On 2/26/19 11:12 AM, Jim Mattson wrote: > On Tue, Feb 26, 2019 at 9:02 AM Singh, Brijesh <brijesh.singh@xxxxxxx> wrote: >> >> Errata#1096: >> >> On a nested data page fault when CR.SMAP=1 and the guest data read >> generates a SMAP violation, GuestInstrBytes field of the VMCB on a >> VMEXIT will incorrectly return 0h instead the correct guest >> instruction bytes . >> >> Recommend Workaround: >> >> To determine what instruction the guest was executing the hypervisor >> will have to decode the instruction at the instruction pointer. >> >> The recommended workaround can not be implemented for the SEV >> guest because guest memory is encrypted with the guest specific key, >> and instruction decoder will not be able to decode the instruction >> bytes. If we hit this errata in the SEV guest then log the message >> and request a guest shutdown. >> >> Reported-by: Venkatesh Srinivas <venkateshs@xxxxxxxxxx> >> Cc: Jim Mattson <jmattson@xxxxxxxxxx> >> Cc: Tom Lendacky <thomas.lendacky@xxxxxxx> >> Cc: Borislav Petkov <bp@xxxxxxxxx> >> Cc: Joerg Roedel <joro@xxxxxxxxxx> >> Cc: "Radim Krčmář" <rkrcmar@xxxxxxxxxx> >> Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx> >> Signed-off-by: Brijesh Singh <brijesh.singh@xxxxxxx> >> --- >> >> Change since v2: >> * rename the callback emulate_instruction_possible->need_emulation_on_page_fault > > This function still seems poorly named. You already know that you > *need* emulation by the time you call it, don't you? > We know that we are going to require emulation to handle this #PF. How about can_emulate_on_page_fault(..) ? Any other suggestions ? -Brijesh