On Tue, Aug 06, 2024 at 11:44:39AM -0700, Anish Moorthy wrote: > On Mon, Aug 5, 2024 at 4:02 PM Oliver Upton <oliver.upton@xxxxxxxxx> wrote: > > > > On Fri, Aug 02, 2024 at 10:40:31PM +0000, Anish Moorthy wrote: > > > Right now userspace just gets a bare EFAULT when the stage-2 fault > > > handler fails to fault in the relevant page. Set up a memory fault exit > > > when this happens, which at the very least eases debugging and might > > > also let userspace decide on/take some specific action other than > > > crashing the VM. > > > > There are several other 'bare' EFAULTs remaining (unexpected fault > > context, failed vma_lookup(), nested PTW), so the patch doesn't exactly > > match the shortlog. > > > > Is there a reason why those are unaddressed? In any case, it doesn't > > hurt to be unambiguous in the shortlog if we're only focused on this single > > error condition, e.g. > > > > KVM: arm64: Do a memory fault exit if __gfn_to_pfn_memslot() fails > > Ah, right- forgot to address this before I sent it out. > > Basically: those cases you mention (besides MTE, where it seems simple > enough to add an annotation) happen before vma_pagesize is calculated, If the motivation is to add additional information for debugging unexpected KVM/VMM behavior then this really ought to be addressed. You could fall back to PAGE_SIZE, or better yet just don't report a size whatsoever (size = 0) if it cannot be reliably determined. Userspace probably only cares about logging @flags and @gpa before killing the VM. -- Thanks, Oliver