[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v1] x86/hvm: Expose MSR_SHADOW_GS_BASE
This patch is adding an new param in the hvm_hw_cpu structure so it can be exposed to user space. Signed-off-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx> --- xen/arch/x86/hvm/hvm.c | 4 ++++ xen/include/public/arch-x86/hvm/save.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 6cb903d..519333c 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -834,6 +834,8 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h) ctxt.gs_base = seg.base; ctxt.gs_arbytes = seg.attr; + rdmsrl(MSR_SHADOW_GS_BASE, ctxt.shadow_gs_base); + hvm_get_segment_register(v, x86_seg_tr, &seg); ctxt.tr_sel = seg.sel; ctxt.tr_limit = seg.limit; @@ -1090,6 +1092,8 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h) seg.attr = ctxt.gs_arbytes; hvm_set_segment_register(v, x86_seg_gs, &seg); + wrmsrl(MSR_SHADOW_GS_BASE, ctxt.shadow_gs_base); + seg.sel = ctxt.tr_sel; seg.limit = ctxt.tr_limit; seg.base = ctxt.tr_base; diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h index fd7bf3f..e6e8e87 100644 --- a/xen/include/public/arch-x86/hvm/save.h +++ b/xen/include/public/arch-x86/hvm/save.h @@ -134,6 +134,8 @@ struct hvm_hw_cpu { /* msr for em64t */ uint64_t shadow_gs; + uint64_t shadow_gs_base; + /* msr content saved/restored. */ uint64_t msr_flags; /* Obsolete, ignored. */ uint64_t msr_lstar; -- 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |