x86/dom0: fix restoring %cr3 and the mapcache override on PV build error

One of the error paths in the PV dom0 builder section that runs on the guest
page-tables wasn't restoring the Xen value of %cr3, neither removing the
mapcache override.

Fixes: 079ff2d32c ('libelf-loader: introduce elf_load_image')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 1fc3f77113
master date: 2024-07-31 12:41:02 +0200
This commit is contained in:
Roger Pau Monné authored and Jan Beulich committed 2024-08-08 13:45:28 +02:00
1 parent d2ecc1f231
commit adf1939b51
1 file changed
+2
+2
View File
@@ -825,6 +825,8 @@ int __init dom0_construct_pv(struct domain *d,
rc = elf_load_binary(&elf);
if ( rc < 0 )
{
mapcache_override_current(NULL);
switch_cr3_cr4(current->arch.cr3, read_cr4());
printk("Failed to load the kernel binary\n");
goto out;
}
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.