From nobody Sat Nov 15 09:23:59 2025 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=1752778327; cv=none; d=zohomail.com; s=zohoarc; b=MKvvYIYcyg2ust+3z0cTGB8lv/RUsLMHi6Jgk67o0qREqzY5HIF89Z6S3/glPWWdDnwAvNvvr9UCU88bUVFWcic1bjCr4hKDG8FXn8H3tqTC4oRjVgUGXYKI/KJHzA8W7b2ZkEYjXTQeUpkzbY6K56vvRI7YPumaG5T716GVQx8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752778327; 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=PLrQp95rvm2mOaUAqrOiIgoBJpm3/ZUBPdW5pZC03uU=; b=n6ehj3RzVT1ClR0V57Pz7cdfCtam4m/40cK7JD5Dm0AGvTqtfGH20gcRqsx42XVP0RaNVN7KjMXe9ozNQLh6podR0gZOy28/dXvP20yVykzWteKvReaftal/O6ZRMnbYHIJ+EUkhkT+Rd8UcDO+tlopM6RCIQABDGWPmB2MeiPc= 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 1752778327750569.8870877611885; Thu, 17 Jul 2025 11:52:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ucThf-00081A-AW; Thu, 17 Jul 2025 14:51:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucR8d-0002tk-Gr for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:30 -0400 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 1ucR8b-0002Fx-P1 for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:15 -0400 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-349-uI2ASmdsPtiGg8u6t1k6HA-1; Thu, 17 Jul 2025 12:07:11 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-453817323afso7991155e9.1 for ; Thu, 17 Jul 2025 09:07:10 -0700 (PDT) Received: from [192.168.10.48] ([151.49.73.155]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45634f4c848sm27537025e9.4.2025.07.17.09.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jul 2025 09:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752768432; 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=PLrQp95rvm2mOaUAqrOiIgoBJpm3/ZUBPdW5pZC03uU=; b=NCtF0OlOIgk9N11OB97WUUIuo1MBFh529wE+NoatHbHw3w2Yc1+7ELFVZnTKSJsTycrAa2 gyd+uH1mdij5q+kv63yrNyf+YiYA7uBW6yCS12wlHpxcqyLuXjvL5OOy0+/mwdonY/CJgT 7cNKtEMegMKULAgLqZz3CsiAiU4rsDU= X-MC-Unique: uI2ASmdsPtiGg8u6t1k6HA-1 X-Mimecast-MFC-AGG-ID: uI2ASmdsPtiGg8u6t1k6HA_1752768430 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752768428; x=1753373228; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PLrQp95rvm2mOaUAqrOiIgoBJpm3/ZUBPdW5pZC03uU=; b=vRG+bh68wZfGp08CxQHKvYJ7CWnOIi40vy3chlicXDcp7p4axrJWeR6TcKoIb7nPuH BNZmqjW6OI5lmIqA9qveYIBWrG3khNU9RdMqex1flFIQdqG4h2qXMXodScUPE099CXUs mxIu/VbIDvaFZFltJtFsO9bQGmuID35iKFZR+19W8EXgdXAabu6LPNlI8uOU3JODiFJU 7zQWddt8rZGB1BOyBeDwGvUSa+6zT82FjeYK3M8jf9+qlst5BZpAcxjJAdoTMLF61Lql U4BS9oBEmv8Hrb6NTi3xTLK98bgP+OvbQUhpxc+tvrqFDVMysYuLSHAkPe668gQY5F1W k/JA== X-Gm-Message-State: AOJu0YzE0gDalDWKCIidQl90A8goehjKP1DXf/A0cG4foQKWA7TT/0Dl ZpVcPyO+Q8ps62JTIaPO+8qYdFisWPeDvjipfPf33mbB1IDsgW4TwsDoUg2md150ZPxrRcuaF1e ldEItI/9HsJsGnId1cqoCEANM0FRwOWYFq5I26GRFP4iYPNeVudT1hIr++F+Cooj8KG/3JpCtgy b6PdarBczBJvS2HEU+DvsU59qtEDcFL17EhswPKUdn X-Gm-Gg: ASbGncsSy/Qntd1q28xJhFLY1pol3MB9ntpUzKbuIVOcBkkTLgMmph8yINh70JyrCvs cYixQVHohiapDe6WgMcz4F3x8VMOOISpyBt8asfzseSEIJ2W/oJ3aV7Si2BRkGWRHRRJLrBCgD4 d/xcjlqlbJVHbA0GpbMya9tXRctlTwzcMLDdGr85H0kyPcj3Clfg4JGMT0GSDM2d4lSetmBOK5p JvH6c11UKcowtpTYRCN7y9VXu40HL72anWl17onIojjrXyKakwDAMezApNW5caEnaJtO6RILrOn 6y+c7+cSU+zxYtOvfR7FkF80FH5TZWG0xZlQJ44MiCM= X-Received: by 2002:a05:600c:3b29:b0:453:7713:546a with SMTP id 5b1f17b1804b1-4562f164b1bmr80081325e9.14.1752768423699; Thu, 17 Jul 2025 09:07:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdGQzMTN+ad5BHVXV7gltb3idOqFI05xWmY6qv2AqFAOMK/pm8K/0ir4Kl8p5iFOJ3m3KP+A== X-Received: by 2002:a05:600c:3b29:b0:453:7713:546a with SMTP id 5b1f17b1804b1-4562f164b1bmr80080645e9.14.1752768423116; Thu, 17 Jul 2025 09:07:03 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Alexandre Chartre , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Xiaoyao Li Subject: [PULL 1/6] target/i386: do not expose ARCH_CAPABILITIES on AMD CPU Date: Thu, 17 Jul 2025 18:06:55 +0200 Message-ID: <20250717160700.357384-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250717160700.357384-1-pbonzini@redhat.com> References: <20250717160700.357384-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_H5=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: 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: 1752778330827116600 KVM emulates the ARCH_CAPABILITIES on x86 for both Intel and AMD cpus, although the IA32_ARCH_CAPABILITIES MSR is an Intel-specific MSR and it makes no sense to emulate it on AMD. As a consequence, VMs created on AMD with qemu -cpu host and using KVM will advertise the ARCH_CAPABILITIES feature and provide the IA32_ARCH_CAPABILITIES MSR. This can cause issues (like Windows BSOD) as the guest OS might not expect this MSR to exist on such cpus (the AMD documentation specifies that ARCH_CAPABILITIES feature and MSR are not defined on the AMD architecture). A fix was proposed in KVM code, however KVM maintainers don't want to change this behavior that exists for 6+ years and suggest changes to be done in QEMU instead. Therefore, hide the bit from "-cpu host": migration of -cpu host guests is only possible between identical host kernel and QEMU versions, therefore this is not a problematic breakage. If a future AMD machine does include the MSR, that would re-expose the Windows guest bug; but it would not be KVM/QEMU's problem at that point, as we'd be following a genuine physical CPU impl. Reported-by: Alexandre Chartre Suggested-by: Daniel P. Berrang=C3=A9 Reviewed-by: Xiaoyao Li Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index e8c8be09bae..369626f8c8d 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -503,8 +503,12 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uin= t32_t function, * Linux v4.17-v4.20 incorrectly return ARCH_CAPABILITIES on SVM h= osts. * We can detect the bug by checking if MSR_IA32_ARCH_CAPABILITIES= is * returned by KVM_GET_MSR_INDEX_LIST. + * + * But also, because Windows does not like ARCH_CAPABILITIES on AMD + * mcahines at all, do not show the fake ARCH_CAPABILITIES MSR that + * KVM sets up. */ - if (!has_msr_arch_capabs) { + if (!has_msr_arch_capabs || !(edx & CPUID_7_0_EDX_ARCH_CAPABILITIE= S)) { ret &=3D ~CPUID_7_0_EDX_ARCH_CAPABILITIES; } } else if (function =3D=3D 7 && index =3D=3D 1 && reg =3D=3D R_EAX) { --=20 2.50.1 From nobody Sat Nov 15 09:23:59 2025 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=1752778352; cv=none; d=zohomail.com; s=zohoarc; b=Gf7FqveIZqSsXZL/4WaVoI7+JiyzoHXPTBBVH/w2E6HJWBJFf8eYYHIAbD5/LCNdZ2jY7locd4VSJFQlu1GOfmhSETSXaXUnV3ayB9iXFfkGIGbGZu7CBMkCDl1oz0o/QQIWK+RhVRYgpwQirKtvk+xCFiBgLKHZd7O46XAPt2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752778352; 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=7Xv86/Rz+8Kqo5xHCX7FN9w/MZvl13ciifCpIY3ePjE=; b=SH1udywu6lq1rZu465nD5AOEJz1B7AwT8+CNHGDrtypstW0d6hR8v2XRhrOnqfJVloeRlFx/pSKD/PHmUpa+wJ4b4XHiJDLFgKlh8Mz6TlksilZsf+ANJw7I3shXjFVwrVTq4hgv3rEWLC9DfP4wkfUtyX1LJ7JdTNALThg9hmk= 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 1752778352326285.8162069665567; Thu, 17 Jul 2025 11:52:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ucThq-00087q-6u; Thu, 17 Jul 2025 14:51:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucR8b-0002tV-Tm for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:30 -0400 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 1ucR8Z-0002FY-FS for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:13 -0400 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-582-xNmZR99gOsetjEJBYIJwfA-1; Thu, 17 Jul 2025 12:07:08 -0400 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-3a5058f9ef4so499401f8f.2 for ; Thu, 17 Jul 2025 09:07:08 -0700 (PDT) Received: from [192.168.10.48] ([151.49.73.155]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b6162a93e6sm1852558f8f.82.2025.07.17.09.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jul 2025 09:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752768430; 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=7Xv86/Rz+8Kqo5xHCX7FN9w/MZvl13ciifCpIY3ePjE=; b=MI4s6AekRDGKVYJKM+2Ef4LFbCF7AjOmDPGebW4Tx5AAJtu3i/+5rhBfrk4hQGyaNHpJoe Ixor/qZqymNmLm22jRzahWfVpeRnuUKW3Ityyi0Yl+mWMViwsE1fztZ5tzv23ChwiicOln JZP6aeSBvYkL8Qzt0F7GAai7t0LDlD0= X-MC-Unique: xNmZR99gOsetjEJBYIJwfA-1 X-Mimecast-MFC-AGG-ID: xNmZR99gOsetjEJBYIJwfA_1752768427 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752768426; x=1753373226; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7Xv86/Rz+8Kqo5xHCX7FN9w/MZvl13ciifCpIY3ePjE=; b=vF6yxj1N1Psr9U4suh6jgdglHdWrSNo3KZAxRaBe9dWbTjKcjIT2P13CT7LAx2yE+9 dV3/PPn9Q15j+tsgmhfN9vswvvlVTD4AUhb0pRCpAZ9UoZ2Amhwr02deoH55xQ0QhZx1 gJrVKZmB6pvt104Dy8Wb+yCCVNTT6Wf00j4DbUV4EAXI4pqhYT6nHLU3TEXzHqqmZb3x OTNN6Koqab8S6jjntkULqJITwP9cuWk4YnS4i5x7GXTLZ/Eeqx5XLeptryn09Nk3wNP1 QyenZqu+AwFfjeBhb2WLcR+hQktWwm7EmgijRmVF3eSRWXDxYX3DmjLno8epbu9cUp5o mkhw== X-Gm-Message-State: AOJu0Yx0Rf2Q5TPQsPK+Rv3ZWw8Rf3KbHkaj9nCBAf+fQWSScFdo63y1 /yyJ2beRCOjnUgXW4clD8BwZtSGlbNIt0B29ZXI8CH4snyqRGKP27VgQNREjyy8f7zxXA8PUFN+ r4I28OmUCFCgz3MYUoZ8S7Hs+DRohyzt5U/yID8+320SHwbvRkk1+YHoSebiKlsNh+UdO8X4l8m Ew9FDOTx7oUNCQFVIZ4ZZ/9pRvRFGQLCZtat7Du8ZT X-Gm-Gg: ASbGncvWl7N8GF7O8AK4MM4AssXIyYO0d3qQUZH61oetlOyIgIsLIMfq22kpjO+d6Nb tq6H5+AriVZ2650BHjH5vgY4s1rYcbD75apGsll9hXX0pd+uWN/w4tvH1U1lH9DYwmGnw5Ayv3e drfZFZOgO2N6ZdGxbPha+78+e17QS5AJ7j+epSKia5VKBqZ6zjcbkHshwDBUwpmW/GBzkPVwhir molQ2fbmngGHR4FQb2VVPo3ei+ucHapjYNXlXsDhHO1+b7gnEmjuy/0RmZ3BWQuCKCWLs3zTb+S LaPmFEO1roInC2Wk/GBjCmIrDsDzFhPiS8ewvslbh9g= X-Received: by 2002:a5d:5d11:0:b0:3a6:f2da:7fe5 with SMTP id ffacd0b85a97d-3b60ddc6571mr6272929f8f.55.1752768426091; Thu, 17 Jul 2025 09:07:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG205Dm1hDo999L732GfedWbc/XMw1E0SZLAPyGDcoIdkGafkDNbYw7deXiimsBZlfSJYMzvw== X-Received: by 2002:a5d:5d11:0:b0:3a6:f2da:7fe5 with SMTP id ffacd0b85a97d-3b60ddc6571mr6272868f8f.55.1752768425425; Thu, 17 Jul 2025 09:07:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Abeni , Xiaoyao Li Subject: [PULL 2/6] i386/cpu: Move x86_ext_save_areas[] initialization to .instance_init Date: Thu, 17 Jul 2025 18:06:56 +0200 Message-ID: <20250717160700.357384-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250717160700.357384-1-pbonzini@redhat.com> References: <20250717160700.357384-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_H5=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: 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: 1752778354904116600 Content-Type: text/plain; charset="utf-8" From: Zhao Liu In x86_cpu_post_initfn(), the initialization of x86_ext_save_areas[] marks the unsupported xsave areas based on Host support. This step must be done before accel_cpu_instance_init(), otherwise, KVM's assertion on host xsave support would fail: qemu-system-x86_64: ../target/i386/kvm/kvm-cpu.c:149: kvm_cpu_xsave_init: Assertion `esa->size =3D=3D eax' failed. (on AMD EPYC 7302 16-Core Processor) Move x86_ext_save_areas[] initialization to .instance_init and place it before accel_cpu_instance_init(). Fixes: commit 5f158abef44c ("target/i386: move accel_cpu_instance_init to .= instance_init") Reported-by: Paolo Abeni Tested-by: Paolo Abeni Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20250717023933.2502109-1-zhao1.liu@intel.com Reviewed-by: Xiaoyao Li Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index da7d8dca633..251d5760a0b 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -9619,6 +9619,16 @@ static void x86_cpu_register_feature_bit_props(X86CP= UClass *xcc, } =20 static void x86_cpu_post_initfn(Object *obj) +{ +#ifndef CONFIG_USER_ONLY + if (current_machine && current_machine->cgs) { + x86_confidential_guest_cpu_instance_init( + X86_CONFIDENTIAL_GUEST(current_machine->cgs), (CPU(obj))); + } +#endif +} + +static void x86_cpu_init_xsave(void) { static bool first =3D true; uint64_t supported_xcr0; @@ -9639,13 +9649,6 @@ static void x86_cpu_post_initfn(Object *obj) } } } - -#ifndef CONFIG_USER_ONLY - if (current_machine && current_machine->cgs) { - x86_confidential_guest_cpu_instance_init( - X86_CONFIDENTIAL_GUEST(current_machine->cgs), (CPU(obj))); - } -#endif } =20 static void x86_cpu_init_default_topo(X86CPU *cpu) @@ -9715,6 +9718,11 @@ static void x86_cpu_initfn(Object *obj) x86_cpu_load_model(cpu, xcc->model); } =20 + /* + * accel's cpu_instance_init may have the xsave check, + * so x86_ext_save_areas[] must be initialized before this. + */ + x86_cpu_init_xsave(); accel_cpu_instance_init(CPU(obj)); } =20 --=20 2.50.1 From nobody Sat Nov 15 09:23:59 2025 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=1752778980; cv=none; d=zohomail.com; s=zohoarc; b=NymDAKh4ls0itAI/qh8o+Tdt1j/aptOAYPt2pwZvPzmSBialMpBNukZ3zuhXdP2QA2pNZeWPML32I4gbX+x21WQd9P1sNgKxOQzaF9q2jc10EoZmgKDZqN28et9IENE2nMhvVMoJl2kfDp3mL19+PeIyVA+AxnU3EjnZ92pdCqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752778980; 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=SqG2DiLmplhxW74U3B4JYB/l83wKcoDTCpLDYKMWsIY=; b=LsB2K2FBcQ27ulPtBLWmLZPAbyF1nJWu8aTK06d856xtCcLIV0pjrlM6TDuQT1VTAVYQtebcSsQplTAavrR71amUDIFh8C5ZpbETu5OXJKuGObhQeQWfOpKTWs0mU23KUio4HI0xkI55UAdZwRpO6fzVq+U3PSMAdkjzs11kPHo= 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 1752778980920171.14176306868956; Thu, 17 Jul 2025 12:03:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ucTrw-0001R9-0j; Thu, 17 Jul 2025 15:02:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucR8c-0002tY-Hw for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:25 -0400 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 1ucR8Z-0002Ff-P4 for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:14 -0400 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-450-pu9y_Z34Mr-g4Dr5nd8tMg-1; Thu, 17 Jul 2025 12:07:09 -0400 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3a4fabcafecso564141f8f.0 for ; Thu, 17 Jul 2025 09:07:09 -0700 (PDT) Received: from [192.168.10.48] ([151.49.73.155]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45634f9be79sm26041165e9.31.2025.07.17.09.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jul 2025 09:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752768431; 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=SqG2DiLmplhxW74U3B4JYB/l83wKcoDTCpLDYKMWsIY=; b=Zy6TvkslWFk62kxvMGvgHAQopcDMeUCPd1TIN/9VRlRgLwADm3MANIHbXm1elQprU84TU0 CKH9N5hGIJLaoZTcS8FpAZYMeVYlmB+tVATQhPHh2taf/Rtx+RjOu4HLfLzXJJG8rrAPsK 7zocFbeZJUNkUchO7G1qFos6vLQ+Z10= X-MC-Unique: pu9y_Z34Mr-g4Dr5nd8tMg-1 X-Mimecast-MFC-AGG-ID: pu9y_Z34Mr-g4Dr5nd8tMg_1752768428 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752768427; x=1753373227; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SqG2DiLmplhxW74U3B4JYB/l83wKcoDTCpLDYKMWsIY=; b=evJqAXvJPBzh1BBobaxSzDIY14fzRqGFmtmXVhOSCuXuHg/zKQAvC9rs+dcFBoZ/HC wwDGTtQ/SLCZyG+WzTuII+oHo0rcvnAsLOyjRzIy+/10/tgcVPT19t6Uzg4OtvuaEuA+ 6r649QAoG9pqlP6mm8QdYzlZcpg06dhktO7IuWIbH3O2bBtIy/TzS2yd5FyjuvSVvIrN vcLiz3IOWhraYB7tUiwJ4kmVN4ysm1IvSpJM0TFE+tBYLCzLVJ+HECH7Nk9oXS+URfPB TpMFhZ2fv0oZnafFYrwwBY8wDgBWEvuYozSwaBVMbIpY44hpGc0vcRxFFadRroMnNSSL Q/iA== X-Gm-Message-State: AOJu0YzcH7qWsSx7GzYTAObtJvG934Yh19bKNz8GW9VMSctnON1V2SPe Yn8x8iVRQ578ZksFcR3fL+1gZuOoI5n3GciyaojmNlNpvKU0fAMFkdippawbKCaJ+HA9rg2CAnX gD17gDU0aoPfwlFRiYawH5OxG65y868RTuodm39yGkwFVjjesnT+8VilyEfHj6cRsi/KYLd8rbv KpGt7gdLPliJkvNDpOAEfGcGg+ILjvhr7teEPxUYX1 X-Gm-Gg: ASbGnctT9WJcvV1jByZg7431bt6+90Pium7/ybmj/V0LsLLKt4B3to5ODt+khx4t/ys f3NSVesA/gvxGJOLs+8zD7p9m+6aKsOXZ5W5DfKhv4tVetp1ceMddVV3QBf5gNzAhbNWUvm/prQ DON/C41V3WIBOs2TER7tq/zI4haJPdFrPDJn1EvfcTt2SFAVvezyVtt2Kn5RLUManageQ1e/isf zBvWuJBEJHieQWuMrsT0DVFozN6DilWR11zS3clRVc4rJPDlhBgVUPC5XJtfQYglWnjX2apXIW4 nTw7hE/2sIz5Q6wniC7orSvE2+1CLsKMakHMkz0vMaQ= X-Received: by 2002:a05:600c:3545:b0:456:1a69:94fa with SMTP id 5b1f17b1804b1-4562e03e75cmr75700815e9.13.1752768427578; Thu, 17 Jul 2025 09:07:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6sbt6o/3/zL6vOStW+JrKbl03z7JNjtTxqZLoirepd2ne7ncufP1U79cXNOG4U8vxmm1ntg== X-Received: by 2002:a05:600c:3545:b0:456:1a69:94fa with SMTP id 5b1f17b1804b1-4562e03e75cmr75700245e9.13.1752768426989; Thu, 17 Jul 2025 09:07:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Stefano Garzarella , roy.hopkins@randomman.co.uk, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 3/6] meson: re-generate scripts/meson-buildoptions.sh to fix IGVM entry Date: Thu, 17 Jul 2025 18:06:57 +0200 Message-ID: <20250717160700.357384-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250717160700.357384-1-pbonzini@redhat.com> References: <20250717160700.357384-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_H5=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: 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: 1752778982727116600 From: Stefano Garzarella Commit 84fe49d94a ("meson: Add optional dependency on IGVM library") was inconsistent with the contents of meson_options.txt and the one generated in scripts/meson-buildoptions.sh Let's regenerate the file in this way to keep them consistent and prevent future changes from including the spurious diff: touch meson_options.txt make update-buildoptions Fixes: 84fe49d94a ("meson: Add optional dependency on IGVM library") Cc: roy.hopkins@randomman.co.uk Reported-by: Daniel P. Berrang=C3=A9 Signed-off-by: Stefano Garzarella Link: https://lore.kernel.org/r/20250717131256.157383-1-sgarzare@redhat.com Signed-off-by: Paolo Bonzini --- scripts/meson-buildoptions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index e8504689e80..0ebe6bc52a6 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -130,7 +130,7 @@ meson_options_help() { printf "%s\n" ' hv-balloon hv-balloon driver (requires Glib 2.68+ = GTree API)' printf "%s\n" ' hvf HVF acceleration support' printf "%s\n" ' iconv Font glyph conversion support' - printf "%s\n" ' igvm IGVM file support' + printf "%s\n" ' igvm Independent Guest Virtual Machine (IGVM= ) file support' printf "%s\n" ' jack JACK sound support' printf "%s\n" ' keyring Linux keyring support' printf "%s\n" ' kvm KVM acceleration support' --=20 2.50.1 From nobody Sat Nov 15 09:23:59 2025 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=1752778659; cv=none; d=zohomail.com; s=zohoarc; b=UQ2U1a5nFdXHkWA9kX2jxyuaeSzQpm388OgqtiiqtDP8NomwcF/gQ2DUFYD1x3AkUCx6sXwiouFoLoMGeVYKZE8R5bqv38LZD4aZsSPqw4GywUp+1swG5WasDGYu024Rvs8kIXPm2H67NZC/fBFV7sCQ0zy7k3sA1pcKJ19UBOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752778659; 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=XDBnlPqeGv4rwPb8eQVz5uOF6kllE9KhwMqiqUrgjcE=; b=QICw4RynK0Q9J10kv4bVEOdNGizoCJ/spAz4HiKuryK3OPr6Jf1en1M67eAW4MG5pu7y9HVPFV4pQ4zYNthcMQfxPr2Tu3WQ2louoIuGvgB861EOB/rrU9UiJ2xlpRIsX0JUUXpXen7dJ0MR3Ny0/MkHsx3JPagJZm2pgZH+kbU= 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 1752778659095891.2019367041505; Thu, 17 Jul 2025 11:57:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ucTm0-0004mF-3H; Thu, 17 Jul 2025 14:56:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucR8m-0002uq-Cq for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:32 -0400 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 1ucR8e-0002Gl-Oo for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:17 -0400 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-620-PWbRZiTrNOKeuyx7V41frQ-1; Thu, 17 Jul 2025 12:07:14 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3a5281ba3a4so794922f8f.0 for ; Thu, 17 Jul 2025 09:07:14 -0700 (PDT) Received: from [192.168.10.48] ([151.49.73.155]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b5e8e1e2cfsm20840222f8f.75.2025.07.17.09.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jul 2025 09:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752768436; 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=XDBnlPqeGv4rwPb8eQVz5uOF6kllE9KhwMqiqUrgjcE=; b=A++TT8itp7jx32yjP3X4KYNPllyuUeDR29mYYGk9S6rBUDlu7axGEacgWOklGTIlCn6mFQ lAjli8XvQOTZoOxvgIrSwI5VMxDBQE3jyxd2XaW5tvY12jFG8c3EtEvPOsg9BminoDAAUN 3kjeqGppe7ct8dcKb1YyNoPMQj7TSds= X-MC-Unique: PWbRZiTrNOKeuyx7V41frQ-1 X-Mimecast-MFC-AGG-ID: PWbRZiTrNOKeuyx7V41frQ_1752768433 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752768432; x=1753373232; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XDBnlPqeGv4rwPb8eQVz5uOF6kllE9KhwMqiqUrgjcE=; b=l/lUKYn5zqKIkFNf9AHqUe2GftzNrFgYMlhMjCIc2ivzvJer9VO2pa/KlcSr/IdlUE t5Ndkg1gLP0F6NMejDFBXk87Y9TeQF+AT0N8JwtZjX5de21GEQnDroY8Tf2kAi0cooN6 IIT3j01hs2jWi9AuKMCDvY75efuix2mkF1aq+I+jRp3dbflDPCpu+UIDLXWVJeKzuaiA PSwdprLrgv+QJF08VNG1ihW+b74iDiHdVRQVuvkqNEgU8pqZAho0P+1YdS2vRrXCQEGg cEUZMbi0aWeHx8cGv/kzZN8G8ioZb4Dk8/lq7NXsmoceBF5t0Odfq5sWkYmPHJXLWzQ6 z9jg== X-Gm-Message-State: AOJu0Yzp5qZbeK0jbYfaNROPTjwzdnrCquIP9CctKbL36JLHP730x6Sx G4svotxQjyuF/SDGVUfZnUJ6f4sgNZQFZeHIK9Dvy/PjUN2DEMvzbPu2e/1zv55lOfsll9A9/3f Y8hgKuyXgu/oJmaCyxo5Wd5qkMqjSd6H58375vu6I4jdKGk9rTkVg1St+1qE1gdQscldpJSYwDW YdyyWo7/PVINTOhAIGuSwDnA27gM4fGRD9wb3Ht6L1 X-Gm-Gg: ASbGncuUCp1pfuoQ3FClaKab8HhE/3Uml5z1zAZtUDOCyvMdpu9oexM6tnOORP2274S Y99lChSbviFlx2MPZiac5HpripI4KF+dCxxvD0VLPCJn9fCpnveJ0tDwi0jAjcytrQV0YdYZMxr qoHRnQXTDG06IBelu2P3CZhGxH7I3Q8z+6wjqyONelS+wJHC0ip1o6ItKWK7lvMzqujgn6Q8xvr u3FmndjR/H/Jta5dtgIDsi+Dv9Uyk2lhfcHsJMHHHZqZ5xqSFrhP/rRW+35VDaUX/uXDQA0grM8 j2aNk80P3AjZaIsARuO+J3qv0M/vDvrunxH2R1F2KmE= X-Received: by 2002:a05:6000:2d81:b0:3a5:2848:2e78 with SMTP id ffacd0b85a97d-3b60dd7a9cemr4362076f8f.28.1752768432059; Thu, 17 Jul 2025 09:07:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvLUtCRYbDv9ccuADerlNA1hmLwN76YfXv7CG6kJvfmSXOKUdvxTJ8fKMTbicphX72mw8MPQ== X-Received: by 2002:a05:6000:2d81:b0:3a5:2848:2e78 with SMTP id ffacd0b85a97d-3b60dd7a9cemr4362033f8f.28.1752768431337; Thu, 17 Jul 2025 09:07:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Peter Maydell , Xiaoyao Li Subject: [PULL 4/6] target/i386: tdx: fix locking for interrupt injection Date: Thu, 17 Jul 2025 18:06:58 +0200 Message-ID: <20250717160700.357384-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250717160700.357384-1-pbonzini@redhat.com> References: <20250717160700.357384-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_H5=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: 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: 1752778660423116600 Content-Type: text/plain; charset="utf-8" Take tdx_guest->lock when injecting the event notification interrupt into the guest. Fixes CID 1612364. Reported-by: Peter Maydell Cc: Xiaoyao Li Reviewed-by: Xiaoyao Li Signed-off-by: Paolo Bonzini --- target/i386/kvm/tdx.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 7d69d6d7b06..1574e7d76fe 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -1126,10 +1126,15 @@ int tdx_parse_tdvf(void *flash_ptr, int size) return tdvf_parse_metadata(&tdx_guest->tdvf, flash_ptr, size); } =20 -static void tdx_inject_interrupt(uint32_t apicid, uint32_t vector) +static void tdx_inject_interrupt(TdxGuest *tdx) { int ret; + uint32_t apicid, vector; =20 + qemu_mutex_lock(&tdx->lock); + vector =3D tdx->event_notify_vector; + apicid =3D tdx->event_notify_apicid; + qemu_mutex_unlock(&tdx->lock); if (vector < 32 || vector > 255) { return; } @@ -1179,8 +1184,7 @@ static void tdx_get_quote_completion(TdxGenerateQuote= Task *task) error_report("TDX: get-quote: failed to update GetQuote header."); } =20 - tdx_inject_interrupt(tdx_guest->event_notify_apicid, - tdx_guest->event_notify_vector); + tdx_inject_interrupt(tdx); =20 g_free(task->send_data); g_free(task->receive_buf); --=20 2.50.1 From nobody Sat Nov 15 09:23:59 2025 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=1752778685; cv=none; d=zohomail.com; s=zohoarc; b=a0SobpgKs+14u3wWcjMd8EMfl+yC29qg0QVWcg19SpvU53A9PYF0Ee2vKwNRYuSkUVY3uaWnIOp8YDoRXKmIJwkWTIk3RASUPQREY8/G21FkeBL6dT88ZPdUqzgYXK2BcWZaBFax286TpfX1oj/mDj+RpOhiqqHM7+G7wOrUSgs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752778685; 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=2WlmBVN2Qucvf1vEE6nWUJB/kVdkIb8dEtL75AIz63Q=; b=VtZcB5V6bnorrQ+Zy6MJEdv4LDdtE4rlzbfrC8JCaf1HyJnKMg/xICWhbRNV9uSuanDuDlBVrw6Kys+v0VJc4LcqSoakDYl4R7yrvKZU8kiG2PaqCAHjC+tujc+nyHyl8dLqzbwXAtdp26I1n0NYjgK6JOGmw4F9J/6YWmEOEH4= 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 1752778685691808.2004247138715; Thu, 17 Jul 2025 11:58:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ucTm2-0004za-UE; Thu, 17 Jul 2025 14:56:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucR8q-0002vf-I5 for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:32 -0400 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 1ucR8m-0002H0-0h for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:27 -0400 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-674-Guis2k6PNiOkOHCqnV-xXw-1; Thu, 17 Jul 2025 12:07:15 -0400 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3a4f7f1b932so746676f8f.2 for ; Thu, 17 Jul 2025 09:07:15 -0700 (PDT) Received: from [192.168.10.48] ([151.49.73.155]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b5e8dc22a8sm21537275f8f.34.2025.07.17.09.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jul 2025 09:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752768438; 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=2WlmBVN2Qucvf1vEE6nWUJB/kVdkIb8dEtL75AIz63Q=; b=b9txktO4eqxMC+n/D2BEqsVDuALNgdU+/NlvsfA2S22Pz1ti+rAv2GsM+IibCa4N/c2OJi /B1vHwR3hjlDef+EsPqwSqnvtYqdMaxlzTMcUTpocJw5uXrCo8G9mJiFqDuWOvxNVvzY72 3dRK3XI0N6vyOg432pk8HEjNEYLF3gg= X-MC-Unique: Guis2k6PNiOkOHCqnV-xXw-1 X-Mimecast-MFC-AGG-ID: Guis2k6PNiOkOHCqnV-xXw_1752768434 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752768433; x=1753373233; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2WlmBVN2Qucvf1vEE6nWUJB/kVdkIb8dEtL75AIz63Q=; b=ONmee9AnXPgxNi4zDPCzUyHx+6rFZIWExLsA4VvWulyhZBmogt8nOHZCiijYeytlD8 lLpCblW1GtunjfjGED4IaqKmyR53lCoi2zlunWBSyrc5X6+PG1oR3tWNU8pjr3TZr11m GqBKuTyPQZAregUCbf4UdRVZJWrtP6Za2Vpgs5XGWe12s1Viu2lTR9IgbSWPzQVP11Vl wgdiBXcqFubZXRGFckl4sJQT+O2sekSnHSM1qkd1GHC9Ws7p4gjZsGADV/HMd8hREN5/ KPENucsbgNnfjQ5JWmiQhHWSvF5lJAwYMP0ersxQwtJdgV0FQzvHvvwsY6q6qv0Sfnfm Dllw== X-Gm-Message-State: AOJu0Yx7MQGnHPRYRF5cEDl74so/vaeL6vPl708TRbzA1hPWvsITdz6L uzhLLsyBuRC5LeRpL1bKLtA2RcoJszpfikfEniTq8wi0j6swtLYExzUDM8UcKk1qV6YgTOIwbx1 lyL4eirIqqlnwXID1kOjezvJpFAiELBO6N5Qey91hwSMczmfN5LZrn59hEnXTjdOBKtvrf2RxAu plLDR8OaB7uN53tRMO9evFQFatR+coryEdkMv36aRK X-Gm-Gg: ASbGncu1SaTh57OaqUUh+hXJBgoAuD1i48LrfbB0kbmVJz1/b0NTggeiMAWSvOxxOgx 3QvteypHMjIvShIA20hPGPf+y05egCrDpcjgLrDt8i1kT88x8l3hzFISj3G9fA5oIjLwmbl3VGZ MZD6ndC7Y3iZBnoJsy/y2UwFBQt4gwKXNQpTm46TtZqqNdv0lt4NYEhpidTguXzNmNhXPvuHcu0 egmBBZb2kV3UM4zSbGxXOw62Ru/oGSc37b+6jDln3QPrRHGBRGPPEDvQKBOGV1gAgfSHQPWgeNz HG92AlYwswsPGGUT3wt6t0FsMhR7416uTlkdnIy4C4s= X-Received: by 2002:a05:6000:3cf:b0:3a6:d95c:5db with SMTP id ffacd0b85a97d-3b60e4cb61emr5917227f8f.26.1752768433401; Thu, 17 Jul 2025 09:07:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBxF7NwvzEYIrMWoobfi+hBkxyhSRo1CYY1NScwW7whzUJBhehuib06kZ4TbSr/Rt6p3o7zQ== X-Received: by 2002:a05:6000:3cf:b0:3a6:d95c:5db with SMTP id ffacd0b85a97d-3b60e4cb61emr5917178f8f.26.1752768432823; Thu, 17 Jul 2025 09:07:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Xiaoyao Li , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PULL 5/6] i386/cpu: Cleanup host_cpu_max_instance_init() Date: Thu, 17 Jul 2025 18:06:59 +0200 Message-ID: <20250717160700.357384-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250717160700.357384-1-pbonzini@redhat.com> References: <20250717160700.357384-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_H5=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: 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: 1752778686553116600 From: Xiaoyao Li The implementation of host_cpu_max_instance_init() was merged into host_cpu_instance_init() by commit 29f1ba338baf ("target/i386: merge host_cpu_instance_init() and host_cpu_max_instance_init()"), while the declaration of it remains in host-cpu.h. Clean it up. Signed-off-by: Xiaoyao Li Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20250716063117.602050-1-xiaoyao.li@intel.com Signed-off-by: Paolo Bonzini --- target/i386/host-cpu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/target/i386/host-cpu.h b/target/i386/host-cpu.h index 10df4b3a3a7..ee653242254 100644 --- a/target/i386/host-cpu.h +++ b/target/i386/host-cpu.h @@ -12,7 +12,6 @@ =20 uint32_t host_cpu_phys_bits(void); void host_cpu_instance_init(X86CPU *cpu); -void host_cpu_max_instance_init(X86CPU *cpu); bool host_cpu_realizefn(CPUState *cs, Error **errp); =20 void host_cpu_vendor_fms(char *vendor, int *family, int *model, int *stepp= ing); --=20 2.50.1 From nobody Sat Nov 15 09:23:59 2025 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=1752778378; cv=none; d=zohomail.com; s=zohoarc; b=jdy1bpCgNET5wGqUoAtu5nyAg5bWszYNdzO46pM43SLisvcM7OiCoNYboaOq5jPRge0RiRSxjHCDT1XUJp0H9j3nJHt2zPQsYI5ADF/85H6RCb4igqElJw/jRhoZ/IieMxSDa0TdPe+lvKFXXZjvhexmgHEpT0eUuQEp0gGr6hI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752778378; 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=6zxpl/PQRwn3jQnhX2F8Ka6KHfmWqxvN4L1LgBM5SOU=; b=YP0RBIXG859nfMg5cSgaVg3W525jDLDXnQj019roPkLlzUlAClyvvhVgO0+YBZ7K1YnNZukb4Xg8AXM/k7zEOlpsfGB5OPf3dxahbgrC0a+pvn6ci2kleNf9U1dIkg5mUoJjEqRCdMm6f8qR2+4soLczuL9T1YVOWWd21k79wFA= 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 1752778378455659.7597463479914; Thu, 17 Jul 2025 11:52:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ucTht-0008Bc-69; Thu, 17 Jul 2025 14:51:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucR8r-0002vg-3P for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:32 -0400 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 1ucR8m-0002H8-0y for qemu-devel@nongnu.org; Thu, 17 Jul 2025 12:07:28 -0400 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-517-vkbwoY8QMhKfg-wkoswWBA-1; Thu, 17 Jul 2025 12:07:18 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-456267c79deso3751585e9.1 for ; Thu, 17 Jul 2025 09:07:18 -0700 (PDT) Received: from [192.168.10.48] ([151.49.73.155]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4562e886113sm55937915e9.23.2025.07.17.09.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jul 2025 09:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752768439; 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=6zxpl/PQRwn3jQnhX2F8Ka6KHfmWqxvN4L1LgBM5SOU=; b=KnDUx7L5XPUJF/zka/ahU9GUqfnPUGFBSzdUY666zbPO/GjGoywQ9u+Gz72XsH8cFYJZjK hRl8C4B1H5E/FAB6AtT9e/xPMTe7d9m0ZDB1DoAMEKpzR02l6v6RiYxhBOUDjYpntUKr+A WmX7ynbnRJXlYP6ru/WRzEjw+50RT7c= X-MC-Unique: vkbwoY8QMhKfg-wkoswWBA-1 X-Mimecast-MFC-AGG-ID: vkbwoY8QMhKfg-wkoswWBA_1752768437 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752768436; x=1753373236; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6zxpl/PQRwn3jQnhX2F8Ka6KHfmWqxvN4L1LgBM5SOU=; b=fdUnd5E/h7bEvtZG18iGVPuUx0QRfjMHdnszOKPn+coMTMVwgowEq3+wj0/LccjHqC ovyqIZv+0ylpgECLyBapk1ZG45/O61JMomjquAoCOMLtxLUIpXGa+5TIzqqXi6PtDGNk 0RqWdm5lKkYwX+9J1IbrDPlVDhyAkvZgYk4Bws5WxGAF8GOF7gF1KLBUphSGvPD79RR8 FGzzw+39HApNgFW6qgk88LJwtNOw+ipQ4PZjVAu5vmEgdLWLHeBelQ01klLTgeaiAa4/ AXKCOkCJVv/uZdTYmTQhgN+RtsTa84ydWO9jhrLQtI9mrXH0u763w9uMpsLHgDOTth2j lE6A== X-Gm-Message-State: AOJu0YwjdtBbPAwpQNcHGFRVrpDWmyUwq8VZo39AO7SXXlqdMdd2N0Zy lqGR9YMVQCMghF5e6RJDhed4A9wM2Tp/H+pmjvyOM5/wK1uqibh8y55HGogEYrgw16Dug4SqS7g mk3RJWSBrFmQRqMoRe1nZRDjpWFeey+Bq2tOE0pzBZRt4GrrIS6yNsFpm8N2i1cYRAM0xzt9HiW 2avpV0UxpWYp/ZbmYcI47j7/5Uw+fYnZtUkSoI+/Cc X-Gm-Gg: ASbGncuQGJAoPhMi8Q82Y3n5R2sOEWYM3QGfECrRYzVdfD9oG7iMrEMAQ98tD5r7QYL RY/HSEo2pkIY7z4JEVdV9uGrZHcWdBrGf2bt8i7PQoWyQkyALhX0AkAhG5PiCpburSG3gFhY0Sq nVBrUFXxD4p2BZdT5uF0WyUutgDMJeu2f2yYq/pQi2hec1VBx8fYGoCRE6j+qTAkjgciI4iD5+D PXZlMkITp5r1yH6VNfcGIL9yUvoqu0r+lU3VOBu1m3j8E6t9UY9IlWZtnbmch+xslLaqCCoS9p9 wMV276Y2dcIT+Q4Q1RRAbtoQivb4Oz5zAMovxbo3Buo= X-Received: by 2002:a05:600c:3481:b0:43c:fcbc:9680 with SMTP id 5b1f17b1804b1-4562e3c4b8bmr63183015e9.25.1752768436428; Thu, 17 Jul 2025 09:07:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuchvTf+jdstqtSaVFZsjDPxLdC0wssJpUGm/o7pWMq6jaG91Q0jM+Wt9WLF+B+hMLMqWuLQ== X-Received: by 2002:a05:600c:3481:b0:43c:fcbc:9680 with SMTP id 5b1f17b1804b1-4562e3c4b8bmr63182535e9.25.1752768435895; Thu, 17 Jul 2025 09:07:15 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Xiaoyao Li , Peter Maydell , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 6/6] i386/tdx: Remove the redundant qemu_mutex_init(&tdx->lock) Date: Thu, 17 Jul 2025 18:07:00 +0200 Message-ID: <20250717160700.357384-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250717160700.357384-1-pbonzini@redhat.com> References: <20250717160700.357384-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_H5=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: 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: 1752778379042116600 From: Xiaoyao Li Commit 40da501d8989 ("i386/tdx: handle TDG.VP.VMCALL") added redundant qemu_mutex_init(&tdx->lock) in tdx_guest_init by mistake. Fix it by removing the redundant one. Fixes: 40da501d8989 ("i386/tdx: handle TDG.VP.VMCALL") Reported-by: Peter Maydell Signed-off-by: Xiaoyao Li Reviewed-by: Daniel P. Berrang=C3=A9 Link: https://lore.kernel.org/r/20250717103707.688929-1-xiaoyao.li@intel.com Signed-off-by: Paolo Bonzini --- target/i386/kvm/tdx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 1574e7d76fe..dbf0fa2c918 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -1527,8 +1527,6 @@ static void tdx_guest_init(Object *obj) tdx_guest_set_qgs, NULL, NULL); =20 - qemu_mutex_init(&tdx->lock); - tdx->event_notify_vector =3D -1; tdx->event_notify_apicid =3D -1; } --=20 2.50.1