pvh: Initialize vCPU regs/sregs for PVH boot

Set the initial values of the KVM vCPU registers as specified in
the PVH boot ABI:

https://xenbits.xen.org/docs/unstable/misc/pvh.html

Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
This commit is contained in:
Alejandro Jimenez
2020-02-11 23:48:09 -05:00
committed by Sebastien Boeuf
parent 24f0e42e6a
commit 840a9a97ff
3 changed files with 113 additions and 32 deletions

View File

@@ -296,11 +296,16 @@ impl Vcpu {
kernel_entry_point.entry_addr.raw_value(),
arch::x86_64::layout::BOOT_STACK_POINTER.raw_value(),
arch::x86_64::layout::ZERO_PAGE_START.raw_value(),
kernel_entry_point.protocol,
)
.map_err(Error::REGSConfiguration)?;
arch::x86_64::regs::setup_fpu(&self.fd).map_err(Error::FPUConfiguration)?;
arch::x86_64::regs::setup_sregs(&vm_memory.memory(), &self.fd)
.map_err(Error::SREGSConfiguration)?;
arch::x86_64::regs::setup_sregs(
&vm_memory.memory(),
&self.fd,
kernel_entry_point.protocol,
)
.map_err(Error::SREGSConfiguration)?;
}
arch::x86_64::interrupts::set_lint(&self.fd).map_err(Error::LocalIntConfiguration)?;
Ok(())