x86/PV: fold exit paths of ptwr_do_page_fault()

One less aspect to keep an eye on for things to stay in sync.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2020-09-11 14:16:14 +02:00
1 parent e5a1b6f0d2
commit 0fcfe9d95f
1 file changed
+7 -13
+7 -13
View File
@@ -262,29 +262,23 @@ static int ptwr_do_page_fault(struct x86_emulate_ctxt *ctxt,
.pte = pte,
};
struct page_info *page;
int rc;
int rc = X86EMUL_UNHANDLEABLE;
page = get_page_from_mfn(l1e_get_mfn(pte), current->domain);
if ( !page )
return X86EMUL_UNHANDLEABLE;
if ( !page_lock(page) )
if ( page_lock(page) )
{
put_page(page);
return X86EMUL_UNHANDLEABLE;
}
if ( (page->u.inuse.type_info & PGT_type_mask) == PGT_l1_page_table )
{
ctxt->data = &ptwr_ctxt;
rc = x86_emulate(ctxt, &ptwr_emulate_ops);
}
if ( (page->u.inuse.type_info & PGT_type_mask) != PGT_l1_page_table )
{
page_unlock(page);
put_page(page);
return X86EMUL_UNHANDLEABLE;
}
ctxt->data = &ptwr_ctxt;
rc = x86_emulate(ctxt, &ptwr_emulate_ops);
page_unlock(page);
put_page(page);
return rc;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.