[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5de5120f-e4b1-5888-58cb-b642361ea5cd@redhat.com>
Date: Thu, 20 Jan 2022 10:49:00 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Xiaoyao Li <xiaoyao.li@...el.com>,
Like Xu <like.xu.linux@...il.com>,
Jun Nakajima <jun.nakajima@...el.com>
Cc: Sean Christopherson <seanjc@...gle.com>,
Jim Mattson <jmattson@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [DROP][PATCH] KVM: x86: Fix the #GP(0) and #UD conditions for
XSETBV emulation
On 1/20/22 10:31, Xiaoyao Li wrote:
>>
>> So while my gut feeling that #UD would not cause a vmexit was correct,
>> technically I was reading the SDM incorrectly.
>
> SDM also states
>
> Certain exceptions have priority over VM exits. These include
> invalid-opcode exception, faults based on privilege level,
> and general-protection exceptions that are based on checking
> I/O permission bits in the task-state segment(TSS)
>
> in "Relative Priority of Faults and VM Exits"
>
> So my understanding is that the architectural check always takes the
> higher priority than VM exit.
Good point! It's right above in 25.1.1. I was confused by the specific
mention of GETSEC, but the reason for the footnote is because undefined
GETSEC leaves cause a vmexit instead of #UD, and GETSEC vmexits also
override #GP faults based on privilege level.
Thanks,
Paolo
Powered by blists - more mailing lists