From patchwork Fri Oct 20 11:11:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 736231 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp239220wrl; Fri, 20 Oct 2023 04:12:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdjOTiaJ3LKeDWpbUyh9KJP28CIAYBhaFffSpLVQjpON2vtIJS6HX3M8wVz69DV6BdzmJc X-Received: by 2002:a05:620a:6787:b0:778:8b8a:37e with SMTP id rr7-20020a05620a678700b007788b8a037emr1224994qkn.21.1697800344607; Fri, 20 Oct 2023 04:12:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697800344; cv=none; d=google.com; s=arc-20160816; b=IHrClt8u+WxtINE6WZfP+RcmPS9tXFi355qFhSXW/Av5Jq2uZWt13h7rEWK2ANyZuv rrk0iA8s+Il9kGd5TVebOM/NIZibBHENb5gXfp+WMwNLWUvRcAVGJgl7cZnIaCVLxV2n fEZy2uJ1V9XzE4YTb81hCaO4r+nYw1ekM3bsqmREiFvXt84QDlwOhQg2aC9TPC4LDR+U mFfChi7xYTD+gT1LFyX5zGPlZsKXAl8TvyzXkH190BEnuvHR9o3dFS+C0FfysKpaQ7La HLjd74zVNSBWjJ3Xpw/swnV6Mt2hfdGtReBH0TcBytodqYIPwNBNGFjbh81KgGy2JNZQ kFVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xnbl+CEJMh29ntVjs7lWsGl3ZirIDduEVYwzRCUzZKs=; fh=Oeaw5eIlXWtJReDcZc2qxw8Csma8P5wlDOYI+raLocI=; b=M+W9wcw3O8ZAqVw7yJsbWSWpuuzuo3wTfS1gMQ7Q2fnI9h4pIZIuVcwbbKZGQGS104 WuTVJIdP0pVUg42jQ/S9eamvPGmzEYgdaqa7oz490KXLIcYuxC3eZ+RJOkazpBDoR6eu 7MB840GRbDdaulzTrBwYUjXH9kg2Vsuxyk/T+Qc+0iJtmLez59eyeNM6HylGhS/ZNn49 6dUXLyZ3aGXxgEvzE07YIaDLb5DKxlVTHYq3+ZyvuSB24z/Ufh2rqdHKACuKNdASmfy3 WtuCG0ROLZqUgwSo5DRh5YH/4f2UMjcOXkSDe7fztMdE0PsNrbl9spnaQH/1NQ9ZMK6w ZNQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zeBHYyQq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q6-20020a05620a024600b00773f7c8ca33si1077720qkn.126.2023.10.20.04.12.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 04:12:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zeBHYyQq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtnQ0-0006xn-9b; Fri, 20 Oct 2023 07:11:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtnPx-0006ow-VS for qemu-devel@nongnu.org; Fri, 20 Oct 2023 07:11:49 -0400 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtnPv-0002KO-Rz for qemu-devel@nongnu.org; Fri, 20 Oct 2023 07:11:49 -0400 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2c515527310so9756131fa.2 for ; Fri, 20 Oct 2023 04:11:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697800306; x=1698405106; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xnbl+CEJMh29ntVjs7lWsGl3ZirIDduEVYwzRCUzZKs=; b=zeBHYyQqW83D1/r0IgXXCQe//L/ss/X9ETesziI3kfvGTfMd3Lks2/l860Rtnia/fS SuVEPdMBYPYJMcJz2ONyw9BP/nMbbY4eMl7FUaLCe5sPK8xiqVVTJu7709YjBfIhV2sH 1FweOn5Kc+ruqi1M5PNhZ1EPi29sHrQFeuV22uFezlW8CggMm05MusOhyj3RCgteawoN PKUbXmjPlQ7AqmYtikI0q7GmwZY/nGhfpdAJfm7wP3lJEmxoxz1+RcMtPTCzoaSAi7Jg ZzeEQnBj8rHl6+0vjgXxXWPTIHBuQpnEfuVIXxOXc245usA63YVJVM5XvScSm99I3EoG yEGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697800306; x=1698405106; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xnbl+CEJMh29ntVjs7lWsGl3ZirIDduEVYwzRCUzZKs=; b=f/0ViH5p3IqERvgrcBNbpDDqIWun04vb+v9zgegcLVrPY4P2MAtP/D0k3X08XbsgbS GJyZGnO5mwTx7sVL3/kkTZAi8gTzmq4LR62iQQEHCTeXux08hWm9qME5CIqQbdnKSRAn lB6K0QDHB6t3MbWKE5Wdzot4czqFVR/eAcfU1PVPRvTs7jdB421sJ1hw0kP7ZjdsRFD7 AaH5d239u8EJRBz90TEFL4n8IfBvVZ1zDRm75Jk89lXvq8+YtvD7DbS1J1HiDyumEg7a gAoCZD3avKuoSeOsQSc2GsYzbLs6i0j7NX2sUmFaxKSd0RiSGkXaV6OV8DV1VRJ4AXSp XYTA== X-Gm-Message-State: AOJu0Yz3HAHAUXyNlPwl8QQAjtTQmSmt+cf8lTC2v+al2iJ3owZ6tL3s 9OlijhxLzIZYHSBkYNAnUvtTcQCijeUtIDBO3aU= X-Received: by 2002:a05:651c:2111:b0:2c5:1042:b6e8 with SMTP id a17-20020a05651c211100b002c51042b6e8mr1404101ljq.12.1697800305973; Fri, 20 Oct 2023 04:11:45 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id az15-20020a05600c600f00b00406447b798bsm6780865wmb.37.2023.10.20.04.11.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 04:11:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Cameron Esfahani , Zhao Liu , Roman Bolshakov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/3] target/i386/hvf: Use CPUState typedef Date: Fri, 20 Oct 2023 13:11:34 +0200 Message-ID: <20231020111136.44401-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020111136.44401-1-philmd@linaro.org> References: <20231020111136.44401-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=philmd@linaro.org; helo=mail-lj1-x231.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Follow C style guidelines and use CPUState forward declaration from "qemu/typedefs.h". No functional changes. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- target/i386/hvf/x86_emu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c index b1f8a685d1..cd7ef30126 100644 --- a/target/i386/hvf/x86_emu.c +++ b/target/i386/hvf/x86_emu.c @@ -45,7 +45,7 @@ #include "vmcs.h" #include "vmx.h" -void hvf_handle_io(struct CPUState *cpu, uint16_t port, void *data, +void hvf_handle_io(CPUState *cpu, uint16_t port, void *data, int direction, int size, uint32_t count); #define EXEC_2OP_FLAGS_CMD(env, decode, cmd, FLAGS_FUNC, save_res) \ @@ -1417,7 +1417,7 @@ static void init_cmd_handler() } } -void load_regs(struct CPUState *cpu) +void load_regs(CPUState *cpu) { X86CPU *x86_cpu = X86_CPU(cpu); CPUX86State *env = &x86_cpu->env; @@ -1440,7 +1440,7 @@ void load_regs(struct CPUState *cpu) env->eip = rreg(cpu->accel->fd, HV_X86_RIP); } -void store_regs(struct CPUState *cpu) +void store_regs(CPUState *cpu) { X86CPU *x86_cpu = X86_CPU(cpu); CPUX86State *env = &x86_cpu->env; From patchwork Fri Oct 20 11:11:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 736232 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp239363wrl; Fri, 20 Oct 2023 04:12:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+hKpOoWlpfw4h3qjZuscDdMP6uti7YDeWL0ZXMsCgHIUgCL3ljcO+P80MXOPOGjr/h7W6 X-Received: by 2002:a05:622a:18b:b0:41c:b94a:98ac with SMTP id s11-20020a05622a018b00b0041cb94a98acmr1593817qtw.57.1697800367414; Fri, 20 Oct 2023 04:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697800367; cv=none; d=google.com; s=arc-20160816; b=x924DuyQutz8kxACktHGJz6hSHt97DIjhEA+4E4kyz77Fpj/q9OfwL7k7TDKf5nk5F 5Z4JpBBdaDcvDVBUEAMrqC1N+b0MHIidI1OxhtUekXV7C5XOpnNP0+i5JCrYEDGQQ4Uw GJEtRUsxcjqWn0nW4YVMfY8cZa0faClpuQJ6sunjqAx0s2N2wmfmbPvM2Wf7B6tHJL+8 b31j3Ht6PCW+YReBicbPCsn7Q5wWV6CWiJLLRNivS8PCPGLfFQJGhDM2Bm+lkQUwmiyL L4S+PYv/NRj68qX2K2H6gs8iEhECtZ3JA2gWGqadGjibqUUm9MzPf53ZPHKvZcSXMEeC rfZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nWtxXECf6UdxjpnkuP192qOcDL26kcTzh/w6DKsz3YI=; fh=Oeaw5eIlXWtJReDcZc2qxw8Csma8P5wlDOYI+raLocI=; b=cqAegD24dDoHAz0qea4yHaAuYMZiFro4Bxq/1IFYPZH3uHlq8kyv2tj6dFmNu/US7x PqmZvnGij9b+jG7H8szXaLUPJ4dfWM+KosubdnrG69VXCinKuDfekqPaRiwLwTyqe4zE DWP6BeXoOYU7weKWVuOkOnf9t2FkJiBPjTlpKhDRuI/2jt7+V1Qt4w59gHAKmFCWEfo8 a7FfBvNmgL79XCRkySwMKFJffqlCiWKTCupFt4mIBlEyQvj+pENcQPu6MYHoBIrTvJ7w 2+P+q85Z7NjDUa6iELftzkapveLMbgPB6KRH6xzGZANIs1uBClsjnOthXVDjL8wgJESh 6ncA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZS3VLYSX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d11-20020a05622a15cb00b0041cc3fd51a3si1140992qty.13.2023.10.20.04.12.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 04:12:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZS3VLYSX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtnQ4-0007CE-Sc; Fri, 20 Oct 2023 07:11:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtnQ3-00078T-JD for qemu-devel@nongnu.org; Fri, 20 Oct 2023 07:11:55 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtnQ1-0002U5-LK for qemu-devel@nongnu.org; Fri, 20 Oct 2023 07:11:55 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4084095722aso5698795e9.1 for ; Fri, 20 Oct 2023 04:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697800312; x=1698405112; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nWtxXECf6UdxjpnkuP192qOcDL26kcTzh/w6DKsz3YI=; b=ZS3VLYSXqfj7ukM28fC5BYaVsoqbtK8XAGbIRZP8sKTrQjrQ6c212LAqYT5taCo4qv RHbH8Rxvx8w49k+110FFJHqJ/vdACGPCSWpOImN3asL3s9Rv+Yap26LWZ967uMLWph84 sDgFvQ27ZHiyA2dUGg3tqQ+9VYyaXgOlEjMjXodjpnXnMpaVBNVFgGUqY6oCQfmZCT49 9IUNkKTAOybkwfj/Z2P3PqfvZCny9Y26Tzx85xFXwUbr4ZGA5cumGokxcC15ZUVszHOa W/TMAqv+TZ+MxuyC3nLrPocjEI4WsPJ8wfv2ev7gqV+DQwTym9iaQ4k8BKlrR5jqRf4L rVWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697800312; x=1698405112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nWtxXECf6UdxjpnkuP192qOcDL26kcTzh/w6DKsz3YI=; b=Q+5Uz+56SzGU99RyRKa3FC6fqPWdSZ2Lufap6Mf6+E+PuCm+1qM2/iRZLek1lJQ6fV OhS8XdgvuLEQHFkCd4mHY7L8QxOSbEtMMOn3iYyHJsh7gBEGHPK88njF9ZBFssY6Np5w dewpwtPSFGJgQZE9/MhXEGFGw2uSJtpsmQjQS7XWbtwUiNsMEOlXMDGAyF2LT6DDUw8G yRQTm3zFbxhbr+yeVl9pkQy6XicBbAAD92BWqEf5sgAQZirOeeBxE7ocyy+uJUcTYi3G krYbWjEO/6ixjb574nyGFtSDznd0D3dhYPe0LWJD/S9SBvn8LJp5jlYfm41v8XWf+zuN ltxg== X-Gm-Message-State: AOJu0Yyte06D1xG8ccp6dE3RxegZvSGXFI/g5Rk+pxJjmzhWDDTkg0y7 5B6xmWPm0nPRqJRkn6H72n6/lDu3nCbI3BTitnM= X-Received: by 2002:a05:600c:3d87:b0:405:40ec:415d with SMTP id bi7-20020a05600c3d8700b0040540ec415dmr1159296wmb.39.1697800311949; Fri, 20 Oct 2023 04:11:51 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id o12-20020a05600c4fcc00b0040775501256sm1913923wmq.16.2023.10.20.04.11.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 04:11:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Cameron Esfahani , Zhao Liu , Roman Bolshakov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/3] target/i386/hvf: Rename 'CPUState *cpu' variable as 'cs' Date: Fri, 20 Oct 2023 13:11:35 +0200 Message-ID: <20231020111136.44401-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020111136.44401-1-philmd@linaro.org> References: <20231020111136.44401-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Follow the naming used by other files in target/i386/. No functional changes. Suggested-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- target/i386/hvf/x86_emu.c | 92 +++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c index cd7ef30126..5b82e84778 100644 --- a/target/i386/hvf/x86_emu.c +++ b/target/i386/hvf/x86_emu.c @@ -45,7 +45,7 @@ #include "vmcs.h" #include "vmx.h" -void hvf_handle_io(CPUState *cpu, uint16_t port, void *data, +void hvf_handle_io(CPUState *cs, uint16_t port, void *data, int direction, int size, uint32_t count); #define EXEC_2OP_FLAGS_CMD(env, decode, cmd, FLAGS_FUNC, save_res) \ @@ -666,13 +666,13 @@ static void exec_lods(CPUX86State *env, struct x86_decode *decode) void simulate_rdmsr(CPUX86State *env) { X86CPU *x86_cpu = env_archcpu(env); - CPUState *cpu = env_cpu(env); + CPUState *cs = env_cpu(env); uint32_t msr = ECX(env); uint64_t val = 0; switch (msr) { case MSR_IA32_TSC: - val = rdtscp() + rvmcs(cpu->accel->fd, VMCS_TSC_OFFSET); + val = rdtscp() + rvmcs(cs->accel->fd, VMCS_TSC_OFFSET); break; case MSR_IA32_APICBASE: val = cpu_get_apic_base(x86_cpu->apic_state); @@ -681,16 +681,16 @@ void simulate_rdmsr(CPUX86State *env) val = x86_cpu->ucode_rev; break; case MSR_EFER: - val = rvmcs(cpu->accel->fd, VMCS_GUEST_IA32_EFER); + val = rvmcs(cs->accel->fd, VMCS_GUEST_IA32_EFER); break; case MSR_FSBASE: - val = rvmcs(cpu->accel->fd, VMCS_GUEST_FS_BASE); + val = rvmcs(cs->accel->fd, VMCS_GUEST_FS_BASE); break; case MSR_GSBASE: - val = rvmcs(cpu->accel->fd, VMCS_GUEST_GS_BASE); + val = rvmcs(cs->accel->fd, VMCS_GUEST_GS_BASE); break; case MSR_KERNELGSBASE: - val = rvmcs(cpu->accel->fd, VMCS_HOST_FS_BASE); + val = rvmcs(cs->accel->fd, VMCS_HOST_FS_BASE); break; case MSR_STAR: abort(); @@ -745,8 +745,8 @@ void simulate_rdmsr(CPUX86State *env) val = env->mtrr_deftype; break; case MSR_CORE_THREAD_COUNT: - val = cpu->nr_threads * cpu->nr_cores; /* thread count, bits 15..0 */ - val |= ((uint32_t)cpu->nr_cores << 16); /* core count, bits 31..16 */ + val = cs->nr_threads * cs->nr_cores; /* thread count, bits 15..0 */ + val |= ((uint32_t)cs->nr_cores << 16); /* core count, bits 31..16 */ break; default: /* fprintf(stderr, "%s: unknown msr 0x%x\n", __func__, msr); */ @@ -767,7 +767,7 @@ static void exec_rdmsr(CPUX86State *env, struct x86_decode *decode) void simulate_wrmsr(CPUX86State *env) { X86CPU *x86_cpu = env_archcpu(env); - CPUState *cpu = env_cpu(env); + CPUState *cs = env_cpu(env); uint32_t msr = ECX(env); uint64_t data = ((uint64_t)EDX(env) << 32) | EAX(env); @@ -778,13 +778,13 @@ void simulate_wrmsr(CPUX86State *env) cpu_set_apic_base(x86_cpu->apic_state, data); break; case MSR_FSBASE: - wvmcs(cpu->accel->fd, VMCS_GUEST_FS_BASE, data); + wvmcs(cs->accel->fd, VMCS_GUEST_FS_BASE, data); break; case MSR_GSBASE: - wvmcs(cpu->accel->fd, VMCS_GUEST_GS_BASE, data); + wvmcs(cs->accel->fd, VMCS_GUEST_GS_BASE, data); break; case MSR_KERNELGSBASE: - wvmcs(cpu->accel->fd, VMCS_HOST_FS_BASE, data); + wvmcs(cs->accel->fd, VMCS_HOST_FS_BASE, data); break; case MSR_STAR: abort(); @@ -796,10 +796,10 @@ void simulate_wrmsr(CPUX86State *env) abort(); break; case MSR_EFER: - /*printf("new efer %llx\n", EFER(cpu));*/ - wvmcs(cpu->accel->fd, VMCS_GUEST_IA32_EFER, data); + /*printf("new efer %llx\n", EFER(cs));*/ + wvmcs(cs->accel->fd, VMCS_GUEST_IA32_EFER, data); if (data & MSR_EFER_NXE) { - hv_vcpu_invalidate_tlb(cpu->accel->fd); + hv_vcpu_invalidate_tlb(cs->accel->fd); } break; case MSR_MTRRphysBase(0): @@ -848,9 +848,9 @@ void simulate_wrmsr(CPUX86State *env) /* Related to support known hypervisor interface */ /* if (g_hypervisor_iface) - g_hypervisor_iface->wrmsr_handler(cpu, msr, data); + g_hypervisor_iface->wrmsr_handler(cs, msr, data); - printf("write msr %llx\n", RCX(cpu));*/ + printf("write msr %llx\n", RCX(cs));*/ } static void exec_wrmsr(CPUX86State *env, struct x86_decode *decode) @@ -1417,56 +1417,56 @@ static void init_cmd_handler() } } -void load_regs(CPUState *cpu) +void load_regs(CPUState *cs) { - X86CPU *x86_cpu = X86_CPU(cpu); + X86CPU *x86_cpu = X86_CPU(cs); CPUX86State *env = &x86_cpu->env; int i = 0; - RRX(env, R_EAX) = rreg(cpu->accel->fd, HV_X86_RAX); - RRX(env, R_EBX) = rreg(cpu->accel->fd, HV_X86_RBX); - RRX(env, R_ECX) = rreg(cpu->accel->fd, HV_X86_RCX); - RRX(env, R_EDX) = rreg(cpu->accel->fd, HV_X86_RDX); - RRX(env, R_ESI) = rreg(cpu->accel->fd, HV_X86_RSI); - RRX(env, R_EDI) = rreg(cpu->accel->fd, HV_X86_RDI); - RRX(env, R_ESP) = rreg(cpu->accel->fd, HV_X86_RSP); - RRX(env, R_EBP) = rreg(cpu->accel->fd, HV_X86_RBP); + RRX(env, R_EAX) = rreg(cs->accel->fd, HV_X86_RAX); + RRX(env, R_EBX) = rreg(cs->accel->fd, HV_X86_RBX); + RRX(env, R_ECX) = rreg(cs->accel->fd, HV_X86_RCX); + RRX(env, R_EDX) = rreg(cs->accel->fd, HV_X86_RDX); + RRX(env, R_ESI) = rreg(cs->accel->fd, HV_X86_RSI); + RRX(env, R_EDI) = rreg(cs->accel->fd, HV_X86_RDI); + RRX(env, R_ESP) = rreg(cs->accel->fd, HV_X86_RSP); + RRX(env, R_EBP) = rreg(cs->accel->fd, HV_X86_RBP); for (i = 8; i < 16; i++) { - RRX(env, i) = rreg(cpu->accel->fd, HV_X86_RAX + i); + RRX(env, i) = rreg(cs->accel->fd, HV_X86_RAX + i); } - env->eflags = rreg(cpu->accel->fd, HV_X86_RFLAGS); + env->eflags = rreg(cs->accel->fd, HV_X86_RFLAGS); rflags_to_lflags(env); - env->eip = rreg(cpu->accel->fd, HV_X86_RIP); + env->eip = rreg(cs->accel->fd, HV_X86_RIP); } -void store_regs(CPUState *cpu) +void store_regs(CPUState *cs) { - X86CPU *x86_cpu = X86_CPU(cpu); + X86CPU *x86_cpu = X86_CPU(cs); CPUX86State *env = &x86_cpu->env; int i = 0; - wreg(cpu->accel->fd, HV_X86_RAX, RAX(env)); - wreg(cpu->accel->fd, HV_X86_RBX, RBX(env)); - wreg(cpu->accel->fd, HV_X86_RCX, RCX(env)); - wreg(cpu->accel->fd, HV_X86_RDX, RDX(env)); - wreg(cpu->accel->fd, HV_X86_RSI, RSI(env)); - wreg(cpu->accel->fd, HV_X86_RDI, RDI(env)); - wreg(cpu->accel->fd, HV_X86_RBP, RBP(env)); - wreg(cpu->accel->fd, HV_X86_RSP, RSP(env)); + wreg(cs->accel->fd, HV_X86_RAX, RAX(env)); + wreg(cs->accel->fd, HV_X86_RBX, RBX(env)); + wreg(cs->accel->fd, HV_X86_RCX, RCX(env)); + wreg(cs->accel->fd, HV_X86_RDX, RDX(env)); + wreg(cs->accel->fd, HV_X86_RSI, RSI(env)); + wreg(cs->accel->fd, HV_X86_RDI, RDI(env)); + wreg(cs->accel->fd, HV_X86_RBP, RBP(env)); + wreg(cs->accel->fd, HV_X86_RSP, RSP(env)); for (i = 8; i < 16; i++) { - wreg(cpu->accel->fd, HV_X86_RAX + i, RRX(env, i)); + wreg(cs->accel->fd, HV_X86_RAX + i, RRX(env, i)); } lflags_to_rflags(env); - wreg(cpu->accel->fd, HV_X86_RFLAGS, env->eflags); - macvm_set_rip(cpu, env->eip); + wreg(cs->accel->fd, HV_X86_RFLAGS, env->eflags); + macvm_set_rip(cs, env->eip); } bool exec_instruction(CPUX86State *env, struct x86_decode *ins) { - /*if (hvf_vcpu_id(cpu)) - printf("%d, %llx: exec_instruction %s\n", hvf_vcpu_id(cpu), env->eip, + /*if (hvf_vcpu_id(cs)) + printf("%d, %llx: exec_instruction %s\n", hvf_vcpu_id(cs), env->eip, decode_cmd_to_string(ins->cmd));*/ if (!_cmd_handler[ins->cmd].handler) { From patchwork Fri Oct 20 11:11:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 736229 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp239219wrl; Fri, 20 Oct 2023 04:12:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/NUDm45s++VCaDuFAOsx5lTYF8nCArwTfkm5DTZT7lJkoF1yHD+SVWcXyw/BJEr/aLVJs X-Received: by 2002:a05:620a:254c:b0:76e:f804:1532 with SMTP id s12-20020a05620a254c00b0076ef8041532mr1401509qko.33.1697800344483; Fri, 20 Oct 2023 04:12:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697800344; cv=none; d=google.com; s=arc-20160816; b=d4kac8RfzTQyo7xWiC5UzmnIf+cqzkDM1JH3M0ncNdNmy0QwDIcF8rbN2LnQ5wkbBN GXVy+V8pngmK+WpulrqHjvjH8rUaCRzJFfwXHZvTkzmFo40pYPVKdeb39ir1Eojv5CJA UlIJUbkg+EBaEqZIFJEemTpwbBq/DaPEauT0rMSrlPwz9pxW/N0/visnxSXQ8t7Y0Xm2 jdIkhD2ywsG4qgoZTuCC172EWXucTluXX/HZb8ahPUJRC33U+M8hWKxT7SJkvAD0u3SC r5PvxAKL1t8tLhM03yETbionbHxg8sTAKOTU/3f5B+xQDeqsAewWT9rAMlVaIIV931cV qauw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dKz6RVZSJf4qXCa2lKtHPOtLSVsJlJBrb9RFA879h2M=; fh=Oeaw5eIlXWtJReDcZc2qxw8Csma8P5wlDOYI+raLocI=; b=vVR/LoV3zX0KgUv8VM1f4R/DHxi/05IdRKYIURf9Cx2ImTgno3oGb8qzcOMQie+STP 21g/7W2ajeWlDCkOp76ZfAYiSZHkEnusDs5Tzm+spBWZscampAb8zgQ57HeiWf1iObVi CL64D5Ky8l8B4tPCtjiaqNp/iOQSMFEvQBNHpYFofGuwW0fM5kcqf8LiOpW9i3oUILC3 N8a83l1y/s1DsKiAFzTzag8lZRwG3zwR9ZUEqElNqSKXCeNYVXn8/OJj4d3CZqVFg+x0 /bXHcqAqs0v5JV7EE9sJjQo7JAnoXZ3ezpvINteWQzypUALYKnraK6tE4bv2RW2FiOdj mMiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sgHS3uTr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j20-20020a05620a0a5400b007708bdf66f3si1060895qka.766.2023.10.20.04.12.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 04:12:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sgHS3uTr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtnQF-0007Gc-Nh; Fri, 20 Oct 2023 07:12:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtnQ9-0007DB-LD for qemu-devel@nongnu.org; Fri, 20 Oct 2023 07:12:04 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtnQ7-0002ak-UP for qemu-devel@nongnu.org; Fri, 20 Oct 2023 07:12:01 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-507bd644a96so941838e87.3 for ; Fri, 20 Oct 2023 04:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697800318; x=1698405118; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dKz6RVZSJf4qXCa2lKtHPOtLSVsJlJBrb9RFA879h2M=; b=sgHS3uTrI754IYwy/y5qPdrWANY+c52p+vbifdoOLzu23WyoRgkSER/xKTGcz6ySw1 qGJzjIzBEy6/EQWSwsscaXeo7Ggp9eKCs3IP8Yl6uzuKgsVskR4BtqVuMrtOEotjx5E4 W+zU7NveojfVGT46YcUQBiqGDkuCDUOQxZmXT9zJFTMrRNYomROwheFPVIfOhQunkm0N rHGOC9Vkh+GgbTSOL7SHl3dEHeKUs1SYgKcHsz1SGmirvFBAE34osQ/DAfn3T9ZDbXyo hzDvO8s1YEeYgk+GNIDu0GA0racPKFCupp4JD+JQwosIvlaHZMZ4snPOv5HXetTQ+74J zImg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697800318; x=1698405118; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dKz6RVZSJf4qXCa2lKtHPOtLSVsJlJBrb9RFA879h2M=; b=EfFXQEtXlYlcOkuiuIYk5u9kgmdfjkvM8l/mPxkugc4+WbEDbLlLrjRqy3PZzaqcJN TRMQFts9HGXaO0PgJom4GavKxrFq1GbiFnBoHfmw/oUt+SJ/vbz8pvg2oJjmH+fABqYs E0wwWSc8ZwrYE0fOurSqemZvhgzNIuzNxC97j5FrR+WuAxDmLgjoF0P+tU9BcVTFRHZA vAtn12QJ3IbovjXU1Br8CIQXyrqmJ9endJL1x2vpvAxgg2uiB/h6IxFF2uo3lKDsNDE0 vcDZH65p0Hw5wbXVbmjL2HBlQpkbJ3dmoABe/dVyzEt5NpF9OpmHV8wJXVvKtd4ts/n9 ZKYQ== X-Gm-Message-State: AOJu0YyZ7VHrr8dTMkRX/tyvh4q+nLS1vbH2SndzjuSkr3nVDfCj+4nv 1WDhMQd7ADfPUTJfmRJFWes8PlS01dJO1mLq1hU= X-Received: by 2002:ac2:5233:0:b0:506:899d:1994 with SMTP id i19-20020ac25233000000b00506899d1994mr977816lfl.52.1697800317978; Fri, 20 Oct 2023 04:11:57 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b0032d2f09d991sm1461745wrn.33.2023.10.20.04.11.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 04:11:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Cameron Esfahani , Zhao Liu , Roman Bolshakov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/3] target/i386/hvf: Rename 'X86CPU *x86_cpu' variable as 'cpu' Date: Fri, 20 Oct 2023 13:11:36 +0200 Message-ID: <20231020111136.44401-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020111136.44401-1-philmd@linaro.org> References: <20231020111136.44401-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Follow the naming used by other files in target/i386/. No functional changes. Suggested-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- target/i386/hvf/x86_emu.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c index 5b82e84778..3a3f0a50d0 100644 --- a/target/i386/hvf/x86_emu.c +++ b/target/i386/hvf/x86_emu.c @@ -665,7 +665,7 @@ static void exec_lods(CPUX86State *env, struct x86_decode *decode) void simulate_rdmsr(CPUX86State *env) { - X86CPU *x86_cpu = env_archcpu(env); + X86CPU *cpu = env_archcpu(env); CPUState *cs = env_cpu(env); uint32_t msr = ECX(env); uint64_t val = 0; @@ -675,10 +675,10 @@ void simulate_rdmsr(CPUX86State *env) val = rdtscp() + rvmcs(cs->accel->fd, VMCS_TSC_OFFSET); break; case MSR_IA32_APICBASE: - val = cpu_get_apic_base(x86_cpu->apic_state); + val = cpu_get_apic_base(cpu->apic_state); break; case MSR_IA32_UCODE_REV: - val = x86_cpu->ucode_rev; + val = cpu->ucode_rev; break; case MSR_EFER: val = rvmcs(cs->accel->fd, VMCS_GUEST_IA32_EFER); @@ -766,7 +766,7 @@ static void exec_rdmsr(CPUX86State *env, struct x86_decode *decode) void simulate_wrmsr(CPUX86State *env) { - X86CPU *x86_cpu = env_archcpu(env); + X86CPU *cpu = env_archcpu(env); CPUState *cs = env_cpu(env); uint32_t msr = ECX(env); uint64_t data = ((uint64_t)EDX(env) << 32) | EAX(env); @@ -775,7 +775,7 @@ void simulate_wrmsr(CPUX86State *env) case MSR_IA32_TSC: break; case MSR_IA32_APICBASE: - cpu_set_apic_base(x86_cpu->apic_state, data); + cpu_set_apic_base(cpu->apic_state, data); break; case MSR_FSBASE: wvmcs(cs->accel->fd, VMCS_GUEST_FS_BASE, data); @@ -1419,8 +1419,8 @@ static void init_cmd_handler() void load_regs(CPUState *cs) { - X86CPU *x86_cpu = X86_CPU(cs); - CPUX86State *env = &x86_cpu->env; + X86CPU *cpu = X86_CPU(cs); + CPUX86State *env = &cpu->env; int i = 0; RRX(env, R_EAX) = rreg(cs->accel->fd, HV_X86_RAX); @@ -1442,8 +1442,8 @@ void load_regs(CPUState *cs) void store_regs(CPUState *cs) { - X86CPU *x86_cpu = X86_CPU(cs); - CPUX86State *env = &x86_cpu->env; + X86CPU *cpu = X86_CPU(cs); + CPUX86State *env = &cpu->env; int i = 0; wreg(cs->accel->fd, HV_X86_RAX, RAX(env));