From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3AED450909 for ; Wed, 27 May 2026 17:44:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779903848; cv=none; b=dOaW0sqsWN5GvydigC8AZoGNQXV8OaARoaxbhOFxPw790p/ixhnAVL7UabXndCWPbiRAtK1hEuqvEp0d6GTiXprB+pk94K1PvI+h+pX6IRH9y4LdpR/XOZNxhhV9rFxLhMuwgcKvnp873oYQgNB41C8rOQl+JAAakrucxj5DMLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779903848; c=relaxed/simple; bh=YxP5krwdaVeOHE62Vd0PtLNRMCzqWyUDf/4m/oTbqYY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=l6b3XtHTSx89BqdutJyrqQs4I5LwSJXkKdWWncsb8gHVxQArF/YxK6f3len9nWyS6bWlWNOPLsBYHL3i/FaOfSxxoOmHZJ1CJWDlapAXEV5HOcnx2kMuuKSFQJFkqj1842Txdj2R+r28awpan/Z6ZtpQGLMzm7ANuX5MsOPGKqA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jmattson.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=d7sPZDLK; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jmattson.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="d7sPZDLK" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-83536dc3be5so13881534b3a.1 for ; Wed, 27 May 2026 10:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779903845; x=1780508645; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9qEcLhasCephgp3AS7VyEnF08Tw7w+64XAN+eU0Mxdw=; b=d7sPZDLK/mQVhUOG8LhwZ/IlmW2xfdFHHbZ7uGFAe5QJAhRl2CNDFc7Uw9q2dn9UNG QHA2wvsixvOY1Oal5VOcyek3x5xhIKLm///cfT1FagNDQsBY5zsiHI1xidS5myr6pYl5 +hRKIYUGYpDuBpto/sC9N9G3Ha0xroguKBkWhvswvS6z2X5aBZ0cGZ/ArQ5v3RU7u4Xe ffBH5yX4ZXZ6AuIHalMWTMCZRyylQ6EIiIhPOx7erEeAcHKqO14Iy9GGNejWLfr6CrYt qqGuJMJ7HnCKHqkqQb2C5TmriCioya+7Nul4AlkCeL4U5sqEPDymMYhuZ2+Qk54/BAdS hGcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779903845; x=1780508645; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9qEcLhasCephgp3AS7VyEnF08Tw7w+64XAN+eU0Mxdw=; b=IwAsPDYNTcSKKd64+ufaPgsLp/JOKJLKz8oII8A3dRS7nn2LjuhNBzmr4pqQmSQWCK ll2OVAga8XOEgoRdrtxvS806/F2wTUJZhG15FpWV/ZUIMARBwv0EL7zM3ZVZ7Nd7NfHa EfWVaAiwAMKjP+KHuzv29KvYpHgi1iNlivAIsM5xPIeipQYA/nHWGGspItkGDct6Brqx AzBN+uhWBhGw2SHmuFS9cyhQVcN5rkpMa6NZ7KlwyUoauSWvVlvFDkvGqOrgvnV11JuF 3zzdfZnE6S15pOtQoihiw7ERDhaR7XoXZya/z+wCqIg+TXjsRxgtWW2WAUfTPt9Jzk4e 5hVg== X-Forwarded-Encrypted: i=1; AFNElJ879FdiCHmcK0N4UGBdOKHhuRDzKRxzBxmGcNcicjZiVhJzByVU7OYEmrt5HcbmQ8XUStomnQQty/WLf/8=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3V2TsI3OtoPIKlD/O3cN/nx0TUcP4c4FMsvh+Z+TbgdgvmCml 2QGKDnuLY7X38wG6U72EVs74t5SLTIiyzYM5nJKG+dweWtkbcda4ggCB114qAd+CC12VtLXM7OT yUISvfvZEbH8nZA== X-Received: from pfkk16.prod.google.com ([2002:aa7:90d0:0:b0:841:9a0c:2108]) (user=jmattson job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:4fc1:b0:83e:b47f:8994 with SMTP id d2e1a72fcca58-8415f0e87f7mr25477524b3a.6.1779903844354; Wed, 27 May 2026 10:44:04 -0700 (PDT) Date: Wed, 27 May 2026 10:43:45 -0700 In-Reply-To: <20260527174347.2356165-1-jmattson@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260527174347.2356165-1-jmattson@google.com> X-Mailer: git-send-email 2.54.0.794.g4f17f83d09-goog Message-ID: <20260527174347.2356165-4-jmattson@google.com> Subject: [PATCH v4 3/5] KVM: x86: Remove supports_cpuid_fault() helper From: Jim Mattson To: seanjc@google.com, pbonzini@redhat.com, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, shuah@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, ctpence@google.com, David.Kaplan@amd.com, binbin.wu@linux.intel.com Cc: Jim Mattson Content-Type: text/plain; charset="UTF-8" The function, supports_cpuid_fault(), tests specifically for guest support of Intel's CPUID faulting feature. It does not test for guest support of AMD's CPUID faulting feature. To avoid confusion, remove the helper. Suggested-by: Sean Christopherson Signed-off-by: Jim Mattson Reviewed-by: Binbin Wu --- arch/x86/kvm/cpuid.h | 5 ----- arch/x86/kvm/x86.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h index bc4a8428b836..95d09ccbf951 100644 --- a/arch/x86/kvm/cpuid.h +++ b/arch/x86/kvm/cpuid.h @@ -183,11 +183,6 @@ static inline int guest_cpuid_stepping(struct kvm_vcpu *vcpu) return x86_stepping(best->eax); } -static inline bool supports_cpuid_fault(struct kvm_vcpu *vcpu) -{ - return vcpu->arch.msr_platform_info & MSR_PLATFORM_INFO_CPUID_FAULT; -} - static inline bool cpuid_fault_enabled(struct kvm_vcpu *vcpu) { return vcpu->arch.msr_misc_features_enables & diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 72bd3cddb026..d5a2d794c3c9 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4264,7 +4264,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) case MSR_MISC_FEATURES_ENABLES: if (data & ~MSR_MISC_FEATURES_ENABLES_CPUID_FAULT || (data & MSR_MISC_FEATURES_ENABLES_CPUID_FAULT && - !supports_cpuid_fault(vcpu))) + !(vcpu->arch.msr_platform_info & MSR_PLATFORM_INFO_CPUID_FAULT))) return 1; vcpu->arch.msr_misc_features_enables = data; break; -- 2.54.0.794.g4f17f83d09-goog