x86/xenoprof: fix kernel/user mode detection for HVM
authorJacob Shin <jacob.shin@amd.com>
Mon, 15 Oct 2012 13:04:51 +0000 (15:04 +0200)
committerJacob Shin <jacob.shin@amd.com>
Mon, 15 Oct 2012 13:04:51 +0000 (15:04 +0200)
commitbe522c694af0f39dcd22f01d3c9417ce38f97a99
tree8f82726b8c15395f9a7ea392d2cee1b44ff5b81d
parentcabea9d59f1783167a79fa7a550ced04b3506f3c
x86/xenoprof: fix kernel/user mode detection for HVM

While trying oprofile under Xen, I noticed that HVM passive domain's
kernel addresses were showing up as user application. It turns out
under HVM get_cpu_user_regs()->cs contains 0x0000beef.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>
Don't cast away const-ness. Use SS instead of CS to determine ring.
Special-case real and protected mode.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/oprofile/xenoprof.c
xen/include/asm-x86/xenoprof.h