From nobody Tue Feb 10 02:43:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614795787; cv=none; d=zohomail.com; s=zohoarc; b=Kn0VpHKigt25vv+EcK+uz19I3S8dB/1g+nTB0DOQioEHEZJAz+n0rzCGUA6oydHUV/gLc/WGcbHqua60XeQhQAi7ECFO6qemiFfH1I7NdswWgv07s3stJ9wMBPK/wh0WvkdATQwpXarj4A8d6BP6WLdVmWmcw1qsJpk1dEWvUwM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614795787; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=JSKZ4U4zBdXHSKAtMYPcidB9tymokaAa3vsPtMUAjQM=; b=cjpTmmtVfQfLznVeWub13qjbJrXBrlF2KxwHs/7o6o+9FhX/QJnhm2EYQzF3rAmkAdPjYPjEzW1UHUkNCJV9YEsYa3yqfR56ctmPAQqh37359wqhp0CwZC6kRWIM9npguTi+zbhTh3H8xoLH/5KFajmb6x99/cpbdYQuyiD8Ooc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 16147957872581015.013340261742; Wed, 3 Mar 2021 10:23:07 -0800 (PST) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-523-kimLJzeCPn2iQvx6nPajwQ-1; Wed, 03 Mar 2021 13:23:02 -0500 Received: by mail-wm1-f70.google.com with SMTP id 73so3358667wma.3 for ; Wed, 03 Mar 2021 10:23:02 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id a131sm6749075wmc.48.2021.03.03.10.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 10:23:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614795786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JSKZ4U4zBdXHSKAtMYPcidB9tymokaAa3vsPtMUAjQM=; b=fAuXMcBm5NKSBkUQfzdpXkaF7H7xUE/u0rvJQhL6HkGkNQTdu/5C+l3sHuG2AtbBzrYp63 GZAzcNYI2MrnUrqxxgxhfpI4qb2DaB9R9yJFI9T6r4mMyyQR+Uo3LeLDqj3icYkJpZ64yn R4AK9HtgC6mfFHq5NzHP6ta4xfTZUJc= X-MC-Unique: kimLJzeCPn2iQvx6nPajwQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JSKZ4U4zBdXHSKAtMYPcidB9tymokaAa3vsPtMUAjQM=; b=VZDJg47P+ofSN+C4dnr8xBkmBryeySt7WOE4WtQBvQzEsLcudjSc6TvbNDmCwE4AKP ckHRGvw0M2Q2MDSwWm1iX2wunAy8I/TLMhGtdf6rrbmYCU/qKnw/C2uMJVO+xKC9+TcK W5terCJz190V3kWyMmFV2Sp5682++w4DI6wBNOmioyWEn4QmP9D9UQfH/FSNqWqCI9M0 HhEk40pGlF8JwT7D2vqI7469qKFMkP8az96jcolNH5meCEfrzy3pS2loMXReKcDJIXJ6 10P/rOoMJg9kPNOTERrMzhA8ATbXERiltbFKxunV2wH73dbOTuMu6MkBHn8Onq5F1Y0Q u/LQ== X-Gm-Message-State: AOAM531ceQxFowkLxPImy09a05uw9XJkzWCUmuyCFeePb4gSfavl+ez7 W8thKFSYcsKm2yqj1HKJBslm7A8QTeUrmawh4larRg70LwkbzMNKxpAoVKhfzMYCacSi1+WEFlJ ACxUPkWGMrrsg/A== X-Received: by 2002:a05:600c:4ec7:: with SMTP id g7mr295364wmq.56.1614795781334; Wed, 03 Mar 2021 10:23:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkfTopuTz8+rr5+ZCkXuINfRYff1lmKq7JTlmgWuTa8IXYSH/Sikf55e2yiTGalQ+YvZXOhQ== X-Received: by 2002:a05:600c:4ec7:: with SMTP id g7mr295331wmq.56.1614795781060; Wed, 03 Mar 2021 10:23:01 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Cornelia Huck , Richard Henderson , Sunil Muthuswamy , Marcelo Tosatti , David Gibson , Marcel Apfelbaum , kvm@vger.kernel.org, Wenchao Wang , Thomas Huth , Cameron Esfahani , Paolo Bonzini , David Hildenbrand , Roman Bolshakov , Peter Maydell , Greg Kurz , qemu-arm@nongnu.org, Halil Pasic , Colin Xu , Claudio Fontana , qemu-ppc@nongnu.org, Christian Borntraeger , qemu-s390x@nongnu.org, haxm-team@intel.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 06/19] accel/whpx: Add typedef for 'struct whpx_vcpu' Date: Wed, 3 Mar 2021 19:22:06 +0100 Message-Id: <20210303182219.1631042-7-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210303182219.1631042-1-philmd@redhat.com> References: <20210303182219.1631042-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Use the 'whpx_vcpu' typedef instead of 'struct whpx_vcpu'. This will make the next commits easier to review. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/whpx/whpx-all.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index f0a35df3bba..6469e388b6d 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -148,6 +148,8 @@ struct whpx_register_set { WHV_REGISTER_VALUE values[RTL_NUMBER_OF(whpx_register_names)]; }; =20 +typedef struct whpx_vcpu whpx_vcpu; + struct whpx_vcpu { WHV_EMULATOR_HANDLE emulator; bool window_registered; @@ -173,9 +175,9 @@ struct WHPDispatch whp_dispatch; * VP support */ =20 -static struct whpx_vcpu *get_whpx_vcpu(CPUState *cpu) +static whpx_vcpu *get_whpx_vcpu(CPUState *cpu) { - return (struct whpx_vcpu *)cpu->hax_vcpu; + return (whpx_vcpu *)cpu->hax_vcpu; } =20 static WHV_X64_SEGMENT_REGISTER whpx_seg_q2h(const SegmentCache *qs, int v= 86, @@ -259,7 +261,7 @@ static int whpx_set_tsc(CPUState *cpu) 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); + whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); struct CPUX86State *env =3D (CPUArchState *)(cpu->env_ptr); X86CPU *x86_cpu =3D X86_CPU(cpu); struct whpx_register_set vcxt; @@ -448,7 +450,7 @@ static int whpx_get_tsc(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); + whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); struct CPUX86State *env =3D (CPUArchState *)(cpu->env_ptr); X86CPU *x86_cpu =3D X86_CPU(cpu); struct whpx_register_set vcxt; @@ -712,7 +714,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); + whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); WHV_EMULATOR_STATUS emu_status; =20 hr =3D whp_dispatch.WHvEmulatorTryMmioEmulation( @@ -737,7 +739,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); + whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); WHV_EMULATOR_STATUS emu_status; =20 hr =3D whp_dispatch.WHvEmulatorTryIoEmulation( @@ -780,7 +782,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); + whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); struct CPUX86State *env =3D (CPUArchState *)(cpu->env_ptr); X86CPU *x86_cpu =3D X86_CPU(cpu); int irq; @@ -902,7 +904,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); + whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); struct CPUX86State *env =3D (CPUArchState *)(cpu->env_ptr); X86CPU *x86_cpu =3D X86_CPU(cpu); =20 @@ -929,7 +931,7 @@ static void whpx_vcpu_process_async_events(CPUState *cp= u) { struct CPUX86State *env =3D (CPUArchState *)(cpu->env_ptr); X86CPU *x86_cpu =3D X86_CPU(cpu); - struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); + whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); =20 if ((cpu->interrupt_request & CPU_INTERRUPT_INIT) && !(env->hflags & HF_SMM_MASK)) { @@ -968,7 +970,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); + whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); int ret; =20 whpx_vcpu_process_async_events(cpu); @@ -1331,7 +1333,7 @@ int whpx_init_vcpu(CPUState *cpu) { HRESULT hr; struct whpx_state *whpx =3D &whpx_global; - struct whpx_vcpu *vcpu =3D NULL; + whpx_vcpu *vcpu =3D NULL; Error *local_error =3D NULL; struct CPUX86State *env =3D (CPUArchState *)(cpu->env_ptr); X86CPU *x86_cpu =3D X86_CPU(cpu); @@ -1356,7 +1358,7 @@ int whpx_init_vcpu(CPUState *cpu) } } =20 - vcpu =3D g_malloc0(sizeof(struct whpx_vcpu)); + vcpu =3D g_malloc0(sizeof(whpx_vcpu)); =20 if (!vcpu) { error_report("WHPX: Failed to allocte VCPU context."); @@ -1475,7 +1477,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); + whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); =20 whp_dispatch.WHvDeleteVirtualProcessor(whpx->partition, cpu->cpu_index= ); whp_dispatch.WHvEmulatorDestroyEmulator(vcpu->emulator); --=20 2.26.2