Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
xen.8005
5af1daa9-2-x86-pv-move-exception-injection-into...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5af1daa9-2-x86-pv-move-exception-injection-into-test_all_events.patch of Package xen.8005
# Commit 0c6c2b1428658687b8f603bf248dec5bdcd882a9 # Date 2018-05-08 18:13:13 +0100 # Author Andrew Cooper <andrew.cooper3@citrix.com> # Committer Andrew Cooper <andrew.cooper3@citrix.com> x86/pv: Move exception injection into {,compat_}test_all_events() This allows paths to jump straight to {,compat_}test_all_events() and have injection of pending exceptions happen automatically, rather than requiring all calling paths to handle exceptions themselves. The normal exception path is simplified as a result, and compat_post_handle_exception() is removed entirely. This is part of XSA-260 / CVE-2018-8897 Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> --- a/xen/arch/x86/x86_64/compat/entry.S +++ b/xen/arch/x86/x86_64/compat/entry.S @@ -104,6 +104,12 @@ ENTRY(compat_test_all_events) leaq irq_stat+IRQSTAT_softirq_pending(%rip),%rcx cmpl $0,(%rcx,%rax,1) jne compat_process_softirqs + + /* Inject exception if pending. */ + lea VCPU_trap_bounce(%rbx), %rdx + testb $TBF_EXCEPTION, TRAPBOUNCE_flags(%rdx) + jnz .Lcompat_process_trapbounce + testb $1,VCPU_mce_pending(%rbx) jnz compat_process_mce .Lcompat_test_guest_nmi: @@ -133,6 +139,15 @@ compat_process_softirqs: call do_softirq jmp compat_test_all_events + ALIGN +/* %rbx: struct vcpu, %rdx: struct trap_bounce */ +.Lcompat_process_trapbounce: + sti +.Lcompat_bounce_exception: + call compat_create_bounce_frame + movb $0, TRAPBOUNCE_flags(%rdx) + jmp compat_test_all_events + ALIGN /* %rbx: struct vcpu */ compat_process_mce: @@ -222,15 +237,6 @@ compat_failsafe_callback: _ASM_PRE_EXTABLE(.Lft0, .Lfx0) _ASM_EXTABLE(.Ldf0, compat_failsafe_callback) -/* %rdx: trap_bounce, %rbx: struct vcpu */ -ENTRY(compat_post_handle_exception) - testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx) - jz compat_test_all_events -.Lcompat_bounce_exception: - call compat_create_bounce_frame - movb $0,TRAPBOUNCE_flags(%rdx) - jmp compat_test_all_events - ENTRY(compat_syscall) /* Fix up reported %cs/%ss for compat domains. */ movl $FLAT_COMPAT_USER_SS, UREGS_ss(%rsp) --- a/xen/arch/x86/x86_64/entry.S +++ b/xen/arch/x86/x86_64/entry.S @@ -273,6 +273,12 @@ test_all_events: leaq irq_stat+IRQSTAT_softirq_pending(%rip),%rcx cmpl $0,(%rcx,%rax,1) jne process_softirqs + + /* Inject exception if pending. */ + lea VCPU_trap_bounce(%rbx), %rdx + testb $TBF_EXCEPTION, TRAPBOUNCE_flags(%rdx) + jnz .Lprocess_trapbounce + testb $1,VCPU_mce_pending(%rbx) jnz process_mce .Ltest_guest_nmi: @@ -301,6 +307,15 @@ process_softirqs: jmp test_all_events ALIGN +/* %rbx: struct vcpu, %rdx struct trap_bounce */ +.Lprocess_trapbounce: + sti +.Lbounce_exception: + call create_bounce_frame + movb $0, TRAPBOUNCE_flags(%rdx) + jmp test_all_events + + ALIGN /* %rbx: struct vcpu */ process_mce: testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%rbx) @@ -653,15 +668,9 @@ handle_exception_saved: mov %r15, STACK_CPUINFO_FIELD(xen_cr3)(%r14) testb $3,UREGS_cs(%rsp) jz restore_all_xen - leaq VCPU_trap_bounce(%rbx),%rdx movq VCPU_domain(%rbx),%rax testb $1,DOMAIN_is_32bit_pv(%rax) - jnz compat_post_handle_exception - testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx) - jz test_all_events -.Lbounce_exception: - call create_bounce_frame - movb $0,TRAPBOUNCE_flags(%rdx) + jnz compat_test_all_events jmp test_all_events /* No special register assumptions. */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor