vm_session(x86): support cstar register

Fixes #3964
This commit is contained in:
Alexander Boettcher
2020-11-28 22:05:47 +01:00
committed by Norman Feske
parent 9189342b77
commit c5de2acf57
12 changed files with 37 additions and 14 deletions

View File

@@ -1 +1 @@
e8d6968e967852affc6a7290936466f032dc210b
e4c5e41a5d3b5398a310dbc39b52a5393526c816

View File

@@ -3,8 +3,8 @@ VERSION := git
DOWNLOADS := seoul.git
URL(seoul) := https://github.com/alex-ab/seoul.git
# branch genode_20_02
REV(seoul) := bcbb781d9412fe8c10d6e324e02116faf04b8d1f
# branch genode_20_11
REV(seoul) := 9c009e7ad2b5ec9fbafdc731e8796f33ff90e921
DIR(seoul) := src/app/seoul
#

View File

@@ -373,10 +373,10 @@ unsigned Seoul::read_vm_state(Genode::Vm_state &state, CpuState &seoul)
Genode::warning("pdpte not supported by Seoul");
}
if (state.star.valid() || state.lstar.valid() ||
if (state.star.valid() || state.lstar.valid() || state.cstar.valid() ||
state.fmask.valid() || state.kernel_gs_base.valid()) {
Genode::warning("star, lstar, fmask, kernel_gs not supported by Seoul");
Genode::warning("star, lstar, cstar, fmask, kernel_gs not supported by Seoul");
}
if (state.tpr.valid() || state.tpr_threshold.valid()) {

View File

@@ -517,6 +517,7 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<Genode::Thread>,
utcb->mtd |= Mtd::SYSCALL_SWAPGS;
utcb->write_star(pCtx->msrSTAR);
utcb->write_lstar(pCtx->msrLSTAR);
utcb->write_cstar(pCtx->msrCSTAR);
utcb->write_fmask(pCtx->msrSFMASK);
utcb->write_kernel_gs_base(pCtx->msrKERNELGSBASE);
@@ -604,6 +605,9 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<Genode::Thread>,
if (pCtx->msrLSTAR != utcb->read_lstar())
CPUMSetGuestMsr(pVCpu, MSR_K8_LSTAR, utcb->read_lstar());
if (pCtx->msrCSTAR != utcb->read_cstar())
CPUMSetGuestMsr(pVCpu, MSR_K8_CSTAR, utcb->read_cstar());
if (pCtx->msrSFMASK != utcb->read_fmask())
CPUMSetGuestMsr(pVCpu, MSR_K8_SF_MASK, utcb->read_fmask());

View File

@@ -345,6 +345,7 @@ class Vcpu_handler : public Genode::List<Vcpu_handler>::Element
_state->star.value(pCtx->msrSTAR);
_state->lstar.value(pCtx->msrLSTAR);
_state->cstar.value(pCtx->msrCSTAR);
_state->fmask.value(pCtx->msrSFMASK);
_state->kernel_gs_base.value(pCtx->msrKERNELGSBASE);
@@ -437,6 +438,9 @@ class Vcpu_handler : public Genode::List<Vcpu_handler>::Element
if (pCtx->msrLSTAR != _state->lstar.value())
CPUMSetGuestMsr(pVCpu, MSR_K8_LSTAR, _state->lstar.value());
if (pCtx->msrCSTAR != _state->cstar.value())
CPUMSetGuestMsr(pVCpu, MSR_K8_CSTAR, _state->cstar.value());
if (pCtx->msrSFMASK != _state->fmask.value())
CPUMSetGuestMsr(pVCpu, MSR_K8_SF_MASK, _state->fmask.value());