From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (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 629CA3BB24 for ; Mon, 30 Sep 2024 16:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727713182; cv=none; b=FiEmtCfEFLXSi2k45BALpEOnvdgUGWjipbo6Zm5EP8sguQr6Bb+cuNkK7SPIax/n81/UxUYlQhlhrldCA6uPhc0YFrZ9uujS37AcNG0FwmGrQL1dkDFfy2oUcsvqgo8DbGK7lVFiP7cyb/JvCARieZkfNzzibDzGlpDYZEX/OkE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727713182; c=relaxed/simple; bh=RQmbciJp+3HvVOT4BZZm0kN1UG2KYPfBnDMMw4gg9Wg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=XWbXXygKOdWz49YljZVyH1q+6hnDv/byRby1x34CS4kaaMsFk2XSXma8Q/R1Ds87GK8u3ST/b0vL75Uh8Y7FqcG9hG2rQ4JNJ3m1o4TvDEfJlTfYWvDUkRCN7yTqDDWb8R4V/CKjbpdSeF/enDSCn49BV9+I1obRTcE8aUx8m3A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ETSlSepj; arc=none smtp.client-ip=209.85.215.202 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--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ETSlSepj" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-7cd9ac1fa89so5479126a12.1 for ; Mon, 30 Sep 2024 09:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1727713181; x=1728317981; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=REWAk9yOZ/oV5DFOSR0fdNCr64LBBiwPareu4SRJi5Y=; b=ETSlSepjaP+Ja4j09nXgBKKNZphifIdG2dgqqROxeND7gVvjp9YKLTmPWNX1s9Ecjl ufPoYuNrMotUXS1lTGOXww3oxm6YLoNDU898Xfkfk4l3yyhSuenfy4S6sHQq5QM2a5GS ZYVqoBsRguA25rBoGdBsbrjkgtXpnjMljK3eApKrePzhuWoR8xKiEV3+ug50YpJLUcNq FHXR9R4so5nxZIMxY8ynw+lJ4T2hP4zY0Q8Bh/K8t1N/MWT0r0T6RqsiKlPImVSqa+kj Bc1WIjr41uoaZbhB9CFcMh4xPE0ChyVt6ASlFH1E1MlLDxHBOpGNKggWTpaWuyujWfBI uZAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727713181; x=1728317981; h=content-transfer-encoding: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=REWAk9yOZ/oV5DFOSR0fdNCr64LBBiwPareu4SRJi5Y=; b=Cgo1XqCMVnAJqBYUAfXjsCfG1MgWfnF3ZTGIoH6ZSPfeBCu16948Xe6R8qSRYpyrpT dG2UDf76zGb+70F6N0rR77N7yWg1Qlim/Rldm0TLFTNeLyE7q8HhpGzX05YGC6+mzyKz zeEatb2XYmGGsHKFPMcFFM/4dnCrFtBwbZwmkYhckCKNUlph43Z4qjifvLpyYdmJaMgE mpPmwfPmgyyRRj0Deu/RAfBip2tmwbXKC84ZlPpvMER0u7QUuS05AChIs9umPNH21SPO YIVvbJSRfNR3c0sYVl4opjuztds0/BwMTZZXfPcE+W185gw3XEnAy4UCAZ6gVkokbyiD Bqyg== X-Forwarded-Encrypted: i=1; AJvYcCViSl2DUl/ta9WW+sG7IY/RoSMf+DyDSJCv1ZOurBgck3bVR7To+iYblrwA3QbLjpLhuPRY08QGf54Rw8o=@vger.kernel.org X-Gm-Message-State: AOJu0Yyn1R/EW+zue73aL8RiI27JkS5D7/Rf7KYy+7Tc+2VDKNafpztY 7cYPXjnRzuR49dCuxtxglQ2f1gryZ6WjHB+ckS9fLCwHaOTrS96UpCq/KgU/YrLEITI8VFedPr6 PQQ== X-Google-Smtp-Source: AGHT+IHkNqpgIOhZDhQLlT+HB+EF4VbjJnvLgjGrAFw/cN8YVeiOCtV2Yk4NeWEWfkYzuZMUGCpEPJE8NW0= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a63:2482:0:b0:7cb:c8c3:3811 with SMTP id 41be03b00d2f7-7e6db03fe9bmr15004a12.5.1727713180514; Mon, 30 Sep 2024 09:19:40 -0700 (PDT) Date: Mon, 30 Sep 2024 09:19:38 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240913173242.3271406-1-jmattson@google.com> Message-ID: Subject: Re: [PATCH v4 0/3] Distinguish between variants of IBPB From: Sean Christopherson To: Jim Mattson Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Paolo Bonzini , Pawan Gupta , Josh Poimboeuf , Sandipan Das , Kai Huang , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, Sep 27, 2024, Jim Mattson wrote: > On Fri, Sep 13, 2024 at 10:32=E2=80=AFAM Jim Mattson wrote: > > > > Prior to Zen4, AMD's IBPB did not flush the RAS (or, in Intel > > terminology, the RSB). Hence, the older version of AMD's IBPB was not > > equivalent to Intel's IBPB. However, KVM has been treating them as > > equivalent, synthesizing Intel's CPUID.(EAX=3D7,ECX=3D0):EDX[bit 26] on= any > > platform that supports the synthetic features X86_FEATURE_IBPB and > > X86_FEATURE_IBRS. > > > > Equivalence also requires a previously ignored feature on the AMD side, > > CPUID Fn8000_0008_EBX[IBPB_RET], which is enumerated on Zen4. > > > > v4: Added "guaranteed" to X86_FEATURE_IBPB comment [Pawan] > > Changed logic for deducing AMD IBPB features from Intel IBPB featur= es > > in kvm_set_cpu_caps [Tom] > > Intel CPUs that suffer from PBRSB can't claim AMD_IBPB_RET [myself] > > > > v3: Pass through IBPB_RET from hardware to userspace. [Tom] > > Derive AMD_IBPB from X86_FEATURE_SPEC_CTRL rather than > > X86_FEATURE_IBPB. [Tom] > > Clarify semantics of X86_FEATURE_IBPB. > > > > v2: Use IBPB_RET to identify semantic equality. [Venkatesh] > > > > Jim Mattson (3): > > x86/cpufeatures: Define X86_FEATURE_AMD_IBPB_RET > > KVM: x86: Advertise AMD_IBPB_RET to userspace > > KVM: x86: AMD's IBPB is not equivalent to Intel's IBPB >=20 > Oops. I forgot to include the v3 responses: >=20 > > For the series: > > > > Reviewed-by: Tom Lendacky >=20 > and >=20 > > Assuming this goes through the KVM tree: > > > > Reviewed-by: Thomas Gleixner >=20 > The only substantive change was to patch 3/3. >=20 > Sean: Are you willing to take this through KVM/x86? Yep, and I can fixup the reviews when applying.