From nobody Tue Feb 10 08:26:39 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=1614795808; cv=none; d=zohomail.com; s=zohoarc; b=msyKdp0MIrpbV0vvD4uoUto9rpD6b9fgdtzn/tHlrFrZSowzqP//3whV73a71h+XxogjmHJoDj2zEgKpPFqv33muxvzONY7c3IHWpi+3+lN3f4HQnOoYDvEl0kd2MeGldNhEg8bjjer1G+2LOIhYpxy8fJCXnxUa3BLpC9AZPBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614795808; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=bsBSf6h5clRIGLmrmL5o7OQtiQ2QaVSKYYOrh/pYYJA=; b=DWy8ANyXmcsX03HVsmRDIsYdeUPq5DfYl9JXWB7X2oWta+f/6QcgX/YBQtz+xmn6V7/Hq9knZHLMFjv7LeinwVgzuhrnWDb2UT6IVKAtw4GL92t6ZH140yBYe/tzs3l4byESX4ZAcLSaSV4vJD4SOzgzC9/EvON4xugQVxABEzI= 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 1614795808607296.28271259151825; Wed, 3 Mar 2021 10:23:28 -0800 (PST) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-103-Lh9Eo1yPN8eIjO-jrVWlRQ-1; Wed, 03 Mar 2021 13:23:24 -0500 Received: by mail-wr1-f69.google.com with SMTP id g5so13094908wrd.22 for ; Wed, 03 Mar 2021 10:23:23 -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 n6sm13487477wrt.1.2021.03.03.10.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 10:23:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614795807; 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=bsBSf6h5clRIGLmrmL5o7OQtiQ2QaVSKYYOrh/pYYJA=; b=PANQgGiYSt8FNfaQVtPVtrYiYU7F3TJqqyF1pjyxZOzqvNLmVQ6tLYqd4KQqQukpoTQIB5 BfuIV6E5ZUbColk2qOLsNnl8jfhJ9qfGGJ5e4HOhDzd164huRfcLsEwmnpoLhvEpwID0je q9nQgYNaRICHgc7kABeoO9tWgXfcyac= X-MC-Unique: Lh9Eo1yPN8eIjO-jrVWlRQ-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=bsBSf6h5clRIGLmrmL5o7OQtiQ2QaVSKYYOrh/pYYJA=; b=LMp2qI1djVriS2zxPVAKAi9QXa1bJ96aKY0kEkBrXm4UzC1NiqCEQ9vn+zNX1TZytl E2frnWslXsrt+Is+52+GKRaL7PuEyX/GKGSnushcPfkZdzpz8wBG7BzX8vowORtovu/o R39Cqu9Ds25+xcBGQXDOkQKaJhb/dbkoTUlDjvK0ErIM8kNf5tbmtAZVkX4oG0GURETa PR6kQGbuji5FCHzQq3x4n+7JZEdROeuTVnG3fq0FzVRaocSXQldvpTte6u1x7hUQ6drd SBxifGcJEXZpXs1/4B1rjBx7xW7HR43PbCDj7LmgXltLaNMyl15QE/2dtHTgyN6xBs4s 1fbg== X-Gm-Message-State: AOAM531puJNWVgGmDyH+0ne7rWRlNxWWFS87fjM9z7q19Q+akwS3ih/A roNb1v8w8dzwmDVzMOb6nqlW8dG6yGSjS3BtwQy/Qt3LQTSlqk7vYMf6k4wG/s9qUMcDKFNjXQk FDJ6TjHNo9bLOEQ== X-Received: by 2002:a05:6000:24b:: with SMTP id m11mr20773887wrz.393.1614795802951; Wed, 03 Mar 2021 10:23:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxT5Mnr/cqn4T3oI+iCl7/2qqSUUEQiDL1NAilJKbe4aa2BGoAiTwZhjp0yFdIrhN8U4ftx4Q== X-Received: by 2002:a05:6000:24b:: with SMTP id m11mr20773870wrz.393.1614795802788; Wed, 03 Mar 2021 10:23:22 -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 09/19] accel/hax: Add typedef for 'struct hax_vcpu_state' Date: Wed, 3 Mar 2021 19:22:09 +0100 Message-Id: <20210303182219.1631042-10-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 'hax_vcpu_state' typedef instead of 'struct hax_vcpu_state'. This will make the next commits easier to review. Beside the typedef addition, patch created mechanically using: $ sed -i s/struct\ hax_vcpu_state/hax_vcpu_state/ \ $(git grep -l 'struct hax_vcpu_state') Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/hax/hax-i386.h | 8 +++++--- target/i386/hax/hax-all.c | 18 +++++++++--------- target/i386/hax/hax-posix.c | 4 ++-- target/i386/hax/hax-windows.c | 4 ++-- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/target/i386/hax/hax-i386.h b/target/i386/hax/hax-i386.h index efbb3462389..ee77406a6a6 100644 --- a/target/i386/hax/hax-i386.h +++ b/target/i386/hax/hax-i386.h @@ -25,6 +25,8 @@ typedef HANDLE hax_fd; #endif =20 extern struct hax_state hax_global; + +typedef struct hax_vcpu_state hax_vcpu_state; struct hax_vcpu_state { hax_fd fd; int vcpu_id; @@ -46,7 +48,7 @@ struct hax_vm { hax_fd fd; int id; int numvcpus; - struct hax_vcpu_state **vcpus; + hax_vcpu_state **vcpus; }; =20 #ifdef NEED_CPU_H @@ -58,7 +60,7 @@ int valid_hax_tunnel_size(uint16_t size); int hax_mod_version(struct hax_state *hax, struct hax_module_version *vers= ion); int hax_inject_interrupt(CPUArchState *env, int vector); struct hax_vm *hax_vm_create(struct hax_state *hax, int max_cpus); -int hax_vcpu_run(struct hax_vcpu_state *vcpu); +int hax_vcpu_run(hax_vcpu_state *vcpu); int hax_vcpu_create(int id); void hax_kick_vcpu_thread(CPUState *cpu); =20 @@ -78,7 +80,7 @@ int hax_host_create_vm(struct hax_state *hax, int *vm_id); hax_fd hax_host_open_vm(struct hax_state *hax, int vm_id); int hax_host_create_vcpu(hax_fd vm_fd, int vcpuid); hax_fd hax_host_open_vcpu(int vmid, int vcpuid); -int hax_host_setup_vcpu_channel(struct hax_vcpu_state *vcpu); +int hax_host_setup_vcpu_channel(hax_vcpu_state *vcpu); hax_fd hax_mod_open(void); void hax_memory_init(void); =20 diff --git a/target/i386/hax/hax-all.c b/target/i386/hax/hax-all.c index bf65ed6fa92..08c2b60b437 100644 --- a/target/i386/hax/hax-all.c +++ b/target/i386/hax/hax-all.c @@ -68,7 +68,7 @@ int valid_hax_tunnel_size(uint16_t size) =20 hax_fd hax_vcpu_get_fd(CPUArchState *env) { - struct hax_vcpu_state *vcpu =3D env_cpu(env)->hax_vcpu; + hax_vcpu_state *vcpu =3D env_cpu(env)->hax_vcpu; if (!vcpu) { return HAX_INVALID_FD; } @@ -142,7 +142,7 @@ static int hax_version_support(struct hax_state *hax) =20 int hax_vcpu_create(int id) { - struct hax_vcpu_state *vcpu =3D NULL; + hax_vcpu_state *vcpu =3D NULL; int ret; =20 if (!hax_global.vm) { @@ -155,7 +155,7 @@ int hax_vcpu_create(int id) return 0; } =20 - vcpu =3D g_new0(struct hax_vcpu_state, 1); + vcpu =3D g_new0(hax_vcpu_state, 1); =20 ret =3D hax_host_create_vcpu(hax_global.vm->fd, id); if (ret) { @@ -194,7 +194,7 @@ int hax_vcpu_create(int id) =20 int hax_vcpu_destroy(CPUState *cpu) { - struct hax_vcpu_state *vcpu =3D cpu->hax_vcpu; + hax_vcpu_state *vcpu =3D cpu->hax_vcpu; =20 if (!hax_global.vm) { fprintf(stderr, "vcpu %x destroy failed, vm is null\n", vcpu->vcpu= _id); @@ -225,7 +225,7 @@ int hax_init_vcpu(CPUState *cpu) exit(-1); } =20 - cpu->hax_vcpu =3D hax_global.vm->vcpus[cpu->cpu_index]; + cpu->accel_vcpu =3D hax_global.vm->vcpus[cpu->cpu_index]; cpu->vcpu_dirty =3D true; qemu_register_reset(hax_reset_vcpu_state, (CPUArchState *) (cpu->env_p= tr)); =20 @@ -265,7 +265,7 @@ struct hax_vm *hax_vm_create(struct hax_state *hax, int= max_cpus) } =20 vm->numvcpus =3D max_cpus; - vm->vcpus =3D g_new0(struct hax_vcpu_state *, vm->numvcpus); + vm->vcpus =3D g_new0(hax_vcpu_state *, vm->numvcpus); for (i =3D 0; i < vm->numvcpus; i++) { vm->vcpus[i] =3D NULL; } @@ -414,7 +414,7 @@ static int hax_handle_io(CPUArchState *env, uint32_t df= , uint16_t port, static int hax_vcpu_interrupt(CPUArchState *env) { CPUState *cpu =3D env_cpu(env); - struct hax_vcpu_state *vcpu =3D cpu->hax_vcpu; + hax_vcpu_state *vcpu =3D cpu->hax_vcpu; struct hax_tunnel *ht =3D vcpu->tunnel; =20 /* @@ -446,7 +446,7 @@ static int hax_vcpu_interrupt(CPUArchState *env) =20 void hax_raise_event(CPUState *cpu) { - struct hax_vcpu_state *vcpu =3D cpu->hax_vcpu; + hax_vcpu_state *vcpu =3D cpu->hax_vcpu; =20 if (!vcpu) { return; @@ -467,7 +467,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env) int ret =3D 0; CPUState *cpu =3D env_cpu(env); X86CPU *x86_cpu =3D X86_CPU(cpu); - struct hax_vcpu_state *vcpu =3D cpu->hax_vcpu; + hax_vcpu_state *vcpu =3D cpu->hax_vcpu; struct hax_tunnel *ht =3D vcpu->tunnel; =20 if (!hax_enabled()) { diff --git a/target/i386/hax/hax-posix.c b/target/i386/hax/hax-posix.c index ac1a51096eb..8ee247845b7 100644 --- a/target/i386/hax/hax-posix.c +++ b/target/i386/hax/hax-posix.c @@ -205,7 +205,7 @@ hax_fd hax_host_open_vcpu(int vmid, int vcpuid) return fd; } =20 -int hax_host_setup_vcpu_channel(struct hax_vcpu_state *vcpu) +int hax_host_setup_vcpu_channel(hax_vcpu_state *vcpu) { int ret; struct hax_tunnel_info info; @@ -227,7 +227,7 @@ int hax_host_setup_vcpu_channel(struct hax_vcpu_state *= vcpu) return 0; } =20 -int hax_vcpu_run(struct hax_vcpu_state *vcpu) +int hax_vcpu_run(hax_vcpu_state *vcpu) { return ioctl(vcpu->fd, HAX_VCPU_IOCTL_RUN, NULL); } diff --git a/target/i386/hax/hax-windows.c b/target/i386/hax/hax-windows.c index 59afa213a6d..08ec93a256c 100644 --- a/target/i386/hax/hax-windows.c +++ b/target/i386/hax/hax-windows.c @@ -301,7 +301,7 @@ hax_fd hax_host_open_vcpu(int vmid, int vcpuid) return hDeviceVCPU; } =20 -int hax_host_setup_vcpu_channel(struct hax_vcpu_state *vcpu) +int hax_host_setup_vcpu_channel(hax_vcpu_state *vcpu) { hax_fd hDeviceVCPU =3D vcpu->fd; int ret; @@ -327,7 +327,7 @@ int hax_host_setup_vcpu_channel(struct hax_vcpu_state *= vcpu) return 0; } =20 -int hax_vcpu_run(struct hax_vcpu_state *vcpu) +int hax_vcpu_run(hax_vcpu_state *vcpu) { int ret; HANDLE hDeviceVCPU =3D vcpu->fd; --=20 2.26.2