From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.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 A47EE33987F for ; Fri, 29 May 2026 22:48:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780094912; cv=none; b=PNe8Nd5X+H/RbdEaxx7+59yjpGAqdDrJIdf6rc4MVSyXTlyvA2Sn8euZDMD+2KNCBtsPTMxcd2GXfqrtNsL1CyLXF0RZ7oUFUUvmk65/S8InlmR3qOPzHwwkUZppYSR5LqXtKp5XU0KoQG9+p6Ss1BDoU0Dm+HDf2LATQ6rOm+0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780094912; c=relaxed/simple; bh=b6ffBYX5aMxbPxEUdFSM4uPKjjfI9TiFsBohWXhyGcE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=mnPtVkeN4gwaRugHVE5psPtV6WMjT1WUhuKZMQJ62iAeYjd6n8aZxOsICBuMNafr6ix5rC8Y6/ohfJOYBbucrFzJT2BzrHYe7Cciyvma7P4wiuOOr92ok9g3gfEIvVSZgi5msndeMOZIkdUMTNGx/61qCMFtco90Zp1ZXMMAlDo= 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=q1IZ09ad; arc=none smtp.client-ip=209.85.215.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--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="q1IZ09ad" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-c8581f7723aso283211a12.0 for ; Fri, 29 May 2026 15:48:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780094911; x=1780699711; 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=nbUSpHboMkhyKDZCfxjpkJGmbfHwd+tsxMAUtlTmtms=; b=q1IZ09ad3YAa25/LGGpyXfEC05wMgxSMiqbUL+6h4JA5AsvxdciagWN3io8Sl3P/xu KJVaeEoP/iGxcNCleqabbHLL964pGb/yZikit56/z09hHcfK0KlI+zDGmTdQC/TFOQu8 Kj1j5CoO32NJRsO/hTMqJiPQHw9tjotd9xY2wqJLilIfgdnVMn/qqNZ3EOLLrlcDgo+R b0wgtuLCUz09cpNKLc3Tx627Dooh+UGZPg1I+pbc6beAWok57ukMVQM0h76FDGFXm/SI 4sKGybNHhjpb0sxCPBUIW3eetwfM8yk4B1q2bCFgbTv4xacOjcgS4jxcqgN7HXJBfU6e WS3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780094911; x=1780699711; 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=nbUSpHboMkhyKDZCfxjpkJGmbfHwd+tsxMAUtlTmtms=; b=J1ACJtvohFoqe5xfhNReMZfu++K4LawLD10J1d6XR4FAfJ47msY8vheXcJ1PR1YWuz WW3oydZ1H5CskFdRmhXBIvNJz71Y+8OlyH/Vo4S1PPYvGCQRRgwrGRLjsBgzSd59rr33 bVRtWZ06fv0huCzyhwm+sxDzXz3uauTC01UhvwGTvFgyQOlarOzQ/iyac5kIAiA9lQ/3 g1Hg3oAhGs2zI7S4SdES4zfg3vs2OkI1vSAQcJqQJ48+A0MZ/MV7BRQW1W9IkDZJYZwI uoceq7IPbMeWYJFNyxWSTRXaNHQbLhFdcX+A/i72xojE1gz9r35fHVoS41mxSHRfPlLI Ev9A== X-Forwarded-Encrypted: i=1; AFNElJ9FJcqK0MQV9wOj36kN4+sAwdOj2OKHJaOABUcbDXrzPY2O2cU7wLUZ2Vlf24jaV0bL+PYiMgdjvt1bv1I=@vger.kernel.org X-Gm-Message-State: AOJu0YywxzIT1NDRdzp9zB7Z97UIosRJvGefwTboHtlOf4mopyb1MYyd TkH7/SgEsDuGqAZP+7PHVPC3eOxi0sjgaK7hYyEv8dSz+tK89WwQlwlGqfKaiC5f0LkxE1TTOmh BXTRh+Q== X-Received: from pgkj5.prod.google.com ([2002:a63:e745:0:b0:c82:71fb:427b]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6300:189:b0:3a2:c683:fa84 with SMTP id adf61e73a8af0-3b427f6d141mr1260270637.27.1780094910736; Fri, 29 May 2026 15:48:30 -0700 (PDT) Date: Fri, 29 May 2026 15:47:54 -0700 In-Reply-To: <20260527022617.3973884-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260527022617.3973884-1-seanjc@google.com> X-Mailer: git-send-email 2.54.0.823.g6e5bcc1fc9-goog Message-ID: <178009472610.881059.2932861959029055304.b4-ty@google.com> Subject: Re: [PATCH v2] KVM: VMX: Handle bad values on proxied writes to LBR MSRs From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Xuanqing Shi <1356292400@qq.com> Content-Type: text/plain; charset="utf-8" On Tue, 26 May 2026 19:26:17 -0700, Sean Christopherson wrote: > Use the "safe" WRMSR API when writing LBRs on behalf of the guest (or host > userspace), and propagate any errors back to the instigator, as the value > being written is untrusted. E.g. if the guest (or host userspace) attempts > to set reserved bits in LBR_SELECT, then KVM needs to return an error, and > not WARN on the bad value. > > Continue using the "unsafe" version of RDMSR, as it should be impossible to > reach the helper with a completely bogus MSR, i.e. WARNing on RDMSR failure > is very desirable, e.g. to make KVM bugs more visible. > > [...] Applied to kvm-x86 vmx, thanks! [1/1] KVM: VMX: Handle bad values on proxied writes to LBR MSRs https://github.com/kvm-x86/linux/commit/ca674df13b19 -- https://github.com/kvm-x86/linux/tree/next