646cd8897b
Updated block-dmmd script - fate#310510 - fix xenpaging restore changes to integrate paging into xm/xend xenpaging.autostart.patch xenpaging.doc.patch - bnc#787163 - VUL-0: CVE-2012-4544: xen: Domain builder Out-of- memory due to malicious kernel/ramdisk (XSA 25) CVE-2012-4544-xsa25.patch - bnc#779212 - VUL-0: CVE-2012-4411: XEN / qemu: guest administrator can access qemu monitor console (XSA-19) CVE-2012-4411-xsa19.patch - bnc#786516 - VUL-0: CVE-2012-4535: xen: Timer overflow DoS vulnerability CVE-2012-4535-xsa20.patch - bnc#786518 - VUL-0: CVE-2012-4536: xen: pirq range check DoS vulnerability CVE-2012-4536-xsa21.patch - bnc#786517 - VUL-0: CVE-2012-4537: xen: Memory mapping failure DoS vulnerability CVE-2012-4537-xsa22.patch - bnc#786519 - VUL-0: CVE-2012-4538: xen: Unhooking empty PAE entries DoS vulnerability CVE-2012-4538-xsa23.patch - bnc#786520 - VUL-0: CVE-2012-4539: xen: Grant table hypercall infinite loop DoS vulnerability CVE-2012-4539-xsa24.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=212
66 lines
1.9 KiB
Diff
66 lines
1.9 KiB
Diff
# HG changeset patch
|
|
# User Jacob Shin <jacob.shin@amd.com>
|
|
# Date 1350306291 -7200
|
|
# Node ID 14e32621dbaf5b485b134ace4558e67c4c36e1ce
|
|
# Parent 983108e1b56bf809f3f5eaaebf18c4b613ff0865
|
|
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>
|
|
|
|
--- a/xen/arch/x86/oprofile/xenoprof.c
|
|
+++ b/xen/arch/x86/oprofile/xenoprof.c
|
|
@@ -78,16 +78,26 @@ int compat_oprof_arch_counter(XEN_GUEST_
|
|
}
|
|
#endif
|
|
|
|
-int xenoprofile_get_mode(const struct vcpu *v,
|
|
- const struct cpu_user_regs *regs)
|
|
+int xenoprofile_get_mode(struct vcpu *curr, const struct cpu_user_regs *regs)
|
|
{
|
|
if ( !guest_mode(regs) )
|
|
return 2;
|
|
|
|
- if ( is_hvm_vcpu(v) )
|
|
- return ((regs->cs & 3) != 3);
|
|
+ if ( !is_hvm_vcpu(curr) )
|
|
+ return guest_kernel_mode(curr, regs);
|
|
|
|
- return guest_kernel_mode(v, regs);
|
|
+ switch ( hvm_guest_x86_mode(curr) )
|
|
+ {
|
|
+ struct segment_register ss;
|
|
+
|
|
+ case 0: /* real mode */
|
|
+ return 1;
|
|
+ case 1: /* vm86 mode */
|
|
+ return 0;
|
|
+ default:
|
|
+ hvm_get_segment_register(curr, x86_seg_ss, &ss);
|
|
+ return (ss.sel & 3) != 3;
|
|
+ }
|
|
}
|
|
|
|
/*
|
|
--- a/xen/include/asm-x86/xenoprof.h
|
|
+++ b/xen/include/asm-x86/xenoprof.h
|
|
@@ -56,7 +56,7 @@ static inline void ibs_init(void) {}
|
|
#define ibs_caps 0
|
|
#endif
|
|
|
|
-int xenoprofile_get_mode(const struct vcpu *, const struct cpu_user_regs *);
|
|
+int xenoprofile_get_mode(struct vcpu *, const struct cpu_user_regs *);
|
|
|
|
static inline int xenoprof_backtrace_supported(void)
|
|
{
|