From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907501; cv=none; d=zohomail.com; s=zohoarc; b=aynsZnIgAY851R+yvM3aPRdxMoTBQcK19ZQ8ul7M9UlJ5eFQCHlZ6P1dSjEtmKqA+DK4X1kYZzxHXBCpeZO33DhuBpcR2moRTb+r/I+L/I5eLqrucgeIlYH8Hk3bvJcnhIB0pNwPH+DiV1ogpcw3KwbUV2BUXdhOo+6uxOQuR9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907501; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=szAIg0k+mHe4c3qMioMT70O09QSk/0gvWDwX1okGjgQ=; b=YfIJrHmfPSR0ivoxSoJ578IRgICsAok9FLiefQyiuJRbtx51bPeti0or8S7z4uLeNEsSeFlX2skRBXW4iyAdODqK5cQWuqP2Qgyl/dcK4ZxqNR33K0uEdlqUf0uljQ6lMK/QaHCz0n3TQmoDbquCRLkNHxYdUzLJTJWRayuWSeQ= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907501967829.5688934870684; Thu, 12 Feb 2026 06:45:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvD-0005cc-R0; Thu, 12 Feb 2026 09:43:59 -0500 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 1vqXul-0005Ko-L1 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXu9-0005i2-S2 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:30 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-369-geDZpvomMri955dLHkdvdA-1; Thu, 12 Feb 2026 09:42:50 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-48079ae1001so63989335e9.0 for ; Thu, 12 Feb 2026 06:42:49 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835ba3df7asm62575835e9.4.2026.02.12.06.42.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:42:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=szAIg0k+mHe4c3qMioMT70O09QSk/0gvWDwX1okGjgQ=; b=ig9fAwjBP1Nu1oPJl4Dv+ea7vGjFJvDVdfy5swRSnOxnHK8RT5tVsGbmYWIxDGFch/+6Ut s15Mrd1f4WlSobk+BDSDE4JYl4OKaga+DWmM+iZ/VlpmNf0xgXhHKLVzAEF2MU4mF7Isk8 jBfMJRvFwqpo57QIFJjPHtN+bPPWncM= X-MC-Unique: geDZpvomMri955dLHkdvdA-1 X-Mimecast-MFC-AGG-ID: geDZpvomMri955dLHkdvdA_1770907368 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907367; x=1771512167; 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=szAIg0k+mHe4c3qMioMT70O09QSk/0gvWDwX1okGjgQ=; b=P7YiclgC6rv5GhBefYVACDss91ZS5EQPtk+VQSd5k22vps7GhflspSy0P+1CgZsYZ3 xSD7e2gjWFDDkrAcrT4WD9NUrKPLC+OF5XCXP86fws9RKmoRmeXhyshuffkbaH4j/y/S Nlkbf4PRInRgYxKVzyTeUNkYdKZhnu41obJnVZOULWG3GlxZLfnRkKi5ytMpcPrCZzaq 4mlcAxerKFKIwx7ZpD2lF4SFx8AiriOf2tbviiwejy/QIPX5aYQp93RJZnyKbGW4Vd/Y 1HKM6Rahb8zw4+PRzaOd+inTSzw96DDJjWkHOs41XmWPUDP1QYL2p8tWS/ZQknUtlMft z49A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907367; x=1771512167; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=szAIg0k+mHe4c3qMioMT70O09QSk/0gvWDwX1okGjgQ=; b=T3BBZe9RoRCNxtsCGHWJcIMwv9aaR5p0PpCi3SKBC5wIckcWQrAqmJe/GSFab33UfI FndT5i2WvbnXEwxTrfkZekOkSxLbzJXest7MnbXqK6oGO/KQKGMCy5IysYU2onu+P4bV TLwYNj4jAea7m7cWzalt85Y31j1zZyJS/KHy9K4X/vWVqevgvNJnsWdsBLkgkT2YbFTH z9DlUX0YNtlJ02NDVHMhv/dj00nxPzOUqxYSPq9iEznjimVJQ5AYs81NSRrKQCAofIQN Khb0P4Mczm/WOOT+nY9S9POwLBaVQ7Cu0E6K2sBl0ANjhuFeq+ntcFL/36HX3rsHBCgQ HeZQ== X-Gm-Message-State: AOJu0YxAuRNxZ/U97XKTyg9x27vgsj/h88/qfhL7Eo9h30kWay3TEaWu T7yh7dubms8oDrur2XNipL3ZSBsvrxE1xgZ+6f2PdnPPlMq4zunZHeSVFksp2OSuQ6olMMeprf1 5NC2zOZ3zzUcP88FiXN5HTGpYcBjzoeanLC8J/M/jGb6/SmkNGD8kYC8bMammx8NJXeUx44dnkH YtL/osAbiJhPouX32iVNqCwReCmL9g3cr0qh3mqaVl X-Gm-Gg: AZuq6aLBBvzO90oRpZq0PpVUxwBLwPi8w3727nE9ua2uw+Pvd/YuCwtaA/BI3fcCpo6 SHlwF+22bHYBDJHdBSGQXEpkzmwoLQ0t3YQ/W8GXjZAzd4MXjJ2vrViKtYv7vWFOt41pjgza/og d2/PiIdmiqpeD5v4T5yccOryBgLn2a6YtxFfv/WiaVW1DLsFPOKuq1das+cGsvPekticRfBpkq5 GYq2DzqSJC3irzECv0SWBqMjiFwjfCVb91t++BlB9K07h2CxAF2JqRqEtyQhbyq9lC0NLucPi0A xVfjqsN0eIPG0mPRvVBN/tgZxSV5s0gta/I/gMI5bhTg3lsG+ebtl6NvacT5NCV2rRdm7UioOaz m40P11vzym1Tr7EqBdaahVTSeQOArrgnq1vXrPmak060g9QElHfdrPKUn8n+tCVM+TSiJwOb8yA 7AnloF3oWWKS9mG4Rzd9R7gA43mNqiA/+WcTJKjs4c2N9IjN5n3zw= X-Received: by 2002:a05:600c:4eca:b0:47e:e20e:bbb0 with SMTP id 5b1f17b1804b1-483656adec5mr45736815e9.6.1770907367071; Thu, 12 Feb 2026 06:42:47 -0800 (PST) X-Received: by 2002:a05:600c:4eca:b0:47e:e20e:bbb0 with SMTP id 5b1f17b1804b1-483656adec5mr45735935e9.6.1770907366469; Thu, 12 Feb 2026 06:42:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Jin Liu , Michael Roth Subject: [PULL 01/41] target/i386: convert SEV-ES termination requests to guest panic events Date: Thu, 12 Feb 2026 15:42:03 +0100 Message-ID: <20260212144244.22579-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907502731158500 Content-Type: text/plain; charset="utf-8" This produces a good error message instead of: KVM: unknown exit reason 24 EAX=3D00000000 EBX=3D00000000 ECX=3D00000000 EDX=3D00a00f11 ESI=3D00000000 EDI=3D00000000 EBP=3D00000000 ESP=3D00000000 EIP=3D0000b004 EFL=3D00000002 [-------] CPL=3D0 II=3D0 A20=3D1 SMM=3D0 HLT= =3D1 ES =3D0000 00000000 0000ffff 00009300 CS =3Df000 00800000 0000ffff 00009b00 SS =3D0000 00000000 0000ffff 00009300 DS =3D0000 00000000 0000ffff 00009300 FS =3D0000 00000000 0000ffff 00009300 GS =3D0000 00000000 0000ffff 00009300 LDT=3D0000 00000000 0000ffff 00008200 TR =3D0000 00000000 0000ffff 00008b00 GDT=3D 00000000 0000ffff IDT=3D 00000000 0000ffff CR0=3D60000010 CR2=3D00000000 CR3=3D00000000 CR4=3D00000000 DR0=3D0000000000000000 DR1=3D0000000000000000 DR2=3D0000000000000000 DR3=3D= 0000000000000000 DR6=3D00000000ffff0ff0 DR7=3D0000000000000400 EFER=3D0000000000000000 Code=3D00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <00> 00 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 = 00 00 00 Reported-by: Jin Liu Cc: Michael Roth Signed-off-by: Paolo Bonzini --- qapi/run-state.json | 23 +++++++++++++++++++++-- accel/kvm/kvm-all.c | 1 + system/runstate.c | 4 ++++ target/i386/cpu-system.c | 22 ++++++++++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/qapi/run-state.json b/qapi/run-state.json index a6bc94a44bb..a5771ad4681 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -504,10 +504,12 @@ # # @tdx: tdx guest panic information type (Since: 10.1) # +# @sev: AMD SEV-ES guest termination information type (Since: 11.0) +# # Since: 2.9 ## { 'enum': 'GuestPanicInformationType', - 'data': [ 'hyper-v', 's390', 'tdx' ] } + 'data': [ 'hyper-v', 's390', 'tdx', 'sev' ] } =20 ## # @GuestPanicInformation: @@ -523,7 +525,8 @@ 'discriminator': 'type', 'data': {'hyper-v': 'GuestPanicInformationHyperV', 's390': 'GuestPanicInformationS390', - 'tdx' : 'GuestPanicInformationTdx'}} + 'tdx': 'GuestPanicInformationTdx', + 'sev': 'GuestPanicInformationSev' }} =20 ## # @GuestPanicInformationHyperV: @@ -625,6 +628,22 @@ 'message': 'str', '*gpa': 'uint64'}} =20 +## +# @GuestPanicInformationSev: +# +# Information for AMD SEV-specific termination request (GHCB MSR +# contents) +# +# @set: The reason code set provided by the guest +# +# @code: The reason code provided by the guest +# +# Since: 11.0 +## +{'struct': 'GuestPanicInformationSev', + 'data': {'set': 'uint32', + 'code': 'uint32'}} + ## # @MEMORY_FAILURE: # diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 8301a512e7f..0d8b0c43470 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3300,6 +3300,7 @@ int kvm_cpu_exec(CPUState *cpu) qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); ret =3D EXCP_INTERRUPT; break; + case KVM_SYSTEM_EVENT_SEV_TERM: case KVM_SYSTEM_EVENT_CRASH: kvm_cpu_synchronize_state(cpu); bql_lock(); diff --git a/system/runstate.c b/system/runstate.c index ed2db564806..d091a2bdddb 100644 --- a/system/runstate.c +++ b/system/runstate.c @@ -669,6 +669,10 @@ void qemu_system_guest_panicked(GuestPanicInformation = *info) "can be found at gpa page: 0x%" PRIx64 "\n", info->u.tdx.gpa); } + } else if (info->type =3D=3D GUEST_PANIC_INFORMATION_TYPE_SEV) { + qemu_log_mask(LOG_GUEST_ERROR, "SEV termination (reason set: %= d code: %d)", + info->u.sev.set, + info->u.sev.code); } =20 qapi_free_GuestPanicInformation(info); diff --git a/target/i386/cpu-system.c b/target/i386/cpu-system.c index b1494aa6740..c8bbf0cbafd 100644 --- a/target/i386/cpu-system.c +++ b/target/i386/cpu-system.c @@ -18,6 +18,8 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "system/kvm.h" #include "cpu.h" #include "qapi/error.h" #include "qapi/qapi-visit-run-state.h" @@ -272,6 +274,26 @@ GuestPanicInformation *x86_cpu_get_crash_info(CPUState= *cs) CPUX86State *env =3D &cpu->env; GuestPanicInformation *panic_info =3D NULL; =20 +#ifdef CONFIG_KVM + if (kvm_enabled()) { + struct kvm_run *run =3D cs->kvm_run; + + if (run->exit_reason =3D=3D KVM_EXIT_SYSTEM_EVENT && + run->system_event.type =3D=3D KVM_SYSTEM_EVENT_SEV_TERM) { + panic_info =3D g_new0(GuestPanicInformation, 1); + + panic_info->type =3D GUEST_PANIC_INFORMATION_TYPE_SEV; + /* There should always be one data item, otherwise use zeroes.= */ + if (run->system_event.ndata > 0) { + panic_info->u.sev.set =3D (run->system_event.data[0] >> 12= ) & 0xf; + panic_info->u.sev.code =3D (run->system_event.data[0] >> 1= 6) & 0xff; + } else { + warn_report("Hypervisor did not provide any data for SEV-E= S termination"); + } + } + } else +#endif + if (hyperv_feat_enabled(cpu, HYPERV_FEAT_CRASH)) { panic_info =3D g_new0(GuestPanicInformation, 1); =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907472; cv=none; d=zohomail.com; s=zohoarc; b=jCd91HpPpXzRrxeEuD2BjT+fGGK6ZEK3cncR+/y48woI63r7rpdAHahhz+OZB4XkhFkj15jdEKE8KYBAE0cfQmja5RbikLk7zJ/xNzRRJO0LIDG6/RKSGY+HaW7owjlt99dGKKWwKDEv0SDDqGJHO3QXBa5NfeNER3xaY3L87DU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907472; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Y1qB8f5S1a8OY4JKauR7kdT3uCW8tDUiJfDSKAlMRVI=; b=kOSnt4ObHEkAqBKDnLLyAWbnrGX2DVQ9acpvondDzhNbeC9AD/wiK0/a+kX46UIqkHXEBTx2A0/3vBpNUY3bfEbvSYz+E1jOfNFB4x8L0gwbispGwOE6Ozkb5Tp2OqvAVyT5JQJlpf4oVfaWV6ThmlikcrX86CcF3Ftr/RcnxM8= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907472061880.8756539913641; Thu, 12 Feb 2026 06:44:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvF-0005id-HG; Thu, 12 Feb 2026 09:44:01 -0500 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 1vqXum-0005Kq-Bx for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuB-0005jk-PW for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:31 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-127-Rgk8NUe_PduiaBuFc5Ymqg-1; Thu, 12 Feb 2026 09:42:51 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-480711d09f1so43103875e9.0 for ; Thu, 12 Feb 2026 06:42:51 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4834d82a4c4sm353804045e9.10.2026.02.12.06.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:42:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907375; 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=Y1qB8f5S1a8OY4JKauR7kdT3uCW8tDUiJfDSKAlMRVI=; b=fdPZYgQuCAqxigHl27RjTFZo1zj3yF44MPqlQhVI6W9vltKW9nQpq/WtTbUbCYi8XjZoaz SnNBDf63hVggKtxOSkrqKs9YlPUVbNsXinNliC4oUwxXFO5un+Yb4A0HqY4724qmvLskZs uPf80rMwSz+iu2bBcHc+GIRDqZHyhmA= X-MC-Unique: Rgk8NUe_PduiaBuFc5Ymqg-1 X-Mimecast-MFC-AGG-ID: Rgk8NUe_PduiaBuFc5Ymqg_1770907370 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907370; x=1771512170; 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=Y1qB8f5S1a8OY4JKauR7kdT3uCW8tDUiJfDSKAlMRVI=; b=uNcgOeRlCSzne7ga2b7JVLiUnTZtLew3PcYYHsyzOL8HIBZBVOLR52Wo7ivnp0tvv6 ogYkgSVvZQV4W4mqOWFkGV44087NW7zUM0D0ae+UBNshB861U6oof9BqmZGf8hRrxxiq FR+oJ8O3rGf7GYCaMYScfPhLC3KQYWzWrChWX5a4aEp9/+1a3n1cyRXj/9y/x3m0SzV5 BSPD8GGQEIKvB/VEHtPhnXSH1gHmjHiUSRPGA2NeC30ILpUlSLEgeUNe4mcNou4EGa6E cnb8OpmQB4Pj9U9xXARkOp8y0wfBHzYcz/d0v4lB9zDhxIgQ7MZxm3aKOnNBQcdQpd3n eQ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907370; x=1771512170; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Y1qB8f5S1a8OY4JKauR7kdT3uCW8tDUiJfDSKAlMRVI=; b=ShMMD3b3O8q9/mqpZACUIJqE9w4SPnp48nMX5sKQgDlLOteP2LaaKLnlRfZ9XB/Jzd 38b9La0sfNbONuOpignvh5xngOg/6F/u8RB1tA9xtH7O16I35ApoP0a6lpGHL6Kd0v8o C8/R0XFNcpq3hjAZSW4G9gUc4349Q3ccNDsVXLg8LWRLPSUzehntH/aqBc7TMVtUoN1h UMef8sJyBs2NvZzSfyifWAPCtrk/HZwujGxVDO97YZnLyzEwUvO1fxH8o8jSGYVinSAo wpngrN+3X1jkFIkutRYsxjV6QA31mGeSYciioTTmZjO3e+ZJnLiuRwVdvgEbmijYU4+4 y7qA== X-Gm-Message-State: AOJu0Yy6khFGA+p17m5WTAKG2/ZI73c9qTBQzlnX3mrb5S0xzOekgJMO dfjFAVl+xM7u6ZkkDEpYVmW92t35bvOApOap/zHhUqoCOroVuPlgr2ca+Mw0eaYQhjqcQEgKOUl WgvMgyXlRasAI6rn8cbspYskM7/THjVxvmkOnfFU/S33wrZjHKnTg/BOmZ2vxZRCbsCOWt8O6q0 lIUsv8yyvlC76ivkk9Vfd+Q5HjP/BBrXWC4QkkxITQ X-Gm-Gg: AZuq6aJY4wDN8gs/Ymle8/13lphi833FzWNukmC6tXilLj8e/TR+StwxS/JQ/QLrVHb RfEY8GF/1dCXGxnQ0kMP9wVFaADIPHcn+Px2C/ix2oqvcNP4O4jBWpv3bRTSOPMsjuzO4+FiIdI V4Ni/T07gdW72JuHGBGQSmn4zqoBi+1B9thcJVJK8Ac8MmH2E17HRL9jNx4yI2vh+cK98HaJT1G 4nNLBwITwxG4Wh4PreF0DFcnJC3DmtKQSx8witn0z4Rx5FeVOsySNvK0OeH6gGhz1G/o86eBGbU 2uAxMDxlkMVOaz34QFLWKL2DEX+oNu1defZnMRqU6VwZ2Wtn6DLe8U8DwoH7LRJklT7NeAA4HtK uBR5u4efBRFmV6saDl4oDezxOWhvgdsDp2Iptu3zpLUxTqkGm/rkF5jmybIDvBRCaDaRuy9Pj9Z H1WN9wjOcE7V+AwtryXPFvveUmV3SvOAXwwUa5DnGiV8mSxt4CUh0= X-Received: by 2002:a05:600c:3b12:b0:477:9814:6882 with SMTP id 5b1f17b1804b1-483670fac0fmr37888715e9.5.1770907369714; Thu, 12 Feb 2026 06:42:49 -0800 (PST) X-Received: by 2002:a05:600c:3b12:b0:477:9814:6882 with SMTP id 5b1f17b1804b1-483670fac0fmr37888045e9.5.1770907369195; Thu, 12 Feb 2026 06:42:49 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Thomas Huth , Zhao Liu , Igor Mammedov Subject: [PULL 02/41] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Date: Thu, 12 Feb 2026 15:42:04 +0100 Message-ID: <20260212144244.22579-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907473413154100 From: Philippe Mathieu-Daud=C3=A9 These machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed. Reviewed-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-2-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- hw/i386/pc_piix.c | 14 -------------- hw/i386/pc_q35.c | 14 -------------- 2 files changed, 28 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 878db5721b7..9efb42ad055 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -732,20 +732,6 @@ static void pc_i440fx_machine_2_7_options(MachineClass= *m) =20 DEFINE_I440FX_MACHINE(2, 7); =20 -static void pc_i440fx_machine_2_6_options(MachineClass *m) -{ - X86MachineClass *x86mc =3D X86_MACHINE_CLASS(m); - PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); - - pc_i440fx_machine_2_7_options(m); - pcmc->legacy_cpu_hotplug =3D true; - x86mc->fwcfg_dma_enabled =3D false; - compat_props_add(m->compat_props, hw_compat_2_6, hw_compat_2_6_len); - compat_props_add(m->compat_props, pc_compat_2_6, pc_compat_2_6_len); -} - -DEFINE_I440FX_MACHINE(2, 6); - #ifdef CONFIG_XEN static void xenfv_machine_4_2_options(MachineClass *m) { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 6e5a23d718f..6dd1120c004 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -680,17 +680,3 @@ static void pc_q35_machine_2_7_options(MachineClass *m) } =20 DEFINE_Q35_MACHINE(2, 7); - -static void pc_q35_machine_2_6_options(MachineClass *m) -{ - X86MachineClass *x86mc =3D X86_MACHINE_CLASS(m); - PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); - - pc_q35_machine_2_7_options(m); - pcmc->legacy_cpu_hotplug =3D true; - x86mc->fwcfg_dma_enabled =3D false; - compat_props_add(m->compat_props, hw_compat_2_6, hw_compat_2_6_len); - compat_props_add(m->compat_props, pc_compat_2_6, pc_compat_2_6_len); -} - -DEFINE_Q35_MACHINE(2, 6); --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907775; cv=none; d=zohomail.com; s=zohoarc; b=LPUmo7/TJQrOWxcBbBnU+Fh+reGQKOgs8L0MSnIcHpGea+sQ5WZWLRcWH5OGAdzhTuY6+3bC2OT5bYIlXw5K0nzfFN94I6LTAEsaQYv38vB0QJeKM28lljneoVffpf1+F5h1TGJ3a3O1rCO6yjrP6GD7/uK60f/sVk9hOR6AWb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907775; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5emFdi1nSDHv0zg/73xkIggYL3JZlaBDKu/OyPg2etI=; b=Qe9qhK4KgdeM1RjkBr5ND0vO6tLL8kh2Q2rOsAyopWOmngjV/bl/WvZXmLIErOnjbVk9pYWi9iwmCpzIebwY3Lj/BRF9Y1yjGdj0ikHT1XW/diL5A8YY0AQDkmk8e20mf03Lwmv2Te3ORFdnx1TvkDpjR+UeM8aS0ihI3hvymNU= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907775149771.6135441830463; Thu, 12 Feb 2026 06:49:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvG-0005jV-2O; Thu, 12 Feb 2026 09:44:02 -0500 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 1vqXum-0005Ku-Dy for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuB-0005k6-Qz for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:31 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-684-EknjrV1VMZe0cngKj0avsA-1; Thu, 12 Feb 2026 09:42:54 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4806b12ad3fso78377315e9.0 for ; Thu, 12 Feb 2026 06:42:52 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835ba1670fsm77334905e9.4.2026.02.12.06.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5emFdi1nSDHv0zg/73xkIggYL3JZlaBDKu/OyPg2etI=; b=aKSmWj9US5yD/n8CprSZUBA6Q36Z+ojNv79eOz5MZeE7vv5gFbPbRGtF9lXWJeIU2dn8A+ +V34C/38slCiyyalBTQQydCs+Ps70ncGmHNRk/ebDqrPga5Mc5d+Fo2+oUX09rD2bzcld8 GNQeB4HcnlamXrFS3ZqNcdVavjSPwEE= X-MC-Unique: EknjrV1VMZe0cngKj0avsA-1 X-Mimecast-MFC-AGG-ID: EknjrV1VMZe0cngKj0avsA_1770907372 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907371; x=1771512171; 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=5emFdi1nSDHv0zg/73xkIggYL3JZlaBDKu/OyPg2etI=; b=MpQ0EnBSGhL58TuyMjqDg9fn7YMVk+RqH/lWLp90wGApcIsHdED5S71544SOtxiFDk JDo+du9GW3KH/CILjCSAjQab6Ow5PUW77ezGE6hqAvnyoVexIw4WrkbBGheDjDyPSQ6u UTc+t5aT8ZIEvMIy3edrelYCPxZYdhAaCbmRfgHu8CTEK0kOCllWLlITLSS1UU1ARlWs BHIbgG1W73N6ygwvQti6ZxPXFhVwq7RL52v4IABikMDy4w2CfIZ/mWFwpq9/NL1XskpC yXH+QWv2WwgZuHKBjIVnjhh4o2OsCdf4HNvcIegSQEDH9hp7cboL8J9fQwLJ4/JB8v+g d8Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907371; x=1771512171; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5emFdi1nSDHv0zg/73xkIggYL3JZlaBDKu/OyPg2etI=; b=DfpDxS8qGSrmK6WV8SbJI6v5N+d5J9RGNKu/+DCR3Dvii/blzyYnosugo/+gUPKQUK AVOVzRVkp/f4HoDm0pkua7Sf04J9gzuXLrNuNafTJOOgR0p4MNjNFIkqkuL1h+HxTl7N Ag8fqLMTSXVByFs5jmeasU6FO3HlyA74ehoz4F0BK8jACBLZLqFnTnZOJj9FeJ4Timcm tVOoZW1cCIFUTNwYslSdMrHrHs2q+dev6KO8saK7UElmzhNFBH9zUs06f6hWuuP8FaPP TkbIDiofGjmbSSRW+mHrxd9ZWCcVyTbfeYHBFYnJ7ndCr5o5Chd011mi6qyYgaDCrAfx Rzdw== X-Gm-Message-State: AOJu0YyUGFmJJZlUEYvC8wACp85CoggwAQoG3plDXtMeaxE+CL/X1UR0 nrrDWu/02qsm+GHx5tyxJruOkom3a90l/kEGxeK4waeY8HcPNNKM87Go4f+ZpgeFClk6qItrOgm H9DpPEzhZ8+TnlVT66FETN9wzDsQx5PC3s1vOlARxhV3coLc3d6LOkrJx5qfU/9GXiGsah4qqL7 zuhQ+bwByxfNR7SVo54FDuxXDIbJ0M/ZJs6CxLysUo X-Gm-Gg: AZuq6aJj3mNYbfCsya7Jk2tHvb2yPbPjMHGFBzxdh5CFZSG+O4y2V8Yt9FLiAPuufG1 bzjC5sx1H5qo2EFf6nGXngLFeeBDUqQac0lHPdMtFt7bNHOFCARPS8kP5bcNz5cj8pT+1+RZEFk +gM+vBBFAmaOhgNJudOcf3O2AfZejdlD2QMbjpftgBZwbCyZ7cIZjKGH+M00ZH7QhY4DsK/z/dZ 1fqQXWdZAfLoW7049POS5MIgypNj8EOSmxOJNDO2Z5F30euEa5mzthNhcIxufV0hj9hxtP3ZS68 sA+baU25IkNC+5MDAJ5TT56ijWzGMvwV0Pqm6vY7dRlmspJFHXNwjCC5CQoqCqJPZxOjKmmQijo Sd99KZAZqYHXF7EhQxmX+3zEn5y81I+PRnQT9DfECzEswqKqL3tdXAp6s2hzyDpem7bRV9IjFNB AypZNpNEN6or2LyFoyosm8EGzHORYfgMGKo/uvRTVZGOkYvBQa5p0= X-Received: by 2002:a05:600c:8411:b0:477:9dc1:b706 with SMTP id 5b1f17b1804b1-4836570df2fmr36677875e9.19.1770907370970; Thu, 12 Feb 2026 06:42:50 -0800 (PST) X-Received: by 2002:a05:600c:8411:b0:477:9dc1:b706 with SMTP id 5b1f17b1804b1-4836570df2fmr36677535e9.19.1770907370406; Thu, 12 Feb 2026 06:42:50 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Igor Mammedov , Zhao Liu Subject: [PULL 03/41] tests/acpi: Allow DSDT table change for x86 machines Date: Thu, 12 Feb 2026 15:42:05 +0100 Message-ID: <20260212144244.22579-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907776082158500 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov Before dropping legacy CPU hotplug code, mark and allow the affected ACPI tables, to avoid breaking ACPI table testing. Signed-off-by: Igor Mammedov Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-3-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- tests/qtest/bios-tables-test-allowed-diff.h | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8bf..eed8ded6933 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,43 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/pc/DSDT", +"tests/data/acpi/x86/pc/DSDT.bridge", +"tests/data/acpi/x86/pc/DSDT.ipmikcs", +"tests/data/acpi/x86/pc/DSDT.cphp", +"tests/data/acpi/x86/pc/DSDT.numamem", +"tests/data/acpi/x86/pc/DSDT.nohpet", +"tests/data/acpi/x86/pc/DSDT.memhp", +"tests/data/acpi/x86/pc/DSDT.dimmpxm", +"tests/data/acpi/x86/pc/DSDT.acpihmat", +"tests/data/acpi/x86/pc/DSDT.acpierst", +"tests/data/acpi/x86/pc/DSDT.roothp", +"tests/data/acpi/x86/pc/DSDT.hpbridge", +"tests/data/acpi/x86/pc/DSDT.hpbrroot", +"tests/data/acpi/x86/q35/DSDT", +"tests/data/acpi/x86/q35/DSDT.tis.tpm2", +"tests/data/acpi/x86/q35/DSDT.tis.tpm12", +"tests/data/acpi/x86/q35/DSDT.bridge", +"tests/data/acpi/x86/q35/DSDT.noacpihp", +"tests/data/acpi/x86/q35/DSDT.multi-bridge", +"tests/data/acpi/x86/q35/DSDT.ipmibt", +"tests/data/acpi/x86/q35/DSDT.cphp", +"tests/data/acpi/x86/q35/DSDT.numamem", +"tests/data/acpi/x86/q35/DSDT.nohpet", +"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator", +"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x", +"tests/data/acpi/x86/q35/DSDT.memhp", +"tests/data/acpi/x86/q35/DSDT.dimmpxm", +"tests/data/acpi/x86/q35/DSDT.acpihmat", +"tests/data/acpi/x86/q35/DSDT.mmio64", +"tests/data/acpi/x86/q35/DSDT.acpierst", +"tests/data/acpi/x86/q35/DSDT.applesmc", +"tests/data/acpi/x86/q35/DSDT.pvpanic-isa", +"tests/data/acpi/x86/q35/DSDT.ivrs", +"tests/data/acpi/x86/q35/DSDT.type4-count", +"tests/data/acpi/x86/q35/DSDT.core-count", +"tests/data/acpi/x86/q35/DSDT.core-count2", +"tests/data/acpi/x86/q35/DSDT.thread-count", +"tests/data/acpi/x86/q35/DSDT.thread-count2", +"tests/data/acpi/x86/q35/DSDT.viot", +"tests/data/acpi/x86/q35/DSDT.cxl", +"tests/data/acpi/x86/q35/DSDT.ipmismbus", +"tests/data/acpi/x86/q35/DSDT.xapic", --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907482; cv=none; d=zohomail.com; s=zohoarc; b=kN66SYdr60k6eNwgfnX1DMDjShjhfd8M7/1x2TCcEjEaITDsLeY0/JtCT/QjUqTIcID6IaVj4KHKyJ3ip1TjS2ZwTp9RaTXmhL1pR5zhi9QosaQInbEirROiDhSnhnYQxlRz8EaRuucuPx6QshbMPSVQHF80vy57N1USO7+cOLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907482; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BdxcduUlG5JK7yqtdX81R2qI0Off0b1Jl2z54JAiMCo=; b=Izq33X0yyO16sNOenOsUMh9pwWKbQIMjs2tbouPGXhHE0WrxqHtAnvVemm1oFJj16EZRueJ/eoStTMQ9dUFXmMA2m3RROo97aemWd3hFk2yzXTt5OJlMk7JvHViyolzq119rHr8e0giXcCJ5m3vuyiiwnO+fiMqkXp28AzQdkNI= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907482762838.3111569138175; Thu, 12 Feb 2026 06:44:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvE-0005h2-KI; Thu, 12 Feb 2026 09:44:00 -0500 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 1vqXut-0005NE-RO for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuF-0005mx-1c for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:33 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-475-5ygL2gusPaWR6neiaqGj_Q-1; Thu, 12 Feb 2026 09:42:56 -0500 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-43771113b3bso2194633f8f.0 for ; Thu, 12 Feb 2026 06:42:56 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43783dfc54csm11978563f8f.25.2026.02.12.06.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:42:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BdxcduUlG5JK7yqtdX81R2qI0Off0b1Jl2z54JAiMCo=; b=C14o+jXm8Q9TqQ3TKuPoWHo3Tpz2XLHtsfqK3PisHgNHmaVmC9dSRVyHRNLeiatQBvBEv7 YTbrxtn8JgygFDKoljr5UWoMmx21acQgqyQy+4grq8hTTrkMYd+04OJGGLTZeMiL4gurkn WeVZnVsOa5ATxZGDucfWfDJ5/38ZdyM= X-MC-Unique: 5ygL2gusPaWR6neiaqGj_Q-1 X-Mimecast-MFC-AGG-ID: 5ygL2gusPaWR6neiaqGj_Q_1770907375 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907374; x=1771512174; 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=BdxcduUlG5JK7yqtdX81R2qI0Off0b1Jl2z54JAiMCo=; b=mi2seGNSCNkplXagQTQnddhBps3wsjM+TveEPtWsQI/X5HSI1rs9aGdYABWTiAwdNk 5Vr+z89JbfswE2HLyyl+N4aZhZe8Fr2WvcDrDeYdBoNgbuswhcK4hJLj1LXZ4b6pQlWM AXXG1o/YdeWboeVeI0kZAqvPZSP8qQl6AZeIVmdAN4VIxVsYcN0pwT+MMZM7SZTl/wss gUtMlr6oaCs/bJiVd5fgchxqxNAR5HlU9sp/boOF8L+6nmG4fhtLIYbKbFUn1jj8yUWQ KmBSgiD7CYCkh0nD2YklpcPyiuhkbCa24XShEowKSY+9ZseWWHAYmvVG0EVbBZTtxLMY uN6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907374; x=1771512174; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BdxcduUlG5JK7yqtdX81R2qI0Off0b1Jl2z54JAiMCo=; b=o0nNNLqMr7LOij4+Ezmb28+6bUFYuCDPFrhH3lq9b2hly3HCHXhQtTOwdELY75IN96 kejERbn1sMQVc5tolJBwuaINnDxe/5nd4rBcYOtiUmovgTcJs9kx6fC/162V21V8mB4s 8HEbf3ymTaxLY7e0KkqEZpqEt1+jIPH4fM2fSZ54salRzW0yhdjuNSL6xYBroSNMmDBa KxaaOYqibr6C43MWnNQi2hYn+4NITEBicuCiJGJTd2oYRMq8e+PLhv0W/6XGggP4uQkc A1TN/cg0/YYGDEFjy6WQhoyQ75Yqmip0RlnBnoOBBDEQEyTu+syYTCN+6U/5x6Kp4+cM +Rsg== X-Gm-Message-State: AOJu0YzVY6iNXpWClFLLNnYIyJLxG6oM+FR5Q+PWDOoRPZUGmTlEjW1G NAJHJ9UQecWulyalqHOHWjTUF46en5MsOpXLZzY+xBLhq7ekgyexzC6j19GKpYtrNQBH5nnu/c+ HxyqpZIAWtrDtA01iexT64RWNa6ao2NAp2jgsyiSERBGvVyt1cGX6gPO5gZtdDY4NjEi5l5/LM3 8gN6SKh92DFcNr8SxPjdxUnNNXtDO4F8dhjHVLznna X-Gm-Gg: AZuq6aJNzVJn5NFxlmKGkGPPMmieOBIUcZl1EJ0f+1xfgOtUxhEsFZkX1pr4ZH1A6kt uOkd3Ww/zdxLMKlvMqcEYHRQh7PL5UEExMR8VSVSMKqQI+lYJKkEhyNdJNvjvtTICyJ63ikl58R kzMnSZU+S0yS44q6d61V9fGJXi94zC9f8zUurlu4pAL8hcT8SbRBxkyjsAmugGOUvfU/AmfKFWD bTZWcP56LCY7GfjWmjtxXzL9s1w1LJxWGHdKOCmUc611OULSKw39smuZI/bPOI8MKHwkFp7fQ/p +rGV55dCINmwJLYd7NSMufJMEzeIWH6CRTHRh1x1IIQ75GBZDXfMC15mEL+zmUDd1b7NWnAHWgJ 81BoToQB6dv+mkRzGn4K9dLwF2MleHzmJklunNK02akEzKpTjRUsSuzPVxlo44gCSAM1jzx7u49 vgtIy+66JGV9Z8yr5usQRF2z2xYz0cgZhA1nafyDiGQMUuD2q4wHI= X-Received: by 2002:a5d:5f54:0:b0:435:a2f8:1534 with SMTP id ffacd0b85a97d-4378f16db5cmr4189212f8f.49.1770907373762; Thu, 12 Feb 2026 06:42:53 -0800 (PST) X-Received: by 2002:a5d:5f54:0:b0:435:a2f8:1534 with SMTP id ffacd0b85a97d-4378f16db5cmr4189146f8f.49.1770907373177; Thu, 12 Feb 2026 06:42:53 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu , Igor Mammedov Subject: [PULL 04/41] pc: Start with modern CPU hotplug interface by default Date: Thu, 12 Feb 2026 15:42:06 +0100 Message-ID: <20260212144244.22579-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907484670158500 Content-Type: text/plain; charset="utf-8" From: Zhao Liu For compatibility reasons PC/Q35 will start with legacy CPU hotplug interface by default but with new CPU hotplug AML code since 2.7 machine type (in commit 679dd1a957df ("pc: use new CPU hotplug interface since 2.7 machine type")). In that way, legacy firmware that doesn't use QEMU generated ACPI tables was able to continue using legacy CPU hotplug interface. While later machine types, with firmware supporting QEMU provided ACPI tables, generate new CPU hotplug AML, which will switch to new CPU hotplug interface when guest OS executes its _INI method on ACPI tables loading. Since 2.6 machine type is now gone, and consider that the legacy BIOS (based on QEMU ACPI prior to v2.7) should be no longer in use, previous compatibility requirements are no longer necessary. So initialize 'modern' hotplug directly from the very beginning for PC/Q35 machines with cpu_hotplug_hw_init(), and drop _INIT method. Additionally, remove the checks and settings around cpu_hotplug_legacy in cpuhp VMState (for piix4 & ich9), to eliminate the risk of segmentation faults, as gpe_cpu no longer has the opportunity to be initialized. This is safe because all hotplug now start with the modern way, and it's impossible to switch to legacy way at runtime (even the "cpu-hotplug-legacy" properties does not allow it either). Signed-off-by: Igor Mammedov Signed-off-by: Zhao Liu Acked-by: Igor Mammedov Link: https://lore.kernel.org/r/20260108033051.777361-4-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/acpi/cpu.h | 1 - hw/acpi/cpu.c | 10 ---------- hw/acpi/ich9.c | 22 +++------------------- hw/acpi/piix4.c | 21 +++------------------ hw/i386/acpi-build.c | 2 +- hw/loongarch/virt-acpi-build.c | 1 - 6 files changed, 7 insertions(+), 50 deletions(-) diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h index 557219d2c63..2809dd8a911 100644 --- a/include/hw/acpi/cpu.h +++ b/include/hw/acpi/cpu.h @@ -54,7 +54,6 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner, =20 typedef struct CPUHotplugFeatures { bool acpi_1_compatible; - bool has_legacy_cphp; bool fw_unplugs_cpu; const char *smi_path; } CPUHotplugFeatures; diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 6f1ae79edbf..d63ca83c1bc 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -408,16 +408,6 @@ void build_cpus_aml(Aml *table, MachineState *machine,= CPUHotplugFeatures opts, aml_append(field, aml_reserved_field(4 * 8)); aml_append(field, aml_named_field(CPU_DATA, 32)); aml_append(cpu_ctrl_dev, field); - - if (opts.has_legacy_cphp) { - method =3D aml_method("_INI", 0, AML_SERIALIZED); - /* switch off legacy CPU hotplug HW and use new one, - * on reboot system is in new mode and writing 0 - * in CPU_SELECTOR selects BSP, which is NOP at - * the time _INI is called */ - aml_append(method, aml_store(zero, aml_name(CPU_SELECTOR))); - aml_append(cpu_ctrl_dev, method); - } } aml_append(sb_scope, cpu_ctrl_dev); =20 diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 2b3b493c014..54590129c69 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -183,26 +183,10 @@ static const VMStateDescription vmstate_tco_io_state = =3D { } }; =20 -static bool vmstate_test_use_cpuhp(void *opaque) -{ - ICH9LPCPMRegs *s =3D opaque; - return !s->cpu_hotplug_legacy; -} - -static int vmstate_cpuhp_pre_load(void *opaque) -{ - ICH9LPCPMRegs *s =3D opaque; - Object *obj =3D OBJECT(s->gpe_cpu.device); - object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abor= t); - return 0; -} - static const VMStateDescription vmstate_cpuhp_state =3D { .name =3D "ich9_pm/cpuhp", .version_id =3D 1, .minimum_version_id =3D 1, - .needed =3D vmstate_test_use_cpuhp, - .pre_load =3D vmstate_cpuhp_pre_load, .fields =3D (const VMStateField[]) { VMSTATE_CPU_HOTPLUG(cpuhp_state, ICH9LPCPMRegs), VMSTATE_END_OF_LIST() @@ -338,8 +322,8 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm= , qemu_irq sci_irq) pm->powerdown_notifier.notify =3D pm_powerdown_req; qemu_register_powerdown_notifier(&pm->powerdown_notifier); =20 - legacy_acpi_cpu_hotplug_init(pci_address_space_io(lpc_pci), - OBJECT(lpc_pci), &pm->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE); + cpu_hotplug_hw_init(pci_address_space_io(lpc_pci), + OBJECT(lpc_pci), &pm->cpuhp_state, ICH9_CPU_HOTPLUG_IO_BASE); =20 acpi_memory_hotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci= ), &pm->acpi_memory_hotplug, @@ -419,7 +403,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs = *pm) { static const uint32_t gpe0_len =3D ICH9_PMIO_GPE0_LEN; pm->acpi_memory_hotplug.is_enabled =3D true; - pm->cpu_hotplug_legacy =3D true; + pm->cpu_hotplug_legacy =3D false; pm->disable_s3 =3D 0; pm->disable_s4 =3D 0; pm->s4_val =3D 2; diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 19d4d4be932..0eda692084d 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -195,25 +195,10 @@ static const VMStateDescription vmstate_memhp_state = =3D { } }; =20 -static bool vmstate_test_use_cpuhp(void *opaque) -{ - PIIX4PMState *s =3D opaque; - return !s->cpu_hotplug_legacy; -} - -static int vmstate_cpuhp_pre_load(void *opaque) -{ - Object *obj =3D OBJECT(opaque); - object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abor= t); - return 0; -} - static const VMStateDescription vmstate_cpuhp_state =3D { .name =3D "piix4_pm/cpuhp", .version_id =3D 1, .minimum_version_id =3D 1, - .needed =3D vmstate_test_use_cpuhp, - .pre_load =3D vmstate_cpuhp_pre_load, .fields =3D (const VMStateField[]) { VMSTATE_CPU_HOTPLUG(cpuhp_state, PIIX4PMState), VMSTATE_END_OF_LIST() @@ -573,12 +558,12 @@ static void piix4_acpi_system_hot_add_init(MemoryRegi= on *parent, qbus_set_hotplug_handler(BUS(pci_get_bus(PCI_DEVICE(s))), OBJECT(s= )); } =20 - s->cpu_hotplug_legacy =3D true; + s->cpu_hotplug_legacy =3D false; object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy", piix4_get_cpu_hotplug_legacy, piix4_set_cpu_hotplug_legacy); - legacy_acpi_cpu_hotplug_init(parent, OBJECT(s), &s->gpe_cpu, - PIIX4_CPU_HOTPLUG_IO_BASE); + cpu_hotplug_hw_init(parent, OBJECT(s), &s->cpuhp_state, + PIIX4_CPU_HOTPLUG_IO_BASE); =20 if (s->acpi_memory_hotplug.is_enabled) { acpi_memory_hotplug_init(parent, OBJECT(s), &s->acpi_memory_hotplu= g, diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 19c62362e31..cdd72cbcaa0 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -964,7 +964,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base); } else { CPUHotplugFeatures opts =3D { - .acpi_1_compatible =3D true, .has_legacy_cphp =3D true, + .acpi_1_compatible =3D true, .smi_path =3D pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL, .fw_unplugs_cpu =3D pm->smi_on_cpu_unplug, }; diff --git a/hw/loongarch/virt-acpi-build.c b/hw/loongarch/virt-acpi-build.c index 54ac94e17d3..3e34bedcd6f 100644 --- a/hw/loongarch/virt-acpi-build.c +++ b/hw/loongarch/virt-acpi-build.c @@ -369,7 +369,6 @@ build_la_ged_aml(Aml *dsdt, MachineState *machine) =20 if (event & ACPI_GED_CPU_HOTPLUG_EVT) { opts.acpi_1_compatible =3D false; - opts.has_legacy_cphp =3D false; opts.fw_unplugs_cpu =3D false; opts.smi_path =3D NULL; =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907503; cv=none; d=zohomail.com; s=zohoarc; b=Mh/LsqlpqU0mrft9p4lxlwRElE/u3c2Xrk0DU/M7YxaQRw2QsScnDaBJnUJUqg9DM6mqpyUCZyocv9z3FR9Dry+Ne7f5dnGYDgeEgncS5e9JpalpH9eN9eSMTuI7ZAm1cHQ4cii4xx22I7+DsC1pfIofWK57emw9dwL1Ed0wX0Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907503; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2ZdsYzHGBqsRtffyKG+WZutAT5K1mgYEx62Q5cTRUDo=; b=cNVVwb7ZYEpO/GMyADRkXzqBEftN23bYJZDaEmfo7AZrRWIWrbp/qFQEPGtuM86gt5rtu8fYcFvD+Uso6BmavwFuyTPdab+X8PfyVLh5ljSsG5H0DKlfx8oFCcFDgQsMoVUky6VhOl5tsltyfMKrsTd1OBahYXZzptUG5S4AqOg= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907503451897.4829089304418; Thu, 12 Feb 2026 06:45:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvF-0005i0-7h; Thu, 12 Feb 2026 09:44:01 -0500 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 1vqXut-0005ND-R0 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:43 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuF-0005pg-Jp for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:35 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-164-jhoLP9MMO2SnXL9POFImGA-1; Thu, 12 Feb 2026 09:42:57 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4803e8b6007so29523435e9.0 for ; Thu, 12 Feb 2026 06:42:57 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4836e39045asm5676405e9.9.2026.02.12.06.42.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907378; 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=2ZdsYzHGBqsRtffyKG+WZutAT5K1mgYEx62Q5cTRUDo=; b=cI9X/Neeere2OsYVBldcfIYviHHbLJNPoH3R5eS+z9ORczPigRmGRkj/+toLGhbNCdgkL+ Yr9XZqt1JTZSbMh3tWxx5zl5IBY4zGvmy/xcDZKJm3oYZYMK48n0YNk7dF8wd9WPFSNsM/ 3aaSFzTLns1Pl5uQELwQkG5t3eO1MF4= X-MC-Unique: jhoLP9MMO2SnXL9POFImGA-1 X-Mimecast-MFC-AGG-ID: jhoLP9MMO2SnXL9POFImGA_1770907376 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907375; x=1771512175; 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=2ZdsYzHGBqsRtffyKG+WZutAT5K1mgYEx62Q5cTRUDo=; b=jg807gEdYjxB1udcOufxEKPcgwLZJoH9fhMRzNhGQLi6cjqfSPTEKPWIJrfcxIRopf j/aH5187wb31TSgRChN4+KZKaalIC7+PxoaL/Ug9glytEJLgeFKOSZSCAeJLTNOzxo5P qLoP77jojWjA7aq5zmhY2XXEOZ1RcsMPCHLXYNwXVNWNX5iQGMuGy5NGmt6ibFmhKfD0 i2LmsK8jKAtbgAcZtxNFF+93C/X0LHgUXam3IR0N3dUON92T2zaIIqVUWkQilrVZlZXK xJihDKITQvuW/J36TQrVTszyQzH8EWALqIrUedV64Klt06OqHo+LiIfe4SkQixY3rl2k vP7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907375; x=1771512175; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=2ZdsYzHGBqsRtffyKG+WZutAT5K1mgYEx62Q5cTRUDo=; b=Nk/mgJ4J/BIP1iYLGBAuh91esvZBbcU8zW9fowpyu42oQcoKigmZy0osNDDwLETTcN OrN+QCcub3L8tmWS5Ysp0G3tNypz9wV2me8COKmotDX6m7LybPUyR+siRFmtle1J6Vov cMAIZmJ9iwlcEDBhSAp9hKgttb5uX4BA8EntWrWYlUJrh8vkuomgryOBhkH7bjNiNFra n94dIELRAWqGbzlAQmD0myAoXQjNgea0aBtxCaTu16vkoa9qE6/8Z6Aqlf/fIphdCRxW nNeEHB7jiN2aEoo1027I1gjcGpHLl4HRH/UWAcOJpaNA7qWyKLWpVn8/0L8XU+JIh5z5 k5DQ== X-Gm-Message-State: AOJu0YxDiYnLEH1RPgTSSQKzFLN7e0V+9GqpvpxviOQa1Jqp7TBKb3nA 9QY5hb3gUuxdkwMrbuEaOC+OCjOGhunbMI1Mz5stsIo8GzudO2jNz+faw/dDtZ6WOpkrN80RRFe js6uPCymTlXcApWKy/K5JbUTlc8TPJX9rJrCOR6PqrcJ+j3qRlu3dgJyUHILQdUqzc7n6Ap62Uq jw3/Yqe6SfMzVKNnX0JY+GVFlsC/GR4TY1/VDqx9Kj X-Gm-Gg: AZuq6aLFPnFRWOh0DYfmJwHjci4bwtrKBtJw54H2DDu5xe3WZ00AREHnfAERsmwiwVq EcfNIOcMk4iEV0wM+yoshozdp69YYk7vqJMdPtBSOF1WZHA8in2+GrFvcB912L4+rSwY/IH2guP JNc5e+3H+qGdyTHSG8BDfYdcYCHNwL8BBNeRyU+w4iTGzM3dtlclwC5xG7v7Bz9zdr7RLsbIYnT 5YhFwdgZyTxFz3iH2j1s2xYo4XHmcPEvtNWE873Jb3QMjRIHOzrw830L69m+4gq2myFYqIJrNSL DvihGpi63J+6o+/YJ12OOTzSq2qm0puZJAkZOaPAvQnxiJH3ixEggFm4ZH9Mg+jGVMWR644AGwm 0GWwZCGrNLjydB2wMsfwztKjmfZC6KqtOBx4ac/Askjj150MR2oIu3DJju5+kCov5G4Q3sriXJx 4kxf4G1FHYstvLmoSvQnWAC8rXvmDlGuSKuKQ6p1Ce6B61Ale5rX4= X-Received: by 2002:a05:600d:486:10b0:483:6a8d:b2f9 with SMTP id 5b1f17b1804b1-4836a8db4f0mr26095115e9.5.1770907375085; Thu, 12 Feb 2026 06:42:55 -0800 (PST) X-Received: by 2002:a05:600d:486:10b0:483:6a8d:b2f9 with SMTP id 5b1f17b1804b1-4836a8db4f0mr26094485e9.5.1770907374464; Thu, 12 Feb 2026 06:42:54 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Igor Mammedov , Zhao Liu Subject: [PULL 05/41] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field Date: Thu, 12 Feb 2026 15:42:07 +0100 Message-ID: <20260212144244.22579-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907504603158500 From: Philippe Mathieu-Daud=C3=A9 Now all PC & Q35 machiens are using modern hotplug from the beginning, and all legacy_cpu_hotplug flags keep false during runtime. So it's safe to remove legacy_cpu_hotplug flags and related properties, with unused gpe_cpu field. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Igor Mammedov Signed-off-by: Zhao Liu Acked-by: Igor Mammedov Link: https://lore.kernel.org/r/20260108033051.777361-5-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/acpi/ich9.h | 2 -- include/hw/acpi/piix4.h | 2 -- include/hw/i386/pc.h | 3 --- hw/acpi/ich9.c | 40 ++++------------------------------------ hw/acpi/piix4.c | 40 ++++------------------------------------ hw/i386/acpi-build.c | 4 +--- 6 files changed, 9 insertions(+), 82 deletions(-) diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index 245fe08dc24..6a21472eb32 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -53,8 +53,6 @@ typedef struct ICH9LPCPMRegs { uint32_t pm_io_base; Notifier powerdown_notifier; =20 - bool cpu_hotplug_legacy; - AcpiCpuHotplug gpe_cpu; CPUHotplugState cpuhp_state; =20 bool keep_pci_slot_hpc; diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h index eb1c122d806..e075f0cbeaf 100644 --- a/include/hw/acpi/piix4.h +++ b/include/hw/acpi/piix4.h @@ -63,8 +63,6 @@ struct PIIX4PMState { uint8_t disable_s4; uint8_t s4_val; =20 - bool cpu_hotplug_legacy; - AcpiCpuHotplug gpe_cpu; CPUHotplugState cpuhp_state; =20 MemHotplugState acpi_memory_hotplug; diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 1890c61a387..7f8cf94138a 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -110,9 +110,6 @@ struct PCMachineClass { bool enforce_amd_1tb_hole; bool isa_bios_alias; =20 - /* generate legacy CPU hotplug AML */ - bool legacy_cpu_hotplug; - /* use PVH to load kernels that support this feature */ bool pvh_enabled; =20 diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 54590129c69..f254f387971 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -339,26 +339,6 @@ static void ich9_pm_get_gpe0_blk(Object *obj, Visitor = *v, const char *name, visit_type_uint32(v, name, &value, errp); } =20 -static bool ich9_pm_get_cpu_hotplug_legacy(Object *obj, Error **errp) -{ - ICH9LPCState *s =3D ICH9_LPC_DEVICE(obj); - - return s->pm.cpu_hotplug_legacy; -} - -static void ich9_pm_set_cpu_hotplug_legacy(Object *obj, bool value, - Error **errp) -{ - ICH9LPCState *s =3D ICH9_LPC_DEVICE(obj); - - assert(!value); - if (s->pm.cpu_hotplug_legacy && value =3D=3D false) { - acpi_switch_to_modern_cphp(&s->pm.gpe_cpu, &s->pm.cpuhp_state, - ICH9_CPU_HOTPLUG_IO_BASE); - } - s->pm.cpu_hotplug_legacy =3D value; -} - static bool ich9_pm_get_enable_tco(Object *obj, Error **errp) { ICH9LPCState *s =3D ICH9_LPC_DEVICE(obj); @@ -403,7 +383,6 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs = *pm) { static const uint32_t gpe0_len =3D ICH9_PMIO_GPE0_LEN; pm->acpi_memory_hotplug.is_enabled =3D true; - pm->cpu_hotplug_legacy =3D false; pm->disable_s3 =3D 0; pm->disable_s4 =3D 0; pm->s4_val =3D 2; @@ -422,9 +401,6 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs = *pm) NULL, NULL, pm); object_property_add_uint32_ptr(obj, ACPI_PM_PROP_GPE0_BLK_LEN, &gpe0_len, OBJ_PROP_FLAG_READ); - object_property_add_bool(obj, "cpu-hotplug-legacy", - ich9_pm_get_cpu_hotplug_legacy, - ich9_pm_set_cpu_hotplug_legacy); object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S3_DISABLED, &pm->disable_s3, OBJ_PROP_FLAG_READWRITE= ); object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_DISABLED, @@ -477,11 +453,7 @@ void ich9_pm_device_plug_cb(HotplugHandler *hotplug_de= v, DeviceState *dev, dev, errp); } } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { - if (lpc->pm.cpu_hotplug_legacy) { - legacy_acpi_cpu_plug_cb(hotplug_dev, &lpc->pm.gpe_cpu, dev, er= rp); - } else { - acpi_cpu_plug_cb(hotplug_dev, &lpc->pm.cpuhp_state, dev, errp); - } + acpi_cpu_plug_cb(hotplug_dev, &lpc->pm.cpuhp_state, dev, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { acpi_pcihp_device_plug_cb(hotplug_dev, &lpc->pm.acpi_pci_hotplug, dev, errp); @@ -500,8 +472,7 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler *h= otplug_dev, acpi_memory_unplug_request_cb(hotplug_dev, &lpc->pm.acpi_memory_hotplug, dev, errp); - } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) && - !lpc->pm.cpu_hotplug_legacy) { + } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { uint64_t negotiated =3D lpc->smi_negotiated_features; =20 if (negotiated & BIT_ULL(ICH9_LPC_SMI_F_BROADCAST_BIT) && @@ -533,8 +504,7 @@ void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_d= ev, DeviceState *dev, =20 if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { acpi_memory_unplug_cb(&lpc->pm.acpi_memory_hotplug, dev, errp); - } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) && - !lpc->pm.cpu_hotplug_legacy) { + } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { acpi_cpu_unplug_cb(&lpc->pm.cpuhp_state, dev, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { acpi_pcihp_device_unplug_cb(hotplug_dev, &lpc->pm.acpi_pci_hotplug, @@ -556,7 +526,5 @@ void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInf= oList ***list) ICH9LPCState *s =3D ICH9_LPC_DEVICE(adev); =20 acpi_memory_ospm_status(&s->pm.acpi_memory_hotplug, list); - if (!s->pm.cpu_hotplug_legacy) { - acpi_cpu_ospm_status(&s->pm.cpuhp_state, list); - } + acpi_cpu_ospm_status(&s->pm.cpuhp_state, list); } diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 0eda692084d..05f9d6372a9 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -336,11 +336,7 @@ static void piix4_device_plug_cb(HotplugHandler *hotpl= ug_dev, } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { acpi_pcihp_device_plug_cb(hotplug_dev, &s->acpi_pci_hotplug, dev, = errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { - if (s->cpu_hotplug_legacy) { - legacy_acpi_cpu_plug_cb(hotplug_dev, &s->gpe_cpu, dev, errp); - } else { - acpi_cpu_plug_cb(hotplug_dev, &s->cpuhp_state, dev, errp); - } + acpi_cpu_plug_cb(hotplug_dev, &s->cpuhp_state, dev, errp); } else { g_assert_not_reached(); } @@ -358,8 +354,7 @@ static void piix4_device_unplug_request_cb(HotplugHandl= er *hotplug_dev, } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { acpi_pcihp_device_unplug_request_cb(hotplug_dev, &s->acpi_pci_hotp= lug, dev, errp); - } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) && - !s->cpu_hotplug_legacy) { + } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { acpi_cpu_unplug_request_cb(hotplug_dev, &s->cpuhp_state, dev, errp= ); } else { error_setg(errp, "acpi: device unplug request for not supported de= vice" @@ -378,8 +373,7 @@ static void piix4_device_unplug_cb(HotplugHandler *hotp= lug_dev, } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { acpi_pcihp_device_unplug_cb(hotplug_dev, &s->acpi_pci_hotplug, dev, errp); - } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) && - !s->cpu_hotplug_legacy) { + } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { acpi_cpu_unplug_cb(&s->cpuhp_state, dev, errp); } else { error_setg(errp, "acpi: device unplug for not supported device" @@ -523,26 +517,6 @@ static const MemoryRegionOps piix4_gpe_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 - -static bool piix4_get_cpu_hotplug_legacy(Object *obj, Error **errp) -{ - PIIX4PMState *s =3D PIIX4_PM(obj); - - return s->cpu_hotplug_legacy; -} - -static void piix4_set_cpu_hotplug_legacy(Object *obj, bool value, Error **= errp) -{ - PIIX4PMState *s =3D PIIX4_PM(obj); - - assert(!value); - if (s->cpu_hotplug_legacy && value =3D=3D false) { - acpi_switch_to_modern_cphp(&s->gpe_cpu, &s->cpuhp_state, - PIIX4_CPU_HOTPLUG_IO_BASE); - } - s->cpu_hotplug_legacy =3D value; -} - static void piix4_acpi_system_hot_add_init(MemoryRegion *parent, PCIBus *bus, PIIX4PMState *s) { @@ -558,10 +532,6 @@ static void piix4_acpi_system_hot_add_init(MemoryRegio= n *parent, qbus_set_hotplug_handler(BUS(pci_get_bus(PCI_DEVICE(s))), OBJECT(s= )); } =20 - s->cpu_hotplug_legacy =3D false; - object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy", - piix4_get_cpu_hotplug_legacy, - piix4_set_cpu_hotplug_legacy); cpu_hotplug_hw_init(parent, OBJECT(s), &s->cpuhp_state, PIIX4_CPU_HOTPLUG_IO_BASE); =20 @@ -576,9 +546,7 @@ static void piix4_ospm_status(AcpiDeviceIf *adev, ACPIO= STInfoList ***list) PIIX4PMState *s =3D PIIX4_PM(adev); =20 acpi_memory_ospm_status(&s->acpi_memory_hotplug, list); - if (!s->cpu_hotplug_legacy) { - acpi_cpu_ospm_status(&s->cpuhp_state, list); - } + acpi_cpu_ospm_status(&s->cpuhp_state, list); } =20 static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index cdd72cbcaa0..22bd497c9be 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -960,9 +960,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, } aml_append(dsdt, scope); =20 - if (pcmc->legacy_cpu_hotplug) { - build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base); - } else { + { CPUHotplugFeatures opts =3D { .acpi_1_compatible =3D true, .smi_path =3D pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL, --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907641; cv=none; d=zohomail.com; s=zohoarc; b=in7Fh4N2TN1CpUeN5Y4D9ISk+qhzhUP68mvlQbdljyKDoMuOgB5jjut0z/Rk3//h4fsEL8vdf8L3qFCil8zXMWxpbeTLwDDj3R1DLZKBRRdTYk982+poWk0Wq8GKdtbuGoLOMJzhtiMySWC/pV9pEW/0crX2i1NaunYZ3lDtg+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907641; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MACQ+pwC/87xSTSNF00O4q88/dO5XENN7b3QlytZ5Lk=; b=Whhp+hUFkJs4mMMfffLBiO11nKJBG5olu03kc3WIAA9XP7K/3WT6esuyf6WzwzJUuVc5QWWgEs5MdF0C4CQ2Dt5BuLlYU2bhjpEZccIdcGKnWl+3MCTuJt3wmgRvPWsWkoxNfTLw/6/clbvkM+Xuv1jql42845LhuR1B+9vuXbI= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907641597307.9680363191287; Thu, 12 Feb 2026 06:47:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvP-0005vI-EE; Thu, 12 Feb 2026 09:44:11 -0500 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 1vqXux-0005Nf-JJ for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuI-0005u5-Pa for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:36 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-142-2p9q5RaIM56W56udVssbsg-1; Thu, 12 Feb 2026 09:43:00 -0500 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-4376c206493so3657508f8f.0 for ; Thu, 12 Feb 2026 06:43:00 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43783d46f9csm12212405f8f.10.2026.02.12.06.42.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:42:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MACQ+pwC/87xSTSNF00O4q88/dO5XENN7b3QlytZ5Lk=; b=VjqIMR/TMKja4MVjKmy9zoP34D3QXGEUUGGkheT7h8KFw4Z/lhiJM3a9sDpT3PU9tXWdK1 mZmWR1RYvt0SNMYMIg4cg7aFgaNROBRWfjRUW2EMpV4DWUOSohpdsaOm9C7q3Arka5YrXo ZFh9lYu9cmIXvVFEb7eqtAEuulIbtIo= X-MC-Unique: 2p9q5RaIM56W56udVssbsg-1 X-Mimecast-MFC-AGG-ID: 2p9q5RaIM56W56udVssbsg_1770907379 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907379; x=1771512179; 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=MACQ+pwC/87xSTSNF00O4q88/dO5XENN7b3QlytZ5Lk=; b=VwIlsRLpmu4piVHA9PVMu6J4Pk+BphF9rH5Om6VLDWfca111JeLdwK2GP8xX0Tp07g 7dXV5HlBeoy85YB47Neqn3sQNvuI0lXBzk25WF408iPdyEMpiMjaApXaiYSRpqRS7pxG ofYd+edUHmfTI0UFw874e0xE02gv8ZJa8TbOVFOVEeQLmQj1XgB0qveVAAfv+X6AHeZL fjNqYMux9bTPOldhKBwRVRPkwRpC2ZtL/1A9en36Ij5c9xT7d0d7HFuWY0CfJvNG4TgP W06/pVPE/G1iFSn3fX1h9qx7oR+2G7GmmwpbgnH07ejxE4waKNTfwffua67FbszRFzIE 3UhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907379; x=1771512179; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MACQ+pwC/87xSTSNF00O4q88/dO5XENN7b3QlytZ5Lk=; b=BIbwziaPXPQpWVpyEC5xUB6pS8bXszOmpBAYScb+RtKdtmH7yreKSGF464lOurwY6Q NTYB95PQaOL1ZQO12a2rzyu0VPPJtEaKSL5uwV4uei/5Ef4VrJBKVsiJnTgSRaitbgjP yMvKZDJLmOeMQDoyVSS/qBpPGXIFXr15nf1L5DHCD+67bJ+dQ5+ljyd9RRT2LEbZxOjs wxUN07M4puKksdAIFKfF9c67uIJ8gsPuSitpmKB8AxdPfOUWc/rOWQe/pGMSGI88ffOI IpbaN914u6WDd5yHIgdGLWABtyN4OvkyCS6Gq9tru2PPgRs+Kfb2SBgf6J8FLaxrJ5Ex HG7Q== X-Gm-Message-State: AOJu0YwsGzY+AQnXX1GfmC3Z48htnBidXoGwCB9FjkVXLK3shh4EhpjE tUAS6/a74819dgmPlUDc9qGI/vWgH7uaCVYMK1/hU56uytMaGIpn8nMpbBptvb+0TE3GX5/Cmmy AisD06qnFkn5ZIHAeGIPmB7NNtznuFZ/sUqiJGT7cuMB5hUQishK+Oa+w96Dsi+eY1YVKcoE0KM brtBprQNOu1FAdgLchGpK5evmib7dZZW97Hzm1aE+L X-Gm-Gg: AZuq6aLSUrx6vZfWxVNWoD1x/CM2dSy5855j5AiWmefHcxUch4sW8JvJOajWjm3pIKE sKd6PbaDCoPhKXHWCsS93TB6OADP4S5+XwFsuzgHCAAk7Cv7lvfHdcczFTLJ8iENBjVpXiEEb91 nVVJg66DKeAK/3jeII74UXPx915qjgu/Ff9gco/2gDj0Fpoq7KYYiDynKGG/Vg0baGB5a8Eoha8 H2czHj3cp5y7C7RGWLkahjdJf0Gr28js6g/mBACdpJlpUw5xqutZf28/Vix6Ao7GQxQdpGS6U44 jxECLvdlWhusVHK9YghkDoi2W9LIMdMay5NMAI1Ssgd5zE37m5/ypBTOavt4H9EBXQTNMw7pB5I wlOvGW4ab7JHe7HpQRpv8g7jSLU8hyMyJ9GFC+4y9JGLtGVmEMZMoo7YV8sl8ZHrJpPcbE5rpWU ED9EOa+wb541RYYaud4X7NNPV4cb/tAcMf3hORvC2Cx3RGNmrG3Pc= X-Received: by 2002:a05:6000:4023:b0:430:f5ed:83e3 with SMTP id ffacd0b85a97d-4378aa01778mr4321096f8f.6.1770907378475; Thu, 12 Feb 2026 06:42:58 -0800 (PST) X-Received: by 2002:a05:6000:4023:b0:430:f5ed:83e3 with SMTP id ffacd0b85a97d-4378aa01778mr4321034f8f.6.1770907377716; Thu, 12 Feb 2026 06:42:57 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu , Igor Mammedov Subject: [PULL 06/41] acpi: Remove legacy cpu hotplug utilities Date: Thu, 12 Feb 2026 15:42:08 +0100 Message-ID: <20260212144244.22579-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907644043154100 Content-Type: text/plain; charset="utf-8" From: Zhao Liu The cpu_hotplug.h and cpu_hotplug.c contain legacy cpu hotplug utilities. Now there's no use case of legacy cpu hotplug, so it's safe to drop legacy cpu hotplug support totally. Signed-off-by: Igor Mammedov Signed-off-by: Zhao Liu Acked-by: Igor Mammedov Link: https://lore.kernel.org/r/20260108033051.777361-6-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/acpi/ich9.h | 2 +- include/hw/acpi/piix4.h | 2 +- hw/acpi/acpi-cpu-hotplug-stub.c | 19 +- hw/acpi/cpu_hotplug.c | 348 -------------------------------- hw/acpi/generic_event_device.c | 1 + hw/acpi/ich9.c | 1 + hw/acpi/piix4.c | 2 +- hw/i386/acpi-build.c | 1 + hw/i386/pc.c | 3 +- hw/i386/x86-common.c | 1 - hw/acpi/meson.build | 2 +- 11 files changed, 10 insertions(+), 372 deletions(-) delete mode 100644 hw/acpi/cpu_hotplug.c diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index 6a21472eb32..019f0915c11 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -22,12 +22,12 @@ #define HW_ACPI_ICH9_H =20 #include "hw/acpi/acpi.h" -#include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/cpu.h" #include "hw/acpi/pcihp.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/ich9_tco.h" +#include "hw/acpi/cpu.h" =20 #define ACPI_PCIHP_ADDR_ICH9 0x0cc0 =20 diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h index e075f0cbeaf..863382a814a 100644 --- a/include/hw/acpi/piix4.h +++ b/include/hw/acpi/piix4.h @@ -24,11 +24,11 @@ =20 #include "hw/pci/pci_device.h" #include "hw/acpi/acpi.h" -#include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/pcihp.h" #include "hw/i2c/pm_smbus.h" #include "hw/isa/apm.h" +#include "hw/acpi/cpu.h" =20 #define TYPE_PIIX4_PM "PIIX4_PM" OBJECT_DECLARE_SIMPLE_TYPE(PIIX4PMState, PIIX4_PM) diff --git a/hw/acpi/acpi-cpu-hotplug-stub.c b/hw/acpi/acpi-cpu-hotplug-stu= b.c index 9872dd55e43..72c5f05f5c4 100644 --- a/hw/acpi/acpi-cpu-hotplug-stub.c +++ b/hw/acpi/acpi-cpu-hotplug-stub.c @@ -1,22 +1,10 @@ #include "qemu/osdep.h" -#include "hw/acpi/cpu_hotplug.h" #include "migration/vmstate.h" - +#include "hw/acpi/cpu.h" =20 /* Following stubs are all related to ACPI cpu hotplug */ const VMStateDescription vmstate_cpu_hotplug; =20 -void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe_cpu, - CPUHotplugState *cpuhp_state, - uint16_t io_port) -{ -} - -void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, - AcpiCpuHotplug *gpe_cpu, uint16_t base) -{ -} - void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner, CPUHotplugState *state, hwaddr base_addr) { @@ -31,11 +19,6 @@ void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, { } =20 -void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, - AcpiCpuHotplug *g, DeviceState *dev, Error **= errp) -{ -} - void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st, DeviceState *dev, Error **errp) { diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c deleted file mode 100644 index aa0e1e3efa5..00000000000 --- a/hw/acpi/cpu_hotplug.c +++ /dev/null @@ -1,348 +0,0 @@ -/* - * QEMU ACPI hotplug utilities - * - * Copyright (C) 2013 Red Hat Inc - * - * Authors: - * Igor Mammedov - * - * This work is licensed under the terms of the GNU GPL, version 2 or late= r. - * See the COPYING file in the top-level directory. - */ -#include "qemu/osdep.h" -#include "hw/acpi/cpu_hotplug.h" -#include "qapi/error.h" -#include "hw/core/cpu.h" -#include "hw/i386/x86.h" -#include "hw/pci/pci_device.h" -#include "qemu/error-report.h" - -#define CPU_EJECT_METHOD "CPEJ" -#define CPU_MAT_METHOD "CPMA" -#define CPU_ON_BITMAP "CPON" -#define CPU_STATUS_METHOD "CPST" -#define CPU_STATUS_MAP "PRS" -#define CPU_SCAN_METHOD "PRSC" - -static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned int si= ze) -{ - AcpiCpuHotplug *cpus =3D opaque; - uint64_t val =3D cpus->sts[addr]; - - return val; -} - -static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data, - unsigned int size) -{ - /* firmware never used to write in CPU present bitmap so use - this fact as means to switch QEMU into modern CPU hotplug - mode by writing 0 at the beginning of legacy CPU bitmap - */ - if (addr =3D=3D 0 && data =3D=3D 0) { - AcpiCpuHotplug *cpus =3D opaque; - object_property_set_bool(cpus->device, "cpu-hotplug-legacy", false, - &error_abort); - } -} - -static const MemoryRegionOps AcpiCpuHotplug_ops =3D { - .read =3D cpu_status_read, - .write =3D cpu_status_write, - .endianness =3D DEVICE_LITTLE_ENDIAN, - .valid =3D { - .min_access_size =3D 1, - .max_access_size =3D 4, - }, - .impl =3D { - .max_access_size =3D 1, - }, -}; - -static void acpi_set_cpu_present_bit(AcpiCpuHotplug *g, CPUState *cpu, - bool *swtchd_to_modern) -{ - int64_t cpu_id; - - cpu_id =3D cpu->cc->get_arch_id(cpu); - if ((cpu_id / 8) >=3D ACPI_GPE_PROC_LEN) { - object_property_set_bool(g->device, "cpu-hotplug-legacy", false, - &error_abort); - *swtchd_to_modern =3D true; - return; - } - - *swtchd_to_modern =3D false; - g->sts[cpu_id / 8] |=3D (1 << (cpu_id % 8)); -} - -void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, - AcpiCpuHotplug *g, DeviceState *dev, Error **= errp) -{ - bool swtchd_to_modern; - Error *local_err =3D NULL; - - acpi_set_cpu_present_bit(g, CPU(dev), &swtchd_to_modern); - if (swtchd_to_modern) { - /* propagate the hotplug to the modern interface */ - hotplug_handler_plug(hotplug_dev, dev, &local_err); - } else { - acpi_send_event(DEVICE(hotplug_dev), ACPI_CPU_HOTPLUG_STATUS); - } -} - -void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, - AcpiCpuHotplug *gpe_cpu, uint16_t base) -{ - CPUState *cpu; - bool swtchd_to_modern; - - memory_region_init_io(&gpe_cpu->io, owner, &AcpiCpuHotplug_ops, - gpe_cpu, "acpi-cpu-hotplug", ACPI_GPE_PROC_LEN); - memory_region_add_subregion(parent, base, &gpe_cpu->io); - gpe_cpu->device =3D owner; - - CPU_FOREACH(cpu) { - acpi_set_cpu_present_bit(gpe_cpu, cpu, &swtchd_to_modern); - } -} - -void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe_cpu, - CPUHotplugState *cpuhp_state, - uint16_t io_port) -{ - MemoryRegion *parent =3D pci_address_space_io(PCI_DEVICE(gpe_cpu->devi= ce)); - - memory_region_del_subregion(parent, &gpe_cpu->io); - cpu_hotplug_hw_init(parent, gpe_cpu->device, cpuhp_state, io_port); -} - -void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine, - uint16_t io_base) -{ - Aml *dev; - Aml *crs; - Aml *pkg; - Aml *field; - Aml *method; - Aml *if_ctx; - Aml *else_ctx; - int i, apic_idx; - Aml *sb_scope =3D aml_scope("_SB"); - uint8_t madt_tmpl[8] =3D {0x00, 0x08, 0x00, 0x00, 0x00, 0, 0, 0}; - Aml *cpu_id =3D aml_arg(1); - Aml *apic_id =3D aml_arg(0); - Aml *cpu_on =3D aml_local(0); - Aml *madt =3D aml_local(1); - Aml *cpus_map =3D aml_name(CPU_ON_BITMAP); - Aml *zero =3D aml_int(0); - Aml *one =3D aml_int(1); - MachineClass *mc =3D MACHINE_GET_CLASS(machine); - const CPUArchIdList *apic_ids =3D mc->possible_cpu_arch_ids(machine); - X86MachineState *x86ms =3D X86_MACHINE(machine); - - /* - * _MAT method - creates an madt apic buffer - * apic_id =3D Arg0 =3D Local APIC ID - * cpu_id =3D Arg1 =3D Processor ID - * cpu_on =3D Local0 =3D CPON flag for this cpu - * madt =3D Local1 =3D Buffer (in madt apic form) to return - */ - method =3D aml_method(CPU_MAT_METHOD, 2, AML_NOTSERIALIZED); - aml_append(method, - aml_store(aml_derefof(aml_index(cpus_map, apic_id)), cpu_on)); - aml_append(method, - aml_store(aml_buffer(sizeof(madt_tmpl), madt_tmpl), madt)); - /* Update the processor id, lapic id, and enable/disable status */ - aml_append(method, aml_store(cpu_id, aml_index(madt, aml_int(2)))); - aml_append(method, aml_store(apic_id, aml_index(madt, aml_int(3)))); - aml_append(method, aml_store(cpu_on, aml_index(madt, aml_int(4)))); - aml_append(method, aml_return(madt)); - aml_append(sb_scope, method); - - /* - * _STA method - return ON status of cpu - * apic_id =3D Arg0 =3D Local APIC ID - * cpu_on =3D Local0 =3D CPON flag for this cpu - */ - method =3D aml_method(CPU_STATUS_METHOD, 1, AML_NOTSERIALIZED); - aml_append(method, - aml_store(aml_derefof(aml_index(cpus_map, apic_id)), cpu_on)); - if_ctx =3D aml_if(cpu_on); - { - aml_append(if_ctx, aml_return(aml_int(0xF))); - } - aml_append(method, if_ctx); - else_ctx =3D aml_else(); - { - aml_append(else_ctx, aml_return(zero)); - } - aml_append(method, else_ctx); - aml_append(sb_scope, method); - - method =3D aml_method(CPU_EJECT_METHOD, 2, AML_NOTSERIALIZED); - aml_append(method, aml_sleep(200)); - aml_append(sb_scope, method); - - method =3D aml_method(CPU_SCAN_METHOD, 0, AML_NOTSERIALIZED); - { - Aml *while_ctx, *if_ctx2, *else_ctx2; - Aml *bus_check_evt =3D aml_int(1); - Aml *remove_evt =3D aml_int(3); - Aml *status_map =3D aml_local(5); /* Local5 =3D active cpu bitmap = */ - Aml *byte =3D aml_local(2); /* Local2 =3D last read byte from bitm= ap */ - Aml *idx =3D aml_local(0); /* Processor ID / APIC ID iterator */ - Aml *is_cpu_on =3D aml_local(1); /* Local1 =3D CPON flag for cpu */ - Aml *status =3D aml_local(3); /* Local3 =3D active state for cpu */ - - aml_append(method, aml_store(aml_name(CPU_STATUS_MAP), status_map)= ); - aml_append(method, aml_store(zero, byte)); - aml_append(method, aml_store(zero, idx)); - - /* While (idx < SizeOf(CPON)) */ - while_ctx =3D aml_while(aml_lless(idx, aml_sizeof(cpus_map))); - aml_append(while_ctx, - aml_store(aml_derefof(aml_index(cpus_map, idx)), is_cpu_on)); - - if_ctx =3D aml_if(aml_and(idx, aml_int(0x07), NULL)); - { - /* Shift down previously read bitmap byte */ - aml_append(if_ctx, aml_shiftright(byte, one, byte)); - } - aml_append(while_ctx, if_ctx); - - else_ctx =3D aml_else(); - { - /* Read next byte from cpu bitmap */ - aml_append(else_ctx, aml_store(aml_derefof(aml_index(status_ma= p, - aml_shiftright(idx, aml_int(3), NULL))), byte)); - } - aml_append(while_ctx, else_ctx); - - aml_append(while_ctx, aml_store(aml_and(byte, one, NULL), status)); - if_ctx =3D aml_if(aml_lnot(aml_equal(is_cpu_on, status))); - { - /* State change - update CPON with new state */ - aml_append(if_ctx, aml_store(status, aml_index(cpus_map, idx))= ); - if_ctx2 =3D aml_if(aml_equal(status, one)); - { - aml_append(if_ctx2, - aml_call2(AML_NOTIFY_METHOD, idx, bus_check_evt)); - } - aml_append(if_ctx, if_ctx2); - else_ctx2 =3D aml_else(); - { - aml_append(else_ctx2, - aml_call2(AML_NOTIFY_METHOD, idx, remove_evt)); - } - } - aml_append(if_ctx, else_ctx2); - aml_append(while_ctx, if_ctx); - - aml_append(while_ctx, aml_increment(idx)); /* go to next cpu */ - aml_append(method, while_ctx); - } - aml_append(sb_scope, method); - - /* The current AML generator can cover the APIC ID range [0..255], - * inclusive, for VCPU hotplug. */ - QEMU_BUILD_BUG_ON(ACPI_CPU_HOTPLUG_ID_LIMIT > 256); - if (x86ms->apic_id_limit > ACPI_CPU_HOTPLUG_ID_LIMIT) { - error_report("max_cpus is too large. APIC ID of last CPU is %u", - x86ms->apic_id_limit - 1); - exit(1); - } - - /* create PCI0.PRES device and its _CRS to reserve CPU hotplug MMIO */ - dev =3D aml_device("PCI0." stringify(CPU_HOTPLUG_RESOURCE_DEVICE)); - aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A06"))); - aml_append(dev, - aml_name_decl("_UID", aml_string("CPU Hotplug resources")) - ); - /* device present, functioning, decoding, not shown in UI */ - aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); - crs =3D aml_resource_template(); - aml_append(crs, - aml_io(AML_DECODE16, io_base, io_base, 1, ACPI_GPE_PROC_LEN) - ); - aml_append(dev, aml_name_decl("_CRS", crs)); - aml_append(sb_scope, dev); - /* declare CPU hotplug MMIO region and PRS field to access it */ - aml_append(sb_scope, aml_operation_region( - "PRST", AML_SYSTEM_IO, aml_int(io_base), ACPI_GPE_PROC_LEN)); - field =3D aml_field("PRST", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE); - aml_append(field, aml_named_field("PRS", 256)); - aml_append(sb_scope, field); - - /* build Processor object for each processor */ - for (i =3D 0; i < apic_ids->len; i++) { - int cpu_apic_id =3D apic_ids->cpus[i].arch_id; - - assert(cpu_apic_id < ACPI_CPU_HOTPLUG_ID_LIMIT); - - dev =3D aml_processor(i, 0, 0, "CP%.02X", cpu_apic_id); - - method =3D aml_method("_MAT", 0, AML_NOTSERIALIZED); - aml_append(method, - aml_return(aml_call2(CPU_MAT_METHOD, - aml_int(cpu_apic_id), aml_int(i)) - )); - aml_append(dev, method); - - method =3D aml_method("_STA", 0, AML_NOTSERIALIZED); - aml_append(method, - aml_return(aml_call1(CPU_STATUS_METHOD, aml_int(cpu_apic_id)))= ); - aml_append(dev, method); - - method =3D aml_method("_EJ0", 1, AML_NOTSERIALIZED); - aml_append(method, - aml_return(aml_call2(CPU_EJECT_METHOD, aml_int(cpu_apic_id), - aml_arg(0))) - ); - aml_append(dev, method); - - aml_append(sb_scope, dev); - } - - /* build this code: - * Method(NTFY, 2) {If (LEqual(Arg0, 0x00)) {Notify(CP00, Arg1)} ...} - */ - /* Arg0 =3D APIC ID */ - method =3D aml_method(AML_NOTIFY_METHOD, 2, AML_NOTSERIALIZED); - for (i =3D 0; i < apic_ids->len; i++) { - int cpu_apic_id =3D apic_ids->cpus[i].arch_id; - - if_ctx =3D aml_if(aml_equal(aml_arg(0), aml_int(cpu_apic_id))); - aml_append(if_ctx, - aml_notify(aml_name("CP%.02X", cpu_apic_id), aml_arg(1)) - ); - aml_append(method, if_ctx); - } - aml_append(sb_scope, method); - - /* build "Name(CPON, Package() { One, One, ..., Zero, Zero, ... })" - * - * Note: The ability to create variable-sized packages was first - * introduced in ACPI 2.0. ACPI 1.0 only allowed fixed-size packages - * ith up to 255 elements. Windows guests up to win2k8 fail when - * VarPackageOp is used. - */ - pkg =3D x86ms->apic_id_limit <=3D 255 ? aml_package(x86ms->apic_id_lim= it) : - aml_varpackage(x86ms->apic_id_limi= t); - - for (i =3D 0, apic_idx =3D 0; i < apic_ids->len; i++) { - int cpu_apic_id =3D apic_ids->cpus[i].arch_id; - - for (; apic_idx < cpu_apic_id; apic_idx++) { - aml_append(pkg, aml_int(0)); - } - aml_append(pkg, aml_int(apic_ids->cpus[i].cpu ? 1 : 0)); - apic_idx =3D cpu_apic_id + 1; - } - aml_append(sb_scope, aml_name_decl(CPU_ON_BITMAP, pkg)); - aml_append(ctx, sb_scope); - - method =3D aml_method("\\_GPE._E02", 0, AML_NOTSERIALIZED); - aml_append(method, aml_call0("\\_SB." CPU_SCAN_METHOD)); - aml_append(ctx, method); -} diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 6741f46723c..30dab43a00c 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -13,6 +13,7 @@ #include "qapi/error.h" #include "hw/acpi/acpi.h" #include "hw/acpi/pcihp.h" +#include "hw/acpi/cpu.h" #include "hw/acpi/generic_event_device.h" #include "hw/pci/pci.h" #include "hw/core/irq.h" diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index f254f387971..bbb1bd60a20 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -40,6 +40,7 @@ #include "hw/southbridge/ich9.h" #include "hw/mem/pc-dimm.h" #include "hw/mem/nvdimm.h" +#include "hw/acpi/pc-hotplug.h" =20 static void ich9_pm_update_sci_fn(ACPIREGS *regs) { diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 05f9d6372a9..138ac3d3940 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -33,7 +33,6 @@ #include "system/xen.h" #include "qapi/error.h" #include "qemu/range.h" -#include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/cpu.h" #include "hw/core/hotplug.h" #include "hw/mem/pc-dimm.h" @@ -43,6 +42,7 @@ #include "migration/vmstate.h" #include "hw/core/cpu.h" #include "qom/object.h" +#include "hw/acpi/pc-hotplug.h" =20 #define GPE_BASE 0xafe0 #define GPE_LEN 4 diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 22bd497c9be..f622b91b76a 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -35,6 +35,7 @@ #include "hw/acpi/acpi-defs.h" #include "hw/acpi/acpi.h" #include "hw/acpi/cpu.h" +#include "hw/acpi/pc-hotplug.h" #include "hw/nvram/fw_cfg.h" #include "hw/acpi/bios-linker-loader.h" #include "hw/acpi/acpi_aml_interface.h" diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5cb074c0a08..716962f24fc 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -48,7 +48,8 @@ #include "hw/xen/xen.h" #include "qobject/qlist.h" #include "qemu/error-report.h" -#include "hw/acpi/cpu_hotplug.h" +#include "hw/acpi/acpi.h" +#include "hw/acpi/pc-hotplug.h" #include "acpi-build.h" #include "hw/mem/nvdimm.h" #include "hw/cxl/cxl_host.h" diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c index c1c92240392..85b90ff4324 100644 --- a/hw/i386/x86-common.c +++ b/hw/i386/x86-common.c @@ -36,7 +36,6 @@ #include "hw/rtc/mc146818rtc.h" #include "target/i386/sev.h" =20 -#include "hw/acpi/cpu_hotplug.h" #include "hw/core/irq.h" #include "hw/core/loader.h" #include "multiboot.h" diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index 56b5d1ec969..66c978aae83 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -6,7 +6,7 @@ acpi_ss.add(files( 'core.c', 'utils.c', )) -acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c', 'cpu_= hotplug.c')) +acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c')) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_false: files('acpi-cpu-hot= plug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_true: files('memory_hot= plug.c')) acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_false: files('acpi-mem-= hotplug-stub.c')) --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770908069; cv=none; d=zohomail.com; s=zohoarc; b=KFeBKCpLo2pnqvWlKPtoqs1cVAqpCn8UifNf75q9VXMg6G087YRkMTCFBloJSqbv78A2VyYxt8nmlABH5kNW2/qC28KlhBcqvS1Ldxa/m8Oj2rfjS1s5v7IkczuC5CSwIgW3gxi5o/yMeD2CtcKURykxNVgSsuYhqwrz0iNOsN0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770908069; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LElDCxwRu1qNcefbJG6vySFgKgBL5nkXOno2oLRLUTc=; b=ReNMTdULMfYkbl21gAIyDXy6lvaVIwoID1PtVGhMIkfbb7ZcmT+hxlV544SOkcupJHVhwjUsZmhQTP6JbjuE5jK6MlrerRLBqPltmMJElRbTFG/hCzAT81FvWkv8Vk6osGRTm92L3x9sPgPlY+XXF3ImkG7eThkCapzLGvNqf+I= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770908069835881.7300455965759; Thu, 12 Feb 2026 06:54:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvI-0005m6-24; Thu, 12 Feb 2026 09:44:04 -0500 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 1vqXuv-0005NZ-Qi for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuK-0005vT-Jd for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:37 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-412-9UzUnUHFNO6Tq6698MNMAQ-1; Thu, 12 Feb 2026 09:43:02 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4806fa4a180so60039125e9.2 for ; Thu, 12 Feb 2026 06:43:02 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835a6137d3sm74497685e9.1.2026.02.12.06.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:42:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LElDCxwRu1qNcefbJG6vySFgKgBL5nkXOno2oLRLUTc=; b=iP0v5Q/GcUPaTUt59w+6WYOiqPnMTtsGNxLI5bnM/wNX+pxG8JPMukwZbmzlTsabVoKXUG +rm6FnD8RNBhY00x0K2MtXaq7/uPIbVhD6neU6+OxfnQ3oWT7dUD0T9vH1kxCMkjUHAR4K Sbdw4ReDdc+77e9NfU1nom9sVVayjUs= X-MC-Unique: 9UzUnUHFNO6Tq6698MNMAQ-1 X-Mimecast-MFC-AGG-ID: 9UzUnUHFNO6Tq6698MNMAQ_1770907381 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907380; x=1771512180; 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=LElDCxwRu1qNcefbJG6vySFgKgBL5nkXOno2oLRLUTc=; b=gzZK8+NOhsSvQ05WzZGcYOXL/dXCii0DlLDRVXZFEco1YfclNaxJlSnV0v2Ujb7NBm UPl/0laV3T109cXxjXe7G5O2fv4DaDsUxTgAKcgA8MzhWB8l9Ap81VW/DeUoxj5zZYq0 bhG+1/nGeWPJ4hjAahgnMemQkhb8bukvcG3KUjfPKZUres9kFOF1Xl7htDfQYj0qAPTl PDdUzXG85o9EYlQ6NyrAYyCnLP/LSmvkdfWqi/tZfIU/yHEwiIUNq89RDNTmLx9BrqQJ 9TF+PB12VKVf9/g+RJ0Mw+aD9Z/5o0eOLEToSc0ek8uiEGUnt29UGL8OAu/5+ceTBWVZ xrWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907380; x=1771512180; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LElDCxwRu1qNcefbJG6vySFgKgBL5nkXOno2oLRLUTc=; b=Oqqf6VNXUlZ6YO20zAe9zgvjmdSMAGLlGf96Laba6ewP3nrq/sJp4QgzMZLN1LxXUl gR2YB9X24o9vzhShDJUwv1ui06Bdkphf2Op8fT2LHtbxTkbZEDaOJ94kqTX3l2e8+pQ3 V/tLWSSXJt7WWyb+Q0/z+expZWjWMEwxOQ140MxdVV25CgQisi/0xvlk+W1SW5ARezHB FSYCXEhNSMinaejBzIWUTPBYjDZVNlobmZs1sqD2DO/HSaDNcmqrwszxUjS3UNEYCgnR FCLg3/ZksUdm8Hd+MPcha2gITCQiOE+Konth4WAf2IoWRV7nqpXKbOoEf5pE0nnaUx8j r0SQ== X-Gm-Message-State: AOJu0YzOD5j0it/Gole+hKMsssIABV2uDNd7jCx17yJBYmPa/D5Dc5uh VYfKl/qzkiQ7ukewcMmWYHxpGDjLQC+Y3ZOJ43Y9QV6EROzmKxu14jI/TISBZq9IH+av9j5+UON WkFvrDh3ilYnwcJIoMGG5c6H0npPHCxHZZ+7aN3q1Cq1PHXE2sBrRMBbUzonMVC61doP3cCQhBa m0rfPKGerKhaky9ATKlSbF8dPEuLul5FliP2etFvZO X-Gm-Gg: AZuq6aJVqdrxdg4fmFvZNWc8AD9JudaFcT/hHb5/M10gwk6OoVQ86uc+hh0noTZ3ZMa fJrUh48ssK4JFVwAj067ZOtMeFigc6K3saFHcYnLAlqd/MtQWsCGupIrTGJkvB6fXwiltXzbHHG +1JHLoiTT7pydcY10NhmTMCj+nD5EeCt1YOIQ6zL9sC4/BBtLh/kwD9dWoz7fRlV68ARdqcQFyo KrjcaFltkjPXfifvuaah2eeFDwX2petirsW4n1TbLJ6Xuc2cLot/QuUl0EI86rca4ptYszyDWgV y9wMZt1tFBjJk9lDMYhfJqnL9UXBAvS9dql6KiE9rYdxLT24yeEVxRmlm76IPOYgzTRHPYRt/X6 /4yvdAbIBoLLRUBw5xyf12vSxcpzqz9kg3d4S+KqU24qIqfN9Fh/CMw6AmVN1Ic+kjf/LrrYYLc LjvaTZNdViu0EWSP0QM7vrE+DiKyDedGzTkxOWgYd0rqw0dqlJsNE= X-Received: by 2002:a05:600c:848d:b0:471:114e:5894 with SMTP id 5b1f17b1804b1-483657166aemr44927685e9.25.1770907379903; Thu, 12 Feb 2026 06:42:59 -0800 (PST) X-Received: by 2002:a05:600c:848d:b0:471:114e:5894 with SMTP id 5b1f17b1804b1-483657166aemr44927195e9.25.1770907379248; Thu, 12 Feb 2026 06:42:59 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu , Igor Mammedov Subject: [PULL 07/41] docs/specs/acpi_cpu_hotplug: Remove legacy cpu hotplug descriptions Date: Thu, 12 Feb 2026 15:42:09 +0100 Message-ID: <20260212144244.22579-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770908072867158500 Content-Type: text/plain; charset="utf-8" From: Zhao Liu Legacy cpu hotplug has been removed totally and machines start with modern cpu hotplug interface directly. Therefore, update the documentation to describe current QEMU cpu hotplug logic. Reviewed-by: Igor Mammedov Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-7-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- docs/specs/acpi_cpu_hotplug.rst | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/docs/specs/acpi_cpu_hotplug.rst b/docs/specs/acpi_cpu_hotplug.= rst index 351057c9676..f4967810004 100644 --- a/docs/specs/acpi_cpu_hotplug.rst +++ b/docs/specs/acpi_cpu_hotplug.rst @@ -8,22 +8,6 @@ ACPI BIOS GPE.2 handler is dedicated for notifying OS abou= t CPU hot-add and hot-remove events. =20 =20 -Legacy ACPI CPU hotplug interface registers -------------------------------------------- - -CPU present bitmap for: - -- ICH9-LPC (IO port 0x0cd8-0xcf7, 1-byte access) -- PIIX-PM (IO port 0xaf00-0xaf1f, 1-byte access) -- One bit per CPU. Bit position reflects corresponding CPU APIC ID. Read-o= nly. -- The first DWORD in bitmap is used in write mode to switch from legacy - to modern CPU hotplug interface, write 0 into it to do switch. - -QEMU sets corresponding CPU bit on hot-add event and issues SCI -with GPE.2 event set. CPU present map is read by ACPI BIOS GPE.2 handler -to notify OS about CPU hot-add events. CPU hot-remove isn't supported. - - Modern ACPI CPU hotplug interface registers ------------------------------------------- =20 @@ -189,20 +173,14 @@ Typical usecases (x86) Detecting and enabling modern CPU hotplug interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ =20 -QEMU starts with legacy CPU hotplug interface enabled. Detecting and -switching to modern interface is based on the 2 legacy CPU hotplug feature= s: +QEMU starts with modern CPU hotplug interface enabled. Use following steps= to +detect modern CPU hotplug interface: =20 -#. Writes into CPU bitmap are ignored. -#. CPU bitmap always has bit #0 set, corresponding to boot CPU. - -Use following steps to detect and enable modern CPU hotplug interface: - -#. Store 0x0 to the 'CPU selector' register, attempting to switch to moder= n mode #. Store 0x0 to the 'CPU selector' register, to ensure valid selector value #. Store 0x0 to the 'Command field' register #. Read the 'Command data 2' register. If read value is 0x0, the modern interface is enabled. - Otherwise legacy or no CPU hotplug interface available + Otherwise no CPU hotplug interface available =20 Get a cpu with pending event ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907960; cv=none; d=zohomail.com; s=zohoarc; b=japNY7QVvHERXNueEUxVtlOUSpMIT2GGh87ti0fn12lkgpdF68nTCMWaPkyk9CsEAOdjulvdpWuyIvnBytmrmOCmd6LYEmeIC8QJVqIYTGHAMgydl7ox0UqLHwQaoRF4u5YrYDD03ulKvIXU/NMh6KQd/D3O2UhRhlvFasF5z8I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907960; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=d6JsA5wWHw+VTqZZzy/lqOjxkeVXzRb1Vn8TkDvQpCE=; b=RiaCfhSqAp1MmwV8+6zVBKdk+BKY8uDsHl+3nvhKdjjPGpAWurJrO4fFwT2NK4emczlP5Icmf2aSH9kmLlmWAmCNYdIBQGB1FbwnGJbESN809wBTGzt38mn1lkg9yDQhW5MSChhZtBJVTBEqUhcqydrmoN5UM1G71D5DFCB1krc= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907960703947.2148117471824; Thu, 12 Feb 2026 06:52:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvQ-0005wT-90; Thu, 12 Feb 2026 09:44:12 -0500 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 1vqXux-0005Ni-Nw for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuN-0005xS-7J for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:41 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-c8ZDWpoMMGS4TdzovVfwKg-1; Thu, 12 Feb 2026 09:43:04 -0500 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-435db8ebc98so2880068f8f.0 for ; Thu, 12 Feb 2026 06:43:04 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43783d46ec6sm12767472f8f.9.2026.02.12.06.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d6JsA5wWHw+VTqZZzy/lqOjxkeVXzRb1Vn8TkDvQpCE=; b=Hz8q91X8ip3Rudc1Jer0G2vQVqjUF5mcDBMIOi9h18Pd2Rxa+fp8gRVmQb2GIEZHUAH6YQ S5Dj3cnEeKie+4U009bxEUV1ccNhcoUaTDmStSv3xkeTIz5TEIKMccr7L49JLHSTa3bGIF gRQAD0ccrDT5b7CzSLMqPYvm4qqhB8s= X-MC-Unique: c8ZDWpoMMGS4TdzovVfwKg-1 X-Mimecast-MFC-AGG-ID: c8ZDWpoMMGS4TdzovVfwKg_1770907384 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907382; x=1771512182; 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=d6JsA5wWHw+VTqZZzy/lqOjxkeVXzRb1Vn8TkDvQpCE=; b=ANJiFclvk6OKOz/ZcnVTw+qR4nbpem6jqlREdGlfdAroojz/mzE7tneHeiHvc6AH01 lif30toY6IKsi0+CGuegDyzBB9c3G+OL1WU2qR7/Kj7oQysWOlsTMwB3D03e+XYMjjKR IzNrQHUX1WUSUfBdLjQOsG/cggu6e5iz86CmVrQxVPD/8NDqU8rp0i4qhPQsPRl5THue Sqg2vAj9+K9RF/9tBPsOExW3RizrjcqcxgD1YeIfCjXYmBzeabfzOqDqXeYwRstXPas2 r/kzQJt+gzsJlPg1e8qddhvFspFWGU3tZ57Lnd8dEeYwXXXhSmtkTUVVrN3IbdtCrIM1 wllg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907382; x=1771512182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=d6JsA5wWHw+VTqZZzy/lqOjxkeVXzRb1Vn8TkDvQpCE=; b=XP+gj1NvKhdtM9zZlZAFyOFr1Pr3TgxtB5gjgKk8HmAOFjZLO12CxRRaGkiV2x1PTL ViIlhJumzbBotrWQpQO5M96fZJt39ziDGIEcUEfDlGsnpCztGmpeEJFAJ1yhvPjp0F+Q mxpD3Uu85ldkjLUajaO1ldoWCFoFeVf+4D11m6fReXgs3KURy7ksGQTQXyxnFQkXiANy x44nDQmkkqBXauBtfhAfAMc4/qIi13/0YKKJTNm3aTBWBH8kJ9lrDNt+TdECUMG6hx41 LKW5DDPUTE/wtU2fBOUZmjHPYPVE0cctOpuMJ2czNNZMwZvlVaT4CoRnxLPX1xBBdMva vPsA== X-Gm-Message-State: AOJu0YwapsSVrnmZzgLjihLnHVZjJiIo9amj6ojdWve5/JfUVu5KA8pg GdryaFOSecPQnSPkhAuCmvxnpaIbbxKcdalJBLUwXgeEwc+nxXsB3V1YGKBt1KsLjeX5cFGWIIP XQM/CmwQGXGwXnGKBmkTikn7beaJFWHZwQUd/dtd08AblZBEDdn7sVgEpqOoZd5Y0cYTTgZC6ej 5lT6PHu4c+Q/7UpW8gAlVZXxGSs1SebJ8OZ56WR1hB X-Gm-Gg: AZuq6aLERh4mqZ9UnTWnnLg6mgPP7qvBgoafX0ZEYFEKEnvMzQs8ZT8hkXdjNI+h8HV RrgraVSGyMCgocpTkJBeBfAXjlWCzW5ILEY1+G+B1V0Mo6fv/a2SfsPitb2/TXeheEYlk5PIIbi QzqK1iBHoayJ7gjkidI969wga4wHmXDUoXOua80wjplkWn3unBTGbzh3fmYZN0hnsvNOsKWgnaI mdMNEHfwYukuDRCWk/L8WfpCwiY3XFF4hYMWIWYodN5dgjBRP5wtwRXpnoPGmf+vhEaSSubidqM WP/m9kZl+l0nKSwkfpNQWLc+5xU0GwJDFeXsIt93aGLlzsKrv0pkU8zWO56PgmwyEzm5BXf/99y nOeAlEruxYuYHi/6ht++XJ48cvEczwNqCkbnntRzWff2DuFcidyn68uHfZgvIB9+lOqUnit6uwZ yxDMU+ndBJ2TmciQxqSgSR1yhdeyOTma7APmAnaiStwxtaqcS+q7A= X-Received: by 2002:a05:6000:4010:b0:430:f68f:ee97 with SMTP id ffacd0b85a97d-4378f178fd3mr4134761f8f.40.1770907381592; Thu, 12 Feb 2026 06:43:01 -0800 (PST) X-Received: by 2002:a05:6000:4010:b0:430:f68f:ee97 with SMTP id ffacd0b85a97d-4378f178fd3mr4134683f8f.40.1770907380818; Thu, 12 Feb 2026 06:43:00 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu , Igor Mammedov Subject: [PULL 08/41] tests/acpi: Update DSDT tables for pc & q35 machines Date: Thu, 12 Feb 2026 15:42:10 +0100 Message-ID: <20260212144244.22579-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907962961154100 Content-Type: text/plain; charset="utf-8" From: Zhao Liu Now the legacy cpu hotplug way has gone away, and there's no _INIT method in DSDT table for modern cpu hotplug support. Update DSDT tables for pc machine, and_INIT methods are removed from DSDT tables: - Method (_INI, 0, Serialized) // _INI: Initialize - { - CSEL =3D Zero - } Signed-off-by: Zhao Liu Acked-by: Igor Mammedov Link: https://lore.kernel.org/r/20260108033051.777361-8-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- tests/qtest/bios-tables-test-allowed-diff.h | 42 ------------------ tests/data/acpi/x86/pc/DSDT | Bin 8611 -> 8598 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8522 -> 8509 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9936 -> 9923 bytes tests/data/acpi/x86/pc/DSDT.bridge | Bin 15482 -> 15469 bytes tests/data/acpi/x86/pc/DSDT.cphp | Bin 9075 -> 9062 bytes tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 10265 -> 10252 bytes tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 8562 -> 8549 bytes tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 5100 -> 5087 bytes tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 8683 -> 8670 bytes tests/data/acpi/x86/pc/DSDT.memhp | Bin 9970 -> 9957 bytes tests/data/acpi/x86/pc/DSDT.nohpet | Bin 8469 -> 8456 bytes tests/data/acpi/x86/pc/DSDT.numamem | Bin 8617 -> 8604 bytes tests/data/acpi/x86/pc/DSDT.roothp | Bin 12404 -> 12391 bytes tests/data/acpi/x86/q35/DSDT | Bin 8440 -> 8427 bytes tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8457 -> 8444 bytes tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9765 -> 9752 bytes .../data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 12650 -> 12637 bytes .../acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8719 -> 8706 bytes tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8486 -> 8473 bytes tests/data/acpi/x86/q35/DSDT.bridge | Bin 12053 -> 12040 bytes tests/data/acpi/x86/q35/DSDT.core-count | Bin 12998 -> 12985 bytes tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33855 -> 33842 bytes tests/data/acpi/x86/q35/DSDT.cphp | Bin 8904 -> 8891 bytes tests/data/acpi/x86/q35/DSDT.cxl | Bin 13231 -> 13218 bytes tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10094 -> 10081 bytes tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8515 -> 8502 bytes tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8528 -> 8515 bytes tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8457 -> 8444 bytes tests/data/acpi/x86/q35/DSDT.memhp | Bin 9799 -> 9786 bytes tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9570 -> 9557 bytes tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13293 -> 13280 bytes tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8302 -> 8289 bytes tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8298 -> 8285 bytes tests/data/acpi/x86/q35/DSDT.numamem | Bin 8446 -> 8433 bytes tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8541 -> 8528 bytes tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12998 -> 12985 bytes tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33855 -> 33842 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 9046 -> 9033 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 9072 -> 9059 bytes tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18674 -> 18661 bytes tests/data/acpi/x86/q35/DSDT.viot | Bin 14697 -> 14684 bytes tests/data/acpi/x86/q35/DSDT.xapic | Bin 35803 -> 35790 bytes 43 files changed, 42 deletions(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index eed8ded6933..dfb8523c8bf 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,43 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/pc/DSDT", -"tests/data/acpi/x86/pc/DSDT.bridge", -"tests/data/acpi/x86/pc/DSDT.ipmikcs", -"tests/data/acpi/x86/pc/DSDT.cphp", -"tests/data/acpi/x86/pc/DSDT.numamem", -"tests/data/acpi/x86/pc/DSDT.nohpet", -"tests/data/acpi/x86/pc/DSDT.memhp", -"tests/data/acpi/x86/pc/DSDT.dimmpxm", -"tests/data/acpi/x86/pc/DSDT.acpihmat", -"tests/data/acpi/x86/pc/DSDT.acpierst", -"tests/data/acpi/x86/pc/DSDT.roothp", -"tests/data/acpi/x86/pc/DSDT.hpbridge", -"tests/data/acpi/x86/pc/DSDT.hpbrroot", -"tests/data/acpi/x86/q35/DSDT", -"tests/data/acpi/x86/q35/DSDT.tis.tpm2", -"tests/data/acpi/x86/q35/DSDT.tis.tpm12", -"tests/data/acpi/x86/q35/DSDT.bridge", -"tests/data/acpi/x86/q35/DSDT.noacpihp", -"tests/data/acpi/x86/q35/DSDT.multi-bridge", -"tests/data/acpi/x86/q35/DSDT.ipmibt", -"tests/data/acpi/x86/q35/DSDT.cphp", -"tests/data/acpi/x86/q35/DSDT.numamem", -"tests/data/acpi/x86/q35/DSDT.nohpet", -"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator", -"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x", -"tests/data/acpi/x86/q35/DSDT.memhp", -"tests/data/acpi/x86/q35/DSDT.dimmpxm", -"tests/data/acpi/x86/q35/DSDT.acpihmat", -"tests/data/acpi/x86/q35/DSDT.mmio64", -"tests/data/acpi/x86/q35/DSDT.acpierst", -"tests/data/acpi/x86/q35/DSDT.applesmc", -"tests/data/acpi/x86/q35/DSDT.pvpanic-isa", -"tests/data/acpi/x86/q35/DSDT.ivrs", -"tests/data/acpi/x86/q35/DSDT.type4-count", -"tests/data/acpi/x86/q35/DSDT.core-count", -"tests/data/acpi/x86/q35/DSDT.core-count2", -"tests/data/acpi/x86/q35/DSDT.thread-count", -"tests/data/acpi/x86/q35/DSDT.thread-count2", -"tests/data/acpi/x86/q35/DSDT.viot", -"tests/data/acpi/x86/q35/DSDT.cxl", -"tests/data/acpi/x86/q35/DSDT.ipmismbus", -"tests/data/acpi/x86/q35/DSDT.xapic", diff --git a/tests/data/acpi/x86/pc/DSDT b/tests/data/acpi/x86/pc/DSDT index 4beb5194b84a711fcb52e3e52cc2096497d18442..6ea2d36d138daffb59a86367590= 78500adc58f24 100644 GIT binary patch delta 39 vcmZ4NJk6QQCDX&x?Dr}$u}_~<5Y&dK+AW^QifJt_o=3DlEc!_~<4NuF3a#X7Y;g#C!UAauhH)2fO-g JuHZc?3;?HG5552Z diff --git a/tests/data/acpi/x86/pc/DSDT.acpihmat b/tests/data/acpi/x86/pc/= DSDT.acpihmat index d081db26d7ba504b3344fad130d5812419291ac0..ba363d6af76af728b7c88bbaf47= f7e0ea3dcb41f 100644 GIT binary patch delta 39 vcmccMd)SxDCD5>CDJ>!F&;-i~9xF+A{naL}{6YuHg$x*=3DI9PH|| Jxq{bQ5&+kc5ODwi diff --git a/tests/data/acpi/x86/pc/DSDT.bridge b/tests/data/acpi/x86/pc/DS= DT.bridge index e16897dc5f0fbb3f7b4de8db913884046246cc3b..b68302363cb24181988d6e3dceb= 04a0946838d5e 100644 GIT binary patch delta 39 vcmexW@wS4?CDz>G&hf!c@zG5lT$Atf%;Xi}iTCvLhl5#|5@ diff --git a/tests/data/acpi/x86/pc/DSDT.cphp b/tests/data/acpi/x86/pc/DSDT= .cphp index e95711cd9cde5d50b841b701ae0fed5a4b15e872..20688edf2da41146ece4faa4141= 517408a42870c 100644 GIT binary patch delta 39 vcmezD_RNjTCD52&X&x@u`1oL__~<5Y&dK+AW^QifeJ2V42kQ;C delta 53 zcmaFn_SucgCD+d~}mH=3Dj6{kGdIuVZIA*0-Iz366_KpslmX&D6o<1J`b07NPMtUd~}ls*W}MUGkHaL;ywL5ISLq@gI#?# J_wY7I0RWRv4?X|@ diff --git a/tests/data/acpi/x86/pc/DSDT.hpbridge b/tests/data/acpi/x86/pc/= DSDT.hpbridge index 0eafe5fbf3d73719c9c3e6e26371863bfb44ed2f..2b5b885b862a2fe8bc4a2444640= 0dccf685dab85 100644 GIT binary patch delta 39 vcmez5^wf#VCDo=3DlEc!_~<4NuF3a#X7Y;g#C!UAauhH)2fO-g JuHbzu3;?^p5J~_5 diff --git a/tests/data/acpi/x86/pc/DSDT.hpbrroot b/tests/data/acpi/x86/pc/= DSDT.hpbrroot index 077a4cc988dc417a1bc9317dddd2dbd96ff1ff50..cc6f26a3f8fe85f34a8acb5432b= ab3cf4d3ab1f6 100644 GIT binary patch delta 39 vcmaE(eqWu-CD9BwWr=3DlEc!_~<4NuE`DDGkHaL;ywL5ISLq@gI#?# JOY$6J2LQ7!4`2WQ diff --git a/tests/data/acpi/x86/pc/DSDT.ipmikcs b/tests/data/acpi/x86/pc/D= SDT.ipmikcs index 8d465f027772f9c59b0c328c1a099e374a6d2a90..052a84e294eee4ecef9a3634149= 3f841caf887a5 100644 GIT binary patch delta 39 vcmaFue9xK7CDz?RPVvD`@zG7*oRjbK%-r0{nz>G&hf!c@zG5lT$Atf%;Xi}iTCvLAHfb0 delta 53 zcmaFr`^lHfCD%W5&-Wd5fK0Y diff --git a/tests/data/acpi/x86/pc/DSDT.nohpet b/tests/data/acpi/x86/pc/DS= DT.nohpet index 9e772c1316d0ea07c51717466c4c7e383553f345..7eedfcd64ebd0193744864b4f6c= bead35c7c3ab2 100644 GIT binary patch delta 39 vcmbR0)ZxVC66_Mfp~%3%cwi%!Ef1HgQ+%*fd~}mH=3Dj1@1nVY}!$cX>|)oKe* delta 53 zcmeBhn(D;m66_Kps>r~=3DxN{?yEf1HIb9}HKCDz?>PVvD`@zG7*oRjbK%-r0{t0Dpb_GAo) delta 53 zcmbQ^ywaJ=3DCDz=3Dr&hf!c@zG5lT$Atf%;Xi}iTCvLo=3DlEc!_~<4NuF3a#X7Y;g#C!UAauhH)2fO-g JuHb#I1OV9F5d;7L diff --git a/tests/data/acpi/x86/q35/DSDT b/tests/data/acpi/x86/q35/DSDT index e5e8d1e041e20e1b3ee56a5c93fe3d6ebd721ee6..377e880175f6f11101548c0c64d= a61b5aee00bd9 100644 GIT binary patch delta 39 vcmez2_}Y=3DnCDUnVT<5ny~`_^t=3Dod delta 53 zcmez4*y+UO66_MfsmQ><7`u^6Qj*KbIX>7aKDx<+YqGB7OkNS5cuzl1jsgbfU{{~b I$0W_z0eo!^6aWAK diff --git a/tests/data/acpi/x86/q35/DSDT.acpihmat b/tests/data/acpi/x86/q3= 5/DSDT.acpihmat index 2a4f2fc1d5c5649673353186e67ff5b5e59e8d53..f1b8483d8da21dd57f3e5e7a1e4= eb787df2c38ac 100644 GIT binary patch delta 39 vcmZ4LGsB0=3DCDUnVT<52Jrv@*4zt4 delta 53 zcmbQ?v($&nCDUnVT<5P8SCN^mq(Y delta 53 zcmcbc^eTzVCD#Fm33dr#Qet3WwBE=3DiDaqv%93SiyAKm25Iayb7=3DH|389B33dtLS7KmbG}*`{Daqv-5+CdoAKm1^HCb13Ca(xjyr-WhM*)L#u&dAJ IW0E!;0Apnhq5uE@ diff --git a/tests/data/acpi/x86/q35/DSDT.applesmc b/tests/data/acpi/x86/q3= 5/DSDT.applesmc index 5e8220e38d6f88b103f6eb3eb7c78dfa466882dc..92c8fdb6cbb8ae8bdf5ede9679e= ea92486eaf372 100644 GIT binary patch delta 39 vcmZ4HG}DR8CDUnVT<5I*9@R-%JaY delta 53 zcmeB(n;OUE66_Kps?Wf{cyl9{q$HPx-*r_CDe delta 56 zcmdng!L+}FiOVI}CB(jkfq}7oBbTHkcV{_Ue6Uk|bdv|yWIf55ydpgDo_?Mj1q{x? Mu0ETOOJ-*Q0MS7ZZ~y=3DR diff --git a/tests/data/acpi/x86/q35/DSDT.cphp b/tests/data/acpi/x86/q35/DS= DT.cphp index a055c2e7d3c4f5a00a03be20fd73227e322283a4..7c87d41d03fcfd2b5b82f2581f1= 6de6bc0bb10bf 100644 GIT binary patch delta 39 vcmX@%y4#h@CDWl9F6b&hf!c@zG5lT$6PrXYz{h#C!UAauhH)2fO-g JJ|=3Dlb5&*aE5HJ7$ diff --git a/tests/data/acpi/x86/q35/DSDT.dimmpxm b/tests/data/acpi/x86/q35= /DSDT.dimmpxm index 664e926e90765550136242f7e3e0bdc7719c1853..a2d812e5a23a3ce7739789246b3= 42e703f8c96c0 100644 GIT binary patch delta 39 vcmaFo_t1~aCDrf04 delta 53 zcmdnybl8c@CD4-o(W diff --git a/tests/data/acpi/x86/q35/DSDT.ipmismbus b/tests/data/acpi/x86/q= 35/DSDT.ipmismbus index 6d0b6b95c2a9fd01befc37b26650781ee1562e2a..1b998820d46e522b3129e42a867= ed691c1f83e8f 100644 GIT binary patch delta 39 vcmccMbl8c@CD@oAq$HQCQ+%*fd~}mH=3DVV>UnVT<5*0KWt;?)bb delta 53 zcmX@?bis+sCD0q$HPUQ diff --git a/tests/data/acpi/x86/q35/DSDT.ivrs b/tests/data/acpi/x86/q35/DS= DT.ivrs index 072a3fe2cd17dfe06658dfd82588f69787810114..026bfdfebf66c1803f158ac8c11= 5eb5f49b5cb19 100644 GIT binary patch delta 39 vcmeBl`s2vu66_N4M}dKXF?A!Cq$HQCQ+%*fd~}mH=3DVV>UnVT<5ny~`_^t=3Dod delta 53 zcmez4*y+UO66_MfsmQ><7`u^6Qj*KbIX>7aKDx<+YqGB7OkNS5cuzl1jsgbfU{{~b I$0W_z0eo!^6aWAK diff --git a/tests/data/acpi/x86/q35/DSDT.memhp b/tests/data/acpi/x86/q35/D= SDT.memhp index 4f2f9bcfceff076490cc49b8286380295a340004..7346125d23fb3174c0ce678a2cd= f2fdc77c4a9fa 100644 GIT binary patch delta 39 vcmX@^v&)CeCD)i9q$HQOQ+%*fd~}mH=3DVV>UnVT<5_HzRO>=3Dz6S delta 53 zcmccW^~j6MCDN9l9F6b&hf!c@zG5lT$6PrXYz{h#C!UAauhH)2fO-g JJ|-z81pw8G5DEYQ diff --git a/tests/data/acpi/x86/q35/DSDT.noacpihp b/tests/data/acpi/x86/q3= 5/DSDT.noacpihp index 9f7261d1b06bbf5d8a3e5a7a46b247a2a21eb544..780616774f97a2d7305faf9e9a9= d12afeb0e2fa2 100644 GIT binary patch delta 39 vcmaFo@X&$FCDPVvD`@zG7*oRiOq&)i%h@rxY*2F?wn delta 53 zcmaFp@XmqDCD4J diff --git a/tests/data/acpi/x86/q35/DSDT.pvpanic-isa b/tests/data/acpi/x86= /q35/DSDT.pvpanic-isa index 89032fa0290f496be0c06c6382586541aa1118a8..da3ce12787c28e555b6ba5eacb2= 6275bdd4587f1 100644 GIT binary patch delta 39 vcmccXbis+sCDUnVT<5cCiBh>8}g; delta 53 zcmccMbk~W?CDx-*r_CDe delta 56 zcmdng!L+}FiOVI}CB(jkfq}7oBbTHkcV{_Ue6Uk|bdv|yWIf55ydpgDo_?Mj1q{x? Mu0ETOOJ-*Q0MS7ZZ~y=3DR diff --git a/tests/data/acpi/x86/q35/DSDT.tis.tpm12 b/tests/data/acpi/x86/q= 35/DSDT.tis.tpm12 index f2ed40ca70cb13e733e39f4bad756be8688e01fe..67ebd7c158759221b801ecb67d8= 562d92fa219d5 100644 GIT binary patch delta 39 vcmccScG8W@CDas5UvNl7kOr}$u}_~<5Y&dIuxGdEwBoXZIS_>T;T delta 53 zcmaFt_Q8$ICD`3u4~PH& diff --git a/tests/data/acpi/x86/q35/DSDT.type4-count b/tests/data/acpi/x86= /q35/DSDT.type4-count index 3194a82b8b4f66aff1ecf7d2d60b4890181fc600..17a64adb2055ad3168754ca121b= f29851d2ee496 100644 GIT binary patch delta 42 ycmew~k@4w7MlP3Nmyo9(3=3DE7>8@VJUx%&??#RogZM>lzMPS%s0x%rBuoIU_FstxM^ delta 56 zcmaDlk@3?+MlP3Nmyk~$3=3DE9H8@VJUxqA*V#RogZM>lzJP1ci~$t%JW@9F2sQNZ9F M?CP`mxTKsu001Nq>i_@% diff --git a/tests/data/acpi/x86/q35/DSDT.viot b/tests/data/acpi/x86/q35/DS= DT.viot index 129d43e1e561be3fd7cd71406829ab81d0a8aba0..6eb30e8f4b2c54e4789c649475a= dff356c8c58a4 100644 GIT binary patch delta 39 vcmaD^bf<{RCDlzMPS%s0x%rADdl3LU$qs)2 delta 56 zcmX>%o$2;;CN7s?myp}t3=3DE9T8@VJUxm!Q7#RogZM>lzJP1ci~$t%JW@9F2sQNZ9F M?CP`mxFmZK01fjIe*gdg --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907505; cv=none; d=zohomail.com; s=zohoarc; b=LEcr2SjUUea2AeDqtS36h8VDOykoZu2cEdvB7AYfMli2LJSHzApj46sf426pLlH0X6XD6mz+5Kb3TrsyD/hbiSD2ohvakImI/E8w7vx24DoENK1JYWkga0py3c7uEjjvkKVhgs61EmyF1bjlPgpHgj/3IRIY6W+f3VstaAwet+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907505; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=aZHLH0U5siZ164vGiDBTwZt96Hx+LUB/6fV12sKSbIg=; b=dxb+X/koAourqe9ccJgEtF1h4XBbOek9uMi8tabcd/mdqn/9onn+P+PR4teHy1MoYKsWJeA07D1fobuiy3bfbfO13K9ZlmVKNQJYB02y8K62dAOhQv2a4qqjiaCnBWOAEqzLdOntJFeaKoVGwpqTbsmMz/JOy/wIJsWPtpyW3Vo= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907505780380.58857086803823; Thu, 12 Feb 2026 06:45:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvQ-0005wp-E6; Thu, 12 Feb 2026 09:44:12 -0500 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 1vqXux-0005Ng-Ng for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuO-00060T-Uf for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:38 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-FBa-UIo0MKaD4U1q979Ldw-1; Thu, 12 Feb 2026 09:43:07 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4803b4e3b9eso64139695e9.3 for ; Thu, 12 Feb 2026 06:43:06 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835dd0e15bsm103362835e9.13.2026.02.12.06.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907388; 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=aZHLH0U5siZ164vGiDBTwZt96Hx+LUB/6fV12sKSbIg=; b=f6iYHd8dfZOKF7lo6qcHTYyZL6Rq8T5oG+kWGA0coP7xD2LRUmc17hSGc95hviscPd16KK O9trUxsJLraai2k3J5lmEcSy75NYOsJWVQUDk2IsGxiSaPmyD1XlVL14DJlLLhLQchgJ/S tx+CXv6rZhaF67BfrIOtXPAJx5K40Dw= X-MC-Unique: FBa-UIo0MKaD4U1q979Ldw-1 X-Mimecast-MFC-AGG-ID: FBa-UIo0MKaD4U1q979Ldw_1770907386 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907385; x=1771512185; 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=aZHLH0U5siZ164vGiDBTwZt96Hx+LUB/6fV12sKSbIg=; b=j4EIdQos0Zjt3Uit11ahQ0JTt6tG0mGb9aCegTdS6bbpvRrrP1vrYuavdf3HKHobEw PENR2YCkzsRaEcUFkzSoUE99vBDQy+TNoQ0Ybvp0SLrEKaugIllSfpKO+BoMdRTXBMok DIgPEzLFsrF1rJaWaZrey8oQ18Xfy8XxeH/VTfqbQWXPBSErE/oW2ktlDWXyvCoHoa3C aWcNjFGomJVsVMLYuMSUg84yKhL7/YROgEBtci0yyeqjmmjAkQACPS3V0LolV+9WuhnE FzoPLnTS6jUoVH+7BxdaaM2pKzeNEPforNR0OwucOnlrlSNPtqLv2U4UCbsE152A4PvX I10w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907385; x=1771512185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aZHLH0U5siZ164vGiDBTwZt96Hx+LUB/6fV12sKSbIg=; b=tCEJH810HNIIw7C5g+xvtM8jtJVY++gIY5eOQdaUHIyp3dHfggPOeQX3CNIwA7XvR9 wvW3HeH/9lH6FcDLlaaU443tbilnb6VYoClZQok/r1/yLx8LfVpPXuPVBy/zP5cuLCG8 GBf0OVNNaMg2BtTnEN6R9ZG3IZN7aof0Jlgzcd7wpXIKMUeGoVY0EWlinr3hFbSCKEt8 fSbEc9ndASarYbbrLOVyOloMTd/dw+DHcjD9IR9tSYqWwHTw+HttzkicQpFShCx7LeOi XECtRdd/vy8JO7Tc3OkO6vKG5/kK6BitU27qa+PC63pHiOM/kyptWp4duXN4PjoQUCmO XXjA== X-Gm-Message-State: AOJu0YyVe8ZENoMUmLe58pz+cqDfISGbypWMbjh4PMn+7BLqxCYUZZuS X6LuDpOq2DHiA3wuqOulywIUUPnrFX0QvtW7nil3/H9AM5R92a0OBtbPZ2iiQF4jZ8CZ4i+rF6W BJChk3pNXBFYvz8i8XLggxva2Xdt1VzX/X228g7NGVtj9Y6I/KvML0paejIygWgAVpQvmekbXCc FhWxPuZ9O3yhNMaeOa4TsqCqFY/hOso3xgIIL2rxff X-Gm-Gg: AZuq6aJGHFa+E7QfJYOwj8h1rZjlwaY2KoCHank++kp0tj+GTo37XsTlxCWt0UgzwXd YespupHTIDYqROUfNkJIfR80M1qB4GKIYxtpHOrG/CNZlrsREa14X3F5FWIHTFnkYksOoEbmE5L VRgutGdzkGH8XBp0isF6qVwDX2nX9jRnslKYLAw9pR5/ohQsgm36TdZl/T2j0OvoGqFH9gy7iDa n1GAUhRrMALUS0GD3n/BtmuzOum0mqnlTjqQKgfmVkJPET870Xy5g1mU3HoUzfJqb9SsUUByi54 EqL8B9ejaahO9sNO9iZi5g34yK3rEDN2T9BMAr3mlwauGu0f2lw3gOmnmy2u/Rt/gCgGgyAXd1D KNZE4iLRdf302hokEXjDqHAujzbNzPqdBhnOr99l+VRwSH1phcYIuncxI4YKPXtRcg0TaZvmaCj AJt4qvFQbD2WUFNZEA2yneWiyaij4rQcRgrw/3juCq2bVYbpTvNJg= X-Received: by 2002:a05:600c:1d86:b0:47a:814c:eea1 with SMTP id 5b1f17b1804b1-4836571faf9mr44827695e9.35.1770907385279; Thu, 12 Feb 2026 06:43:05 -0800 (PST) X-Received: by 2002:a05:600c:1d86:b0:47a:814c:eea1 with SMTP id 5b1f17b1804b1-4836571faf9mr44826985e9.35.1770907384799; Thu, 12 Feb 2026 06:43:04 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Igor Mammedov , Xiaoyao Li Subject: [PULL 09/41] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix Date: Thu, 12 Feb 2026 15:42:11 +0100 Message-ID: <20260212144244.22579-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907506636158500 From: Philippe Mathieu-Daud=C3=A9 Rename fw_cfg_init_mem() as fw_cfg_init_mem_nodma() to distinct with the DMA version (currently named fw_cfg_init_mem_wide). Suggested-by: Zhao Liu Reviewed-by: Igor Mammedov Reviewed-by: Zhao Liu Reviewed-by: Xiaoyao Li Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-9-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/nvram/fw_cfg.h | 3 ++- hw/hppa/machine.c | 2 +- hw/nvram/fw_cfg.c | 7 +++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index a29a5d55eab..510b227b7ef 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -307,7 +307,8 @@ bool fw_cfg_add_file_from_generator(FWCfgState *s, =20 FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase, AddressSpace *dma_as); -FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr); +FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr, + unsigned data_width); FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, hwaddr data_addr, uint32_t data_width, hwaddr dma_addr, AddressSpace *dma_as); diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 960aefc9e26..c3680667aee 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -208,7 +208,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIB= us *pci_bus, int btlb_entries =3D HPPA_BTLB_ENTRIES(&cpu[0]->env); int len; =20 - fw_cfg =3D fw_cfg_init_mem(addr, addr + 4); + fw_cfg =3D fw_cfg_init_mem_nodma(addr, addr + 4, 1); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, ms->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, HPPA_MAX_CPUS); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size); diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 69e97361453..7751de3d977 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1088,11 +1088,10 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, return s; } =20 -FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr) +FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr, + unsigned data_width) { - return fw_cfg_init_mem_wide(ctl_addr, data_addr, - fw_cfg_data_mem_ops.valid.max_access_size, - 0, NULL); + return fw_cfg_init_mem_wide(ctl_addr, data_addr, data_width, 0, NULL); } =20 =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907462; cv=none; d=zohomail.com; s=zohoarc; b=ZXkDNjX7jm2zATJ0Jy2v4169nYW7OyXFvCbbPv4teYdsR4KVSaoYdP7OZkKBfeWieYX2x3bV88PDtW+PJdjR0qFLcV0ltq+05M7qGLm+9oZAfE23EAdfj2oKGUVx9ABmzAJHJ3qEoKVkkHfb4e/UJmwKGZi293LrHVj9kq8yPdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907462; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ztjQZUvb3l5UC1d7nkrajfRm5xtDWQi1UWTU3CLPHL8=; b=FsylWxYsl6Clqp27x/bjDGtA8RZ9ZLCc/itRU9RwH7obw+huOKT69OvffrTNeOAaSCXDhAJ2ce2XIv2dM4Pop0T5xdUhwOpvk0ncdh3KvVaQDg4PFM1spqhH3BhwqLsDhmgC6z5an3aRHtKljNHefv+fLI/4LIBQX9aac7DCZuE= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907462059675.2804926213357; Thu, 12 Feb 2026 06:44:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvG-0005ky-U8; Thu, 12 Feb 2026 09:44:02 -0500 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 1vqXux-0005Nj-Pk for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuZ-00062d-8q for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:42 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-163-rNp7jsdIP_2VR9p0Bw0rqg-1; Thu, 12 Feb 2026 09:43:15 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4806fa4a180so60040725e9.2 for ; Thu, 12 Feb 2026 06:43:15 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4836131d52bsm41869025e9.28.2026.02.12.06.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907396; 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=ztjQZUvb3l5UC1d7nkrajfRm5xtDWQi1UWTU3CLPHL8=; b=aWGVfgwP96XLlyAtEIvC28y0Uj1VyhZ0UyF7H5YMEcusQslHV6FwhlkN48nVeO9dZaPDyG FofvEY0H4khOJAcuqYITIFaFrRNJVBOT3smrTzTVdwyIU9NpbE1pTa6eKUFEWLpWdMsxFu b3rCUiLlonHWQ1iu8yY5QCLacXgWMAM= X-MC-Unique: rNp7jsdIP_2VR9p0Bw0rqg-1 X-Mimecast-MFC-AGG-ID: rNp7jsdIP_2VR9p0Bw0rqg_1770907394 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907394; x=1771512194; 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=ztjQZUvb3l5UC1d7nkrajfRm5xtDWQi1UWTU3CLPHL8=; b=kJ2uwIIxN4mdNRdqzoqjdr7tG3xwYBWxQcsP4DDhXcJSjetgEyOlfiYyLWRHb9vqte bJ3dBb82TERoldp/ZJLih0Yn2qrNOXU9AzOBuxsBhi2uXF1o+oXxdr2DhID3kELchKkl GDTDnyTkyEKzs5ufoeadXJs5FWMksnHOGDROgV5+mEybER1ePdgqr0DMq0YdMAhmM7mc EHUGPAlrfn+/Gjf8Ow+Db73OaZIGCKqcOPZNc4yyPrSWxEIUMLyyylVxl+xcx/Xfxazk 9Nu33NRRRd98bGxMhYmhvhYn2sM8MGFlgKFx7fKVWK5sKVJSUGM/kAIlUzlABDWKpc9o E+NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907394; x=1771512194; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ztjQZUvb3l5UC1d7nkrajfRm5xtDWQi1UWTU3CLPHL8=; b=L8XAZexEeRCJlFRQIiba/A7XFYBG0P4ZmH2H098SJMUnVNY5ak5dm1B5PrhjO7ROaI +mmDa9XlPq2L9W5k5JflRimd49A2FOxuC67ExxRJs04Kb+D6H9MpJcucszG6I3s9b2dz 60Eb4ZD/HepXGJlyKOd6/YJjNy7eebxD39Y/ADLdSyhmNJgPMi+Vd+EgCzjOsiS71DzH vJS+AhQfhrI0Cr7P7j0BC07d4aTqa7Cl9AM/MQAq265Nz2l89+OWVWIybcfHU7yRwOS9 3+/8u4Hf98GKrTi8Awhfr26MuYATVETakHes5sAb8thLVBErN/pfmMvPLuyfcsz+up1J Dwxg== X-Gm-Message-State: AOJu0Ywd3zRU1V/sN484KhBas9VLtB28ZYdofjeEQfLR5P3nSMVpqS6X UnEUegon3xhX8i3LuThODQ2e+GKuWGpkF/lTEvsnOCMy+D70EtZEdZhVveDmXdu6vPadnomco5Q IeXfLzOc9GsGqq1dCTgwJRF0/8M6wvyt01TzCXKbMkjQAxjy/0GM3/KLtOooW8pmjx/qXcbcfoI /usUg/StASbpX5vWaUxA+CoCDVyYw1tvA4SpJgiMOr X-Gm-Gg: AZuq6aJksXNQqAGv6JhJNnJ5OHhjnwVJOa7FIEYX/0X7M+B4yqK7IL1T4Nmzp6vXV6d IzuOfkwDnSPM7HOr/nEAfhZ7qSsZsipnt0vrrkOoELB2RUgmC7+moBoo8OO3i7IAaUREzpeNyJq vS5bn6rISdBnVZsTNX04Sn7tnneJJK/Gv9n1bZLQggJRvhoyLL3VNKjc/DEmJZ2tS7hpnIgLsdw qKgwAmwX7i21NYvqofFyhnCrkD9d1MioZIjJ3C23McbXHHvp873w0VExi65LiKYUTWs63cdmgx5 vAjdCZHBQCaeX1hYsXfdr6DGi9nFY/866un+H6vfr+UUgqBaEK3qXyxlc+uqjX4NOBzH2pjzTEW xsISio0qiwjB+ON3mGZj0X5f29rRVaR5T4kpb7fjS0otGc6SbpQpWbS5MQ0CBFy5MvgPHZMPSfq CWFuBfd5Uf0FLRl8umE0mxE+72PgKsFzJYg16NxoOtu/SzL3MjMXk= X-Received: by 2002:a05:600c:3b1a:b0:47e:e78a:c834 with SMTP id 5b1f17b1804b1-4836571ea9bmr49032775e9.34.1770907392131; Thu, 12 Feb 2026 06:43:12 -0800 (PST) X-Received: by 2002:a05:600c:3b1a:b0:47e:e78a:c834 with SMTP id 5b1f17b1804b1-4836571ea9bmr49028505e9.34.1770907388090; Thu, 12 Feb 2026 06:43:08 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Xiaoyao Li , Igor Mammedov , Zhao Liu Subject: [PULL 10/41] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma() Date: Thu, 12 Feb 2026 15:42:12 +0100 Message-ID: <20260212144244.22579-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907465109154100 From: Philippe Mathieu-Daud=C3=A9 fw_cfg_init_mem_wide() is prefered to initialize fw_cfg with DMA support. Without DMA, use fw_cfg_init_mem_nodma(). Reviewed-by: Xiaoyao Li Reviewed-by: Igor Mammedov Reviewed-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-10-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- hw/mips/loongson3_virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index fe51fb66f6f..cd94e9f5f77 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -287,7 +287,7 @@ static void fw_conf_init(void) FWCfgState *fw_cfg; hwaddr cfg_addr =3D virt_memmap[VIRT_FW_CFG].base; =20 - fw_cfg =3D fw_cfg_init_mem_wide(cfg_addr, cfg_addr + 8, 8, 0, NULL); + fw_cfg =3D fw_cfg_init_mem_nodma(cfg_addr, cfg_addr + 8, 8); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)current_machine->smp.= cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)current_machine->smp= .max_cpus); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, loaderparams.ram_size); --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907501; cv=none; d=zohomail.com; s=zohoarc; b=HEEkn+8DnppkFlL7MUYb0D4208a50WuLTrZ1Lge4xGjUDRvXUBbayOjwLa/9fie5mdB/JvDrXVlkdsf4AxpZIaZYJhUoG7yt7wO++3NgzDWsFgYhvNl1iHDcrwnGISW/aUuEMidanXeFL3apgE37JTsQAgJpO+edtTuG4qLe14o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907501; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ST95/BNrjjmUYvk/3RmRykxO/bM5J4yv/3ZrgUtkelc=; b=FIECghF2geQm8X8wlXFpZpXTk/ZwNqN6AFxw1OAvyk1hlenRiNeCMq1n//igwdQaOnCokAH4XoUPuRjZMm1RiXQXuBfhyLleLbvj3Jpw+TMJwxuTmz11DktzHXKGr2I+w9Nj2qcPDTNIvL0yMBXsFG1usCpSxLMyHNLyP7EwCa4= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907501266331.85662276921914; Thu, 12 Feb 2026 06:45:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvJ-0005qc-Ra; Thu, 12 Feb 2026 09:44:05 -0500 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 1vqXux-0005Nh-Op for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuV-000629-6I for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:39 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-74-4ftNYiwsMAS5CxJEPVKisg-1; Thu, 12 Feb 2026 09:43:12 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-48057c39931so83175005e9.0 for ; Thu, 12 Feb 2026 06:43:12 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835dd20519sm209226585e9.15.2026.02.12.06.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907394; 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=ST95/BNrjjmUYvk/3RmRykxO/bM5J4yv/3ZrgUtkelc=; b=ewn/f1jK0qO7wnVgxj9XyYvZDAbSUhkvBzQidVJvXrkmhsHtybLlgXCyFK6bD5PReCrPG0 UdwhNRcrBKndDdRKpRPhGIvUjISRVUCk+rlNPw17l9iTKJi/dUjOudoxrp8z6L27E6UMMb FXHCBrfkbG3dZl4JKC7XgLwNKZzM41g= X-MC-Unique: 4ftNYiwsMAS5CxJEPVKisg-1 X-Mimecast-MFC-AGG-ID: 4ftNYiwsMAS5CxJEPVKisg_1770907391 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907390; x=1771512190; 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=ST95/BNrjjmUYvk/3RmRykxO/bM5J4yv/3ZrgUtkelc=; b=i96gd0j4fZY8I+QSfy9CecIYNbjeTfYLtvz+pBI7UBNvNB3rdU7Z/DXcjn/+1PL1SG mE2QI8dVWQGj6wlDKOugMC1pnhB3L0wURf2F4+sHz2KLZMYL9/2ZJg7ylg+9wdIAyaL5 hch3W+vcL4sPZ+dhijLQxRPLw1cIE1Fsnl/wtYI0p/lhlCm5sA45FydQGWgZ1yBmN5PL GExf4uaR1xwvmd4EU0mXQ0gDLe2Cl+PxP6y2g882n7sink5nEyqvfK+cbpTAsSeVzyuh Cewjmv33U7MWqIDXylnmVcpPbLs6wNOwtlf+8wkXOEWHpgRTUvBjh30P05BJBMdXMWv+ XBUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907390; x=1771512190; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ST95/BNrjjmUYvk/3RmRykxO/bM5J4yv/3ZrgUtkelc=; b=Vhcsv4jbBoe86JZ/un/ZXZNVqmCLlwLZWUmENoYX9tYD30blKSi2ZHuxz6COmnFup9 2n0yuheUUaqnhq0wBhObelAf+1T0+Fbfl77q9WCwjjrwsmhd8UlaRrF3CA+yoIk6Vopb hufy0qygdJmKnrIGQP06oD8JoRZvr8V2m0JEjugoQ3iqm0FPX00Dcysv8UQwKJEG/ilE ELaDxWufxN+tHiDjrj4serXgjEFPGFpduIkXWcRgSUlg00tg8eik6+8YH3ThLMBKIZG/ KpTqZgm2oSPF/xbU209QPYhI7S6QaU1J53k0jWK0wnV5y3zStbnXN36xR712QH8LLzrk RT6g== X-Gm-Message-State: AOJu0YzUcm5A4SqgNVe0c7yDzmVIPnm1VzBEybD0CPWXn/Z/8hguY3FY 2uvX5h//9tVcakDbjx/a99GLbr8psbamdLZ9JZvLJdLoXEKOALaM22MkkfnnN2JDKV+Yk/nDW/d otPeKGkuVQTjXShrE8cUgaeTs0Pyuof3BDTUciaTYVtyYJoEMtc+pneL9l2UynoHFpeU8sk7uVo 1B+NFC5KSNQOk1zuNrK8m5vKGahxPJrhdTn+UrrD4Q X-Gm-Gg: AZuq6aLl8uvqpppyfXTyP2BtcSqN6yV9NGbhGCcm5wT6S55ut1kGVMKOKMm2LXDNVFx C90oNg6BmHcZO6Miu5/4pU8SGFfRZwx3huL2L2DwwlxYmxqOEkbLCpiNAgF9z9GPWVb1DHuuEg/ 4HTCTTnMA0N6fgvxRNBRCZrl+qpMEdUtEbFvODus31vcp89ZXml9UUw+bPyzhblWCP6jj1GzARA 6VuQOFxrtA2Tk79HoPS+/PTlVC1mPAMBgG3yhL/1dxlIra3WF8CUj50pCeMBzQbSe3e5IbBXO7X UzRFyrcq7OZzq98bwH+6efxym/iYKPPseww7QaLsiO813YzxjM2F/bZvLJ3fhverwVinOf7s70V rwIME5lzuPlaqpf9rVVcpuRKqldmch/KmLC2WV6W8q3SrQuwlC5nUBRuwZIwhuBGH5GPK9QTGU6 noGDl/KKdReBKZ4gKts2QUMeo0q5VCS7dNNMJj00SzbFJDLgiDJ6Y= X-Received: by 2002:a05:600c:450e:b0:477:a219:cdb7 with SMTP id 5b1f17b1804b1-48365610fecmr46355975e9.0.1770907390660; Thu, 12 Feb 2026 06:43:10 -0800 (PST) X-Received: by 2002:a05:600c:450e:b0:477:a219:cdb7 with SMTP id 5b1f17b1804b1-48365610fecmr46355615e9.0.1770907390255; Thu, 12 Feb 2026 06:43:10 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Igor Mammedov , Zhao Liu , Xiaoyao Li Subject: [PULL 11/41] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Date: Thu, 12 Feb 2026 15:42:13 +0100 Message-ID: <20260212144244.22579-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907503738154100 From: Philippe Mathieu-Daud=C3=A9 Factor fw_cfg_init_mem_internal() out of fw_cfg_init_mem_wide(). In fw_cfg_init_mem_wide(), assert DMA arguments are provided. Callers without DMA have to use the fw_cfg_init_mem() helper. Reviewed-by: Igor Mammedov Reviewed-by: Zhao Liu Reviewed-by: Xiaoyao Li Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-11-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- hw/nvram/fw_cfg.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 7751de3d977..8a21cdae4fc 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1054,9 +1054,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint3= 2_t dma_iobase, return s; } =20 -FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, - hwaddr data_addr, uint32_t data_width, - hwaddr dma_addr, AddressSpace *dma_as) +static FWCfgState *fw_cfg_init_mem_internal(hwaddr ctl_addr, + hwaddr data_addr, uint32_t dat= a_width, + hwaddr dma_addr, AddressSpace = *dma_as) { DeviceState *dev; SysBusDevice *sbd; @@ -1088,10 +1088,19 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, return s; } =20 +FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, + hwaddr data_addr, uint32_t data_width, + hwaddr dma_addr, AddressSpace *dma_as) +{ + assert(dma_addr && dma_as); + return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_width, + dma_addr, dma_as); +} + FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr, unsigned data_width) { - return fw_cfg_init_mem_wide(ctl_addr, data_addr, data_width, 0, NULL); + return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_width, 0, NU= LL); } =20 =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907723; cv=none; d=zohomail.com; s=zohoarc; b=UgQMHuduQ29WbkipNcP+97gXoSFSwTE1qY83LQ4V/OnT35ScMGlNBOinXWZRY4dKmOrhkGL5pYwC6K3UjVeH9YUdBrxNBrMGgbfjO9SMiFeQDB5U+yHcf8Eps1z+F3/Uiy03yI9JhJu4qvPKvBLAxkFbNbSQ+JQEUrcx8RehwhI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907723; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=88S69tjfHiWtrSxu0v7zYgbs5OyDo7TvODXnvOF9ylI=; b=jAPYoSQwYc5qq6YSwFrasLo6is8pK+EOoYSn3O0lOMICFPBeFgNsfM03IDWkGG2bAYS5rij1Py1IwROeliFygMjOacWgKy6d2slafPsFkvco7ueNN7Rb6GpPyVsmScHuobSqkvPYSPbjq7OCBgOmE+t3pOw9tuGnyt8fuz8h8f0= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907723364714.2471766731087; Thu, 12 Feb 2026 06:48:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvJ-0005pK-GT; Thu, 12 Feb 2026 09:44:05 -0500 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 1vqXux-0005Nk-P9 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuW-00062Q-NG for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:41 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-367-mXAw7z5MO-WxNfb0AbGfmQ-1; Thu, 12 Feb 2026 09:43:14 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4832c4621c2so60279945e9.3 for ; Thu, 12 Feb 2026 06:43:14 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835a5bf1efsm93492635e9.0.2026.02.12.06.43.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907396; 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=88S69tjfHiWtrSxu0v7zYgbs5OyDo7TvODXnvOF9ylI=; b=bhyZfuAB4kPX5hmNCicobTRZkXa2YX7jYzeXm7vuY7oXYDgb4sm/9/BVZsbBedVf1SCCMe O81YIrEBqImIsiYGp20kHdxz+una18u7/CtY7iMFAMCBhpR3T4aFev1neI+S0mG7FuAn0h 2ISwp8QPms844b5lGb/i2uwY4YbrRs0= X-MC-Unique: mXAw7z5MO-WxNfb0AbGfmQ-1 X-Mimecast-MFC-AGG-ID: mXAw7z5MO-WxNfb0AbGfmQ_1770907393 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907393; x=1771512193; 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=88S69tjfHiWtrSxu0v7zYgbs5OyDo7TvODXnvOF9ylI=; b=InOpTc8OIfwwcvvCNqc4KKIX2dWoK27GAq8UQgFKYCtEDcmWvjNuTMU+SmnFYO5PzY ogL1Lh2rhswVeEUm0X2ck5pjGQcDfOuuG4s5KPuVTyiQQA12wfyCfr3iS+Y++U6Rm6ow Yy2yzDz+MIKlbr3iHhUrFleQo2ji0sPspqLTiV5ZV5xFSRmrZKSTbty1DTv9hD3WLaHB IkhmXTo7HnshWb/CnK9m+Y2UHZcJ92bwleHerz7JWlbuIZcopUXRDXExgNlk9j0z3rub 2mHtJndQHMjGcVZz2S8sSWoqZGBO2T9jRakButE+jPVBQboEcHQybqkzVqkTTSNkgpPy heOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907393; x=1771512193; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=88S69tjfHiWtrSxu0v7zYgbs5OyDo7TvODXnvOF9ylI=; b=HZs3LiWtwxlTOZqih7cXwuPBNlQsrFPTePsClYQh7hxI+Urkz/wy2pkspK2eNisYTr oDdYV0i23xvdz8SlCHCh/4jartQTSIeSgb3qBM2rBtqQyOFLBunuHb7anhXegJ+MaFg4 lnpEV6MdYRKlvEdM+fZMJws4HmwV84l6twpzVnnGl37nWq01PnHdcgfgqCPa5qyIXal6 RVPg5J0iaYH1eICrdya/O6icKHpm6MEAUwgDrSIltaL9kdHeTeKgvKUoIr2QolTZ8bB7 neqUWEtvVgKMTYJ5NjgdGWjCECjPhT1Is4IsU+Ri+Md461ItH3kMPWyBkj/gi8qbjwEY kvVg== X-Gm-Message-State: AOJu0YyteQv2Yl39vK9Tn2+3kyig6ddLxfmGB4P8BM14MrKMn5UVPWJd EbXpSFxD7mIP+TAvHgGiF2Z2edW8I7IEtkCuGOWei4nVWjJme4BypWv8rLg3S4h53zbWqOfT9v9 LMpxUVCLwze6fVuc0hxuLXRguosCJS/mWrZVnwj2Hn8mjKHwyWyzIXhHlygxtgLklWubT+xjqHf JmRtsmrxogMd+eH74S6IomebwX1fpwFlbLBRLfwYSx X-Gm-Gg: AZuq6aJS4VQDY1dWEtEwP3kBdhJiDwp1dK8dps89GP/FdmAPXU5enFh+yCT23q/G7ZA KBTA2rBaU7wJwOEAhwpkODHTHSfLLtTZaVyWQTQeTVkRC2b+lt4jv0fgoJ85xVkxqWDUIK+ttNN GBZb8t8N4KqpG+mmxMrBDJiEDSz0TLCihjFRkSCXi579IZb9vcv0tSwfnOSftf6QhRb4wY2GZFz y4O3hOqiWRIJBT4YkE5+EBEUnBWpcnMcdbEeH54C4oYbWRoA4q4Jv0wcGHCBdlG55jmwPI95dxP J3s7kNVfcqBDheQSeR1tBBrE3ihOvc+SwnJY3aiAoX8lisSHKoyGa5Z0d4C/a3Ewwtu9Jurd9Jk 4W3TWTHv+TLQyoJbKjKzKmoHZ45a87/8rjMCR6jVG6TURWd55O4Q16HEP14ZVisEI9+sCccs/KO VMYlf2DunbTihsFv7bo0JFEtP8BOB99ipqgrFIHmN5vYsz/kuQ0SQ= X-Received: by 2002:a05:600c:a09:b0:483:47ae:7c00 with SMTP id 5b1f17b1804b1-4836570d0e7mr35992125e9.20.1770907392615; Thu, 12 Feb 2026 06:43:12 -0800 (PST) X-Received: by 2002:a05:600c:a09:b0:483:47ae:7c00 with SMTP id 5b1f17b1804b1-4836570d0e7mr35991585e9.20.1770907392049; Thu, 12 Feb 2026 06:43:12 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Xiaoyao Li , Igor Mammedov Subject: [PULL 12/41] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma() Date: Thu, 12 Feb 2026 15:42:14 +0100 Message-ID: <20260212144244.22579-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907725278154100 From: Philippe Mathieu-Daud=C3=A9 "wide" in fw_cfg_init_mem_wide() means "DMA support". Rename for clarity. Suggested-by: Zhao Liu Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-12-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/nvram/fw_cfg.h | 6 +++--- hw/arm/virt.c | 2 +- hw/loongarch/fw_cfg.c | 4 ++-- hw/nvram/fw_cfg.c | 6 +++--- hw/riscv/virt.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index 510b227b7ef..56f17a0bdcf 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -309,9 +309,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_= t dma_iobase, AddressSpace *dma_as); FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr, unsigned data_width); -FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, - hwaddr data_addr, uint32_t data_width, - hwaddr dma_addr, AddressSpace *dma_as); +FWCfgState *fw_cfg_init_mem_dma(hwaddr ctl_addr, + hwaddr data_addr, uint32_t data_width, + hwaddr dma_addr, AddressSpace *dma_as); =20 FWCfgState *fw_cfg_find(void); bool fw_cfg_dma_enabled(void *opaque); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 390845c503b..13d2057fb30 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1412,7 +1412,7 @@ static FWCfgState *create_fw_cfg(const VirtMachineSta= te *vms, AddressSpace *as) FWCfgState *fw_cfg; char *nodename; =20 - fw_cfg =3D fw_cfg_init_mem_wide(base + 8, base, 8, base + 16, as); + fw_cfg =3D fw_cfg_init_mem_dma(base + 8, base, 8, base + 16, as); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)ms->smp.cpus); =20 nodename =3D g_strdup_printf("/fw-cfg@%" PRIx64, base); diff --git a/hw/loongarch/fw_cfg.c b/hw/loongarch/fw_cfg.c index 493563669e5..d2a79efbf76 100644 --- a/hw/loongarch/fw_cfg.c +++ b/hw/loongarch/fw_cfg.c @@ -23,8 +23,8 @@ FWCfgState *virt_fw_cfg_init(ram_addr_t ram_size, Machine= State *ms) int max_cpus =3D ms->smp.max_cpus; int smp_cpus =3D ms->smp.cpus; =20 - fw_cfg =3D fw_cfg_init_mem_wide(VIRT_FWCFG_BASE + 8, VIRT_FWCFG_BASE, = 8, - VIRT_FWCFG_BASE + 16, &address_space_mem= ory); + fw_cfg =3D fw_cfg_init_mem_dma(VIRT_FWCFG_BASE + 8, VIRT_FWCFG_BASE, 8, + VIRT_FWCFG_BASE + 16, &address_space_memo= ry); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)max_cpus); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)smp_cpus); diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 8a21cdae4fc..1d7d8354213 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1088,9 +1088,9 @@ static FWCfgState *fw_cfg_init_mem_internal(hwaddr ct= l_addr, return s; } =20 -FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, - hwaddr data_addr, uint32_t data_width, - hwaddr dma_addr, AddressSpace *dma_as) +FWCfgState *fw_cfg_init_mem_dma(hwaddr ctl_addr, + hwaddr data_addr, uint32_t data_width, + hwaddr dma_addr, AddressSpace *dma_as) { assert(dma_addr && dma_as); return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_width, diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index bd8608ea5bf..07e66b39364 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1274,8 +1274,8 @@ static FWCfgState *create_fw_cfg(const MachineState *= ms, hwaddr base) { FWCfgState *fw_cfg; =20 - fw_cfg =3D fw_cfg_init_mem_wide(base + 8, base, 8, base + 16, - &address_space_memory); + fw_cfg =3D fw_cfg_init_mem_dma(base + 8, base, 8, base + 16, + &address_space_memory); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)ms->smp.cpus); =20 return fw_cfg; --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907769; cv=none; d=zohomail.com; s=zohoarc; b=hqjGfp+GzPt+2kysRankhWGcEpelNjKABcnjr+rw+eoBcFq/06NI594I23VuqXy8PY4lGQJ2MomXDzXVBqeyta17/LvY/UELMS1R0CxgJWz4B6TwqSyc/s0QhrUa+/XnbLeO/wsWUKOyLsTSK7+1svFAKNjKo5Tw7II8vg7eX+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907769; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Zub/LVsTjWjVZ5bQ3GCjLklkh++VWzGkXKT/zQbO43U=; b=aiBfA0pyjc1AyLJsGwNKNlBR0pa71yyXhj7v7xQW+Rr+7wBArwi0vrLlNLnOuurhuaH1s64wuymYQGN0GWqifHu4oPo+CUqYUMM87hOCjoPf4DHjUtiGDj27iuyBKnff3Gsh4B46/NWn6KA1Y4Yb8tpAqvN9kcAMoyUaUEHKzWo= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907769903650.9522940621517; Thu, 12 Feb 2026 06:49:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvG-0005kB-DM; Thu, 12 Feb 2026 09:44:02 -0500 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 1vqXux-0005Nm-Qw for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuZ-000636-Ph for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:42 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-642-44Ebw3feN2uC8aaiGlI7NQ-1; Thu, 12 Feb 2026 09:43:18 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-43623cfb160so5112845f8f.1 for ; Thu, 12 Feb 2026 06:43:17 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43783d56b44sm12344505f8f.16.2026.02.12.06.43.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907399; 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=Zub/LVsTjWjVZ5bQ3GCjLklkh++VWzGkXKT/zQbO43U=; b=EWkf+97R1+nPSCuUhTnY1XamX52zdfmcEc/99j7KNx2DIDgqEcNtFX+3ATiLMElA1JPncb jVccxynmPJNQnjZZ19XVnaFFqAlUmvptddGMGAR1aGtT5bfl6UqgcARBkTF100Qt1N/K3i 2au3kBU6W6vBW/vPqb11VQNDWPGIC2U= X-MC-Unique: 44Ebw3feN2uC8aaiGlI7NQ-1 X-Mimecast-MFC-AGG-ID: 44Ebw3feN2uC8aaiGlI7NQ_1770907397 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907396; x=1771512196; 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=Zub/LVsTjWjVZ5bQ3GCjLklkh++VWzGkXKT/zQbO43U=; b=L8IQsiE1ilMfmjLgpwE0qQmWVAwJ4Ho8QZxQc+G8Lb+objeBcZ79TruYvvzx0W8/Uj tXOgGkSDK4LdXnCwWjl+RtX0/jih/SVfDEhO9Z+vI95Wf5CuBPdGfZ13BYmDUiq+z4VL gqF9v5fTeWph9V3prVs1J1PlbHsb4yf0u3+RmYv1h+YZtZC5MOdYR8FoPh0fZBIcKqr/ fycjaCgB4GTJr08KDfpH4X9DTmkouMwMxMrMfIajz7fHIQY72S6ADRfaMvadqZR7m6Kx 15YZApD2d3467T0AfXZ38lNlr+9n3jDbj5KZ5qPxxGHpP/zQIpuVCATxi0jMKMZ279mo K5PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907396; x=1771512196; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Zub/LVsTjWjVZ5bQ3GCjLklkh++VWzGkXKT/zQbO43U=; b=SWFh+5LzScWpp7AQlSQmW0OkKV3arlri6tBWgh7hqFgpO95DIxSxg/dxI6Ta0+BZDG TXTXXS05uj9T0hyIvyFVPfLytlr+np38cgJLiQdOLKHqJQnIXjNrz2m6JfXBuPDOo1jX bVIYgWRDaGTZekwC6621cU77zIFVJdp65hyTS7xcfB6AG+Sc/k6EI/W7plseJuW77XO2 BbwkQ+wleBL9H1aKP7FHf9ce88MbW9S63tKf0Flzyb4VKv2gNYcC5CPlN1+KJMs9bD7p EgvuSnCFrDKQAlEf/YhVFwpfc039vDNIzmtNM7jZVOkyj55/MPgAoVlkalldLd7XkgAt +mfg== X-Gm-Message-State: AOJu0Yz/UIrHGeTwQUjec0zAq4x+r+nne9w3QdFbh1ER+pBl0hpdVPkF Rjm54E1zW9ngHNSbZgWvv+IgCaw8Q94Bapp90pgQfSlYIC+53aYkZxgM6rXPqfgW9O1vRmb4p6K KYfxEcmmUL4SAjqYJ65VTOFXYt9+n+H4nHow+937C3LzigpMWOMQWMkO9gCXVzk3V9RxB05SCdy S29SZCgnSKAaa6UD8ciK1l/rsbTuUwXCDFo3ViUq43 X-Gm-Gg: AZuq6aJGQyBaILHm5kMJm39PKcC2m3wtInsl4tZMSt8j2upciiJp8+gZ3zHXTRiE4Pi fwrsuhTal2ZG6iyOrI4NMymX0QEkS3oBMXDKeb+P9oQ1JyPeA0dQUL3WC2V0KBMNja/lGKsg2mO XDbJVdMXFPW9VoM4z+QJtFJeCdn8yAaAL8R3q658RsVZNJMBrkkSAb3Fb8g5/ggQ19b/uJx3UtI yTNyNy+LMl2G0XCU7bFcTBpTrzo3N7cyfuXkUQqZA6Zl4OE91FOuMJTPJQDOWz9z16cxxDxAcs8 UyZbm/DRsm9IEwx65B9UiLIORwCZ8InVZROWEq9e/YNIAheAPRAA5I+/BkhgVvcpO/Z4uSVf0zl bCeCpadXqkHvmj3ZeiR2fcS6zmzJmVeg4S7ponltJWS5b0rm43SP5ZS4Jq9j0uMB8FGi8wVyIwZ k5b0LCGlxOnGUvGi6Jgq19qdjt18XUhLAr37YvvoWtNfnX5EmDbzE= X-Received: by 2002:a5d:5f55:0:b0:437:7168:af52 with SMTP id ffacd0b85a97d-4378aa021c2mr5864555f8f.11.1770907396168; Thu, 12 Feb 2026 06:43:16 -0800 (PST) X-Received: by 2002:a5d:5f55:0:b0:437:7168:af52 with SMTP id ffacd0b85a97d-4378aa021c2mr5864479f8f.11.1770907395609; Thu, 12 Feb 2026 06:43:15 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Igor Mammedov Subject: [PULL 13/41] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Date: Thu, 12 Feb 2026 15:42:15 +0100 Message-ID: <20260212144244.22579-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907772036154100 From: Philippe Mathieu-Daud=C3=A9 The X86MachineClass::fwcfg_dma_enabled boolean was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it and simplify. 'multiboot.bin' isn't used anymore, we'll remove it in the next commit. Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-13-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/i386/x86.h | 2 -- hw/i386/microvm.c | 3 --- hw/i386/multiboot.c | 7 +------ hw/i386/x86-common.c | 3 +-- hw/i386/x86.c | 2 -- 5 files changed, 2 insertions(+), 15 deletions(-) diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 0dffba95f9a..23be6274377 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -30,8 +30,6 @@ struct X86MachineClass { MachineClass parent; =20 - /* use DMA capable linuxboot option rom */ - bool fwcfg_dma_enabled; /* CPU and apic information: */ bool apic_xrupt_override; }; diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 8cf99ad6623..7ff20512636 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -640,7 +640,6 @@ GlobalProperty microvm_properties[] =3D { =20 static void microvm_class_init(ObjectClass *oc, const void *data) { - X86MachineClass *x86mc =3D X86_MACHINE_CLASS(oc); MicrovmMachineClass *mmc =3D MICROVM_MACHINE_CLASS(oc); MachineClass *mc =3D MACHINE_CLASS(oc); HotplugHandlerClass *hc =3D HOTPLUG_HANDLER_CLASS(oc); @@ -674,8 +673,6 @@ static void microvm_class_init(ObjectClass *oc, const v= oid *data) hc->unplug_request =3D microvm_device_unplug_request_cb; hc->unplug =3D microvm_device_unplug_cb; =20 - x86mc->fwcfg_dma_enabled =3D true; - object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto", microvm_machine_get_rtc, microvm_machine_set_rtc, diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c index 8b6acfee9ba..0e960a15dda 100644 --- a/hw/i386/multiboot.c +++ b/hw/i386/multiboot.c @@ -153,7 +153,6 @@ int load_multiboot(X86MachineState *x86ms, int kernel_file_size, uint8_t *header) { - bool multiboot_dma_enabled =3D X86_MACHINE_GET_CLASS(x86ms)->fwcfg_dma= _enabled; int i, is_multiboot =3D 0; uint32_t flags =3D 0; uint32_t mh_entry_addr; @@ -402,11 +401,7 @@ int load_multiboot(X86MachineState *x86ms, fw_cfg_add_bytes(fw_cfg, FW_CFG_INITRD_DATA, mb_bootinfo_data, sizeof(bootinfo)); =20 - if (multiboot_dma_enabled) { - option_rom[nb_option_roms].name =3D "multiboot_dma.bin"; - } else { - option_rom[nb_option_roms].name =3D "multiboot.bin"; - } + option_rom[nb_option_roms].name =3D "multiboot_dma.bin"; option_rom[nb_option_roms].bootindex =3D 0; nb_option_roms++; =20 diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c index 85b90ff4324..192e91042f2 100644 --- a/hw/i386/x86-common.c +++ b/hw/i386/x86-common.c @@ -645,7 +645,6 @@ void x86_load_linux(X86MachineState *x86ms, int acpi_data_size, bool pvh_enabled) { - bool linuxboot_dma_enabled =3D X86_MACHINE_GET_CLASS(x86ms)->fwcfg_dma= _enabled; uint16_t protocol; int setup_size, kernel_size, cmdline_size; int dtb_size, setup_data_offset; @@ -1004,7 +1003,7 @@ void x86_load_linux(X86MachineState *x86ms, =20 option_rom[nb_option_roms].bootindex =3D 0; option_rom[nb_option_roms].name =3D "linuxboot.bin"; - if (linuxboot_dma_enabled && fw_cfg_dma_enabled(fw_cfg)) { + if (fw_cfg_dma_enabled(fw_cfg)) { option_rom[nb_option_roms].name =3D "linuxboot_dma.bin"; } nb_option_roms++; diff --git a/hw/i386/x86.c b/hw/i386/x86.c index c29856c810a..01872cba073 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -375,14 +375,12 @@ static void x86_machine_initfn(Object *obj) static void x86_machine_class_init(ObjectClass *oc, const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); - X86MachineClass *x86mc =3D X86_MACHINE_CLASS(oc); NMIClass *nc =3D NMI_CLASS(oc); =20 mc->cpu_index_to_instance_props =3D x86_cpu_index_to_props; mc->get_default_cpu_node_id =3D x86_get_default_cpu_node_id; mc->possible_cpu_arch_ids =3D x86_possible_cpu_arch_ids; mc->kvm_type =3D x86_kvm_type; - x86mc->fwcfg_dma_enabled =3D true; nc->nmi_monitor_handler =3D x86_nmi; =20 object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto", --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907479; cv=none; d=zohomail.com; s=zohoarc; b=ccr3AgNpGTekOsqqDPQiOoh6Iw9kQA692KyyyD5xWD4aS1rSmPM7ino8bV1lMxe1gooIYtwbKWlIfAyyQncXJ/4Up90klWW8UvdEbxkVnUn5TYHyO5+wbqCJnpMgPT0aJW4PsTD3ok9hSnoTYIrSTVesKa/A7nnkED1S0TeFKpI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907479; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=j2J5S69ujIyTT8+25co0N6GqgCEdVM5HCv9XrkCpJ+g=; b=I4H8XcVRD6Qz19aPvZikxQsVayHgHNlmiWmLO4ay1LF771wSxCagsha1QWGckURdU11Sqys+U+HleJL2xI2scYZIigXKjucWOFoEObKqWnGwMf/BomM4AGfxmbEAfumsxOwIbas8iiJPiWBERWquddfaeGVH21tMfL/QiKgD5Og= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177090747937553.29490778422303; Thu, 12 Feb 2026 06:44:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvG-0005kT-Ke; Thu, 12 Feb 2026 09:44:02 -0500 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 1vqXuz-0005O1-BA for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXug-000641-6u for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:44 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-1-9LnXJA8yMOOVQEivW69VQg-1; Thu, 12 Feb 2026 09:43:21 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-47ee3dd7fc8so60700775e9.3 for ; Thu, 12 Feb 2026 06:43:21 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835a627c96sm71706275e9.2.2026.02.12.06.43.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907405; 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=j2J5S69ujIyTT8+25co0N6GqgCEdVM5HCv9XrkCpJ+g=; b=OlqI07OPWC49zi79SiC2ahIxr7EBgBmi5cwJpnFp7r7zIwMp3qRkYUPiZWInspiICClmKy yIt/7yFaEmgnWjvamHKGdeuE2MtlHVWAyrQm0WovI3z+2vn8sQWuh/zm8gDtmMrDhIOAUe zbHgqMousRJzNIJ/flaiFN3f66G8OuM= X-MC-Unique: 9LnXJA8yMOOVQEivW69VQg-1 X-Mimecast-MFC-AGG-ID: 9LnXJA8yMOOVQEivW69VQg_1770907400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907399; x=1771512199; 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=j2J5S69ujIyTT8+25co0N6GqgCEdVM5HCv9XrkCpJ+g=; b=gq6EdOVGDqU7o4DZrtaCTWCXVhiWp3f5Ih0UcGSEvuhuAO6RO0WBXh7bLE8JknAYEG EmX9CAs18UeR+afBmawOehAaIi59iOJBsrVwvv05S/f/XToURo8veCw6pSU8tYQ/xTit AyUfsvsJAjTw2BBZL/cP8+d6B3PR60QnxFd+2+xK6OVRqB8K6d0KSdwoatIEPJC2p0vF 4tM8fFYFF5P1AR27U2z+m+xE0zM6aSWpVFl6r8gMWQxanv/AKIvVOxnLp77ax87yKh0O 3FlhGKeRy8u+vg5u9iAHc0kOUkbuLywZ2Wu6R/S6iRVEq/LUD/O2bV/7rhhNNuQNDkEU Ofjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907399; x=1771512199; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=j2J5S69ujIyTT8+25co0N6GqgCEdVM5HCv9XrkCpJ+g=; b=U6E2DFqSnaoSspGl0caB5PHGOsLne02s82UT6hLEV2gRlgyCWm8KwU/NHYcINgxpT+ cqhZytipMceU23v2jWbkMEUfOLUvo36GyC6TPB/AAgYylmYnl+7BrIDSXGQu8ejI5Ujw gTvbxfk6KNmY3MAHEaW6EcOMgYG8hxvtclMUrXHUb+KvMDT5HuCDCIdZNz5/DdmmYTcB 31HBBsYPLi8zQUXsZ2cs/7hIT2+Oj4oXLXXA+cp9FxlqroBYLuVDtABj7ALD307GlMvl W7QTGKmMYWcFjJtAUgeoRg4pZnUj5MA4bzEIDYsJ1i4/zCCLCcHfrU1GSK6qQ/DeW/qM m22A== X-Gm-Message-State: AOJu0YyNKHNqQ43aCb85nMvsE9nZfP48nVF755jKYkJgcIlkeadTYRRJ 74+XR6LqWMiubb5RBlYnAfRwNR8C4PwuSJIUHiC652s1EyFs6ZCOAEo3ER+huJwQxDqndOR0UKW bop4cK1Ru2Cxoxah/PzF6jGO5i7sdduAxYQ0IUpJVK/eU1lL/NdfPAYBuko5twSxNzPU1s/8wfF s4ejuLjmoHhzML2ZwraczV4pqz+EYkFLkD0ivKZATx X-Gm-Gg: AZuq6aJAH/+MyZO2gbBCtiBoKwR22PiUlm1DpEJHwoaDY++VxVOzXILvyW78nl/IVsh oCSu18IU9/A80mfLU6db64AfgpQqWO8ajoIkY2FVbSOnprN8xpXhXPwObJraQ8XtbCWPV3CYCfQ LggbXwp3yenEDucrLD6B5u1/EDEUbB+rrz93WaibMt8G5oyf0a2VznEFgPeBdO8vX4KbvZd8/2J taYAJGlxnLVigkw5x/m2QW8PmGZo9R6yLIL8TaKMP5UHPWdulN+tyEDTXZpf9SgKv2KAtbtHJZj bGBm1RXQu1gKpNzu/UjMzjaI5d+0ltyK07dfYpk0nX1BuG6WzOpZnqshhvQap0nD2lk9pY4VWCU QjjOqyBZJISTN/U6wBk7VrYSHoU51gXppR+geJAsuchYeIvKZklD70KTJjqZJAY62IXfREm6nyZ 1FrFhZ+hHnbu8kV+TfklYj/XjVo32eQknrVtA2mOk1SA2ZnI80pWo= X-Received: by 2002:a05:600c:458c:b0:477:55ce:f3c2 with SMTP id 5b1f17b1804b1-483656c608cmr38197945e9.14.1770907398870; Thu, 12 Feb 2026 06:43:18 -0800 (PST) X-Received: by 2002:a05:600c:458c:b0:477:55ce:f3c2 with SMTP id 5b1f17b1804b1-483656c608cmr38197175e9.14.1770907398144; Thu, 12 Feb 2026 06:43:18 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Zhao Liu , Igor Mammedov Subject: [PULL 14/41] hw/i386/pc: Remove multiboot.bin Date: Thu, 12 Feb 2026 15:42:16 +0100 Message-ID: <20260212144244.22579-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907504430158500 From: Philippe Mathieu-Daud=C3=A9 All PC machines now use the multiboot_dma.bin binary, we can remove the non-DMA version (multiboot.bin). This doesn't change multiboot_dma binary file. Suggested-by: Thomas Huth Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-14-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- pc-bios/optionrom/optionrom.h | 4 - hw/i386/pc.c | 1 - pc-bios/meson.build | 1 - pc-bios/multiboot.bin | Bin 1024 -> 0 bytes pc-bios/optionrom/Makefile | 2 +- pc-bios/optionrom/multiboot.S | 232 ----------------------------- pc-bios/optionrom/multiboot_dma.S | 234 +++++++++++++++++++++++++++++- 7 files changed, 233 insertions(+), 241 deletions(-) delete mode 100644 pc-bios/multiboot.bin delete mode 100644 pc-bios/optionrom/multiboot.S diff --git a/pc-bios/optionrom/optionrom.h b/pc-bios/optionrom/optionrom.h index 7bcdf0eeb24..2e6e2493f83 100644 --- a/pc-bios/optionrom/optionrom.h +++ b/pc-bios/optionrom/optionrom.h @@ -117,16 +117,12 @@ * * Clobbers: %eax, %edx, %es, %ecx, %edi and adresses %esp-20 to %esp */ -#ifdef USE_FW_CFG_DMA #define read_fw_blob_dma(var) \ read_fw var ## _SIZE; \ mov %eax, %ecx; \ read_fw var ## _ADDR; \ mov %eax, %edi ; \ read_fw_dma var ## _DATA, %ecx, %edi -#else -#define read_fw_blob_dma(var) read_fw_blob(var) -#endif =20 #define read_fw_blob_pre(var) \ read_fw var ## _SIZE; \ diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 716962f24fc..b033fc67cf9 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -672,7 +672,6 @@ void xen_load_linux(PCMachineState *pcms) assert(!strcmp(option_rom[i].name, "linuxboot.bin") || !strcmp(option_rom[i].name, "linuxboot_dma.bin") || !strcmp(option_rom[i].name, "pvh.bin") || - !strcmp(option_rom[i].name, "multiboot.bin") || !strcmp(option_rom[i].name, "multiboot_dma.bin")); rom_add_option(option_rom[i].name, option_rom[i].bootindex); } diff --git a/pc-bios/meson.build b/pc-bios/meson.build index 9260aaad78e..efe45c16705 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -62,7 +62,6 @@ blobs =3D [ 'efi-e1000e.rom', 'efi-vmxnet3.rom', 'qemu-nsis.bmp', - 'multiboot.bin', 'multiboot_dma.bin', 'linuxboot.bin', 'linuxboot_dma.bin', diff --git a/pc-bios/multiboot.bin b/pc-bios/multiboot.bin deleted file mode 100644 index e772713c95749bee82c20002b50ec6d05b2d4987..000000000000000000000000000= 0000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmeHFF=3D!KE7=3D3rWv_~9rsoFv02vW|$BE3Z@O2HvxF(Tbn?w$(KKupFCa&$N@9Fjpq zK@c}VaQwY4cgc{Tlqxt>x}>-yZJ|RqIXJnrkq&Z`qYu9S`*@G&pvhTyuJgL1#^qn)3#|vcmPSdBLEU<5H(yG&ogOxzu?&L$_ll z`=3D1R?t;PFYKHEz@813aPx^pUQ7NogpP)Gm@mqMG#RX}I}{ICADANm7-NHH@$nuknt zOJkc1gMiQ1RzNOyxKbM?UVlI lgl_|v@lXbCmseKtxLIvHx?ig`O4Zsu%dVet`Hz2u_&3=3Dy3J?GQ diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index e6674a76e73..963a77a3298 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -2,7 +2,7 @@ include config.mak SRC_DIR :=3D $(TOPSRC_DIR)/pc-bios/optionrom VPATH =3D $(SRC_DIR) =20 -all: multiboot.bin multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmva= pic.bin pvh.bin +all: multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin # Dummy command so that make thinks it has done something @true =20 diff --git a/pc-bios/optionrom/multiboot.S b/pc-bios/optionrom/multiboot.S deleted file mode 100644 index c95e35c9cb6..00000000000 --- a/pc-bios/optionrom/multiboot.S +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Multiboot Option ROM - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - * Copyright Novell Inc, 2009 - * Authors: Alexander Graf - */ - -#include "optionrom.h" - -#define BOOT_ROM_PRODUCT "multiboot loader" - -#define MULTIBOOT_MAGIC 0x2badb002 - -#define GS_PROT_JUMP 0 -#define GS_GDT_DESC 6 - - -BOOT_ROM_START - -run_multiboot: - - cli - cld - - mov %cs, %eax - shl $0x4, %eax - - /* set up a long jump descriptor that is PC relative */ - - /* move stack memory to %gs */ - mov %ss, %ecx - shl $0x4, %ecx - mov %esp, %ebx - add %ebx, %ecx - sub $0x20, %ecx - sub $0x30, %esp - shr $0x4, %ecx - mov %cx, %gs - - /* now push the indirect jump descriptor there */ - mov (prot_jump), %ebx - add %eax, %ebx - movl %ebx, %gs:GS_PROT_JUMP - mov $8, %bx - movw %bx, %gs:GS_PROT_JUMP + 4 - - /* fix the gdt descriptor to be PC relative */ - movw (gdt_desc), %bx - movw %bx, %gs:GS_GDT_DESC - movl (gdt_desc+2), %ebx - add %eax, %ebx - movl %ebx, %gs:GS_GDT_DESC + 2 - - xor %eax, %eax - mov %eax, %es - - /* Read the bootinfo struct into RAM */ - read_fw_blob_dma(FW_CFG_INITRD) - - /* FS =3D bootinfo_struct */ - read_fw FW_CFG_INITRD_ADDR - shr $4, %eax - mov %ax, %fs - - /* Account for the EBDA in the multiboot structure's e801 - * map. - */ - int $0x12 - cwtl - movl %eax, %fs:4 - - /* ES =3D mmap_addr */ - mov %fs:48, %eax - shr $4, %eax - mov %ax, %es - - /* Initialize multiboot mmap structs using int 0x15(e820) */ - xor %ebx, %ebx - /* Start storing mmap data at %es:0 */ - xor %edi, %edi - -mmap_loop: - /* The multiboot entry size has offset -4, so leave some space */ - add $4, %di - /* entry size (mmap struct) & max buffer size (int15) */ - movl $20, %ecx - /* e820 */ - movl $0x0000e820, %eax - /* 'SMAP' magic */ - movl $0x534d4150, %edx - int $0x15 - -mmap_check_entry: - /* Error or last entry already done? */ - jb mmap_done - -mmap_store_entry: - /* store entry size */ - /* old as(1) doesn't like this insn so emit the bytes instead: - movl %ecx, %es:-4(%edi) - */ - .dc.b 0x26,0x67,0x66,0x89,0x4f,0xfc - - /* %edi +=3D entry_size, store as mbs_mmap_length */ - add %ecx, %edi - movw %di, %fs:0x2c - - /* Continuation value 0 means last entry */ - test %ebx, %ebx - jnz mmap_loop - -mmap_done: - /* Calculate upper_mem field: The amount of memory between 1 MB and - the first upper memory hole. Get it from the mmap. */ - xor %di, %di - mov $0x100000, %edx -upper_mem_entry: - cmp %fs:0x2c, %di - je upper_mem_done - add $4, %di - - /* Skip if type !=3D 1 */ - cmpl $1, %es:16(%di) - jne upper_mem_next - - /* Skip if > 4 GB */ - movl %es:4(%di), %eax - test %eax, %eax - jnz upper_mem_next - - /* Check for contiguous extension (base <=3D %edx < base + length) */ - movl %es:(%di), %eax - cmp %eax, %edx - jb upper_mem_next - addl %es:8(%di), %eax - cmp %eax, %edx - jae upper_mem_next - - /* If so, update %edx, and restart the search (mmap isn't ordered) */ - mov %eax, %edx - xor %di, %di - jmp upper_mem_entry - -upper_mem_next: - addl %es:-4(%di), %edi - jmp upper_mem_entry - -upper_mem_done: - sub $0x100000, %edx - shr $10, %edx - mov %edx, %fs:0x8 - -real_to_prot: - /* Load the GDT before going into protected mode */ -lgdt: - data32 lgdt %gs:GS_GDT_DESC - - /* get us to protected mode now */ - movl $1, %eax - movl %eax, %cr0 - - /* the LJMP sets CS for us and gets us to 32-bit */ -ljmp: - data32 ljmp *%gs:GS_PROT_JUMP - -prot_mode: -.code32 - - /* initialize all other segments */ - movl $0x10, %eax - movl %eax, %ss - movl %eax, %ds - movl %eax, %es - movl %eax, %fs - movl %eax, %gs - - /* Read the kernel and modules into RAM */ - read_fw_blob_dma(FW_CFG_KERNEL) - - /* Jump off to the kernel */ - read_fw FW_CFG_KERNEL_ENTRY - mov %eax, %ecx - - /* EBX contains a pointer to the bootinfo struct */ - read_fw FW_CFG_INITRD_ADDR - movl %eax, %ebx - - /* EAX has to contain the magic */ - movl $MULTIBOOT_MAGIC, %eax -ljmp2: - jmp *%ecx - -/* Variables */ -.align 4, 0 -prot_jump: .long prot_mode - .short 8 - -.align 8, 0 -gdt: - /* 0x00 */ -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - /* 0x08: code segment (base=3D0, limit=3D0xfffff, type=3D32bit code exec/= read, DPL=3D0, 4k) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00 - - /* 0x10: data segment (base=3D0, limit=3D0xfffff, type=3D32bit data read/= write, DPL=3D0, 4k) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00 - - /* 0x18: code segment (base=3D0, limit=3D0x0ffff, type=3D16bit code exec/= read/conf, DPL=3D0, 1b) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00 - - /* 0x20: data segment (base=3D0, limit=3D0x0ffff, type=3D16bit data read/= write, DPL=3D0, 1b) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00 - -gdt_desc: -.short (5 * 8) - 1 -.long gdt - -BOOT_ROM_END diff --git a/pc-bios/optionrom/multiboot_dma.S b/pc-bios/optionrom/multiboo= t_dma.S index d809af3e23f..c95e35c9cb6 100644 --- a/pc-bios/optionrom/multiboot_dma.S +++ b/pc-bios/optionrom/multiboot_dma.S @@ -1,2 +1,232 @@ -#define USE_FW_CFG_DMA 1 -#include "multiboot.S" +/* + * Multiboot Option ROM + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + * + * Copyright Novell Inc, 2009 + * Authors: Alexander Graf + */ + +#include "optionrom.h" + +#define BOOT_ROM_PRODUCT "multiboot loader" + +#define MULTIBOOT_MAGIC 0x2badb002 + +#define GS_PROT_JUMP 0 +#define GS_GDT_DESC 6 + + +BOOT_ROM_START + +run_multiboot: + + cli + cld + + mov %cs, %eax + shl $0x4, %eax + + /* set up a long jump descriptor that is PC relative */ + + /* move stack memory to %gs */ + mov %ss, %ecx + shl $0x4, %ecx + mov %esp, %ebx + add %ebx, %ecx + sub $0x20, %ecx + sub $0x30, %esp + shr $0x4, %ecx + mov %cx, %gs + + /* now push the indirect jump descriptor there */ + mov (prot_jump), %ebx + add %eax, %ebx + movl %ebx, %gs:GS_PROT_JUMP + mov $8, %bx + movw %bx, %gs:GS_PROT_JUMP + 4 + + /* fix the gdt descriptor to be PC relative */ + movw (gdt_desc), %bx + movw %bx, %gs:GS_GDT_DESC + movl (gdt_desc+2), %ebx + add %eax, %ebx + movl %ebx, %gs:GS_GDT_DESC + 2 + + xor %eax, %eax + mov %eax, %es + + /* Read the bootinfo struct into RAM */ + read_fw_blob_dma(FW_CFG_INITRD) + + /* FS =3D bootinfo_struct */ + read_fw FW_CFG_INITRD_ADDR + shr $4, %eax + mov %ax, %fs + + /* Account for the EBDA in the multiboot structure's e801 + * map. + */ + int $0x12 + cwtl + movl %eax, %fs:4 + + /* ES =3D mmap_addr */ + mov %fs:48, %eax + shr $4, %eax + mov %ax, %es + + /* Initialize multiboot mmap structs using int 0x15(e820) */ + xor %ebx, %ebx + /* Start storing mmap data at %es:0 */ + xor %edi, %edi + +mmap_loop: + /* The multiboot entry size has offset -4, so leave some space */ + add $4, %di + /* entry size (mmap struct) & max buffer size (int15) */ + movl $20, %ecx + /* e820 */ + movl $0x0000e820, %eax + /* 'SMAP' magic */ + movl $0x534d4150, %edx + int $0x15 + +mmap_check_entry: + /* Error or last entry already done? */ + jb mmap_done + +mmap_store_entry: + /* store entry size */ + /* old as(1) doesn't like this insn so emit the bytes instead: + movl %ecx, %es:-4(%edi) + */ + .dc.b 0x26,0x67,0x66,0x89,0x4f,0xfc + + /* %edi +=3D entry_size, store as mbs_mmap_length */ + add %ecx, %edi + movw %di, %fs:0x2c + + /* Continuation value 0 means last entry */ + test %ebx, %ebx + jnz mmap_loop + +mmap_done: + /* Calculate upper_mem field: The amount of memory between 1 MB and + the first upper memory hole. Get it from the mmap. */ + xor %di, %di + mov $0x100000, %edx +upper_mem_entry: + cmp %fs:0x2c, %di + je upper_mem_done + add $4, %di + + /* Skip if type !=3D 1 */ + cmpl $1, %es:16(%di) + jne upper_mem_next + + /* Skip if > 4 GB */ + movl %es:4(%di), %eax + test %eax, %eax + jnz upper_mem_next + + /* Check for contiguous extension (base <=3D %edx < base + length) */ + movl %es:(%di), %eax + cmp %eax, %edx + jb upper_mem_next + addl %es:8(%di), %eax + cmp %eax, %edx + jae upper_mem_next + + /* If so, update %edx, and restart the search (mmap isn't ordered) */ + mov %eax, %edx + xor %di, %di + jmp upper_mem_entry + +upper_mem_next: + addl %es:-4(%di), %edi + jmp upper_mem_entry + +upper_mem_done: + sub $0x100000, %edx + shr $10, %edx + mov %edx, %fs:0x8 + +real_to_prot: + /* Load the GDT before going into protected mode */ +lgdt: + data32 lgdt %gs:GS_GDT_DESC + + /* get us to protected mode now */ + movl $1, %eax + movl %eax, %cr0 + + /* the LJMP sets CS for us and gets us to 32-bit */ +ljmp: + data32 ljmp *%gs:GS_PROT_JUMP + +prot_mode: +.code32 + + /* initialize all other segments */ + movl $0x10, %eax + movl %eax, %ss + movl %eax, %ds + movl %eax, %es + movl %eax, %fs + movl %eax, %gs + + /* Read the kernel and modules into RAM */ + read_fw_blob_dma(FW_CFG_KERNEL) + + /* Jump off to the kernel */ + read_fw FW_CFG_KERNEL_ENTRY + mov %eax, %ecx + + /* EBX contains a pointer to the bootinfo struct */ + read_fw FW_CFG_INITRD_ADDR + movl %eax, %ebx + + /* EAX has to contain the magic */ + movl $MULTIBOOT_MAGIC, %eax +ljmp2: + jmp *%ecx + +/* Variables */ +.align 4, 0 +prot_jump: .long prot_mode + .short 8 + +.align 8, 0 +gdt: + /* 0x00 */ +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + /* 0x08: code segment (base=3D0, limit=3D0xfffff, type=3D32bit code exec/= read, DPL=3D0, 4k) */ +.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00 + + /* 0x10: data segment (base=3D0, limit=3D0xfffff, type=3D32bit data read/= write, DPL=3D0, 4k) */ +.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00 + + /* 0x18: code segment (base=3D0, limit=3D0x0ffff, type=3D16bit code exec/= read/conf, DPL=3D0, 1b) */ +.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00 + + /* 0x20: data segment (base=3D0, limit=3D0x0ffff, type=3D16bit data read/= write, DPL=3D0, 1b) */ +.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00 + +gdt_desc: +.short (5 * 8) - 1 +.long gdt + +BOOT_ROM_END --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907724; cv=none; d=zohomail.com; s=zohoarc; b=gLmEBmIZVd/JNRXMSGSX+SimSlFsU49bRTAwa+U+0Ef9uQmZ6jvrvy3AV3G32qhL9MhFFku/nipZaapBQc9WBBaQ3KP5otfCTVyZ7DpklKgNdDEMUKlDG8/OVVps+KbRBNj+q1sbcTYfkb8CUVejSUYgX3MURNxMmAbcd9wnEB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907724; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jeyKAy+Sk16BZBcLEdZFiLIsmU/3OCDrP03DNwve1oA=; b=JhEp9XSNLV8btAxzMnQrcIF1n3S0BaGOTY4Ab64VSmKfcNPv3mOBgQaezxxBG8cn3XT9/d12dMujD/5gRacBpKWAA704nVymKr2I4CDbKIUrzu8ApfV7d6BqJu4+NuvOP39JcM6BoquvXUp87AMMgXn0kj/6GHQkHRXCuBuEhd0= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907724274705.20699044986; Thu, 12 Feb 2026 06:48:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvQ-0005wY-AT; Thu, 12 Feb 2026 09:44:12 -0500 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 1vqXux-0005Nn-RQ for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuf-00063s-0p for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:43 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-491-b-qTDgxeMXK405QVihxjWg-1; Thu, 12 Feb 2026 09:43:22 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-482eec44485so24801975e9.3 for ; Thu, 12 Feb 2026 06:43:22 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835ba3e4b5sm69694995e9.5.2026.02.12.06.43.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907404; 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=jeyKAy+Sk16BZBcLEdZFiLIsmU/3OCDrP03DNwve1oA=; b=G8cyH3QGF4cGIS6hOF/3ugHPIFrjSvFbg2ZPgTmUsv7pjK5AKPzfb6jCriMJBIJiNqgDH5 TDAF2JB4WlVWsf22FKnSI/byT6qE8YI1mDyUJEbtW8Z+X4l1Ul98RMDR2YQ91cI/IL5I/5 LLXnXDofyX4+DTnqa5see1qy+7BvOV8= X-MC-Unique: b-qTDgxeMXK405QVihxjWg-1 X-Mimecast-MFC-AGG-ID: b-qTDgxeMXK405QVihxjWg_1770907401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907401; x=1771512201; 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=jeyKAy+Sk16BZBcLEdZFiLIsmU/3OCDrP03DNwve1oA=; b=brufwcFodL5mfg2u4lh/GjsxbzqSHABfVKKBQy9uJrZbvVEwYu32l1EFHCx26qqXTp 9gR7kmdlUpd6h3mAbfdx1TuHL9bCr315bbb4UtAX/wFwhhmvU6taTLCcd1Uf4b371RlG orLgU7MQ2XtArYpML4KYWx1XUxTqJIslYJIVMUXgTAaC9kkz9qeJCs0WvWj4nKlF/4Es BwbZQ+RAw193xiyEdlE6/JHY3/mXJpn29CsD1TJMddnB+oL1DjgB2MV0aLTkneDFgHjh Wvuzx42mvRP9NnZ4NDxiJzyIFgutnV2wzxPeT9zDW2/073VjEAlnMIkW+dD/tREGiKX3 +UQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907401; x=1771512201; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jeyKAy+Sk16BZBcLEdZFiLIsmU/3OCDrP03DNwve1oA=; b=XJ6GMsrWtaDo0uc7xA30Zl1sd117kUC8JRCdgynIF0bd8BHAl3+AnixUggL6OG08EY zHH+MPLLdu9zlrg+ATpnyO/MbCMfKuKEwd1Og4NrXtLEajapIPJtZ1I502yVgLdCrNEC KbxIJF4WS9eNkSwffGl3MYXsBBZ1l5U8DeUcg2VhuKnObMco6ys9Kp2uHbA/5TnwmnDn 3Fopa+JtuEIAAAUtoK58/tkgJee6+q3MFa0aLF1tMCQih0C6H+rhUDQOTqsTnHg+iSAo 7s4bHzgo0SidwmtOrvIyqexcxvOHBeKjJo1PLwlQ6GYqmb2Za5o8nn3hLRp9UOdiykDN Yfjw== X-Gm-Message-State: AOJu0YxVDQH7FXQJb/xGupIpQ75I3PV2d+qx0i6AifsvFq3Bzv1OP8pn brQ6Rof27+L5vA+zYXSM6DA4DGLWSDlE0BxBIDblL0LZB5fR4Y1tEprbqpbVE2HVahkN12Y6ih3 CsngmRBxq7Hykb8hcCu2S87cS+jgDePvWwGJHuxm/L0IcnOP+v6RHZMkiw8rltACxXAh7v7ntUT HUvN9YBTUxi6l3AX3D/TYpB+aqP87yV5fItRQkpWbu X-Gm-Gg: AZuq6aKDDCHj/NqyGT9mGf3hLG5SHTVKsOQIajcdgN6Xlo9DEkfauXSJ2JvF740XMq9 LWiwgNeORUN+oke3OAI8urUn8EiK1K35N5Q8RDyQPbBJ6awGgoyFoFSW7/vWSsON3XWgnrZ3xZU kE9s7ITL0W4nZtEA9vMQ2j10lnMG4XF7cHntWdDBLhdEwnuYTdfrAiL79/fbFGHlf92xv/qp0GZ YyjrhgjZTyyDuKH6A6IK8QkPbB9yTo8V9i7AeHRUFwUpPBLvXXTw23U3AHPFe0NaEzB6wr6FNPc rOP7CvoqA8jKOSFlRL2Q0tgzaVQ09YcMUz5q/vbvINZ8kc7y1Kg8SsJG10HgoUO3zyJOrHM5IvD 5DOhHiB3bLbY187hkEgc1VD5QcRsK4ZcZ154jxKfqJUsPMkMU5UckrVCRLPRvndw9lcxbh4ero3 TVQsZoaKtnlz2Yc5qsyirr62MweuIufH02TyeooPECcUcOjkIddDw= X-Received: by 2002:a05:600c:5489:b0:47e:e076:c7a5 with SMTP id 5b1f17b1804b1-483671146f6mr31599625e9.11.1770907400511; Thu, 12 Feb 2026 06:43:20 -0800 (PST) X-Received: by 2002:a05:600c:5489:b0:47e:e076:c7a5 with SMTP id 5b1f17b1804b1-483671146f6mr31599085e9.11.1770907399918; Thu, 12 Feb 2026 06:43:19 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Igor Mammedov , Thomas Huth Subject: [PULL 15/41] hw/i386: Assume fw_cfg DMA is always enabled Date: Thu, 12 Feb 2026 15:42:17 +0100 Message-ID: <20260212144244.22579-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907725317154100 From: Philippe Mathieu-Daud=C3=A9 Now all calls of x86 machines to fw_cfg_init_io_dma() pass DMA arguments, so the FWCfgState (FWCfgIoState) created by x86 machines enables DMA by default. Although other callers of fw_cfg_init_io_dma() besides x86 also pass DMA arguments to create DMA-enabled FwCfgIoState, the "dma_enabled" property of FwCfgIoState cannot yet be removed, because Sun4u and Sun4v still create DMA-disabled FwCfgIoState (bypass fw_cfg_init_io_dma()) in sun4uv_init() (hw/sparc64/sun4u.c). Maybe reusing fw_cfg_init_io_dma() for them would be a better choice, or adding fw_cfg_init_io_nodma(). However, before that, first simplify the handling of FwCfgState in x86. Considering that FwCfgIoState in x86 enables DMA by default, remove the handling for DMA-disabled cases and replace DMA checks with assertions to ensure that the default DMA-enabled setting is not broken. Then 'linuxboot.bin' isn't used anymore, and it will be removed in the next commit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Acked-by: Igor Mammedov Reviewed-by: Thomas Huth Link: https://lore.kernel.org/r/20260108033051.777361-15-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- hw/i386/fw_cfg.c | 16 ++++++++-------- hw/i386/x86-common.c | 6 ++---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index 5c0bcd5f8a9..5670e8553ea 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -215,18 +215,18 @@ void fw_cfg_build_feature_control(MachineState *ms, F= WCfgState *fw_cfg) #ifdef CONFIG_ACPI void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg) { + uint8_t io_size; + Aml *dev =3D aml_device("FWCF"); + Aml *crs =3D aml_resource_template(); + /* * when using port i/o, the 8-bit data register *always* overlaps * with half of the 16-bit control register. Hence, the total size - * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the - * DMA control register is located at FW_CFG_DMA_IO_BASE + 4 + * of the i/o region used is FW_CFG_CTL_SIZE; And the DMA control + * register is located at FW_CFG_DMA_IO_BASE + 4 */ - Object *obj =3D OBJECT(fw_cfg); - uint8_t io_size =3D object_property_get_bool(obj, "dma_enabled", NULL)= ? - ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) : - FW_CFG_CTL_SIZE; - Aml *dev =3D aml_device("FWCF"); - Aml *crs =3D aml_resource_template(); + assert(fw_cfg_dma_enabled(fw_cfg)); + io_size =3D ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t); =20 aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002"))); =20 diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c index 192e91042f2..de4cd7650a4 100644 --- a/hw/i386/x86-common.c +++ b/hw/i386/x86-common.c @@ -1002,10 +1002,8 @@ void x86_load_linux(X86MachineState *x86ms, } =20 option_rom[nb_option_roms].bootindex =3D 0; - option_rom[nb_option_roms].name =3D "linuxboot.bin"; - if (fw_cfg_dma_enabled(fw_cfg)) { - option_rom[nb_option_roms].name =3D "linuxboot_dma.bin"; - } + assert(fw_cfg_dma_enabled(fw_cfg)); + option_rom[nb_option_roms].name =3D "linuxboot_dma.bin"; nb_option_roms++; } =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907464; cv=none; d=zohomail.com; s=zohoarc; b=U3D3BOI6mjObDloKYYFJeEVi243ybCJH4Vmnnzf3jHxz/Tz+QTguWCWant5l6vE1mrQ7flwHsNqWySsyHRCWpOKG9NoKsJCGFW9GvGa2EwU4Wnx1kNztwxKcJ5hKyxhvkV10pQvgGN/HTqYqt65Vt17gWLlp0IVlIkIx21mucTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907464; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8e+pO/23r770rJp74Z6WNcABsTogv9mHs4szurDP7+w=; b=EjKYU6xAmQNPXcDEgKZ8XmO9Q01SZML8V2Xr7c+dupB8ddihAswKCULXG69HltbOK8A49hIDeT7vrXQK2jKXiA1hbqr/iTaNSOpLX35XoYcnmGL4IWqbrmO3qcq0OUTOpw1JDwIJfgC2q+RRUXxce7s+CWDd0HKRgX92cil57kg= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907464526324.16492217345103; Thu, 12 Feb 2026 06:44:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvR-0005xM-Ef; Thu, 12 Feb 2026 09:44:13 -0500 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 1vqXuz-0005O0-Ay for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXul-00064U-6c for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:44 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-16-WLhk3J_uPcC0gYca1a85dw-1; Thu, 12 Feb 2026 09:43:24 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4806fa4a180so60041535e9.2 for ; Thu, 12 Feb 2026 06:43:23 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4836c0da093sm24400705e9.7.2026.02.12.06.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907408; 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=8e+pO/23r770rJp74Z6WNcABsTogv9mHs4szurDP7+w=; b=T9wnda9msoAmqUETS8Rtci302XZY/6GCqhSjmNgtEBw+LOkbJwWuCQQB94gYHs7xOBFEfU JmJE0NRSchdw8G+QRd/nRgXX08HNEllMj8ldMbKpVKM51axfiOpMSJmvaYRx4pOeATmCgl ufVLJdJ8A+wqr1DwGWFgTHO0EuZl2UM= X-MC-Unique: WLhk3J_uPcC0gYca1a85dw-1 X-Mimecast-MFC-AGG-ID: WLhk3J_uPcC0gYca1a85dw_1770907403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907402; x=1771512202; 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=8e+pO/23r770rJp74Z6WNcABsTogv9mHs4szurDP7+w=; b=eHEqiRPZD5Yl8xFTsvlxrziAgDQVkachyy05wYQNmd5bHzWJGBrvwuasKqAt49Vnl6 hMwxg+nBsgSHs2f3GsJMvyWjtSj1POqBHsc3o8nG6XEitM+MwLmwV8asPc8rsqLX2wj/ 4IzMPeYxt1a/sM5Qp3tc+pAnx1qMjpaY7bbBwWJfiFcgO60+t3Vrx8SNnKM3C3NgT69a I4Sf5//X3301ZALwqwxi2NUiAt5SRyfVu7ss2ynEsYhjgYv/rD6t9qfQewx2y2R1KkGc 8/gd7vOPDQyqxH7emO+6+VduH1hRE2HaFw8XgEOWNhn4UHTp/FiAYmIoyRGoMTuF6b3C frHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907402; x=1771512202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8e+pO/23r770rJp74Z6WNcABsTogv9mHs4szurDP7+w=; b=u2lzGTEbqNLAQfDIsOkBePDapcc7M56GE0A+JLtuoqmAmDCYaofKWjPv9CPivMNjz5 LnJnFt3snrBCapX1qC2dYKqtbN66KMSWnYtFpwh5TyX3+AOlNR2r7KaYSDJ4B2zs+v7l JXuKjcxoiyEY7cVogHgSJ94qsbsc7nRz3nwQOltuY0bbzDgTz377CjQRKvrYrm8NCCY3 Ritk1DX+tlIKSD1o/bCvsHSPaAL5xXeIriN4Qwyn9lWWX3XV2CNkvJA0o05xdamc6V/y 9er2r/Zxp6pNbflpCbmE2HmNqcbUiRq16pJBIV616cornxH1sgyNWtS5umX9SONNmntB qLrw== X-Gm-Message-State: AOJu0Yza9+IiAYJEk7xZwJ8QNTdFDpvZigkYOMvExdHt7m1ySmRt0Rv2 CN+wHrQHLvthSHMgmLnMBNRwO7TyHzf1xKyxEZcrKjagpNfkh7ECeCLmI7ONDRW4mM0dNJZ6REt o055XDiHceep7gViTXfmkczCI9VQn4Awwihv3gKBXfv5Jp9gmfRnPaR+tbA/L84Yf3bmJmtmg7V gO4B0c4mPdKTL0j/YjZY2YBsRrVIET2fwrhsPrjCdq X-Gm-Gg: AZuq6aLFbKfKt0VVxeGaOMQsQb79AqaG7++h8eAgKMfpsNNjoyuIVi9YN0D6zJ/mKjE yjk/OvegflIf/Mtv5qg16Wwz7jUFilm9HYtZy3JEopdUo6WwCetD5PxArVP2zdq38HBXLBnNa5z zbyUpfkz5nEiaQo7dlViPhpJcAiN76a2pXl9jut+MoKfOp/g/eUdO/GUnVpSkpJFPpW+vyUpOVX AtAPYi7A5tfbz7yaZrCaJIJJCDd8EWvbzcW50Z6RRQ1FC3QSGoaDa0II/Hx8rBuAHofbpAMIOOG CCjdrrLdLQqFBssWz5IBh8B/zg3pQ9LIbyhq6kSWg50cYz9eXivk/+NulR5RnQNratLmHsbqZ1s b7OXkdA/mkmOgcULaNvJHX0kMzeFeU5eICPSjLF4Ih0d1YNfAiqK6DW2pZI2a4wnE2Y68dxi9Z5 BeT3CyZhvlp43CC1DhmSCeVQVSeZcHTXSuak7Ii80PqB/1wsycX2M= X-Received: by 2002:a05:600c:348f:b0:480:1dc6:2686 with SMTP id 5b1f17b1804b1-483656c571fmr48562235e9.13.1770907402030; Thu, 12 Feb 2026 06:43:22 -0800 (PST) X-Received: by 2002:a05:600c:348f:b0:480:1dc6:2686 with SMTP id 5b1f17b1804b1-483656c571fmr48561695e9.13.1770907401449; Thu, 12 Feb 2026 06:43:21 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Zhao Liu Subject: [PULL 16/41] hw/i386: Remove linuxboot.bin Date: Thu, 12 Feb 2026 15:42:18 +0100 Message-ID: <20260212144244.22579-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, LOTS_OF_MONEY=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907466577158500 From: Philippe Mathieu-Daud=C3=A9 All machines now use the linuxboot_dma.bin binary, so it's safe to remove the non-DMA version (linuxboot.bin). Suggested-by: Thomas Huth Reviewed-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Link: https://lore.kernel.org/r/20260108033051.777361-16-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 3 +- pc-bios/meson.build | 1 - pc-bios/optionrom/Makefile | 2 +- pc-bios/optionrom/linuxboot.S | 195 ---------------------------------- 4 files changed, 2 insertions(+), 199 deletions(-) delete mode 100644 pc-bios/optionrom/linuxboot.S diff --git a/hw/i386/pc.c b/hw/i386/pc.c index b033fc67cf9..c0e6a23bec1 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -669,8 +669,7 @@ void xen_load_linux(PCMachineState *pcms) =20 x86_load_linux(x86ms, fw_cfg, PC_FW_DATA, pcmc->pvh_enabled); for (i =3D 0; i < nb_option_roms; i++) { - assert(!strcmp(option_rom[i].name, "linuxboot.bin") || - !strcmp(option_rom[i].name, "linuxboot_dma.bin") || + assert(!strcmp(option_rom[i].name, "linuxboot_dma.bin") || !strcmp(option_rom[i].name, "pvh.bin") || !strcmp(option_rom[i].name, "multiboot_dma.bin")); rom_add_option(option_rom[i].name, option_rom[i].bootindex); diff --git a/pc-bios/meson.build b/pc-bios/meson.build index efe45c16705..2f470ed1294 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -63,7 +63,6 @@ blobs =3D [ 'efi-vmxnet3.rom', 'qemu-nsis.bmp', 'multiboot_dma.bin', - 'linuxboot.bin', 'linuxboot_dma.bin', 'kvmvapic.bin', 'pvh.bin', diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 963a77a3298..f1c1b9efc21 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -2,7 +2,7 @@ include config.mak SRC_DIR :=3D $(TOPSRC_DIR)/pc-bios/optionrom VPATH =3D $(SRC_DIR) =20 -all: multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin +all: multiboot_dma.bin linuxboot_dma.bin kvmvapic.bin pvh.bin # Dummy command so that make thinks it has done something @true =20 diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S deleted file mode 100644 index ba821ab922d..00000000000 --- a/pc-bios/optionrom/linuxboot.S +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Linux Boot Option ROM - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - * Copyright Novell Inc, 2009 - * Authors: Alexander Graf - * - * Based on code in hw/pc.c. - */ - -#include "optionrom.h" - -#define BOOT_ROM_PRODUCT "Linux loader" - -BOOT_ROM_START - -run_linuxboot: - - cli - cld - - jmp copy_kernel -boot_kernel: - - read_fw FW_CFG_SETUP_ADDR - - mov %eax, %ebx - shr $4, %ebx - - /* All segments contain real_addr */ - mov %bx, %ds - mov %bx, %es - mov %bx, %fs - mov %bx, %gs - mov %bx, %ss - - /* CX =3D CS we want to jump to */ - add $0x20, %bx - mov %bx, %cx - - /* SP =3D cmdline_addr-real_addr-16 */ - read_fw FW_CFG_CMDLINE_ADDR - mov %eax, %ebx - read_fw FW_CFG_SETUP_ADDR - sub %eax, %ebx - sub $16, %ebx - mov %ebx, %esp - - /* Build indirect lret descriptor */ - pushw %cx /* CS */ - xor %ax, %ax - pushw %ax /* IP =3D 0 */ - - /* Clear registers */ - xor %eax, %eax - xor %ebx, %ebx - xor %ecx, %ecx - xor %edx, %edx - xor %edi, %edi - xor %ebp, %ebp - - /* Jump to Linux */ - lret - - -copy_kernel: - /* Read info block in low memory (0x10000 or 0x90000) */ - read_fw FW_CFG_SETUP_ADDR - shr $4, %eax - mov %eax, %es - xor %edi, %edi - read_fw_blob_addr32_edi(FW_CFG_SETUP) - - cmpw $0x203, %es:0x206 // if protocol >=3D 0x203 - jae 1f // have initrd_max - movl $0x37ffffff, %es:0x22c // else assume 0x37ffffff -1: - - /* Check if using kernel-specified initrd address */ - read_fw FW_CFG_INITRD_ADDR - mov %eax, %edi // (load_kernel wants it in %edi) - read_fw FW_CFG_INITRD_SIZE // find end of initrd - add %edi, %eax - xor %es:0x22c, %eax // if it matches es:0x22c - and $-4096, %eax // (apart from padding for page) - jz load_kernel // then initrd is not at top - // of memory - - /* pc.c placed the initrd at end of memory. Compute a better - * initrd address based on e801 data. - */ - mov $0xe801, %ax - xor %cx, %cx - xor %dx, %dx - int $0x15 - - /* Output could be in AX/BX or CX/DX */ - or %cx, %cx - jnz 1f - or %dx, %dx - jnz 1f - mov %ax, %cx - mov %bx, %dx -1: - - or %dx, %dx - jnz 2f - addw $1024, %cx /* add 1 MB */ - movzwl %cx, %edi - shll $10, %edi /* convert to bytes */ - jmp 3f - -2: - addw $16777216 >> 16, %dx /* add 16 MB */ - movzwl %dx, %edi - shll $16, %edi /* convert to bytes */ - -3: - read_fw FW_CFG_INITRD_SIZE - subl %eax, %edi - andl $-4096, %edi /* EDI =3D start of initrd */ - movl %edi, %es:0x218 /* put it in the header */ - -load_kernel: - /* We need to load the kernel into memory we can't access in 16 bit - mode, so let's get into 32 bit mode, write the kernel and jump - back again. */ - - /* Reserve space on the stack for our GDT descriptor. */ - mov %esp, %ebp - sub $16, %esp - - /* Now create the GDT descriptor */ - movw $((3 * 8) - 1), -16(%bp) - mov %cs, %eax - movzwl %ax, %eax - shl $4, %eax - addl $gdt, %eax - movl %eax, -14(%bp) - - /* And load the GDT */ - data32 lgdt -16(%bp) - mov %ebp, %esp - - /* Get us to protected mode now */ - mov $1, %eax - mov %eax, %cr0 - - /* So we can set ES to a 32-bit segment */ - mov $0x10, %eax - mov %eax, %es - - /* We're now running in 16-bit CS, but 32-bit ES! */ - - /* Load kernel and initrd */ - read_fw_blob_addr32_edi(FW_CFG_INITRD) - read_fw_blob_addr32(FW_CFG_KERNEL) - read_fw_blob_addr32(FW_CFG_CMDLINE) - - /* And now jump into Linux! */ - mov $0, %eax - mov %eax, %cr0 - - /* ES =3D CS */ - mov %cs, %ax - mov %ax, %es - - jmp boot_kernel - -/* Variables */ - -.align 4, 0 -gdt: - /* 0x00 */ -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - /* 0x08: code segment (base=3D0, limit=3D0xfffff, type=3D32bit code exec/= read, DPL=3D0, 4k) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00 - - /* 0x10: data segment (base=3D0, limit=3D0xfffff, type=3D32bit data read/= write, DPL=3D0, 4k) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00 - -BOOT_ROM_END --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907623; cv=none; d=zohomail.com; s=zohoarc; b=ihahgnB5YepvNhN+vntyWPZ6LlcE4mvJMYoPC5414B2QBn/eTyFy6lvwCuVfEapXobk2IwhRuYfPa1uyhOrs/OhBFkZhC2/6K8Tdvh9/83FI18e9rbNKj5V+g1auQuFXSgysdpsRI/e1lzQvrJdkmKE7wk8DFsE6zfLAHO6K7UA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907623; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yoD0TtgLmIrq8/npxlFppEMCqVLj+d/XD3HyCB+m280=; b=AxXhxV6t5Vib+1D/HfmJOCs38TiqxTG3olXfrwvjbUC+d3S9Wk9gA4RcdtJJFcfQPxrSKGSYaWrvweFW0Dfy59v58+MkukG2Z5e3qbt8SwC1QKDI/1UJrFZBk/iwbp9xZHh4o6rv9pGjbJo00CSbXakTOWrQAUb9C7Luqnf3pPo= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177090762343030.433713409988172; Thu, 12 Feb 2026 06:47:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvF-0005iy-RD; Thu, 12 Feb 2026 09:44:01 -0500 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 1vqXuz-0005O3-Ep for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXul-00064d-6Q for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:44 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-154-vSBQQ3B1MLuncL64pNXWrQ-1; Thu, 12 Feb 2026 09:43:27 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-48069a43217so76251555e9.1 for ; Thu, 12 Feb 2026 06:43:26 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835a5c7c4csm158957785e9.0.2026.02.12.06.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907408; 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=yoD0TtgLmIrq8/npxlFppEMCqVLj+d/XD3HyCB+m280=; b=KDwtApLaz3fAliKMrP67OJ02y+NqLuXrjzctT/jlVAuK1Q6JCI8MWPL/+6lOfN+GItboiq OqTS7jrX/l1BQJEmlt5DaTerjIFsZgKPZ8lPjFWFJf5sVmNPTRT7NNIVPabwHEmMGIvFFW u2g7RgJWt4Vb8lnrn0zdAu8PAt0kLUw= X-MC-Unique: vSBQQ3B1MLuncL64pNXWrQ-1 X-Mimecast-MFC-AGG-ID: vSBQQ3B1MLuncL64pNXWrQ_1770907405 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907405; x=1771512205; 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=yoD0TtgLmIrq8/npxlFppEMCqVLj+d/XD3HyCB+m280=; b=F3j45ZpX6Peb4YIA6SPhkjPKKE581bn+994qnbOMiiPKFU3aat0kCjnM0dke1jzaU5 xpns/GfW1KN1DciyWJpOWv/+5XIDI4xuKjjsI8DUHa+35Niq436BGFRUf2N5ok8I+pVK +WVBDbZs5O9cd8p7D3mHR+lwczCFckwOwq/4ovgh0gXYpFSJznwrnd3ok87dazUA8mg9 okRAb8F5VFjeqm5OvLXaBku4o3Ut2CPmpUY+lok+UuYeJ/JTRpy/i95wG8ceYrJ8bBGA C6Tv6G7ZkbJvJcOGf0djRLHr2BMG0mrcx32gDpJPEPSLMAjvMqvv0cTSTpp57YM0h4sR Z+0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907405; x=1771512205; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=yoD0TtgLmIrq8/npxlFppEMCqVLj+d/XD3HyCB+m280=; b=FVIkpT6huN3IA/+Xgachjh+5nG3Zq7nod9lVF313a+VhyiKvCuK3LFOHspteyafrpH ZqGUhj/XIiCyvsME2tCLsmdE+lQ1OrCa1fo5Ytj+OfaTD+YviLaJBUuwqV/af1t8dmRv HcdDJbrfoG/vsJySSGMp5pKjQeHKW0xhi/0+hYkKHtBAnklDfP+WlHIZx0aP3uGkP79N 7jwWJ/6SiGWbIoZIqrj8IEqxorpx25PJgd6zQzVS/scUNeYBh1c3O4RbUsdwayqAJ360 ZXvvuFxoteZ/qzlklxOhsIoyiGcJuInLvaoq7ZMwwoApBr8n7ZJhAlKtEnO9dEtP4z7P BZPQ== X-Gm-Message-State: AOJu0YylvgRbVp2GIOawu490nRzTAr0fDcgzIXWkfKT1n5qzm6Yc93sY O4n3rn/GGIfxazIe0k/hw6kk4nN+8zrVFIOxIKxCLXvW7ohG3trcrvoLDcR3iJi/2N7nKJsQbJ2 YvtDszUEWGyNfeNA/4UicTEsd89cGbTC5szEJ49U1TcSroZAS9H2t5nBat/UlyhN6L3D0VdUuxU a7affXj61pkMqbmVfwG9PlYbjCI0cRMNNZYn3T/gUx X-Gm-Gg: AZuq6aLi/hUm0qF35V87s4yFAtzgJivALF00W780OIvCBImGIMxRAtqE8CNUzYskbgv TBSGkGLND5a11fLd18rHhC23xO+jbqW4SYnHQkVU08qtRWPPY5DsXsOTE+qbmuUJFoR28Zwv0Ah mc8uTu37RbpqYyKh9snkVtqirT/rMDcoU6avE/+Pton+u8yjKwlUhZbYh9nCnxN+0+BRXlO1MNW QtLPaAeBDp2Gs/apogxT3dt3JvMJY571d5B6Hjttd3RCIm87QALJXbKsc01aoJVezQNjnKvlZJj B1QouEGfIUIB0cIKkgx6GJhtE/BwS9SUacte2zV5ZulYf2//FHdWlfjscSjJUbOMjCwJSDwe6MD Xsng0UEddlZiDIG9t5OBoYaVRpzmS7DQPn1hSXlwtncIQkC12BkBHth1YSntW2XkSG1s324az/6 8bojBFjhoFOPDUZpKG50PBe+omg5fP5bEEE0A8kIwb7V0KWg3iKg0= X-Received: by 2002:a05:600c:524e:b0:477:7b16:5f77 with SMTP id 5b1f17b1804b1-483656abab4mr44171965e9.3.1770907404629; Thu, 12 Feb 2026 06:43:24 -0800 (PST) X-Received: by 2002:a05:600c:524e:b0:477:7b16:5f77 with SMTP id 5b1f17b1804b1-483656abab4mr44171305e9.3.1770907404139; Thu, 12 Feb 2026 06:43:24 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Thomas Huth , Zhao Liu , Igor Mammedov Subject: [PULL 17/41] hw/i386/pc: Remove pc_compat_2_6[] array Date: Thu, 12 Feb 2026 15:42:19 +0100 Message-ID: <20260212144244.22579-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907625707154100 From: Philippe Mathieu-Daud=C3=A9 The pc_compat_2_6[] array was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it. Reviewed-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-17-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 8 -------- 2 files changed, 11 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 7f8cf94138a..d6d54852375 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -298,9 +298,6 @@ extern const size_t pc_compat_2_8_len; extern GlobalProperty pc_compat_2_7[]; extern const size_t pc_compat_2_7_len; =20 -extern GlobalProperty pc_compat_2_6[]; -extern const size_t pc_compat_2_6_len; - #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, \ const void *data) \ diff --git a/hw/i386/pc.c b/hw/i386/pc.c index c0e6a23bec1..12f139c6798 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -266,14 +266,6 @@ GlobalProperty pc_compat_2_7[] =3D { }; const size_t pc_compat_2_7_len =3D G_N_ELEMENTS(pc_compat_2_7); =20 -GlobalProperty pc_compat_2_6[] =3D { - { TYPE_X86_CPU, "cpuid-0xb", "off" }, - { "vmxnet3", "romfile", "" }, - { TYPE_X86_CPU, "fill-mtrr-mask", "off" }, - { "apic-common", "legacy-instance-id", "on", } -}; -const size_t pc_compat_2_6_len =3D G_N_ELEMENTS(pc_compat_2_6); - /* * @PC_FW_DATA: * Size of the chunk of memory at the top of RAM for the BIOS ACPI tables --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907807; cv=none; d=zohomail.com; s=zohoarc; b=VvwPLPJo16KOnlbWE5HNlWUgbVovojtuMx7+UG9hnvoLI/oGRWuMuCUzFm8i0dPqW9QbiOZTJet+PDX6RNx9oD37uN/ahfjpEEiXiFml8/BcEMhIC51TvEY3iX4V1jH2yBxW9qUI0jrQBML9HuxW49l0umJm2dBGvgk5zcC7h6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907807; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VMvh1T7VSlWdNvOAnSK+e5XNAASrexQ0cLNtJxfMpMI=; b=anMfx4nBsnIcg+ESu3FZ8pMWm5wZC17swlqWQz4qSkhOItw2FBDCBE6oGHhJLHFge39oxJJqlGzzfy94Sx/1ETJ3CWIXizpbM+DXPoicTGSi4QBinDxReHoueT3BkMbDLffy0YJSnYpzW9LtpJ95pNqH1CjGAiDfcyKP+kGwGJ0= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907807847453.7322161897674; Thu, 12 Feb 2026 06:50:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvG-0005jm-89; Thu, 12 Feb 2026 09:44:02 -0500 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 1vqXuz-0005O5-FJ for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXum-000651-4Y for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:44 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-613-PHNLb-qYPbyf94BUN4bywA-1; Thu, 12 Feb 2026 09:43:29 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4836b7fbf4fso5777185e9.2 for ; Thu, 12 Feb 2026 06:43:28 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835dd0e327sm125281235e9.14.2026.02.12.06.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907410; 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=VMvh1T7VSlWdNvOAnSK+e5XNAASrexQ0cLNtJxfMpMI=; b=AC7c7RvP+uFL3XB4N5gx+42vHBJQVr9NfaFUCS7zq1Q9QsFoXm7zy52jDjPQ2/mt7Qo/bk yj4EAevj4RW+yEa7SxBG/suTQlRS48isHCcAB/1JjjGkdWb19GEPI4+JIF154TSxKcPNBh 4APLf2DrUOxyM7fp14hC7Jp2E6QQux8= X-MC-Unique: PHNLb-qYPbyf94BUN4bywA-1 X-Mimecast-MFC-AGG-ID: PHNLb-qYPbyf94BUN4bywA_1770907408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907407; x=1771512207; 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=VMvh1T7VSlWdNvOAnSK+e5XNAASrexQ0cLNtJxfMpMI=; b=PU5gYeC9X3107F2S11cHQP65nXQMqct+6ypm4RwHhnQ9/3POTgX/TWE1cszqcFuvUm j/Sbsh58oR3rmx9aQDJ1bmnkgMW/7exQz+NVZ6xFPCoGY7ISOntav3AH3N51z93KIM+D oTAUmJZmph0HEeDzZacWnI9+N0pv+9DB6O3tSM84KTxkVLPplCu8fHWpnVMtVJQKTz1k DL7de6QabJADAnlM7LIJ19OYYcruPK+i64tkHT2ywk9fER6sEb/8xUr4pIrWZo+s6h1i Ds434ZQsSLv4iZt+b6Fu1+rs4JnUppoxHt0zAUZ3cmJZqNss8FVyLdv0FpVEpGVivgPM kaVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907407; x=1771512207; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VMvh1T7VSlWdNvOAnSK+e5XNAASrexQ0cLNtJxfMpMI=; b=rt3IvVOjAifg4Cl8I1dtTrJeyXfPVd3Qz2eLtKHWuYgF63sMqhd8TevDJE1YnO60rF C7HE6vo3sH+irva+Pgs5DaD3uyGNjL0/Y8Fv7WL3My13W5qM9vk1/QuEpr+uPi2oE7mH jiFz1xcEKC2WfznAQjKJYlCGqt9X5kCkSmz0tHr/CkVfgmS1sTnGnZTAZJALOA560ITt FhcnAgEfyoduV9uUZtIb2TFv9Lab99riZT8TXuvYrLkzVLkIGFyhDI9MGf8FGOeYWn2S f0A+qqWsF1n08iyuM5Nt87r/bmXh31TEaX3XV6m4JE8Bqj5rAeYUxBRlwgDDckFNdMP0 a7nQ== X-Gm-Message-State: AOJu0YwjQp+Q6z3T6H/qEW8NlPOMdtH1B3aYPm9aN8MdtVRriHr5tj56 CE8xzJ0afRiH1Ibxxwese0gMHeydalbQph3ZKEM9f1c/2dx5KNFy4dptRnqd6PEpg7a5/8c5oEE LJLjZCl+w1oLTYFkjAtEKq+gJ9ttF0s+RyVsEQVxlAf+Df2f1dvJZY3LwcOEGxZvSpAq1ZyqYDN 5MwJDP7iUXKYwllg3/9GkzZsEh9mOBa1yHTFkpAt/p X-Gm-Gg: AZuq6aIbqNlqo6dFxv4P+P+uKeNgiILRY3Uzf3nv/MWXBcyxZynQHAdYWj6oNCEPWUD pdCKAOH3q/9h4PdK3UVMaob6OHDmH/dqLwbMumZ2n31q1d4nWyRGFegUREJS/QLOj1UI6nvZv57 82S31FlBh73Kw/RncDp5z0ZyRYtWiElOJ46EVViu8bOic/beQm/SkhcOfGs1tb3qcVJxSBMkmDT 5MeMznmFKwDnIzGHHttPqH2hRqagy4EYk2ptIf4+Wo1fEcEm0ktQayblzWcJNFR+E9NVaxN7oTJ KEoVUatdUYDhy6lfVv5N7UPv+fCEsv3T1PSa3ZYLSo+5TCh/NhcwDh4uUeZ13I6e/WHKbUSwfbm 7VH6Z27S/t1xtOQCBqFTMfwuJG9xoGdrdHxrbDES3sIBTudoCH0IDobOooHqWtAOi0zJPo3uUSO 2SN2aQvi+eQnngT9W3pxWdsUG5RpFmiHxk6xxocUyTKKTOTUJiIfQ= X-Received: by 2002:a05:600c:6095:b0:477:89d5:fdb2 with SMTP id 5b1f17b1804b1-483656cb1b1mr39478525e9.14.1770907406995; Thu, 12 Feb 2026 06:43:26 -0800 (PST) X-Received: by 2002:a05:600c:6095:b0:477:89d5:fdb2 with SMTP id 5b1f17b1804b1-483656cb1b1mr39477915e9.14.1770907406494; Thu, 12 Feb 2026 06:43:26 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Thomas Huth , Igor Mammedov , Zhao Liu Subject: [PULL 18/41] hw/intc/apic: Remove APICCommonState::legacy_instance_id field Date: Thu, 12 Feb 2026 15:42:20 +0100 Message-ID: <20260212144244.22579-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907810611154100 From: Philippe Mathieu-Daud=C3=A9 The APICCommonState::legacy_instance_id boolean was only set in the pc_compat_2_6[] array, via the 'legacy-instance-id=3Don' property. We removed all machines using that array, lets remove that property, simplifying apic_common_realize(). Because instance_id is initialized as initial_apic_id, we can not register vmstate_apic_common directly via dc->vmsd. Reviewed-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Igor Mammedov Reviewed-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-18-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/i386/apic_internal.h | 1 - hw/intc/apic_common.c | 5 ----- 2 files changed, 6 deletions(-) diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_interna= l.h index 4a62fdceb4e..0cb06bbc76c 100644 --- a/include/hw/i386/apic_internal.h +++ b/include/hw/i386/apic_internal.h @@ -187,7 +187,6 @@ struct APICCommonState { uint32_t vapic_control; DeviceState *vapic; hwaddr vapic_paddr; /* note: persistence via kvmvapic */ - bool legacy_instance_id; uint32_t extended_log_dest; }; =20 diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c index 4e9e3089945..bf4abc21d7b 100644 --- a/hw/intc/apic_common.c +++ b/hw/intc/apic_common.c @@ -276,9 +276,6 @@ static void apic_common_realize(DeviceState *dev, Error= **errp) info->enable_tpr_reporting(s, true); } =20 - if (s->legacy_instance_id) { - instance_id =3D VMSTATE_INSTANCE_ID_ANY; - } vmstate_register_with_alias_id(NULL, instance_id, &vmstate_apic_common, s, -1, 0, NULL); =20 @@ -395,8 +392,6 @@ static const Property apic_properties_common[] =3D { DEFINE_PROP_UINT8("version", APICCommonState, version, 0x14), DEFINE_PROP_BIT("vapic", APICCommonState, vapic_control, VAPIC_ENABLE_= BIT, true), - DEFINE_PROP_BOOL("legacy-instance-id", APICCommonState, legacy_instanc= e_id, - false), }; =20 static void apic_common_get_id(Object *obj, Visitor *v, const char *name, --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907679; cv=none; d=zohomail.com; s=zohoarc; b=D5K/2gzIsK5fYgFDeIyn7RL54sFMFE4LGKvT/Lg8joH7K0YGAphIpeq9LrCkPOzGsK0O0Yh23647zHJmGkYVBob7XGRE2Qi/0owMiWNFO9+xnQbv65QtICsLn+XAc8waZmzZ/2Ho2xMb7REQw7KA8jUOcrrwCf30p67IzOoEV/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907679; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=g/BATMQ1KN5pWJq8a9yC9CIZttopA3VSwHRJBsr7m+k=; b=co3GUFrRKdr61HPYwVwtzcf/YBAxtI+B0lDJL74gVT6qo3yCvGnnAkGLKEGtXIm2rZ1nnLhR47EayUwEymXIDx2e8abKC1auSAS45mraaPjnLlno6hXNCPBpg5WKoGJQegWyWoHxqrRvtHegOk2+Y0SqNUfYGediq/bb/36Vt/0= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907679149745.3435192410873; Thu, 12 Feb 2026 06:47:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvH-0005lA-Ck; Thu, 12 Feb 2026 09:44:03 -0500 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 1vqXuz-0005O7-LD for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXur-00066L-MR for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:45 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-450-DaBHpZ-xNDm_KTlc8vvZwA-1; Thu, 12 Feb 2026 09:43:31 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-482eec44485so24802705e9.3 for ; Thu, 12 Feb 2026 06:43:31 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4834d8334a8sm204685175e9.12.2026.02.12.06.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907412; 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=g/BATMQ1KN5pWJq8a9yC9CIZttopA3VSwHRJBsr7m+k=; b=OjN6t3Ko5Wtrfw9ipocX8SqK7hg0t/8LvCbU34xMa5mlsLFH5JQwByollUrnxtUkvDeVzC tZ5cVYQf9VCuxrt0so92rnwGHLPvbBSfjCpAWGMrX7UoETEjOonBagjT5hsPaLLAofqHrj VpOYB2hcYKAjliNg8WR2lKEMR9OEyWM= X-MC-Unique: DaBHpZ-xNDm_KTlc8vvZwA-1 X-Mimecast-MFC-AGG-ID: DaBHpZ-xNDm_KTlc8vvZwA_1770907410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907409; x=1771512209; 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=g/BATMQ1KN5pWJq8a9yC9CIZttopA3VSwHRJBsr7m+k=; b=Ko2OuYtzngI+FIC9kyndSQyiTn03T8tBEK1xsS7eZJZCKPW/cn5/a6vzTXOfmPBJs/ qZziTyoxKM+p9xoVd82C8qlG+2XdOW1bVQ1DbTM93TXnOisOW7yBr24Ar6Pa6JQxnPBu X5SpmOmctTCfqCuCSHMs3U9kaToj/E0T2WlYzFGqIbcfd0xbcpqnYTprnidF6iS+qzp9 nDo2pHw/o5aT4Cgm9Z6sv2VtYpnJ8LUjuwBHVXVMrDt2Te785/hnnvLwXRIiM8vUvvgv /AOyo/tv1zzg1hVVO1XnDm9gzsc4NJ8hVS3BiXm4wvpUQsG6efy8vOx3LRUm6ISZeo45 yWdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907409; x=1771512209; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=g/BATMQ1KN5pWJq8a9yC9CIZttopA3VSwHRJBsr7m+k=; b=oHuTB2/k+XqbmwhQPgCqPAfBiMDz7et5wHO2PGjCRpytiTSjCIQ98KgkJPHC+go69d VxB/OJI1GjkbetIiNtDmT381wFmTW3mnBmLssTKMCLOoesXzSKG71VVwToIl3QSFdCxS kHDke+IVugq5LpoBG9Peg4l4L33iGJlrIMSPdTkiTjtOp2gdFXkzHsZb5UekeTuTWcOA TPSp2J/XKfqkscJ3GOmmZ2pLNlftL7CIbBpYe06i6eBKT1joAaYykFxy8PrpBMWDpV18 w1xhxtOt8j4xOO6NZAfh33KAgJ+hsWKH0FAH1c+WgSNsT3bzlv5BXaiR7UXlST3tjjh6 9cOA== X-Gm-Message-State: AOJu0YzIbRx5Uy447NMtPXl2itVJSZfriKOVBPo1eud9lfXYQPTOh+dk Q2XQBdOaTAF2BBp9dY/Op7dBYCkcR8jYaBHFgFStZ49g7+EYKAB3fs6Rr2Gq1rqAoJkJpTXUgv/ O52/A1mlBHXWbGBh7RFLQXWmLUoj60lBCGpaLVNlfA6d3s1eUyEp/q1pRC4/JC0O+2eQnL4tWl+ Ts1fI1nfljcBAHrcw3pRWgXSZ2Mds9ach0ERtiRTNl X-Gm-Gg: AZuq6aIbbodhuVg9SlA9yb4gzqYy3cD6q0uJ8NYsnrN6YRTHVp0kK+N1GY4HgXuu7oy y8KjUKhML1Vn02DrbnaxTyMvppRPiw3/IYLcgO/gUbd1vFh97HfoScp5zSNdWcNOk36+MtTAjr+ ++XyNnvdzxx0JbSYpgLLzHHRqcYmjHEg/5WMo2XhLTG4jm2MRz3B+6+mnx6OJkpbtsggrBFMj6y qjrt4ElVMmJcmgL9VD709MixGk9uFhegR/tVfXfESBjRULKVhvi2wWzoRUXX6UkIykUmWx+oE+C NlyVLAgcyaNCi5FhyUf6KX2T8PmUMMQtFAKPzowpOLVgcO8yH/3baF9PcontrZqSRUtEW3u2qjD V/BtsK56ONoBsrpQ+pIku0QbaUwB7uFKgEc7QvnGLOSz0D8m8rtGe/1KTlxj90mDJ+5ilVApgwx CS52Hoq3NxLe9KV8n8zbBEG8mmQsCqzl02isJaGDcF5cG3IpDLjHw= X-Received: by 2002:a05:600c:621b:b0:480:6ab1:ed0d with SMTP id 5b1f17b1804b1-48367113facmr34912345e9.9.1770907409311; Thu, 12 Feb 2026 06:43:29 -0800 (PST) X-Received: by 2002:a05:600c:621b:b0:480:6ab1:ed0d with SMTP id 5b1f17b1804b1-48367113facmr34911885e9.9.1770907408808; Thu, 12 Feb 2026 06:43:28 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Thomas Huth , Zhao Liu , Igor Mammedov Subject: [PULL 19/41] hw/core/machine: Remove hw_compat_2_6[] array Date: Thu, 12 Feb 2026 15:42:21 +0100 Message-ID: <20260212144244.22579-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907679620158500 From: Philippe Mathieu-Daud=C3=A9 The hw_compat_2_6[] array was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it. Reviewed-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-19-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/core/boards.h | 3 --- hw/core/machine.c | 8 -------- 2 files changed, 11 deletions(-) diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index 07f89387525..d6ff9f3d233 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -885,7 +885,4 @@ extern const size_t hw_compat_2_8_len; extern GlobalProperty hw_compat_2_7[]; extern const size_t hw_compat_2_7_len; =20 -extern GlobalProperty hw_compat_2_6[]; -extern const size_t hw_compat_2_6_len; - #endif diff --git a/hw/core/machine.c b/hw/core/machine.c index 6411e68856b..2664848c2b0 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -293,14 +293,6 @@ GlobalProperty hw_compat_2_7[] =3D { }; const size_t hw_compat_2_7_len =3D G_N_ELEMENTS(hw_compat_2_7); =20 -GlobalProperty hw_compat_2_6[] =3D { - { "virtio-mmio", "format_transport_address", "off" }, - /* Optional because not all virtio-pci devices support legacy mode */ - { "virtio-pci", "disable-modern", "on", .optional =3D true }, - { "virtio-pci", "disable-legacy", "off", .optional =3D true }, -}; -const size_t hw_compat_2_6_len =3D G_N_ELEMENTS(hw_compat_2_6); - MachineState *current_machine; =20 static char *machine_get_kernel(Object *obj, Error **errp) --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907507; cv=none; d=zohomail.com; s=zohoarc; b=e+tRp3o1ITdZP5eGOKcfkfnanWd37/PrGn4wIOCsMlryCnoatiPbAu3YJGuC3cTg7l0sQFsZ4r9Zp833XHjBr5XYvzkhYBtkxsNwkj33wnrWNAarsrKiYihbKytgH2jfEQD99KW6oXd6IT2MwKWkh7hGcBNrJGbP/ULDVTenQrI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907507; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gplk9ekMQ9pSZ/sJ6RCmeWHrM9FXdUM1xTfytnwRqZ8=; b=Sj7VOFLG11g4ryx+eU8Ohv+/Kx7iSBsdfKsG+dzBaQIDwcMgeTKxDscG8Ft90Zm7OuwB0YdX/clELjkwKW4mA49Lw1WKNHFJb52GVSHkrGAAI1mZvZUwo0Wjx4Z3UoBsnOGinaULY4ILZEB2lcVioMzm1a9zVMVKUVQe/99pE5g= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177090750793462.75947067175889; Thu, 12 Feb 2026 06:45:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvP-0005vH-De; Thu, 12 Feb 2026 09:44:11 -0500 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 1vqXuz-0005O9-Qe for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXut-00066i-Ib for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:45 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-542-Pxu2k--PMq-Y-gOWA4lu_w-1; Thu, 12 Feb 2026 09:43:34 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4803b4e3b9eso64142985e9.3 for ; Thu, 12 Feb 2026 06:43:33 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835a64674esm70564035e9.3.2026.02.12.06.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907415; 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=gplk9ekMQ9pSZ/sJ6RCmeWHrM9FXdUM1xTfytnwRqZ8=; b=BZ2cQNcdis3rpT4vCX4waF9g2qZ7vxuFMH19MP6tpsz0kJwdQCbomXHkt5UFneKdE/Mr1z 3H9yYXGTmGcAN0+CnwqhkF2Q3srge2yeEMgW8YjuahM7Nem0ErWSi20TS0OAstzQVjZYtO BPpRw684B2Zd7d8Ra8Fv7qCf+QTZAsI= X-MC-Unique: Pxu2k--PMq-Y-gOWA4lu_w-1 X-Mimecast-MFC-AGG-ID: Pxu2k--PMq-Y-gOWA4lu_w_1770907413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907412; x=1771512212; 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=gplk9ekMQ9pSZ/sJ6RCmeWHrM9FXdUM1xTfytnwRqZ8=; b=Q2s+LHIJCmp/9RCIvt21ifZ9QTUuETw1SxsW707pg2KqBruqjaFZs7sZU/1SqekfkK qTMnEl6oWixW++a0GTjmWnlbFQEDJNQY0UvBPbIst8ZC4Dz2ff4Qw+9RK2/14XHIOOFf /gdrHacBXirzdqvP28EFh2XOGzZvrYWU5kaTtZN3Olhgloj9Z3KXXtJeL8bna56fnQuT 229KjVf3oo+ZFE151dVe4d+bbXsfh/7UsmGnCm+1R5MwZd5QGFrY8xcu8g99Z97OxLt+ a8eBWT5Hlm6k5AyUCkQEdR5m7wL3JAxdFT9Gi+0pZvMufvqz9SuwOk2mE+0RrNoFjg4D B9cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907412; x=1771512212; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=gplk9ekMQ9pSZ/sJ6RCmeWHrM9FXdUM1xTfytnwRqZ8=; b=XPWysOfKrNmBzb/yPXw4JvxS3HjS2VNWeDKzrG9j0ZiFEEHRv4Q1nyY7BzhbnkfYGk Me5eDidfqaq1og0eGu7NZrLcFeiTouH6DA8qec/JJbqUE8iCXOI5G3PzcmUAVk3Wc6Jt GlaHke8HezYsHw4sY9SKA0xTEx4wxniVTB0SUdgK+MPcQUGgL8LRgRSHf760KQd8FXkM XklSe74+9hLuk2u+DteMHj3tAUKaE52jWf8QEVoLKA8obkKx7tHO98t7X0aK3vnOK9vA vBUeo1i9QedWH8BDsTqYik/dWcVNdcNQe0zwXyutECkeVXIOE9cQvSsANIM2rH+kCBIb jgBA== X-Gm-Message-State: AOJu0Yx0lqCk4bsU+/tqYsEN6Iv7UVm3nfK5J6ipCtCbknWIhqSpO4fI cwDoVeunoMGulHn98NgFKmB5mWkrSJecnFaV25M2LArJqpsYBtetcCIsjsFJOyUN9n1GBWpTitB oX348NnRNm/pG34h8YcvYM4GGOoGdCLq4o7xkLywSbgmiYQGlS9UbbgpVEUvBzfRgob+Htk9yjU QVZ+JMzOIUZEcm2KH+t1tnI39FlE+6UkTdlgeZHUkO X-Gm-Gg: AZuq6aImjtPDai2U60xRazKm+WczS3dG6jHa3PStP7RpSp+OZaJp2Dt+FN+0yZiIim7 HRiWP8KCs6ElxiEjCVSXled2RUX8yOzHz5c8P00nQbKc9ttG0nZn+4EMFBbUZmWT0rCgafbkJoa 3ylL/OIs1EiP/wRLRWCnXoHChCiIwTe4b3G6UrqDw0YBTXVxKzG/My/QV1OGs3uQnlaalXs4mfP +J9F5qCK//DlVT4YQ0IqL3pfuBZXFrQCS31jodZbutdp0Xe9wQShniYe4ZtGF6QAgZmrk3yp2C7 kc1l9YZ+S9MItK+269qS+U28btZ2+AeUzP+etGNkohX9Mze9ShAp9SY07cnLtsG3JumJKLEIpb/ pNdGByBA0hIKEwGJ+z05lcnzrnjsXjM8TtxkEom1E7Txz1OyWrQTpkV00CARXj/JrtjlZyw2KDt szQTwk3QWa2154WdEOqk/3C2LJbisJj3QroueXhUBfBa3CyuNpP7w= X-Received: by 2002:a05:600c:3512:b0:477:7ae0:cd6e with SMTP id 5b1f17b1804b1-483656ae17amr44335095e9.5.1770907412053; Thu, 12 Feb 2026 06:43:32 -0800 (PST) X-Received: by 2002:a05:600c:3512:b0:477:7ae0:cd6e with SMTP id 5b1f17b1804b1-483656ae17amr44334415e9.5.1770907411472; Thu, 12 Feb 2026 06:43:31 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Thomas Huth , Zhao Liu , Igor Mammedov Subject: [PULL 20/41] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field Date: Thu, 12 Feb 2026 15:42:22 +0100 Message-ID: <20260212144244.22579-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907508707158500 From: Philippe Mathieu-Daud=C3=A9 The VirtIOMMIOProxy::format_transport_address boolean was only set in the hw_compat_2_6[] array, via the 'format_transport_address=3Doff' property. We removed all machines using that array, lets remove that property, simplifying virtio_mmio_bus_get_dev_path(). Reviewed-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-20-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/virtio/virtio-mmio.h | 1 - hw/virtio/virtio-mmio.c | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/include/hw/virtio/virtio-mmio.h b/include/hw/virtio/virtio-mmi= o.h index 1eab3c0dece..1644d098105 100644 --- a/include/hw/virtio/virtio-mmio.h +++ b/include/hw/virtio/virtio-mmio.h @@ -66,7 +66,6 @@ struct VirtIOMMIOProxy { uint32_t guest_page_shift; /* virtio-bus */ VirtioBusState bus; - bool format_transport_address; /* Fields only used for non-legacy (v2) devices */ uint32_t guest_features[2]; VirtIOMMIOQueue vqs[VIRTIO_QUEUE_MAX]; diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 0b0412b22f2..742ca3d3e4d 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -764,8 +764,6 @@ static void virtio_mmio_pre_plugged(DeviceState *d, Err= or **errp) /* virtio-mmio device */ =20 static const Property virtio_mmio_properties[] =3D { - DEFINE_PROP_BOOL("format_transport_address", VirtIOMMIOProxy, - format_transport_address, true), DEFINE_PROP_BOOL("force-legacy", VirtIOMMIOProxy, legacy, true), DEFINE_PROP_BIT("ioeventfd", VirtIOMMIOProxy, flags, VIRTIO_IOMMIO_FLAG_USE_IOEVENTFD_BIT, true), @@ -827,19 +825,6 @@ static char *virtio_mmio_bus_get_dev_path(DeviceState = *dev) virtio_mmio_proxy =3D VIRTIO_MMIO(virtio_mmio_bus->parent); proxy_path =3D qdev_get_dev_path(DEVICE(virtio_mmio_proxy)); =20 - /* - * If @format_transport_address is false, then we just perform the sam= e as - * virtio_bus_get_dev_path(): we delegate the address formatting for t= he - * device on the virtio-mmio bus to the bus that the virtio-mmio proxy - * (i.e., the device that implements the virtio-mmio bus) resides on. = In - * this case the base address of the virtio-mmio transport will be - * invisible. - */ - if (!virtio_mmio_proxy->format_transport_address) { - return proxy_path; - } - - /* Otherwise, we append the base address of the transport. */ section =3D memory_region_find(&virtio_mmio_proxy->iomem, 0, 0x200); assert(section.mr); =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770908091; cv=none; d=zohomail.com; s=zohoarc; b=XJCpmb4GUDjNGrIblTMk28bKLWYESbEQeLbMNT4jqAfkLSlLVJUTqDX5OXLZmZ/odXS+fT6bTHF8IZe8l8mgx5L6jizitQIvxSi2+yM0xQ2NpqcthwmvPX5YmW5sqIl+9hcGr2YSk+Ir4wPX1bd2pnBLJzID5GyBohVWkTotz8Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770908091; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JGOT1h5ESN0Qld+a/yHoOKPmD7wsqNv5O1QINCuR2Ao=; b=U8Sl1ngzvnzAtnE3haPTmZvCSm5MwadYmj+QJsjrSf+/XzOGw9BiFCTnij7gGC6uQ0paSiXPVGIzlVMYYQBCToLb2w9hahbOisx2OKxBYJwPUe9a3Pw9EWYCgwKRT6vb/PVglY6pl9qYKVkTooii/PDIrWIp8F1HlnlqLBAZrCw= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770908091432209.93231222384793; Thu, 12 Feb 2026 06:54:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvI-0005ms-4H; Thu, 12 Feb 2026 09:44:04 -0500 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 1vqXv0-0005OI-K0 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuv-000672-3c for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:46 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-573-_6xVKlXaN8GRzVcnZdoZ5Q-1; Thu, 12 Feb 2026 09:43:36 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4831192e66aso70114355e9.2 for ; Thu, 12 Feb 2026 06:43:35 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835d9946dcsm106794215e9.5.2026.02.12.06.43.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907417; 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=JGOT1h5ESN0Qld+a/yHoOKPmD7wsqNv5O1QINCuR2Ao=; b=AEycS5IC0jhGM4enDd7z26IW78K7ew+UiDiujWtvlLxV61xNBlznjv9YYY6Ro/bTWIwOSJ ZsAVt0qw5wy/ZnCM4GhO4yVo2wux1gj3mjpHk/H4Ah80LzofwezjfgW+PbS0lpIFMz+751 VpKFx0u37ABT3Jbbq+o3xMlG52m+Ly4= X-MC-Unique: _6xVKlXaN8GRzVcnZdoZ5Q-1 X-Mimecast-MFC-AGG-ID: _6xVKlXaN8GRzVcnZdoZ5Q_1770907415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907414; x=1771512214; 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=JGOT1h5ESN0Qld+a/yHoOKPmD7wsqNv5O1QINCuR2Ao=; b=O7FZGCv3h3932NIxmf1WDcAUkz8xVHQIBvuz/5htS77Og9750OJDevJwcI6rBhfp1D 4rMT1y4IkXyfkdTQiDLtAVB1fkMuu81oEyxvJbMrlFOnNOnzMFqv1I2WHHPq/TCE/Qi3 rBvA99Opqdox8V4WZRhmlEEtHFAbUPBKZm+J5ctdGN+weJpi2i9E/dzoV3PhL1IZdwAf 61hJ/yCd9q62FmI2VwG1JWpcfmPcZ8KuLpmGRHR3KiCuJKGecJnVWKqEZxPmZGuYNAD5 ZYQ8SszQP2YB5ftx4P0hAFnVrgCUMO7sj/ydF9Wz9JaruDG/aFJKNxz6nYTCafiHVt0U //Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907414; x=1771512214; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JGOT1h5ESN0Qld+a/yHoOKPmD7wsqNv5O1QINCuR2Ao=; b=pzKr8pPW58XNUP5nwcjemvCTXlRVzN2GH+TKNluRSLq2Xp9W0P2xEz/sybS6yk5gCW e1xIGItPH26Y+fbNU0SgepSr4ug9WXtGNgjIvo2ScBc9f7Ksdcn1fXiQnxbrOyBviBMz 5paPLild4gzv5QFcbAKVIzTJW7rRHtfXDXNNUdqom28ubR1Be+69W1dOtNLUHWvUSsH/ Zs1GPRwJsRqGavEdMehacmf6lSp+YYJieswsA9AYW45lPM5CsawJnNT88ec/GfH8OD00 NpmNtFTBBOeIgfLsXI0sKbFpEU/GNwU8S7qXI7QSHLv06/PFOPmaGAeeck0+PR35vicZ sUyw== X-Gm-Message-State: AOJu0YwNPJ2OsDZgscYIS/QTVsOA+gEBrVDRRTev4r/cvy/Tl3RyAhR3 tOzzUFXho7mAcp1I0CamZQ79j5Gfzf01pKr51FBEhGRMUJ3a+ycLeNXugIxRAG64dyikzmfc9IN nBBmFwbUMkeStwcXwUEN1JfiOefb2WvZzZiRFZRL8B/kidTi7t61O628DpClpJpr4sCBC5XT8kn FWVPBV4sFeYjpy4gvdepDhFTfffXzVoW/zcc0h5hHB X-Gm-Gg: AZuq6aKcimJyOlGwgx5MmvX9CThN6IdTObwv2DNYL43bebnesCpZ6TDOmYeE89W7vhL Nt5LrION2SGiSPV7Xsfcjkl4uUPv+YmuruCfZ/LxDLNofY+rBgIcYOw8BKjkbHOn8kVgbDQpHNd RaRj9tlnTJGOS/FDhH6Ofc+8hatA+RW9ZjKGIK+kG0eEYsiFWzFZLDNpiVl/ZERzfbhI3X67KyO 2UiwBXtUJlmDl7u4XKfMr9aSyqQHGINn6NVr/2Kgjh5aCYQ4u4SbI7JneaCwaHdbKc3U/wyqSQS A7MA6dD+PKlA7FoN1QPQQia6jBHaTDGCR+CkC5ot5uNt5i5ayVx46Ilmp4iuJeXcSA1ln+XnDSk noOfeFIgSJ6AvQ1fkFFzl9e9KmqHu53B2s8mZSHpxCn1+J/zcq4j+vIFldRVCzxWiQduOFYPgfL 7AQqO6z3/GbLSfpGBuPwOXzI9oXJ8zgSf1F3z2pRmHlrwrUas+quE= X-Received: by 2002:a05:600c:8411:b0:477:9dc1:b706 with SMTP id 5b1f17b1804b1-4836570df2fmr36711235e9.19.1770907414414; Thu, 12 Feb 2026 06:43:34 -0800 (PST) X-Received: by 2002:a05:600c:8411:b0:477:9dc1:b706 with SMTP id 5b1f17b1804b1-4836570df2fmr36710765e9.19.1770907413870; Thu, 12 Feb 2026 06:43:33 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Thomas Huth , Zhao Liu , Igor Mammedov Subject: [PULL 21/41] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines Date: Thu, 12 Feb 2026 15:42:23 +0100 Message-ID: <20260212144244.22579-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770908092924154100 From: Philippe Mathieu-Daud=C3=A9 These machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed. Remove the qtest in test-x86-cpuid-compat.c file. Reviewed-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-21-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- hw/i386/pc_piix.c | 9 --------- hw/i386/pc_q35.c | 10 ---------- tests/qtest/test-x86-cpuid-compat.c | 11 ----------- 3 files changed, 30 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 9efb42ad055..f9e0bca9743 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -723,15 +723,6 @@ static void pc_i440fx_machine_2_8_options(MachineClass= *m) =20 DEFINE_I440FX_MACHINE(2, 8); =20 -static void pc_i440fx_machine_2_7_options(MachineClass *m) -{ - pc_i440fx_machine_2_8_options(m); - compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len); - compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len); -} - -DEFINE_I440FX_MACHINE(2, 7); - #ifdef CONFIG_XEN static void xenfv_machine_4_2_options(MachineClass *m) { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 6dd1120c004..9158631f761 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -670,13 +670,3 @@ static void pc_q35_machine_2_8_options(MachineClass *m) } =20 DEFINE_Q35_MACHINE(2, 8); - -static void pc_q35_machine_2_7_options(MachineClass *m) -{ - pc_q35_machine_2_8_options(m); - m->max_cpus =3D 255; - compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len); - compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len); -} - -DEFINE_Q35_MACHINE(2, 7); diff --git a/tests/qtest/test-x86-cpuid-compat.c b/tests/qtest/test-x86-cpu= id-compat.c index 456e2af6657..5e0547e81b7 100644 --- a/tests/qtest/test-x86-cpuid-compat.c +++ b/tests/qtest/test-x86-cpuid-compat.c @@ -345,17 +345,6 @@ int main(int argc, char **argv) =20 /* Check compatibility of old machine-types that didn't * auto-increase level/xlevel/xlevel2: */ - if (qtest_has_machine("pc-i440fx-2.7")) { - add_cpuid_test("x86/cpuid/auto-level/pc-2.7", - "486", "arat=3Don,avx512vbmi=3Don,xsaveopt=3Don", - "pc-i440fx-2.7", "level", 1); - add_cpuid_test("x86/cpuid/auto-xlevel/pc-2.7", - "486", "3dnow=3Don,sse4a=3Don,invtsc=3Don,npt=3Don,= svm=3Don", - "pc-i440fx-2.7", "xlevel", 0); - add_cpuid_test("x86/cpuid/auto-xlevel2/pc-2.7", - "486", "xstore=3Don", "pc-i440fx-2.7", - "xlevel2", 0); - } if (qtest_has_machine("pc-i440fx-2.9")) { add_cpuid_test("x86/cpuid/auto-level7/pc-i440fx-2.9/off", "Conroe", NULL, "pc-i440fx-2.9", --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907490; cv=none; d=zohomail.com; s=zohoarc; b=Oe17aDa/OyTyvIAVBgfpIj8VK34GP6i0W0okGfHvci06Y4+FpYkBceuQTIZHzqZ3ut/MDisr1Lrv7JQvhey1xKMPg/tq35dMtADWTQ6Tq46m5ovDQBINNbVOKWMM1QkmMEi6FQCKI/EdsuFfoR7fHsP6hXx7ABnY2OE7ZZMZfkU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907490; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MC3+KU0icfjmOgw8k+VWmnV40sQ8cN56y9GBvwmJBjY=; b=jr2NQxkSx4p43ftDhxwhR+90lQU9w1xcSzgELCFRkcISPfsEu1hRjCtss3YIyVZEViU9hkF8RHLAWk+HBeONcPYh31t63y1NIRiL3d/GpIHVhCPwBwlMFYH/OH1rixnmgNZLh9JfYGqfzI1VNsiGfsqLidt8tuYn2glda7WI+6I= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907490085667.3985469986317; Thu, 12 Feb 2026 06:44:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvK-0005qx-6H; Thu, 12 Feb 2026 09:44:06 -0500 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 1vqXv0-0005OJ-NH for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXux-00068F-76 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:46 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-562-Qel78NACOf-7Oho0y_rEGA-1; Thu, 12 Feb 2026 09:43:38 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4830e7c6131so55402655e9.2 for ; Thu, 12 Feb 2026 06:43:38 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835d994670sm101547965e9.4.2026.02.12.06.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907420; 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=MC3+KU0icfjmOgw8k+VWmnV40sQ8cN56y9GBvwmJBjY=; b=GEZfycfyd4qL5JkEfX8bnHFVOcEJsdNO2HBweA8E44No4zVeRsQp4agsZqAizMcooQXw57 LYq0CpE9Gybj/DGYtazr7Y7yFt2o4ncA3StXlYgUSoS247qENBpplOh0lz1fFWFp/GBW9B h9mxxBGiBfbxvIv5/6ElPecFIQhZHd0= X-MC-Unique: Qel78NACOf-7Oho0y_rEGA-1 X-Mimecast-MFC-AGG-ID: Qel78NACOf-7Oho0y_rEGA_1770907418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907417; x=1771512217; 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=MC3+KU0icfjmOgw8k+VWmnV40sQ8cN56y9GBvwmJBjY=; b=FfBtYFNILZK29ef6QYjuB69Nr/aAgm/lUuxh3rhG5di2MtSd/sWyQiGMgyzW+XcCZb t+khgACePbw/panGHDO51Vx4ra1voDeNVt49QHegmBK3hO7iU6rBmIme9iTW6AFtBLX4 lNy6y+9OwU8JLUV1oP81Aoijfe8QL7m4jPft5FTw3dfOqfq5ASjJPsgrZEqsBtKRJ7Lo xasw1WnV6bopv+3mgAdd/4YSRHD9KfKB7EVVxqzSYTpA2uPZ8YK5nqoKQeYX3+YiR0nU ld1jYrFOY1LRzlBX0tfDagmTzAa3RyL+00dRkorN3zJzp8Ha0Q5ujRrYe7mH+zbDnZYL qTKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907417; x=1771512217; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MC3+KU0icfjmOgw8k+VWmnV40sQ8cN56y9GBvwmJBjY=; b=Un3T/rE5d6/36JU0xzDAltii2j5pkzastv0dS0g5gKzu1gE3HU8BoFxOEf5mWE/+iz 5bmvFqaZOH8QfBMtM+3lEqse2La+RpzEZV1K7Wkj2oVayYZU2tFIYKwxblC970Ck7PgT M/l8fB3W4X6SNFN2d2BkZ8ZxbfG3xsd9GrM5pcIED5rRxYymH7e0MnKE4Wyz7j1hKniY tp1Fd/QcpAtau+YOUtXfw9cOtewBx0jXQx9LGP0AkuXNCv0EMxAPUIMgaKBisNlJHzUG VMVxiPNsZl9FMjxN5uGlWKDAAnY1fPXwOUDsHt5VJ0+OwsOzNDmGXxPpYrnqYsrkYJSl IwDg== X-Gm-Message-State: AOJu0Yz9Ipj8Tfjlt8vu6c6sXdla5tEOCPcrFkPzGMEI/o6Man/gFU+0 W//P20rmOgJudLnVixLy64mqYS1FHxPYEgzKaUl5DMazZNrHApFr6f8Hxg3puUQS3csipuTkxhU l1XKoZh7dTFmSxtl4fUPENtZjkCnLkEgOAwu4OymPraayBElmCujrzBUJlPjtGaJukBfzazvMwL TS1F7PZvoAim3tkewPeS4BE8tZSH0YG6egnBnBq+A+ X-Gm-Gg: AZuq6aLxF8blzpaQhtnSBLim23HHvgzTj1IcymvXmLwT4vvKlzD3ZUpyQ93PMF9eMjC Qfwl8Ws8BQqcHuokydRv9oPEYU+PnjJVI8nraIxtW18QXKELBPJNj1XIth3WxU9ac/gzIZzuekH B08AvXERHQk/bhrwrK0eRP5XSW6QlEiGKKwJZeRHlkKoFAerQH/dEE6qAEvDDoTLsHW5UasiLHn kKCZycP3X5cSBTSvTAvbck8LrBvt/oD58kUFaSs6hlkyFMmUvo8AVRYeAxB9f4v4NhB+SjE/+66 cFvzBFaOwYsrinkCiVyMq0Unbxmq/2UHstOj/ysuP9wMQj0eI+yv9JCMt/boApbkmAB9kBMxRZJ PGJ4ExTlq4w+17fT3cGY9IoEhzs+cneb8DB1iOLXBJ5s4UM6o3SnOVpMdNK4C3jyly6b4zRJRWj YEqskMz2zKMgWlqDjy1WAlZa2/2+4P5TDcr2j23IqGy5OT/zSV6Pg= X-Received: by 2002:a05:600c:3e0d:b0:47e:e20e:bbb2 with SMTP id 5b1f17b1804b1-483656ae35fmr44964505e9.7.1770907416938; Thu, 12 Feb 2026 06:43:36 -0800 (PST) X-Received: by 2002:a05:600c:3e0d:b0:47e:e20e:bbb2 with SMTP id 5b1f17b1804b1-483656ae35fmr44964055e9.7.1770907416500; Thu, 12 Feb 2026 06:43:36 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Zhao Liu , Thomas Huth , Igor Mammedov Subject: [PULL 22/41] hw/i386/pc: Remove pc_compat_2_7[] array Date: Thu, 12 Feb 2026 15:42:24 +0100 Message-ID: <20260212144244.22579-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907491715154100 From: Philippe Mathieu-Daud=C3=A9 The pc_compat_2_7[] array was only used by the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Remove it. Reviewed-by: Mark Cave-Ayland Reviewed-by: Zhao Liu Reviewed-by: Thomas Huth Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-22-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 10 ---------- 2 files changed, 13 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index d6d54852375..1cf88c16975 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -295,9 +295,6 @@ extern const size_t pc_compat_2_9_len; extern GlobalProperty pc_compat_2_8[]; extern const size_t pc_compat_2_8_len; =20 -extern GlobalProperty pc_compat_2_7[]; -extern const size_t pc_compat_2_7_len; - #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, \ const void *data) \ diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 12f139c6798..5a70e5a7da4 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -256,16 +256,6 @@ GlobalProperty pc_compat_2_8[] =3D { }; const size_t pc_compat_2_8_len =3D G_N_ELEMENTS(pc_compat_2_8); =20 -GlobalProperty pc_compat_2_7[] =3D { - { TYPE_X86_CPU, "l3-cache", "off" }, - { TYPE_X86_CPU, "full-cpuid-auto-level", "off" }, - { "Opteron_G3" "-" TYPE_X86_CPU, "family", "15" }, - { "Opteron_G3" "-" TYPE_X86_CPU, "model", "6" }, - { "Opteron_G3" "-" TYPE_X86_CPU, "stepping", "1" }, - { "isa-pcspk", "migrate", "off" }, -}; -const size_t pc_compat_2_7_len =3D G_N_ELEMENTS(pc_compat_2_7); - /* * @PC_FW_DATA: * Size of the chunk of memory at the top of RAM for the BIOS ACPI tables --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907460; cv=none; d=zohomail.com; s=zohoarc; b=hnh59dn9Ue3AsYV4rGCOy4jhFeVkBXxaZUlTzwdqivF0X3O6xIYFqGPoC1MQloYrV/OzMz15vQdj2j1ygbGwaoe4r3rQztB8Hu0penat6oAO6yHA0TVAHTc6dgEcrQ1VcbXhAVOREBajd/nhRiyBFfmjKLz2kIWOyKhtpTR9Z8I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907460; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BNVw9azJMhrqoIvHRfT5WOQ0fbhJsvRuSAkYrSswDgA=; b=isde8FmgYKhAuq+smENaeYB1Mic8Hblle008o2uuO3Btm/sxv2OCvgBMaXASxAH5cUgWXerOGSYnU6kvCFAf8u6ibTqAt7s3mQOqDmayh1LsPPHnYFGVVqEjfQhzEfvqfb/mzAFIlynXSkNpISx/2eygevehHoqstJzVysyc/FY= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907460303737.466553406551; Thu, 12 Feb 2026 06:44:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvD-0005cX-Pe; Thu, 12 Feb 2026 09:43:59 -0500 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 1vqXv1-0005OM-87 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXux-00068k-MW for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:46 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-sDaBLJLJPyiQV86rH7lr_w-1; Thu, 12 Feb 2026 09:43:41 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4836b7c302fso4826505e9.1 for ; Thu, 12 Feb 2026 06:43:41 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835dd0e15bsm103388505e9.13.2026.02.12.06.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907422; 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=BNVw9azJMhrqoIvHRfT5WOQ0fbhJsvRuSAkYrSswDgA=; b=AnTi/Pqo9rgo/MsgIEpZaHCwd1HQDhBLNpUarSKC/SEKTRNDhEXaqh1VNNU1NMw+/PlVkc Ap+zTb70Fxyt+WsGKeqnFuE9G21OUJh7POXj6FEEAFk4GbtgdeC6d3Bby4Xxk82/ABRBW9 IYRJU8FKhl9anAso1gx37KMgJ1nId3o= X-MC-Unique: sDaBLJLJPyiQV86rH7lr_w-1 X-Mimecast-MFC-AGG-ID: sDaBLJLJPyiQV86rH7lr_w_1770907420 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907420; x=1771512220; 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=BNVw9azJMhrqoIvHRfT5WOQ0fbhJsvRuSAkYrSswDgA=; b=B77kbc419vvSBqss/Ih2BX/v5gGw/R42W1V6qGhHmX4xEWL/CJVKHHmVcjQkey878M G/x/Zx3jwOtSShU0YpD//r2EMpgvJ4nS+JzC21lUu3+xTENGuQw3dGnWripfGwHKU+gM 6aQBBTDNMnMT494+9gJWde08hinTY1sNufZrD3L3cGm6oYFU2HvNiuU/gaod6cwxJjGU nHQtPr8CduOvsIDnqXXPYLUbeq1VIpA443fCpIuF87K7Jzp5X48kLnGMUEDJouiNM3I8 S9/0cDDc+9zSNEu47fOlDBBwa2NEYYxoEqaCOAWBZ4MWVuqy6ScXloGktryCOUB2dRR4 A3BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907420; x=1771512220; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BNVw9azJMhrqoIvHRfT5WOQ0fbhJsvRuSAkYrSswDgA=; b=OHhtr8lGVQJfV39cup46DBrZcUlxosStNo0c9FGqj+L837PVNm0bTUKJnE5tB6bOVK GDyNOGoSb7AI+VU36iIi0B2KlImk0Wa32hRFGLZxr1Ox/Ej9YtKzeogG0a2IznWZjk1s QB3sTbr63asqnDw43kaXjEhT5HxvCd5RKqNpV29H3rE35gFJZCUx0/qt2I6i38sojpBj FoULqxWhCTSn2dw+/rR5Wj+tTNW6sNFbpg6/6dU61S50FhRkkqFG1V577+XjTQClbuS1 ljLvlU5oUBcnBOrCPkABmD0TsakbpmO1Xn6R+u6/B0csrtq24AWBQZyIiFQ9i0ZDbYOJ RUCQ== X-Gm-Message-State: AOJu0YwwfBMW1NQsG7ukY7KDxdlTre6sc0GKOcQvbWr3IktXvjYwau8m jSJR8tsdSky+lPUnKKu/5BP8/pMMO9n2Pv0BVxWX3C/Uh9wQNQOLAFkcv51AkSNWxSGwffy0R0w mpiR9Yf2UwSmsAe1fvGWddaWp4IESFm+HNcG833OP0AH5NirPH9Oe8QCEox7oH1q6yHSJhYqcGw zwh8MHiwiSsE/H/UZxkxRGoWolGd0cQTRqv5Y5z2VW X-Gm-Gg: AZuq6aJcB1M5XaQCpSERbVrZikbL8YuhN64H9jLxzb5VRaqQiFFpTG0Vw1TaotBWD1e 5WuThcojn72uO/EBGO0jC9UtNDvImU8i5PW6Qro82QKCuB8XYwc1D9FQiu7CamYB29JKvlpjHt3 Dhvac2D5P978/ZmOelkcI+edCUTSbgfEHsO1MlYCg3eUKqLyqiLu0kVDvhO2CxKIuEQMhI1XXWu KsGuzQ0zLIba545e+yYaIBRz30Vg6w1YQIw4jY8/+cvHzUs69/N92ysu8XLFhWGD+5awDURf/Nn 4YBSWpVq3hEjDPo9itftf9u+jNo1cGJPgy+Kw3tYwrDUBqjdiC71aN30DwDBTce3P4Gb7gDeGuJ G/5LLKo0bUeE1vEAHU297f51szg0LO3LpEckOC4XJgKCMVZYZ5l8t5dxkYwwYwG4FkvhcEl+By4 yocEPb7pdf41IClEO0DX1YeiBLrYygALcz/5g+9nctQ9Qy3TNKV2I= X-Received: by 2002:a05:600c:848d:b0:479:35e7:a0e3 with SMTP id 5b1f17b1804b1-48365716033mr43890335e9.30.1770907419890; Thu, 12 Feb 2026 06:43:39 -0800 (PST) X-Received: by 2002:a05:600c:848d:b0:479:35e7:a0e3 with SMTP id 5b1f17b1804b1-48365716033mr43889675e9.30.1770907419296; Thu, 12 Feb 2026 06:43:39 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Igor Mammedov Subject: [PULL 23/41] target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field Date: Thu, 12 Feb 2026 15:42:25 +0100 Message-ID: <20260212144244.22579-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907462547158500 From: Philippe Mathieu-Daud=C3=A9 The CPUX86State::full_cpuid_auto_level boolean was only disabled for the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Being now always %true, we can remove it and simplify x86_cpu_expand_features(). Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-23-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 3 -- target/i386/cpu.c | 117 ++++++++++++++++++++++------------------------ 2 files changed, 57 insertions(+), 63 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index da5161fc1a5..f2be42d7f65 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2425,9 +2425,6 @@ struct ArchCPU { /* Force to enable cpuid 0x1f */ bool force_cpuid_0x1f; =20 - /* Enable auto level-increase for all CPUID leaves */ - bool full_cpuid_auto_level; - /* * Compatibility bits for old machine types (PC machine v6.0 and older= ). * Only advertise CPUID leaves defined by the vendor. diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 0a7b884528e..201c5d5c210 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -9508,74 +9508,72 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **e= rrp) =20 /* CPUID[EAX=3D7,ECX=3D0].EBX always increased level automatically: */ x86_cpu_adjust_feat_level(cpu, FEAT_7_0_EBX); - if (cpu->full_cpuid_auto_level) { - x86_cpu_adjust_feat_level(cpu, FEAT_1_EDX); - x86_cpu_adjust_feat_level(cpu, FEAT_1_ECX); - x86_cpu_adjust_feat_level(cpu, FEAT_6_EAX); - x86_cpu_adjust_feat_level(cpu, FEAT_7_0_ECX); - x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EAX); - x86_cpu_adjust_feat_level(cpu, FEAT_7_1_ECX); - x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EDX); - x86_cpu_adjust_feat_level(cpu, FEAT_7_2_EDX); - x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_EDX); - x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_ECX); - x86_cpu_adjust_feat_level(cpu, FEAT_8000_0007_EDX); - x86_cpu_adjust_feat_level(cpu, FEAT_8000_0008_EBX); - x86_cpu_adjust_feat_level(cpu, FEAT_C000_0001_EDX); - x86_cpu_adjust_feat_level(cpu, FEAT_SVM); - x86_cpu_adjust_feat_level(cpu, FEAT_XSAVE); + x86_cpu_adjust_feat_level(cpu, FEAT_1_EDX); + x86_cpu_adjust_feat_level(cpu, FEAT_1_ECX); + x86_cpu_adjust_feat_level(cpu, FEAT_6_EAX); + x86_cpu_adjust_feat_level(cpu, FEAT_7_0_ECX); + x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EAX); + x86_cpu_adjust_feat_level(cpu, FEAT_7_1_ECX); + x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EDX); + x86_cpu_adjust_feat_level(cpu, FEAT_7_2_EDX); + x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_EDX); + x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_ECX); + x86_cpu_adjust_feat_level(cpu, FEAT_8000_0007_EDX); + x86_cpu_adjust_feat_level(cpu, FEAT_8000_0008_EBX); + x86_cpu_adjust_feat_level(cpu, FEAT_C000_0001_EDX); + x86_cpu_adjust_feat_level(cpu, FEAT_SVM); + x86_cpu_adjust_feat_level(cpu, FEAT_XSAVE); =20 - /* Intel Processor Trace requires CPUID[0x14] */ - if ((env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_INTEL_PT)) { - if (cpu->intel_pt_auto_level) { - x86_cpu_adjust_level(cpu, &cpu->env.cpuid_min_level, 0x14); - } else if (cpu->env.cpuid_min_level < 0x14) { - mark_unavailable_features(cpu, FEAT_7_0_EBX, - CPUID_7_0_EBX_INTEL_PT, - "Intel PT need CPUID leaf 0x14, please set by \"-cpu .= ..,intel-pt=3Don,min-level=3D0x14\""); - } + /* Intel Processor Trace requires CPUID[0x14] */ + if ((env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_INTEL_PT)) { + if (cpu->intel_pt_auto_level) { + x86_cpu_adjust_level(cpu, &cpu->env.cpuid_min_level, 0x14); + } else if (cpu->env.cpuid_min_level < 0x14) { + mark_unavailable_features(cpu, FEAT_7_0_EBX, + CPUID_7_0_EBX_INTEL_PT, + "Intel PT need CPUID leaf 0x14, please set by \"-cpu ...,i= ntel-pt=3Don,min-level=3D0x14\""); } + } =20 - /* - * Intel CPU topology with multi-dies support requires CPUID[0x1F]. - * For AMD Rome/Milan, cpuid level is 0x10, and guest OS should de= tect - * extended toplogy by leaf 0xB. Only adjust it for Intel CPU, unl= ess - * cpu->vendor_cpuid_only has been unset for compatibility with ol= der - * machine types. - */ - if (x86_has_cpuid_0x1f(cpu) && - (IS_INTEL_CPU(env) || !cpu->vendor_cpuid_only)) { - x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x1F); - } + /* + * Intel CPU topology with multi-dies support requires CPUID[0x1F]. + * For AMD Rome/Milan, cpuid level is 0x10, and guest OS should detect + * extended toplogy by leaf 0xB. Only adjust it for Intel CPU, unless + * cpu->vendor_cpuid_only has been unset for compatibility with older + * machine types. + */ + if (x86_has_cpuid_0x1f(cpu) && + (IS_INTEL_CPU(env) || !cpu->vendor_cpuid_only)) { + x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x1F); + } =20 - /* Advanced Vector Extensions 10 (AVX10) requires CPUID[0x24] */ - if (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) { - x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x24); - } + /* Advanced Vector Extensions 10 (AVX10) requires CPUID[0x24] */ + if (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) { + x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x24); + } =20 - /* Advanced Performance Extensions (APX) requires CPUID[0x29] */ - if (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_APXF) { - x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x29); - } + /* Advanced Performance Extensions (APX) requires CPUID[0x29] */ + if (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_APXF) { + x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x29); + } =20 - /* SVM requires CPUID[0x8000000A] */ - if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) { - x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A); - } + /* SVM requires CPUID[0x8000000A] */ + if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) { + x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A); + } =20 - /* SEV requires CPUID[0x8000001F] */ - if (sev_enabled()) { - x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000001F); - } + /* SEV requires CPUID[0x8000001F] */ + if (sev_enabled()) { + x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000001F); + } =20 - if (env->features[FEAT_8000_0021_EAX]) { - x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x80000021); - } + if (env->features[FEAT_8000_0021_EAX]) { + x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x80000021); + } =20 - /* SGX requires CPUID[0x12] for EPC enumeration */ - if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_SGX) { - x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x12); - } + /* SGX requires CPUID[0x12] for EPC enumeration */ + if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_SGX) { + x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x12); } =20 /* Set cpuid_*level* based on cpuid_min_*level, if not explicitly set = */ @@ -10520,7 +10518,6 @@ static const Property x86_cpu_properties[] =3D { DEFINE_PROP_UINT32("min-xlevel", X86CPU, env.cpuid_min_xlevel, 0), DEFINE_PROP_UINT32("min-xlevel2", X86CPU, env.cpuid_min_xlevel2, 0), DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0), - DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_leve= l, true), DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor), DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true), DEFINE_PROP_BOOL("x-vendor-cpuid-only", X86CPU, vendor_cpuid_only, tru= e), --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907941; cv=none; d=zohomail.com; s=zohoarc; b=nYoT9LuM9mwvrJCGZ7gtV8sCqvdO0IFc/5uOqU+hrxshv2GQj2ZD1TwY/Ajy+h8x6ONC8pnE9EZYZnZggCYCZRGI+SXG6Lv76JpFDy8EXEfBu/4Nynefu6V0rdBpM7CtYaH8iWGxF1dIKIkX3SG8G8VrGk+WlZuXwkawVoL2Hm8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907941; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1pZJeSsRKhhmEscgZ7YYP5vcNGqC0Rr9KYF4FasGN1I=; b=KtmeAvI1QsNjqiT3UiMBAIImSQQ47PsFD4RA44wtLJuheRQ0U8MNONFcmDyzTgDFxKHmyzY1KnmBzMQqq4Y1rbBpcI/s+zoT/MlopCh2mWEdatakNG9DXKhgWSuCkWTVTXrSINoXlTXdFrz5NCR9mDAN/qpbMR+0lmMeFkPlSAs= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907941271122.731055335017; Thu, 12 Feb 2026 06:52:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvL-0005t2-5W; Thu, 12 Feb 2026 09:44:07 -0500 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 1vqXv1-0005OZ-VO for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXuz-0006AO-RI for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:47 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-367-9avk3JidOjGhIinwgDtbcg-1; Thu, 12 Feb 2026 09:43:43 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4802bb29400so72399665e9.0 for ; Thu, 12 Feb 2026 06:43:43 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4836131d48fsm33303475e9.24.2026.02.12.06.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907425; 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=1pZJeSsRKhhmEscgZ7YYP5vcNGqC0Rr9KYF4FasGN1I=; b=Xuq94094af0JPZhYBvMhH2adRptKXfLYKcHdwo7WFXucf5BN+XDIVXWFP9hNl4tUhBtjmQ P8e03MpunMbzKi1EMn4WnoBPPKRMmgfS3RlGjU17QkZY71YDUz5blM7IepNjAS5/2ROd9J bbMgFZO706XYhtJjn5yV/+1TbLJW5Eo= X-MC-Unique: 9avk3JidOjGhIinwgDtbcg-1 X-Mimecast-MFC-AGG-ID: 9avk3JidOjGhIinwgDtbcg_1770907423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907422; x=1771512222; 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=1pZJeSsRKhhmEscgZ7YYP5vcNGqC0Rr9KYF4FasGN1I=; b=fZM+RLnERBSXthjXD5vCXUshXj8sVb91b0IOFuYEy2BH0h41wVmfjxlZb8AmxaU6XC D/133xLkgHg/YqRj/9eVTU1P2+miwyvsHAkwzFmOq2q4fjeAfhv8K7om4WwwSiQSUpuy Cl12YrF/lzMP0LMqAIa1H20u7QZGsOibCf7yrCUTpIgRjVrD9aRCCWbkWhOU8k5Gg3EK BqvOts+ufLIBoLZJnYg7GG77cA7p0sd1yKmcBzdjOeOsb3FZjZl0xdvRl0ztNTcTBO7f ALTf3IUAy9NYTRcemEl66l3s78YKgFKd5Zbq7VW3LuesWfXuuiRwcQXGviUsM5z5Wik+ pJ6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907422; x=1771512222; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1pZJeSsRKhhmEscgZ7YYP5vcNGqC0Rr9KYF4FasGN1I=; b=gfhSs9jxtwwCFBToc2iTJoB3I2Oc2zO+3OEzB1WFLrkc8lcxV3n8sp1CzV9tiQiEy3 ofXa4uxp5bwcM0od3jd7t5csfXs9fOxgFU5w5IvLDMaz9btzI6uRuDkpMMMBsg31MljP 5dyV5jkI0MpBoPt6M6W1wFY7+/jUGbWEJeD5DcJZaXJQdRm/iIdi4bg0t6hoxQ6gaALD DP2kX/8qy+e6L8VB5G9intHEC42blWZisOaGr9Y6/hWDjSo18e6RHF48Zg6NRAy3l3an 0ZxckVJUm/kTZ+CqRNE8m2O/Xu1BF4kCwK46lXwuj0tfPYu/A0onRmzE0Jmj8yinlpC3 UCqw== X-Gm-Message-State: AOJu0YywwIuYRYFBRF/q0DlDGf5jppit9N2ZOION/w4RCLWtbhfL4pld 4f5N5VPGWfZLjlXdF2ibMS83xZsdxlyrZlub5d8wxdaiWEb1CK9wGrEKSkYxfHPK4P+vIQ0+qTV +CDUunye0+OdUsKoUkATKTHH41trFU/Wa6L0EjYVNOA5PIoOfvPYCcwbpbBIQ8yl3fqbK717XBt 1hDBoynpdIt/YI1JLmgWBzGVu/WMU3SHbTTbCLhp3Z X-Gm-Gg: AZuq6aK+Pxlh5urCSZ57N+vHzfp590hTeCtAAB7k5trUpQHaheHcI0+u79xsIGB9DOL 852hpLOCYH5h0vUCPycVcHcMDteTs5oe6fj1S1AvxQ8cDs0A5g4L8E4Lor1K+sKpZ/GDIVmz1j2 NDz3s/L2l2J4Xa1nREbfOSOtN0XGMFnKO8OkB3+Pd0gQ7PbwcUMAFMS2fh31bb3GPJOIwZFTXv0 79ws7SlMar9+17X++3q1qumvotg0RmIa4SyCC7BnNEg1erbVBE5lk9coRfdy+YS8Q8ATrLzGZcX U27r40MKFRMaHa6NYARJcXZ+Vxc5rivKLbOhto5uFfv3pSIRHKfQoYea1dWuJouMT1n34RYGOJz 1PMKv57V1c27gji6cQEyhWGU7weIegYuQTNPL/YFJJvTJbF+AwxuWRdYrzqc0vX3rqwcm9V2Wix WKfwmUZDplH4GZpBknZRW7Qhimg1NSxkBQOVQslLkwVEcpHXg6+sU= X-Received: by 2002:a05:600c:35cc:b0:483:6fe1:c057 with SMTP id 5b1f17b1804b1-4836fe1c12dmr2079885e9.21.1770907422152; Thu, 12 Feb 2026 06:43:42 -0800 (PST) X-Received: by 2002:a05:600c:35cc:b0:483:6fe1:c057 with SMTP id 5b1f17b1804b1-4836fe1c12dmr2079335e9.21.1770907421673; Thu, 12 Feb 2026 06:43:41 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Thomas Huth , Igor Mammedov , Zhao Liu Subject: [PULL 24/41] hw/audio/pcspk: Remove PCSpkState::migrate field Date: Thu, 12 Feb 2026 15:42:26 +0100 Message-ID: <20260212144244.22579-25-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907942710154100 From: Philippe Mathieu-Daud=C3=A9 The PCSpkState::migrate boolean was only set in the pc_compat_2_7[] array, via the 'migrate=3Doff' property. We removed all machines using that array, lets remove that property, simplifying vmstate_spk[]. Reviewed-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Igor Mammedov Reviewed-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-24-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- hw/audio/pcspk.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 916c56fa4c0..0b01544941c 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -57,7 +57,6 @@ struct PCSpkState { unsigned int play_pos; uint8_t data_on; uint8_t dummy_refresh_clock; - bool migrate; }; =20 static const char *s_spk =3D "pcspk"; @@ -202,18 +201,10 @@ static void pcspk_realizefn(DeviceState *dev, Error *= *errp) } } =20 -static bool migrate_needed(void *opaque) -{ - PCSpkState *s =3D opaque; - - return s->migrate; -} - static const VMStateDescription vmstate_spk =3D { .name =3D "pcspk", .version_id =3D 1, .minimum_version_id =3D 1, - .needed =3D migrate_needed, .fields =3D (const VMStateField[]) { VMSTATE_UINT8(data_on, PCSpkState), VMSTATE_UINT8(dummy_refresh_clock, PCSpkState), @@ -224,7 +215,6 @@ static const VMStateDescription vmstate_spk =3D { static const Property pcspk_properties[] =3D { DEFINE_AUDIO_PROPERTIES(PCSpkState, audio_be), DEFINE_PROP_UINT32("iobase", PCSpkState, iobase, 0x61), - DEFINE_PROP_BOOL("migrate", PCSpkState, migrate, true), DEFINE_PROP_LINK("pit", PCSpkState, pit, TYPE_PIT_COMMON, PITCommonSta= te *), }; =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770908090; cv=none; d=zohomail.com; s=zohoarc; b=G4C9LhSGB9XwiPujNZK/eFgA1fyclij6PH3LQg3Wji5CM83h11if41pb6eWJQRpYfVTPl7gSM4GMq+00HdBWO8neSTCXNmrI3EvvRFYhqxl1rbnOw1ryAfIDkYp2H84m2vdffQDfOIxIlQA09pqq5MUrwYR1OD6Yc6Vp78F04ZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770908090; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kZ15JADujw0LyvCgnaafncrrHu/B+7f+maVF03/vnno=; b=c7Rw89hz7xZrmqQDJizngmbTXpyzEjczXR3b9yDs/C9OaXpT6KpTy95d+qLioZg3JNJn9L7kkHms1/zdnl2KmfN9zXXFavlaEhMPp1MpBBIW0Oe+fgskLnEGEWQtJ//XkCJdoTu/oirRmOi6x/Iaa2q+DG/96dkXkS6yHGmMHQk= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770908090124208.20379512318596; Thu, 12 Feb 2026 06:54:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvI-0005o6-Mc; Thu, 12 Feb 2026 09:44:04 -0500 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 1vqXv3-0005PG-DB for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXv1-0006BL-S8 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:49 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-676-dTngS0uzNU-1nRZ3Rv01NA-1; Thu, 12 Feb 2026 09:43:46 -0500 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-43623192c6aso3965703f8f.3 for ; Thu, 12 Feb 2026 06:43:45 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43783b09b99sm12762592f8f.0.2026.02.12.06.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907427; 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=kZ15JADujw0LyvCgnaafncrrHu/B+7f+maVF03/vnno=; b=eC8hwozc0FBDKRAKFMLYlWLMNS3fPSydPEl58DYiih/kD8LeeHeKmaZgMUngITsSWbxSoE hKnjqfDztW2GeRKQb12HyP+eW5ZssnRibcO7JVggIxTA37pxvYkqNSha6AFSn8jXDI8FDD I5EUVaujZzR3xdrkspdbsFiXkdtsM+s= X-MC-Unique: dTngS0uzNU-1nRZ3Rv01NA-1 X-Mimecast-MFC-AGG-ID: dTngS0uzNU-1nRZ3Rv01NA_1770907425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907424; x=1771512224; 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=kZ15JADujw0LyvCgnaafncrrHu/B+7f+maVF03/vnno=; b=RVWmCCPGsHLlvyWs1qP7kn0V2ZCIyGcE54cSilAEPhJDOEqwRvgyDf2bQsKwkIc7Cx G54SS+C3dQIo7aHl6g88lh1rteF3UaRs0CJzF6C4Ff/G5YYzcnawgfXTFIEgSZbKU4hz 2C0E3hx5XDnOH1DwsbeXwl7HCtjW6MbOipnVwEq/V0s7ksOg2WfSB1Y0sd5I1YZpEnca JrWIZMiG5Hi/lanOvNeVGrDxXIvPFmTBrtNjs2TKYOgggkdf5+eEw5PPi9lCF1tBXOVG miBW6sM5wTsn0vZVlKCEs3uR6XxF3OX4XztnN9nwsxrMMiN/i3RD712PcExQmQ+5y7ed jl+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907424; x=1771512224; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kZ15JADujw0LyvCgnaafncrrHu/B+7f+maVF03/vnno=; b=EF6e3YpQX56CALD84u+64viLeykLRpI+GvgwaUiY+zGSfG38C6e3oJcWtGzp8k9o5d ejvH227CnxQV2LOWtIOfhmAfWFtI2cCzwKdoBgzSmodYYwvAiUvZnuraKHHYhI/zOsx2 UeYnjzXcEaPULXkOf40NVMD0Y502DJ+3y8rIFzGb6vPA4Zxq7QkwbfbCezkQZM/6luxK GGDMo3HlsudIRIGXnRYD3VdN7hjxkR+q2f+r5hdH1vf8O6ArE+2JhayHj4lg5BDqHIW1 xOcK8s+aRfqHja0oHr3YaZ434svZaKR6+6hLyNDuBEybU1n2YwXSMxBSXr2Qga0w+NRx yg4Q== X-Gm-Message-State: AOJu0YwCQo3vrWlgAMcMN5h9161DQPn8fzPpWYJyI7uO1W9KEwzmWsEK f4EBdjfaiRBlv4A9VoE6+m3Ar1fbPJFxYh/Y0CT/3Nl7FWgHPFZsswjLYluI0RPbjDOyk8G1Yge iJ09u6N7CxRVTcqLClM5jXLD/ZFr8aFT3kLdiF4Zg4ex9mjvYSD7jAQkvD3d9Irh9XM5s+gd3Ki wvTKpgZhIGlAjf/b6zcv9sSEvLOP7axx0TPHT76xWh X-Gm-Gg: AZuq6aIh2nDKYS2DF9RkbbItbfb+C1j00oaU6R0qPZWbgk36D6XXlvtVln3L65JOeBG XZ8GGmtxKbcd7lfdvc2Nm84DPh0zArI36ABVj9f0oCvPLoV61KdFNfe/5aGN220AOcQ4gMxCFd4 X6tXMA3ansprlGHJVY+4/XEfV6vCEtK2ta2TQgBsmQODcbnv+SrhS+owj+z20vzC1GrnUhVNsWj WdmnmZXToi9cS6D/ajT87VQy0MR+gSa+ylJBhluixG26peOhBJZCrhsPfjkXQQXXyVCOxqDks+z ++Jfj8y5HsYvwZmGkwLTWJzyz1meOxcmLbaYJxepUW5qXzz3OeTrNLUcfUQkcfjNlqCTlzcs9B4 qMIPGtBNn68P/Yw+21DkcHoC5/eo32nXDBlp8QXSAb8ctyHQwUqWyxeeA4vTzYHdu8G85WyGFrZ Sj0FLbj9/Z9ynOA8lvaK9Ul9iQFLlby92kiJhdd6RySKSH0kQJES8= X-Received: by 2002:a5d:55c7:0:b0:436:f7e5:e057 with SMTP id ffacd0b85a97d-4378f168bb3mr3269300f8f.49.1770907424009; Thu, 12 Feb 2026 06:43:44 -0800 (PST) X-Received: by 2002:a5d:55c7:0:b0:436:f7e5:e057 with SMTP id ffacd0b85a97d-4378f168bb3mr3269255f8f.49.1770907423477; Thu, 12 Feb 2026 06:43:43 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Zhao Liu , Igor Mammedov Subject: [PULL 25/41] hw/core/machine: Remove hw_compat_2_7[] array Date: Thu, 12 Feb 2026 15:42:27 +0100 Message-ID: <20260212144244.22579-26-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770908092432158500 From: Philippe Mathieu-Daud=C3=A9 The hw_compat_2_7[] array was only used by the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Remove it. Reviewed-by: Mark Cave-Ayland Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-25-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/core/boards.h | 3 --- hw/core/machine.c | 9 --------- 2 files changed, 12 deletions(-) diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index d6ff9f3d233..a99ef4ca469 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -882,7 +882,4 @@ extern const size_t hw_compat_2_9_len; extern GlobalProperty hw_compat_2_8[]; extern const size_t hw_compat_2_8_len; =20 -extern GlobalProperty hw_compat_2_7[]; -extern const size_t hw_compat_2_7_len; - #endif diff --git a/hw/core/machine.c b/hw/core/machine.c index 2664848c2b0..308bd0b6088 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -284,15 +284,6 @@ GlobalProperty hw_compat_2_8[] =3D { }; const size_t hw_compat_2_8_len =3D G_N_ELEMENTS(hw_compat_2_8); =20 -GlobalProperty hw_compat_2_7[] =3D { - { "virtio-pci", "page-per-vq", "on" }, - { "virtio-serial-device", "emergency-write", "off" }, - { "ioapic", "version", "0x11" }, - { "intel-iommu", "x-buggy-eim", "true" }, - { "virtio-pci", "x-ignore-backend-features", "on" }, -}; -const size_t hw_compat_2_7_len =3D G_N_ELEMENTS(hw_compat_2_7); - MachineState *current_machine; =20 static char *machine_get_kernel(Object *obj, Error **errp) --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770908080; cv=none; d=zohomail.com; s=zohoarc; b=f0+8xcBMKPBlSu/kOB+Q5lAEbs7AfpVF8B6KoRp3X0LRdgwDBtNRzsKol5j45BYNv/fhHQy3rQPrTKW10ghEPA81eJpVWHh27QqP9li53DW0LkdoXtUM77Nle7ZBzSRBZa18EnylZSKB2jhE6ObKiCvgJIDFdtaLUOuhNaCV/zI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770908080; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zJbz9sfjacuujudUJwh17bT/zPXAUO3y3Cmg/O9D+sw=; b=X8bDcB3DOmxRVbmfSh3vM6d06CSViaVcUZANzGqz6hz3E4VP5cQrhIv4Yk88QofMM1buAYzGQY1+U4OZAzjJYFUh9MJjM2FaHee3yNPOWKXqAfSq7tGnBegtUlLgKmK6xwDzXGEeIgGuOpkK1Za3Bk/NXvNXzcw9TBm6eA5njoI= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770908080518947.6694055367407; Thu, 12 Feb 2026 06:54:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvI-0005no-HP; Thu, 12 Feb 2026 09:44:04 -0500 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 1vqXv6-0005Td-Pv for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXv4-0006Bt-B4 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:51 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-122--OvWcrXJM4W_yWu2Yw3Jtg-1; Thu, 12 Feb 2026 09:43:48 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-48070c21420so15035545e9.0 for ; Thu, 12 Feb 2026 06:43:48 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4834d7e50casm192826095e9.8.2026.02.12.06.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907429; 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=zJbz9sfjacuujudUJwh17bT/zPXAUO3y3Cmg/O9D+sw=; b=CC4EZXlap7WHROIeY1LhPXhozwLJd4k9AQMnSL6u5BoGHuuKIEy/a1oV3gUh/s9g2y0jxs +f5oJzXE0C0gde/r5131ed7TR4qnVrgCwmMKcTPGR9Dn7ij3PNoa7VrlqFKhhwd24J403o 0fYvbsicHf2EoqJSWdKI0fJIAqeHGFk= X-MC-Unique: -OvWcrXJM4W_yWu2Yw3Jtg-1 X-Mimecast-MFC-AGG-ID: -OvWcrXJM4W_yWu2Yw3Jtg_1770907427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907426; x=1771512226; 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=zJbz9sfjacuujudUJwh17bT/zPXAUO3y3Cmg/O9D+sw=; b=U5CSW0qEBNj1OFeetMTiwMtP9+mjDmhKiXRNsu9wxO35Zpo92Q4evSbccn9Vo9lfBq JY7jmRXhQ+x75YKuKUCQmACgF6AIsu0qLqjwkjQCIA1szcrTz2Wct1CrpFBzjHOSRVVd ULEjuCxCvQXqX9gZXIBAeBabb7SwAVf1ZFLUvO48VvtHMMBCMZ76/JlAo8KuuNIyuLki zUNmJR7tet15xkzotkv1+v2DW+5NKPiCPuQEJ7HZvW/TKd4YHLjZpLXKal5zvbjJIZmN lwcYGZDO1VAL0Lg0EAlH7Cu8pbAXIKn7KnUvEgezWOFjpPsFv82tWKIeCE5hMLN3fR9H BMmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907426; x=1771512226; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zJbz9sfjacuujudUJwh17bT/zPXAUO3y3Cmg/O9D+sw=; b=FxpPkY07r6RF/SEd6VXGMu6q0GhD2Du6WlGC7nVjxLyQL4niyuAmofBE/Ewn1shTgb dC39vqiakJglF9yEk/PU5h86ovPvtjJW57QWU//PnIWmQt8ujVzOo7ZbFIr23q+FViFg gB/QzVsSERUPTr6F6k0NZayEaUEK0RNkcURYPnCry7oHclKG8I5bX36Xczfd4sK1+MG1 iYGtJXAPoG+Z49gGnVGHMiDTMtFNkmCTLp/oRGnSXxA6LvdVWOaPHqProDSbu/jqdjC7 8QNQwjwv1iw6bQHhRcEn96XiO5J0QacK49T9a5yS607vE7DHR6mpBqTih7zy6wWWH9Tn 8kFw== X-Gm-Message-State: AOJu0YyUNGq++/xH/UxnwV89IavD7kbKpj42eWYzXxl+Xg8jJevSLY1f +RKQ9C/QSwthNrkUlkWPSrg3kEJbzuqU+cS54rH8fhQ7IwsuqeRt9t6wXdvGvinnBwX674OBv01 1/DaVagJ4ezU9MQSvnHMnMeqhrpJf7YTBLorfnjVKCfQynULRykryWqH5BgqxRc2nwftUwEGwU0 tyQhl+FUlfD+8mEjQu3pyEEFPHH8l9A+56kMpDHECD X-Gm-Gg: AZuq6aIH5/rtSDNQVT3xJa/QdGMGbXdwfNdVe3283+3Ey/5fCyAq0NCd9PCTaNed9F5 QqY5KXg4KAMCuOCNuEeIikgttvXaJua3sQfgSlzzPbHw4SU/w2u+TTzvgoqVJhGQTbEKSnPut5f LF4OujqT2WRkB9P1mnaQzgPQOPGO7KroZxjaa9mOWuuqk/G1J1avols9nH6kDJZTwhCevqhoQEr ytFvjNgm1ICwSVJ8LN7vmQf/AeMqlfgDwL6HwHFBBbkwDBlTTg3bfZTBpxwghOowv4gcG0x1iyf RURIBWiRJWZmYEKSGqkcjA71YOeDCjP9p6UA6LOdoDuU3aCm0FZny1oZM4bM08i0t+LQ6AyxrkS OVKNqRFebN2Op8dbCcO3pf1UMQpzh8jbXiP/2E/LuEe/K11vOBdLmp9JvNJTK+lgHwmHLxkSqr5 633QGN9bY+U925JZf9TDD8a2M1kEFVuH8fPnv8c5f8QgURPbnDrpY= X-Received: by 2002:a05:600c:4f48:b0:47e:e2b8:66e6 with SMTP id 5b1f17b1804b1-48366031156mr38717875e9.14.1770907426195; Thu, 12 Feb 2026 06:43:46 -0800 (PST) X-Received: by 2002:a05:600c:4f48:b0:47e:e2b8:66e6 with SMTP id 5b1f17b1804b1-48366031156mr38717415e9.14.1770907425574; Thu, 12 Feb 2026 06:43:45 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Igor Mammedov , Zhao Liu Subject: [PULL 26/41] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field Date: Thu, 12 Feb 2026 15:42:28 +0100 Message-ID: <20260212144244.22579-27-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770908082406158500 From: Philippe Mathieu-Daud=C3=A9 The IntelIOMMUState::buggy_eim boolean was only set in the hw_compat_2_7[] array, via the 'x-buggy-eim=3Dtrue' property. We removed all machines using that array, lets remove that property, simplifying vtd_decide_config(). Reviewed-by: Mark Cave-Ayland Reviewed-by: Igor Mammedov Reviewed-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-26-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/i386/intel_iommu.h | 1 - hw/i386/intel_iommu.c | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h index d600e5495f5..54c2b6b77a0 100644 --- a/include/hw/i386/intel_iommu.h +++ b/include/hw/i386/intel_iommu.h @@ -313,7 +313,6 @@ struct IntelIOMMUState { uint32_t intr_size; /* Number of IR table entries */ bool intr_eime; /* Extended interrupt mode enabled */ OnOffAuto intr_eim; /* Toggle for EIM cabability */ - bool buggy_eim; /* Force buggy EIM unless eim=3Doff */ uint8_t aw_bits; /* Host/IOVA address width (in bits) */ bool dma_drain; /* Whether DMA r/w draining enabled */ bool pasid; /* Whether to support PASID */ diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index dd00079a406..92a367d6577 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -4180,7 +4180,6 @@ static const Property vtd_properties[] =3D { DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0), DEFINE_PROP_ON_OFF_AUTO("eim", IntelIOMMUState, intr_eim, ON_OFF_AUTO_AUTO), - DEFINE_PROP_BOOL("x-buggy-eim", IntelIOMMUState, buggy_eim, false), DEFINE_PROP_UINT8("aw-bits", IntelIOMMUState, aw_bits, VTD_HOST_ADDRESS_WIDTH), DEFINE_PROP_BOOL("caching-mode", IntelIOMMUState, caching_mode, FALSE), @@ -5539,11 +5538,11 @@ static bool vtd_decide_config(IntelIOMMUState *s, E= rror **errp) } =20 if (s->intr_eim =3D=3D ON_OFF_AUTO_AUTO) { - s->intr_eim =3D (kvm_irqchip_in_kernel() || s->buggy_eim) + s->intr_eim =3D kvm_irqchip_in_kernel() && x86_iommu_ir_supported(x86_iommu) ? ON_OFF_AUTO_ON : ON_OFF_AUTO= _OFF; } - if (s->intr_eim =3D=3D ON_OFF_AUTO_ON && !s->buggy_eim) { + if (s->intr_eim =3D=3D ON_OFF_AUTO_ON) { if (kvm_irqchip_is_split() && !kvm_enable_x2apic()) { error_setg(errp, "eim=3Don requires support on the KVM side" "(X2APIC_API, first shipped in v4.7)"); --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907816; cv=none; d=zohomail.com; s=zohoarc; b=c+Kai6kMvtGFzt1b63oMZDhiO9wPxSSK5TaGWrRj8FqwWxTDs/gm4Sj6kfYp6SIM9rBwDJWFjPg36/N3w7L95IGQL0sxcdpDCYbHgDBWWuUSdprp+CkM3Lf5ue8upZhpGXMLFAhaoqbmUlPZOEFqxuqeOKrY/C3RRfOpzYd+3sQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907816; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+kngmgvEBoYtSag4vTJFF8aM743+lT79utmLBi9cYQA=; b=aqD6DUbqVXeGh3n+HXELrIhNSGU3bb07xRjkxJ2R33FWAr3ncTcbAYAvS+RvB8v1TL6JfR8cV2GEwjWiyhA6ZV+MtwnHCe7aTqEULzqiUw0QGLEbm4oOZnLuJFCW+mKJ7KL7lgH3Ivxr9QnQ3xwVRCngjkzeZkvkDJmYZkYKEtA= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907816384634.9833977961118; Thu, 12 Feb 2026 06:50:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvS-0005yp-MW; Thu, 12 Feb 2026 09:44:14 -0500 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 1vqXv8-0005VB-9A for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXv6-0006CR-HQ for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:54 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-375--Bu183f8NY60BoDVSbq0WA-1; Thu, 12 Feb 2026 09:43:50 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4804157a3c9so57189765e9.1 for ; Thu, 12 Feb 2026 06:43:49 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43783e5c550sm13671917f8f.36.2026.02.12.06.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907431; 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=+kngmgvEBoYtSag4vTJFF8aM743+lT79utmLBi9cYQA=; b=apg5tju1p/9Mu8/8LW+H8cjLo8utkTpxCGdkZiiroiB/8rGCkmxMM9REmBoxdn/LprO6YY caPGxCi59colw/oKuyoXwBYAqKj+NNbhJi5GEE2NT1bgr01bWtvIFaFTeoZchE4b26ztOX hFsYnxTOapYjT6Qso7Uruherd+1NLzU= X-MC-Unique: -Bu183f8NY60BoDVSbq0WA-1 X-Mimecast-MFC-AGG-ID: -Bu183f8NY60BoDVSbq0WA_1770907429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907428; x=1771512228; 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=+kngmgvEBoYtSag4vTJFF8aM743+lT79utmLBi9cYQA=; b=RbQ81Yz1aBAiKextZDeeFn1k8+26g4fJF8asE66Pc2u6+Mjs/yl/wml1+Bp0l0Exoi AxOk1a/tj7oCcxFN0TEBZfD3SqbvoO/y41TQHY1dCTIb8ZPX94965RrcRT+0OR8K5fsq HeRvYg4vEgpxXBmkfQOBBSJTPCyuHCv4F1vPB9R+vnOgPQet0EHP7kbCg2KE7yM3E7Ac SlbpR/AlEzJwUijfaFPXCTYKbtf4X0TTnipUwFfP0aekjcS05P5ijsxiUEgjdSGTbEvv dk9uJRuRtzKzzf87cOVyohivbV3gT9Pc+qo34QwsxWNFDMW6CHner1PeY2c/+HQErxbA Fs3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907428; x=1771512228; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+kngmgvEBoYtSag4vTJFF8aM743+lT79utmLBi9cYQA=; b=EJwITgy2eyygk0z1/hkuRfGnnIRHZfZM3Nxube7sKlSkMUzqr72t8WOezJzN+MC0Bc H8rSasLxqh2Sr9NZXeH/Kd3CB+rwPL4dsLU2eOx4yh/Eo/qa23ugsaBnYvbguE339dvD X8wNJRRUwEknTXoq3Hyt3Qjfoh4lZHslA0+4k5kvQwbl9lYG4A1aJxX+f0t4nlkMSvsA dhg/0UKQmQ88d3MjFGDbtq8UIiqepsnooK0HWNRimX3gxbmzqtXwTFAxDNSaTuvqru7W P4MQBIsMRLXqFRpGXj1UmVMm6aiUKIL4lNQf0fmJ0wKi3P/hz9O5pqUvg/VwO9OYwCwY JG+w== X-Gm-Message-State: AOJu0YyOsDL1ghe8fw7vwlNCVajRUeRyMLb/pijWfEBzo35XGz5UTgo5 4Hf79dpXh2xkzdYb0qQKh4Fwu7KkYSG9Vsrfib5223vE85LObFfkZdriZRGRfjjKotBa/tLtlIk Y+w0B0RPoRWRb0PztgZNDWU5GIxvjDwcd+kLdxgb3u7w6Yj/sXV6SfawEBeZWMUdx9pwYGh9Wrb K5Wj5OY55F0rEtZ9EnwOELls5aAV+vViIOMNL08raP X-Gm-Gg: AZuq6aKINjEpekAqI6tSD+Wa0o6pvHSmuiESFXwp5xrXNW78aYFeanMnaTxTirCU8pE pJX1ux7DQp3eLaMLu4UvOFe1uETMY/JfgTLgIxAWyMbQBLAh4es22vwxn+/5HX163hAvDMfW/b8 cm0H9sVciHWHmCxNigci1dB2H1a2KXR8uH9zxjAYQ/zHTjudGc/iWSTXyfrv/R57ni9tJLOHl4o yAH1YII8S3OC0lcNMiu4RrHtcmdl3hU15hm9NJEDf9bG8WkHgVJWBxTYAROEri3FmZuoJ5g+tJK r1rix0aJk1dmBGFkBQdWznge+OoLytjHjxzWKn/K2trC/TjSUuN3xsub2RQEbeH1yWTpvDYbY/r vC7Je4HNh470+RMnwJjE2HjIU2xOKfkuMfMRs0GBgjgrDMYoG4jqoWrqFw/3ZXs3jfUd2TfQvkH PFd7IR027GTLtBE3z5xyLlxHzwHu9EA9C0aqh0uJL3bAEIhNRYrvM= X-Received: by 2002:a05:600c:8b2f:b0:47e:e48b:506d with SMTP id 5b1f17b1804b1-483656da45cmr49457505e9.16.1770907427603; Thu, 12 Feb 2026 06:43:47 -0800 (PST) X-Received: by 2002:a05:600c:8b2f:b0:47e:e48b:506d with SMTP id 5b1f17b1804b1-483656da45cmr49456565e9.16.1770907426867; Thu, 12 Feb 2026 06:43:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Igor Mammedov , Zhao Liu Subject: [PULL 27/41] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field Date: Thu, 12 Feb 2026 15:42:29 +0100 Message-ID: <20260212144244.22579-28-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907818449158500 From: Philippe Mathieu-Daud=C3=A9 The VirtIOPCIProxy::ignore_backend_features boolean was only set in the hw_compat_2_7[] array, via the 'x-ignore-backend-features=3Don' property. We removed all machines using that array, lets remove that property, simplify by only using the default version. Reviewed-by: Mark Cave-Ayland Reviewed-by: Igor Mammedov Reviewed-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-27-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/virtio/virtio-pci.h | 1 - hw/virtio/virtio-pci.c | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h index 639752977ee..581bb830b79 100644 --- a/include/hw/virtio/virtio-pci.h +++ b/include/hw/virtio/virtio-pci.h @@ -150,7 +150,6 @@ struct VirtIOPCIProxy { uint16_t last_pcie_cap_offset; uint32_t flags; bool disable_modern; - bool ignore_backend_features; OnOffAuto disable_legacy; /* Transitional device id */ uint16_t trans_devid; diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 1e8f90df34e..fe13a7a9503 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2040,8 +2040,7 @@ static void virtio_pci_device_plugged(DeviceState *d,= Error **errp) * Virtio capabilities present without * VIRTIO_F_VERSION_1 confuses guests */ - if (!proxy->ignore_backend_features && - !virtio_has_feature(vdev->host_features, VIRTIO_F_VERSION_1)) { + if (!virtio_has_feature(vdev->host_features, VIRTIO_F_VERSION_1)) { virtio_pci_disable_modern(proxy); =20 if (!legacy) { @@ -2443,8 +2442,6 @@ static const Property virtio_pci_properties[] =3D { VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT, false), DEFINE_PROP_BIT("page-per-vq", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT, false), - DEFINE_PROP_BOOL("x-ignore-backend-features", VirtIOPCIProxy, - ignore_backend_features, false), DEFINE_PROP_BIT("ats", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_ATS_BIT, false), DEFINE_PROP_BIT("x-ats-page-aligned", VirtIOPCIProxy, flags, --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907461; cv=none; d=zohomail.com; s=zohoarc; b=lbE2PSRmABJ+gKA11p4m2X1dVxBBQb36CwFlf/4qcN7KvR7a2kqOIFfX7+DoQjnOwVYztPhuTuky7yflPAZf93yZNftOWarorrJBaquKpZbhprupuWGial9c5NaQ8g0wEK4Um/NVI2AAu+6xy9OvCzoyvL446T7zZFtQwBnfRbg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907461; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wId+UDYcV0D4KMt0YhRwB30s7Fni+NsfRnUa5cYhF0Y=; b=ACMHLRRKBiEcwyXOFj8XKjytrrocRMd8/yk5DP9TDbV26iVLWshY9UbV3hU+CQ7AgFZs8EJOLxMnGmYlqYg5kxlTLch351/JGiro5Nu8poZvYPynm8g+E9iLN6BnLEd/jgmqubK52K1T5CNdMCwtpwmiAPenNTLg/xTZRkCzyIc= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907461542234.66932952437503; Thu, 12 Feb 2026 06:44:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvP-0005vf-I6; Thu, 12 Feb 2026 09:44:11 -0500 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 1vqXvA-0005VX-MB for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXv8-0006D1-W5 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:56 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-270-nXN_KXaCMuGbz_aU9G6ApA-1; Thu, 12 Feb 2026 09:43:52 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4806b12ad3fso78384675e9.0 for ; Thu, 12 Feb 2026 06:43:52 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835bc8736esm44919385e9.19.2026.02.12.06.43.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907434; 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=wId+UDYcV0D4KMt0YhRwB30s7Fni+NsfRnUa5cYhF0Y=; b=L/CkcMaiudFBXbMKlRNdmXOsLMuZEIuQWb9w3622DPPOHXmi//aK32Am958+qqltAHFdng ZpfIupRAGYQyrd8lauNJbBrW5JSkzgVABQGAKXPkMfE2TP/FHpsSyYPMdJ+nYSKBDokcVQ Dc7I6fHx1SAGEM4xzQ6eRWoVfV6T818= X-MC-Unique: nXN_KXaCMuGbz_aU9G6ApA-1 X-Mimecast-MFC-AGG-ID: nXN_KXaCMuGbz_aU9G6ApA_1770907432 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907431; x=1771512231; 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=wId+UDYcV0D4KMt0YhRwB30s7Fni+NsfRnUa5cYhF0Y=; b=pvwstBm41znt1iFQacCrsmyecCX3B2Eac8Tmr+MCG0xdNH7VDZMPbFZQVH/rHHpiFE 6ib2SU14mUhsU2HotJo+BhQqCERJHnkPgRp4vwBP+fwCcQlkzff9NX7RTmGG0sf0qriF PuH5ixD4HoPl4HB5USmRbBeyqYsU+4RhPPPq2kJOFoJbkUS4GfE5hfZA/unsfF7gB8kk E0YmuVP7REazScRDj4XC/P+0lBnyBhksWbuSeEZJkIYGFZGzrLE3BFAa0j8GpM6tSS4C vUSx96/0o4AhiykJBzYxEtR1S/0O6b5TlLntyDr0r+1CvejbKgNyH7PgCjWjRi0oNAgQ 6Ixg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907431; x=1771512231; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wId+UDYcV0D4KMt0YhRwB30s7Fni+NsfRnUa5cYhF0Y=; b=NHvH6tkCtF9kZMzqLR8jjXqEdvE45ArIESv6K4eV2aU727HfFDw8NXNsftclT7wTxr QH+W0/o1TIN71wbiW+hVn855qXCHRJadSmvcdNDDZpVy3dMVY1KqjNr+qxG7pQrfyaRp PQTuxBMMpT/S5oSRlr7Yuk9KrSx4ExA9ZmSSY9UDOVEmseCG9Q7r5JWc5H3Jsq3/8B/K 1IrvMe5xFbJkhU4cX/ruOthdIf9UeUvFJfxyhO2xhpCEUq4xKABPAbOiyqCQ3gTMj71b jkdOZp3cbKTviTCVFA3MZNk85MkKpTsuiAEuLUiLOdmBr96jagRyVhY6QwxJgkMedEFp eCzQ== X-Gm-Message-State: AOJu0YxUuyg5WFC5IZr7DryrLvEcsJ1le0VtemVubFiJN+vsnOY9Jf9p FOch6a/M8I7mbgGa/hNh6IUaSLEkfvYDrjTRLLsDAo5kekGuiQXl4lOGxN70p+2OGZ5r924AByy EAlEcyuYRKAzh3Lx+5XtpyP40GIvaCGQSgam3wewCMS1uNpY0tgKLdC+6RPM2URPRaxChEdrq7E 26warjwMZVRxy9fZN9T61ilV6rOvxE1bboE27Uowg6 X-Gm-Gg: AZuq6aLV+W9haeYV0++U695wWcwiX2b16pnqBMZtrSZSEg5rfPDP8lj/V+hsR6Pjigw 5GtFgzYS8GoxaAbMyAic3O72S1WKcfJbY6arlB6wVPTkHWeoS8x7SrfYfPqxCfKnDiTwzJg5Crl TbQPnPDpT2XxGyA/qC7jl6VZlpLJ6mDgSJrChmsrKm8/EdPJsnIivY4Eb12HCQdovb0za7dVP6t vwE2nTixlUXUTobpbqKVaYk8R2t+JPCYyw4n3K8J4dxWge74/SZWpO6XAAFABKbwMymWouhBIsd cQGUuVGlFwMkiccddDp7mJX/ax7c9Uj4Efuru3qvvjsFEzzBImopMlAv78BwqAcXb6IZn4ytfhr c7kxpXQpeXfrBUOJJ3BnsaXW/ZcZXWcc3kObSgSf69BpQmht7YEfeFmD7Z1cO/GyXba/cX4OLg6 ZUZ4/d3/XdqTKkd8p6HAwERwqx1NR5e0AbNXlVlcJc0Mtc0bj/Odg= X-Received: by 2002:a05:600c:c0c3:20b0:482:eec4:772 with SMTP id 5b1f17b1804b1-48365716447mr32737855e9.32.1770907430668; Thu, 12 Feb 2026 06:43:50 -0800 (PST) X-Received: by 2002:a05:600c:c0c3:20b0:482:eec4:772 with SMTP id 5b1f17b1804b1-48365716447mr32737335e9.32.1770907430103; Thu, 12 Feb 2026 06:43:50 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Zhao Liu , Igor Mammedov Subject: [PULL 28/41] hw/char/virtio-serial: Do not expose the 'emergency-write' property Date: Thu, 12 Feb 2026 15:42:30 +0100 Message-ID: <20260212144244.22579-29-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907463094154100 From: Philippe Mathieu-Daud=C3=A9 The VIRTIO_CONSOLE_F_EMERG_WRITE feature bit was only set in the hw_compat_2_7[] array, via the 'emergency-write=3Doff' property. We removed all machines using that array, lets remove that property. All instances have this feature bit set and it can not be disabled. VirtIOSerial::host_features mask is now unused, remove it. Reviewed-by: Mark Cave-Ayland Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20260108033051.777361-28-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/virtio/virtio-serial.h | 2 -- hw/char/virtio-serial-bus.c | 9 +++------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-s= erial.h index 60641860bf8..da0c91e1a40 100644 --- a/include/hw/virtio/virtio-serial.h +++ b/include/hw/virtio/virtio-serial.h @@ -186,8 +186,6 @@ struct VirtIOSerial { struct VirtIOSerialPostLoad *post_load; =20 virtio_serial_conf serial; - - uint64_t host_features; }; =20 /* Interface to the virtio-serial bus */ diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index 5ec5f5313b2..b7c57ea9678 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -557,7 +557,7 @@ static uint64_t get_features(VirtIODevice *vdev, uint64= _t features, =20 vser =3D VIRTIO_SERIAL(vdev); =20 - features |=3D vser->host_features; + features |=3D BIT_ULL(VIRTIO_CONSOLE_F_EMERG_WRITE); if (vser->bus.max_nr_ports > 1) { virtio_add_feature(&features, VIRTIO_CONSOLE_F_MULTIPORT); } @@ -587,8 +587,7 @@ static void set_config(VirtIODevice *vdev, const uint8_= t *config_data) VirtIOSerialPortClass *vsc; uint8_t emerg_wr_lo; =20 - if (!virtio_has_feature(vser->host_features, - VIRTIO_CONSOLE_F_EMERG_WRITE) || !config->emerg_wr) { + if (!config->emerg_wr) { return; } =20 @@ -1040,7 +1039,7 @@ static void virtio_serial_device_realize(DeviceState = *dev, Error **errp) return; } =20 - if (!virtio_has_feature(vser->host_features, + if (!virtio_has_feature(vdev->host_features, VIRTIO_CONSOLE_F_EMERG_WRITE)) { config_size =3D offsetof(struct virtio_console_config, emerg_wr); } @@ -1156,8 +1155,6 @@ static const VMStateDescription vmstate_virtio_consol= e =3D { static const Property virtio_serial_properties[] =3D { DEFINE_PROP_UINT32("max_ports", VirtIOSerial, serial.max_virtserial_po= rts, 31), - DEFINE_PROP_BIT64("emergency-write", VirtIOSerial, host_features, - VIRTIO_CONSOLE_F_EMERG_WRITE, true), }; =20 static void virtio_serial_class_init(ObjectClass *klass, const void *data) --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907724; cv=none; d=zohomail.com; s=zohoarc; b=BNI2SLktok9aZFdGbeapOxetIAWXlti3t7xMnhlpu2ti8mR02+Cj4kZ4S/BtxQL2/g0KEjqq8VvVWM790t1no0O8+A3StKG9WQUs0/VgRWhMRcklNLUYacD/GrR1ehzvfDEvR0pTiLhVx34JkTbgydPaT0onrSvjS1F2Wd5PiKo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907724; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=F5C5V9mlyEYrUFXjVMKVGDiElN7K/7aJObqEFirrLrY=; b=TW+fjzIw/cSTbJzS3HZdBQGmO56dhEvUKwhotmjAIMNPRikeamTdZ4luLWpOIvSOieo2mTiueJBGR0zPu6MQmMtYOwpLoFMx6l5vwZJyUkx/Kmt1QXkxt+oY5RSrP+XNohqCSPr+ysO1bnRPz9OFbNXaqfIAlvubXiASRTr8nqI= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907724064604.779326693621; Thu, 12 Feb 2026 06:48:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvT-00061M-4i; Thu, 12 Feb 2026 09:44:15 -0500 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 1vqXvD-0005df-Va for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvA-0006DI-R8 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:43:59 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-22-eNIfxoBIPUyySskhtKw3-w-1; Thu, 12 Feb 2026 09:43:55 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-482d8e6e13aso58790365e9.3 for ; Thu, 12 Feb 2026 06:43:54 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835d989165sm157738145e9.2.2026.02.12.06.43.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F5C5V9mlyEYrUFXjVMKVGDiElN7K/7aJObqEFirrLrY=; b=OoeVw73P4FtSkO7Ocr5s3N7jffOplCltEqJrhNcXco7Q12Ibfg2DvVoduu2byEaQezBQKt h35UsTiPvsUNUb5Ypg4H8jgXGTKpFZLMIAI9DiH2fRo2v7AumAZ3DI+0BdE7OmC9nnD3MF cjmo1jLw9zALWna85EWo8g+rSRLqeoI= X-MC-Unique: eNIfxoBIPUyySskhtKw3-w-1 X-Mimecast-MFC-AGG-ID: eNIfxoBIPUyySskhtKw3-w_1770907434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907433; x=1771512233; 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=F5C5V9mlyEYrUFXjVMKVGDiElN7K/7aJObqEFirrLrY=; b=fuLGuZ4d6sjrU+ZxN2RrUoOFjneAOFTyjBIOJikoE8LQkC9SylW1Fat3HAFWZaeWj/ xpoNFHGpfL1MdDFOE/+mlFWQc6v2aVKeOaTCmWPHUf3oqa9eWZ1vA2KuCWWmuYG4pW/h YYV3xVy9Xbg8VMMSeGd1ac/3rYNXZ1qBWVEcgfwdAAPzUtekkct5jnEtpbzadCSQ8CVO UnnJcFfj3H2tnjm+bx/fmhnsBc5WPR8zcFe8G5hKcq5U1Mm3JqH4e+cXx4a2nn3iZudi draQ3DNC4Ia7fBlCA3RQsxO2MaAvZtL7HB09/9MZIN/co8/XnwawB6F/NcqwWwLy5tdF SfRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907433; x=1771512233; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=F5C5V9mlyEYrUFXjVMKVGDiElN7K/7aJObqEFirrLrY=; b=oqaCMId94dNFwnUdg5KVm0pAQZPa5nWeeexI3ucb8dZVmXSmxnrrzC4H4JPB7sGE3p tcfgHE2GxWi3vzPJSDOKZ5snA1YjBfGx6Vx8pnhSGXTfeR6/1vMv7FgT+JNw8SGk+WWZ 7x4uG6ElfMHkU7ZKrDfwt5VBwEbpOl6qaD1tNIcv+iAilXlcjllVXaBdtTGUuXOz7//8 k/brpxKbeFijBK4ouwZML8UXwh0ynuvjywgibbvo7zFQAUze7N182q5+tvdk7p7yCZzp 1QpVvtzpjdxBBobgL9hlQzXVlkFOzZt6f3mXoB7Nfpl1Ye8CXOqpW/tMv1ytgjdLdW3Q rykw== X-Gm-Message-State: AOJu0YzjHpzCRBue+hi40+8H9gfJcD6MgijNRe1JCbpGCCXL8brdowJH IfcT/5rOp1YYcJlmkNufovkEGIHGiWzrpkqBn7y/XuyLCsIbzZqOHahQE0743vZWNiVI0KDXVWN dW8Gcy8atOB1D2lDHrh43VWyzJT9KUkv1gaK+6kXL/Q7ycQJKKA4/qbSFr0tXD2ViiGdR1Hc/ZV x9Vb0uRuDSPaWLSY2OMe1zs13RzPYI0qEOVDzjXEyI X-Gm-Gg: AZuq6aLbQeDnxrJur1r54+OHmuJ9LI76iUhgMS+MFvCKND1BpINoBR2AeU7NU+CxT8p a3WiI8Vro9BitCc81EY0thSp+17cutRjIM2M5wGh0g4pfL2tNJZ7aHklR/qpNKLPE5RMsEIuqpK JAxc8b7Irv1qsPpPgAY8h0mp9s8zikDXF1KQKM4wf7gjnEYALe0vowVihHL+DtVlI0B5b/YpZ0R 8ZuGX4mL12RCOJmCdQuu1Sg7mJCoKukaquei/p/Xbv6rXeiIt9SATsBnq0s4UiFhURcVCcSJw+C Hnb5j+qtrjBQv++pgO7ibGBkOHn+mqHoeVFHc7i5AIs04FBcQv/qOcXO23/JqVLfX/tGqxZZZpD kjF6ru4G2FdGP6T0eX/fvZNo0dA401Tg8AiGXhrb+2QIjv6ixdj4nOFiwyASU9IJ6R15EF9IrNZ XSHkWW/R6MU5rfSG/Tcfw3get1/a+q5WAcWSJyuoRrpB8wBnCvFzk= X-Received: by 2002:a05:600c:a0c:b0:480:3a71:92b2 with SMTP id 5b1f17b1804b1-48365717d44mr41443555e9.26.1770907432943; Thu, 12 Feb 2026 06:43:52 -0800 (PST) X-Received: by 2002:a05:600c:a0c:b0:480:3a71:92b2 with SMTP id 5b1f17b1804b1-48365717d44mr41442975e9.26.1770907432400; Thu, 12 Feb 2026 06:43:52 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Aidan Khoury Subject: [PULL 29/41] i386/cpu: Fix incorrect initializer in Diamond Rapids definition Date: Thu, 12 Feb 2026 15:42:31 +0100 Message-ID: <20260212144244.22579-30-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907725211154100 Content-Type: text/plain; charset="utf-8" From: Aidan Khoury The new Diamond Rapids x86 cpu model definition that was added in 7a6dd8bde1 has an unexpected comma in the `.features[FEAT_VMX_EXIT_CTLS]` subobject initializer, causing the prior initialization to be overridden. For this reason `VMX_VM_EXIT_SAVE_DEBUG_CONTROLS | VMX_VM_EXIT_HOST_ADDR_SPACE_SIZE` is not included. Fix this by replacing the comma with the missing bitwise OR to properly combine all the flags into a single bitmask value. Fixes: 7a6dd8bde159 ("i386/cpu: Add CPU model for Diamond Rapids") Signed-off-by: Aidan Khoury --- target/i386/cpu.c | 2 +- roms/seabios-hppa | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 201c5d5c210..eaa01438c1b 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5579,7 +5579,7 @@ static const X86CPUDefinition builtin_x86_defs[] =3D { MSR_VMX_EPT_INVVPID_ALL_CONTEXT | MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS, .features[FEAT_VMX_EXIT_CTLS] =3D - VMX_VM_EXIT_SAVE_DEBUG_CONTROLS | VMX_VM_EXIT_HOST_ADDR_SPACE_= SIZE, + VMX_VM_EXIT_SAVE_DEBUG_CONTROLS | VMX_VM_EXIT_HOST_ADDR_SPACE_= SIZE | VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER | diff --git a/roms/seabios-hppa b/roms/seabios-hppa index b876684ec39..3391c580960 160000 --- a/roms/seabios-hppa +++ b/roms/seabios-hppa @@ -1 +1 @@ -Subproject commit b876684ec394856a8cc2523c57b3dc784dc119d4 +Subproject commit 3391c580960febcb9fa8f686f9666adaa462c349 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907460; cv=none; d=zohomail.com; s=zohoarc; b=jKf22wj1w5Nng/e9TEfyKiaueLsis4nZSHVu+6eEIn5of1XRPCRxINZNeG4cUz3f1ynyzf1b61Ij5NPnoyMrcr2YDcaT3iinXPwIi53kUCf9IzFwH6GvHFa9rETYCBXOa0o3VJv3BD4rUbo+E9jjMaNT+XNeJEds9Hp2tDXChKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907460; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UnAQ+JDnymETfg+WiYDLUt8ZapEKgk2VtyvzlE9mJ/M=; b=CPBJNYhYM/pBPvA4jjgktVSADvvV6g7KNNPDERHzqlhpCGSLfUN+ucpL3IGHzZnX04ZOskDh/I/eJpzLr/W2yPA5dpZDr9+HqZcXr1UZ1d86/CzEP0kZwSmQunVOlGnhAe3tp79q2jPPnt6j23LIidVEj0A0FftEXxEoNWOCUI0= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907460196815.0232698674514; Thu, 12 Feb 2026 06:44:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvJ-0005p4-83; Thu, 12 Feb 2026 09:44:05 -0500 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 1vqXvE-0005fK-A2 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvC-0006DU-HD for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:00 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-532-jst3qz-oOKGw_bwysf0dJA-1; Thu, 12 Feb 2026 09:43:56 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-480711d09f1so43114625e9.0 for ; Thu, 12 Feb 2026 06:43:56 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835a60ee40sm99570605e9.1.2026.02.12.06.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UnAQ+JDnymETfg+WiYDLUt8ZapEKgk2VtyvzlE9mJ/M=; b=GfxJDlvXiiDdjh6da8kaO5RqC6bLu4cGzPyhS8UNtDNcI34L5fOPBST4nWcaazHgt5PXDC QnUEhQJ7Ay3EvNHDaC0XkrE1hmOd7cTm2/iES/pvtWsIUe0YqDW5uJS9RP8D7D4U6RQdGg SRDhutCHq/Q+frxauYEcaS2N198mCe0= X-MC-Unique: jst3qz-oOKGw_bwysf0dJA-1 X-Mimecast-MFC-AGG-ID: jst3qz-oOKGw_bwysf0dJA_1770907435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907434; x=1771512234; 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=UnAQ+JDnymETfg+WiYDLUt8ZapEKgk2VtyvzlE9mJ/M=; b=bdNBEG/kXgO40HW8vMhekRQcvp4ayMokgxXxml/uZGiC/m8iVBQLkuV93oT7VltmNX M6xQR+D2roEbucQUMYNmPuMF5PBuoD4/PHGYxu49dDffFfVt6fgDxuwiKaZ7crTbdBHm VgWr3FX8GfAxD4JJVy5eXKuZm3+y82Zj2WilkPIkxmt9ge9TXpphY4j6oCBSsBh2CgFR DJ6hPQZ3M4ZCHiwpVLhbZKp/mm02NJWI2+Krtf3uLVhRMAYRwxFHiAblMH0we5pVt1vU XyGE6X87m0Tc0sYjYnJ0s0VOGrq8gVT9YVgPOXWLPdb4qkwLextNtuDJvt2EV4eGtKDj 2K+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907434; x=1771512234; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=UnAQ+JDnymETfg+WiYDLUt8ZapEKgk2VtyvzlE9mJ/M=; b=ZDDsjMS/5sLCFIp+oOoeFMCillV7Z9cxj7cj4HWAszuNeYTLddvZ6DwFGUnEKPFLqa H8BOHjoGdKv66Cms22wkyJ9Mtoc3NPgf8oUtLV1x5/kh/TjzCWSftSWOWreClOtdUMq5 KB4MuYRS+mbzXO9S5eGd1xsWhCwyXH8g5/Dl9dhnuvDrxX16YgsHevrh8o9sfKKoAVOT SJi626FQ+XnfVDnqGG2V+3uVab1Deg08GJp+62KvSJ3iNQoddkzTxxxvWZPIB+nwAKRH zU3WGNxEzTxNDto71xUCg5iYjeSdfT59JG08s2q5isYC7EQUIVsjlSwhdPtdyGCcT0gS 5blQ== X-Gm-Message-State: AOJu0YyUL9Xs1YHLMqLAmf5Z4IK7krO1VJbBdeVopopYg/0uJhOGsEm8 jhRQqKs5KLFJSY92cN5Q4wgvJNpqpYcf6Kpvy+3s/gZB6OhWbn8f5vjxWfmk+thksBXoKxKBx+F JD+Ibi3EfYyjq9DBlWWznExVB8ALG7GtlIuIBHogLZ2CY/7BkRXTJ+I8+Xi01NB23DdkqQ3w1lT I6IaZNIbVb+EiK/mcA4yiVC3VYwgjhdj4xQCTM/+Nd X-Gm-Gg: AZuq6aKG1a13BbN0jOuobyXOFMmMbW7nOI6wU7GnKRHGzIbVbMNq9UEA4iEg3qQArga xXSiH9e62xqVhYaQteEYRGG/vtrFJTnrU/zryOtgTaoK5lcJ5HppLX/P1n4GwwUc/ePCZRT2hDO WbRUa5Cv8v4czTKNdAXaWU+xQuHxKvqBR7bBWEudiIGLKKGtRbfrO4WKAx9VtMLOEMAypwRNKR3 v9ZwCh2QoIwyIsYydo9nW34MVynLr9CzSL8sMeDGjow5JuMcqRX5DWNO3SUVAqtIBW+LqdgDf1r 3nxdI4XPl/zfybCCYioSXcdVOqRT9feArkCHBtkzwBiURnYB+Wzx8lFAjEfqFqoO7ItLn++AB3x zIHZWT1P0//X9TQ53qNNR4UmYW0w9+Sq5YyPfJs8mM4oZ0mkd4ga3wKR11yCWBYLE1DqLXlUIsp lTyabKo9NIvBBb7HQwpgiZgDPVpQYAWEs4dxdaNO8f5CZ9euAb+ow= X-Received: by 2002:a05:600c:350f:b0:483:4807:210c with SMTP id 5b1f17b1804b1-4836715a2bcmr39802635e9.24.1770907434206; Thu, 12 Feb 2026 06:43:54 -0800 (PST) X-Received: by 2002:a05:600c:350f:b0:483:4807:210c with SMTP id 5b1f17b1804b1-4836715a2bcmr39802065e9.24.1770907433753; Thu, 12 Feb 2026 06:43:53 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Dongli Zhang , Xiaoyao Li , Zhao Liu , Dapeng Mi , Zide Chen Subject: [PULL 30/41] target/i386/kvm: set KVM_PMU_CAP_DISABLE if "-pmu" is configured Date: Thu, 12 Feb 2026 15:42:32 +0100 Message-ID: <20260212144244.22579-31-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907462587158500 Content-Type: text/plain; charset="utf-8" From: Dongli Zhang Although AMD PERFCORE and PerfMonV2 are removed when "-pmu" is configured, there is no way to fully disable KVM AMD PMU virtualization. Neither "-cpu host,-pmu" nor "-cpu EPYC" achieves this. As a result, the following message still appears in the VM dmesg: [ 0.263615] Performance Events: AMD PMU driver. However, the expected output should be: [ 0.596381] Performance Events: PMU not available due to virtualization,= using software events only. [ 0.600972] NMI watchdog: Perf NMI watchdog permanently disabled This occurs because AMD does not use any CPUID bit to indicate PMU availability. To address this, KVM_CAP_PMU_CAPABILITY is used to set KVM_PMU_CAP_DISABLE when "-pmu" is configured. Signed-off-by: Dongli Zhang Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu Reviewed-by: Dapeng Mi Reviewed-by: Zide Chen Link: https://lore.kernel.org/r/20260109075508.113097-2-dongli.zhang@oracle= .com Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 0c940d4b640..69748420fd6 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -178,6 +178,8 @@ static int has_triple_fault_event; =20 static bool has_msr_mcg_ext_ctl; =20 +static int pmu_cap; + static struct kvm_cpuid2 *cpuid_cache; static struct kvm_cpuid2 *hv_cpuid_cache; static struct kvm_msr_list *kvm_feature_msrs; @@ -2079,6 +2081,33 @@ full: =20 int kvm_arch_pre_create_vcpu(CPUState *cpu, Error **errp) { + static bool first =3D true; + int ret; + + if (first) { + first =3D false; + + /* + * Since Linux v5.18, KVM provides a VM-level capability to easily + * disable PMUs; however, QEMU has been providing PMU property per + * CPU since v1.6. In order to accommodate both, have to configure + * the VM-level capability here. + * + * KVM_PMU_CAP_DISABLE doesn't change the PMU + * behavior on Intel platform because current "pmu" property works + * as expected. + */ + if ((pmu_cap & KVM_PMU_CAP_DISABLE) && !X86_CPU(cpu)->enable_pmu) { + ret =3D kvm_vm_enable_cap(kvm_state, KVM_CAP_PMU_CAPABILITY, 0, + KVM_PMU_CAP_DISABLE); + if (ret < 0) { + error_setg_errno(errp, -ret, + "Failed to set KVM_PMU_CAP_DISABLE"); + return ret; + } + } + } + if (is_tdx_vm()) { return tdx_pre_create_vcpu(cpu, errp); } @@ -3390,6 +3419,8 @@ int kvm_arch_init(MachineState *ms, KVMState *s) } } =20 + pmu_cap =3D kvm_check_extension(s, KVM_CAP_PMU_CAPABILITY); + return 0; } =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907752; cv=none; d=zohomail.com; s=zohoarc; b=dGmY0ME4RWuL0mqP+x3WNjA99jlhU5B6CVz9whJ61EchrC7oNid4v9y2sV7hx/EcUBLsh4nAK+fdwKiQjsqEq8mhaNq+Q6y9l7Ls/Gs6UCx0VwSvL2OBaL2+7ksLE5yTJZtMwe5loBHjjoNrkFqsvFRrZMZXyM0CpUohP9paqgw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907752; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bcpWkpn50Ck93z02v0fM6JJavzwotApdJbS9F2TxzKM=; b=WqFRw4M07n6Qr0aeKcVDNrDlJ4Zd+qN/qH2jkCUjA/FEHk+27+2EQEEnYhUpmQ7njBFDHQWojFWaugka9BEStmVMtfhn6QS4tzCOn4uGgfPpyyM7ZlkjrvUajdupZBtKZTuQbuKuQubsAejBfTUQZcxVOuCX55sY2qw9hA5hodY= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907752042775.8817752155337; Thu, 12 Feb 2026 06:49:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvT-00061y-Lu; Thu, 12 Feb 2026 09:44:15 -0500 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 1vqXvH-0005lH-Lc for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvF-0006Es-UU for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:03 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-287-JVrkV2LkPUKX7hABqGz3_Q-1; Thu, 12 Feb 2026 09:43:59 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4836cd6dfe6so4553225e9.2 for ; Thu, 12 Feb 2026 06:43:59 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4834d82a4c4sm353885065e9.10.2026.02.12.06.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bcpWkpn50Ck93z02v0fM6JJavzwotApdJbS9F2TxzKM=; b=MQswgGd2vXI1eTqvdvOuRRsUBq8HvcvOYn1D765KHvzzCZfcZQ2F5ktDaOOd4Y2v+Gam4Z aOOc1Jf1jN964nUzj+ykzMkAWbqhF9F86kwA4qpUCqfKjJ3mpSujEzBQviTJ0lV02htk+v YpFNG7rV2w+GGlFtEUPDcv2OiYvvTZk= X-MC-Unique: JVrkV2LkPUKX7hABqGz3_Q-1 X-Mimecast-MFC-AGG-ID: JVrkV2LkPUKX7hABqGz3_Q_1770907439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907438; x=1771512238; 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=bcpWkpn50Ck93z02v0fM6JJavzwotApdJbS9F2TxzKM=; b=Cku+KMlf6UOQlSzDhjac61psCgb+CQbMWZGGyUtJjAYri1ZcNy69D2xMCW8Dg6k/X5 J+pgYUx53Lbc4TIPggthm0JiqCLxB1JZ7C7ZRtCnjQYFGUqsPS7YLsbB1kibZBwg2g/y t25VNdHNjYkDDQZ8L6WNEAuJkR1/DNCf5ZzyXpKPguvKQhejOauMaMxzwmFJgsF8VPdB mliwBD+W9+Hw2bqkQSPgT0TOARLQepeR/8Cz5/ls5rE+iaX7bEUDY56zQ5DHmtxG8PeB iJly2EcOq4dseTpwAXdxtwo5S7pgw75goX24foooFYo0z2ZxncMRfzH485yGPzEyHNKt ernQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907438; x=1771512238; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bcpWkpn50Ck93z02v0fM6JJavzwotApdJbS9F2TxzKM=; b=aBK2UB9rvKUh7n71QcDN4lKyJMMmx77dfERksrzoyEoylap3NjAm5qhqjFOYuX+ju6 ViiUnlHzW+n9SG7HWiZWS4q66mvSFxMhzcR3hV+XPPRaO8psOIpQGn/HB8NQQJc1QKK5 ls7AYcp05NSGksHwk1369eqUrO2op4mpbgv8lTNxDXgj8638lr7i/YKOdpTvgb4vtGI5 cHvtnvBJa3LIPFqLfOxjMuLbkt+GSuXITckM+KwJo6ojhf8xWGSmN2kAlx/6URtaGYAA oGLVGa4d7h/tbq5bvWmpBPXW2GFSIG88/N4l3lXUmURfNWcygzGCqUUZ0mnU9is/nVhQ oPDQ== X-Gm-Message-State: AOJu0Yz4t7onxeVrgjrt01hG8aqVbsLOSdyf05UW9eVdZkAgG6FvJEMJ s949QCp6X2SqB1dEs6eUnMQ7RMKcUJezZWi3b8nPOXY1R90cSI4SXjWWddt8VAzUJk2+oVoYtoe 6igUr5xedCfXeuaaa11Ey9yiITySEtLnluREfG72NtTRT9pnKLTthWHN6FcmCik+TSVu6wGbUPh a8LNIiVSir6qOdUcPBG9lRICftseezrdGHe4X/4NEU X-Gm-Gg: AZuq6aJDmCeymyK7noCoKFLJYhBGcMcdxUEyFB424ehDRnD66CIJ4uLJ7mvLo+vKAJ/ ZdHSCF1ZMNPCICQVIFUdV3CxdTB05nVEXRfltYsPuASxAK9FjkmfV/2eCEGC/W58zaQJKAOY1EA 8nk1jhpZcOwDo3Et7oY/JPkhMp4howoiXGzZfoivl0y10cEQ7Lmimv4jTf1S8oghSFvuKQBUmp9 GN0bqDdXb/Tkp5BSDSc2+fkmvXqj4UbIKJC1FlRZCeeoZRodmSlZWfH6dLTXxsFwz5H6YhHNAa+ RQuLKitStN15cLQjXARO8OT4hDPWeauf9Z51RnTaO4nB6P/chi/2lSszqGdYg2tJxNZXsIUtnnm W5xo/LypJKD7kp5ZfUD0TWGuEKVNyJBTMLCUyS67SJBfKciGc9B2NAr4RGq8MeZ58ebg1lSvgq9 +/O160uSLDndPFDHdOnWY9rP2nBWusQQuj4+7U7H04/ljFJazf0OA= X-Received: by 2002:a05:600c:3f1b:b0:482:ef72:5787 with SMTP id 5b1f17b1804b1-483656ae605mr38410175e9.1.1770907437668; Thu, 12 Feb 2026 06:43:57 -0800 (PST) X-Received: by 2002:a05:600c:3f1b:b0:482:ef72:5787 with SMTP id 5b1f17b1804b1-483656ae605mr38409695e9.1.1770907437101; Thu, 12 Feb 2026 06:43:57 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Dongli Zhang , Zhao Liu , Dapeng Mi , Zide Chen Subject: [PULL 31/41] target/i386/kvm: extract unrelated code out of kvm_x86_build_cpuid() Date: Thu, 12 Feb 2026 15:42:33 +0100 Message-ID: <20260212144244.22579-32-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907753727154100 Content-Type: text/plain; charset="utf-8" From: Dongli Zhang The initialization of 'has_architectural_pmu_version', 'num_architectural_pmu_gp_counters', and 'num_architectural_pmu_fixed_counters' is unrelated to the process of building the CPUID. Extract them out of kvm_x86_build_cpuid(). In addition, use cpuid_find_entry() instead of cpu_x86_cpuid(), because CPUID has already been filled at this stage. Signed-off-by: Dongli Zhang Reviewed-by: Zhao Liu Reviewed-by: Dapeng Mi Reviewed-by: Zide Chen Link: https://lore.kernel.org/r/20260109075508.113097-3-dongli.zhang@oracle= .com Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 62 ++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 69748420fd6..31e8ef87aab 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -1985,33 +1985,6 @@ uint32_t kvm_x86_build_cpuid(CPUX86State *env, struc= t kvm_cpuid_entry2 *entries, } } =20 - if (limit >=3D 0x0a) { - uint32_t eax, edx; - - cpu_x86_cpuid(env, 0x0a, 0, &eax, &unused, &unused, &edx); - - has_architectural_pmu_version =3D eax & 0xff; - if (has_architectural_pmu_version > 0) { - num_architectural_pmu_gp_counters =3D (eax & 0xff00) >> 8; - - /* Shouldn't be more than 32, since that's the number of bits - * available in EBX to tell us _which_ counters are available. - * Play it safe. - */ - if (num_architectural_pmu_gp_counters > MAX_GP_COUNTERS) { - num_architectural_pmu_gp_counters =3D MAX_GP_COUNTERS; - } - - if (has_architectural_pmu_version > 1) { - num_architectural_pmu_fixed_counters =3D edx & 0x1f; - - if (num_architectural_pmu_fixed_counters > MAX_FIXED_COUNT= ERS) { - num_architectural_pmu_fixed_counters =3D MAX_FIXED_COU= NTERS; - } - } - } - } - cpu_x86_cpuid(env, 0x80000000, 0, &limit, &unused, &unused, &unused); =20 for (i =3D 0x80000000; i <=3D limit; i++) { @@ -2115,6 +2088,39 @@ int kvm_arch_pre_create_vcpu(CPUState *cpu, Error **= errp) return 0; } =20 +static void kvm_init_pmu_info(struct kvm_cpuid2 *cpuid) +{ + struct kvm_cpuid_entry2 *c; + + c =3D cpuid_find_entry(cpuid, 0xa, 0); + + if (!c) { + return; + } + + has_architectural_pmu_version =3D c->eax & 0xff; + if (has_architectural_pmu_version > 0) { + num_architectural_pmu_gp_counters =3D (c->eax & 0xff00) >> 8; + + /* + * Shouldn't be more than 32, since that's the number of bits + * available in EBX to tell us _which_ counters are available. + * Play it safe. + */ + if (num_architectural_pmu_gp_counters > MAX_GP_COUNTERS) { + num_architectural_pmu_gp_counters =3D MAX_GP_COUNTERS; + } + + if (has_architectural_pmu_version > 1) { + num_architectural_pmu_fixed_counters =3D c->edx & 0x1f; + + if (num_architectural_pmu_fixed_counters > MAX_FIXED_COUNTERS)= { + num_architectural_pmu_fixed_counters =3D MAX_FIXED_COUNTER= S; + } + } + } +} + int kvm_arch_init_vcpu(CPUState *cs) { struct { @@ -2305,6 +2311,8 @@ int kvm_arch_init_vcpu(CPUState *cs) cpuid_i =3D kvm_x86_build_cpuid(env, cpuid_data.entries, cpuid_i); cpuid_data.cpuid.nent =3D cpuid_i; =20 + kvm_init_pmu_info(&cpuid_data.cpuid); + if (x86_cpu_family(env->cpuid_version) >=3D 6 && (env->features[FEAT_1_EDX] & (CPUID_MCE | CPUID_MCA)) =3D=3D (CPUID_MCE | CPUID_MCA)) { --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907964; cv=none; d=zohomail.com; s=zohoarc; b=VweGrIV8EZRYV/SVUhNASNKlqydtMxfjBatxFix24OlHVsdZRJqT3c+TXR7UeET1kkU+82uWreerbVtVaGaGq8IlQyZplE9mvBSRVe7h6D4aesSmDor+hjeVHWU45fcgptLvI+ii+P+Egp/bZStpasS0tnZ5m5N47VzzLenSiFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907964; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Oyw3iN4RWS1l74BvVt0dka4bgQPOIP1RWCHgcmGGEsI=; b=E3eMDdWdbYK8LPrt89jze0nB5M5a03KiqRVQRtuXBsMPCzcpY99JPnm4hBQrVpJvg0+a81xm92p+VdsQa/vtaOsk0TqPMq98YjaA99RVcI2C2PQFXmENftulI8rtO8zTuazWj+cKPYu+EuGS1+oAblXOFQTgyopk1ErsXMB5Swo= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907964892368.8695833064528; Thu, 12 Feb 2026 06:52:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvU-00064v-7G; Thu, 12 Feb 2026 09:44:16 -0500 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 1vqXvK-0005rC-7o for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:06 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvI-0006Fd-Er for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:05 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-473-Noa7-BAwNUijNRC2-rdDOw-1; Thu, 12 Feb 2026 09:44:02 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-48070c21420so15036885e9.0 for ; Thu, 12 Feb 2026 06:44:02 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835b958b6csm134434425e9.1.2026.02.12.06.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:43:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Oyw3iN4RWS1l74BvVt0dka4bgQPOIP1RWCHgcmGGEsI=; b=TLD1nKhIKpoQiJJzz+dVY6ZBXWEhYACVUsgkGA897mBFaFIN/fW8Ot7euMGLwSYsNcuM+H Ytc7+AQQSR9w7WJdKpW648yKMBCjNGUhd4jCm6JnMlIHL8YJSlSGLgUWYRYaBk2Ymru0mL bYocyvUii1QGzI0sqr0GqVGtYTMel18= X-MC-Unique: Noa7-BAwNUijNRC2-rdDOw-1 X-Mimecast-MFC-AGG-ID: Noa7-BAwNUijNRC2-rdDOw_1770907441 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907440; x=1771512240; 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=Oyw3iN4RWS1l74BvVt0dka4bgQPOIP1RWCHgcmGGEsI=; b=PONsv9bj8DwgwmgHnXhnFiJ7Je9zGQFzFdnq8HGZeVF9ijV7Q6tV5O7o8s5VrM7HHi +KE7/CNTpjaUib6reW5EPPKeWyEIAW44ts2NFmyn2vWzZxAqRC5BEXYh2tTdmvJtMq9R 5Hm9fKyug21usBrsldZ9dwQINfXBW5fozIGcOcYk2urcdjCU96jDL4RQyGynFsOLsitD QKY39bLR78oA/wtuLzQeC9oCGinpStrMzceEcQUWGx8LCY9aslBHjtDFuf+2SZH/+CAd xbPCBe2CRq7uTs99FENU82QteYUhieFWhSIJ88eQ4E8LLIkPfFTXICyNaHTakgPX6o+w r7UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907440; x=1771512240; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Oyw3iN4RWS1l74BvVt0dka4bgQPOIP1RWCHgcmGGEsI=; b=DjYoog4CTfnrLdgSaFxuFmBUSYX4Ui/7YGY8pTDka/KxMaK+Ewa79bE06QF4He3jGI 3IBMa+2WR/xbwtiW4TLh2+XptF/swQgYa6ww11pzcJ431rM9/0QyciKDIMJUWkUD6di1 3CIYA7+/MNAZ4wEgi+p/ysWBL1NpMHC3tOVq8E1rcNlfoElJQi4l8b9yAkEEn7UaHNCY lIFb2bUlIlqhDSFgQMEcxm9XCMpXABpmNH6+qGJv2syzuxcpGlcWxtJT+FT+iM2PzKMA 4fgQoINDulLrcr2SWGS4lVObE+VPENNCmIS2+NQTlCxo1odhxOOtMk6a/rmyoGl6jFEx jq3Q== X-Gm-Message-State: AOJu0Yx5jqzRDeHHTUX3djyb97yUR/nHDhIv4s1+7kgnqOsjVMvXazwe mL/kinOZDvzerDyKAIelE4BJalkoayu59a10rGlzCmD6u0J7q0C9ojrbhw0W4hULLp6KJ0YivDf z6tSV2XSRDR7aIqUHTYhbWBeEPPfsSx+sOVi19ypBKuKzQ0KkytTSpADdDnb3ul9Mfvsow3l4FR uSlRxKq6KQq9zu2ZVYwQ0gwlkeprP8EiGvgTGWQRrt X-Gm-Gg: AZuq6aIUiVFS3DZl5v3EJzIZNQDTnhhG8vs9xhVUAT1L2c10NlzePIw69MiaSufGggV 34lxqYmzExWPa05jbiHIri9VTzhhYnI9eTic0U7FZr37qv2PgfGe3E98HNvkqri8sD7sSKio4K/ VZ9WpXfbp5fZyfMuAUcpRZ+7wWD9f1l2qtGiYO/7ajGlkE+5SJu3By6dAv83gyvDdj59OhsMhdr /M0TkHeNSsI22cOZElpVhLTxv+xeWu43bw/63KSEjvVKbLahbZQHg9cCUFpktanaibhNb5zm30K 0zSvWHCFZYtifrhu/7puSahXrrKlNkm2ji6nTPTjoZ6Fs+oXayKwtWeD3jFPEYWWxBEs7e+mTWk Wo9Pfc693iMXO4elnj3W/SYRRTiTJQb4hFWWh6w2iXpuyZ28P7mIsCEIRICpfknsBRvbNjplbm6 tlxY3hisY+Yc9fGNsXX1fcUhVbGyAxQUvM1CJffXYNZ9TaJNzOCdg= X-Received: by 2002:a05:600c:896:b0:47e:e051:79ee with SMTP id 5b1f17b1804b1-48365fdec0dmr29466305e9.3.1770907439915; Thu, 12 Feb 2026 06:43:59 -0800 (PST) X-Received: by 2002:a05:600c:896:b0:47e:e051:79ee with SMTP id 5b1f17b1804b1-48365fdec0dmr29465795e9.3.1770907439327; Thu, 12 Feb 2026 06:43:59 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Dongli Zhang , Dapeng Mi , Zhao Liu , Sandipan Das , Zide Chen Subject: [PULL 32/41] target/i386/kvm: rename architectural PMU variables Date: Thu, 12 Feb 2026 15:42:34 +0100 Message-ID: <20260212144244.22579-33-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907967097154100 Content-Type: text/plain; charset="utf-8" From: Dongli Zhang AMD does not have what is commonly referred to as an architectural PMU. Therefore, we need to rename the following variables to be applicable for both Intel and AMD: - has_architectural_pmu_version - num_architectural_pmu_gp_counters - num_architectural_pmu_fixed_counters For Intel processors, the meaning of pmu_version remains unchanged. For AMD processors: pmu_version =3D=3D 1 corresponds to versions before AMD PerfMonV2. pmu_version =3D=3D 2 corresponds to AMD PerfMonV2. Signed-off-by: Dongli Zhang Reviewed-by: Dapeng Mi Reviewed-by: Zhao Liu Reviewed-by: Sandipan Das Reviewed-by: Zide Chen Link: https://lore.kernel.org/r/20260109075508.113097-4-dongli.zhang@oracle= .com Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 49 ++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 31e8ef87aab..8faba7e471e 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -166,9 +166,16 @@ static bool has_msr_perf_capabs; static bool has_msr_pkrs; static bool has_msr_hwcr; =20 -static uint32_t has_architectural_pmu_version; -static uint32_t num_architectural_pmu_gp_counters; -static uint32_t num_architectural_pmu_fixed_counters; +/* + * For Intel processors, the meaning is the architectural PMU version + * number. + * + * For AMD processors: 1 corresponds to the prior versions, and 2 + * corresponds to AMD PerfMonV2. + */ +static uint32_t pmu_version; +static uint32_t num_pmu_gp_counters; +static uint32_t num_pmu_fixed_counters; =20 static int has_xsave2; static int has_xcrs; @@ -2098,24 +2105,24 @@ static void kvm_init_pmu_info(struct kvm_cpuid2 *cp= uid) return; } =20 - has_architectural_pmu_version =3D c->eax & 0xff; - if (has_architectural_pmu_version > 0) { - num_architectural_pmu_gp_counters =3D (c->eax & 0xff00) >> 8; + pmu_version =3D c->eax & 0xff; + if (pmu_version > 0) { + num_pmu_gp_counters =3D (c->eax & 0xff00) >> 8; =20 /* * Shouldn't be more than 32, since that's the number of bits * available in EBX to tell us _which_ counters are available. * Play it safe. */ - if (num_architectural_pmu_gp_counters > MAX_GP_COUNTERS) { - num_architectural_pmu_gp_counters =3D MAX_GP_COUNTERS; + if (num_pmu_gp_counters > MAX_GP_COUNTERS) { + num_pmu_gp_counters =3D MAX_GP_COUNTERS; } =20 - if (has_architectural_pmu_version > 1) { - num_architectural_pmu_fixed_counters =3D c->edx & 0x1f; + if (pmu_version > 1) { + num_pmu_fixed_counters =3D c->edx & 0x1f; =20 - if (num_architectural_pmu_fixed_counters > MAX_FIXED_COUNTERS)= { - num_architectural_pmu_fixed_counters =3D MAX_FIXED_COUNTER= S; + if (num_pmu_fixed_counters > MAX_FIXED_COUNTERS) { + num_pmu_fixed_counters =3D MAX_FIXED_COUNTERS; } } } @@ -4086,25 +4093,25 @@ static int kvm_put_msrs(X86CPU *cpu, KvmPutState le= vel) kvm_msr_entry_add(cpu, MSR_KVM_POLL_CONTROL, env->poll_control= _msr); } =20 - if (has_architectural_pmu_version > 0) { - if (has_architectural_pmu_version > 1) { + if (pmu_version > 0) { + if (pmu_version > 1) { /* Stop the counter. */ kvm_msr_entry_add(cpu, MSR_CORE_PERF_FIXED_CTR_CTRL, 0); kvm_msr_entry_add(cpu, MSR_CORE_PERF_GLOBAL_CTRL, 0); } =20 /* Set the counter values. */ - for (i =3D 0; i < num_architectural_pmu_fixed_counters; i++) { + for (i =3D 0; i < num_pmu_fixed_counters; i++) { kvm_msr_entry_add(cpu, MSR_CORE_PERF_FIXED_CTR0 + i, env->msr_fixed_counters[i]); } - for (i =3D 0; i < num_architectural_pmu_gp_counters; i++) { + for (i =3D 0; i < num_pmu_gp_counters; i++) { kvm_msr_entry_add(cpu, MSR_P6_PERFCTR0 + i, env->msr_gp_counters[i]); kvm_msr_entry_add(cpu, MSR_P6_EVNTSEL0 + i, env->msr_gp_evtsel[i]); } - if (has_architectural_pmu_version > 1) { + if (pmu_version > 1) { kvm_msr_entry_add(cpu, MSR_CORE_PERF_GLOBAL_STATUS, env->msr_global_status); kvm_msr_entry_add(cpu, MSR_CORE_PERF_GLOBAL_OVF_CTRL, @@ -4621,17 +4628,17 @@ static int kvm_get_msrs(X86CPU *cpu) if (env->features[FEAT_KVM] & CPUID_KVM_POLL_CONTROL) { kvm_msr_entry_add(cpu, MSR_KVM_POLL_CONTROL, 1); } - if (has_architectural_pmu_version > 0) { - if (has_architectural_pmu_version > 1) { + if (pmu_version > 0) { + if (pmu_version > 1) { kvm_msr_entry_add(cpu, MSR_CORE_PERF_FIXED_CTR_CTRL, 0); kvm_msr_entry_add(cpu, MSR_CORE_PERF_GLOBAL_CTRL, 0); kvm_msr_entry_add(cpu, MSR_CORE_PERF_GLOBAL_STATUS, 0); kvm_msr_entry_add(cpu, MSR_CORE_PERF_GLOBAL_OVF_CTRL, 0); } - for (i =3D 0; i < num_architectural_pmu_fixed_counters; i++) { + for (i =3D 0; i < num_pmu_fixed_counters; i++) { kvm_msr_entry_add(cpu, MSR_CORE_PERF_FIXED_CTR0 + i, 0); } - for (i =3D 0; i < num_architectural_pmu_gp_counters; i++) { + for (i =3D 0; i < num_pmu_gp_counters; i++) { kvm_msr_entry_add(cpu, MSR_P6_PERFCTR0 + i, 0); kvm_msr_entry_add(cpu, MSR_P6_EVNTSEL0 + i, 0); } --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907835; cv=none; d=zohomail.com; s=zohoarc; b=nSSxpoTSz8DKQX8uFUrA0hvBqm3IC18Y1an235HsGQZFKiFiOB5gaoEhnMLg740qmgXPiW5R7X9JoKuhizphathjgej9nNeLTDcJmJBm1C7YbYg4fgPK3mCj5hU2yTWiN96Jy/BUsG+o3MTQscU7Rd4ORFnfLthQKODZ0ieqg4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907835; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=819F/zJSma8yNTF8JsRD8z0SEcfHEtbcMUCeyum8ozo=; b=T5NY2dD2K+aN+AHYEFJMM2EIBJ9cE1QyJ89lyr3cv5DJUgXeopKCevm9bhz2nWe4l9lr5XsWh8psnmzCcfnZF8gnwstcgb5CX5YVRjD3fd1NyYsbDZrS+x1aCu4MttJavoSwz38YItgz6hMfD3yZ3FUrplW12jdzldBf65kvrLU= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907835043682.801262825634; Thu, 12 Feb 2026 06:50:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvl-0006uA-IV; Thu, 12 Feb 2026 09:44:33 -0500 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 1vqXvU-00066p-Sw for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvS-0006H9-Gc for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:16 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-228-yRNGo4JwPgGwaZtbRHkyEg-1; Thu, 12 Feb 2026 09:44:03 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4836e35292cso2661415e9.1 for ; Thu, 12 Feb 2026 06:44:03 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4834d8334a8sm204725265e9.12.2026.02.12.06.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:44:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=819F/zJSma8yNTF8JsRD8z0SEcfHEtbcMUCeyum8ozo=; b=bfbqkSc/9xrmFSSykAIi9biTnFgMBv1nt7H6dsEOyhLD4U9jCsSSCHWMj6sscN5TTBQaLN lcazT1xwce740v2JAcH+FmWvozDd5DsTb2ROgEzF76msAPDPHGXFCUnAZqsrxyiPVsXhDg WqtW9aFEKnN4t52GcZFYSiAbJQnrwAU= X-MC-Unique: yRNGo4JwPgGwaZtbRHkyEg-1 X-Mimecast-MFC-AGG-ID: yRNGo4JwPgGwaZtbRHkyEg_1770907442 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907441; x=1771512241; 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=819F/zJSma8yNTF8JsRD8z0SEcfHEtbcMUCeyum8ozo=; b=KM1rGL9nBhbV32ukjLR5peTAVAIsMkYbBXX0y3Z4GOty4uKpLnmhmroGk7bA2LdBnm jERo56sxpLlXKiAPj+dSwKiy0jQ8c9L7ZDvUV6zf/3HvAWC/TB6kGOsG4zjgYopJJEws d/IK05X835A6alVJKO8u0bu+gc934eZ1Us4QEAg8ZpcgGTQPn6mWG+7sXsR1yavzB5fO B+oyGqgPrYpU1mo4tmBVZ+vim2hrVFtzR1cCAwlZplk9n23UqUd+whpDFqX6M0/WwUb2 2QqTBNKZry3cwGb8fsOh9GLjwRGSgY0F3hTiyu2uLcRsNaa94sCko5p2xAw8Hx7tSZje 9zIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907441; x=1771512241; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=819F/zJSma8yNTF8JsRD8z0SEcfHEtbcMUCeyum8ozo=; b=aRqpL4zrJMS2cPiAN76m77clu88Upa4V4JMt9iC1NY9626VjO5E5lFF2eDYSVHOOVb 7mhokFtXzcChhtCIAlcx6P30nzyUAUEpv2bMUVc06ZhLXRWjpdzAQ18Y7xAx1jA3uAVa bE7c7eneQKlfYhHg+giiXnoCMhbtVw4+ib97vMZJtMSNWZPdYnJ+F0PSlcRrP0HzFEKw rFieh5jUFD3KBj4opgVFgqZziVqSWreoX6qAOEsxeE00sgGof6ztP8HVJPWzTArVSflf Xd85IN2tbo2wa3V5ayvwWYsGpmLdpVWreDwErpHze6xihLbyZJ5FO2dsO62vTYXcOzNO NkLA== X-Gm-Message-State: AOJu0Yys3FObmH9IVuhSX+BvecwIyupgYPvmSjVIgC4iD7bbNW29k6Kf d/nP8BKVfb5nDH9gzIGxLt3hcdWsNO3IGnQ/DelXguF9XokKahRFITuuT2ggQ78VaogkbugXoze r9kpHLJNA0ZjEwhzSzZoxuQf3oJtO4BLi+twe8kky3VaOHTVfhkyZN/IfKY1IaWlvqATTbgyTLs 7vAGIea5jcWUfMhYk0nNM3zuF439O5+LB2Z97h7upL X-Gm-Gg: AZuq6aJ6TywkhtIaz1nq8pScQL6V1ZWU05jBY+JkktQ9XFXA/qBx+AfEny5F9xspj6m Xypk/1i+5/1JpE7u/5Ml+7Y3Ed02ubL2HyMPUFEGCbVrSEIu1I/FEqPGyYiG/M1i2NLeEocfveB vhVyNO4KlWaj4Wnq8sv8O2fVLOSnP67mRKU6ztAQWN7tJN45NNhDY49rePy8csQ3QaZpB6V1fQ6 tMs9YrgFhri78GqAII4w2hGN5kb95BdTRZnSV3dPO/8LBKDygL249ZDEvKehXfZqNZjDgA7Uqda rasdGcg7bKrL6jwWJvrtOoRAJUp5AAJzSjyqfm1xH17Ecudvpo4YUCTv2nhVLf0Jrsd8Xivqa/b qbb5WRPmBqmCdVfyLumwzSCpoA7RoFchuVjOgTxw7/q4XBIsv1Gg8sObXP2nmu8Kl7VOcaWjZfz MDR4NzDjCPWiLnNVV8WY2Ob3FtxiMpMp84AVTgVdkpJldP5MVQOl4= X-Received: by 2002:a05:600c:a09:b0:483:47ae:7c00 with SMTP id 5b1f17b1804b1-4836570d0e7mr36033025e9.20.1770907441173; Thu, 12 Feb 2026 06:44:01 -0800 (PST) X-Received: by 2002:a05:600c:a09:b0:483:47ae:7c00 with SMTP id 5b1f17b1804b1-4836570d0e7mr36032495e9.20.1770907440600; Thu, 12 Feb 2026 06:44:00 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Dongli Zhang , Dapeng Mi , Zhao Liu Subject: [PULL 33/41] target/i386/kvm: reset AMD PMU registers during VM reset Date: Thu, 12 Feb 2026 15:42:35 +0100 Message-ID: <20260212144244.22579-34-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907837035154100 Content-Type: text/plain; charset="utf-8" From: Dongli Zhang QEMU uses the kvm_get_msrs() function to save Intel PMU registers from KVM and kvm_put_msrs() to restore them to KVM. However, there is no support for AMD PMU registers. Currently, pmu_version and num_pmu_gp_counters are initialized based on cpuid(0xa), which does not apply to AMD processors. For AMD CPUs, prior to PerfMonV2, the number of general-purpose registers is determined based on the CPU version. To address this issue, we need to add support for AMD PMU registers. Without this support, the following problems can arise: 1. If the VM is reset (e.g., via QEMU system_reset or VM kdump/kexec) while running "perf top", the PMU registers are not disabled properly. 2. Despite x86_cpu_reset() resetting many registers to zero, kvm_put_msrs() does not handle AMD PMU registers, causing some PMU events to remain enabled in KVM. 3. The KVM kvm_pmc_speculative_in_use() function consistently returns true, preventing the reclamation of these events. Consequently, the kvm_pmc->perf_event remains active. 4. After a reboot, the VM kernel may report the following error: [ 0.092011] Performance Events: Fam17h+ core perfctr, Broken BIOS detect= ed, complain to your hardware vendor. [ 0.092023] [Firmware Bug]: the BIOS has corrupted hw-PMU resources (MSR= c0010200 is 530076) 5. In the worst case, the active kvm_pmc->perf_event may inject unknown NMIs randomly into the VM kernel: [...] Uhhuh. NMI received for unknown reason 30 on CPU 0. To resolve these issues, we propose resetting AMD PMU registers during the VM reset process. Signed-off-by: Dongli Zhang Reviewed-by: Dapeng Mi Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20260109075508.113097-5-dongli.zhang@oracle= .com Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 12 +++ target/i386/kvm/kvm.c | 168 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 176 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index f2be42d7f65..cf02472fc79 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -506,6 +506,14 @@ typedef enum X86Seg { #define MSR_CORE_PERF_GLOBAL_CTRL 0x38f #define MSR_CORE_PERF_GLOBAL_OVF_CTRL 0x390 =20 +#define MSR_K7_EVNTSEL0 0xc0010000 +#define MSR_K7_PERFCTR0 0xc0010004 +#define MSR_F15H_PERF_CTL0 0xc0010200 +#define MSR_F15H_PERF_CTR0 0xc0010201 + +#define AMD64_NUM_COUNTERS 4 +#define AMD64_NUM_COUNTERS_CORE 6 + #define MSR_MC0_CTL 0x400 #define MSR_MC0_STATUS 0x401 #define MSR_MC0_ADDR 0x402 @@ -1737,6 +1745,10 @@ typedef struct { #endif =20 #define MAX_FIXED_COUNTERS 3 +/* + * This formula is based on Intel's MSR. The current size also meets AMD's + * needs. + */ #define MAX_GP_COUNTERS (MSR_IA32_PERF_STATUS - MSR_P6_EVNTSEL0) =20 #define NB_OPMASK_REGS 8 diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 8faba7e471e..7ebb96c66f2 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -2095,7 +2095,7 @@ int kvm_arch_pre_create_vcpu(CPUState *cpu, Error **e= rrp) return 0; } =20 -static void kvm_init_pmu_info(struct kvm_cpuid2 *cpuid) +static void kvm_init_pmu_info_intel(struct kvm_cpuid2 *cpuid) { struct kvm_cpuid_entry2 *c; =20 @@ -2128,6 +2128,89 @@ static void kvm_init_pmu_info(struct kvm_cpuid2 *cpu= id) } } =20 +static void kvm_init_pmu_info_amd(struct kvm_cpuid2 *cpuid, X86CPU *cpu) +{ + struct kvm_cpuid_entry2 *c; + int64_t family; + + family =3D object_property_get_int(OBJECT(cpu), "family", NULL); + if (family < 0) { + return; + } + + if (family < 6) { + error_report("AMD performance-monitoring is supported from " + "K7 and later"); + return; + } + + pmu_version =3D 1; + num_pmu_gp_counters =3D AMD64_NUM_COUNTERS; + + c =3D cpuid_find_entry(cpuid, 0x80000001, 0); + if (!c) { + return; + } + + if (!(c->ecx & CPUID_EXT3_PERFCORE)) { + return; + } + + num_pmu_gp_counters =3D AMD64_NUM_COUNTERS_CORE; +} + +static bool is_host_compat_vendor(CPUX86State *env) +{ + char host_vendor[CPUID_VENDOR_SZ + 1]; + + host_cpu_vendor_fms(host_vendor, NULL, NULL, NULL); + + /* + * Intel and Zhaoxin are compatible. + */ + if ((g_str_equal(host_vendor, CPUID_VENDOR_INTEL) || + g_str_equal(host_vendor, CPUID_VENDOR_ZHAOXIN1) || + g_str_equal(host_vendor, CPUID_VENDOR_ZHAOXIN2)) && + (IS_INTEL_CPU(env) || IS_ZHAOXIN_CPU(env))) { + return true; + } + + return g_str_equal(host_vendor, CPUID_VENDOR_AMD) && + IS_AMD_CPU(env); +} + +static void kvm_init_pmu_info(struct kvm_cpuid2 *cpuid, X86CPU *cpu) +{ + CPUX86State *env =3D &cpu->env; + + /* + * If KVM_CAP_PMU_CAPABILITY is not supported, there is no way to + * disable the AMD PMU virtualization. + * + * Assume the user is aware of this when !cpu->enable_pmu. AMD PMU + * registers are not going to reset, even they are still available to + * guest VM. + */ + if (!cpu->enable_pmu) { + return; + } + + /* + * It is not supported to virtualize AMD PMU registers on Intel + * processors, nor to virtualize Intel PMU registers on AMD processors. + */ + if (!is_host_compat_vendor(env)) { + error_report("host doesn't support requested feature: vPMU"); + return; + } + + if (IS_INTEL_CPU(env) || IS_ZHAOXIN_CPU(env)) { + kvm_init_pmu_info_intel(cpuid); + } else if (IS_AMD_CPU(env)) { + kvm_init_pmu_info_amd(cpuid, cpu); + } +} + int kvm_arch_init_vcpu(CPUState *cs) { struct { @@ -2318,7 +2401,7 @@ int kvm_arch_init_vcpu(CPUState *cs) cpuid_i =3D kvm_x86_build_cpuid(env, cpuid_data.entries, cpuid_i); cpuid_data.cpuid.nent =3D cpuid_i; =20 - kvm_init_pmu_info(&cpuid_data.cpuid); + kvm_init_pmu_info(&cpuid_data.cpuid, cpu); =20 if (x86_cpu_family(env->cpuid_version) >=3D 6 && (env->features[FEAT_1_EDX] & (CPUID_MCE | CPUID_MCA)) =3D=3D @@ -4093,7 +4176,7 @@ static int kvm_put_msrs(X86CPU *cpu, KvmPutState leve= l) kvm_msr_entry_add(cpu, MSR_KVM_POLL_CONTROL, env->poll_control= _msr); } =20 - if (pmu_version > 0) { + if ((IS_INTEL_CPU(env) || IS_ZHAOXIN_CPU(env)) && pmu_version > 0)= { if (pmu_version > 1) { /* Stop the counter. */ kvm_msr_entry_add(cpu, MSR_CORE_PERF_FIXED_CTR_CTRL, 0); @@ -4124,6 +4207,38 @@ static int kvm_put_msrs(X86CPU *cpu, KvmPutState lev= el) env->msr_global_ctrl); } } + + if (IS_AMD_CPU(env) && pmu_version > 0) { + uint32_t sel_base =3D MSR_K7_EVNTSEL0; + uint32_t ctr_base =3D MSR_K7_PERFCTR0; + /* + * The address of the next selector or counter register is + * obtained by incrementing the address of the current selector + * or counter register by one. + */ + uint32_t step =3D 1; + + /* + * When PERFCORE is enabled, AMD PMU uses a separate set of + * addresses for the selector and counter registers. + * Additionally, the address of the next selector or counter + * register is determined by incrementing the address of the + * current register by two. + */ + if (num_pmu_gp_counters =3D=3D AMD64_NUM_COUNTERS_CORE) { + sel_base =3D MSR_F15H_PERF_CTL0; + ctr_base =3D MSR_F15H_PERF_CTR0; + step =3D 2; + } + + for (i =3D 0; i < num_pmu_gp_counters; i++) { + kvm_msr_entry_add(cpu, ctr_base + i * step, + env->msr_gp_counters[i]); + kvm_msr_entry_add(cpu, sel_base + i * step, + env->msr_gp_evtsel[i]); + } + } + /* * Hyper-V partition-wide MSRs: to avoid clearing them on cpu hot-= add, * only sync them to KVM on the first cpu @@ -4628,7 +4743,8 @@ static int kvm_get_msrs(X86CPU *cpu) if (env->features[FEAT_KVM] & CPUID_KVM_POLL_CONTROL) { kvm_msr_entry_add(cpu, MSR_KVM_POLL_CONTROL, 1); } - if (pmu_version > 0) { + + if ((IS_INTEL_CPU(env) || IS_ZHAOXIN_CPU(env)) && pmu_version > 0) { if (pmu_version > 1) { kvm_msr_entry_add(cpu, MSR_CORE_PERF_FIXED_CTR_CTRL, 0); kvm_msr_entry_add(cpu, MSR_CORE_PERF_GLOBAL_CTRL, 0); @@ -4644,6 +4760,35 @@ static int kvm_get_msrs(X86CPU *cpu) } } =20 + if (IS_AMD_CPU(env) && pmu_version > 0) { + uint32_t sel_base =3D MSR_K7_EVNTSEL0; + uint32_t ctr_base =3D MSR_K7_PERFCTR0; + /* + * The address of the next selector or counter register is + * obtained by incrementing the address of the current selector + * or counter register by one. + */ + uint32_t step =3D 1; + + /* + * When PERFCORE is enabled, AMD PMU uses a separate set of + * addresses for the selector and counter registers. + * Additionally, the address of the next selector or counter + * register is determined by incrementing the address of the + * current register by two. + */ + if (num_pmu_gp_counters =3D=3D AMD64_NUM_COUNTERS_CORE) { + sel_base =3D MSR_F15H_PERF_CTL0; + ctr_base =3D MSR_F15H_PERF_CTR0; + step =3D 2; + } + + for (i =3D 0; i < num_pmu_gp_counters; i++) { + kvm_msr_entry_add(cpu, ctr_base + i * step, 0); + kvm_msr_entry_add(cpu, sel_base + i * step, 0); + } + } + if (env->mcg_cap) { kvm_msr_entry_add(cpu, MSR_MCG_STATUS, 0); kvm_msr_entry_add(cpu, MSR_MCG_CTL, 0); @@ -4974,6 +5119,21 @@ static int kvm_get_msrs(X86CPU *cpu) case MSR_P6_EVNTSEL0 ... MSR_P6_EVNTSEL0 + MAX_GP_COUNTERS - 1: env->msr_gp_evtsel[index - MSR_P6_EVNTSEL0] =3D msrs[i].data; break; + case MSR_K7_EVNTSEL0 ... MSR_K7_EVNTSEL0 + AMD64_NUM_COUNTERS - 1: + env->msr_gp_evtsel[index - MSR_K7_EVNTSEL0] =3D msrs[i].data; + break; + case MSR_K7_PERFCTR0 ... MSR_K7_PERFCTR0 + AMD64_NUM_COUNTERS - 1: + env->msr_gp_counters[index - MSR_K7_PERFCTR0] =3D msrs[i].data; + break; + case MSR_F15H_PERF_CTL0 ... + MSR_F15H_PERF_CTL0 + AMD64_NUM_COUNTERS_CORE * 2 - 1: + index =3D index - MSR_F15H_PERF_CTL0; + if (index & 0x1) { + env->msr_gp_counters[index] =3D msrs[i].data; + } else { + env->msr_gp_evtsel[index] =3D msrs[i].data; + } + break; case HV_X64_MSR_HYPERCALL: env->msr_hv_hypercall =3D msrs[i].data; break; --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907787; cv=none; d=zohomail.com; s=zohoarc; b=EXyg06qBBSNXWl4NY2tuJaOZifXLc6EI+tih6bB6Ps8uWD1PHQCBTo2OhH777qtX2FhaogKwn5UL1mF46RKYn0jGN6bulKKQxzJXDRp8Am56ocLqbL2dQUyn/9voS1Dw8PxHh6iB1mRoZqIIBK1MvXvSMOzrdCJkp54SVBgYHOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907787; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7MAK39Fchg9SvJj6pNbo856+vTQzOZL0gnweEU9gzss=; b=cA/Na3dqR/njN579xWHF6DzKbVBjohTml5LoC53VJIOT0c2/2Hvjf9prp/GrFSxgcgaCMjP8Xt5fsLFU4iNK+slNZLKB0AtShfe9wQj9bart3/ZHmLMGd3woBQfdGWKKmXaWJVrya4zbJHxi8JLNQBlhJDlxfiAOn7NzrqmuZ/A= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907787818464.36950362113066; Thu, 12 Feb 2026 06:49:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvS-00061B-Qg; Thu, 12 Feb 2026 09:44:14 -0500 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 1vqXvQ-0005wP-10 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvM-0006GE-Qj for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:11 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-674-n_WQBHmqO4-JgALnoIZP_A-1; Thu, 12 Feb 2026 09:44:06 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4831192e66aso70117345e9.2 for ; Thu, 12 Feb 2026 06:44:06 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835a5bf1efsm93529385e9.0.2026.02.12.06.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:44:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7MAK39Fchg9SvJj6pNbo856+vTQzOZL0gnweEU9gzss=; b=TockhLh80z38E9LfW+3TRcsnZVt6s5HTKpZBUllP7vRC9B2bTWhACld3nB14/DP3KF4ND4 9H0kyIG31+pVFAqYNboDVTP6JFkHeoPM09nGrv984e1k98L6Cum2wuvrSo6BM3AhALgz1c pZ4V1ja9d4xP/i7ovvnEBDH/09ZHGaA= X-MC-Unique: n_WQBHmqO4-JgALnoIZP_A-1 X-Mimecast-MFC-AGG-ID: n_WQBHmqO4-JgALnoIZP_A_1770907446 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907445; x=1771512245; 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=7MAK39Fchg9SvJj6pNbo856+vTQzOZL0gnweEU9gzss=; b=Kz9LV1NkkOwrORs/o1dBmb6JUDxPAotCCbHO6mZ24DJrX8Xqfr5AdxkhRvM8YRmKHq mPCkU+0osP1RgrsdKVh4niHpRjnQshAiwOrEc+bPHDzNjOGJJvdO2iuutIVuWkW9OQqJ jWZOa7O3/W9mh+3/27sFMZQ+txpA9/HcDZRh3Ji+5T2p42XxlhoAwbWe60P6VYSthTX/ L4yZ48APnBqXLdenDfOuq4PrWs8lXr6ssPPdhoDMRcBIIAUanMrlD94FAIgi2QNDKLNg SM0FVigCW0AIMhJGNmvQqbzrN3sXTxrKbUYph4QCPdBOKNVyfgsGwzhmRhIdYd+wiCJm Z21A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907445; x=1771512245; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7MAK39Fchg9SvJj6pNbo856+vTQzOZL0gnweEU9gzss=; b=HttJBcK3yHV5I76PO1OLBALjKC1J8lb0qAKCJNitYvK73rc5i/sSF1Uy+nuJBRSFC6 PZsyIncLjApCLSTbJUxQOwxRDOk4NGhJwLZoUBuL/bI0mS0JADfYxGX3jWfv+WkWi33a 8tjoKuCVer7yVRiuKRLC8vIdB8Hgm7GDtiLi3ee9iq6EJ+UAj1zUmPpHMdySoW3wutmy OPpUL7lXazCPJqLwSqak8BwzUh859zb1MqeOyJwl2yihRd1R9ZJDwU2vsYjoT41ynQ1o tA8p/tFWq3o5DzSbrCn9iyvJvudda0D7abIqf310O22R992DrdZXKo9tsLiYKyAkKL6Z Y2xg== X-Gm-Message-State: AOJu0YzAAihGA3ecUQa6sEFE4zetKvKW7CGZmO1uJ0VEBigjofw5DADE mxQRC15OWLrpaySJpRytdRdWGknMqkK2FllcHSvL8QMSolDJl3Dk5YLReg6FPWrUsK/mdpzp66T 94feBvnh4KZ6Mce13C8ck4qE8E+jFsenDlZY870bmcL5HZ1HazvCT0zJXYxa2P5pqiQ2XBwaUT5 BuW30NnsR7qbAUOuyjJo0p5Xs/TWThRto6unnYstGn X-Gm-Gg: AZuq6aJ41jr1sZe4Uw1yV3PKewoUUf8s8GKUgj3SLdNWB7ZbQ4Yp+l78ahCp2j7TET1 xJtzqLQWtFY2AJDbcPiKf0OMfKjNP0Uq0aSTyqQXaRmcUsbm0m4UjJSQJSBhK+JWkI+I1ukCkvm tsYbwC3XU3tjLDlqCTvg0fVuKnJgXjuajd0QasB8Q+6Z/4OOlQXMqiqFJDhaN2yR0Mcy5cDzsEK 2H98GTtuEJB+2NSXAO/rl4f1t/tWVYIJji553osk4WT8AzVPkrgw9ehoMXlotz4ZBpNOVzIGjzT L9SttXryG8xa71N4ZXMcVUGFk+D2ZOoUQHi9A6HZhXZymujmGfxcJlGKw0PQe0JBttFu5u75q6U wx2/GkZXHNqgiwUYzsN0I7ArJRKW941qF6SG8K9tOp1mqE4hvvEbJMLPoYZfNbplzKnOAKzktHv LsZtQKk23Gs5RdXQFbpHtffhQTfMggcl26PQqKiOTFV1y3iALPo7c= X-Received: by 2002:a05:600c:4e91:b0:483:ea6:8767 with SMTP id 5b1f17b1804b1-4836571fe86mr47862555e9.36.1770907444544; Thu, 12 Feb 2026 06:44:04 -0800 (PST) X-Received: by 2002:a05:600c:4e91:b0:483:ea6:8767 with SMTP id 5b1f17b1804b1-4836571fe86mr47861925e9.36.1770907443879; Thu, 12 Feb 2026 06:44:03 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Dongli Zhang , Zhao Liu , Sandipan Das , Zide Chen Subject: [PULL 34/41] target/i386/kvm: support perfmon-v2 for reset Date: Thu, 12 Feb 2026 15:42:36 +0100 Message-ID: <20260212144244.22579-35-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907788177158500 Content-Type: text/plain; charset="utf-8" From: Dongli Zhang Since perfmon-v2, the AMD PMU supports additional registers. This update includes get/put functionality for these extra registers. Similar to the implementation in KVM: - MSR_CORE_PERF_GLOBAL_STATUS and MSR_AMD64_PERF_CNTR_GLOBAL_STATUS both use env->msr_global_status. - MSR_CORE_PERF_GLOBAL_CTRL and MSR_AMD64_PERF_CNTR_GLOBAL_CTL both use env->msr_global_ctrl. - MSR_CORE_PERF_GLOBAL_OVF_CTRL and MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR both use env->msr_global_ovf_ctrl. No changes are needed for vmstate_msr_architectural_pmu or pmu_enable_needed(). Signed-off-by: Dongli Zhang Reviewed-by: Zhao Liu Reviewed-by: Sandipan Das Reviewed-by: Zide Chen Link: https://lore.kernel.org/r/20260109075508.113097-6-dongli.zhang@oracle= .com Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 4 ++++ target/i386/kvm/kvm.c | 48 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index cf02472fc79..9f222a0c9fe 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -506,6 +506,10 @@ typedef enum X86Seg { #define MSR_CORE_PERF_GLOBAL_CTRL 0x38f #define MSR_CORE_PERF_GLOBAL_OVF_CTRL 0x390 =20 +#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS 0xc0000300 +#define MSR_AMD64_PERF_CNTR_GLOBAL_CTL 0xc0000301 +#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR 0xc0000302 + #define MSR_K7_EVNTSEL0 0xc0010000 #define MSR_K7_PERFCTR0 0xc0010004 #define MSR_F15H_PERF_CTL0 0xc0010200 diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 7ebb96c66f2..9f1a4d4cbb2 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -2157,6 +2157,16 @@ static void kvm_init_pmu_info_amd(struct kvm_cpuid2 = *cpuid, X86CPU *cpu) } =20 num_pmu_gp_counters =3D AMD64_NUM_COUNTERS_CORE; + + c =3D cpuid_find_entry(cpuid, 0x80000022, 0); + if (c && (c->eax & CPUID_8000_0022_EAX_PERFMON_V2)) { + pmu_version =3D 2; + num_pmu_gp_counters =3D c->ebx & 0xf; + + if (num_pmu_gp_counters > MAX_GP_COUNTERS) { + num_pmu_gp_counters =3D MAX_GP_COUNTERS; + } + } } =20 static bool is_host_compat_vendor(CPUX86State *env) @@ -4219,13 +4229,14 @@ static int kvm_put_msrs(X86CPU *cpu, KvmPutState le= vel) uint32_t step =3D 1; =20 /* - * When PERFCORE is enabled, AMD PMU uses a separate set of - * addresses for the selector and counter registers. - * Additionally, the address of the next selector or counter - * register is determined by incrementing the address of the - * current register by two. + * When PERFCORE or PerfMonV2 is enabled, AMD PMU uses a + * separate set of addresses for the selector and counter + * registers. Additionally, the address of the next selector or + * counter register is determined by incrementing the address + * of the current register by two. */ - if (num_pmu_gp_counters =3D=3D AMD64_NUM_COUNTERS_CORE) { + if (num_pmu_gp_counters =3D=3D AMD64_NUM_COUNTERS_CORE || + pmu_version > 1) { sel_base =3D MSR_F15H_PERF_CTL0; ctr_base =3D MSR_F15H_PERF_CTR0; step =3D 2; @@ -4237,6 +4248,15 @@ static int kvm_put_msrs(X86CPU *cpu, KvmPutState lev= el) kvm_msr_entry_add(cpu, sel_base + i * step, env->msr_gp_evtsel[i]); } + + if (pmu_version > 1) { + kvm_msr_entry_add(cpu, MSR_AMD64_PERF_CNTR_GLOBAL_STATUS, + env->msr_global_status); + kvm_msr_entry_add(cpu, MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_C= LR, + env->msr_global_ovf_ctrl); + kvm_msr_entry_add(cpu, MSR_AMD64_PERF_CNTR_GLOBAL_CTL, + env->msr_global_ctrl); + } } =20 /* @@ -4771,13 +4791,14 @@ static int kvm_get_msrs(X86CPU *cpu) uint32_t step =3D 1; =20 /* - * When PERFCORE is enabled, AMD PMU uses a separate set of - * addresses for the selector and counter registers. + * When PERFCORE or PerfMonV2 is enabled, AMD PMU uses a separate + * set of addresses for the selector and counter registers. * Additionally, the address of the next selector or counter * register is determined by incrementing the address of the * current register by two. */ - if (num_pmu_gp_counters =3D=3D AMD64_NUM_COUNTERS_CORE) { + if (num_pmu_gp_counters =3D=3D AMD64_NUM_COUNTERS_CORE || + pmu_version > 1) { sel_base =3D MSR_F15H_PERF_CTL0; ctr_base =3D MSR_F15H_PERF_CTR0; step =3D 2; @@ -4787,6 +4808,12 @@ static int kvm_get_msrs(X86CPU *cpu) kvm_msr_entry_add(cpu, ctr_base + i * step, 0); kvm_msr_entry_add(cpu, sel_base + i * step, 0); } + + if (pmu_version > 1) { + kvm_msr_entry_add(cpu, MSR_AMD64_PERF_CNTR_GLOBAL_CTL, 0); + kvm_msr_entry_add(cpu, MSR_AMD64_PERF_CNTR_GLOBAL_STATUS, 0); + kvm_msr_entry_add(cpu, MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR, = 0); + } } =20 if (env->mcg_cap) { @@ -5102,12 +5129,15 @@ static int kvm_get_msrs(X86CPU *cpu) env->msr_fixed_ctr_ctrl =3D msrs[i].data; break; case MSR_CORE_PERF_GLOBAL_CTRL: + case MSR_AMD64_PERF_CNTR_GLOBAL_CTL: env->msr_global_ctrl =3D msrs[i].data; break; case MSR_CORE_PERF_GLOBAL_STATUS: + case MSR_AMD64_PERF_CNTR_GLOBAL_STATUS: env->msr_global_status =3D msrs[i].data; break; case MSR_CORE_PERF_GLOBAL_OVF_CTRL: + case MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR: env->msr_global_ovf_ctrl =3D msrs[i].data; break; case MSR_CORE_PERF_FIXED_CTR0 ... MSR_CORE_PERF_FIXED_CTR0 + MAX_F= IXED_COUNTERS - 1: --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907491; cv=none; d=zohomail.com; s=zohoarc; b=Wg3pCgzXn99Qz0wO8/Mpl/Cih0q5SP8a+aK/bby1AL4iVD+t0wpmxziRW7JmLS81iZtL18ZiF6RI3Un3pfpn8LS5qxjXwdYsYv6/+Sl3gUdCaLWWErufz7LA9Hbx0Rs/QiRYritInMHRRMEXApFlyhhsfgC9plT1WDVZ6+vYQ88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907491; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mBrt5ee4/fiILW9JEjenLshWan4+h+vd2E487X6J0ps=; b=cQMEwI/oq1GZNc1i68Kzln7LbSZjBjCDo/sy396faS9+vhI3oLv/7Jvd7N0unszOXiADnA83E0kcFo7fR39m+dYTRcEoNj0UUtXPYV1/zzadhd/9IvBfl1Kwe2OO04TzFe6vmVG7rUhdOMqkoT6ma+2TJ2VcfYu+FyHxR6xOcaY= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907491823139.0910801445333; Thu, 12 Feb 2026 06:44:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvT-00061O-7B; Thu, 12 Feb 2026 09:44:15 -0500 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 1vqXvR-0005y1-J0 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvP-0006Gb-3H for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:13 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-19-2HZLG-fwMYW90vlFMMeXdA-1; Thu, 12 Feb 2026 09:44:09 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4831192e66aso70117455e9.2 for ; Thu, 12 Feb 2026 06:44:08 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43783dfc2b0sm11941539f8f.21.2026.02.12.06.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:44:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mBrt5ee4/fiILW9JEjenLshWan4+h+vd2E487X6J0ps=; b=FbD1yivwWp7n7p1jAmDKjcKRwWjBmSdq1DJfEja2GvU1Nn8qma0cB+z54uq5ylEf3/BHfn e9AGrMZhvpKKUoslNtIS40NEWydTZuLUPU1l4Cweln0LNDENomaBFQZGC8lCfpqCoV0kRq /Ih+/glolwNFuaSAi/aeFDjXwLx1b14= X-MC-Unique: 2HZLG-fwMYW90vlFMMeXdA-1 X-Mimecast-MFC-AGG-ID: 2HZLG-fwMYW90vlFMMeXdA_1770907447 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907446; x=1771512246; 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=mBrt5ee4/fiILW9JEjenLshWan4+h+vd2E487X6J0ps=; b=LrvL3CvLgN5tUXXHB2BG0MfNlBHcSOaWj3fYBVHsY0kXN3jICX3eYlKPLAL+4Jday1 M15GuS2KK336KEZPo1QpvYDIrEGyKGBW7yj30z2IjP8dp6MsOkZV2xwCgpcSHXlB+n9f sJlHG2eBfuJMoc+JOsyVk+J0PrWry0/+g7xTpQxW58UnEo/7TkteTPCWpjCwRD31WB5y FwcMGZZJrVxEKS0cw3b2Ll6CVqcFEFpn5U8DeOoLqsAtW5hu56BLZbiBlRH0YhVSsswO WkrNL6nysqHENgu0C3q7nBbP9xxXGkRwSoG7G51fv0RbjaBmmUEaFIoqVofBa33VA1Kj GdJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907446; x=1771512246; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mBrt5ee4/fiILW9JEjenLshWan4+h+vd2E487X6J0ps=; b=YfQlcItsUAfO0IGg9fBjtpEJ1RMY0ASWSyhlNDzVg6gEFBHDA8evMffsfT9rIZTOCu mfDWrqkMBIUENynL6YvMgovle77PmuTfcKiIquq64m87X96JJSXk1f6iA+7EOe2Gs/jI DR3HWZi1mceQiIiSEw4Yi97Eis0T3gZwQp29X7nVz33fQm8f+L1UcT7dcZJlbg/Rni6g TAUOjPOia1yry3fgB5fcCB0xkdON5hNshK1iw7Qtx/mm59YsDr5azP2k2uZ1TXJl5wYW o1oUORSMS95jQPwbTEj6ph2XuxLMwBeF6eZkS0AoArVE87PLA9Y864c6nccLXHDWv1d8 KYJA== X-Gm-Message-State: AOJu0YwvKDGiA4O/jcmsWylFEuXAglhXM2b/Lg2+EN2UDfpn2lxQVKtr HIQl0zxMm1QWLxUZ6iiZVnUjU0jR9b8+/cW7kl7Yq3bj/60C82X6LfPiBI6zyZcd55DcY6c6Ao3 t9xigAvpcO6pGbC591udKaab+yVQHtVpkS3k6XeO2t4ppabjJq2CoTDnBAMRUDBCCNn77+6uO4s WhgJkMtcPGPmz2V9P4GODjWzkwdulHHCZ3lVmZy/7k X-Gm-Gg: AZuq6aIlBh00ZzgYirbdnFV5/pBxWMttxgkM0cFEa89/gFYbkmDQ/cid+MbjsRFalzE xALA4D3U/M7Na0Kclk3C7FMiiH79FOeN4K83NO/pcB3jqO18WpVqZ98QETBWwhlNOHlxHdrx5ka jBMyOi4kPGjHDW4OyxanB0veWGAXRhUSgxWcXfny693T8nZK5m2iFVj/ffuFK3H8Wkt7SiIDryJ C6RyXjn/VGDarxUobu9eywmf397Jo8ljim7SCu65gePooL9SUHf0leTnasrY6pEVjB4sFjhdq1W ElogmlnQ2gqf6TTFz/4uYiA5+IFnk8E+Uh1Xy9THnl/tAraB+3VmmCmeq/xpymHK5VNqJRtPFN7 gJmZtHXBauwi1LrW3Df95QSKbplsg5nupIZ5IkB9sOocMFAb0wSsY3eKy81x/N2mxjX25Zpnvd7 XJzNFmGnjj9rGoqMjnJy/V+L0fY0CtJqdOTnxnx8mKq8sw4GcWS6E= X-Received: by 2002:a05:600c:19c6:b0:480:1d0b:2d15 with SMTP id 5b1f17b1804b1-48365715e72mr47458615e9.27.1770907445698; Thu, 12 Feb 2026 06:44:05 -0800 (PST) X-Received: by 2002:a05:600c:19c6:b0:480:1d0b:2d15 with SMTP id 5b1f17b1804b1-48365715e72mr47457955e9.27.1770907445116; Thu, 12 Feb 2026 06:44:05 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Chandan Somani , Stefan Hajnoczi Subject: [PULL 35/41] qdev: Free property array on release Date: Thu, 12 Feb 2026 15:42:37 +0100 Message-ID: <20260212144244.22579-36-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907492682158500 Content-Type: text/plain; charset="utf-8" From: Chandan Somani Before this patch, users of the property array would free the array themselves in their cleanup functions. This causes inconsistencies where some users leak the array and some free them. This patch makes it so that the property array's release function frees the property array (instead of just its elements). It fixes any leaks and requires less code. DEFINE_PROP_ARRAY leakers that are fixed in this patch: ebpf-rss_fds in hw/net/virtio-net.c rnmi_irqvec, rnmi_excpvec in hw/riscv/riscv_hart.c common.display_modes in hw/display/apple-gfx-mmio.m common.display_modes in hw/display/apple-gfx-pci.m Signed-off-by: Chandan Somani Reviewed-by: Stefan Hajnoczi Link: https://lore.kernel.org/r/20260108230311.584141-2-csomani@redhat.com Signed-off-by: Paolo Bonzini --- block/accounting.c | 1 - hw/core/qdev-properties.c | 21 ++++++++++----------- hw/input/stellaris_gamepad.c | 8 -------- hw/intc/arm_gicv3_common.c | 8 -------- hw/intc/rx_icu.c | 8 -------- hw/misc/arm_sysctl.c | 2 -- hw/misc/mps2-scc.c | 8 -------- hw/net/rocker/rocker.c | 1 - hw/nvram/xlnx-efuse.c | 8 -------- hw/nvram/xlnx-versal-efuse-ctrl.c | 8 -------- hw/virtio/virtio-iommu-pci.c | 8 -------- 11 files changed, 10 insertions(+), 71 deletions(-) diff --git a/block/accounting.c b/block/accounting.c index 0933c61f3a2..5cf51f029b1 100644 --- a/block/accounting.c +++ b/block/accounting.c @@ -73,7 +73,6 @@ bool block_acct_setup(BlockAcctStats *stats, enum OnOffAu= to account_invalid, } block_acct_add_interval(stats, stats_intervals[i]); } - g_free(stats_intervals); } return true; } diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index c96ccfb2635..c2e3f0543fd 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -673,10 +673,8 @@ static Property array_elem_prop(Object *obj, const Pro= perty *parent_prop, =20 /* * Object property release callback for array properties: We call the - * underlying element's property release hook for each element. - * - * Note that it is the responsibility of the individual device's deinit - * to free the array proper. + * underlying element's property release hook for each element and free the + * property array. */ static void release_prop_array(Object *obj, const char *name, void *opaque) { @@ -686,15 +684,16 @@ static void release_prop_array(Object *obj, const cha= r *name, void *opaque) char *elem =3D *arrayptr; int i; =20 - if (!prop->arrayinfo->release) { - return; + if (prop->arrayinfo->release) { + for (i =3D 0; i < *alenptr; i++) { + Property elem_prop =3D array_elem_prop(obj, prop, name, elem); + prop->arrayinfo->release(obj, NULL, &elem_prop); + elem +=3D prop->arrayfieldsize; + } } =20 - for (i =3D 0; i < *alenptr; i++) { - Property elem_prop =3D array_elem_prop(obj, prop, name, elem); - prop->arrayinfo->release(obj, NULL, &elem_prop); - elem +=3D prop->arrayfieldsize; - } + g_clear_pointer(arrayptr, g_free); + *alenptr =3D 0; } =20 /* diff --git a/hw/input/stellaris_gamepad.c b/hw/input/stellaris_gamepad.c index f64f5ea9ce3..42d43f9af51 100644 --- a/hw/input/stellaris_gamepad.c +++ b/hw/input/stellaris_gamepad.c @@ -63,13 +63,6 @@ static void stellaris_gamepad_realize(DeviceState *dev, = Error **errp) qemu_input_handler_register(dev, &stellaris_gamepad_handler); } =20 -static void stellaris_gamepad_finalize(Object *obj) -{ - StellarisGamepad *s =3D STELLARIS_GAMEPAD(obj); - - g_free(s->keycodes); -} - static void stellaris_gamepad_reset_enter(Object *obj, ResetType type) { StellarisGamepad *s =3D STELLARIS_GAMEPAD(obj); @@ -98,7 +91,6 @@ static const TypeInfo stellaris_gamepad_info[] =3D { .name =3D TYPE_STELLARIS_GAMEPAD, .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(StellarisGamepad), - .instance_finalize =3D stellaris_gamepad_finalize, .class_init =3D stellaris_gamepad_class_init, }, }; diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index 0a2e5a3e2fc..e5f3c3c4473 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -488,13 +488,6 @@ static void arm_gicv3_common_realize(DeviceState *dev,= Error **errp) s->itslist =3D g_ptr_array_new(); } =20 -static void arm_gicv3_finalize(Object *obj) -{ - GICv3State *s =3D ARM_GICV3_COMMON(obj); - - g_free(s->redist_region_count); -} - static void arm_gicv3_common_reset_hold(Object *obj, ResetType type) { GICv3State *s =3D ARM_GICV3_COMMON(obj); @@ -644,7 +637,6 @@ static const TypeInfo arm_gicv3_common_type =3D { .instance_size =3D sizeof(GICv3State), .class_size =3D sizeof(ARMGICv3CommonClass), .class_init =3D arm_gicv3_common_class_init, - .instance_finalize =3D arm_gicv3_finalize, .abstract =3D true, .interfaces =3D (const InterfaceInfo[]) { { TYPE_ARM_LINUX_BOOT_IF }, diff --git a/hw/intc/rx_icu.c b/hw/intc/rx_icu.c index 87cdc6cbdef..992b069ae24 100644 --- a/hw/intc/rx_icu.c +++ b/hw/intc/rx_icu.c @@ -334,13 +334,6 @@ static void rxicu_init(Object *obj) sysbus_init_irq(d, &icu->_swi); } =20 -static void rxicu_fini(Object *obj) -{ - RXICUState *icu =3D RX_ICU(obj); - g_free(icu->map); - g_free(icu->init_sense); -} - static const VMStateDescription vmstate_rxicu =3D { .name =3D "rx-icu", .version_id =3D 1, @@ -382,7 +375,6 @@ static const TypeInfo rxicu_info =3D { .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(RXICUState), .instance_init =3D rxicu_init, - .instance_finalize =3D rxicu_fini, .class_init =3D rxicu_class_init, }; =20 diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c index 2a317ac7f5b..7b320f89c1f 100644 --- a/hw/misc/arm_sysctl.c +++ b/hw/misc/arm_sysctl.c @@ -618,9 +618,7 @@ static void arm_sysctl_finalize(Object *obj) { arm_sysctl_state *s =3D ARM_SYSCTL(obj); =20 - g_free(s->db_voltage); g_free(s->db_clock); - g_free(s->db_clock_reset); } =20 static const Property arm_sysctl_properties[] =3D { diff --git a/hw/misc/mps2-scc.c b/hw/misc/mps2-scc.c index 350bba3dab8..7877b31479c 100644 --- a/hw/misc/mps2-scc.c +++ b/hw/misc/mps2-scc.c @@ -405,13 +405,6 @@ static void mps2_scc_realize(DeviceState *dev, Error *= *errp) s->oscclk =3D g_new0(uint32_t, s->num_oscclk); } =20 -static void mps2_scc_finalize(Object *obj) -{ - MPS2SCC *s =3D MPS2_SCC(obj); - - g_free(s->oscclk_reset); -} - static bool cfg7_needed(void *opaque) { MPS2SCC *s =3D opaque; @@ -489,7 +482,6 @@ static const TypeInfo mps2_scc_info =3D { .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(MPS2SCC), .instance_init =3D mps2_scc_init, - .instance_finalize =3D mps2_scc_finalize, .class_init =3D mps2_scc_class_init, }; =20 diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 3eb7b445113..4a7056bd45e 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -1429,7 +1429,6 @@ static void pci_rocker_uninit(PCIDevice *dev) world_free(r->worlds[i]); } } - g_free(r->fp_ports_peers); } =20 static void rocker_reset(DeviceState *dev) diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c index 34436705dde..1a9650ba128 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -225,13 +225,6 @@ static void efuse_realize(DeviceState *dev, Error **er= rp) } } =20 -static void efuse_finalize(Object *obj) -{ - XlnxEFuse *s =3D XLNX_EFUSE(obj); - - g_free(s->ro_bits); -} - static void efuse_prop_set_drive(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { @@ -289,7 +282,6 @@ static const TypeInfo efuse_info =3D { .name =3D TYPE_XLNX_EFUSE, .parent =3D TYPE_DEVICE, .instance_size =3D sizeof(XlnxEFuse), - .instance_finalize =3D efuse_finalize, .class_init =3D efuse_class_init, }; =20 diff --git a/hw/nvram/xlnx-versal-efuse-ctrl.c b/hw/nvram/xlnx-versal-efuse= -ctrl.c index b7dc0e49e5f..69acdfa3047 100644 --- a/hw/nvram/xlnx-versal-efuse-ctrl.c +++ b/hw/nvram/xlnx-versal-efuse-ctrl.c @@ -724,13 +724,6 @@ static void efuse_ctrl_init(Object *obj) sysbus_init_irq(sbd, &s->irq_efuse_imr); } =20 -static void efuse_ctrl_finalize(Object *obj) -{ - XlnxVersalEFuseCtrl *s =3D XLNX_VERSAL_EFUSE_CTRL(obj); - - g_free(s->extra_pg0_lock_spec); -} - static const VMStateDescription vmstate_efuse_ctrl =3D { .name =3D TYPE_XLNX_VERSAL_EFUSE_CTRL, .version_id =3D 1, @@ -767,7 +760,6 @@ static const TypeInfo efuse_ctrl_info =3D { .instance_size =3D sizeof(XlnxVersalEFuseCtrl), .class_init =3D efuse_ctrl_class_init, .instance_init =3D efuse_ctrl_init, - .instance_finalize =3D efuse_ctrl_finalize, }; =20 static void efuse_ctrl_register_types(void) diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c index f5f6ce7359d..7b5ffddc1e9 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -94,18 +94,10 @@ static void virtio_iommu_pci_instance_init(Object *obj) TYPE_VIRTIO_IOMMU); } =20 -static void virtio_iommu_pci_instance_finalize(Object *obj) -{ - VirtIOIOMMUPCI *dev =3D VIRTIO_IOMMU_PCI(obj); - - g_free(dev->vdev.prop_resv_regions); -} - static const VirtioPCIDeviceTypeInfo virtio_iommu_pci_info =3D { .generic_name =3D TYPE_VIRTIO_IOMMU_PCI, .instance_size =3D sizeof(VirtIOIOMMUPCI), .instance_init =3D virtio_iommu_pci_instance_init, - .instance_finalize =3D virtio_iommu_pci_instance_finalize, .class_init =3D virtio_iommu_pci_class_init, }; =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907752; cv=none; d=zohomail.com; s=zohoarc; b=YzRwOIMNP405ri3Qb0VFHa6ZvkkHK/EUFRTUdBL8nNQQcMXPc6eE9+Lfip0dGd4koateNtWs562PVAjTDF+ZarZvKVEZ0yRyuP6zfzKmRcTm4J3HfWkYlXjJIthkH6N6y/UVNWRqNTLFFZyBSIpYGqhd39W+YrytU4syu4bdcNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907752; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h7mzYSXU/d7IGRVFubgbC3pj3BXXtorod57WfcEtQGE=; b=aQw4+wq+QDk3oixgu/Moa3kamymWMSvl0wGW8cLasebGxcS4yd0zwio356bWQHyJAa1ebRP67zNSEbPyPndDj0vqk78Ek5v2YWnFTNdt2MBcE8LHfG62AuqJSOjHVe6GwDgQ9xCyz5FW16nJPcp7epIxru08rCQZMDj2uTWvhYs= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177090775199852.81739847142899; Thu, 12 Feb 2026 06:49:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvc-0006dW-QZ; Thu, 12 Feb 2026 09:44:26 -0500 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 1vqXvT-00061d-HA for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvR-0006Gv-JI for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:15 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-593-qs4SU57XNuSYKEhwVNX4Yw-1; Thu, 12 Feb 2026 09:44:11 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-4376ecafb7fso1824749f8f.2 for ; Thu, 12 Feb 2026 06:44:11 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43783e0196bsm13502245f8f.23.2026.02.12.06.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:44:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907452; 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=h7mzYSXU/d7IGRVFubgbC3pj3BXXtorod57WfcEtQGE=; b=MMXSVnnwDRWm5v+6J/PJ3toh2D+7Ws8mjcwmBRyl9wpNzRUvp2UWTXtqMn6muDtgqCyVmC PAApJMjegjb6HQxacGnqnN5eTSjenSLFkWOkVdB1gN/HvhBA0SA7h5mFl+opJEARmwO7Us kNVgqin9HQRFebCkx2FZaOz0XpxoWXg= X-MC-Unique: qs4SU57XNuSYKEhwVNX4Yw-1 X-Mimecast-MFC-AGG-ID: qs4SU57XNuSYKEhwVNX4Yw_1770907450 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907450; x=1771512250; 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=h7mzYSXU/d7IGRVFubgbC3pj3BXXtorod57WfcEtQGE=; b=CEXLtdrpoP1iFXrARAN5P5MppZfeRDgg5vG/p4pSzREEclFELWgUcu/lpYfvkEBXTW eIkw8STB4fuMuOYqhEF/KsqiVx71Vsz9T4Eopa/4fXgltm0kC32su6gIOZHqXH7QxsbZ MWcq6GYqPrkDbe0rLFv1S+dTXPPkk/5QEivjdViLGPWnlVdfvWCU7pbpih274NccVw3/ E3PD5FmAnihMwWyM7TkzYtIazF3KM9R3XInDKVth3Dz4Kq7+mtjgtos1saZ0+kxzubEk H0Yup4qI0r1I7EkZcJJstGqXQ9WUj3te4D2i6vG09wU/annsDFC6MDMjQZs8IOxanq38 7gfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907450; x=1771512250; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=h7mzYSXU/d7IGRVFubgbC3pj3BXXtorod57WfcEtQGE=; b=aVBfLncGpx0G8zO/QJG1/qH5EB5O6uQkVA6JLAJ8BpCCzXfaiNmsiGZ2gGiTWTBLgG FM+z/eWL+A+FCjlEdIV8jvqrrD1ApBUv1N+JPA0payoIM/iAZet9A8onrqOA97gfHZjB r4YQrYclIaJXdVYngnmZSdzmW1VSO549t6PCMLJQSRXBKC92062LzLO4jyxqfTO/6zWl kvgEbm9cYYRTI9WSvKN1U3WRmATcbm9Rx0UvQE0NBffeViVpqxGBNe7JToka8ESnx8UX 6FxxbdZKyMczLmhiiTKZfmX7KU1JSnbCH+dcg46gJBvygKA6uqkU1RSt0gBjXSX0miga P/cg== X-Gm-Message-State: AOJu0YzMfvBHHStZ7gypxMvI6ylvURz9gXGIqReI7bzPAwaurqUcBU3o 9zgzifSx3dTym+1xlh9PY8W1FXtJ6TGdVUNCdEetKlrTkO0ShDBAXHiyfac2e0cKTKuVOBvQiI/ Sc9HTyMvxf44mQGyWjjHNdQWqywZ6cemHORFsiYp5ohyp4K0VAfNdhXAgBCEaNaR+1TufoeI6Y3 AW8gZ8g3UrUdjsuxeoajoIDgz1fp2O1hhgjM/SI5gs X-Gm-Gg: AZuq6aInDvQAxPAIK78ihLUlPUR44tgNWdQPO6sAAvPUlv71UalhvjRkSnjYIHoYno/ oN+epZGIs9yI2JwQSWnOT2Z7LEkcPew/gXGiO7JtvikdpvTg2TEmk9I8mDqemzUHV9JpmjNvAWq Uz1pm9pJgBnBet+CGe4ZGiu6i+osNI4lz5/GdeXZnhcqEqSHXIDXE3MZw1WA5oyfZPhNdX/PI7+ ynFzAEc0LAL4NWdBFexs+Yo5EunA6B8MZzytCY+X49/O/LmuK91AzsVxdAdAsFdel8ZrFNlSpn+ hggu9gUAj0tlx5eCpZUxy9Wom/Mll0SV8oNNXAEeSjBlUKQ5lEUmmXgx/cFHPd3Z700EigROr6F vPzC1zqQ72EEedICqcx5ztjswtJdjLLStM2HSG2VWMbZaH3n1dR8+mYquT+j/bairdLc0vWS1QZ n4U6dlMee+E0m6EBugbttKN5TALsGumngJtR/coVgh9bpBRvVcRMc= X-Received: by 2002:a05:6000:184e:b0:437:6c2b:2f47 with SMTP id ffacd0b85a97d-4378f112ee2mr5111026f8f.11.1770907449765; Thu, 12 Feb 2026 06:44:09 -0800 (PST) X-Received: by 2002:a05:6000:184e:b0:437:6c2b:2f47 with SMTP id ffacd0b85a97d-4378f112ee2mr5110874f8f.11.1770907448339; Thu, 12 Feb 2026 06:44:08 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Berger , Stefan Hajnoczi Subject: [PULL 36/41] qdev: make release_string() idempotent Date: Thu, 12 Feb 2026 15:42:38 +0100 Message-ID: <20260212144244.22579-37-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907753685154100 From: Marc-Andr=C3=A9 Lureau So it can eventually be called multiple times safely. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Berger Link: https://lore.kernel.org/r/20250429140306.190384-2-marcandre.lureau@re= dhat.com Reviewed-by: Stefan Hajnoczi Link: https://lore.kernel.org/r/20260108230311.584141-3-csomani@redhat.com Signed-off-by: Paolo Bonzini --- hw/core/qdev-properties.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index c2e3f0543fd..ba8461e9a42 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -551,7 +551,8 @@ const PropertyInfo qdev_prop_usize =3D { static void release_string(Object *obj, const char *name, void *opaque) { const Property *prop =3D opaque; - g_free(*(char **)object_field_prop_ptr(obj, prop)); + + g_clear_pointer((char **)object_field_prop_ptr(obj, prop), g_free); } =20 static void get_string(Object *obj, Visitor *v, const char *name, --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770908091; cv=none; d=zohomail.com; s=zohoarc; b=m1IssufAV4gB7ikvguOQ3tFERdF3KzWWt815QYpDLTz8hqJLDAngEGlOJ9SKjJIPk4oxnbvvAGIUkpd9JaCgZfiIMEss3IW8YuwVFqAOMWvSYS0UagM0A1PsX+qagTfzNC6Kfm7K1a1Aabx5DHiak6dYQh0/il1KujRAIwpLYdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770908091; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fQVJ9LSUskFrc7hUqy6BdTg9X2ZnsHe1rHSqlbLzkvM=; b=JWHH/qVpVVcU3qT2RY/WDam85xYK4d+CzB3RrT67DIOYBdmUpWfGiocPUvsiYPHoo1d96qW6HY0So02bECNULdEFgmwMPHZ2F+DwxfA+4BeSmlBina4IWpJT3AddZ3Dml0zKSLt0nw49TUvrGTf94z0n3Tr+r8B2vJUKyBb1WYU= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770908091190344.4479352671377; Thu, 12 Feb 2026 06:54:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvs-00077S-Av; Thu, 12 Feb 2026 09:44:40 -0500 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 1vqXvW-0006GE-7m for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvT-0006HG-Q0 for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:17 -0500 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-113-AJoXVwE5Ol-QfL5vU7IsNQ-1; Thu, 12 Feb 2026 09:44:13 -0500 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-43591aacca2so2610104f8f.1 for ; Thu, 12 Feb 2026 06:44:13 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43783d34657sm14576178f8f.6.2026.02.12.06.44.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:44:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907455; 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=fQVJ9LSUskFrc7hUqy6BdTg9X2ZnsHe1rHSqlbLzkvM=; b=hJJvu666UVQEZXo5D76R4Oy1fDbEbZ7mAn2X7opZthMYAJgymxjGME9xM7ptzNIbAKy6EV erxlgNi3avKVJtRQlgbtriwsQaOLvehLPR+JZT8psQqQAdoiVmVu394oi1xUrSm7FPyLjZ /aAOObt6Rmn0oEgVQmJ/iXxYlLSJV4o= X-MC-Unique: AJoXVwE5Ol-QfL5vU7IsNQ-1 X-Mimecast-MFC-AGG-ID: AJoXVwE5Ol-QfL5vU7IsNQ_1770907452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907450; x=1771512250; 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=fQVJ9LSUskFrc7hUqy6BdTg9X2ZnsHe1rHSqlbLzkvM=; b=aB+gWfBg4jlW19ff8r4iU31BXmnu73Dqryhv1myK0ue66nosrDx0ZDrd0b31sMc1b0 88HNj1UA2VtHnBsQUGOXqECjpWq8kXYjSqWlCEK8jrxh3TTwDQ4blg8fE6SVAf32HW4r R6lrWwt1IsqoeaTLM9x7bu69mAMFslI2aNh20MyGgk3qPdB/STN4h+bXB34PZEergisZ j/8wDfaEi0+yXrl1+sPHhJv+kNLwS5/F7/ruvLB1iOoVyrYqEN9+86wI5oPkto8zoZan ThaNsAa/4T7hL55FGSR2+T9UYsp6DivFjxPuMaQGbKuzw+eyWq7oJanTW9jE8oNCWFZJ rBZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907450; x=1771512250; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fQVJ9LSUskFrc7hUqy6BdTg9X2ZnsHe1rHSqlbLzkvM=; b=dI/RqV1EnOunml7itKwGnnEoPnPoxxIt7PxrxIrjT8OA+LCcirEI57M3YbizmOBNNT E6P0ze3vtviQl6e66AxOq4GScAsCnorCZ87QwnTRDP7w/9MhYAHzFcnt5eQq9RZpj30G P1gev8vWXF3JFuloVz54c5Q1bVbkPWDTMzWKywhB606btqnNAbE8HMcR5E9QN7Z5HsV0 lcLxcJrsGqwRtmuzFu2jMHYZSCmpP77WBXXh2ntk37qHnRLETo+0rnRCqmERWjDl1YV4 10V6Jq7dhKMdj6aP4CHRYykorusxZIFBbMDGTOcWJZn/VMZvMwwD2tJS3fNEasd4DUGF /l/w== X-Gm-Message-State: AOJu0YyV4CBwOW1vWoqow2sWd+jWvN7fb3w24usZUQ/fOVjEiXpUo378 EOtR76ykqnddpYbyUWfy58awM8OT5iEoUF2ExFTng9o1ufq/oZ0uz9l8wGyq5WRQJCloFiPA7Bb lB8/g3y53CmGZRLbkZqgNR5I7PuMsiSUrdCTTqxxknDKiDMVsyiNkJNcc5H7JAE0YwdnqQX6DAh koqIxk766eS2ae7ZNpcMLHK9qpR79CZVDInm1unKd9 X-Gm-Gg: AZuq6aIMiFyHX3DCUpdgdzOxFPj+PEUrDtbyEEJlfZYawzKBKfG9EAZeQ3DkICukV17 rbmTZYn4V+u218vDM9aP3cl0PpFfKnY/IC6NsVh6ui8T9Dkz9FcZh/1L7Tirw4WAWUx+NFRdCnF bKVPuUSnlF81avvm7tihEdt0ruyJsZ0qe10ZYxsNVn/6zRyv+acRSLFLJaa8WOTUtdi73aGmHAz rn9efNhlUt8CIKVW3L7J8J9MG2Egd2kN6NDpU/56EVM//nEDWWdcsDYV+HdP/BPtKwI1r6EBT6Q if2sL5FJOvEv2rYKl1EtM4L2hlIys5KQzu06tONatPRNSeMZSoTg6AKy/Ki57L5Bf3Qi+n61VGF TD1rxbsoGBXdTNseNZ3O7vkzB/hXp8mPGZFaETCAcTbOXsbWE7v2ds2Oy7Y3lP1Pfv/BjtSOw5X DylESTfLTVZuY+A8TRPIcmGY9iMJEB/aZ6lIZ2Oyl9Z2BHaj9qCEY= X-Received: by 2002:a05:6000:2311:b0:436:2356:47c4 with SMTP id ffacd0b85a97d-4378f178dccmr4336204f8f.35.1770907450233; Thu, 12 Feb 2026 06:44:10 -0800 (PST) X-Received: by 2002:a05:6000:2311:b0:436:2356:47c4 with SMTP id ffacd0b85a97d-4378f178dccmr4336149f8f.35.1770907449716; Thu, 12 Feb 2026 06:44:09 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Berger , Stefan Hajnoczi Subject: [PULL 37/41] qdev: make release_drive() idempotent Date: Thu, 12 Feb 2026 15:42:39 +0100 Message-ID: <20260212144244.22579-38-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770908092891154100 From: Marc-Andr=C3=A9 Lureau So it can eventually be called multiple times safely. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Berger Link: https://lore.kernel.org/r/20250429140306.190384-3-marcandre.lureau@re= dhat.com Reviewed-by: Stefan Hajnoczi Link: https://lore.kernel.org/r/20260108230311.584141-4-csomani@redhat.com Signed-off-by: Paolo Bonzini --- hw/core/qdev-properties-system.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index fe5464c7da1..a402321f42c 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -232,6 +232,7 @@ static void release_drive(Object *obj, const char *name= , void *opaque) if (*ptr) { blockdev_auto_del(*ptr); blk_detach_dev(*ptr, dev); + *ptr =3D NULL; } } =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907855; cv=none; d=zohomail.com; s=zohoarc; b=ORSLRrQOD0Iu6yUSEx9Ujh8rIx5c1NAYv2wbECbePMdLtrsm7y6DCtjhOpi195mZY7ih3oRAkCyzzK1MuNWaYXkFCpS6Cf4KUl5/gTEh7xQ8/8N8LFwXIYSfIuFGWxeQMp/ps9ahpXab88/zL5Sr7h80nPWAiOGbF62mjXUtRf8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907855; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=R/H8PR4Z+t+yD0VOfkreALdVOsHffEBJGMz/d0n5vsk=; b=Eejs5ynrU4EMWjBtGTB6AR+vE6vtX+QfVhFqa8HDW6V0H0ExiIB0NDS6ocE7TpyKN9YJGd8xV2cBu+pocx+08sGESo9pzW5RQ/Gd8tP8VaH5IfXBXpy1gG/xpV4RQlmysC64xmlS/IfmGnH5PJazxnsp+lRAJ444bYPFcDjH55Y= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907855146758.3745186245909; Thu, 12 Feb 2026 06:50:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvl-0006t9-Fa; Thu, 12 Feb 2026 09:44:33 -0500 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 1vqXvX-0006LG-OF for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvW-0006Hk-3L for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:19 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-633-Hau3JWZYMN608ED3qJ8qPA-1; Thu, 12 Feb 2026 09:44:16 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4806cfffca6so88971185e9.2 for ; Thu, 12 Feb 2026 06:44:16 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835ba1670fsm77374815e9.4.2026.02.12.06.44.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:44:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907457; 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=R/H8PR4Z+t+yD0VOfkreALdVOsHffEBJGMz/d0n5vsk=; b=SPz7Wh6EQDb2hWbaGykHQKvyyp+ujkjE4oZsr49uXGEKhfVBl6xe3xaAQ1wnnimNBtoyX/ YyC4rXCLAVsBN2Ajl8hmKzVAOh8sic4ry+4f7uugRxFLubtw1VFFvtPyiYTmK5HyS89JyD /PuPYcK8S+MRBIZRxWMeeTjvPR2aELU= X-MC-Unique: Hau3JWZYMN608ED3qJ8qPA-1 X-Mimecast-MFC-AGG-ID: Hau3JWZYMN608ED3qJ8qPA_1770907455 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907454; x=1771512254; 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=R/H8PR4Z+t+yD0VOfkreALdVOsHffEBJGMz/d0n5vsk=; b=UihyS6cr9sXnu/VIDEELSC9ZHDoEuEZ44V/hmb8bU6TXfJL3kz/dyA+hbmS1qzkMbe /2iQdMuPIuPdnncKpwwFXPi7PTusIc3EP69eC5s6zm5UlMh2e+cJ7nPNnATSHOUtEf/z fUI6WIElvy7BaxARdPaTZ6SH4H/lVRYcYwSStWveBmxgsObtAuxYsU1wU/JNUVGAMbIZ jMrLLNYmf8kySACGq43sCTJyLUTFypqNo81nWASLfSd00MPe4vX2PBedDpEsi6HnqYhu GZrQB4pQOqo0sxO+DTZGvejiIBJsRGQOiZzw53mBRAJfdfq68Zxcu5IDwlEA5qo/Ydm4 kf9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907454; x=1771512254; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=R/H8PR4Z+t+yD0VOfkreALdVOsHffEBJGMz/d0n5vsk=; b=QWgnFYZ+KNPEqXM/S3aJGJ+Eq6oYqQENLUtNWTPXdOnLZGRixvT+/K8FImZBs2ZUOP 9RtbcBae5l6QYPBhPhcxFMk7p1k03qPIcHJvPqzHi9uq5wtM2ZK9NHUpEUrsKudsDfZN CBHDp+c50+8XYMZOKuoGMUYfwZt9beJqy8voxPJ8jSYvXJF5ytTdFQKj+x3oQSsxMPQO QEuGgNCwQkC2U96edSeZpONDF+IzYdNGkOFpk7QM6lmgpXVrM8A8M0zlSMJ5zo5LIfjp ETFpMw1sQAxncm4xwz2laFrDoofxFSWV/oeknZb3SZvGGsauq9WAuUKdQ86FODCBEMA1 XgCw== X-Gm-Message-State: AOJu0Yxgm8z3JHQxn26GeRMB/LB1Mrd4z/iO9nwpm20xIkj4IstJDdzE VbxudujfnJhOCV/efHjArDCgnngIFxTlzyKBoIfZb+E7KbErX1nDbboyUBLehgnzVRF2JJivLMy vXRrUGkndnX5iZroD76GvDTojK3SQCaAbZ1iL3p56WkZFKz+1lDtXHVKUnWs+HD0WaF4AQPh+ZK I66eC22E5K0V/9s3hNQIs4bJbJgK+EZdSiA8zzhe1n X-Gm-Gg: AZuq6aKYPD2AJNFcIW6T5sLHvzZ8sll6cReFWNEOZXOUXf41sNUyMZY2YsvDg+Oh51B JhZyFr4GzKai5f6EBnZpd+YkjIFls8++lvdWjmtQpaWL3kKlow3mTi2rdQh0oWHYJF7XzjhGi4W arCn+JkepuDJ3HIVpCLpVwaTCjoawfYWBoS4XmWbN6k9tdo+co7f7OD6C2UHWkLF25NGtIrTJKX /DSDRNHBnxJ8XQvhJY9bPuPSovXEzCSQ/6asQj00nH03vZMass73MXLY49Vaj6vU1WQ0CYcUpGE w2VPuxcPC9TD4tBN2uqzLwbXM9yQyHUUSCAJC9QDjEsxlTw9jUesQlnlQOTS+HDS2gcc07ueOaB 8t5+s/zfrYMe5yNbG0CQoDkl0LbcGMQ/UV4hC2lOV2T8DfjCnXpXit7BZqHRyTYJL9wCr4370Dj I1hYWKHTOHzvhLWnivpseUSJhaJd2QJPl1fffj3PQeVB3hXYNujnc= X-Received: by 2002:a05:600c:888b:b0:477:5af7:6fa with SMTP id 5b1f17b1804b1-48367184279mr23990745e9.32.1770907454325; Thu, 12 Feb 2026 06:44:14 -0800 (PST) X-Received: by 2002:a05:600c:888b:b0:477:5af7:6fa with SMTP id 5b1f17b1804b1-48367184279mr23990425e9.32.1770907453808; Thu, 12 Feb 2026 06:44:13 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Berger , Stefan Hajnoczi Subject: [PULL 38/41] qdev: make release_tpm() idempotent Date: Thu, 12 Feb 2026 15:42:40 +0100 Message-ID: <20260212144244.22579-39-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907857267154101 From: Marc-Andr=C3=A9 Lureau So it can eventually be called multiple times safely. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Berger Link: https://lore.kernel.org/r/20250429140306.190384-4-marcandre.lureau@re= dhat.com Reviewed-by: Stefan Hajnoczi Link: https://lore.kernel.org/r/20260108230311.584141-5-csomani@redhat.com Signed-off-by: Paolo Bonzini --- backends/tpm/tpm_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c index a64e156f45f..264bff22a91 100644 --- a/backends/tpm/tpm_util.c +++ b/backends/tpm/tpm_util.c @@ -72,6 +72,7 @@ static void release_tpm(Object *obj, const char *name, vo= id *opaque) =20 if (*be) { tpm_backend_reset(*be); + *be =3D NULL; } } =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907752; cv=none; d=zohomail.com; s=zohoarc; b=EIw13fJEj+S0Zcbd+L5aZsd3BGt7nluvV9M71ez/TumQJkfEioekD1QvVHz7vIkyf5uUVI/5TNUmLatKR+WYGbVtygjjqzr9mQCQK95Vd/2mFv6Mw4iuV+JJ7K5vNHeAPNTI+rASZHHQ0IgaRi3dudYu/FASMyZlqj+/xt8u2vs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907752; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ODhn/b5AvptlCuVZKL5lyPwHbvz25VOUzIhw6xuP1GI=; b=mbU5X8jeIpfCh5CJmg8mdIvVO2Wz2u//iNIpLLh7ZfFcOdTxPcnkO6btYeAFq5H0Fz3R0jk3xqMFBAL7GH4XAtYGOil1/oC8oNHtdsuEr4kPoWkqAqenzZrbPIeHxmZZbvSBmId0JyHE7hS944ZvLNRvh+xiGj5CUQfN8/akdck= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907752620982.3314085702967; Thu, 12 Feb 2026 06:49:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXw7-0007Tt-Fp; Thu, 12 Feb 2026 09:44:59 -0500 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 1vqXva-0006Yp-OE for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvY-0006IE-DE for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:22 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-qtX18ST1PV2qGUZBIWarHg-1; Thu, 12 Feb 2026 09:44:18 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4831192e66aso70119045e9.2 for ; Thu, 12 Feb 2026 06:44:18 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835a66fcf7sm56255795e9.7.2026.02.12.06.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:44:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907459; 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=ODhn/b5AvptlCuVZKL5lyPwHbvz25VOUzIhw6xuP1GI=; b=f1wWxqKLoa0jdtV+ZVp4xG6WiC2qJQPaHf6wGAfk8ubCBgmDHlCzngII2R6IdtGXYaZqLD 8YjuSwlIh0ajish7TdLMQ5LRuomRTeY+61QARPkGmAeul1YgU8BNh+SbPxWIuM4oo9nduq Vc5kL0XbOxbpQmx71ACfvXGs+o82rvc= X-MC-Unique: qtX18ST1PV2qGUZBIWarHg-1 X-Mimecast-MFC-AGG-ID: qtX18ST1PV2qGUZBIWarHg_1770907457 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907457; x=1771512257; 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=ODhn/b5AvptlCuVZKL5lyPwHbvz25VOUzIhw6xuP1GI=; b=FtBjML2KSMMk9Bh/rmQetk4NyyVAY1VGgt41rpHtqsGmXW95jseLKXInW7Ax9ZXFgS pi/CxNHIryRS9NLW5z4NIkvWMtrd9kt+wD1I4rKl0b4k+iAj8dngxxvUgeFG0DqIfaKH d5rUcd4h+CuMhLvdxPCHb4kVqn8pUB923GGYieYqFZ8UkZFwvZFGYdwLbgStjCYosB5U VI/HkkEjGHXMjIMnzLthRZxZI94GNYCkkmZz7EoZZYrIJuDA/DsDcX0PQRCfjUfdgGeq pabd8P/mmXfS5iUga5T5Q/Bo+hNHfPf8xCVv7xIXGeN09egSFHc96ThkYXNWF6gqvj2g xzSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907457; x=1771512257; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ODhn/b5AvptlCuVZKL5lyPwHbvz25VOUzIhw6xuP1GI=; b=TAKyCfqcNDsyfXyVnMD0egVqVUXzC9dPNnDhcC01BDRwG1G2zVI59jAxUPEWg3u6/y GKLbAkPwj61XGgdy0Yx0Ea8oyofwKOMaitXNvI36uWAvr5YPQGZ5Bgg9xHIo8NoJrMDA 7HFndvYpW/a3XPJ0vcyIABPBKYe5TgbvOauSCPLag6Cmzqhi8foZKu82QQfEv8HV5u/o efIKB8hIlTskKlUpdqQPpuYW+Pz9dtJBE4ZInuNJUWKBCY23dgjTg87EBjfOHNEUJjHa dUYMNJ8SRCvpN4+ZJk5GImj8l16ybVVS/n+xPxB6aE63qRYW+pNLzCZ63ZLy2DY3LwfW oMkw== X-Gm-Message-State: AOJu0Yyn14nYQB1VZpPj5S3VQrcD6RYHr5SCfIOniKB4DYks0/gSiT5M iuSdTH7ZZGG6mMRAeBz9xnGAmmHF0+7pVtVcsbA+GMLAKt+lsDqfd01kna1V3/9CzCGpiNCcjfm XL1ytKsWwq4NizWQCFmLEfNlgIeEv6eoW+Kw9vRKW0a2gGgMtmS1g9jFqzBsOo5G2X9OA2vzZ5g lEeVKp3sOnlryMco/ycnOMIHyL4GHAw4otUMVESzYd X-Gm-Gg: AZuq6aK9hKcCnaFPco8NXx6uuZnaBYuKnCWj5tr0niaCOGNFqcmCaN4LvnNfB4KSsys IrrS9zkzc+KHxeHzACS2d5D/wJIhYBK1hfyqSVq78eqasLgfoMYO2kBBVfoNVK+Kj8BW+hgTuGU xKIsvE5h5h5JC7g1C8wuR1wT9zOKsWYWefMwqSqyCruhInoLf6WyM6FQFkv+FKX3o55dn4MDtYQ j9tg1CNx9KAUsWp6JAMNE0FHU4JkY5QPl03IC49qXBNPWBHWIHPHSA1lUBmhJh+QHnqJZku1Avo GbtLsTpBjcG8lQSf7sxG53W/vU3jauM8p2ATx4RbnMKooQNSa+yfROoJYnbFteVjTXyZpzUBdhY ZZppvX7qvvIr9G/U47zDUOFzriiuT7h82xJeeL+zqlWn+0zCX48wAP7rjJphWrODdFcZL9XGkl9 d+48pjoY5lpinlbLZpohKV9KaTCEuC8BuBdVyi990B8q2LZ/nyUw8= X-Received: by 2002:a05:600c:4e14:b0:480:1e8f:d15f with SMTP id 5b1f17b1804b1-483656ae432mr41831755e9.2.1770907456879; Thu, 12 Feb 2026 06:44:16 -0800 (PST) X-Received: by 2002:a05:600c:4e14:b0:480:1e8f:d15f with SMTP id 5b1f17b1804b1-483656ae432mr41831305e9.2.1770907456373; Thu, 12 Feb 2026 06:44:16 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Berger , Stefan Hajnoczi Subject: [PULL 39/41] tests: add /qdev/free-properties test Date: Thu, 12 Feb 2026 15:42:41 +0100 Message-ID: <20260212144244.22579-40-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907755758154100 From: Marc-Andr=C3=A9 Lureau Add a simple qdev test to check that allocated properties get freed with the object. This test exhibited array leaks before the fixes. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Berger Link: https://lore.kernel.org/r/20250429140306.190384-6-marcandre.lureau@re= dhat.com Reviewed-by: Stefan Hajnoczi Link: https://lore.kernel.org/r/20260108230311.584141-6-csomani@redhat.com Signed-off-by: Paolo Bonzini --- tests/unit/test-qdev.c | 96 ++++++++++++++++++++++++++++++++++++++++++ tests/unit/meson.build | 1 + 2 files changed, 97 insertions(+) create mode 100644 tests/unit/test-qdev.c diff --git a/tests/unit/test-qdev.c b/tests/unit/test-qdev.c new file mode 100644 index 00000000000..20eae38e03f --- /dev/null +++ b/tests/unit/test-qdev.c @@ -0,0 +1,96 @@ +#include "qemu/osdep.h" +#include "hw/core/qdev-properties.h" +#include "qom/object.h" +#include "qapi/error.h" +#include "qapi/visitor.h" + + +#define TYPE_MY_DEV "my-dev" +typedef struct MyDev MyDev; +DECLARE_INSTANCE_CHECKER(MyDev, STATIC_TYPE, + TYPE_MY_DEV) + +struct MyDev { + DeviceState parent_obj; + + uint32_t prop_u32; + char *prop_string; + uint32_t *prop_array_u32; + uint32_t prop_array_u32_nb; +}; + +static const Property my_dev_props[] =3D { + DEFINE_PROP_UINT32("u32", MyDev, prop_u32, 100), + DEFINE_PROP_STRING("string", MyDev, prop_string), + DEFINE_PROP_ARRAY("array-u32", MyDev, prop_array_u32_nb, prop_array_u3= 2, + qdev_prop_uint32, uint32_t), +}; + +static void my_dev_class_init(ObjectClass *oc, const void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(oc); + + dc->realize =3D NULL; + device_class_set_props(dc, my_dev_props); +} + +static const TypeInfo my_dev_type_info =3D { + .name =3D TYPE_MY_DEV, + .parent =3D TYPE_DEVICE, + .instance_size =3D sizeof(MyDev), + .class_init =3D my_dev_class_init, +}; + +/* + * Initialize a fake machine, being prepared for future tests. + * + * Realization of anonymous qdev (with no parent object) requires both + * the machine object and its "unattached" container to be at least presen= t. + */ +static void test_init_machine(void) +{ + /* This is a fake machine - it doesn't need to be a machine object */ + Object *machine =3D object_property_add_new_container( + object_get_root(), "machine"); + + /* This container must exist for anonymous qdevs to realize() */ + object_property_add_new_container(machine, "unattached"); +} + +static void test_qdev_free_properties(void) +{ + MyDev *mt; + + mt =3D STATIC_TYPE(object_new(TYPE_MY_DEV)); + object_set_props(OBJECT(mt), &error_fatal, + "string", "something", + "array-u32", "12,13", + NULL); + qdev_realize(DEVICE(mt), NULL, &error_fatal); + + g_assert_cmpuint(mt->prop_u32, =3D=3D, 100); + g_assert_cmpstr(mt->prop_string, =3D=3D, "something"); + g_assert_cmpuint(mt->prop_array_u32_nb, =3D=3D, 2); + g_assert_cmpuint(mt->prop_array_u32[0], =3D=3D, 12); + g_assert_cmpuint(mt->prop_array_u32[1], =3D=3D, 13); + + object_unparent(OBJECT(mt)); + object_unref(mt); +} + + +int main(int argc, char **argv) +{ + g_test_init(&argc, &argv, NULL); + + module_call_init(MODULE_INIT_QOM); + type_register_static(&my_dev_type_info); + test_init_machine(); + + g_test_add_func("/qdev/free-properties", + test_qdev_free_properties); + + g_test_run(); + + return 0; +} diff --git a/tests/unit/meson.build b/tests/unit/meson.build index bd580290601..41e8b06c339 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -156,6 +156,7 @@ if have_system 'test-qdev-global-props': [qom, hwcore] } endif + tests +=3D {'test-qdev': [qom, hwcore]} endif =20 if have_ga and host_os =3D=3D 'linux' --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770908078; cv=none; d=zohomail.com; s=zohoarc; b=mtV512S3D7QtIK3wWFvf8kXq4roJSsD+HWVrpZQRAs6wwlSWVhKqFLFtmBfL4L6ikgx30bClqw6Dt4maX/NDvrNhhmDVZHRfvDpDDbI6cU18XWVO4N0xH528DW8CqbdwZa9B5538MA2riGGRZJ9wC2Zl61lJxvhubEjTp8X33UA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770908078; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=D0uYZne8yLPOlYUa8J2qxfeDZ6ErnSQon2oFjnwLMmA=; b=iIDm0Pgt5/JzalORXq8PwEiC40nqRWRhjhyPGWr9s5tfbCl7c/p5AvgY0kYNub3If2+T1hIY0oxKmH9ymi6r71qGVCeGv4NFNsbqtRFNIx0ZnlbTtsLop53Do0S6Mra/FlV+ydGyl9BP4UgDkc4iLwbpSDHJjvZgElIQXZzBDgk= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770908078701570.8859105383083; Thu, 12 Feb 2026 06:54:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXvs-00078U-C4; Thu, 12 Feb 2026 09:44:40 -0500 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 1vqXvf-0006k2-0o for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvc-0006JF-2I for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:26 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-215-g2X3IRtkPbC1-V7yYmDaXw-1; Thu, 12 Feb 2026 09:44:22 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-480711d09f1so43118195e9.0 for ; Thu, 12 Feb 2026 06:44:21 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4836aa0847asm48393415e9.3.2026.02.12.06.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:44:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D0uYZne8yLPOlYUa8J2qxfeDZ6ErnSQon2oFjnwLMmA=; b=OkLUvkLr0TaB4COYNvgJsQWXJPveLP5X3FFdvIuM0aRxFRqdNEQ5RI1e/I4sxwo09fi4bQ PG9PBEYRx5z8tPYGphmfyVGenJ/z1hRvZRs7h28SWQIc0UCQpVjn+Mb2WW254WoeRyrHx2 KD9DDTLe0mFMbVCVVyRAanXM+yXNBmo= X-MC-Unique: g2X3IRtkPbC1-V7yYmDaXw-1 X-Mimecast-MFC-AGG-ID: g2X3IRtkPbC1-V7yYmDaXw_1770907461 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907459; x=1771512259; 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=D0uYZne8yLPOlYUa8J2qxfeDZ6ErnSQon2oFjnwLMmA=; b=hxzyw8YJZbONbNVmPOCMBtpfAYboPmOmO09eX0ehJbQxIGxJRVB90sZyjjE5fY2fIz 24hVP9WJkP5EHJPj+0hT1sMiIYCWEadBSnhJ4rI5L0W0N+WLU0SdT0fFqYVgjII4zVhl DZp83r/U+iQduMXXftWXMxLMt7j93qrMc+yq81z9uOuJkl2yptTaK7/MeXP5T0DYpIv4 5FnR5dttlR/Jt6v+AupTa/Igsw2xOjwqe7D3njEmL0fxn40J2asenIUZwe9L2awLZcdY 8o5nM6OqCQmTep5hC6cBpPwsF1wAWno7fJtIVK09dJkNGsr2mO5ZbnlluYuD1u8UEx24 FNlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907459; x=1771512259; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=D0uYZne8yLPOlYUa8J2qxfeDZ6ErnSQon2oFjnwLMmA=; b=RHL6r5AqWDiDmpD8OLO+r+zw0KeMLRbfq2ZkBnPZEhJosPLzPuYmfTvC3jf6p3r7uJ /NZEEnHWA+00trdvV/ImY98w6fRdELHCGqzdFkOA5KGS0glafvOnNbE+Jf66hbDo/kwR DiMlh+7dsMBZJVabnIuuHYOblZmUmhHKlBAB07N6kPKcqSYz5EzEpKedJAqeAUr4cdmF YgpYeq1dG57WwIp+lyA4rx/Zb/dP18tyD7cv564At43+Pp7Iyc/mFIvKoU+gmycbdLCx SYbW3aYqK98d4evgunNI6JZcenJANNA2rYvN8G2RuS/ucid6kIXgeifofj+hD5nShU9A OUlw== X-Gm-Message-State: AOJu0Yzzep0SG4xeVaVJBLHyD95GoC5Qpjs9boqmKNnPdjFwNE9JNvCz K1ow0TvT5gal/5vMgPRcAN+ZYI0nOhcbGGHKbwuRwG5ej1Pu+Bmyzd/KrXDNeQ7hxKOVkZIGxQ9 vaMmZm+fNQjENGYMZXNpQbXz8QgBhA7ksp6tOhWmZSg/i6Php+6NC0GAR6FcCcKKWntlSP4JJ0e gQYDSkWREMjZGG6/QoXUS3eg0vlCe3KQg97m2O6Zrk X-Gm-Gg: AZuq6aKtLY3tYtXb1Y0qVeJ0LUU07YKQi53CG9zt2aeDd1GIJU4G02iTmEeYTEAXben 1iHLj2a542nBg5hcKIF4jGraB0n6fJljgmrothz756DuoZON7YJU5FOMGtxL3HRHs/LqZ+Onbsa SGmEgfagD8rbj4kOgsxAZHK6J5GdgsqU5TPZYWDqL9lRt40cbK5EBe7sJrqqy4Hag6KoY6ahDuh 84JuNlqAdLBZ7cMpmiZI4r0KBlF+3JpV63iHOgGn8X8st/kHPCY97hqXgBmHq2/UoV4PCxTFWyu uFALSZJ8sMfqhC0fvZ23uhd8jO2FoxBWcj4XG0S4miq8r422k8vwo3ZR5KuLyTklriJmrcZScoN thWEljNNvG+1khxML9P7xxZ4vJb5CKm+g1J++FC0q6jOwUWszYUuE4q6vUe4xDHUIiloQOjSbUd ivZmk0H67oKTsRIn9KzTZt1KxvyPQnNpqfOMh8EVro6Xpx3bRKui0= X-Received: by 2002:a05:600c:3e1b:b0:47a:935f:61a0 with SMTP id 5b1f17b1804b1-48367086001mr35416645e9.0.1770907459205; Thu, 12 Feb 2026 06:44:19 -0800 (PST) X-Received: by 2002:a05:600c:3e1b:b0:47a:935f:61a0 with SMTP id 5b1f17b1804b1-48367086001mr35416075e9.0.1770907458601; Thu, 12 Feb 2026 06:44:18 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Magnus Kulke , "Wei Liu (Microsoft)" , Mohamed Mediouni Subject: [PULL 40/41] accel/mshv: Remove remap overlapping mappings code Date: Thu, 12 Feb 2026 15:42:42 +0100 Message-ID: <20260212144244.22579-41-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770908080944158500 Content-Type: text/plain; charset="utf-8" From: Magnus Kulke This change removes userland code that worked around a restriction in the mshv driver in the 6.18 kernel: regions from userland couldn't be mapped to multiple regions in the kernel. We maintained a shadow mapping table in qemu and used a heuristic to swap in a requested region in case of UNMAPPED_GPA exits. However, this heuristic wasn't reliable in all cases, since HyperV behaviour is not 100% reliable across versions. HyperV itself doesn't prohibit to map regions at multiple places into the guest, so the restriction has been removed in the mshv driver. Hence we can remove the remapping code. Effectively this will mandate a 6.19 kernel, if the workload attempt to map e.g. BIOS to multiple reagions. I still think it's the right call to remove this logic: - The workaround only seems to work reliably with a certain revision of HyperV as a nested hypervisor. - We expect Direct Virtualization (L1VH) to be the main platform for the mshv accelerator, which also requires a 6.19 kernel This reverts commit efc4093358511a58846a409b965213aa1bb9f31a. Signed-off-by: Magnus Kulke Acked-by: Wei Liu (Microsoft) Tested-by: Mohamed Mediouni Link: https://lore.kernel.org/r/20260113153708.448968-1-magnuskulke@linux.m= icrosoft.com Signed-off-by: Paolo Bonzini --- include/system/mshv_int.h | 22 +- accel/mshv/mem.c | 406 +++--------------------------------- accel/mshv/mshv-all.c | 2 - target/i386/mshv/mshv-cpu.c | 43 ---- accel/mshv/trace-events | 5 - 5 files changed, 30 insertions(+), 448 deletions(-) diff --git a/include/system/mshv_int.h b/include/system/mshv_int.h index 490563c1ab2..ad4d001c3cd 100644 --- a/include/system/mshv_int.h +++ b/include/system/mshv_int.h @@ -16,8 +16,6 @@ =20 #define MSHV_MSR_ENTRIES_COUNT 64 =20 -#define MSHV_MAX_MEM_SLOTS 32 - typedef struct hyperv_message hv_message; =20 typedef struct MshvHvCallArgs { @@ -42,12 +40,6 @@ typedef struct MshvAddressSpace { AddressSpace *as; } MshvAddressSpace; =20 -typedef struct MshvMemorySlotManager { - size_t n_slots; - GList *slots; - QemuMutex mutex; -} MshvMemorySlotManager; - struct MshvState { AccelState parent_obj; int vm; @@ -56,7 +48,6 @@ struct MshvState { int nr_as; MshvAddressSpace *as; int fd; - MshvMemorySlotManager msm; }; =20 typedef struct MshvMsiControl { @@ -87,12 +78,6 @@ typedef enum MshvVmExit { MshvVmExitSpecial =3D 2, } MshvVmExit; =20 -typedef enum MshvRemapResult { - MshvRemapOk =3D 0, - MshvRemapNoMapping =3D 1, - MshvRemapNoOverlap =3D 2, -} MshvRemapResult; - void mshv_init_mmio_emu(void); int mshv_create_vcpu(int vm_fd, uint8_t vp_index, int *cpu_fd); void mshv_remove_vcpu(int vm_fd, int cpu_fd); @@ -116,22 +101,19 @@ int mshv_hvcall(int fd, const struct mshv_root_hvcall= *args); #endif =20 /* memory */ -typedef struct MshvMemorySlot { +typedef struct MshvMemoryRegion { uint64_t guest_phys_addr; uint64_t memory_size; uint64_t userspace_addr; bool readonly; - bool mapped; -} MshvMemorySlot; +} MshvMemoryRegion; =20 -MshvRemapResult mshv_remap_overlap_region(int vm_fd, uint64_t gpa); int mshv_guest_mem_read(uint64_t gpa, uint8_t *data, uintptr_t size, bool is_secure_mode, bool instruction_fetch); int mshv_guest_mem_write(uint64_t gpa, const uint8_t *data, uintptr_t size, bool is_secure_mode); void mshv_set_phys_mem(MshvMemoryListener *mml, MemoryRegionSection *secti= on, bool add); -void mshv_init_memory_slot_manager(MshvState *mshv_state); =20 /* msr */ typedef struct MshvMsrEntry { diff --git a/accel/mshv/mem.c b/accel/mshv/mem.c index 0e2164af3ee..e55c38d4db9 100644 --- a/accel/mshv/mem.c +++ b/accel/mshv/mem.c @@ -11,9 +11,7 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/lockable.h" #include "qemu/error-report.h" -#include "qemu/rcu.h" #include "linux/mshv.h" #include "system/address-spaces.h" #include "system/mshv.h" @@ -22,137 +20,6 @@ #include #include "trace.h" =20 -typedef struct SlotsRCUReclaim { - struct rcu_head rcu; - GList *old_head; - MshvMemorySlot *removed_slot; -} SlotsRCUReclaim; - -static void rcu_reclaim_slotlist(struct rcu_head *rcu) -{ - SlotsRCUReclaim *r =3D container_of(rcu, SlotsRCUReclaim, rcu); - g_list_free(r->old_head); - g_free(r->removed_slot); - g_free(r); -} - -static void publish_slots(GList *new_head, GList *old_head, - MshvMemorySlot *removed_slot) -{ - MshvMemorySlotManager *manager =3D &mshv_state->msm; - - assert(manager); - qatomic_store_release(&manager->slots, new_head); - - SlotsRCUReclaim *r =3D g_new(SlotsRCUReclaim, 1); - r->old_head =3D old_head; - r->removed_slot =3D removed_slot; - - call_rcu1(&r->rcu, rcu_reclaim_slotlist); -} - -/* Needs to be called with mshv_state->msm.mutex held */ -static int remove_slot(MshvMemorySlot *slot) -{ - GList *old_head, *new_head; - MshvMemorySlotManager *manager =3D &mshv_state->msm; - - assert(manager); - old_head =3D qatomic_load_acquire(&manager->slots); - - if (!g_list_find(old_head, slot)) { - error_report("slot requested for removal not found"); - return -1; - } - - new_head =3D g_list_copy(old_head); - new_head =3D g_list_remove(new_head, slot); - manager->n_slots--; - - publish_slots(new_head, old_head, slot); - - return 0; -} - -/* Needs to be called with mshv_state->msm.mutex held */ -static MshvMemorySlot *append_slot(uint64_t gpa, uint64_t userspace_addr, - uint64_t size, bool readonly) -{ - GList *old_head, *new_head; - MshvMemorySlot *slot; - MshvMemorySlotManager *manager =3D &mshv_state->msm; - - assert(manager); - - old_head =3D qatomic_load_acquire(&manager->slots); - - if (manager->n_slots >=3D MSHV_MAX_MEM_SLOTS) { - error_report("no free memory slots available"); - return NULL; - } - - slot =3D g_new0(MshvMemorySlot, 1); - slot->guest_phys_addr =3D gpa; - slot->userspace_addr =3D userspace_addr; - slot->memory_size =3D size; - slot->readonly =3D readonly; - - new_head =3D g_list_copy(old_head); - new_head =3D g_list_append(new_head, slot); - manager->n_slots++; - - publish_slots(new_head, old_head, NULL); - - return slot; -} - -static int slot_overlaps(const MshvMemorySlot *slot1, - const MshvMemorySlot *slot2) -{ - uint64_t start_1 =3D slot1->userspace_addr, - start_2 =3D slot2->userspace_addr; - size_t len_1 =3D slot1->memory_size, - len_2 =3D slot2->memory_size; - - if (slot1 =3D=3D slot2) { - return -1; - } - - return ranges_overlap(start_1, len_1, start_2, len_2) ? 0 : -1; -} - -static bool is_mapped(MshvMemorySlot *slot) -{ - /* Subsequent reads of mapped field see a fully-initialized slot */ - return qatomic_load_acquire(&slot->mapped); -} - -/* - * Find slot that is: - * - overlapping in userspace - * - currently mapped in the guest - * - * Needs to be called with mshv_state->msm.mutex or RCU read lock held. - */ -static MshvMemorySlot *find_overlap_mem_slot(GList *head, MshvMemorySlot *= slot) -{ - GList *found; - MshvMemorySlot *overlap_slot; - - found =3D g_list_find_custom(head, slot, (GCompareFunc) slot_overlaps); - - if (!found) { - return NULL; - } - - overlap_slot =3D found->data; - if (!overlap_slot || !is_mapped(overlap_slot)) { - return NULL; - } - - return overlap_slot; -} - static int set_guest_memory(int vm_fd, const struct mshv_user_mem_region *region) { @@ -160,169 +27,38 @@ static int set_guest_memory(int vm_fd, =20 ret =3D ioctl(vm_fd, MSHV_SET_GUEST_MEMORY, region); if (ret < 0) { - error_report("failed to set guest memory: %s", strerror(errno)); - return -1; + error_report("failed to set guest memory"); + return -errno; } =20 return 0; } =20 -static int map_or_unmap(int vm_fd, const MshvMemorySlot *slot, bool map) +static int map_or_unmap(int vm_fd, const MshvMemoryRegion *mr, bool map) { struct mshv_user_mem_region region =3D {0}; =20 - region.guest_pfn =3D slot->guest_phys_addr >> MSHV_PAGE_SHIFT; - region.size =3D slot->memory_size; - region.userspace_addr =3D slot->userspace_addr; + region.guest_pfn =3D mr->guest_phys_addr >> MSHV_PAGE_SHIFT; + region.size =3D mr->memory_size; + region.userspace_addr =3D mr->userspace_addr; =20 if (!map) { region.flags |=3D (1 << MSHV_SET_MEM_BIT_UNMAP); - trace_mshv_unmap_memory(slot->userspace_addr, slot->guest_phys_add= r, - slot->memory_size); + trace_mshv_unmap_memory(mr->userspace_addr, mr->guest_phys_addr, + mr->memory_size); return set_guest_memory(vm_fd, ®ion); } =20 region.flags =3D BIT(MSHV_SET_MEM_BIT_EXECUTABLE); - if (!slot->readonly) { + if (!mr->readonly) { region.flags |=3D BIT(MSHV_SET_MEM_BIT_WRITABLE); } =20 - trace_mshv_map_memory(slot->userspace_addr, slot->guest_phys_addr, - slot->memory_size); + trace_mshv_map_memory(mr->userspace_addr, mr->guest_phys_addr, + mr->memory_size); return set_guest_memory(vm_fd, ®ion); } =20 -static int slot_matches_region(const MshvMemorySlot *slot1, - const MshvMemorySlot *slot2) -{ - return (slot1->guest_phys_addr =3D=3D slot2->guest_phys_addr && - slot1->userspace_addr =3D=3D slot2->userspace_addr && - slot1->memory_size =3D=3D slot2->memory_size) ? 0 : -1; -} - -/* Needs to be called with mshv_state->msm.mutex held */ -static MshvMemorySlot *find_mem_slot_by_region(uint64_t gpa, uint64_t size, - uint64_t userspace_addr) -{ - MshvMemorySlot ref_slot =3D { - .guest_phys_addr =3D gpa, - .userspace_addr =3D userspace_addr, - .memory_size =3D size, - }; - GList *found; - MshvMemorySlotManager *manager =3D &mshv_state->msm; - - assert(manager); - found =3D g_list_find_custom(manager->slots, &ref_slot, - (GCompareFunc) slot_matches_region); - - return found ? found->data : NULL; -} - -static int slot_covers_gpa(const MshvMemorySlot *slot, uint64_t *gpa_p) -{ - uint64_t gpa_offset, gpa =3D *gpa_p; - - gpa_offset =3D gpa - slot->guest_phys_addr; - return (slot->guest_phys_addr <=3D gpa && gpa_offset < slot->memory_si= ze) - ? 0 : -1; -} - -/* Needs to be called with mshv_state->msm.mutex or RCU read lock held */ -static MshvMemorySlot *find_mem_slot_by_gpa(GList *head, uint64_t gpa) -{ - GList *found; - MshvMemorySlot *slot; - - trace_mshv_find_slot_by_gpa(gpa); - - found =3D g_list_find_custom(head, &gpa, (GCompareFunc) slot_covers_gp= a); - if (found) { - slot =3D found->data; - trace_mshv_found_slot(slot->userspace_addr, slot->guest_phys_addr, - slot->memory_size); - return slot; - } - - return NULL; -} - -/* Needs to be called with mshv_state->msm.mutex held */ -static void set_mapped(MshvMemorySlot *slot, bool mapped) -{ - /* prior writes to mapped field becomes visible before readers see slo= t */ - qatomic_store_release(&slot->mapped, mapped); -} - -MshvRemapResult mshv_remap_overlap_region(int vm_fd, uint64_t gpa) -{ - MshvMemorySlot *gpa_slot, *overlap_slot; - GList *head; - int ret; - MshvMemorySlotManager *manager =3D &mshv_state->msm; - - /* fast path, called often by unmapped_gpa vm exit */ - WITH_RCU_READ_LOCK_GUARD() { - assert(manager); - head =3D qatomic_load_acquire(&manager->slots); - /* return early if no slot is found */ - gpa_slot =3D find_mem_slot_by_gpa(head, gpa); - if (gpa_slot =3D=3D NULL) { - return MshvRemapNoMapping; - } - - /* return early if no overlapping slot is found */ - overlap_slot =3D find_overlap_mem_slot(head, gpa_slot); - if (overlap_slot =3D=3D NULL) { - return MshvRemapNoOverlap; - } - } - - /* - * We'll modify the mapping list, so we need to upgrade to mutex and - * recheck. - */ - assert(manager); - QEMU_LOCK_GUARD(&manager->mutex); - - /* return early if no slot is found */ - gpa_slot =3D find_mem_slot_by_gpa(manager->slots, gpa); - if (gpa_slot =3D=3D NULL) { - return MshvRemapNoMapping; - } - - /* return early if no overlapping slot is found */ - overlap_slot =3D find_overlap_mem_slot(manager->slots, gpa_slot); - if (overlap_slot =3D=3D NULL) { - return MshvRemapNoOverlap; - } - - /* unmap overlapping slot */ - ret =3D map_or_unmap(vm_fd, overlap_slot, false); - if (ret < 0) { - error_report("failed to unmap overlap region"); - abort(); - } - set_mapped(overlap_slot, false); - warn_report("mapped out userspace_addr=3D0x%016lx gpa=3D0x%010lx size= =3D0x%lx", - overlap_slot->userspace_addr, - overlap_slot->guest_phys_addr, - overlap_slot->memory_size); - - /* map region for gpa */ - ret =3D map_or_unmap(vm_fd, gpa_slot, true); - if (ret < 0) { - error_report("failed to map new region"); - abort(); - } - set_mapped(gpa_slot, true); - warn_report("mapped in userspace_addr=3D0x%016lx gpa=3D0x%010lx size= =3D0x%lx", - gpa_slot->userspace_addr, gpa_slot->guest_phys_addr, - gpa_slot->memory_size); - - return MshvRemapOk; -} - static int handle_unmapped_mmio_region_read(uint64_t gpa, uint64_t size, uint8_t *data) { @@ -388,97 +124,20 @@ int mshv_guest_mem_write(uint64_t gpa, const uint8_t = *data, uintptr_t size, return -1; } =20 -static int tracked_unmap(int vm_fd, uint64_t gpa, uint64_t size, - uint64_t userspace_addr) +static int set_memory(const MshvMemoryRegion *mshv_mr, bool add) { - int ret; - MshvMemorySlot *slot; - MshvMemorySlotManager *manager =3D &mshv_state->msm; + int ret =3D 0; =20 - assert(manager); - - QEMU_LOCK_GUARD(&manager->mutex); - - slot =3D find_mem_slot_by_region(gpa, size, userspace_addr); - if (!slot) { - trace_mshv_skip_unset_mem(userspace_addr, gpa, size); - /* no work to do */ - return 0; - } - - if (!is_mapped(slot)) { - /* remove slot, no need to unmap */ - return remove_slot(slot); - } - - ret =3D map_or_unmap(vm_fd, slot, false); - if (ret < 0) { - error_report("failed to unmap memory region"); - return ret; - } - return remove_slot(slot); -} - -static int tracked_map(int vm_fd, uint64_t gpa, uint64_t size, bool readon= ly, - uint64_t userspace_addr) -{ - MshvMemorySlot *slot, *overlap_slot; - int ret; - MshvMemorySlotManager *manager =3D &mshv_state->msm; - - assert(manager); - - QEMU_LOCK_GUARD(&manager->mutex); - - slot =3D find_mem_slot_by_region(gpa, size, userspace_addr); - if (slot) { - error_report("memory region already mapped at gpa=3D0x%lx, " - "userspace_addr=3D0x%lx, size=3D0x%lx", - slot->guest_phys_addr, slot->userspace_addr, - slot->memory_size); + if (!mshv_mr) { + error_report("Invalid mshv_mr"); return -1; } =20 - slot =3D append_slot(gpa, userspace_addr, size, readonly); - - overlap_slot =3D find_overlap_mem_slot(manager->slots, slot); - if (overlap_slot) { - trace_mshv_remap_attempt(slot->userspace_addr, - slot->guest_phys_addr, - slot->memory_size); - warn_report("attempt to map region [0x%lx-0x%lx], while " - "[0x%lx-0x%lx] is already mapped in the guest", - userspace_addr, userspace_addr + size - 1, - overlap_slot->userspace_addr, - overlap_slot->userspace_addr + - overlap_slot->memory_size - 1); - - /* do not register mem slot in hv, but record for later swap-in */ - set_mapped(slot, false); - - return 0; - } - - ret =3D map_or_unmap(vm_fd, slot, true); - if (ret < 0) { - error_report("failed to map memory region"); - return -1; - } - set_mapped(slot, true); - - return 0; -} - -static int set_memory(uint64_t gpa, uint64_t size, bool readonly, - uint64_t userspace_addr, bool add) -{ - int vm_fd =3D mshv_state->vm; - - if (add) { - return tracked_map(vm_fd, gpa, size, readonly, userspace_addr); - } - - return tracked_unmap(vm_fd, gpa, size, userspace_addr); + trace_mshv_set_memory(add, mshv_mr->guest_phys_addr, + mshv_mr->memory_size, + mshv_mr->userspace_addr, mshv_mr->readonly, + ret); + return map_or_unmap(mshv_state->vm, mshv_mr, add); } =20 /* @@ -514,9 +173,7 @@ void mshv_set_phys_mem(MshvMemoryListener *mml, MemoryR= egionSection *section, bool writable =3D !area->readonly && !area->rom_device; hwaddr start_addr, mr_offset, size; void *ram; - - size =3D align_section(section, &start_addr); - trace_mshv_set_phys_mem(add, section->mr->name, start_addr); + MshvMemoryRegion mshv_mr =3D {0}; =20 size =3D align_section(section, &start_addr); trace_mshv_set_phys_mem(add, section->mr->name, start_addr); @@ -543,21 +200,14 @@ void mshv_set_phys_mem(MshvMemoryListener *mml, Memor= yRegionSection *section, =20 ram =3D memory_region_get_ram_ptr(area) + mr_offset; =20 - ret =3D set_memory(start_addr, size, !writable, (uint64_t)ram, add); + mshv_mr.guest_phys_addr =3D start_addr; + mshv_mr.memory_size =3D size; + mshv_mr.readonly =3D !writable; + mshv_mr.userspace_addr =3D (uint64_t)ram; + + ret =3D set_memory(&mshv_mr, add); if (ret < 0) { - error_report("failed to set memory region"); + error_report("Failed to set memory region"); abort(); } } - -void mshv_init_memory_slot_manager(MshvState *mshv_state) -{ - MshvMemorySlotManager *manager; - - assert(mshv_state); - manager =3D &mshv_state->msm; - - manager->n_slots =3D 0; - manager->slots =3D NULL; - qemu_mutex_init(&manager->mutex); -} diff --git a/accel/mshv/mshv-all.c b/accel/mshv/mshv-all.c index bed0fa298e6..ddc4c18cba4 100644 --- a/accel/mshv/mshv-all.c +++ b/accel/mshv/mshv-all.c @@ -437,8 +437,6 @@ static int mshv_init(AccelState *as, MachineState *ms) =20 mshv_init_msicontrol(); =20 - mshv_init_memory_slot_manager(s); - ret =3D create_vm(mshv_fd, &vm_fd); if (ret < 0) { close(mshv_fd); diff --git a/target/i386/mshv/mshv-cpu.c b/target/i386/mshv/mshv-cpu.c index 586383b8820..f5c388eb87c 100644 --- a/target/i386/mshv/mshv-cpu.c +++ b/target/i386/mshv/mshv-cpu.c @@ -1167,43 +1167,6 @@ static int handle_mmio(CPUState *cpu, const struct h= yperv_message *msg, return 0; } =20 -static int handle_unmapped_mem(int vm_fd, CPUState *cpu, - const struct hyperv_message *msg, - MshvVmExit *exit_reason) -{ - struct hv_x64_memory_intercept_message info =3D { 0 }; - uint64_t gpa; - int ret; - enum MshvRemapResult remap_result; - - ret =3D set_memory_info(msg, &info); - if (ret < 0) { - error_report("failed to convert message to memory info"); - return -1; - } - - gpa =3D info.guest_physical_address; - - /* attempt to remap the region, in case of overlapping userspace mappi= ngs */ - remap_result =3D mshv_remap_overlap_region(vm_fd, gpa); - *exit_reason =3D MshvVmExitIgnore; - - switch (remap_result) { - case MshvRemapNoMapping: - /* if we didn't find a mapping, it is probably mmio */ - return handle_mmio(cpu, msg, exit_reason); - case MshvRemapOk: - break; - case MshvRemapNoOverlap: - /* This should not happen, but we are forgiving it */ - warn_report("found no overlap for unmapped region"); - *exit_reason =3D MshvVmExitSpecial; - break; - } - - return 0; -} - static int set_ioport_info(const struct hyperv_message *msg, hv_x64_io_port_intercept_message *info) { @@ -1545,12 +1508,6 @@ int mshv_run_vcpu(int vm_fd, CPUState *cpu, hv_messa= ge *msg, MshvVmExit *exit) case HVMSG_UNRECOVERABLE_EXCEPTION: return MshvVmExitShutdown; case HVMSG_UNMAPPED_GPA: - ret =3D handle_unmapped_mem(vm_fd, cpu, msg, &exit_reason); - if (ret < 0) { - error_report("failed to handle unmapped memory"); - return -1; - } - return exit_reason; case HVMSG_GPA_INTERCEPT: ret =3D handle_mmio(cpu, msg, &exit_reason); if (ret < 0) { diff --git a/accel/mshv/trace-events b/accel/mshv/trace-events index 36f0d59b385..a4dffeb24a3 100644 --- a/accel/mshv/trace-events +++ b/accel/mshv/trace-events @@ -26,8 +26,3 @@ mshv_map_memory(uint64_t userspace_addr, uint64_t gpa, ui= nt64_t size) "\tu_a=3D0x% mshv_unmap_memory(uint64_t userspace_addr, uint64_t gpa, uint64_t size) "\= tu_a=3D0x%" PRIx64 " gpa=3D0x%010" PRIx64 " size=3D0x%08" PRIx64 mshv_set_phys_mem(bool add, const char *name, uint64_t gpa) "\tadd=3D%d na= me=3D%s gpa=3D0x%010" PRIx64 mshv_handle_mmio(uint64_t gva, uint64_t gpa, uint64_t size, uint8_t access= _type) "\tgva=3D0x%" PRIx64 " gpa=3D0x%010" PRIx64 " size=3D0x%" PRIx64 " a= ccess_type=3D%d" - -mshv_found_slot(uint64_t userspace_addr, uint64_t gpa, uint64_t size) "\tu= _a=3D0x%" PRIx64 " gpa=3D0x%010" PRIx64 " size=3D0x%08" PRIx64 -mshv_skip_unset_mem(uint64_t userspace_addr, uint64_t gpa, uint64_t size) = "\tu_a=3D0x%" PRIx64 " gpa=3D0x%010" PRIx64 " size=3D0x%08" PRIx64 -mshv_remap_attempt(uint64_t userspace_addr, uint64_t gpa, uint64_t size) "= \tu_a=3D0x%" PRIx64 " gpa=3D0x%010" PRIx64 " size=3D0x%08" PRIx64 -mshv_find_slot_by_gpa(uint64_t gpa) "\tgpa=3D0x%010" PRIx64 --=20 2.52.0 From nobody Sun Apr 12 05:51:24 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770907906; cv=none; d=zohomail.com; s=zohoarc; b=jxoutjT0tcQGVCUoUaRW7guucoY4DDPl3T+5xHw7vjDx81fzdTNBITH8pMYIR193tvN/5xAIjqv/axuPUEPHBCKucuNkVsUahU0xSen1L2AhTsgkhLgWKIBMJw1AusOd+Wueey/SBcwjiwzv9aWkrZHpvoY7Y0VCXzu237c80PA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770907906; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ib0hoRv9v6QkqLlSYdriLq1dMc7eH7520dLic6nJ728=; b=JiBjHT3BnvblVwhx1nvCsI8dTMe03rMU5yquCJr3GYiK0HV+nNQYNetcP3ToxYrkZ9ElUs7kvVNw+XA8jJKNUAzqFbmCMAcSYd+h1goCr8bZq7D1Yy4K8+606muqZwmMfb33b/DEVx1aDNNrTl555194EEhZdrKf6OH3pdH7fEU= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770907906043308.65167955417894; Thu, 12 Feb 2026 06:51:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqXwC-0007jX-ES; Thu, 12 Feb 2026 09:45:00 -0500 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 1vqXvg-0006rS-Kx for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:32 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqXvd-0006JU-BH for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:44:28 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-103-Bhr6la28P3y6ggH3ryAiPw-1; Thu, 12 Feb 2026 09:44:23 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4836b7fbf4fso5784805e9.2 for ; Thu, 12 Feb 2026 06:44:23 -0800 (PST) Received: from [10.60.241.123] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835d994670sm101584295e9.4.2026.02.12.06.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 06:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770907464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ib0hoRv9v6QkqLlSYdriLq1dMc7eH7520dLic6nJ728=; b=dRiK87sBXFytobK8DGfPrKw5jVG2MW4pWX2Uksxw5EPHI9LOL/xNEkm3R0p35TE8++3B4S s93Eiyh+55LOHjPoRXHbXy5VGV1C6sA8ZB3pgLTn3g5p1CcflgyHw+hegjQk8EjES4ka6G WA1GSmBafdBGnbN1DsOx96HgD6xATCo= X-MC-Unique: Bhr6la28P3y6ggH3ryAiPw-1 X-Mimecast-MFC-AGG-ID: Bhr6la28P3y6ggH3ryAiPw_1770907462 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770907460; x=1771512260; 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=Ib0hoRv9v6QkqLlSYdriLq1dMc7eH7520dLic6nJ728=; b=fQzPg9LE+Svfo5XtRL8/EHV7tKpzgjHXiu7kSPPDtaK0Gx9aoTZ+4dADpvQDSTUA3u 2OyFdOlSghVz52aNQ+kdDWU+GKu0Fp7OYs3Bv9gKyHwbXA/uId2XcNrEZboEd291KkgP eu8fgq4H6nQHyp3N4F6nTMTrNe6hWATFJOWdqm6NfJIjWV1DJ5j4eNurXuT9ulz0nUNr NC3FUoyXYbUNLUCuwxbUkdMVkO83myJ9C6ph0gpQqDaMmhlv/oGTmp4tsH+WW32NJBKL TPVWde9PjSO/Y9Du3yGP/WB1BpSBoEqkOZc3g8xHid3qrJPoZ/Do0+jLBq2n2W76KNGq Pz6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907460; x=1771512260; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ib0hoRv9v6QkqLlSYdriLq1dMc7eH7520dLic6nJ728=; b=NW+OuLP8a1RzpOj4pAt2ydhNKXzLEW2ksmvDBms4XgI2BBwGALK4A/GuEknUylht15 0bVi3z6nOUW4f/WC8t8lNXWe7kifKIYTrdJD6Q9pCRc3bhsYRPXxWH3t4TkhxzWTUYZM g+CfrHku51+fGt3waCDGN40w656h5i8Zae6sSj81RtmXCoX0UbWZINIIH6fD+FJ6fmIF tdXGT7Y0TnWDkWVVZbl0NjC/Qy0m+XlPrI/wjkzkI4nWLnDQoaS836kEybFS7EsMf8eU itNZZuMuqoC5acQT7LAv6fz5N1GNmERMhzlgOMVmSjw8Ti6tFaOH5WF1kcfSEWaXTLVf mWZA== X-Gm-Message-State: AOJu0Yw7kVXxo2FmCl3YH7l++hEWtdWU8QBBpgagL1XxnelrKyNkGBhR lB/sbNkBLuqK0XpYW2gcB1KPJIqU+cFH2k+YMzfdxAKhMlh3KyMLpMw/i/6+3uYOqnGzGxBm046 bLArSfQam0WNCWdlYqDeIo+RJh5JKgoAf8cv5mjvD44+GBME14Gk2pXurZ+oYN2fivsFousiy5B l3IA2E8kElnA00KjLZCMo5/y27I1xMEtWv7nnkcK5h X-Gm-Gg: AZuq6aLpBvoGCFl0rA7M8m2TZKecmFWEU+DIDIvaetAzVNWAc4iba6wgB7q6fKRTjdw DCotMZkT26dRJXHn2ikV4Q36JJoTirnWn1/3h1Y/KuI4w1W94WAcguLnV358jRN8SV91ME9qlWh H8oqh4vqhZSAQ/dFBHJS34Ze8jqJ1zptFmvvm0R2nFpay3UZ34KVdqcZaiLHY34btPtEA8yXGY+ bGnvBsOt0TR2dim+rmmLlGfUDwbrydDRYZXPjLHLQIX+yqDVW2YpV1T2tVl8TeZjWQysKfF224u ouHsLSBL0mzyWcdlh7wHDyKw6TFjahJF7Tx2vP/wn7WfTwL8pVVNdPdX6sd/Mq1M1sOg4TdDNR9 e1pqCKsmPfBju089cgwgoKvaWs+ImT6hWF/El2FYLxBRQuUoSFaGChgofwTuiuvnl0rISyYU8/F w01rML32+rpRddQoOgPaDDDeZ6kJLcs7gJbmEF84x+3sLrVKyex1k= X-Received: by 2002:a05:600c:4584:b0:47e:e2eb:bc22 with SMTP id 5b1f17b1804b1-483656b08cdmr46720905e9.5.1770907460467; Thu, 12 Feb 2026 06:44:20 -0800 (PST) X-Received: by 2002:a05:600c:4584:b0:47e:e2eb:bc22 with SMTP id 5b1f17b1804b1-483656b08cdmr46720315e9.5.1770907459856; Thu, 12 Feb 2026 06:44:19 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Magnus Kulke , Wei Liu Subject: [PULL 41/41] target/i386/mshv: remove unused optimization of gva=>gpa translation Date: Thu, 12 Feb 2026 15:42:43 +0100 Message-ID: <20260212144244.22579-42-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260212144244.22579-1-pbonzini@redhat.com> References: <20260212144244.22579-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1770907908131154100 Content-Type: text/plain; charset="utf-8" From: Magnus Kulke The removed parameters are remnants of a prior attempt to optimize gva=3D>gpa translation. Currently there is only one call site and it's not using it. So we can remove it as dead code. Signed-off-by: Magnus Kulke Reviewed-by: Wei Liu Link: https://lore.kernel.org/r/20251125120852.250149-1-magnuskulke@linux.m= icrosoft.com Signed-off-by: Paolo Bonzini --- target/i386/mshv/mshv-cpu.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/target/i386/mshv/mshv-cpu.c b/target/i386/mshv/mshv-cpu.c index f5c388eb87c..f190e83bd15 100644 --- a/target/i386/mshv/mshv-cpu.c +++ b/target/i386/mshv/mshv-cpu.c @@ -1336,23 +1336,19 @@ static int read_memory(const CPUState *cpu, uint64_= t initial_gva, return 0; } =20 -static int write_memory(const CPUState *cpu, uint64_t initial_gva, - uint64_t initial_gpa, uint64_t gva, const uint8_t = *data, +static int write_memory(const CPUState *cpu, uint64_t gva, const uint8_t *= data, size_t len) { int ret; uint64_t gpa, flags; =20 - if (gva =3D=3D initial_gva) { - gpa =3D initial_gpa; - } else { - flags =3D HV_TRANSLATE_GVA_VALIDATE_WRITE; - ret =3D translate_gva(cpu, gva, &gpa, flags); - if (ret < 0) { - error_report("failed to translate gva to gpa"); - return -1; - } + flags =3D HV_TRANSLATE_GVA_VALIDATE_WRITE; + ret =3D translate_gva(cpu, gva, &gpa, flags); + if (ret < 0) { + error_report("failed to translate gva to gpa"); + return -1; } + ret =3D mshv_guest_mem_write(gpa, data, len, false); if (ret !=3D MEMTX_OK) { error_report("failed to write to mmio"); @@ -1407,7 +1403,7 @@ static int handle_pio_str_read(CPUState *cpu, for (size_t i =3D 0; i < repeat; i++) { pio_read(port, data, len, false); =20 - ret =3D write_memory(cpu, 0, 0, dst, data, len); + ret =3D write_memory(cpu, dst, data, len); if (ret < 0) { error_report("Failed to write memory"); return -1; --=20 2.52.0