[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging-4.10] x86: fix return value checks of set_guest_{machinecheck, nmi}_trapbounce
commit 7e21b75a21dbd9eabd6d8df057d330dda5813201 Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Fri May 18 11:46:41 2018 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Fri May 18 11:46:41 2018 +0200 x86: fix return value checks of set_guest_{machinecheck,nmi}_trapbounce Commit 0142064421 ("x86/traps: move set_guest_{machine,nmi}_trapbounce") converted the functions' return types from int to bool without also correcting the checks in assembly code: The ABI does not guarantee sub- 32-bit return values to be promoted to 32 bits. Take the liberty and also adjust the number of spaces used in the compat code, such that both code sequences end up similar (they already are in the non-compat case). Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> master commit: 4611f529c0e39493a3945641cc161967a864d6b5 master date: 2018-05-03 17:35:51 +0200 --- xen/arch/x86/x86_64/compat/entry.S | 12 ++++++------ xen/arch/x86/x86_64/entry.S | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S index 4dc539e271..a47cb9dc19 100644 --- a/xen/arch/x86/x86_64/compat/entry.S +++ b/xen/arch/x86/x86_64/compat/entry.S @@ -89,9 +89,9 @@ compat_process_mce: testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%rbx) jnz .Lcompat_test_guest_nmi sti - movb $0,VCPU_mce_pending(%rbx) - call set_guest_machinecheck_trapbounce - testl %eax,%eax + movb $0, VCPU_mce_pending(%rbx) + call set_guest_machinecheck_trapbounce + test %al, %al jz compat_test_all_events movzbl VCPU_async_exception_mask(%rbx),%edx # save mask for the movb %dl,VCPU_mce_old_mask(%rbx) # iret hypercall @@ -103,11 +103,11 @@ compat_process_mce: /* %rbx: struct vcpu */ compat_process_nmi: testb $1 << VCPU_TRAP_NMI,VCPU_async_exception_mask(%rbx) - jnz compat_test_guest_events + jnz compat_test_guest_events sti - movb $0,VCPU_nmi_pending(%rbx) + movb $0, VCPU_nmi_pending(%rbx) call set_guest_nmi_trapbounce - testl %eax,%eax + test %al, %al jz compat_test_all_events movzbl VCPU_async_exception_mask(%rbx),%edx # save mask for the movb %dl,VCPU_nmi_old_mask(%rbx) # iret hypercall diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S index 1107f72e02..41d3ec21a1 100644 --- a/xen/arch/x86/x86_64/entry.S +++ b/xen/arch/x86/x86_64/entry.S @@ -92,7 +92,7 @@ process_mce: sti movb $0, VCPU_mce_pending(%rbx) call set_guest_machinecheck_trapbounce - test %eax, %eax + test %al, %al jz test_all_events movzbl VCPU_async_exception_mask(%rbx), %edx # save mask for the movb %dl, VCPU_mce_old_mask(%rbx) # iret hypercall @@ -108,7 +108,7 @@ process_nmi: sti movb $0, VCPU_nmi_pending(%rbx) call set_guest_nmi_trapbounce - test %eax, %eax + test %al, %al jz test_all_events movzbl VCPU_async_exception_mask(%rbx), %edx # save mask for the movb %dl, VCPU_nmi_old_mask(%rbx) # iret hypercall -- generated by git-patchbot for /home/xen/git/xen.git#staging-4.10 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |