@@ -739,12 +739,15 @@ int arch_memory_failure(unsigned long pfn, int flags)
* decision but not simply kill it. This is quite useful for
* virtualization case.
*/
- if (page->flags & SGX_EPC_PAGE_KVM_GUEST) {
+ if (page->owner) {
/*
* The "owner" field is repurposed as the virtual address
* of virtual EPC page.
*/
- vaddr = (unsigned long)page->owner & PAGE_MASK;
+ if (page->flags & SGX_EPC_PAGE_KVM_GUEST)
+ vaddr = (unsigned long)page->owner & PAGE_MASK;
+ else
+ vaddr = (unsigned long)page->owner->desc & PAGE_MASK;
ret = force_sig_mceerr(BUS_MCEERR_AR, (void __user *)vaddr,
PAGE_SHIFT);
if (ret < 0)