diff options
author | Aravindh Puthiyaparambil <aravindh@virtuata.com> | 2012-04-27 17:57:55 +0200 |
---|---|---|
committer | Aravindh Puthiyaparambil <aravindh@virtuata.com> | 2012-04-27 17:57:55 +0200 |
commit | b7fa98fbf14f8e08919e9e0d531fa2472619d26e (patch) | |
tree | dcc36b0e303085c8c1b772441ad13ec168d68c5f /xen/arch/x86/domctl.c | |
parent | 7febbdae3bda9ccca27870c3396850c3fb45f728 (diff) | |
download | xen-b7fa98fbf14f8e08919e9e0d531fa2472619d26e.tar.gz xen-b7fa98fbf14f8e08919e9e0d531fa2472619d26e.tar.bz2 xen-b7fa98fbf14f8e08919e9e0d531fa2472619d26e.zip |
x86: Add FS and GS base to HVM VCPU context
Add FS and GS base to the HVM VCPU context returned by
xc_vcpu_getcontext().
Signed-off-by: Aravindh Puthiyaparambil <aravindh@virtuata.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/arch/x86/domctl.c')
-rw-r--r-- | xen/arch/x86/domctl.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 168147fa98..a79f581e19 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1590,8 +1590,23 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c) c.nat->user_regs.es = sreg.sel; hvm_get_segment_register(v, x86_seg_fs, &sreg); c.nat->user_regs.fs = sreg.sel; +#ifdef __x86_64__ + c.nat->fs_base = sreg.base; +#endif hvm_get_segment_register(v, x86_seg_gs, &sreg); c.nat->user_regs.gs = sreg.sel; +#ifdef __x86_64__ + if ( ring_0(&c.nat->user_regs) ) + { + c.nat->gs_base_kernel = sreg.base; + c.nat->gs_base_user = hvm_get_shadow_gs_base(v); + } + else + { + c.nat->gs_base_user = sreg.base; + c.nat->gs_base_kernel = hvm_get_shadow_gs_base(v); + } +#endif } else { |