From nobody Mon Feb 9 17:59:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1687628676; cv=none; d=zohomail.com; s=zohoarc; b=lboOJMW3lPICDNhMYhXu4k3osT+UqzPYm/wp8XiCmy7AM/y55ZqB3aqjNaiB8pBjDXe2dhx9tPJQQ8FeKLKsPgu/ItjQLm7V2WsfSXJ33lvnL2ZpVq1oeQ+ZksXptEkvoa0RbCPwcODwi+frr6lb+7QAvi9e1ub+w2AwHcjJqIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687628676; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=F3YC9GFHrwXVDf1ItgmDmu2S/mgeY2SHKESPMbekbhg=; b=GbcyRWRX9y1PefrAsQpMXoNEdakx/jGPewrbxDoMctil0w+OcJHtTm6T6DPEkVE5NRjAo9lPYOL79wu5TFUVoCPv4DYHY8jckTb5GvXNHo/DDNVGLgCWzqKzvO0na/ilfDUlqsZYmWZ6lxLwWitapzK5FRtMlmjIRyDu1wI8PeE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1687628676722406.2020443645122; Sat, 24 Jun 2023 10:44:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qD7I2-0000WX-5P; Sat, 24 Jun 2023 13:43:14 -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 1qD7Ht-0000N0-5M for qemu-devel@nongnu.org; Sat, 24 Jun 2023 13:43:05 -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 1qD7Hr-0007gm-4A for qemu-devel@nongnu.org; Sat, 24 Jun 2023 13:43:04 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fa79605a3bso15801675e9.0 for ; Sat, 24 Jun 2023 10:43:02 -0700 (PDT) Received: from m1x-phil.lan ([176.187.217.150]) by smtp.gmail.com with ESMTPSA id x24-20020a05600c21d800b003f858ae8f9dsm5627374wmj.31.2023.06.24.10.42.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 24 Jun 2023 10:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687628581; x=1690220581; 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=F3YC9GFHrwXVDf1ItgmDmu2S/mgeY2SHKESPMbekbhg=; b=ISbZ7BY9b4/Aq+EjBk8eGpZlBPuqZIMbCL1Z2KOFPMZz5ox8oBaCrkDc4FubFKawGY 1tL2W1BGOVdUJvioaccKvPFxa0fEaw7zU/sU/n+FO2BpC/1IPS2fD/EtnxEeMc5v/tPg VwJX1jKjSp14BD9fIrvVzF/tQyR/m/xhTXl78ZfsDcfFUGIsFaXjG37CDoNuPmVipyz6 TINz55AJXSQbJ3aFJm4lg1dDwZMk2T/PkUao90+jkPyulQ+K2D88yQgTzzMeJPYQvf8G 3ti4QnkgoEQLWxpgFzIGE6kJzwKx6tnpeaUv8ETipQZdlWQyYpmoT8rKxNFuLXCiunZb t+uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687628581; x=1690220581; 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=F3YC9GFHrwXVDf1ItgmDmu2S/mgeY2SHKESPMbekbhg=; b=ZpPVZvRSIYMDt0ZAgO2ars0/U9JZB/xUpt+dYLCf+mc0pDgnCc31Gbbmqaa1oOo5mP g0cIwd4x7rsyKNX/58s9WYRAfp4kCVVpk9502KfCPSH+0Fa9waHNLJaPPMAimbKrocxO RXxLR3VA+pgl0G7o/b55t6gQ7DqcNHssDdCeCDfDNiyRZcX8cyFV1aQDseEXbbhK8NO0 PzsFQDAZfEbXB9ukMJYLkUVfbnXGMRaq/JVxP2dby01ON4dZpr/FIsrloD1OZSKXm72Z IwXr8lPKNNr3M6Bw51rMjtm0sFA8AjG77fIYnyVIgC4LLu/C2+eCnEdDu4/fJwhn2jy2 txBw== X-Gm-Message-State: AC+VfDyyUUHhBmv/DZs+cDAZ0fKvdCObsDMY7EoWALv1hBADG/c+knRD aCRyE6XiaqJHSKb1sZx1tIFMrc489fAu1NdzZbg= X-Google-Smtp-Source: ACHHUZ6x1kJtmnLWyDej5xX9yS3xNdJXqxD8xkB+g+E8OEa6HcSaTMV73YfM1pIWCauIJs3hjcdCpQ== X-Received: by 2002:a7b:cb04:0:b0:3f7:ecdf:ab2d with SMTP id u4-20020a7bcb04000000b003f7ecdfab2dmr24480622wmj.20.1687628581315; Sat, 24 Jun 2023 10:43:01 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, Marcel Apfelbaum , Peter Maydell , Roman Bolshakov , qemu-arm@nongnu.org, Richard Henderson , Alexander Graf , xen-devel@lists.xenproject.org, Sunil Muthuswamy , Anthony Perard , Stefano Stabellini , Yanan Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paul Durrant , Reinoud Zandijk , Eduardo Habkost , Cameron Esfahani , Paolo Bonzini Subject: [PATCH v3 13/16] accel: Rename WHPX 'struct whpx_vcpu' -> AccelCPUState Date: Sat, 24 Jun 2023 19:41:18 +0200 Message-Id: <20230624174121.11508-14-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230624174121.11508-1-philmd@linaro.org> References: <20230624174121.11508-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1687628678299100001 We want all accelerators to share the same opaque pointer in CPUState. Rename WHPX 'whpx_vcpu' as 'AccelCPUState'; use the typedef. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/i386/whpx/whpx-all.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index cad7bd0f88..4ddd2d076a 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -229,7 +229,7 @@ typedef enum WhpxStepMode { WHPX_STEP_EXCLUSIVE, } WhpxStepMode; =20 -struct whpx_vcpu { +struct AccelCPUState { WHV_EMULATOR_HANDLE emulator; bool window_registered; bool interruptable; @@ -260,9 +260,9 @@ static bool whpx_has_xsave(void) * VP support */ =20 -static struct whpx_vcpu *get_whpx_vcpu(CPUState *cpu) +static AccelCPUState *get_whpx_vcpu(CPUState *cpu) { - return (struct whpx_vcpu *)cpu->accel; + return (AccelCPUState *)cpu->accel; } =20 static WHV_X64_SEGMENT_REGISTER whpx_seg_q2h(const SegmentCache *qs, int v= 86, @@ -390,7 +390,7 @@ static uint64_t whpx_cr8_to_apic_tpr(uint64_t cr8) static void whpx_set_registers(CPUState *cpu, int level) { struct whpx_state *whpx =3D &whpx_global; - struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); + AccelCPUState *vcpu =3D get_whpx_vcpu(cpu); CPUX86State *env =3D cpu->env_ptr; X86CPU *x86_cpu =3D X86_CPU(cpu); struct whpx_register_set vcxt; @@ -609,7 +609,7 @@ static void whpx_get_xcrs(CPUState *cpu) static void whpx_get_registers(CPUState *cpu) { struct whpx_state *whpx =3D &whpx_global; - struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); + AccelCPUState *vcpu =3D get_whpx_vcpu(cpu); CPUX86State *env =3D cpu->env_ptr; X86CPU *x86_cpu =3D X86_CPU(cpu); struct whpx_register_set vcxt; @@ -892,7 +892,7 @@ static const WHV_EMULATOR_CALLBACKS whpx_emu_callbacks = =3D { static int whpx_handle_mmio(CPUState *cpu, WHV_MEMORY_ACCESS_CONTEXT *ctx) { HRESULT hr; - struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); + AccelCPUState *vcpu =3D get_whpx_vcpu(cpu); WHV_EMULATOR_STATUS emu_status; =20 hr =3D whp_dispatch.WHvEmulatorTryMmioEmulation( @@ -917,7 +917,7 @@ static int whpx_handle_portio(CPUState *cpu, WHV_X64_IO_PORT_ACCESS_CONTEXT *ctx) { HRESULT hr; - struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); + AccelCPUState *vcpu =3D get_whpx_vcpu(cpu); WHV_EMULATOR_STATUS emu_status; =20 hr =3D whp_dispatch.WHvEmulatorTryIoEmulation( @@ -1417,7 +1417,7 @@ static vaddr whpx_vcpu_get_pc(CPUState *cpu, bool exi= t_context_valid) * of QEMU, nor this port by calling WHvSetVirtualProcessorRegiste= rs(). * This is the most common case. */ - struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); + AccelCPUState *vcpu =3D get_whpx_vcpu(cpu); return vcpu->exit_ctx.VpContext.Rip; } else { /* @@ -1468,7 +1468,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) { HRESULT hr; struct whpx_state *whpx =3D &whpx_global; - struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); + AccelCPUState *vcpu =3D get_whpx_vcpu(cpu); CPUX86State *env =3D cpu->env_ptr; X86CPU *x86_cpu =3D X86_CPU(cpu); int irq; @@ -1590,7 +1590,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) =20 static void whpx_vcpu_post_run(CPUState *cpu) { - struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); + AccelCPUState *vcpu =3D get_whpx_vcpu(cpu); CPUX86State *env =3D cpu->env_ptr; X86CPU *x86_cpu =3D X86_CPU(cpu); =20 @@ -1617,7 +1617,7 @@ static void whpx_vcpu_process_async_events(CPUState *= cpu) { CPUX86State *env =3D cpu->env_ptr; X86CPU *x86_cpu =3D X86_CPU(cpu); - struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); + AccelCPUState *vcpu =3D get_whpx_vcpu(cpu); =20 if ((cpu->interrupt_request & CPU_INTERRUPT_INIT) && !(env->hflags & HF_SMM_MASK)) { @@ -1656,7 +1656,7 @@ static int whpx_vcpu_run(CPUState *cpu) { HRESULT hr; struct whpx_state *whpx =3D &whpx_global; - struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); + AccelCPUState *vcpu =3D get_whpx_vcpu(cpu); struct whpx_breakpoint *stepped_over_bp =3D NULL; WhpxStepMode exclusive_step_mode =3D WHPX_STEP_NONE; int ret; @@ -2154,7 +2154,7 @@ int whpx_init_vcpu(CPUState *cpu) { HRESULT hr; struct whpx_state *whpx =3D &whpx_global; - struct whpx_vcpu *vcpu =3D NULL; + AccelCPUState *vcpu =3D NULL; Error *local_error =3D NULL; CPUX86State *env =3D cpu->env_ptr; X86CPU *x86_cpu =3D X86_CPU(cpu); @@ -2177,7 +2177,7 @@ int whpx_init_vcpu(CPUState *cpu) } } =20 - vcpu =3D g_new0(struct whpx_vcpu, 1); + vcpu =3D g_new0(AccelCPUState, 1); =20 hr =3D whp_dispatch.WHvEmulatorCreateEmulator( &whpx_emu_callbacks, @@ -2290,7 +2290,7 @@ int whpx_vcpu_exec(CPUState *cpu) void whpx_destroy_vcpu(CPUState *cpu) { struct whpx_state *whpx =3D &whpx_global; - struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); + AccelCPUState *vcpu =3D get_whpx_vcpu(cpu); =20 whp_dispatch.WHvDeleteVirtualProcessor(whpx->partition, cpu->cpu_index= ); whp_dispatch.WHvEmulatorDestroyEmulator(vcpu->emulator); --=20 2.38.1