Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:olh:xen-4.5
xen
xen.7a46badcf4eaa337070a6e7dda61698fd5a32cb3.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xen.7a46badcf4eaa337070a6e7dda61698fd5a32cb3.patch of Package xen
From: Jan Beulich <jbeulich@suse.com> Date: Fri, 9 Jun 2017 13:58:11 +0200 Subject: 7a46badcf4eaa337070a6e7dda61698fd5a32cb3 x86: fix build with gcc 7 -Wint-in-bool-context, enabled by default in gcc 7, doesn't like multiplication in conditional operators. "Hide" them, at the risk of the next compiler version becoming smarter and recognizing even those. (The hope is that added smartness then would also better deal with legitimate cases like the ones here.) The change could have been done in access_ok(), but I think we better keep it at the places the compiler is actually unhappy about. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> master commit: f32400e90c046a9fd76c8917a60d34ade9c02ea2 master date: 2017-05-19 10:11:36 +0200 --- xen/arch/x86/traps.c | 4 ++-- xen/include/asm-x86/x86_64/uaccess.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -3007,44 +3007,44 @@ static void emulate_gate_op(struct cpu_user_regs *regs) regs->error_code = ss & ~3; do_guest_trap(TRAP_invalid_tss, regs, 1); return; } if ( !(ar & _SEGMENT_P) || !check_stack_limit(ar, limit, esp, (4 + nparm) * 4) ) { regs->error_code = ss & ~3; do_guest_trap(TRAP_stack_error, regs, 1); return; } stkp = (unsigned int *)(unsigned long)((unsigned int)base + esp); - if ( !compat_access_ok(stkp - 4 - nparm, (4 + nparm) * 4) ) + if ( !compat_access_ok(stkp - 4 - nparm, 16 + nparm * 4) ) { do_guest_trap(TRAP_gp_fault, regs, 1); return; } push(regs->ss); push(regs->esp); if ( nparm ) { const unsigned int *ustkp; if ( !read_descriptor(regs->ss, v, regs, &base, &limit, &ar, 0) || ((ar >> 13) & 3) != (regs->cs & 3) || !(ar & _SEGMENT_S) || (ar & _SEGMENT_CODE) || !(ar & _SEGMENT_WR) || !check_stack_limit(ar, limit, esp + nparm * 4, nparm * 4) ) return do_guest_trap(TRAP_gp_fault, regs, 1); ustkp = (unsigned int *)(unsigned long)((unsigned int)base + regs->_esp + nparm * 4); - if ( !compat_access_ok(ustkp - nparm, nparm * 4) ) + if ( !compat_access_ok(ustkp - nparm, 0 + nparm * 4) ) { do_guest_trap(TRAP_gp_fault, regs, 1); return; } do { unsigned int parm; --ustkp; rc = __get_user(parm, ustkp); if ( rc ) { --- a/xen/include/asm-x86/x86_64/uaccess.h +++ b/xen/include/asm-x86/x86_64/uaccess.h @@ -46,25 +46,25 @@ extern void *xlat_malloc(unsigned long *xlat_page_current, size_t size); #define __compat_addr_ok(d, addr) \ ((unsigned long)(addr) < HYPERVISOR_COMPAT_VIRT_START(d)) #define __compat_access_ok(d, addr, size) \ __compat_addr_ok(d, (unsigned long)(addr) + ((size) ? (size) - 1 : 0)) #define compat_access_ok(addr, size) \ __compat_access_ok(current->domain, addr, size) #define compat_array_access_ok(addr,count,size) \ (likely((count) < (~0U / (size))) && \ - compat_access_ok(addr, (count) * (size))) + compat_access_ok(addr, 0 + (count) * (size))) #define __put_user_size(x,ptr,size,retval,errret) \ do { \ retval = 0; \ switch (size) { \ case 1: __put_user_asm(x,ptr,retval,"b","b","iq",errret);break; \ case 2: __put_user_asm(x,ptr,retval,"w","w","ir",errret);break; \ case 4: __put_user_asm(x,ptr,retval,"l","k","ir",errret);break; \ case 8: __put_user_asm(x,ptr,retval,"q","","ir",errret);break; \ default: __put_user_bad(); \ } \ } while (0)
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