From nobody Mon Feb 9 19:54:14 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=1614795847; cv=none; d=zohomail.com; s=zohoarc; b=EFPn7XxOHJN0WwM2HAmvrSAUR/cyqAvt2UaGaeDnneUISRWRrubnkfbNHLgEa0uLce/Q9VbngYIWl7YA07mAmfYy2EuQAtHuKNbViMl4UZnNOmbwgZaRkOY0ytVpkJgvnFnV+aONjAERgWU75j9EU50xkGngp/iN6Dqz7+2iHcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614795847; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=M4K8ZUs7Kh4DBTFlI/pvongtlyoWjFjhXN1UWmJlGpA=; b=YQaNXC3hMwUTeoUpxBtnAmI76vocnu9OKO1CHuJuzv3cQ57uO613fkK8Hk20BzXh0FAKeIBNmbfG2AjPz5xV+XbSNRQ64v1tUi/5I5YUwPs5oHodL50BKJZVHSXwEP3z1QW2PHGvHIeCYT2TiPM/RD2U95m46uvnQR1IoHc3OkQ= 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 1614795847955163.98700520458056; Wed, 3 Mar 2021 10:24:07 -0800 (PST) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-2ihyDVLMMj2tq7u_u1CTTA-1; Wed, 03 Mar 2021 13:24:02 -0500 Received: by mail-wr1-f70.google.com with SMTP id r12so9089736wro.15 for ; Wed, 03 Mar 2021 10:24: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 t14sm34525941wru.64.2021.03.03.10.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 10:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614795847; 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=M4K8ZUs7Kh4DBTFlI/pvongtlyoWjFjhXN1UWmJlGpA=; b=KkfkvbdyEtrfoRIFdr/qip6n6Z5VGQuiJCNWDUV16uSz1MY549R2h8avQwsrq23YTBZgMg GWFctVJ5S2+R/fEDBTE6frGRPO3sgAPFNqxYt+3K6KWyCnAkFU4Y07qzklMLcX6O4K4xdo k2XLJLYOV4xClSxiGbm9x4u1L3oeo1U= X-MC-Unique: 2ihyDVLMMj2tq7u_u1CTTA-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=M4K8ZUs7Kh4DBTFlI/pvongtlyoWjFjhXN1UWmJlGpA=; b=oO/mw8b7fZTqdjuPb73FVKMb8/s12Au04UwfO5OPVgQPNtEMz01Qpkt9d3aOZzt/7e HE7+/v6RIW4ACsi0HSvaxvh25sqHFHK0xTDD2C7YNWyIP8nwulqp9x6tBtYKL4Q9tc/B bEnq2LbrGH3LoHUnuy/E47k+4PFBCXLm92Kr03dGKXEBwiYbWLDSokby80Jdf4olA/rk m8++trC+5ySZCIUCS3W1BakhKR2FG7+HvQaoRtp/on03saMNDbvVNeNJaLHo3gexrdbI UPkCQMi1zjsWZNsmv2TQKpxWkAMUbTZ5GVHZL0CPyhuP9NmhqO2PsVd6yX5agMzu9H77 R2mQ== X-Gm-Message-State: AOAM530VcB+MfdLpvZKOrAz/TI9hix1Tk14/W+R13VbTwDd8ycx2OF6W ckQ69HGuW2b8tCimDB4XiULMHZuGoR6idVG4Lk4Qqfi11QrHEnqT0YgQxJmYdfjMvQaUfjL3klX 5n3r+rePh9ZuB7A== X-Received: by 2002:a1c:2049:: with SMTP id g70mr261150wmg.7.1614795841714; Wed, 03 Mar 2021 10:24:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKNSRqR8zLkOnVmlcq5ZuBoN3wSOkgPWh5iTNFfiCeOZ6YvIytWpn9Bxp5s21C1pEsD2GscQ== X-Received: by 2002:a1c:2049:: with SMTP id g70mr261066wmg.7.1614795840433; Wed, 03 Mar 2021 10:24:00 -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 15/19] accel/kvm: Move the 'kvm_state' field to AccelvCPUState Date: Wed, 3 Mar 2021 19:22:15 +0100 Message-Id: <20210303182219.1631042-16-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) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 1 - include/sysemu/kvm_int.h | 1 + accel/kvm/kvm-all.c | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index ca2526e6a23..4f280509f9b 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -415,7 +415,6 @@ struct CPUState { =20 /* Accelerator-specific fields. */ struct AccelvCPUState *accel_vcpu; - struct KVMState *kvm_state; struct kvm_run *kvm_run; int hvf_fd; /* shared by kvm, hax and hvf */ diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h index 3bf75e62293..dc45b3c3afa 100644 --- a/include/sysemu/kvm_int.h +++ b/include/sysemu/kvm_int.h @@ -18,6 +18,7 @@ struct AccelvCPUState { * @kvm_fd: vCPU file descriptor for KVM */ int kvm_fd; + struct KVMState *kvm_state; }; =20 typedef struct KVMSlot diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 1c08ff3fbe0..737db3d3e0e 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -437,7 +437,7 @@ int kvm_init_vcpu(CPUState *cpu, Error **errp) =20 cpu->accel_vcpu =3D g_new(struct AccelvCPUState, 1); cpu->accel_vcpu->kvm_fd =3D ret; - cpu->kvm_state =3D s; + cpu->accel_vcpu->kvm_state =3D s; cpu->vcpu_dirty =3D true; =20 mmap_size =3D kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0); @@ -1985,7 +1985,7 @@ bool kvm_vcpu_id_is_valid(int vcpu_id) =20 KVMState *kvm_vcpu_state(CPUState *cpu) { - return cpu->kvm_state; + return cpu->accel_vcpu->kvm_state; } =20 static int kvm_init(MachineState *ms) --=20 2.26.2