Re: [PATCH] KVM: x86/mmu: Embed direct bits into gpa for KVM_PRE_FAULT_MEMORY
From: Edgecombe, Rick P
Date: Thu Jun 12 2025 - 14:51:17 EST
On Thu, 2025-06-12 at 15:19 +0800, Yan Zhao wrote:
> > TDX isn't setting PFERR_WRITE_MASK or PFERR_PRESENT_MASK in the error_code
> > passed into the fault handler. So page_fault_can_be_fast() should return
> > false
> > for that reason for private/mirror faults.
> Hmm, TDX does set PFERR_WRITE_MASK in the error_code when fault->prefetch is
> false (since exit_qual is set to EPT_VIOLATION_ACC_WRITE in
> tdx_handle_ept_violation()).
>
> PFERR_PRESENT_MASK is always unset.
>
> page_fault_can_be_fast() does always return false for private mirror faults
> though, due to the reason in
> https://lore.kernel.org/kvm/aEp6pDQgbjsfrg2h@xxxxxxxxxxxxxxxxxxxxxxxxx :)
Seems cleanup worthy to me, but not a bug. I think we should follow up,
depending on the scope of Sean's cleanup.