The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Costas Argyris <costas.argyris@amd.com>
Cc: Jim Mattson <jmattson@google.com>, Borislav Petkov <bp@alien8.de>,
	Joerg Roedel <joro@8bytes.org>,
	 Tom Lendacky <thomas.lendacky@amd.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: selftests: Add guest-side test for AMD HWCR.McStatusWrEn
Date: Thu, 7 May 2026 11:28:14 -0700	[thread overview]
Message-ID: <afzZvhJgmpAT2elF@google.com> (raw)
In-Reply-To: <20260507153850.8214-1-costas.argyris@amd.com>

On Thu, May 07, 2026, Costas Argyris wrote:
> The existing hwcr_msr_test exercises MSR_K7_HWCR only via KVM_SET_MSRS,
> which sets host_initiated=true in KVM. The gate in set_msr_mce() that
> calls can_set_mci_status() short-circuits when host_initiated=true, so
> can_set_mci_status() is never reached by the existing test.
> 
> Add a guest-side test that verifies HWCR.McStatusWrEn (bit 18) correctly
> gates non-zero writes to MCi_STATUS MSRs. With the bit set, the write
> must succeed and read back unchanged. With the bit clear, the write must
> raise #GP and leave the register unmodified.
> 
> Signed-off-by: Costas Argyris <costas.argyris@amd.com>
> ---
>  .../testing/selftests/kvm/x86/hwcr_msr_test.c | 65 ++++++++++++++++++-
>  1 file changed, 63 insertions(+), 2 deletions(-)

Rather than pile code into a one-off MSR test, how hard would it be to fold this
into msrs_test.c?

  reply	other threads:[~2026-05-07 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 15:38 [PATCH] KVM: selftests: Add guest-side test for AMD HWCR.McStatusWrEn Costas Argyris
2026-05-07 18:28 ` Sean Christopherson [this message]
2026-05-08 16:12   ` [PATCH v2] " Costas Argyris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afzZvhJgmpAT2elF@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=costas.argyris@amd.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.lendacky@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox