From: "Ewan Hai-oc" <ewanhai-oc@zhaoxin.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Shuah Khan <shuah@kernel.org>, Frank Zhu <frankzhu@zhaoxin.com>,
kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, ewanhai@zhaoxin.com,
cobechen@zhaoxin.com
Subject: Re: [PATCH 7/8] KVM: selftests: nested_exceptions_test: Add Zhaoxin CPU support
Date: Thu, 10 Sep 2026 19:40:47 +0800 [thread overview]
Message-ID: <aqKW7ls1KpdsCxdN@ewan-server> (raw)
In-Reply-To: <apdrtnMGJN7K0wRa@google.com>
On Tue, Sep 01, 2026 at 05:20:06PM -0700, Sean Christopherson wrote:
> On Thu, Jul 30, 2026, Ewan Hai-oc wrote:
> > From: Frank Zhu <frankzhu@zhaoxin.com>
> >
> > In the test, the ERROR_CODE_EXT_FLAG bit should not be set in the #GP
> > error code on Zhaoxin CPUs.
>
> Why not?
We confirmed with the Zhaoxin hardware team that EXT is set only during
interrupt delivery and for the following guest-mode events: ICEBP, #MC,
#BR, #UD, #NM, #DB, and #MF.
In this test, #GP is generated while vectoring an injected #SS through
an empty IDT. Since #SS delivery is not one of the cases that sets EXT
on Zhaoxin CPUs, EXT remains clear and the resulting error code is 0x62.
We observed this behavior on the Zhaoxin system used to test the series.
This explanation is included in patch 8's description in v2.
>
> > Add GP_ERROR_CODE_ZX and use it when > running on Zhaoxin hardware.
> >
> > Signed-off-by: Frank Zhu <frankzhu@zhaoxin.com>
> > Signed-off-by: Ewan Hai <ewanhai-oc@zhaoxin.com>
> > ---
> > tools/testing/selftests/kvm/x86/nested_exceptions_test.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/kvm/x86/nested_exceptions_test.c b/tools/testing/selftests/kvm/x86/nested_exceptions_test.c
> > index aeec3121c8e8..bacbbdc5dc69 100644
> > --- a/tools/testing/selftests/kvm/x86/nested_exceptions_test.c
> > +++ b/tools/testing/selftests/kvm/x86/nested_exceptions_test.c
> > @@ -38,6 +38,7 @@
> > */
> > #define GP_ERROR_CODE_AMD ((SS_VECTOR * 8) | ERROR_CODE_IDT_FLAG)
> > #define GP_ERROR_CODE_INTEL ((SS_VECTOR * 8) | ERROR_CODE_IDT_FLAG | ERROR_CODE_EXT_FLAG)
> > +#define GP_ERROR_CODE_ZX ((SS_VECTOR * 8) | ERROR_CODE_IDT_FLAG)
> >
> > /*
> > * Intel and AMD both shove '0' into the error code on #DF, regardless of what
> > @@ -139,7 +140,8 @@ static void l1_vmx_code(struct vmx_pages *vmx)
> > */
> > GUEST_ASSERT_EQ(vmwrite(EXCEPTION_BITMAP, INTERCEPT_SS_GP_DF), 0);
> > vmx_run_l2(l2_ss_pending_test, SS_VECTOR, (u16)SS_ERROR_CODE);
> > - vmx_run_l2(l2_ss_injected_gp_test, GP_VECTOR, GP_ERROR_CODE_INTEL);
> > + vmx_run_l2(l2_ss_injected_gp_test, GP_VECTOR,
> > + host_cpu_is_zx ? GP_ERROR_CODE_ZX : GP_ERROR_CODE_INTEL);
> >
> > GUEST_ASSERT_EQ(vmwrite(EXCEPTION_BITMAP, INTERCEPT_SS_DF), 0);
> > vmx_run_l2(l2_ss_injected_df_test, DF_VECTOR, DF_ERROR_CODE);
> > --
> > 2.34.1
> >
> >
>
next prev parent reply other threads:[~2026-09-10 11:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 11:05 [PATCH 0/8] KVM: selftests: " Ewan Hai-oc
2026-07-30 11:05 ` [PATCH 1/8] KVM: selftests: Add Zhaoxin (ZX) CPU detection support Ewan Hai-oc
2026-09-02 0:19 ` Sean Christopherson
2026-09-10 11:39 ` Ewan Hai-oc
2026-07-30 11:05 ` [PATCH 2/8] KVM: selftests: nx_huge_pages_test: Add TDP detection for Zhaoxin CPUs Ewan Hai-oc
2026-07-30 11:05 ` [PATCH 3/8] KVM: selftests: vmx_exception_with_invalid_guest_state: Support " Ewan Hai-oc
2026-07-30 11:05 ` [PATCH 4/8] KVM: selftests: fix_hypercall_test: Add Zhaoxin CPU support Ewan Hai-oc
2026-07-30 11:05 ` [PATCH 5/8] KVM: selftests: Skip PERF_CAPABILITIES vCPU checks without PDCM Ewan Hai-oc
2026-07-30 11:05 ` [PATCH 6/8] KVM: selftests: feature_msrs_test: Extend MSR_IA32_UCODE_REV quirk to Zhaoxin Ewan Hai-oc
2026-07-30 11:05 ` [PATCH 7/8] KVM: selftests: nested_exceptions_test: Add Zhaoxin CPU support Ewan Hai-oc
2026-09-02 0:20 ` Sean Christopherson
2026-09-10 11:40 ` Ewan Hai-oc [this message]
2026-07-30 11:05 ` [PATCH 8/8] KVM: selftests: vmx_apic_access_test: Check APIC virtualization support Ewan Hai-oc
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=aqKW7ls1KpdsCxdN@ewan-server \
--to=ewanhai-oc@zhaoxin.com \
--cc=cobechen@zhaoxin.com \
--cc=ewanhai@zhaoxin.com \
--cc=frankzhu@zhaoxin.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=shuah@kernel.org \
/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
all inboxes | Powered by JetHome®