From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586467049; cv=none; d=zohomail.com; s=zohoarc; b=iLrl4s+5bjA+U2bAImXBW4LU6+PnR0aUnl0NmGg06OImPVo5ftSgtL0gu6crnQ/b5BM8/i1Vo/VwZ1MgXP2iDtl9vBUuQysfGt5FAZ5acDfYbKOg04H340nWQPNqstxOy8yRx1Iazn5DFjpnsZeegviftx9XQLHIRBUF/yVDhJw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586467049; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ITHp/kEolbZdKkPDRbNKDAnTtqhWxFt1FMIeHrkT1Fo=; b=TYuLBqMjRSK5PUtNucuvyihsA3i3oC7mHubhJqViUpXZ2t12eQx2Ld/e65CI6zAKtKuY237g4akN7xR3jPorL8x3EGrn7nfHT4xBhkmrK/3e7FvXYQNCrt8BFUl4159sWDPcMRJ7cYo+AwnMILuCDVPwrSjhjThtXg37JawDTDc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15864670490321011.1240370618104; Thu, 9 Apr 2020 14:17:29 -0700 (PDT) Received: from localhost ([::1]:55600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeY9-0003mQ-MF for importer@patchew.org; Thu, 09 Apr 2020 17:17:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42311) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeWQ-00022R-Qb for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMeWN-0005dc-SE for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:38 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:54758) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMeWN-0005cm-Hs for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:35 -0400 Received: by mail-wm1-x335.google.com with SMTP id h2so265712wmb.4 for ; Thu, 09 Apr 2020 14:15:35 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x11sm40545386wru.62.2020.04.09.14.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:15:31 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 211EA1FF87; Thu, 9 Apr 2020 22:15:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ITHp/kEolbZdKkPDRbNKDAnTtqhWxFt1FMIeHrkT1Fo=; b=EIjH0pA8pRF3CNcxE03g2+5nGHDowHA39kZWdTjM91Kzzaw1U1G1u+s0gKRYWOo11H s1HjkmXEOUorKI/gNKyP6V2zco1sl0GItYVdAsTVCCaMo4tmx/kEV09bs8rufKb2FRSl nap6IfIVU8OrusxITIVo6TxLXJEPaTBbRTuOpRTknPw0kOE/tZxtFvvg7lbuMXfkspNn d54oPH+1K9Bg3LJMR0ZJjiJUiHuFNhsSxUo0i2dcMCijbwcJlX7dQk0GSpd4LwFuW9el DG/yetckzKTpN0hBBvgdIIBWOSH5gFdidgZaGgvaOFYHiy0afVBmMCsrP1l72RRC63MO g7Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ITHp/kEolbZdKkPDRbNKDAnTtqhWxFt1FMIeHrkT1Fo=; b=JEeKOotHduOeLrSjBH8kC2VcI1LO0pj0I7zG4yNNYKxed2tk9wUgzjrmjAkwzrutai SrYyoX6KT2h/d+lXsNvIp5Whob2FAa2IyDTpFyzIozgUyhyqVYSJs1/TEKIL5tkece3T BArL0tcee3JmAoWTq1431eq+VtUkhq5sz2J5/s2P6D1JmgislUvuDdtmKV/+iqajAh1k G+l4xwuZJHg8iq1no3vSTGIWld9PTthilQFKyKTqHYgaqwGRcQcuyz0Oa798AkW+MyuV M78FhcogLiZRVwufSQHdhT2jkGYGVV9tFNzd6ih5+yLmmlDRZG9WAaR3rkTf9IRwA8ud TTVw== X-Gm-Message-State: AGi0PuZDWToxtS3eXP+3vUDGJktB2w+4ko7MnLUaLDd9SnXakxI0ZR55 QNyeYjsOcBZRONGHKkYAkX4faDjhfPU= X-Google-Smtp-Source: APiQypIb+qRCYotv8l+yos4iMt7XE/cxP8YlRWt9H216oe7Fr86ISv7VjsQK4z07yvDPlz2I4vtlHA== X-Received: by 2002:a7b:cd07:: with SMTP id f7mr1775219wmj.30.1586466933990; Thu, 09 Apr 2020 14:15:33 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 01/11] linux-user: completely re-write init_guest_space Date: Thu, 9 Apr 2020 22:15:19 +0100 Message-Id: <20200409211529.5269-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409211529.5269-1-alex.bennee@linaro.org> References: <20200409211529.5269-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) First we ensure all guest space initialisation logic comes through probe_guest_base once we understand the nature of the binary we are loading. The convoluted init_guest_space routine is removed and replaced with a number of pgb_* helpers which are called depending on what requirements we have when loading the binary. We first try to do what is requested by the host. Failing that we try and satisfy the guest requested base address. If all those options fail we fall back to finding a space in the memory map using our recently written read_self_maps() helper. There are some additional complications we try and take into account when looking for holes in the address space. We try not to go directly after the system brk() space so there is space for a little growth. We also don't want to have to use negative offsets which would result in slightly less efficient code on x86 when it's unable to use the segment offset register. Less mind-binding gotos and hopefully clearer logic throughout. Signed-off-by: Alex Benn=C3=A9e --- v3 - include rth updates that - split probe_guest_base into multiple functions - more heuristics on gap finding --- linux-user/qemu.h | 31 ++- linux-user/elfload.c | 503 +++++++++++++++++++++--------------------- linux-user/flatload.c | 6 + linux-user/main.c | 23 +- 4 files changed, 277 insertions(+), 286 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 792c74290f8..e1febb88cf5 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -219,18 +219,27 @@ void init_qemu_uname_release(void); void fork_start(void); void fork_end(int child); =20 -/* Creates the initial guest address space in the host memory space using - * the given host start address hint and size. The guest_start parameter - * specifies the start address of the guest space. guest_base will be the - * difference between the host start address computed by this function and - * guest_start. If fixed is specified, then the mapped address space must - * start at host_start. The real start address of the mapped memory space= is - * returned or -1 if there was an error. +/** + * probe_guest_base: + * @image_name: the executable being loaded + * @loaddr: the lowest fixed address in the executable + * @hiaddr: the highest fixed address in the executable + * + * Creates the initial guest address space in the host memory space. + *=20 + * If @loaddr =3D=3D 0, then no address in the executable is fixed, + * i.e. it is fully relocatable. In that case @hiaddr is the size + * of the executable. + * + * This function will not return if a valid value for guest_base + * cannot be chosen. On return, the executable loader can expect + * + * target_mmap(loaddr, hiaddr - loaddr, ...) + * + * to succeed. */ -unsigned long init_guest_space(unsigned long host_start, - unsigned long host_size, - unsigned long guest_start, - bool fixed); +void probe_guest_base(const char *image_name, + abi_ulong loaddr, abi_ulong hiaddr); =20 #include "qemu/log.h" =20 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 619c054cc48..01a9323a637 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -11,6 +11,7 @@ #include "qemu/queue.h" #include "qemu/guest-random.h" #include "qemu/units.h" +#include "qemu/selfmap.h" =20 #ifdef _ARCH_PPC64 #undef ARCH_DLINFO @@ -382,68 +383,30 @@ enum { =20 /* The commpage only exists for 32 bit kernels */ =20 -/* Return 1 if the proposed guest space is suitable for the guest. - * Return 0 if the proposed guest space isn't suitable, but another - * address space should be tried. - * Return -1 if there is no way the proposed guest space can be - * valid regardless of the base. - * The guest code may leave a page mapped and populate it if the - * address is suitable. - */ -static int init_guest_commpage(unsigned long guest_base, - unsigned long guest_size) -{ - unsigned long real_start, test_page_addr; - - /* We need to check that we can force a fault on access to the - * commpage at 0xffff0fxx - */ - test_page_addr =3D guest_base + (0xffff0f00 & qemu_host_page_mask); - - /* If the commpage lies within the already allocated guest space, - * then there is no way we can allocate it. - * - * You may be thinking that that this check is redundant because - * we already validated the guest size against MAX_RESERVED_VA; - * but if qemu_host_page_mask is unusually large, then - * test_page_addr may be lower. - */ - if (test_page_addr >=3D guest_base - && test_page_addr < (guest_base + guest_size)) { - return -1; - } +#define ARM_COMMPAGE (intptr_t)0xffff0f00u =20 - /* Note it needs to be writeable to let us initialise it */ - real_start =3D (unsigned long) - mmap((void *)test_page_addr, qemu_host_page_size, - PROT_READ | PROT_WRITE, - MAP_ANONYMOUS | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +static bool init_guest_commpage(void) +{ + void *want =3D g2h(ARM_COMMPAGE & -qemu_host_page_size); + void *addr =3D mmap(want, qemu_host_page_size, PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); =20 - /* If we can't map it then try another address */ - if (real_start =3D=3D -1ul) { - return 0; + if (addr =3D=3D MAP_FAILED) { + perror("Allocating guest commpage"); + exit(EXIT_FAILURE); } - - if (real_start !=3D test_page_addr) { - /* OS didn't put the page where we asked - unmap and reject */ - munmap((void *)real_start, qemu_host_page_size); - return 0; + if (addr !=3D want) { + return false; } =20 - /* Leave the page mapped - * Populate it (mmap should have left it all 0'd) - */ - - /* Kernel helper versions */ - __put_user(5, (uint32_t *)g2h(0xffff0ffcul)); + /* Set kernel helper versions; rest of page is 0. */ + __put_user(5, (uint32_t *)g2h(0xffff0ffcu)); =20 - /* Now it's populated make it RO */ - if (mprotect((void *)test_page_addr, qemu_host_page_size, PROT_READ)) { + if (mprotect(addr, qemu_host_page_size, PROT_READ)) { perror("Protecting guest commpage"); - exit(-1); + exit(EXIT_FAILURE); } - - return 1; /* All good */ + return true; } =20 #define ELF_HWCAP get_elf_hwcap() @@ -2075,239 +2038,267 @@ static abi_ulong create_elf_tables(abi_ulong p, i= nt argc, int envc, return sp; } =20 -unsigned long init_guest_space(unsigned long host_start, - unsigned long host_size, - unsigned long guest_start, - bool fixed) -{ - /* In order to use host shmat, we must be able to honor SHMLBA. */ - unsigned long align =3D MAX(SHMLBA, qemu_host_page_size); - unsigned long current_start, aligned_start; - int flags; - - assert(host_start || host_size); - - /* If just a starting address is given, then just verify that - * address. */ - if (host_start && !host_size) { -#if defined(TARGET_ARM) && !defined(TARGET_AARCH64) - if (init_guest_commpage(host_start, host_size) !=3D 1) { - return (unsigned long)-1; - } +#ifndef ARM_COMMPAGE +#define ARM_COMMPAGE 0 +#define init_guest_commpage() true #endif - return host_start; - } =20 - /* Setup the initial flags and start address. */ - current_start =3D host_start & -align; - flags =3D MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE; - if (fixed) { - flags |=3D MAP_FIXED; - } +static void pgb_fail_in_use(const char *image_name) +{ + error_report("%s: requires virtual address space that is in use " + "(omit the -B option or choose a different value)", + image_name); + exit(EXIT_FAILURE); +} =20 - /* Otherwise, a non-zero size region of memory needs to be mapped - * and validated. */ +static void pgb_have_guest_base(const char *image_name, abi_ulong guest_lo= addr, + abi_ulong guest_hiaddr, long align) +{ + const int flags =3D MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE; + void *addr, *test; =20 -#if defined(TARGET_ARM) && !defined(TARGET_AARCH64) - /* On 32-bit ARM, we need to map not just the usable memory, but - * also the commpage. Try to find a suitable place by allocating - * a big chunk for all of it. If host_start, then the naive - * strategy probably does good enough. - */ - if (!host_start) { - unsigned long guest_full_size, host_full_size, real_start; - - guest_full_size =3D - (0xffff0f00 & qemu_host_page_mask) + qemu_host_page_size; - host_full_size =3D guest_full_size - guest_start; - real_start =3D (unsigned long) - mmap(NULL, host_full_size, PROT_NONE, flags, -1, 0); - if (real_start =3D=3D (unsigned long)-1) { - if (host_size < host_full_size - qemu_host_page_size) { - /* We failed to map a continous segment, but we're - * allowed to have a gap between the usable memory and - * the commpage where other things can be mapped. - * This sparseness gives us more flexibility to find - * an address range. - */ - goto naive; - } - return (unsigned long)-1; + if (!QEMU_IS_ALIGNED(guest_base, align)) { + fprintf(stderr, "Requested guest base 0x%lx does not satisfy " + "host minimum alignment (0x%lx)\n", + guest_base, align); + exit(EXIT_FAILURE); + } + + /* Sanity check the guest binary. */ + if (reserved_va) { + if (guest_hiaddr > reserved_va) { + error_report("%s: requires more than reserved virtual " + "address space (0x%" PRIx64 " > 0x%lx)", + image_name, (uint64_t)guest_hiaddr, reserved_va); + exit(EXIT_FAILURE); } - munmap((void *)real_start, host_full_size); - if (real_start & (align - 1)) { - /* The same thing again, but with extra - * so that we can shift around alignment. - */ - unsigned long real_size =3D host_full_size + qemu_host_page_si= ze; - real_start =3D (unsigned long) - mmap(NULL, real_size, PROT_NONE, flags, -1, 0); - if (real_start =3D=3D (unsigned long)-1) { - if (host_size < host_full_size - qemu_host_page_size) { - goto naive; - } - return (unsigned long)-1; - } - munmap((void *)real_start, real_size); - real_start =3D ROUND_UP(real_start, align); + } else { + if ((guest_hiaddr - guest_base) > ~(uintptr_t)0) { + error_report("%s: requires more virtual address space " + "than the host can provide (0x%" PRIx64 ")", + image_name, (uint64_t)guest_hiaddr - guest_base); + exit(EXIT_FAILURE); } - current_start =3D real_start; } - naive: -#endif =20 - while (1) { - unsigned long real_start, real_size, aligned_size; - aligned_size =3D real_size =3D host_size; + /* + * Expand the allocation to the entire reserved_va. + * Exclude the mmap_min_addr hole. + */ + if (reserved_va) { + guest_loaddr =3D (guest_base >=3D mmap_min_addr ? 0 + : mmap_min_addr - guest_base); + guest_hiaddr =3D reserved_va; + } =20 - /* Do not use mmap_find_vma here because that is limited to the - * guest address space. We are going to make the - * guest address space fit whatever we're given. - */ - real_start =3D (unsigned long) - mmap((void *)current_start, host_size, PROT_NONE, flags, -1, 0= ); - if (real_start =3D=3D (unsigned long)-1) { - return (unsigned long)-1; - } + /* Reserve the address space for the binary, or reserved_va. */ + test =3D g2h(guest_loaddr); + addr =3D mmap(test, guest_hiaddr - guest_loaddr, PROT_NONE, flags, -1,= 0); + if (test !=3D addr) { + pgb_fail_in_use(image_name); + } +} =20 - /* Check to see if the address is valid. */ - if (host_start && real_start !=3D current_start) { - qemu_log_mask(CPU_LOG_PAGE, "invalid %lx && %lx !=3D %lx\n", - host_start, real_start, current_start); - goto try_again; +/* Return value for guest_base, or -1 if no hole found. */ +static uintptr_t pgb_find_hole(uintptr_t guest_loaddr, uintptr_t guest_siz= e, + long align) +{ + GSList *maps, *iter; + uintptr_t this_start, this_end, next_start, brk; + intptr_t ret =3D -1; + + assert(QEMU_IS_ALIGNED(guest_loaddr, align)); + + maps =3D read_self_maps(); + + /* Read brk after we've read the maps, which will malloc. */ + brk =3D (uintptr_t)sbrk(0); + + /* The first hole is before the first map entry. */ + this_start =3D mmap_min_addr; + + for (iter =3D maps; iter; + this_start =3D next_start, iter =3D g_slist_next(iter)) { + uintptr_t align_start, hole_size; + + this_end =3D ((MapInfo *)iter->data)->start; + next_start =3D ((MapInfo *)iter->data)->end; + align_start =3D ROUND_UP(this_start, align); + + /* Skip holes that are too small. */ + if (align_start >=3D this_end) { + continue; + } + hole_size =3D this_end - align_start; + if (hole_size < guest_size) { + continue; } =20 - /* Ensure the address is properly aligned. */ - if (real_start & (align - 1)) { - /* Ideally, we adjust like - * - * pages: [ ][ ][ ][ ][ ] - * old: [ real ] - * [ aligned ] - * new: [ real ] - * [ aligned ] - * - * But if there is something else mapped right after it, - * then obviously it won't have room to grow, and the - * kernel will put the new larger real someplace else with - * unknown alignment (if we made it to here, then - * fixed=3Dfalse). Which is why we grow real by a full page - * size, instead of by part of one; so that even if we get - * moved, we can still guarantee alignment. But this does - * mean that there is a padding of < 1 page both before - * and after the aligned range; the "after" could could - * cause problems for ARM emulation where it could butt in - * to where we need to put the commpage. - */ - munmap((void *)real_start, host_size); - real_size =3D aligned_size + align; - real_start =3D (unsigned long) - mmap((void *)real_start, real_size, PROT_NONE, flags, -1, = 0); - if (real_start =3D=3D (unsigned long)-1) { - return (unsigned long)-1; + /* If this hole contains brk, give ourselves some room to grow. */ + if (this_start <=3D brk && brk < this_end) { + hole_size -=3D guest_size; + if (sizeof(uintptr_t) =3D=3D 8 && hole_size >=3D 1 * GiB) { + align_start +=3D 1 * GiB; + } else if (hole_size >=3D 16 * MiB) { + align_start +=3D 16 * MiB; + } else { + align_start =3D (this_end - guest_size) & -align; + if (align_start < this_start) { + continue; + } } - aligned_start =3D ROUND_UP(real_start, align); - } else { - aligned_start =3D real_start; } =20 -#if defined(TARGET_ARM) && !defined(TARGET_AARCH64) - /* On 32-bit ARM, we need to also be able to map the commpage. */ - int valid =3D init_guest_commpage(aligned_start - guest_start, - aligned_size + guest_start); - if (valid =3D=3D -1) { - munmap((void *)real_start, real_size); - return (unsigned long)-1; - } else if (valid =3D=3D 0) { - goto try_again; + /* Record the lowest successful match. */ + if (ret < 0) { + ret =3D align_start - guest_loaddr; } -#endif - - /* If nothing has said `return -1` or `goto try_again` yet, - * then the address we have is good. - */ - break; - - try_again: - /* That address didn't work. Unmap and try a different one. - * The address the host picked because is typically right at - * the top of the host address space and leaves the guest with - * no usable address space. Resort to a linear search. We - * already compensated for mmap_min_addr, so this should not - * happen often. Probably means we got unlucky and host - * address space randomization put a shared library somewhere - * inconvenient. - * - * This is probably a good strategy if host_start, but is - * probably a bad strategy if not, which means we got here - * because of trouble with ARM commpage setup. - */ - if (munmap((void *)real_start, real_size) !=3D 0) { - error_report("%s: failed to unmap %lx:%lx (%s)", __func__, - real_start, real_size, strerror(errno)); - abort(); + /* If this hole contains the identity map, select it. */ + if (align_start <=3D guest_loaddr && + guest_loaddr + guest_size <=3D this_end) { + ret =3D 0; } - current_start +=3D align; - if (host_start =3D=3D current_start) { - /* Theoretically possible if host doesn't have any suitably - * aligned areas. Normally the first mmap will fail. - */ - return (unsigned long)-1; + /* If this hole ends above the identity map, stop looking. */ + if (this_end >=3D guest_loaddr) { + break; } } + free_self_maps(maps); =20 - qemu_log_mask(CPU_LOG_PAGE, "Reserved 0x%lx bytes of guest address spa= ce\n", host_size); - - return aligned_start; + return ret; } =20 -static void probe_guest_base(const char *image_name, - abi_ulong loaddr, abi_ulong hiaddr) +static void pgb_static(const char *image_name, abi_ulong orig_loaddr, + abi_ulong orig_hiaddr, long align) { - /* Probe for a suitable guest base address, if the user has not set - * it explicitly, and set guest_base appropriately. - * In case of error we will print a suitable message and exit. - */ - const char *errmsg; - if (!have_guest_base && !reserved_va) { - unsigned long host_start, real_start, host_size; + uintptr_t loaddr =3D orig_loaddr; + uintptr_t hiaddr =3D orig_hiaddr; + uintptr_t addr; =20 - /* Round addresses to page boundaries. */ - loaddr &=3D qemu_host_page_mask; - hiaddr =3D HOST_PAGE_ALIGN(hiaddr); + if (hiaddr !=3D orig_hiaddr) { + error_report("%s: requires virtual address space that the " + "host cannot provide (0x%" PRIx64 ")", + image_name, (uint64_t)orig_hiaddr); + exit(EXIT_FAILURE); + } =20 - if (loaddr < mmap_min_addr) { - host_start =3D HOST_PAGE_ALIGN(mmap_min_addr); + loaddr &=3D -align; + if (ARM_COMMPAGE) { + /* + * Extend the allocation to include the commpage. + * For a 64-bit host, this is just 4GiB; for a 32-bit host, + * the address arithmetic will wrap around, but the difference + * will produce the correct allocation size. + */ + if (sizeof(uintptr_t) =3D=3D 8 || loaddr >=3D 0x80000000u) { + hiaddr =3D (uintptr_t)4 << 30; } else { - host_start =3D loaddr; - if (host_start !=3D loaddr) { - errmsg =3D "Address overflow loading ELF binary"; - goto exit_errmsg; - } + loaddr =3D ARM_COMMPAGE & -align; } - host_size =3D hiaddr - loaddr; + } =20 - /* Setup the initial guest memory space with ranges gleaned from - * the ELF image that is being loaded. + addr =3D pgb_find_hole(loaddr, hiaddr - loaddr, align); + if (addr =3D=3D -1) { + /* + * If ARM_COMMPAGE, there *might* be a non-consecutive allocation + * that can satisfy both. But as the normal arm32 link base addre= ss + * is ~32k, and we extend down to include the commpage, making the + * overhead only ~96k, this is unlikely. */ - real_start =3D init_guest_space(host_start, host_size, loaddr, fal= se); - if (real_start =3D=3D (unsigned long)-1) { - errmsg =3D "Unable to find space for application"; - goto exit_errmsg; - } - guest_base =3D real_start - loaddr; + error_report("%s: Unable to allocate %#zx bytes of " + "virtual address space", image_name, + (size_t)(hiaddr - loaddr)); + exit(EXIT_FAILURE); + } + + guest_base =3D addr; +} + +static void pgb_dynamic(const char *image_name, long align) +{ + /* + * The executable is dynamic and does not require a fixed address. + * All we need is a commpage that satisfies align. + * If we do not need a commpage, leave guest_base =3D=3D 0. + */ + if (ARM_COMMPAGE) { + uintptr_t addr, commpage; =20 - qemu_log_mask(CPU_LOG_PAGE, "Relocating guest address space from 0= x" - TARGET_ABI_FMT_lx " to 0x%lx\n", - loaddr, real_start); + /* 64-bit hosts should have used reserved_va. */ + assert(sizeof(uintptr_t) =3D=3D 4); + + /* + * By putting the commpage at the first hole, that puts guest_base + * just above that, and maximises the positive guest addresses. + */ + commpage =3D ARM_COMMPAGE & -align; + addr =3D pgb_find_hole(commpage, -commpage, align); + assert(addr !=3D -1); + guest_base =3D addr; } - return; +} =20 -exit_errmsg: - fprintf(stderr, "%s: %s\n", image_name, errmsg); - exit(-1); +static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr, + abi_ulong guest_hiaddr, long align) +{ + const int flags =3D MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE; + void *addr, *test; + + if (guest_hiaddr > reserved_va) { + error_report("%s: requires more than reserved virtual " + "address space (0x%" PRIx64 " > 0x%lx)", + image_name, (uint64_t)guest_hiaddr, reserved_va); + exit(EXIT_FAILURE); + } + + /* Widen the "image" to the entire reserved address space. */ + pgb_static(image_name, 0, reserved_va, align); + + /* Reserve the memory on the host. */ + assert(guest_base !=3D 0); + test =3D g2h(0); + addr =3D mmap(test, reserved_va, PROT_NONE, flags, -1, 0); + if (addr =3D=3D MAP_FAILED) { + error_report("Unable to reserve 0x%lx bytes of virtual address " + "space for use as guest address space (check your " + "virtual memory ulimit setting or reserve less " + "using -R option)", reserved_va); + exit(EXIT_FAILURE); + } + assert(addr =3D=3D test); } =20 +void probe_guest_base(const char *image_name, abi_ulong guest_loaddr, + abi_ulong guest_hiaddr) +{ + /* In order to use host shmat, we must be able to honor SHMLBA. */ + uintptr_t align =3D MAX(SHMLBA, qemu_host_page_size); + + if (have_guest_base) { + pgb_have_guest_base(image_name, guest_loaddr, guest_hiaddr, align); + } else if (reserved_va) { + pgb_reserved_va(image_name, guest_loaddr, guest_hiaddr, align); + } else if (guest_loaddr) { + pgb_static(image_name, guest_loaddr, guest_hiaddr, align); + } else { + pgb_dynamic(image_name, align); + } + + /* Reserve and initialize the commpage. */ + if (!init_guest_commpage()) { + /* + * With have_guest_base, the user has selected the address and + * we are trying to work with that. Otherwise, we have selected + * free space and init_guest_commpage must succeeded. + */ + assert(have_guest_base); + pgb_fail_in_use(image_name); + } + + assert(QEMU_IS_ALIGNED(guest_base, align)); + qemu_log_mask(CPU_LOG_PAGE, "Locating guest address space " + "@ 0x%" PRIx64 "\n", (uint64_t)guest_base); +} =20 /* Load an ELF image into the address space. =20 @@ -2399,6 +2390,12 @@ static void load_elf_image(const char *image_name, i= nt image_fd, * MMAP_MIN_ADDR or the QEMU application itself. */ probe_guest_base(image_name, loaddr, hiaddr); + } else { + /* + * The binary is dynamic, but we still need to + * select guest_base. In this case we pass a size. + */ + probe_guest_base(image_name, 0, hiaddr - loaddr); } } =20 diff --git a/linux-user/flatload.c b/linux-user/flatload.c index 0122ab3afe6..952b4cb26d8 100644 --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -441,6 +441,12 @@ static int load_flat_file(struct linux_binprm * bprm, indx_len =3D MAX_SHARED_LIBS * sizeof(abi_ulong); indx_len =3D (indx_len + 15) & ~(abi_ulong)15; =20 + /* + * Alloate the address space. + */ + probe_guest_base(bprm->filename, 0, + text_len + data_len + extra + indx_len); + /* * there are a couple of cases here, the separate code/data * case, and then the fully copied to RAM case which lumps diff --git a/linux-user/main.c b/linux-user/main.c index 22578b16336..1d20a83d4e8 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -24,6 +24,7 @@ #include "qemu-version.h" #include #include +#include =20 #include "qapi/error.h" #include "qemu.h" @@ -747,28 +748,6 @@ int main(int argc, char **argv, char **envp) target_environ =3D envlist_to_environ(envlist, NULL); envlist_free(envlist); =20 - /* - * Now that page sizes are configured in tcg_exec_init() we can do - * proper page alignment for guest_base. - */ - guest_base =3D HOST_PAGE_ALIGN(guest_base); - - if (reserved_va || have_guest_base) { - guest_base =3D init_guest_space(guest_base, reserved_va, 0, - have_guest_base); - if (guest_base =3D=3D (unsigned long)-1) { - fprintf(stderr, "Unable to reserve 0x%lx bytes of virtual addr= ess " - "space for use as guest address space (check your virt= ual " - "memory ulimit setting or reserve less using -R option= )\n", - reserved_va); - exit(EXIT_FAILURE); - } - - if (reserved_va) { - mmap_next_start =3D reserved_va; - } - } - /* * Read in mmap_min_addr kernel parameter. This value is used * When loading the ELF image to determine whether guest_base --=20 2.20.1 From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586467157; cv=none; d=zohomail.com; s=zohoarc; b=RYLmurymYHo7iHQVqziH7fXUBN2IwEo5/XHfln12YE1+cEF1fIMlzjOjqprwxunv+GlVn4x3BFqCOQFsKilamncZuGERXqTFOm8GIBQJGD0BBO7vjdRhHuPaOMFkyT2ASZbgvJ3H7+1Pfn5Yi9pYwYITWjz1b7vJCBDGQkRa+04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586467157; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=L3oo5e13KKY97yaceKpUyQX6w7q5mwKsED5f0rgFBwI=; b=AoAlcyb8OUAfFU7pRdWCACkAr20NS832xU5ELvgH81ApGy27hcc7Yj6FzHilDNttJr/6hAWnr1ck0u6D4z0UstPlFppu3g0p31Fe2cEKf0EaEF0O5tPcgLitN1OiM86Tw8xyzBoDvSxW8MXatp1+eDMZFQE7CeuZVL5P2WC06vE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586467157687638.1307434568987; Thu, 9 Apr 2020 14:19:17 -0700 (PDT) Received: from localhost ([::1]:55640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeZw-0007DK-El for importer@patchew.org; Thu, 09 Apr 2020 17:19:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42266) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeWN-00020d-FZ for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMeWM-0005cE-B8 for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:35 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:46568) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMeWM-0005bp-5V for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:34 -0400 Received: by mail-wr1-x444.google.com with SMTP id f13so7119339wrm.13 for ; Thu, 09 Apr 2020 14:15:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id i8sm44602522wrb.41.2020.04.09.14.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 391D11FF8C; Thu, 9 Apr 2020 22:15:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L3oo5e13KKY97yaceKpUyQX6w7q5mwKsED5f0rgFBwI=; b=EZ9x65bBr9LDMxcvIuXSUbh89pfWZKhTgBH478avcUIAU1K6WbB8Dn0AWPoHlx2Nxo aQP+qZrjNSOYdgdGuN8422Uvpnc8ApzX9nPonIU7S+JpRWFHxgXMSBblHNmE79hpW1CY FVzbQ+LuFzgo1LlLoKW+EAWa4++8sguttc98lfFSQbjt796IuX6soG9WkhtWiswu53IV qawawKKfX+g3Q0aKtT8ievfa+v3KYFYb/LC9jWvt+ANsKIG6ckYX59aQM/b3DesJVXcL sAqPNFEpCqZO9mSKz74vXPlwmcWTxulJk9i5IaBjKRIDcaI+dUNG96oBdLFfAYFXSlnr L0Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L3oo5e13KKY97yaceKpUyQX6w7q5mwKsED5f0rgFBwI=; b=Slh69rrLFQXZEbfAXfvNnT5MJi3HZMficzW+m3U15w6Md11vbvLMZIhw2lUxnweHsz fqcysS1gC/SLz/OeZwovVe7a18yIdvSK1HO0koI5hiLRG66oLMzVgyiyEEpL1p8c60H5 laPEU/7ym7+lkfwZZB22Sj3FmwI9QzXVUEec+iathd39ml9DOidyEQ/7wGIyu2k+Q4Xk Nj7j9vykdjvvHx8Q8ZhGQrkwgeyJNzYrYmwROLLHiP082e+CB7ehff+ML9mIwl0gjMZi VtVhvetrXot6Rz7hs6sT4ic45+fOpzsQj0OEPcHHcLFy8+F+xJyKP/ZnNe4tFEEkrnwH tEkQ== X-Gm-Message-State: AGi0PuZ6w7qSpKUQp3FNyjQ2gH0zBUhSfT1vhFvk6tFPArXLNAhdqIfg HIkyAjSpjmu4jPY3PuJrNpz2og== X-Google-Smtp-Source: APiQypLYk8uO/rPDuKym2dArtQVJkBj8wQaIq0uyyIY6pD+Ipk3+NAFl3LuFjzU2PFXpMlaBTUY5kA== X-Received: by 2002:adf:afe4:: with SMTP id y36mr1103433wrd.205.1586466932969; Thu, 09 Apr 2020 14:15:32 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 02/11] exec/cpu-all: Use bool for have_guest_base Date: Thu, 9 Apr 2020 22:15:20 +0100 Message-Id: <20200409211529.5269-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409211529.5269-1-alex.bennee@linaro.org> References: <20200409211529.5269-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Richard Henderson , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/exec/cpu-all.h | 2 +- bsd-user/main.c | 4 ++-- linux-user/main.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 49384bb66a5..b4fb5832c4a 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -159,7 +159,7 @@ static inline void tswap64s(uint64_t *s) * This allows the guest address space to be offset to a convenient locati= on. */ extern unsigned long guest_base; -extern int have_guest_base; +extern bool have_guest_base; extern unsigned long reserved_va; =20 #if HOST_LONG_BITS <=3D TARGET_VIRT_ADDR_SPACE_BITS diff --git a/bsd-user/main.c b/bsd-user/main.c index 770c2b267ad..aef5531628a 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -42,7 +42,7 @@ int singlestep; unsigned long mmap_min_addr; unsigned long guest_base; -int have_guest_base; +bool have_guest_base; unsigned long reserved_va; =20 static const char *interp_prefix =3D CONFIG_QEMU_INTERP_PREFIX; @@ -828,7 +828,7 @@ int main(int argc, char **argv) } } else if (!strcmp(r, "B")) { guest_base =3D strtol(argv[optind++], NULL, 0); - have_guest_base =3D 1; + have_guest_base =3D true; } else if (!strcmp(r, "drop-ld-preload")) { (void) envlist_unsetenv(envlist, "LD_PRELOAD"); } else if (!strcmp(r, "bsd")) { diff --git a/linux-user/main.c b/linux-user/main.c index 1d20a83d4e8..90ad365b439 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -59,7 +59,7 @@ static const char *cpu_type; static const char *seed_optarg; unsigned long mmap_min_addr; unsigned long guest_base; -int have_guest_base; +bool have_guest_base; =20 /* * Used to implement backwards-compatibility for the `-strace`, and @@ -334,7 +334,7 @@ static void handle_arg_cpu(const char *arg) static void handle_arg_guest_base(const char *arg) { guest_base =3D strtol(arg, NULL, 0); - have_guest_base =3D 1; + have_guest_base =3D true; } =20 static void handle_arg_reserved_va(const char *arg) --=20 2.20.1 From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586467268; cv=none; d=zohomail.com; s=zohoarc; b=h+b9i1Qp6lJuuEwk+1l8NCa+fegYMG09vaXIU1dF/HAx42VpJQB9At8fOEh2B6sVrMdnMgZSu6oLxOQ9GoSyjylZmIabdNrKGexnBJli6U0Y+VXPGtXB0h+jI6sSxhda0yBtCatBLlnbpK++LLdR8LqTZJn4ph8fuP1x2KndLb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586467268; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NOU8+nMEIGED2iJZhktWL6KnvYhctO6T5v6pR87w3Mo=; b=OlsbpPDdHUf+b+VDZVJ6d785jserGv+S5T136r65ajsM2eTw8OBY85u8fGS/sTtNnIhxOu4kpm3H6J2uXS3y9/tyiASGeFozY/+5zBDIu+GTk8bEuTJr0oA6DlU/lDE9gnoZcwZ76+KWZy+izoji+VH1GlWiCVbxW7rFVswpE6M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586467268261709.0072426556063; Thu, 9 Apr 2020 14:21:08 -0700 (PDT) Received: from localhost ([::1]:55714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMebi-00029J-Qs for importer@patchew.org; Thu, 09 Apr 2020 17:21:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42303) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeWQ-00021K-3J for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMeWO-0005ee-M7 for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:38 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:43715) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMeWO-0005da-FX for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:36 -0400 Received: by mail-wr1-x443.google.com with SMTP id i10so7401679wrv.10 for ; Thu, 09 Apr 2020 14:15:36 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c11sm16635780wrt.24.2020.04.09.14.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:15:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 50D8B1FF8F; Thu, 9 Apr 2020 22:15:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NOU8+nMEIGED2iJZhktWL6KnvYhctO6T5v6pR87w3Mo=; b=V9d0Bu6RvtTqDxTr5JqOE/cxlRXXhnHirbzdTgm0jEO+mH6BsThkbzhFLQF8NmTiid fLhQNdmKv/C2Yzbfd3ONdqUFWtpkqX6iJTH0nmiRNYWcQryA+7sZUzWUb14ZWiqCn35c daaLWDjn0awL2E4uBgKqTtXHmzKrakVaQY0GC/dbv0shfnAYVOkAk8rEhy28hg/sWYPu vVHXy8M4Opshvjjqt2PvdwLV7B9lfJr8zWBz4StWyzkdo2W1SVsfcN++8Nb4JjrvqrFX pTiBipjTAvPdC7QIPVdQGUzZC/XTTVkbGK52jhAh/8bxTmgygFYSAwEmROcQ/lBoUzGy qVnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NOU8+nMEIGED2iJZhktWL6KnvYhctO6T5v6pR87w3Mo=; b=D2XQce8APiXFJ7eD0wjm+VcKldEEwI3Z30REjEAKhfAKyz+BFyk4BSGJeBvT6mrVlq 19PfRfdJtu3fpzqtg2wCe+73SZMOqpY7nm0rF2yjTTxqTNsPJE5jqvdznwVJ3Cx7qZbs X+2uKeWexrggNjlnGIBQ0pVCJdDItr8X7Ke/rwX7AxA/zDtZ7bkQ5FN9uN2WlhxpwG47 NBkzBM5aRaJgVW7wmnWL1ryKNOcolov3w8jZAgevAmKApKQHqxRJbyUU5NLNWFJRvD5N 9RDktl4dZsnHsdjsPBUYuD6OyLXzHoCV5gRbuW9du9LeMmm56BoLCf8qM00lehupybux e51g== X-Gm-Message-State: AGi0Pua20hrWgMhCF1KftvZh57LAX3Zll2iBR79Ej8r+8L/x4b53O2nF qV85++6nUR3T5wz3R+zyQ28Sjw== X-Google-Smtp-Source: APiQypLWb8lZdzSFJYRQOFXh/ZPhJTqBObToOgls2yMWhLdAGW92s+h2CFwBUg02hgWfoVUr1r3GQQ== X-Received: by 2002:a5d:4a11:: with SMTP id m17mr1055726wrq.125.1586466935348; Thu, 09 Apr 2020 14:15:35 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 03/11] accel/tcg: Relax va restrictions on 64-bit guests Date: Thu, 9 Apr 2020 22:15:21 +0100 Message-Id: <20200409211529.5269-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409211529.5269-1-alex.bennee@linaro.org> References: <20200409211529.5269-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Richard Henderson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Richard Henderson We cannot at present limit a 64-bit guest to a virtual address space smaller than the host. It will mostly work to ignore this limitation, except if the guest uses high bits of the address space for tags. But it will certainly work better, as presently we can wind up failing to allocate the guest stack. Widen our user-only page tree to the host or abi pointer width. Remove the workaround for this problem from target/alpha. Always validate guest addresses vs reserved_va, as there we control allocation ourselves. Signed-off-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e --- include/exec/cpu-all.h | 23 +++++++++++++++++++---- target/alpha/cpu-param.h | 15 ++------------- accel/tcg/translate-all.c | 15 +++++++++------ 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index b4fb5832c4a..c0c2fa3cc56 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -162,12 +162,27 @@ extern unsigned long guest_base; extern bool have_guest_base; extern unsigned long reserved_va; =20 -#if HOST_LONG_BITS <=3D TARGET_VIRT_ADDR_SPACE_BITS -#define GUEST_ADDR_MAX (~0ul) +/* + * Limit the guest addresses as best we can. + * + * When not using -R reserved_va, we cannot really limit the guest + * to less address space than the host. For 32-bit guests, this + * acts as a sanity check that we're not giving the guest an address + * that it cannot even represent. For 64-bit guests... the address + * might not be what the real kernel would give, but it is at least + * representable in the guest. + * + * TODO: Improve address allocation to avoid this problem, and to + * avoid setting bits at the top of guest addresses that might need + * to be used for tags. + */ +#if MIN(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <=3D 32 +# define GUEST_ADDR_MAX_ UINT32_MAX #else -#define GUEST_ADDR_MAX (reserved_va ? reserved_va - 1 : \ - (1ul << TARGET_VIRT_ADDR_SPACE_BITS) -= 1) +# define GUEST_ADDR_MAX_ ~0ul #endif +#define GUEST_ADDR_MAX (reserved_va ? reserved_va - 1 : GUEST_ADDR_MAX_) + #else =20 #include "exec/hwaddr.h" diff --git a/target/alpha/cpu-param.h b/target/alpha/cpu-param.h index 692aee27ca9..1153992e42a 100644 --- a/target/alpha/cpu-param.h +++ b/target/alpha/cpu-param.h @@ -10,22 +10,11 @@ =20 #define TARGET_LONG_BITS 64 #define TARGET_PAGE_BITS 13 -#ifdef CONFIG_USER_ONLY -/* - * ??? The kernel likes to give addresses in high memory. If the host has - * more virtual address space than the guest, this can lead to impossible - * allocations. Honor the long-standing assumption that only kernel addrs - * are negative, but otherwise allow allocations anywhere. This could lead - * to tricky emulation problems for programs doing tagged addressing, but - * that's far fewer than encounter the impossible allocation problem. - */ -#define TARGET_PHYS_ADDR_SPACE_BITS 63 -#define TARGET_VIRT_ADDR_SPACE_BITS 63 -#else + /* ??? EV4 has 34 phys addr bits, EV5 has 40, EV6 has 44. */ #define TARGET_PHYS_ADDR_SPACE_BITS 44 #define TARGET_VIRT_ADDR_SPACE_BITS (30 + TARGET_PAGE_BITS) -#endif + #define NB_MMU_MODES 3 =20 #endif diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 9924e66d1f7..e4f703a7e6d 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -173,8 +173,13 @@ struct page_collection { #define TB_FOR_EACH_JMP(head_tb, tb, n) \ TB_FOR_EACH_TAGGED((head_tb)->jmp_list_head, tb, n, jmp_list_next) =20 -/* In system mode we want L1_MAP to be based on ram offsets, - while in user mode we want it to be based on virtual addresses. */ +/* + * In system mode we want L1_MAP to be based on ram offsets, + * while in user mode we want it to be based on virtual addresses. + * + * TODO: For user mode, see the caveat re host vs guest virtual + * address spaces near GUEST_ADDR_MAX. + */ #if !defined(CONFIG_USER_ONLY) #if HOST_LONG_BITS < TARGET_PHYS_ADDR_SPACE_BITS # define L1_MAP_ADDR_SPACE_BITS HOST_LONG_BITS @@ -182,7 +187,7 @@ struct page_collection { # define L1_MAP_ADDR_SPACE_BITS TARGET_PHYS_ADDR_SPACE_BITS #endif #else -# define L1_MAP_ADDR_SPACE_BITS TARGET_VIRT_ADDR_SPACE_BITS +# define L1_MAP_ADDR_SPACE_BITS MIN(HOST_LONG_BITS, TARGET_ABI_BITS) #endif =20 /* Size of the L2 (and L3, etc) page tables. */ @@ -2497,9 +2502,7 @@ void page_set_flags(target_ulong start, target_ulong = end, int flags) /* This function should never be called with addresses outside the guest address space. If this assert fires, it probably indicates a missing call to h2g_valid. */ -#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS - assert(end <=3D ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS)); -#endif + assert(end - 1 <=3D GUEST_ADDR_MAX); assert(start < end); assert_memory_lock(); =20 --=20 2.20.1 From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586467045; cv=none; d=zohomail.com; s=zohoarc; b=X1SsWbf2dD8FZIxbHg3+KtXnOh7xQNRbPcXnfdwUSAlC+RBXNB2S1R+72alhTc0XivnLxGxBWBjp4vD31HUcH1jV1jIOUAREeJ+FauLzDHxmEcl8LHTWMnJzJ/8Qu6IzUOVaSyfPIYpgkB0qM8s2jJ0/b9jDH3/FeCl/ZXjR/cc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586467045; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=en3XxeI0kUhj1g+8oDCU8qm2/eo411eCLElDQvibSv4=; b=XB52UCFVlCMj3d/vU2oHNa2YB8NabbHn7k2zsNnSj+K5M1v4JgQkpfhfeSEjy/UGDU3EZ6JdO4pBlz9rgcFlUiyQHL/NUOXRIF+JTaDDalF/sMfyue6H8dEDtDj8dVO+qX6BMQwFk5D8B8I17bHIxmlFM7I/awBXB1Gyr2Vpeu8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586467045780124.11772162677335; Thu, 9 Apr 2020 14:17:25 -0700 (PDT) Received: from localhost ([::1]:55596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeY8-0003jJ-Fi for importer@patchew.org; Thu, 09 Apr 2020 17:17:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42323) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeWR-00023d-Pq for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMeWQ-0005fi-3p for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:39 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:36112) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMeWP-0005f7-T7 for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:38 -0400 Received: by mail-wr1-x441.google.com with SMTP id k1so13758971wrm.3 for ; Thu, 09 Apr 2020 14:15:37 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v7sm4408633wmg.3.2020.04.09.14.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:15:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 656131FF90; Thu, 9 Apr 2020 22:15:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=en3XxeI0kUhj1g+8oDCU8qm2/eo411eCLElDQvibSv4=; b=BtY+6NkZh9PztFPJFQVkCw1KsCuP9tB6Y+bYElEu4HoHvspxU6FY3nHsdQI+Q72tmw XIvbp0MFW8Ht4+9JAf00flsqFo+E8Tpy3BO/NxrXdU36u1TIUa5tF/GhNI8YYjSnEy6S AaHxaXaAUXXW3JfjpVNbxnbjK9trUB0otAVUEqwub1dSTWybW67ybc4W9mNTuyB7IbWq XA36fymyQ14hlZlnkw9VDWQTeJkCBXdo6s0v+V6UJN0HCFA7x8nFLsAVBKrz9lcMFzDK cSPIvY7TOikXFgnij2FLBXVUvK4vz8XlI4XinRHTTBskKHIaIc6l9qhvpH6DFFd1fKaO Oz1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=en3XxeI0kUhj1g+8oDCU8qm2/eo411eCLElDQvibSv4=; b=RewR8Th6qI0vcgfwtRRcpeG3XoHHixy6d4ABL1h+Yv969ohxcPhHf8d+FsNdUU6vNa p2Fn4Ctokls8I/3U8/aTmFyv9ZEU9ObpD5F6c3edltPk8xs2c57nkFFaiAR6SeEvWXQk vvXZ9QAKClOvywsFdXmT+2BYK4FHOgntxPWQOr6CIXKm94W9p/mi6TmEHIFYNOBkmHuw a7YW2K5BIBGa+CTX6ia4Y8Yw+CMtTusUgshGP7SKVSpaxw7iZ1q/u0Vq+QOEM6OEa97K HkwuDbSdVYOW/YWYgZOKDCY6RNkcYOQcjHb2+J3S25RHzvbABAD1qd8SEGbstDKKtu5Q nQpg== X-Gm-Message-State: AGi0PuZJAgbZDWr/xbOuBE2Cqthea+KJ3ZbWGNYtTCkrIbLpjfNXFnwD YJ7Udz+1uEUz/Lr+Kh/U8JpCTw== X-Google-Smtp-Source: APiQypJv4e/QIJNoKFfTKf/JoyzorQCQcXPf2sojqO7HekY6oeLoepihm39qAK3VjqDT7Rn36IRz5w== X-Received: by 2002:a5d:6a4e:: with SMTP id t14mr1152493wrw.101.1586466936785; Thu, 09 Apr 2020 14:15:36 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 04/11] linux-user/ppc: Fix padding in mcontext_t for ppc64 Date: Thu, 9 Apr 2020 22:15:22 +0100 Message-Id: <20200409211529.5269-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409211529.5269-1-alex.bennee@linaro.org> References: <20200409211529.5269-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Riku Voipio , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Richard Henderson The padding that was added in 95cda4c44ee was added to a union, and so it had no effect. This fixes misalignment errors detected by clang sanitizers for ppc64 and ppc64le. In addition, only ppc64 allocates space for VSX registers, so do not save them for ppc32. The kernel only has references to CONFIG_SPE in signal_32.c, so do not attempt to save them for ppc64. Fixes: 95cda4c44ee Signed-off-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e --- linux-user/ppc/signal.c | 69 +++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 40 deletions(-) diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c index ecd99736b7e..20a02c197cb 100644 --- a/linux-user/ppc/signal.c +++ b/linux-user/ppc/signal.c @@ -35,12 +35,26 @@ struct target_mcontext { target_ulong mc_gregs[48]; /* Includes fpscr. */ uint64_t mc_fregs[33]; + #if defined(TARGET_PPC64) /* Pointer to the vector regs */ target_ulong v_regs; + /* + * On ppc64, this mcontext structure is naturally *unaligned*, + * or rather it is aligned on a 8 bytes boundary but not on + * a 16 byte boundary. This pad fixes it up. This is why we + * cannot use ppc_avr_t, which would force alignment. This is + * also why the vector regs are referenced in the ABI by the + * v_regs pointer above so any amount of padding can be added here. + */ + target_ulong pad; + /* VSCR and VRSAVE are saved separately. Also reserve space for VSX. = */ + struct { + uint64_t altivec[34 + 16][2]; + } mc_vregs; #else target_ulong mc_pad[2]; -#endif + /* We need to handle Altivec and SPE at the same time, which no kernel needs to do. Fortunately, the kernel defines this bit to be Altivec-register-large all the time, rather than trying to @@ -48,32 +62,14 @@ struct target_mcontext { union { /* SPE vector registers. One extra for SPEFSCR. */ uint32_t spe[33]; - /* Altivec vector registers. The packing of VSCR and VRSAVE - varies depending on whether we're PPC64 or not: PPC64 splits - them apart; PPC32 stuffs them together. - We also need to account for the VSX registers on PPC64 - */ -#if defined(TARGET_PPC64) -#define QEMU_NVRREG (34 + 16) - /* On ppc64, this mcontext structure is naturally *unaligned*, - * or rather it is aligned on a 8 bytes boundary but not on - * a 16 bytes one. This pad fixes it up. This is also why the - * vector regs are referenced by the v_regs pointer above so - * any amount of padding can be added here - */ - target_ulong pad; -#else - /* On ppc32, we are already aligned to 16 bytes */ -#define QEMU_NVRREG 33 -#endif - /* We cannot use ppc_avr_t here as we do *not* want the implied - * 16-bytes alignment that would result from it. This would have - * the effect of making the whole struct target_mcontext aligned - * which breaks the layout of struct target_ucontext on ppc64. + /* + * Altivec vector registers. One extra for VRSAVE. + * On ppc32, we are already aligned to 16 bytes. We could + * use ppc_avr_t, but choose to share the same type as ppc64. */ - uint64_t altivec[QEMU_NVRREG][2]; -#undef QEMU_NVRREG + uint64_t altivec[33][2]; } mc_vregs; +#endif }; =20 /* See arch/powerpc/include/asm/sigcontext.h. */ @@ -278,6 +274,7 @@ static void save_user_regs(CPUPPCState *env, struct tar= get_mcontext *frame) __put_user((uint32_t)env->spr[SPR_VRSAVE], vrsave); } =20 +#if defined(TARGET_PPC64) /* Save VSX second halves */ if (env->insns_flags2 & PPC2_VSX) { uint64_t *vsregs =3D (uint64_t *)&frame->mc_vregs.altivec[34]; @@ -286,6 +283,7 @@ static void save_user_regs(CPUPPCState *env, struct tar= get_mcontext *frame) __put_user(*vsrl, &vsregs[i]); } } +#endif =20 /* Save floating point registers. */ if (env->insns_flags & PPC_FLOAT) { @@ -296,22 +294,18 @@ static void save_user_regs(CPUPPCState *env, struct t= arget_mcontext *frame) __put_user((uint64_t) env->fpscr, &frame->mc_fregs[32]); } =20 +#if !defined(TARGET_PPC64) /* Save SPE registers. The kernel only saves the high half. */ if (env->insns_flags & PPC_SPE) { -#if defined(TARGET_PPC64) - for (i =3D 0; i < ARRAY_SIZE(env->gpr); i++) { - __put_user(env->gpr[i] >> 32, &frame->mc_vregs.spe[i]); - } -#else for (i =3D 0; i < ARRAY_SIZE(env->gprh); i++) { __put_user(env->gprh[i], &frame->mc_vregs.spe[i]); } -#endif /* Set MSR_SPE in the saved MSR value to indicate that frame->mc_vregs contains valid data. */ msr |=3D MSR_SPE; __put_user(env->spe_fscr, &frame->mc_vregs.spe[32]); } +#endif =20 /* Store MSR. */ __put_user(msr, &frame->mc_gregs[TARGET_PT_MSR]); @@ -392,6 +386,7 @@ static void restore_user_regs(CPUPPCState *env, __get_user(env->spr[SPR_VRSAVE], vrsave); } =20 +#if defined(TARGET_PPC64) /* Restore VSX second halves */ if (env->insns_flags2 & PPC2_VSX) { uint64_t *vsregs =3D (uint64_t *)&frame->mc_vregs.altivec[34]; @@ -400,6 +395,7 @@ static void restore_user_regs(CPUPPCState *env, __get_user(*vsrl, &vsregs[i]); } } +#endif =20 /* Restore floating point registers. */ if (env->insns_flags & PPC_FLOAT) { @@ -412,22 +408,15 @@ static void restore_user_regs(CPUPPCState *env, env->fpscr =3D (uint32_t) fpscr; } =20 +#if !defined(TARGET_PPC64) /* Save SPE registers. The kernel only saves the high half. */ if (env->insns_flags & PPC_SPE) { -#if defined(TARGET_PPC64) - for (i =3D 0; i < ARRAY_SIZE(env->gpr); i++) { - uint32_t hi; - - __get_user(hi, &frame->mc_vregs.spe[i]); - env->gpr[i] =3D ((uint64_t)hi << 32) | ((uint32_t) env->gpr[i]= ); - } -#else for (i =3D 0; i < ARRAY_SIZE(env->gprh); i++) { __get_user(env->gprh[i], &frame->mc_vregs.spe[i]); } -#endif __get_user(env->spe_fscr, &frame->mc_vregs.spe[32]); } +#endif } =20 #if !defined(TARGET_PPC64) --=20 2.20.1 From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586467163; cv=none; d=zohomail.com; s=zohoarc; b=NjnyXGC8cp4ZAeznmoSJoA+kqdgEFWHzaTknT481VwbBQU6nG39h4+ubNjs8M1kYOooDUq4+ecBH6p7oeZsaOnMh2f+q/QBEPaAivHitnzKWHzqtHJ8yFqxk5xuH/fYvAgkcRb/QTE0OO90CAnV5s4ZzzInYXwFlUScqPEoV1vo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586467163; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8kQXViYqUTZuPa2IrzFhn8UbNVNyk6FZ2Gjm7NSMqNs=; b=GTDw08/uCdei/fUY9op2e7OqiJA8ekGJpcvrAGX17JWOiIqrGFJuRaBpF5vpA5Bm57vDkmOZH/1R4QTOfhQxqMty03iT81H8Qr5+51D+qva+5eEr5EjYVZDyrjA1oN+87y6DpUZDyA1Vt1+XOO/+0m3Ho5rtGaIgU57QnfZDnn8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586467163113225.530187494673; Thu, 9 Apr 2020 14:19:23 -0700 (PDT) Received: from localhost ([::1]:55644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMea1-0007T4-Tf for importer@patchew.org; Thu, 09 Apr 2020 17:19:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42336) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeWS-000252-Op for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMeWR-0005gi-8S for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:40 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:50675) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMeWR-0005g3-2J for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:39 -0400 Received: by mail-wm1-x32e.google.com with SMTP id x25so294470wmc.0 for ; Thu, 09 Apr 2020 14:15:39 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j10sm24038122wru.85.2020.04.09.14.15.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:15:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 830BE1FF91; Thu, 9 Apr 2020 22:15:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8kQXViYqUTZuPa2IrzFhn8UbNVNyk6FZ2Gjm7NSMqNs=; b=Nus5r/PBUtysXeNOzCbziBtjB2uborn+ThW7eupuqD/2pQJvPDsYIKnWlJnDVRBxaE sglav2nIVP9iwmP96Znw1zBwDaUTWM6+c20xnmRj9BGIsnIAszo06Tf+qrCGR028z6Ma mwCGOIFuhLzhx22Q5Gyz7tZs/sj8FO5MzcFMWnAoAyrZSkDtLWn/C81tQbGPeu7hyTrX NNFYWTZsARklMZDgZFBuENY2j7kVBhzJAbJWpI9NkKTJONaDjZWfAGb+Jg2VpvbkI5OB i9i1c6zRPoZwn0qLc6gL+xOa7Ya8WED3sbIfjW/ya9NoUQ5jzoYA3RNl00NkZhYmdR3y gvCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8kQXViYqUTZuPa2IrzFhn8UbNVNyk6FZ2Gjm7NSMqNs=; b=hmNDHPjRWqt3w7tjywpoQ+cLVXvnMU4OlMdVL6HxwmY7rprMFZx//xB3/jJpLtCEqZ I++OulBuC2Vpk8gVkAZ+gYJHUfMVWU7y3wdPsujZgu/FrSD43wOAjzUaLsEkxLn3nRj5 ULTe9D1ijscw3QfB1P9uLnwG+00wCjujxbcPw0EzUsfihFQhj4OCIRPhOxIbiq54/6qM oTIqh8oxZPX5/B5g8irB5bKX05gogyeU5CYbcuCNBJ+D6/zIIlzvjuKO25BDMsuAi2vs 87F3IXxdo/A044ciD97hbJRJm9irv7U4iUKpbtbUG2NkUmYuTJ9+VRiVR86osi1XqPPY 01ew== X-Gm-Message-State: AGi0PuY8b7D+xIWaXnvRc66mp90kHlDUv/vH6rOA9qb1FOiZaOuu95MB jMXwSMknBUEoGP+C7wN7rHq3oA== X-Google-Smtp-Source: APiQypKbqLrtSh4fH8LcE2onNKIi88ZMocBJlO67z6NBzpwuHH0frhvfDQp7lg/mCsXEs4P3K+3dmQ== X-Received: by 2002:a1c:9c47:: with SMTP id f68mr1709909wme.148.1586466937998; Thu, 09 Apr 2020 14:15:37 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 05/11] tests/docker: add docs FEATURE flag and use for test-misc Date: Thu, 9 Apr 2020 22:15:23 +0100 Message-Id: <20200409211529.5269-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409211529.5269-1-alex.bennee@linaro.org> References: <20200409211529.5269-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The test-misc docker test fails on a number of images which don't have the prerequisites to build the docs. Use the FEATURES flag so we can skip those tests. As the sphinx test fails to detect whatever feature we need to get hxtool to work we drop them from debian9 so the windows build doesn't attempt to build the docs. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- tests/docker/dockerfiles/debian10.docker | 2 ++ tests/docker/dockerfiles/debian9.docker | 2 -- tests/docker/dockerfiles/fedora.docker | 2 +- tests/docker/dockerfiles/travis.docker | 2 +- tests/docker/dockerfiles/ubuntu.docker | 2 +- tests/docker/dockerfiles/ubuntu1804.docker | 2 +- tests/docker/test-misc | 2 ++ 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/docker/dockerfiles/debian10.docker b/tests/docker/docker= files/debian10.docker index 2fcdc406e83..0769700a416 100644 --- a/tests/docker/dockerfiles/debian10.docker +++ b/tests/docker/dockerfiles/debian10.docker @@ -34,3 +34,5 @@ RUN apt update && \ python3-sphinx \ texinfo \ $(apt-get -s build-dep qemu | egrep ^Inst | fgrep '[all]' | cut -d= \ -f2) + +ENV FEATURES docs diff --git a/tests/docker/dockerfiles/debian9.docker b/tests/docker/dockerf= iles/debian9.docker index 92edbbf0f48..08cc970feb1 100644 --- a/tests/docker/dockerfiles/debian9.docker +++ b/tests/docker/dockerfiles/debian9.docker @@ -30,6 +30,4 @@ RUN apt update && \ pkg-config \ psmisc \ python3 \ - python3-sphinx \ - texinfo \ $(apt-get -s build-dep qemu | egrep ^Inst | fgrep '[all]' | cut -d= \ -f2) diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfi= les/fedora.docker index 4bd2c953af8..179575ecaaa 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -103,4 +103,4 @@ ENV QEMU_CONFIGURE_OPTS --python=3D/usr/bin/python3 RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt ENV PATH $PATH:/usr/libexec/python3-sphinx/ -ENV FEATURES mingw clang pyyaml asan +ENV FEATURES mingw clang pyyaml asan docs diff --git a/tests/docker/dockerfiles/travis.docker b/tests/docker/dockerfi= les/travis.docker index e8eb48dccfd..591282561bc 100644 --- a/tests/docker/dockerfiles/travis.docker +++ b/tests/docker/dockerfiles/travis.docker @@ -13,5 +13,5 @@ RUN apt-get -y install device-tree-compiler python3 pytho= n3-yaml dh-autoreconf g # Travis tools require PhantomJS / Neo4j / Maven accessible # in their PATH (QEMU build won't access them). ENV PATH /usr/local/phantomjs/bin:/usr/local/phantomjs:/usr/local/neo4j-3.= 2.7/bin:/usr/local/maven-3.5.2/bin:/usr/local/cmake-3.9.2/bin:/usr/local/cl= ang-5.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV FEATURES clang pyyaml +ENV FEATURES clang pyyaml docs USER travis diff --git a/tests/docker/dockerfiles/ubuntu.docker b/tests/docker/dockerfi= les/ubuntu.docker index b6c7b41dddd..eeb3b22bf20 100644 --- a/tests/docker/dockerfiles/ubuntu.docker +++ b/tests/docker/dockerfiles/ubuntu.docker @@ -68,4 +68,4 @@ ENV PACKAGES flex bison \ RUN apt-get update && \ DEBIAN_FRONTEND=3Dnoninteractive apt-get -y install $PACKAGES RUN dpkg -l $PACKAGES | sort > /packages.txt -ENV FEATURES clang pyyaml sdl2 +ENV FEATURES clang pyyaml sdl2 docs diff --git a/tests/docker/dockerfiles/ubuntu1804.docker b/tests/docker/dock= erfiles/ubuntu1804.docker index 1efedeef995..f66b06f4cff 100644 --- a/tests/docker/dockerfiles/ubuntu1804.docker +++ b/tests/docker/dockerfiles/ubuntu1804.docker @@ -54,7 +54,7 @@ ENV PACKAGES flex bison \ RUN apt-get update && \ DEBIAN_FRONTEND=3Dnoninteractive apt-get -y install $PACKAGES RUN dpkg -l $PACKAGES | sort > /packages.txt -ENV FEATURES clang pyyaml sdl2 +ENV FEATURES clang pyyaml sdl2 docs =20 # https://bugs.launchpad.net/qemu/+bug/1838763 ENV QEMU_CONFIGURE_OPTS --disable-libssh diff --git a/tests/docker/test-misc b/tests/docker/test-misc index d480afedca7..cc94a738dd0 100755 --- a/tests/docker/test-misc +++ b/tests/docker/test-misc @@ -14,6 +14,8 @@ =20 . common.rc =20 +requires docs + cd "$BUILD_DIR" =20 # build everything else but QEMU --=20 2.20.1 From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586467268; cv=none; d=zohomail.com; s=zohoarc; b=jAk2LvLWvZuABvLasC2Cy9/zqi8HarsW0DF4q54UOcZUX4MqgC65t1cIyAuS+5hNmop+EJBY7dCQ1QYQbNtHxgLJ68l69o4eV6fLn/DEyLrOsSE6g0jTU1ej83JFz76GHUTSbuHMtY4yTYqQckhYYuc54SsidzwLDyhOgqQb3N8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586467268; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BdeCn4+10IAGnxWmwrkvRB49uZrWTVunuxiT/Jj8P3k=; b=fJOlQvofE/DSGZ3oGCq9bo3XIzJfVjjT3fnPqS/xWAkrqyawthOL9knhUw8isCgXv1+mZhetIaELIKH8YReQtX2vEb0hYU6tG5gO0+vjaTs7jEK5UGtQuaj9Dmty/3q6G09yCVXhp1+/+gGVq2sj/Z5ZXkM7RzW5Ff5L74ywYTQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586467268265642.1649892579279; Thu, 9 Apr 2020 14:21:08 -0700 (PDT) Received: from localhost ([::1]:55712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMebi-00029E-O6 for importer@patchew.org; Thu, 09 Apr 2020 17:21:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42349) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeWU-00025x-6o for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMeWS-0005hh-Ah for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:42 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:34130) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMeWS-0005h1-5I for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:40 -0400 Received: by mail-wm1-x335.google.com with SMTP id c195so3416623wme.1 for ; Thu, 09 Apr 2020 14:15:40 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s6sm5167430wmh.17.2020.04.09.14.15.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:15:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 967B61FF92; Thu, 9 Apr 2020 22:15:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BdeCn4+10IAGnxWmwrkvRB49uZrWTVunuxiT/Jj8P3k=; b=c1tIiXIDvJBh4Eg+6dYhPcprRYOKl0gTIA+tOK6kkmyV2UDcoPbXFzKujxwNqvvm7T dHOSaOHKMbicZu+Gaes1roDlsxRbG6gjBC/4IZfy3aQVrBpeK+/NvcIPo07bd5gAH4Q9 F1sciZTvpgMMvuEi59jNbPl42CFaRf6z59Lo7LY7Eu6aGI9YWxI1Y5Pn5+Bq57F+QWRU XZ2YiDv1334obufMCg2uKXmRAaGl54ajveewnBeH7XB85HvzzX64rv4KEkIyTAvvSEEF fJ530c/YPRKtyLdvxnytz4mPX8x4/29eJzaNx9bfkVdbEusdohr7JLs6Ggqakg6S809N 3fKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BdeCn4+10IAGnxWmwrkvRB49uZrWTVunuxiT/Jj8P3k=; b=e3jRnnzwvWnaW15tyaKIvTn3THdoWqiMEW6zvSKE7HYZf6nDyf67KO9A8VBGfif/dE Rtu/p3vdtkiqTwla+XBUI9O3QvO/dVF2HCTMQzAYe2+nRaL75ViZx1LATxQX+Bulabim 5FtTT9raT2XopaY0JM9aqZDEM0tW4wHWm9e4Vjc+cbuStt3xcZx+KVRwigEKoSRthf/x 8VRWnIu9vaAdOiAycukz2Ws2AOmXJZrlFp7Z/K2xydF8yk+XYYPg48Bsp3ARZiHXFZ5F MhHzctCtlipoFO306RHz8+jVcPDrIdFdrMMUhz9f82oqK4Yt3b6x8r4U/r8s5vDBgL5p VvVQ== X-Gm-Message-State: AGi0PubNOB3IJUbZoKqPk7KmnVyxOcS6e/sJh0yPRt0iJjZfvK3OWXkG Undp2iW3GoCeO6Eiz6wW0T5G5A== X-Google-Smtp-Source: APiQypKE5MeDGOqE7WkXJJeUEpYo+++z2drN5M0o5Q9fsI8ABvviper07GxK6+qMphcq8hR4A1smxw== X-Received: by 2002:a1c:7415:: with SMTP id p21mr1720225wmc.93.1586466939240; Thu, 09 Apr 2020 14:15:39 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 06/11] configure: redirect sphinx-build check to config.log Date: Thu, 9 Apr 2020 22:15:24 +0100 Message-Id: <20200409211529.5269-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409211529.5269-1-alex.bennee@linaro.org> References: <20200409211529.5269-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Otherwise it's hard to debug whats going on. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 233c671aaa9..a207cce82bc 100755 --- a/configure +++ b/configure @@ -4936,7 +4936,7 @@ has_sphinx_build() { # sphinx-build doesn't exist at all or if it is too old. mkdir -p "$TMPDIR1/sphinx" touch "$TMPDIR1/sphinx/index.rst" - "$sphinx_build" -c "$source_path/docs" -b html "$TMPDIR1/sphinx" "$TMP= DIR1/sphinx/out" >/dev/null 2>&1 + "$sphinx_build" -c "$source_path/docs" -b html "$TMPDIR1/sphinx" "$TMP= DIR1/sphinx/out" >> config.log 2>&1 } =20 # Check if tools are available to build documentation. --=20 2.20.1 From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586467195; cv=none; d=zohomail.com; s=zohoarc; b=HqNdZ17sBRq2pZADK8UJX+hlSsd6e67hy8tixu7t18inPs/S7vJ7iE3wXBS2sfJpBBLWQXWdETjJ8omK01ZiaHDwKrGehKT6QwS2icZsDxSscox/4hTOpJJbcKUvmhv0PssmD5rWl7gcpI64PYke+hD48Dtfb9aB8xREC/jcpTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586467195; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ziNKYsZMVifuVbLWk94SRoJmjJXfnyU9uE+FhQ5jb/Q=; b=G35cCQ1LK2QpxscPPxIE1YMujgqzWz0kKf72gvYpJ5OlTzyEkQWG4IhmS6I/LMgnE4wyOCJ+fZEqv15Sa2BCORfdLX9f4aNuBTFyid2AvAQ19PnZdN+S7yi4axdO8VhsijYHNuSGvccvQzlGLhCUnMiNbKnC78dgf+xf7VpSMvI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586467195664495.02150079749094; Thu, 9 Apr 2020 14:19:55 -0700 (PDT) Received: from localhost ([::1]:55652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeaX-0000HI-Q7 for importer@patchew.org; Thu, 09 Apr 2020 17:19:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42372) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeWV-00028t-Tt for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMeWU-0005md-PS for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:43 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:38275) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMeWU-0005i7-JH for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:42 -0400 Received: by mail-wm1-x334.google.com with SMTP id f20so329796wmh.3 for ; Thu, 09 Apr 2020 14:15:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b85sm5443767wmb.21.2020.04.09.14.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:15:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AA03F1FF93; Thu, 9 Apr 2020 22:15:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ziNKYsZMVifuVbLWk94SRoJmjJXfnyU9uE+FhQ5jb/Q=; b=ao5c+AdFy4Z91r5753lr0175eqQlPTmo3VUHIzu5J6q9Kuj/3+6zx+SYCh7twi0D01 rQ/vjcw8AePtlkPVvvc2vr9iiSkIJq456ONd3hU8JcZlwvh1jWrNloqWqm5PYdK38p/v oir2d26AXKTN8NPaJX1Of77L2f6za/ghfpk8+Qfru10qTToQVxGZCsMZe5RZI40iRfp1 l5FOzFt5MPluP2Ob7Vc/OcM825HP2/cgi8cTz5+8T1hof1neIVNWgFn4BT9RQF8qHTPl 0/gvt1wmo1i7DfvVoBhf0Q2vbfeNLi8jckhtF9J823NMfsFiJsiUd3hJvLYROhMyHGf7 XohA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ziNKYsZMVifuVbLWk94SRoJmjJXfnyU9uE+FhQ5jb/Q=; b=CvrOR8EP5Rw3uNkRoQ5uJYS54Zm5gjEkUomaKNA73VW8LP7KnwottX6ppHmzmhOMn+ mJRC1HSo/C8WHZ4KLouiPFAwh+RQfAaeTk8urDXDApZNuOoe8U9JvmS0/q1jYAXt785v hONyAdmBpwIqfCkDzVhAvIIVNzmmC5CSUJhYZwah/IMcTeWFKsFGEdS1zWf6/qnVR9Fs sdGIFzfJsbU1aqo8ym6NLJ9hCiODVr4uwINRdrnmcZl3ZqMMELHdKEGh8yTyvma84svK 2ytaOOybr2qy+HpnTMqFNl6qJkpgM9j2vITIqKro2MvdLblJ6SO5uFvS6FXI2lrhhQ7a /Qew== X-Gm-Message-State: AGi0PuaTZ8l7pgG2uysTkhhyAhxPqCV+A5Pa/BM6MBUM4TrD4MWHV51/ L4yhphRzWbUmjcr5JMcdILEK3Q== X-Google-Smtp-Source: APiQypJa6hEPuBlOx8kPCUvdPpqm5mmfN/uvQIxlsCX0OUe5apCxKV+WZnm+IcH2zsuQtltrXnS1gw== X-Received: by 2002:a7b:cdf7:: with SMTP id p23mr1790328wmj.33.1586466940416; Thu, 09 Apr 2020 14:15:40 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 07/11] configure: disable PIE for Windows builds Date: Thu, 9 Apr 2020 22:15:25 +0100 Message-Id: <20200409211529.5269-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409211529.5269-1-alex.bennee@linaro.org> References: <20200409211529.5269-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bug 1871798 <1871798@bugs.launchpad.net>, James Le Cuirot , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) It seems on some compilers the test can pass but still give you broken binaries. [AJB untested - please could windows users test] Fixes: d2cd29e30736 Fixes: https://bugs.launchpad.net/qemu/+bug/1871798 Cc: Bug 1871798 <1871798@bugs.launchpad.net> Cc: James Le Cuirot Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Tested-by: Howard Spoelstra --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index a207cce82bc..e9c5f630c14 100755 --- a/configure +++ b/configure @@ -807,6 +807,7 @@ MINGW32*) audio_drv_list=3D"" fi supported_os=3D"yes" + pie=3D"no" ;; GNU/kFreeBSD) bsd=3D"yes" --=20 2.20.1 From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586467078; cv=none; d=zohomail.com; s=zohoarc; b=CH+oX46oFTf539M0e06SXz/HOFtRBTn/5XNeH/Ak0YCt2VGtbbYBWmNCfYEE1VPevOP2yFl8i3sI7PQYXzCWGnFnTxekkbBVog+v3n3J8eJY4YPl3GDRsiGIGyofsdWpQkadprXvOR4nWB2yiR0qrAYA5vKZrSON4OL//ca/W+o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586467078; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3Vwwp+7FgPCuWIPWypnjEryUlzyp/CqPviLpa6fHhzs=; b=J7fnq9JH5x0jnpU5KVKKwQHLo+ZIsnoUEsGJ4vffJ+eeIDCuPlkj/b0iKHqX2zPUsfLwPsip9ldBx91N5BB4P0Z49cN0PS5czpfNgSZajIQ3PaWxjxQR9xJUi+t4m8jsRuD1s4B3qYHoeNXqsIW8zCaNO3z8b0Jlq9RtL67co64= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586467078778629.1527010125112; Thu, 9 Apr 2020 14:17:58 -0700 (PDT) Received: from localhost ([::1]:55604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeYf-0005K4-Ii for importer@patchew.org; Thu, 09 Apr 2020 17:17:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42370) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeWV-00028P-Kh for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMeWU-0005m5-H7 for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:43 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:44954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMeWU-0005jw-BT for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:42 -0400 Received: by mail-wr1-x42b.google.com with SMTP id c15so13649342wro.11 for ; Thu, 09 Apr 2020 14:15:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 127sm5440743wmd.38.2020.04.09.14.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:15:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C14B21FF96; Thu, 9 Apr 2020 22:15:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3Vwwp+7FgPCuWIPWypnjEryUlzyp/CqPviLpa6fHhzs=; b=QLTcE4JhzphXKShNK4RN0Od/VFN09fkzpUqPAb+/skkecwnvkFLqeNWzN+ccJm+722 YBvnCpNbt8NT/baiYiMS2xMmlkbLLAENVQc2DUsJAPcF9q0UeAlos1j9QU9KHGFZ12Mp GP4r3d7ETBDH4TgcqqR2fyIC2OqVaMaVjOfg2RfduY0JLeUcrVtucQoHo0GtE6KuiAnN g7UljjawR0D8vLtThFNraHMNfn1tUuzlwxMhS9rDclGFzjC4WKL/yePErkx1LOxAEmlx 1ehVHPlQn1as3H8OO2kpP/E5Ckh6JDUxghN3lf3xGnMWlDKbrAdSleBJlNDKjYpSPYKV nFFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3Vwwp+7FgPCuWIPWypnjEryUlzyp/CqPviLpa6fHhzs=; b=c84DVYDUROJTmwen+fx2yH9ZYc0vLYtTlaKMDaMVvJ+isqy6xbEm1a93ieEwmXIFE9 dDCOjSs/aNmgaZ5Frd+2SbUn4Ysu/zZymYRMDOKuzvEzd2z3BQdzqDyYHCnAgvUeFlSs BQeWB1WnEpQkmYwelh1yNntE9S18uJ5g9aLrDaronEvqMj8mjEZ/9byYfGXGu8MYoY9P voeyxOx6lmH9rZBxouS7ih9BQAMRWzfgySar8Swiu5Gt4wNB7re7zr4X4tsUfmQIfMDr XmpM9YIpq8iCSpLBMytP9gEeicyk8BUChT82QY5AejVDXLS5bbr1ny5W/0XzgEsGX/Tc ufqQ== X-Gm-Message-State: AGi0PuZmmjHl537XeQ0QWiOicsbCWkNDI56PgE0t73rkgpeGkd0bH1WI QFMqtPwC6wtFv8PhRbzTChnC43DxRc4= X-Google-Smtp-Source: APiQypKZ/EJWB1Q8+JY9/gHifqgKo3+6jEig1OJGDmu/J6tKZAk4HR4KkmJZ644+QMMtaDQtV/QGuw== X-Received: by 2002:a5d:69ce:: with SMTP id s14mr1075308wrw.413.1586466941366; Thu, 09 Apr 2020 14:15:41 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 08/11] target/m68k/helper: Fix m68k_fpu_gdb_get_reg() use of GByteArray Date: Thu, 9 Apr 2020 22:15:26 +0100 Message-Id: <20200409211529.5269-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409211529.5269-1-alex.bennee@linaro.org> References: <20200409211529.5269-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42b X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Peter Xu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Since a010bdbe719 the gdbstub API takes a GByteArray*. Unfortunately we forgot to update the gdb_get_reg*() calls. Do it now. Fixes: a010bdbe719 ("extend GByteArray to read register helpers") Reported-by: Peter Xu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier Reviewed-by: Peter Xu Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200409172509.4078-1-philmd@redhat.com> Reviewed-by: Richard Henderson --- target/m68k/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 014657c6372..cad40838956 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -109,8 +109,8 @@ static int m68k_fpu_gdb_get_reg(CPUM68KState *env, GByt= eArray *mem_buf, int n) { if (n < 8) { int len =3D gdb_get_reg16(mem_buf, env->fregs[n].l.upper); - len +=3D gdb_get_reg16(mem_buf + len, 0); - len +=3D gdb_get_reg64(mem_buf + len, env->fregs[n].l.lower); + len +=3D gdb_get_reg16(mem_buf, 0); + len +=3D gdb_get_reg64(mem_buf, env->fregs[n].l.lower); return len; } switch (n) { --=20 2.20.1 From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586467321; cv=none; d=zohomail.com; s=zohoarc; b=mtaAD5gFx2Ntr9VNPkQL3I3KUC6ysEpNkcSP2TDtnhS6Xfma21VQ2VJZ834gW2BpFV39RleQqAsS68UUDHbV+0V6olfbkjFFT7b83ekyBNbif8tET9//ERQ7QF0SSpvZuak53MUXSNB/sbOajADB1ol7OObTL17lmqM/Ew+rMHM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586467321; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nVauCqAe02ZVV85VxJmPfUpt8hQkj2V7/kcfJf/XgeM=; b=JJDthiSe1IGmwyHi8jp8GfrAezn647Qk3/YHTgTe8e1fq1dN0AzhgaUhhumk/6yOGl/xaflQIsTvp0r6BVM5cnMdZMlB2RHo4hQrTVeBDqaALw3Vwv0J5i8u/Lvkr4iPiGdolOqGDKnBtVfnZ9p17Aa9wMBWGtVrDiQycs/4SG8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158646732154873.03877243110344; Thu, 9 Apr 2020 14:22:01 -0700 (PDT) Received: from localhost ([::1]:55722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeca-0003MJ-9d for importer@patchew.org; Thu, 09 Apr 2020 17:22:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42394) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeWY-0002CA-15 for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMeWW-0005p8-1a for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:44 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:53436) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMeWV-0005nA-Rs for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:43 -0400 Received: by mail-wm1-x341.google.com with SMTP id d77so272869wmd.3 for ; Thu, 09 Apr 2020 14:15:43 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a15sm4914213wme.17.2020.04.09.14.15.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:15:37 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D6EF61FF98; Thu, 9 Apr 2020 22:15:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nVauCqAe02ZVV85VxJmPfUpt8hQkj2V7/kcfJf/XgeM=; b=cC1P2vPJJVf9RW/DyIIR90z4563W7+d9n5a+q5sh2AmPheKzS/sbazYOi1eQ8q9CEI MSD0p5Zi2L/1pqUFdzrLP4LWOnbvMyFYmtBsge+KZ00wQHUhTwWv+rZdx9v5RbVm6hXt IYrJ0gU53DYYUg/WKuwJ/HyUXcHBwhahh+wo4R+2uWqa8ViAA59I34TS+fJ8CQxQ42Gk 77GLAiRdbECed+RPxh6VXq2UW+6R7cMNS++vOe9wEKJdCAZ7TkJjTybZefC93c5aMRe2 0tb041iYA5CAXqPOAyz2KvJ6owFJAngVxMfku/T7w0D9sDo06DLKVlno6YXfnkEDJY7T yn/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nVauCqAe02ZVV85VxJmPfUpt8hQkj2V7/kcfJf/XgeM=; b=T+dGWtm8mDAvu5Wxo8JPdKKqkupzbBybz8BB2HQvleBY/6t6KIdYu1X6l4UIuS+3ia 50X/TjsQI/YWGAmPykwRvozhX1bUZgj7MD5gJVWvpucYV0wIOTiMShXC5CdWvO8qlfEs DLPiXfpcDUJTA3bsxlnBE4IEaGSKCkaPoYtAZTzcqlBIE598g1he3zfAEY99MpHM86pX 7TFdEBjW5os8Bm7UrL4cQdhpFR9eovy1Rq45xhlJsRQ6JsZiT/D+FxDzq8R+1Mq9kzMA oAGAIpL6qqBtOJUwYn3ymajUOmLuSNWXbIQxkWMjevi6gIAerf2ZkDcu0o5M4VaJettt PUZw== X-Gm-Message-State: AGi0PubzkEuN6Mov1ZEuudUE0tT+hktxesVo1/Y0DdgpBie/wObzBipt 5aTevF1vLEnTJsl11n2DGauh8Q== X-Google-Smtp-Source: APiQypJ1otw2P+unA7+Lti4vRM/jxNQoQfbOwzay6uRm0lG1c/7p+SKdWarS1cFyc5A4oPC/Bmhk1A== X-Received: by 2002:a1c:6787:: with SMTP id b129mr1822353wmc.165.1586466942652; Thu, 09 Apr 2020 14:15:42 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 09/11] gdbstub: i386: Fix gdb_get_reg16() parameter to unbreak gdb Date: Thu, 9 Apr 2020 22:15:27 +0100 Message-Id: <20200409211529.5269-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409211529.5269-1-alex.bennee@linaro.org> References: <20200409211529.5269-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Peter Xu We should only pass in gdb_get_reg16() with the GByteArray* object itself, no need to shift. Without this patch, gdb remote attach will crash QEMU. Fixes: a010bdbe719 ("extend GByteArray to read register helpers") Signed-off-by: Peter Xu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200409164954.36902-3-peterx@redhat.com> Reviewed-by: Richard Henderson Tested-by: Stefano Garzarella --- target/i386/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c index f3d23b614ee..b98a99500ae 100644 --- a/target/i386/gdbstub.c +++ b/target/i386/gdbstub.c @@ -106,7 +106,7 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray = *mem_buf, int n) } else if (n >=3D IDX_FP_REGS && n < IDX_FP_REGS + 8) { floatx80 *fp =3D (floatx80 *) &env->fpregs[n - IDX_FP_REGS]; int len =3D gdb_get_reg64(mem_buf, cpu_to_le64(fp->low)); - len +=3D gdb_get_reg16(mem_buf + len, cpu_to_le16(fp->high)); + len +=3D gdb_get_reg16(mem_buf, cpu_to_le16(fp->high)); return len; } else if (n >=3D IDX_XMM_REGS && n < IDX_XMM_REGS + CPU_NB_REGS) { n -=3D IDX_XMM_REGS; --=20 2.20.1 From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586467376; cv=none; d=zohomail.com; s=zohoarc; b=OBkQ4hAbw4TXVJ7HPWzUDOBENdGiyHLkEWkoQWUvNNOkDX20iTcKtu5F4EWgrhmK0Lc4zqE1yovm3AsPTGCuR929xe2md9wy5I/yoRqiMJxjiOXzO7jBHSp9Y4KKgi3J98OuTP0FUp+9r351EaXkhELfAclU8Dpw9k1oxqMAY6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586467376; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UOHKfqIKF1jCjy8KTE3gn1Ffb6t6apDQDsVpcDQdBmM=; b=RQCNwGFcic9wk4eku86JIK2hESTB79AaoUxamGNYeQ9az8fTnPnkgDOvDpFrX6zsENIO6EQO3tVy/juCvcumM7JJShHAImmOIryVP0ny4XGmLYpW+NzQCQ8hYFh1vTRFayOKotMd22CPr7L/JnQXS3mWfHUy2bMYXsNQkbNXQTY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586467376616713.7938491560006; Thu, 9 Apr 2020 14:22:56 -0700 (PDT) Received: from localhost ([::1]:55754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMedS-0004fF-BR for importer@patchew.org; Thu, 09 Apr 2020 17:22:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42396) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeWY-0002CU-6t for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMeWX-0005qF-2y for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:46 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:46569) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMeWW-0005pW-T2 for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:45 -0400 Received: by mail-wr1-x444.google.com with SMTP id f13so7119751wrm.13 for ; Thu, 09 Apr 2020 14:15:44 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x18sm5045661wmi.29.2020.04.09.14.15.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:15:37 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EE4091FF99; Thu, 9 Apr 2020 22:15:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UOHKfqIKF1jCjy8KTE3gn1Ffb6t6apDQDsVpcDQdBmM=; b=zvkleqK54b0q8+MePDP5WrH3YP8Drad0R5SwOyaUvXPWXJhLxfw6gqYrwoC5QPyBKY bP0RqyDQg1pjNqAOgTVKjJPFk/mnkD+8HJe296Kj3Ak4/3iMBh2eiY643dDWMKNQ3zzG CLoOvVAyz/9LRGM4RNX0nv3LNL3dzs/RONV7nlcjbMcpkhCMYYJKQP0oDeYErzfIlsFi WtFblGD5dH/qhcdpD3YKHZAMndOiQa6xDCBxNeQv6xaiL5bUJKxw7ZNXk7qzfo7SOUdn cvH1kK5WS7N/Siy18w3nszXNoJEfl3i5P+r/DFRqe07+nV0SK+/ixNbHXbrL9XTAr3Nh q/yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UOHKfqIKF1jCjy8KTE3gn1Ffb6t6apDQDsVpcDQdBmM=; b=L6RSb5i2Dn0cGMojWMbEMsJ50XloHPO+AIav1yJZH+Qa6CcESB6UcvoxYrzgNv7vZU J/G/fC5JMWevujOPKnxU0WehaZT+XZ25CGzQQ7Pa/wZKfdrliXthfN6rTSjXdKP0/fLl kAPSNT9Nxubu95ywbuy2NtbV2eoEDG+tj7WD8jya7offrqFO4CbMpiwGeZ07fTErqY7q DFy3bmV0nx27GdgUm0A8xplpMdaZrjvQPPBPkOsDDhtnB3IUMf1FhhitXaqWou9JNdf1 g2mkCZsdubv47YHc+5vPWdFB22liL28upQid8pKE/QhpVhT/GIo6uIlRDtvxqhvB8VUy le7A== X-Gm-Message-State: AGi0PuZ23H6uTwB+kzwq/cvC0EU/P8Cr7zaNG5Wld1rGDo7cdg/jb6qf CUr6MpWuoTr38DvoJ1yxn8hrCw== X-Google-Smtp-Source: APiQypIEQomNRFsdOZgmEZSmQIyxW+r//0e4NHXz7N+YtI+mfg8pXIHkVgvDLNHLHbirZGE62wDCKg== X-Received: by 2002:adf:d851:: with SMTP id k17mr1214694wrl.157.1586466943892; Thu, 09 Apr 2020 14:15:43 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 10/11] linux-user: fix /proc/self/stat handling Date: Thu, 9 Apr 2020 22:15:28 +0100 Message-Id: <20200409211529.5269-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409211529.5269-1-alex.bennee@linaro.org> References: <20200409211529.5269-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=5FMathieu-Daud=C3=A9?= , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Laurent Vivier , Brice Goglin Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) In the original bug report long files names in Guix caused /proc/self/stat be truncated without the trailing ") " as specified in proc manpage which says: (2) comm %s The filename of the executable, in parentheses. This is visible whether or not the executable is swapped out. Additionally it should only be reporting the executable name rather than the full path. Fix both these failings while cleaning up the code to use GString to build up the reported values. As the whole function is cleaned up also adjust the white space to the current coding style. Message-ID: Reported-by: Brice Goglin Cc: Philippe_Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- linux-user/syscall.c | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6495ddc4cda..674f70e70a5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7295,34 +7295,29 @@ static int open_self_stat(void *cpu_env, int fd) { CPUState *cpu =3D env_cpu((CPUArchState *)cpu_env); TaskState *ts =3D cpu->opaque; - abi_ulong start_stack =3D ts->info->start_stack; + g_autoptr(GString) buf =3D g_string_new(NULL); int i; =20 for (i =3D 0; i < 44; i++) { - char buf[128]; - int len; - uint64_t val =3D 0; - - if (i =3D=3D 0) { - /* pid */ - val =3D getpid(); - snprintf(buf, sizeof(buf), "%"PRId64 " ", val); - } else if (i =3D=3D 1) { - /* app name */ - snprintf(buf, sizeof(buf), "(%s) ", ts->bprm->argv[0]); - } else if (i =3D=3D 27) { - /* stack bottom */ - val =3D start_stack; - snprintf(buf, sizeof(buf), "%"PRId64 " ", val); - } else { - /* for the rest, there is MasterCard */ - snprintf(buf, sizeof(buf), "0%c", i =3D=3D 43 ? '\n' : ' '); - } + if (i =3D=3D 0) { + /* pid */ + g_string_printf(buf, FMT_pid " ", getpid()); + } else if (i =3D=3D 1) { + /* app name */ + gchar *bin =3D g_strrstr(ts->bprm->argv[0], "/"); + bin =3D bin ? bin + 1 : ts->bprm->argv[0]; + g_string_printf(buf, "(%.15s) ", bin); + } else if (i =3D=3D 27) { + /* stack bottom */ + g_string_printf(buf, TARGET_ABI_FMT_ld " ", ts->info->start_st= ack); + } else { + /* for the rest, there is MasterCard */ + g_string_printf(buf, "0%c", i =3D=3D 43 ? '\n' : ' '); + } =20 - len =3D strlen(buf); - if (write(fd, buf, len) !=3D len) { - return -1; - } + if (write(fd, buf->str, buf->len) !=3D buf->len) { + return -1; + } } =20 return 0; --=20 2.20.1 From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586467164; cv=none; d=zohomail.com; s=zohoarc; b=jQLx/f5C8mfIfsZEdlCsCO2VxwjMKIksLsGiTfMmuF8A9uokEbkklRyRYEC+su67Ry8wG8jD4Xo5Bz7+uknjWAu2jV6JmVnl+/V+pZaKzqAlZr3+s7Ihrg0vDDX1WZOQMQGjMJb77De6Zs56OrpcQrLJUbUW62qdO6zQMmOg2Yw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586467164; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NsgGnaK6H7tXZSUowxzbNGfoZoXPun4GYcBXJ76FIg0=; b=P2gPcGSJnMnREUN6RCw/gnjrm4nuG9WlZIgDeV/VkFUVjFGIhn2Da33GhTl+I5nolLkOB2uaZ6P1SvONA1trzh6YsYLguO0OG+mifYwV9VuHhjgyUEMhS2OD6+H2rwV1y2qQ013q/fDN1mFDa7LuFEIlkYYX/swsRGnU24m2Yg4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586467164921661.967379837281; Thu, 9 Apr 2020 14:19:24 -0700 (PDT) Received: from localhost ([::1]:55648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMea3-0007Vo-Lz for importer@patchew.org; Thu, 09 Apr 2020 17:19:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42413) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMeWZ-0002G5-GQ for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMeWY-0005rQ-9n for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:47 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:47076) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMeWY-0005qa-46 for qemu-devel@nongnu.org; Thu, 09 Apr 2020 17:15:46 -0400 Received: by mail-wr1-x433.google.com with SMTP id f13so7119786wrm.13 for ; Thu, 09 Apr 2020 14:15:46 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o9sm36693010wru.29.2020.04.09.14.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:15:41 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0FA191FF9A; Thu, 9 Apr 2020 22:15:31 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NsgGnaK6H7tXZSUowxzbNGfoZoXPun4GYcBXJ76FIg0=; b=iokV08ARsSiWllJ9cOA3WSv7O7YlPfESa/gnZ4Jr2a14wQsD5Mju2H6CgmQnJwU2iW b5zuJTJk7+PJ137KF9mgQ1QQhiReONIFhcd/iCVjQRLo9kWeyYw+6HurYjHLvHofSGPc af6EnETKMHmGLkZZwDEKxtC/e0E+lUCAKM465sZhnde7FZ4H/gRHcWu2wXBllMxb97Am 22DzvRGM7sxdvoDUmwFIU2OTJF5vKzMMR0WoSYdKJj4r/D69Nc1c7b0pWjgJitgeqV6m lLK0/KiW0XEmmnpg1GNsffZbQiTykkj/xz408UGAOpXFFJzR5XaiuhgMukAKIWHgLkxn JMfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NsgGnaK6H7tXZSUowxzbNGfoZoXPun4GYcBXJ76FIg0=; b=fOtwgNaBosP5xHT00ghex701f6s1qAh1UyQ7DtJFvqs4r8rKWfFoybs3vxQ28zRPDZ VFHVvHqiVzRKLqSZs7jYEmCJZwyxD45zpgVeZRcHDQ8Rf9Ay41TJGJ4Xh/AC7w8BP0Qv 7pYezF3/ejpEpGPuuNLJ7uB4SasO2+nqEXeasAgFQImjbtnxA36tyqFCD6jTkbpQcqts WXl3FiqAEMQPPTwBCGPodXykuN7vCEv4fMrVVMnB2J142xhMHBltIHaPhuGRQqnzBoZ8 czSCc9PIYVUF9sLAWrc3FXHLMFx6ikWUPmlxKkue9evDemQSMHG9viVlb4nD44RsN+1e 7rmA== X-Gm-Message-State: AGi0PuarxtZFEeACruNd6L+r65bcXNn9M9r1jPw3tets3MqoBkGwY7JJ 7ImJOx5e2RFOTZRZxXMowGgr4w== X-Google-Smtp-Source: APiQypKoFD1XjBzu3LhzxvXwnZt5npJILuC62nU6zdHnVpG7eurJAW8SeitIbGFMV7841ambAvUPuw== X-Received: by 2002:adf:e94a:: with SMTP id m10mr1130808wrn.324.1586466945102; Thu, 09 Apr 2020 14:15:45 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 11/11] .travis.yml: Build OSX 10.14 with Xcode 10.0 Date: Thu, 9 Apr 2020 22:15:29 +0100 Message-Id: <20200409211529.5269-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409211529.5269-1-alex.bennee@linaro.org> References: <20200409211529.5269-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Travis recently made a change which generates various warnings such [*]: CC utils.o In file included from cs.c:11: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.1= 4.sdk/usr/include/stdio.h:64: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_std= io.h:93:16: warning: pointer is missing a nullability type specifier (_Nonn= ull, _Nullable, or _Null_unspecified) [-Wnullability-completeness] unsigned char *_base; ^ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_std= io.h:93:16: note: insert '_Nullable' if the pointer may be null unsigned char *_base; ^ _Nullable We only aim to support MacOS 10.14 and 10.15. 10.14 comes with Xcode 10.0. These warnings are not emitted with this Xcode version, so switch back to it. [*] https://travis-ci.org/github/qemu/qemu/jobs/673000302#L1387 Reported-by: Daniel P. Berrang=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200409190618.7402-1-philmd@redhat.com> --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2fd63eceaac..7c92206ea33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -272,12 +272,12 @@ jobs: =20 # MacOSX builds - cirrus.yml also tests some MacOS builds including la= test Xcode =20 - - name: "OSX Xcode 10.3" + - name: "OSX 10.14 (Xcode 10.0)" env: - BASE_CONFIG=3D"--disable-docs --enable-tools" - CONFIG=3D"--target-list=3Di386-softmmu,ppc-softmmu,ppc64-softmmu= ,m68k-softmmu,x86_64-softmmu" os: osx - osx_image: xcode10.3 + osx_image: xcode10 compiler: clang addons: homebrew: --=20 2.20.1