From patchwork Tue Mar 31 03:54:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185073 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3242048ilr; Mon, 30 Mar 2020 20:55:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vskxPBJeFy/c+ludUkAXPcNnNCAoF+LnFYI6tezuppVrpuPf9oWBKHopxO5qTh5lin1UGHS X-Received: by 2002:a37:453:: with SMTP id 80mr3083537qke.325.1585626919019; Mon, 30 Mar 2020 20:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585626919; cv=none; d=google.com; s=arc-20160816; b=Z79KAOLxLtCTgcnCuvkyU4kzkVC3iwojwO01li2L7pqb+0kUkPJxzoThY7BZL0ihm/ OsJunrpG3/1B3oTJ/fAJn2fdopjF5SzaNj1l3SeObdstJjb69NzTBw4ayWRL/kRSF5N4 rGaPukgbAEWSFbxeQWe4xcB/SDqRMr1pCAYIouRocxz/gum+RkKXgKI90kyh/07IQxpX ZkXfq+/iWCUHIJFnO3/rh5ctOZR94P5Uoz7t35FFNovRE1Jpw5Rm4GWX35/TZ0jgOnpL XVrbhqXs0KsCBmWN3PwaWFeAbj0le+6knrBoCUwtKOLyr31yPKgzxWJPQzL3OH5l8rKh oulw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=dr2iLz/DtlBYqPaC0YalK4V7LwrO76HcMZE10x4F5dI=; b=iZ8M3bKDXOftZ5n7rqeCgXdu/C6oxLM9bwUjpg8CF86xr+fF1tsLb6gcnh+Yp0S4Sj LWXBVevWd//wMfZqskkLHrZ5Txkds1KFozfuqttgFoT7AJOzGr3mdcM9oUvq8xp4TJhM BU5SNFN1O0GdhCpsXbgL41wfk2sv+/FXltVQjbLWLbKEbHKY1TV3oTDWgZ424OtOfENz OgMKQErm+3dl6lImbHDnXFz5Q46cq5EVW6ZuME+R0DoP4XvPSZNU8bOWIA0vT1jTFELb 7FTLqTZ5N948DvRuqKFJBL2A6Fm7L75XBUcinRJdjoyF694O7s0zpNZKXQoFww1d/Y/Z lQgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="kthMz/fq"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q75si8776010qvq.150.2020.03.30.20.55.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 20:55:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="kthMz/fq"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zg-0004Yl-Hf for patch@linaro.org; Mon, 30 Mar 2020 23:55:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60780) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zT-0004YM-4h for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7zR-000896-Td for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:03 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:46434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7zR-000860-Nt for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:01 -0400 Received: by mail-pg1-x543.google.com with SMTP id k191so9713139pgc.13 for ; Mon, 30 Mar 2020 20:55:01 -0700 (PDT) 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=dr2iLz/DtlBYqPaC0YalK4V7LwrO76HcMZE10x4F5dI=; b=kthMz/fqkPX/41l3miN7kY3K18r3EHAERK2EYudCL5vwlWzYoltJd+FJOMe8FRJvje W2SHG7/5QZBfzBJ6HpkWQjIhHMSSDHm/iuqjRJrFHqbSBLgQdmfOICuRgWTOxHPe6C2S YDrMEMCMTARm6IxP1VvgNG5GnsRtP0VTpK982cWYseMpk2ff6jvwU1X69rM5V+f08eML K/q6ggg6B1+bhCtlRbU98fWJLWhzJu2sSLhwgFiv/Mjyatpt6f+Offp/PhLOZGmigiGE a2ASROq541E7158RuJHEvTcnGwgXQNeD7MOSPyLKjmqmGhHWjUZ44/VBGdlBU6ZJCRL9 SdAQ== 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=dr2iLz/DtlBYqPaC0YalK4V7LwrO76HcMZE10x4F5dI=; b=ACA8DykhcsPTXTtdUpWwupGt82aH6uYpiy7bAqznkoT6kjIuuXKAypn4sVGrqivx3R Tj29PBDpsizcwEnDwtXxsU68QxXW5nUY5AGgG8AiVWqZxPEUaD8BKAgL9YdjRN00mnUy mZHiFAT1JxxN/dKKIfsiXqUgWNDycdvBuOeBolVnPDZy6qRqIAl2X88XIVHDGQ2pZ/Do pwktxyrsyjI4T+vYfgtjtVY+chMbut3s6pCmrJ2zm20IAd4p9C6gvlozeOc/ZKU4lrzJ U6N890LO1QUvbJ4L+zLYio+4i9M/5eb6cSxVTds2tBkxjw0DYY3xSj5AEaCM/Ie+dAU6 70bA== X-Gm-Message-State: AGi0PuZjGhvpaoQImUOOhdpKqK7ngGPwsyMLww7iBwD434PZtDeebcsD jcUg0ZBdUUyy8pvikmnrwh2zgTHIZHs= X-Received: by 2002:a65:6412:: with SMTP id a18mr10062990pgv.322.1585626900182; Mon, 30 Mar 2020 20:55:00 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:54:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 01/10] configure: Drop adjustment of textseg Date: Mon, 30 Mar 2020 20:54:46 -0700 Message-Id: <20200331035456.6494-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 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: peter.maydell@linaro.org, Thomas Huth , =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This adjustment was random and unnecessary. The user mode startup code in probe_guest_base() will choose a value for guest_base that allows the host qemu binary to not conflict with the guest binary. With modern distributions, this isn't even used, as the default is PIE, which does the same job in a more portable way. Reviewed-by: Alex Bennée Reviewed-by: Thomas Huth Signed-off-by: Richard Henderson --- v2: Remove mention of config-host.ld from make distclean --- configure | 47 ----------------------------------------------- Makefile | 2 +- 2 files changed, 1 insertion(+), 48 deletions(-) -- 2.20.1 diff --git a/configure b/configure index e225a1e3ff..e3ccb8daf0 100755 --- a/configure +++ b/configure @@ -6498,49 +6498,6 @@ if test "$cpu" = "s390x" ; then fi fi -# Probe for the need for relocating the user-only binary. -if ( [ "$linux_user" = yes ] || [ "$bsd_user" = yes ] ) && [ "$pie" = no ]; then - textseg_addr= - case "$cpu" in - arm | i386 | ppc* | s390* | sparc* | x86_64 | x32) - # ??? Rationale for choosing this address - textseg_addr=0x60000000 - ;; - mips) - # A 256M aligned address, high in the address space, with enough - # room for the code_gen_buffer above it before the stack. - textseg_addr=0x60000000 - ;; - esac - if [ -n "$textseg_addr" ]; then - cat > $TMPC </dev/null 2>&1; then - error_exit \ - "We need to link the QEMU user mode binaries at a" \ - "specific text address. Unfortunately your linker" \ - "doesn't support either the -Ttext-segment option or" \ - "printing the default linker script with --verbose." \ - "If you don't want the user mode binaries, pass the" \ - "--disable-user option to configure." - fi - - $ld --verbose | sed \ - -e '1,/==================================================/d' \ - -e '/==================================================/,$d' \ - -e "s/[.] = [0-9a-fx]* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \ - -e "s/__executable_start = [0-9a-fx]*/__executable_start = $textseg_addr/" > config-host.ld - textseg_ldflags="-Wl,-T../config-host.ld" - fi - fi -fi - # Check that the C++ compiler exists and works with the C compiler. # All the QEMU_CXXFLAGS are based on QEMU_CFLAGS. Keep this at the end to don't miss any other that could be added. if has $cxx; then @@ -8175,10 +8132,6 @@ if test "$gprof" = "yes" ; then fi fi -if test "$target_linux_user" = "yes" || test "$target_bsd_user" = "yes" ; then - ldflags="$ldflags $textseg_ldflags" -fi - # Newer kernels on s390 check for an S390_PGSTE program header and # enable the pgste page table extensions in that case. This makes # the vm.allocate_pgste sysctl unnecessary. We enable this program diff --git a/Makefile b/Makefile index fc2808fb4b..84ef881600 100644 --- a/Makefile +++ b/Makefile @@ -795,7 +795,7 @@ rm -f $(MANUAL_BUILDDIR)/$1/objects.inv $(MANUAL_BUILDDIR)/$1/searchindex.js $(M endef distclean: clean - rm -f config-host.mak config-host.h* config-host.ld $(DOCS) + rm -f config-host.mak config-host.h* $(DOCS) rm -f tests/tcg/config-*.mak rm -f config-all-devices.mak config-all-disas.mak config.status rm -f $(SUBDIR_DEVICES_MAK) From patchwork Tue Mar 31 03:54:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185079 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3243851ilr; Mon, 30 Mar 2020 20:58:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvSxaOs0sNLKAn4GIYvA1HXWbC4yH9W3NfgcZYQHVndr0Y3oYd8ZfNHoZDA6fIhXNlFSRfr X-Received: by 2002:aed:39e4:: with SMTP id m91mr3345231qte.188.1585627121234; Mon, 30 Mar 2020 20:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585627121; cv=none; d=google.com; s=arc-20160816; b=ucHuzt7paoEIq38YIzlN38KivqoeqRO+1rLpWjp8YJ93jHsT0wdkwV77xW1XcGb8pE 8Cy1tdvJWDHs6ue5FJYSGqF4akuR4gaPRetmEfg1iIjgnK80j6GQFElKIPSvzvHfjlOh dOoUj9f5X+vVMyQIec56CyUi11vrR8KQ97Exav4Qyy6+zCC4UWuzqJBpj70b97MVOeBu a1cLwF+eg2lUlq4EMQP0sSc1L2iUgS7dwE+75lm9QOqTxX+oqDR6qDffYOJD/YONnJsK fYL85j4myofL/Nb8XAugtqFnt+vrgwe6uihgqTs0dEgcfQMltN3IOA8rBwmRnZh3/X6s Shvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=AVWo3TkNC8dRck4gxr30FMdUL1YEqwhhQceYuT351jQ=; b=fMTFks0UBMXRY3B6yk6YtZu+wGzduT9mP2JhqchfsDKav8Cu/N9AKNwTjarlrhCWGK Eno3uByeKwcSepeyonyc9vzDCbkdgWJJHk2Xd1A+K6BNUspUHL9wjkyGDsrBYzl/hyno LUPW4Fi6UU9AKPN/zUk/EjfWOxy30fS+cA3Kle0kKysepxXcNPZHoL78zn0Ql/jrTi+D 3ipK1X8EpUErxLyzijux9+8iA0pzKHGA8O6+RScKR8onUFPFqruQ6yJ1E15Hbk+pEC7R jmW+j6ZaqCxSATRqM3QCLBHPvLJWynZHJWJ62WET5Jp+c2UxOmYCSAbugkfyHZj1vxPY tfTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bFf0kUgR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r2si8958119qte.140.2020.03.30.20.58.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 20:58:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bFf0kUgR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ82y-0003Qx-Ot for patch@linaro.org; Mon, 30 Mar 2020 23:58:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60824) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zV-0004Yz-BN for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7zU-0008Dd-7Z for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:05 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:45380) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7zU-0008Bu-2E for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:04 -0400 Received: by mail-pg1-x541.google.com with SMTP id o26so9721610pgc.12 for ; Mon, 30 Mar 2020 20:55:04 -0700 (PDT) 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=AVWo3TkNC8dRck4gxr30FMdUL1YEqwhhQceYuT351jQ=; b=bFf0kUgR2GoEiqNITsPTFpdjOaZesDn+wYad7Gh0iG49tzG5u2a2oEJQNnNhcTGX5B RyTqpddoBt4K2NCnDDl8Bnpvau+enrW5R2sP6RPrXFIH1kxVicUqy9nfeMZehHJHqMiW QB8RT4OJeJK5Nk8DLzvHNlOeomqP/Qg/TkxyZIQH+bMEu0Z1RH19ZQCgkKHN6BnSzs0k o0wcYBeW8qDwKlSL52l7aK+5p/46Zx+aHi3OgRyN2azTSdSmgT3LoJewLhg3b+E+K3gH 1KhKt2CRUG8ghS9/P/GshRIb0tuR3lvd/Ju+f3feq1oCznGP7bDTAOXyeBSFOsquczAx /3kQ== 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=AVWo3TkNC8dRck4gxr30FMdUL1YEqwhhQceYuT351jQ=; b=ZrQU5/0m2NqhzHs9tEmCzB3CswxDyrlxocu0gwGQliW0KMZbo3+FwAjzTfawMzg0Az sVIU2JVKjlLDFItEEtRP3vqP7b8qvirXsurtd9a5oYEI6UcGCXof2phoU+CwWK0ECIWe KsSX9Q8Jsr76hu9HLugWqmKULRC+gzF489dcxE8LDN14/dmstkC6uB3GEadmAIMlk61f vaV6SstssYXRDMuOuTeadZFInCgE/Cykesp5UJsqe+WCnN+heMyPkP9tDXTGfDqn6Cx1 6vSsHxLr3nVliRu+2YkSq32Hr8NK6ZA+ECOvOaGJpZIx6E+yBXIaikjnj7VD4SfO3FxE 44Rg== X-Gm-Message-State: ANhLgQ3ZtJdlZx8gc7Z1JWWpj4cwRhaGtLv6y7sPsPCLgalvXe0lIkn9 feSvUAjP1soSdcF8yxzE+DUIR3wNgy8= X-Received: by 2002:a62:7dd0:: with SMTP id y199mr15872936pfc.267.1585626902674; Mon, 30 Mar 2020 20:55:02 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.55.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 02/10] tcg: Remove softmmu code_gen_buffer fixed address Date: Mon, 30 Mar 2020 20:54:48 -0700 Message-Id: <20200331035456.6494-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::541 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: peter.maydell@linaro.org, Thomas Huth , =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The commentary talks about "in concert with the addresses assigned in the relevant linker script", except there is no linker script for softmmu, nor has there been for some time. (Do not confuse the user-only linker script editing that was removed in the previous patch, because user-only does not use this code_gen_buffer allocation method.) Reviewed-by: Alex Bennée Reviewed-by: Thomas Huth Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) -- 2.20.1 diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 78914154bf..9924e66d1f 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1043,47 +1043,20 @@ static inline void *alloc_code_gen_buffer(void) { int prot = PROT_WRITE | PROT_READ | PROT_EXEC; int flags = MAP_PRIVATE | MAP_ANONYMOUS; - uintptr_t start = 0; size_t size = tcg_ctx->code_gen_buffer_size; void *buf; - /* Constrain the position of the buffer based on the host cpu. - Note that these addresses are chosen in concert with the - addresses assigned in the relevant linker script file. */ -# if defined(__PIE__) || defined(__PIC__) - /* Don't bother setting a preferred location if we're building - a position-independent executable. We're more likely to get - an address near the main executable if we let the kernel - choose the address. */ -# elif defined(__x86_64__) && defined(MAP_32BIT) - /* Force the memory down into low memory with the executable. - Leave the choice of exact location with the kernel. */ - flags |= MAP_32BIT; - /* Cannot expect to map more than 800MB in low memory. */ - if (size > 800u * 1024 * 1024) { - tcg_ctx->code_gen_buffer_size = size = 800u * 1024 * 1024; - } -# elif defined(__sparc__) - start = 0x40000000ul; -# elif defined(__s390x__) - start = 0x90000000ul; -# elif defined(__mips__) -# if _MIPS_SIM == _ABI64 - start = 0x128000000ul; -# else - start = 0x08000000ul; -# endif -# endif - - buf = mmap((void *)start, size, prot, flags, -1, 0); + buf = mmap(NULL, size, prot, flags, -1, 0); if (buf == MAP_FAILED) { return NULL; } #ifdef __mips__ if (cross_256mb(buf, size)) { - /* Try again, with the original still mapped, to avoid re-acquiring - that 256mb crossing. This time don't specify an address. */ + /* + * Try again, with the original still mapped, to avoid re-acquiring + * the same 256mb crossing. + */ size_t size2; void *buf2 = mmap(NULL, size, prot, flags, -1, 0); switch ((int)(buf2 != MAP_FAILED)) { From patchwork Tue Mar 31 03:54:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185074 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3242063ilr; Mon, 30 Mar 2020 20:55:21 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv33+0OTmLB4BTw0XocilCxoir+zAINln9FLhaHG3LjJrWeLGW9jb4cGM25vdQAwIzBXjbL X-Received: by 2002:ac8:4e35:: with SMTP id d21mr3253027qtw.179.1585626921612; Mon, 30 Mar 2020 20:55:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585626921; cv=none; d=google.com; s=arc-20160816; b=OF/EBklbnEm0N2qe1kgr2LrIPVzqBgH/oYE9goyh7Kh6FanUOxVsSrggyrlU7P0HSf 5oFxTDRrDZZZggwhWDcpq0L6gKMb3OspJ+xDkezp/ohrtwVw/yvyrIAvc2b6VDseZFlz jNmEVMNADuNC6C577V9vuTmQI/GlO3yOiLHxi5Lu5VIttITT7TxGZ0KXg2c/GFj308Xh zle2aqX0GjmiQrW9R1pfEk9zFN4EYeDR92x5+x0WwyWk90wu454DF5sZNqxnewG0DzFv NAC6l6jBi0OVM5EmurvEoVaeWJVlQIQJZvnQ7Tg5PltlO9DdV2W1nC/Tqu/QQ5pz4ETN QoOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=cw+WZzzhEd4mjQWPUsr/UQXcmfdkOCsgB8L/Xuk7inw=; b=BihLGDtS+zqC+lmEtPVIS0LPGueWxsv7rkJGUGgihXd1dZMx7XRRrIeZQLBQWTZ8qA wPaAQzMoYtIwcGNqW8EiYZv0aANXkFp+EqRUkcYpFm3gIq3ATZB7yd8FklP45DejvHFR Qv4YiFwP1c9sQTAT3pFkE75oOrqUwXuDnRXObR76M5IrQDzZdgRrJPXAW4NWxBrWr0Ea NOpXxTOdhRl/XqM0IRhfRW3ZTRJx98QpsAny4ONuPL+nwz/3AroKHZWJ8/LqvXkjZD5B u++6x7iyzk8hfvC5x/97fc+IdHTfX6jWJDnAVt0+apjv+0+N1/GcWHLtl7elI+WQ0Fss 3IfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qxZpcVJa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g14si9904094qvl.109.2020.03.30.20.55.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 20:55:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qxZpcVJa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zl-0004eM-2d for patch@linaro.org; Mon, 30 Mar 2020 23:55:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60834) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zW-0004af-9K for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7zV-0008EA-AG for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:06 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:37313) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7zV-0008Dr-4v for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:05 -0400 Received: by mail-pl1-x642.google.com with SMTP id x1so7614334plm.4 for ; Mon, 30 Mar 2020 20:55:05 -0700 (PDT) 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=cw+WZzzhEd4mjQWPUsr/UQXcmfdkOCsgB8L/Xuk7inw=; b=qxZpcVJaFb1jtv+OAw3oDhzmEtPCwR4/gKbgDx7xi1xRIeD6z9WjvPmUr6uXGzMYz9 e+g2o0qFsV7PviiombDQ7ArypNeYJQMjnupFh9eGoK40O7NP0a6njiNFGbZTcyBlMYR3 yocl2XrXtB6Fl52lAkAAg8/2OmM+KYSzmxjB4OSaMxB4risW2w7/894uapn62ISzyd81 sFsS3cukM9GwQrpdd36Zin1r7R/TXqmPT+9chMdvY7dNy0N9HbN8DQo8x+/Re/Mc8Xe9 GgOpxviQFQju7LRmkEboWoRK0zMhLMm7XlebJGPAU4YHVckiAfEhapa3DtTP91+pCQBY m84Q== 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=cw+WZzzhEd4mjQWPUsr/UQXcmfdkOCsgB8L/Xuk7inw=; b=e+HJ2cuCMo7u2TRly2oqc2G6wKiJ/xAiLPlV2GltOsO8907TPvWF67Xxgf7ENsIIX+ H9YXt9IOcd7hrdrD4L1HM/ZMuf2yTXdy1PZzxRlvaagGfQytLNIwfyMn6NPp+oSnzUUg F7iCLqsRDkfh+40+6fmKXwerZ4jjXcfsiwzshBiZX8+k88qxCDyWZfaHsvGP44mevXSM 0hWvMYei9KzTFF1X0LjWBu7GYDbHSFJd3VNUsw2riUQI5ViUmGTQxBIjtpaX2k02yle2 iZ5rUCXAxPycdpGq7OVgyVObyfsNC1mM37gWwAD5yhzGXaJ1QzJTqZD093KwJeLW3SbN l6ig== X-Gm-Message-State: ANhLgQ2HkfRoUB5ViFef0K4l7kNewuvGXztgQ4t0bDZkMQAuZuWLfmqG /XkoDDVbyBB1nE9yNbj4GKAIb2nTfsA= X-Received: by 2002:a17:902:a517:: with SMTP id s23mr16150017plq.125.1585626903844; Mon, 30 Mar 2020 20:55:03 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 03/10] configure: Do not force pie=no for non-x86 Date: Mon, 30 Mar 2020 20:54:49 -0700 Message-Id: <20200331035456.6494-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 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: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" PIE is supported on many other hosts besides x86. The default for non-x86 is now the same as x86: pie is used if supported, and may be forced via --enable/--disable-pie. The original commit (40d6444e91c) said: "Non-x86 are not changed, as they require TCG changes" but I think that's wrong -- there's nothing about PIE that affects TCG one way or another. Tested on aarch64 (bionic) and ppc64le (centos 7) hosts. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- configure | 10 ---------- 1 file changed, 10 deletions(-) -- 2.20.1 diff --git a/configure b/configure index e3ccb8daf0..d4c2c7a563 100755 --- a/configure +++ b/configure @@ -2107,16 +2107,6 @@ if ! compile_prog "-Werror" "" ; then "Thread-Local Storage (TLS). Please upgrade to a version that does." fi -if test "$pie" = ""; then - case "$cpu-$targetos" in - i386-Linux|x86_64-Linux|x32-Linux|i386-OpenBSD|x86_64-OpenBSD) - ;; - *) - pie="no" - ;; - esac -fi - if test "$pie" != "no" ; then cat > $TMPC << EOF From patchwork Tue Mar 31 03:54:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185082 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3244865ilr; Mon, 30 Mar 2020 21:00:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vunlFLfmys0nYKUBKZWAebT7AjfCuINL6n4TTChEUDBmSuP3Ahohh/KvIEe6eWlN8aGXyMg X-Received: by 2002:aed:3c10:: with SMTP id t16mr3203961qte.45.1585627219614; Mon, 30 Mar 2020 21:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585627219; cv=none; d=google.com; s=arc-20160816; b=Qp1JTDP1cYehnO8Q+X/7NjdeUw0MLIcoXAxSol3KqmuFaPsEYe/1Vd150Usr43ulsC pZlIOZPhsV8aU6xmKQo0euAAPOsg8k6B1rvsRy7ax4VyHfma00mioEIQYlg8fJNJ2VpC 0milRAFDflGc9wSeGRgT/mxOoOP0Bc4nrhp/Ihv+VVxFyJPXFX8DHvaGD7VYaOH7h2mT yfNy6AHaGbsk0K3NIyUYncMY1VHdl6l6uZ1pECgJafSR5ZiAjcf24/NVndXFlWyjkbmj j5v4NBdzGyuXzy53avcitVCXuFW/xSzDFykk/SqYHJA3VhJlmFGEBhhxx7+Vzv+uzJJA Nygw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=nFUQTfUSKaEvMkBYs+/kSP9YEBdIr8bGAjyzPCvPYkQ=; b=b2Phm25ZrX1rQCshxhNVV52BvUl4aEGfYMxOAFIZ+u0ejCPi1i0PmHssyYr+g3ZL52 1nBlpJYutL/hUKFkKQBTIDzhdiTn7O7AcnBajF9c00iXu9ADbjoePMSHc0Lu2Hp9ekmw FwKNrGf8ShK9QlGcg0eIiLBRIgHQckTGrH/0mrQUcgdWUW0XJVUnNlp94eKWiD1YjRwC zhgAJPi7anAiRkrRAjbRfd+G958Sbm6ZYGTd6yvdICv5dXhbpoOQVIKl75aONYPOglrA 24izgs+lNC+uSxySNu4JMY5C/lu1/eqB/sZdFquizOeHQ1SltSp7IZ5aAozY+AUR4VV0 busA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ek8AHqbC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x6si8865808qvn.7.2020.03.30.21.00.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 21:00:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ek8AHqbC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ84Z-00069R-1j for patch@linaro.org; Tue, 31 Mar 2020 00:00:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60847) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zX-0004dh-SA for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7zW-0008Eu-PQ for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:07 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:43908) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7zW-0008Ea-K3 for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:06 -0400 Received: by mail-pl1-x642.google.com with SMTP id v23so7599875ply.10 for ; Mon, 30 Mar 2020 20:55:06 -0700 (PDT) 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=nFUQTfUSKaEvMkBYs+/kSP9YEBdIr8bGAjyzPCvPYkQ=; b=Ek8AHqbCycWVJDm79edQGPIqhsWrWcw4RfwumJ/TYaZfgZohPLYtoTYKfuqpQjiEfV iZqLRmQJLJnk49e0ekks+hTN5kLFD6PiQDw3E2BzQ0AQ4oG+XjdZXJztfI07Uppb/scj zzSZnDcYDM4tE91f2gEhB5gpVxt123mrVjxpVVDas2hLc9+znaz54yQcindUZidwq06d nGvj4paMQX99mzBUfdfaIWUIkct5QHyLzg3hZrpKa4VXVOMMkBfJ0VfJw3o8CBF7dDbl 2ghI41ZqNE/yVfPxBmJe07q4SbrRd3qkZ/51Lmu2Lri0Hsu1uZ5AHg5HzDsGEjOFxSB3 dMbg== 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=nFUQTfUSKaEvMkBYs+/kSP9YEBdIr8bGAjyzPCvPYkQ=; b=AOfdtDoRESHHE6O3S50xSjKNKqfrqxhuNF0qk4sgriiAhbWaafSJ1wxVo/tAUU2E6x nRkgzhg8lszmbdgP+hYtZft+OpoTYzIWzWB+1NapXXokhu0nznOLpb2Y2C0ahpD7HnBL 8qdFrPcSOQk7XudB+ru4uaCwH7LQnNpsRaLYjF7dfAIUs+KuirKHmSvB7wy2x1W+518j U4x5FefW5q14ec0vYBQOfHX+iw6WXXup1Vsd07YCTFJIdpaAqLS9Qmvf6sZcmd/Udhcs hu0IcH1mu7HY38xwMrIKI5MCWsYFP8hMLL9xG6ZhAnryd686BC6kD4dReJynCcAJCQ46 u7Fw== X-Gm-Message-State: AGi0Pubwe5JKrwzWbjHYzOtVqrB/zdGgk9SOqa4+Ov47/kS0wuYcW/2J osAASfpbUBP5x/63kN+FR4JqAH7G28M= X-Received: by 2002:a17:90a:a484:: with SMTP id z4mr1556857pjp.77.1585626905312; Mon, 30 Mar 2020 20:55:05 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.55.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 04/10] configure: Always detect -no-pie toolchain support Date: Mon, 30 Mar 2020 20:54:50 -0700 Message-Id: <20200331035456.6494-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 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: peter.maydell@linaro.org, Thomas Huth , =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The CFLAGS_NOPIE and LDFLAGS_NOPIE variables are used in pc-bios/optionrom/Makefile, which has nothing to do with the PIE setting of the main qemu executables. This overrides any operating system default to build all executables as PIE, which is important for ROMs. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Richard Henderson --- configure | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) -- 2.20.1 diff --git a/configure b/configure index d4c2c7a563..1cdc439a57 100755 --- a/configure +++ b/configure @@ -2107,26 +2107,24 @@ if ! compile_prog "-Werror" "" ; then "Thread-Local Storage (TLS). Please upgrade to a version that does." fi -if test "$pie" != "no" ; then - cat > $TMPC << EOF +cat > $TMPC << EOF #ifdef __linux__ # define THREAD __thread #else # define THREAD #endif - static THREAD int tls_var; - int main(void) { return tls_var; } - EOF - # check we support --no-pie first... - if compile_prog "-Werror -fno-pie" "-no-pie"; then - CFLAGS_NOPIE="-fno-pie" - LDFLAGS_NOPIE="-nopie" - fi +# Check we support --no-pie first; we will need this for building ROMs. +if compile_prog "-Werror -fno-pie" "-no-pie"; then + CFLAGS_NOPIE="-fno-pie" + LDFLAGS_NOPIE="-no-pie" +fi + +if test "$pie" != "no" ; then if compile_prog "-fPIE -DPIE" "-pie"; then QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" QEMU_LDFLAGS="-pie $QEMU_LDFLAGS" From patchwork Tue Mar 31 03:54:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185077 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3243000ilr; Mon, 30 Mar 2020 20:57:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuFxw+/gKSB9uYrj3J+wssW2e4b4btp/k7IjEMLuTe+JPa6zavw6Q2YZl0I03xHTNCmwL93 X-Received: by 2002:ac8:719a:: with SMTP id w26mr3170158qto.257.1585627024691; Mon, 30 Mar 2020 20:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585627024; cv=none; d=google.com; s=arc-20160816; b=kw8hOrRpmwRj3YtAl88iWtnOtvcxA6CvaP9vUIlHN2Bu+sTmXvxvLmBQR8zZtv5oV/ pgnzU1vyvT4Fp+bSxv4At+aWeaYFm2G8igwK7br9VQv97pxJRt2falcdcIXEyNafZRPm 5onRIB7E067eIXebXLNsJogflRpvaTwbCnBpmsaKDgRTbdEs9pF2XpAKwTuMisUDp9fM wuqvJUfQpvd2vlns/XKAQUc+mVdk9POuqm1sCYks7z2lzNFdb+yIJwXIl/Op0dOCyDMo vFjYTKX7Ja7PrZuz5tWM24wSPboTxS2TzTgHuq7Ym/xHVXGM7Mdq520pVmZM44GVuYrb L5Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=4fxKsy6khBcHTq1p6rkwxiGqHx6M8cWBd65wf3ZxqfQ=; b=wjvp01tCtxzIBA58nMxVoyjLJm0Ggwu5IRUSMUGjTUeXyZEaE9hfiDflevY8DPjxHx hajAhOBcFyy9+ir0+dFOVuRJoQ68qAszPJLdflP1XNtk21QuATVcnavOY4WvC4T5Mr9h yB8yXfG+5/i5WthnNMN5qhLCRGfy4PqG8VRlio+kqLoqkBiOjlGS4ujDDeqtSPrXQJzk j9jLFNrByOfulGLrLHuSXish62jNquL0ZFvQb1WjqET/BS6drvRC894qh7yqqOMwwYwu AeZDz+DbWVvzPqbmGckoky09Zi9h6LUz3UG7H51gvthLTr963jcSSPPBDSj6MqDX5obB 0wEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=APe97RPR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l53si9568280qtl.355.2020.03.30.20.57.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 20:57:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=APe97RPR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ81Q-0008TR-2C for patch@linaro.org; Mon, 30 Mar 2020 23:57:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60866) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zZ-0004gM-3h for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7zX-0008FR-W5 for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:09 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:34279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7zX-0008F4-Qj for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:07 -0400 Received: by mail-pl1-x641.google.com with SMTP id a23so7621386plm.1 for ; Mon, 30 Mar 2020 20:55:07 -0700 (PDT) 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=4fxKsy6khBcHTq1p6rkwxiGqHx6M8cWBd65wf3ZxqfQ=; b=APe97RPRwahsiYzPaIZvKEg7kxEcZ9VN2zoNFNCG+NumkrpRkPHTiU3fbYUfHVdT2z FxeamWMB04LyyqhreI//MuW3TP8oMp1uZGkDZ9/Z6wdDjlqAohr9aa0QSuRDvgwz33Hk FQsrmw2OfiaQ7NLS31HZrtKs5a52JPU/vxpeiO9icIzzMvGDe60rWiqp9wPJEFnNu8mN AIejH6ua01VEtw0+Gb0uNnKRyGCBkngv9McmrpjuuA/6ZDlwPmDbMaZjNitKMols0TeB RuSYD/sVlBdmBLUQSMO0JVX7jWE+NPcVkHFLmRAMHoEeUrzf5PXmGBqHJqXQuKtYvm7q LS5g== 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=4fxKsy6khBcHTq1p6rkwxiGqHx6M8cWBd65wf3ZxqfQ=; b=RNkYqje+T12bGh9sXJ8PFtfFzr/O9bHNwB1mTe6C0APQQcOsiUlFjNPoimnQLTwKoB AnpDgbhdaT4gFXoE7S/ehkTZrTg6DM/im/WBOA95Kuyrd8BBuO2prRiYCTJoYZbFubXe QHS0S7SSCGDRhIpAJc25SK8Zwrd119JFYOddNGCJTnNxrzE2wPrwXcz+qzWSbT9HTO0W GGzHTZffGvge6MH4XuZG4HkVn4+Jumm5nIieW5iD7uYRAcxkq6N08TbdsAipYeV4WiJ9 J6XUXRtvRY4F227AoUVtZw7jV8L8EtSdc1MgrshkPfz8Iouy4EEu1NpPapYtivG7GuSx hQKg== X-Gm-Message-State: AGi0PuaURZXd0WrfW0JzzFJ/BlTIbgzewVk8/mcLOE1s2c0xgM4xTqaV 708hdombqcLnOouskkCl6c3zHpM5H5g= X-Received: by 2002:a17:90a:2103:: with SMTP id a3mr1527798pje.181.1585626906522; Mon, 30 Mar 2020 20:55:06 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 05/10] configure: Unnest detection of -z, relro and -z, now Date: Mon, 30 Mar 2020 20:54:51 -0700 Message-Id: <20200331035456.6494-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::641 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: peter.maydell@linaro.org, Fangrui Song , =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There is nothing about these options that is related to PIE. Use them unconditionally. Reviewed-by: Alex Bennée Reviewed-by: Fangrui Song Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- v2: Do not split into two tests. v3: Update to QEMU_LDFLAGS. --- configure | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 1cdc439a57..1e622f5acb 100755 --- a/configure +++ b/configure @@ -2129,9 +2129,6 @@ if test "$pie" != "no" ; then QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" QEMU_LDFLAGS="-pie $QEMU_LDFLAGS" pie="yes" - if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then - QEMU_LDFLAGS="-Wl,-z,relro -Wl,-z,now $QEMU_LDFLAGS" - fi else if test "$pie" = "yes"; then error_exit "PIE not available due to missing toolchain support" @@ -2142,6 +2139,12 @@ if test "$pie" != "no" ; then fi fi +# Detect support for PT_GNU_RELRO + DT_BIND_NOW. +# The combination is known as "full relro", because .got.plt is read-only too. +if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then + QEMU_LDFLAGS="-Wl,-z,relro -Wl,-z,now $QEMU_LDFLAGS" +fi + ########################################## # __sync_fetch_and_and requires at least -march=i486. Many toolchains # use i686 as default anyway, but for those that don't, an explicit From patchwork Tue Mar 31 03:54:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185081 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3244743ilr; Mon, 30 Mar 2020 21:00:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtV44eY6brYmqWsYxIEcTCjwwnkye0jsTSy25teaM26sOLqDFXh23fpZN/5Ln08jwHNsP/3 X-Received: by 2002:ac8:4982:: with SMTP id f2mr3318219qtq.38.1585627210552; Mon, 30 Mar 2020 21:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585627210; cv=none; d=google.com; s=arc-20160816; b=Cu2jjp5YWepMMAlA96RQG4aacL1fTfC5WpTL0Z5sQqc4QZAkiB0OVnRyIKdlP7KKDP yZteAJGvP9GoUWR8a6C513s9zwBkRjhCZ7kxtbn/RuWteF8mzWwIJOCotVzoX509YgOG X6Tb0UXTY7KR4YdHUC0geNOaHHuaYJOiwFzSY4igatl2jZ02QZzGMbliJeeUOwsDd+kz ei734FNB0sFeAjRJEjMPJHBe3DmOHoh9arQm46g5y71VQ9AGWVdnpDvYllbamlVATjVa KIh6OUamS2/tW0UlI1I/21HCDmJ1HHUbNaiZokEyH5+47b3xvvVROyeNTbNIhA24HMep 0dxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=S+YD6LWo1z5Vsgzq3ypvuc0IEmwxuyzEeq5y1l14e9U=; b=E5THdtH8cZD1yAK5/FWThaJKXF0/p14pE3yGE+uSrJodb2GOYFTVAZw+t/Kk70uYdX g8l6HQmnHRadGfbOgYN03y6JwEC02OzcUjmZ9k3xX5yuOpOxW7ihzhD9foWFoptAOvtb Q7z1SnPFCkv/drHc68JBy1cpkIhQ40ApPLF2uLtKJ6bF3dW1XoTqzvVKg8x39j0BoxDX TZ2SrBOqqFDUsfw+xqNxrqXFx71HxinAVG+M+XDcvxYvvlfyuRtQxotN2nvFQ5mZQ721 3N80fDgfWf8wekqSlh73vRJmO/9SULnp13PomX8/zqob3Su/NAd0pDx0BAeSGpNQmWxg LmTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=F0iVltKB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s71si9830496qke.126.2020.03.30.21.00.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 21:00:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=F0iVltKB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ84Q-000605-1M for patch@linaro.org; Tue, 31 Mar 2020 00:00:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60880) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7za-0004jJ-Df for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7zZ-0008G2-7q for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:10 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:40623) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7zZ-0008Ff-2J for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:09 -0400 Received: by mail-pj1-x1030.google.com with SMTP id kx8so509781pjb.5 for ; Mon, 30 Mar 2020 20:55:09 -0700 (PDT) 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=S+YD6LWo1z5Vsgzq3ypvuc0IEmwxuyzEeq5y1l14e9U=; b=F0iVltKBtDusq4Qu78xf8Dgg2AK0wrtUwzFG0F4FqPtqM596JK+LHTw8Ha4bbt7sLI hYL+YYQPcpHlRxNuD5CUG0CHT9kpCwKDlqcjaNsNLjuZ6qJ3XhCfe2I5BGSnFPeCB0Zq EBdvy8ESOP+lIVkvDUmdTwed633e8O7Q7VBPdgIwie6TCYrZNz10MYCCx89tNLIB/BNT DB2b1q6RjCdMf9VfRcrb4Y7AfFnZ0uJvcbqFqzKG2quVWPb0alMgcGKIgr5LwwE9Tsww yftmzybgy//6tR96tasRCDkya9zFKwAi7owLiSI8pO+lEBqU+9XiNyhIHLyQdAAXZaGH iwTQ== 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=S+YD6LWo1z5Vsgzq3ypvuc0IEmwxuyzEeq5y1l14e9U=; b=LhNR0t6ZZLt8v1CGibW0eJWmxIx5ZOtfQCZ9zcNvOLs7mCANl2At9pKs4yC/H5GL2T qoWphpNfZrSVpNuRmhMQrZCGCFRaf57RndTXGjJ72HLn6HrRckCtNdvdNXX6WJhDKEna mffwVJkQyz5WGaATIQI6F0UgPBDSShC6OplcNWVitlJMT35j3JpFdCP7Od1s1XCxHddC nAYI0wta5RNxPPcNppO7cnxyRa3kQlu9mngEHsnPijtE/0pnXCBqL3LN6NWv81YzIogd SuYWZkV/8ACsvefLJEXaY1u4IuFbSLujX0YYQRg3mds8xTSQfvLBoEX5S05aN0oVeYPu 99Dw== X-Gm-Message-State: AGi0Pua/99fER5f/xZNDhSBWFn9+jTtX05ryFYv3o50gi9AVnGSwCC4/ U7GyuKAWGqK0PTSUoL5oAP4no5eUtX0= X-Received: by 2002:a17:90a:8c18:: with SMTP id a24mr1585344pjo.43.1585626907775; Mon, 30 Mar 2020 20:55:07 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.55.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 06/10] configure: Override the os default with --disable-pie Date: Mon, 30 Mar 2020 20:54:52 -0700 Message-Id: <20200331035456.6494-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1030 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: peter.maydell@linaro.org, Thomas Huth , =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Some distributions, e.g. Ubuntu 19.10, enable PIE by default. If for some reason one wishes to build a non-pie binary, we must provide additional options to override. At the same time, reorg the code to an elif chain. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Richard Henderson --- v3: Update for QEMU_LDFLAGS. --- configure | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 1e622f5acb..481d5077f7 100755 --- a/configure +++ b/configure @@ -2124,19 +2124,18 @@ if compile_prog "-Werror -fno-pie" "-no-pie"; then LDFLAGS_NOPIE="-no-pie" fi -if test "$pie" != "no" ; then - if compile_prog "-fPIE -DPIE" "-pie"; then - QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" - QEMU_LDFLAGS="-pie $QEMU_LDFLAGS" - pie="yes" - else - if test "$pie" = "yes"; then - error_exit "PIE not available due to missing toolchain support" - else - echo "Disabling PIE due to missing toolchain support" - pie="no" - fi - fi +if test "$pie" = "no"; then + QEMU_CFLAGS="$CFLAGS_NOPIE $QEMU_CFLAGS" + QEMU_LDFLAGS="$LDFLAGS_NOPIE $QEMU_LDFLAGS" +elif compile_prog "-fPIE -DPIE" "-pie"; then + QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" + QEMU_LDFLAGS="-pie $QEMU_LDFLAGS" + pie="yes" +elif test "$pie" = "yes"; then + error_exit "PIE not available due to missing toolchain support" +else + echo "Disabling PIE due to missing toolchain support" + pie="no" fi # Detect support for PT_GNU_RELRO + DT_BIND_NOW. From patchwork Tue Mar 31 03:54:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185076 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3242924ilr; Mon, 30 Mar 2020 20:56:57 -0700 (PDT) X-Google-Smtp-Source: ADFU+vso5Gwato3u6mASy0pzOHzzFf5h4hv6c5rruXve1+LzTHb6ZNnIhNXTUVAI5usjrUDJ7lKQ X-Received: by 2002:ac8:2c51:: with SMTP id e17mr3219335qta.290.1585627017324; Mon, 30 Mar 2020 20:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585627017; cv=none; d=google.com; s=arc-20160816; b=vSXIhi9uqBSbIRGBYa7DOZBBON+5YvUE2vh50oRJsrO6OzPvL/kMnzOjWBCn1qGZq+ i8AwqXrZr11Z+n1yh7L7Tg8o3Vxy4iXSyGfbLyf+WwKmayn40OPVyH7dCvPbkegAs3uv 1MEkgibbpO3WVvRJoBZ0lRZ4LMa2R99kitLcxZccOB0K7sVt2wQePeoK7yDDtpqgZd08 Nj+HA5Xk/B9X0uqaWKMFs9EXwCT3Eh3GXhsmT4t9S4NUfD5kTFHolzOhsLcDsJLt/aFC JAYCGCQT+eSrzBC3UiOrwr72qQ/Fgexh1SUWP7oFyq1uwKLFXqQBZKQTdIYqb24UE9lq fYqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=UgUHjWUCMpFSJAz+Az/IeJleYSOaGK+TNCsM8YWgUmI=; b=L9JRajsI64/mP73BZ453SzUfANrIypiz6+mVIG7JYhQe7x2vvZd5rof6dT/vpDCFc8 meFUdvPCRM2TR3aIiCsr5ztnnamT6wO2gj11xDcGbxRi8FpIHUfx50t5zy72+PGC+gf2 66I0FRU+8+zYheZmxHzklEzNCr+bDmwB/Y5q/F1oZrYJJ/HQXQPiizR2sXczZNgeE5fh zqQPGIVgfjNGIezUOmVs0mhsQjCaSmnWgr6xx9CSbqV6H96GlbIVmZVLcbq5GWoGGCZQ aocjxgf+kzLXswVTpsBob/W4NfTW7vJ0w59c8bcSEnxZBNW895d2N0kiyZO7IayxD/Co KJoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IZt6qDGz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k22si9018658qkh.206.2020.03.30.20.56.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 20:56:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IZt6qDGz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ81I-0008Uu-Oo for patch@linaro.org; Mon, 30 Mar 2020 23:56:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60897) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zb-0004lp-Mp for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7za-0008GY-GE for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:11 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:34967) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7za-0008GE-9p for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:10 -0400 Received: by mail-pj1-x102a.google.com with SMTP id g9so520988pjp.0 for ; Mon, 30 Mar 2020 20:55:10 -0700 (PDT) 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=UgUHjWUCMpFSJAz+Az/IeJleYSOaGK+TNCsM8YWgUmI=; b=IZt6qDGz2zABDbH/Cvh2zniiofyquCkU6n66Y8Jz8qQPrbWBFUDwwXjhRZGmJUEOPk xB89NLsO9HkksXtD0CF2tMRny6VOV6K0HVv5c8BksAFG4e8MYdD5g44oOT70fm1aFihK NThfwPKm0JwnHffLsKFij8+vy11l3xRhVBLiE9QmH3ooExsbvKWCpSHk39p3j9fgERcg hp3D/Y62lp6u6CzBtNEiab8a0c4gRMM+D7RxogJxVKs9hUzn12Nxd1NMktTiX2dZHz+y n263VDZHHjlg28Sfz+3/D5EWotkbcgQAuiODxbjqEN4sNbU3xSLawWd52lVAfcLP40J0 yrtg== 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=UgUHjWUCMpFSJAz+Az/IeJleYSOaGK+TNCsM8YWgUmI=; b=NX3YFA8iLijtPwirSoq4XpRFq01uSMnvxQ/s2M5rJJhf9vJTnKbj95Y3GbIalSm0Nh fJkENjygO0d36nOTrLoXdf+fMzBKGd1LCc0hGmoUlMLaUn09TA9iSb1NwD3TNO2kAMYY AHiCiq9FogDObTEMyHLxt7jEgkyuIg2WCA1gmusLknstW5rliG8rgaudz4FOeREj4ft2 4XHzc+vw4BV2LuQpTGN+FOAdo85x4Ft4Anq4OzYElF+KABbqJ9Roe+mblLdp+jovnXF+ nVKji9ce6XbLcItsyGtm1MNVyRXUnQGOmdimSSfR56k8DE1hicfi3Bw71c50av5mYVNK Si3Q== X-Gm-Message-State: AGi0Puan8TgK/Tqoi7TZiAHvTbNGhuKWdWHwMeO0aF2Oc8gDIgQKBEYH Tpnv1NbJ66jV5GEfo+8OUgsDHaqrt6U= X-Received: by 2002:a17:90b:1b05:: with SMTP id nu5mr1557197pjb.110.1585626908932; Mon, 30 Mar 2020 20:55:08 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 07/10] configure: Support -static-pie if requested Date: Mon, 30 Mar 2020 20:54:53 -0700 Message-Id: <20200331035456.6494-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::102a 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: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Recent toolchains support static and pie at the same time. As with normal dynamic builds, allow --static to default to PIE if supported by the toolchain. Allow --enable/--disable-pie to override the default. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- v2: Fix --disable-pie --static v3: Update for QEMU_LDFLAGS. --- configure | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 481d5077f7..22870f3867 100755 --- a/configure +++ b/configure @@ -1067,7 +1067,6 @@ for opt do ;; --static) static="yes" - QEMU_LDFLAGS="-static $QEMU_LDFLAGS" QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" ;; --mandir=*) mandir="$optarg" @@ -2089,11 +2088,6 @@ if test "$static" = "yes" ; then if test "$modules" = "yes" ; then error_exit "static and modules are mutually incompatible" fi - if test "$pie" = "yes" ; then - error_exit "static and pie are mutually incompatible" - else - pie="no" - fi fi # Unconditional check for compiler __thread support @@ -2124,7 +2118,18 @@ if compile_prog "-Werror -fno-pie" "-no-pie"; then LDFLAGS_NOPIE="-no-pie" fi -if test "$pie" = "no"; then +if test "$static" = "yes"; then + if test "$pie" != "no" && compile_prog "-fPIE -DPIE" "-static-pie"; then + QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" + QEMU_LDFLAGS="-static-pie $QEMU_LDFLAGS" + pie="yes" + elif test "$pie" = "yes"; then + error_exit "-static-pie not available due to missing toolchain support" + else + QEMU_LDFLAGS="-static $QEMU_LDFLAGS" + pie="no" + fi +elif test "$pie" = "no"; then QEMU_CFLAGS="$CFLAGS_NOPIE $QEMU_CFLAGS" QEMU_LDFLAGS="$LDFLAGS_NOPIE $QEMU_LDFLAGS" elif compile_prog "-fPIE -DPIE" "-pie"; then From patchwork Tue Mar 31 03:54:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185080 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3244645ilr; Mon, 30 Mar 2020 21:00:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtn4XJfEQId1eUlAs61ZCp0kTR1AM9Vfk885sH0JmR7nZA40LerF+KAhQY00I0v76Yjtcek X-Received: by 2002:ad4:5448:: with SMTP id h8mr14924527qvt.23.1585627202125; Mon, 30 Mar 2020 21:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585627202; cv=none; d=google.com; s=arc-20160816; b=HPET0Cw7XXa6gk1wYzThz5sMX1kA0EqHQFJcvxvwAOHriz8sTbJkdFgyWnZKDvRlYC wNFPCLLaWlW/ZyMWjQbqIX/WaIu0b+NHvSzxOi01oDUOchmHSyLoexFMAVgqdTWyRVIM IwwCzkRBMoc9Y2xWvVqHHC6F5ashvnU8c5EP7hfSF5gLwzfzkLK1HAiC9DzWzEK8JVSP d+lBPDdGSrO9Y7Yw8d4wigtZm65S0hj7KC3pgDti70g9yzhCXmHKeSZZ72J8ogL2NbbA petziQQNjR8ZiGfyzoDbNNM33zF9tKxqriO2AS/W/S+RWoVhSplF+eSs5IwyXxqTMRDe Ti/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=sVWQh9CNUJ7u635QOP+H3s5ThKzTlbDf/81J3QrEWMc=; b=wUSVUBTR/aiumAIPvV2IGKrCa/WUPo/TZqcZxjuXx036c18NbnRyPPMDXDnVKwR0GL SW/cByiorst1SIvqzPz7zWeGMqcnJ+jmnuPAJjWqKyQbdsa++wRXzj7qJ7CJ8lU80368 1KH6RiTSWD2yIPx0X3+cjnlgIJ8XLUHadxKGlVcwRlLzPzu2E6WsAOh5sXOQUxCdMUrM s6F34s69IYcEhYGbaaCLyqvknMjkjqvmSZeWKHSS+2a80Hiqa/kpExUt7KWFhqTMvb0e 3qTkZXE0aP1s5V1S8ebe9rjlkfiEReSKKvvrqGDiq0jwrfSYNrclO3Shao/uyMVByx4n 1MWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=abAIrGDB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v83si9580418qka.245.2020.03.30.21.00.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 21:00:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=abAIrGDB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ84H-0005jy-F9 for patch@linaro.org; Tue, 31 Mar 2020 00:00:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60917) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zd-0004oi-04 for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7zb-0008H9-Nr for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:12 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:43560) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7zb-0008Gm-I5 for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:11 -0400 Received: by mail-pl1-x635.google.com with SMTP id v23so7599934ply.10 for ; Mon, 30 Mar 2020 20:55:11 -0700 (PDT) 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=sVWQh9CNUJ7u635QOP+H3s5ThKzTlbDf/81J3QrEWMc=; b=abAIrGDBGlAjvpm2YYOvX3gKhR8abmRXTe5lzZVK1+hVb36wpznzeeQc+D/nenODF8 ukNo/c5+Cd8SALKDryLq2RwVE+MIhgQKViSnx1okcLhLE4eWGM1xCjZ434oz/RCc0qWy UZeEIdDYabKA8jfaLhltxG3lUKskCFqHnI7BXM7LMrsy/kSvv7Ipuhs60+r4pEltl0bV BK7cpzlN4YeB5+a/Ulhneb15ccTLITNV5EI1Ju4DWnp8UQSEFrNI0VFPN/kF031udfCa EXC7Pd3nQklulbetaZcqO3sApCddrGv+Bz81ZiAQ8k77Ai2XZ9UZ0Z8AShX+cIpkuAtQ jbwg== 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=sVWQh9CNUJ7u635QOP+H3s5ThKzTlbDf/81J3QrEWMc=; b=r+F4PtObjMXNOcaryYh3yyxaSlXiYxHjE270HQCtAzI8oZqtu1HCclZ3U2v5B/41Rj p4muet5fsszQNf1mDdJT/mZ3fjjxgkHcQc3fS+nfGAvDfBr7W4qHAEUO7vHlI5CIBwTe jLH4ZvwQRfCdzU8xDM8AepotllDDWLDWWzdGGiZ5qTvoVowAvaxfgwo1Zl5zXGNRlqZG 8MPnvoTFk2myD7EEUI2c8zgigYe9jM4sT+Wv/QStzp+D5kE97fIICPI9iOLe+D1IrtPY uHBWuYDw/Ln5a7JRchT05TUDmPHa47zJ+pmv65OlBf6kyafODKXnfyHf18Jd2+SdEFr6 NgEQ== X-Gm-Message-State: AGi0PuZkGnc1Ad3g9AlzA5DCfzUald9kSCNoLSXrpJSk/n6Ga/rvf+A7 nCyO4fK3WSCh2ysiLt5winpTUGBKRws= X-Received: by 2002:a17:90a:2801:: with SMTP id e1mr1592143pjd.78.1585626910274; Mon, 30 Mar 2020 20:55:10 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.55.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 08/10] target/mips: Fix loongson multimedia condition instructions Date: Mon, 30 Mar 2020 20:54:54 -0700 Message-Id: <20200331035456.6494-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::635 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: peter.maydell@linaro.org, Aleksandar Markovic , Jiaxun Yang , Huacai Chen Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Jiaxun Yang Loongson multimedia condition instructions were previously implemented as write 0 to rd due to lack of documentation. So I just confirmed with Loongson about their encoding and implemented them correctly. Signed-off-by: Jiaxun Yang Acked-by: Huacai Chen Reviewed-by: Richard Henderson Reviewed-by: Aleksandar Markovic Message-Id: <20200324122212.11156-1-jiaxun.yang@flygoat.com> Signed-off-by: Richard Henderson --- target/mips/translate.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/target/mips/translate.c b/target/mips/translate.c index d745bd2803..25b595a17d 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -5529,6 +5529,7 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt) { uint32_t opc, shift_max; TCGv_i64 t0, t1; + TCGCond cond; opc = MASK_LMI(ctx->opcode); switch (opc) { @@ -5862,14 +5863,39 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt) case OPC_SEQU_CP2: case OPC_SEQ_CP2: + cond = TCG_COND_EQ; + goto do_cc_cond; + break; case OPC_SLTU_CP2: + cond = TCG_COND_LTU; + goto do_cc_cond; + break; case OPC_SLT_CP2: + cond = TCG_COND_LT; + goto do_cc_cond; + break; case OPC_SLEU_CP2: + cond = TCG_COND_LEU; + goto do_cc_cond; + break; case OPC_SLE_CP2: - /* - * ??? Document is unclear: Set FCC[CC]. Does that mean the - * FD field is the CC field? - */ + cond = TCG_COND_LE; + do_cc_cond: + { + int cc = (ctx->opcode >> 8) & 0x7; + TCGv_i64 t64 = tcg_temp_new_i64(); + TCGv_i32 t32 = tcg_temp_new_i32(); + + tcg_gen_setcond_i64(cond, t64, t0, t1); + tcg_gen_extrl_i64_i32(t32, t64); + tcg_gen_deposit_i32(fpu_fcr31, fpu_fcr31, t32, + get_fp_bit(cc), 1); + + tcg_temp_free_i32(t32); + tcg_temp_free_i64(t64); + } + goto no_rd; + break; default: MIPS_INVAL("loongson_cp2"); generate_exception_end(ctx, EXCP_RI); @@ -5878,6 +5904,7 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt) gen_store_fpr64(ctx, t0, rd); +no_rd: tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); } From patchwork Tue Mar 31 03:54:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185083 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3245083ilr; Mon, 30 Mar 2020 21:00:38 -0700 (PDT) X-Google-Smtp-Source: ADFU+vusaCX1q83KVTimNxgVFg0BCKISdKEY1pK7o2klvHIsnj4CPASJmagd+922n443ayLk0r6L X-Received: by 2002:ac8:6f1b:: with SMTP id g27mr3209133qtv.117.1585627237935; Mon, 30 Mar 2020 21:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585627237; cv=none; d=google.com; s=arc-20160816; b=GPfMQaob8WP+IJmPQwmbYGDc4NUvKe6slqVLQrJAGEfbUdqrclG22Ifru2NPpZ3Fs7 sfmGrt3t4h4BXUvBOKi4aJ2cKaIjsmdzh/AYXZtmWjcB9tUqkGCDHjCnxV8rt+IPlFX7 UxZgk7QBi4GXa7+NCOSsXYJ+sKcvPmZXlEO3XoS42e6jVWyX4+jzDiPfcWIjwXSseH77 3i0rN57mE3JfYAeY2dolpAuFJ2VxvYGnmUhlUWAnjBirO5mEU7pfUFOSzo7FO/0G147x v7G4c+xZCFTtfuDXNBBLKxyHlUdx/Bb/0mtP7LSsiGNYCk4CsvA6C7IML2j4/dyH63CJ wt1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=CDnFqJBoj0Xo8UAeGjSsmq+bEn4LCuvCKa5BZTVovPc=; b=t+IZ6tpioQxnBi9jcqfH7B8xmp836DWk+TUZdcWf+n08TlQTigC4jKCby3OHy/4N32 sSoQVjd1z5xVr9NTHclFA+agkp+WhYZSRiqKa1Cd+n79gmICMm7en8IigHbKDbiUbEtb IQ4TBJVicJpB7uUuM6SE/twfqYd7BAFb5gzD/eprvzKVMZpoDCz4baLhTtHArc/u0RoD 6GhlO9wsq7Y/CoKJkTTSsr9fF8mEooSOaFo79+c3EVzPpZ/DgQSXPqZkFI3Opa2JvNAh WMH6vLj35s6rUe5KfqJOYQfOf3f7Fl3E73W+uBtXvi74BIf65TqK6vp2BSjXx15PT6UL Dkpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GCuLikD0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z34si9220015qtd.102.2020.03.30.21.00.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 21:00:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GCuLikD0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ84r-0006Kx-Cq for patch@linaro.org; Tue, 31 Mar 2020 00:00:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60937) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7ze-0004qp-26 for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7zc-0008K6-Sv for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:13 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:45782) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7zc-0008IO-Ni for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:12 -0400 Received: by mail-pf1-x441.google.com with SMTP id r14so7210915pfl.12 for ; Mon, 30 Mar 2020 20:55:12 -0700 (PDT) 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=CDnFqJBoj0Xo8UAeGjSsmq+bEn4LCuvCKa5BZTVovPc=; b=GCuLikD0qFP9t1TFXC+XvTBy6C8TSQ2lrXGh/ivBOei7lS97JesH7lo1L+Hrdt2llg 3yfGZiYfaOuLWF7lgFDPdATePRFQqvI/UoZ7CjPkDeubu3lpy3WO7t/ZLdcYVBRUG/xD Q9UM4SvDH8ulF9mgX9vvz/35pNMZn8qHUdxlNzBXKN1DwZML/hq5ZxHhWOMmoMYXfoiZ qsEqgbS0A+yvEQKoKGPy33yldE4hiHO++kQIS4QmY5IzwpX2k7Hy1HnZ9E71KcxS4XcV UCXWta41iUXU8purJ+ueWm+SU16mq6ngTOttyyGRTYr7JMX1Wi15JO5Ez+IoKR2nJLcj Rlvg== 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=CDnFqJBoj0Xo8UAeGjSsmq+bEn4LCuvCKa5BZTVovPc=; b=EXWlCocBHA9TZjnlrQGiSuhWqDsEiKnQRG3FzCOCk9luCt6Wx4N6W4poBelD3XRhu/ euEzohUEZ5XWGQUimtD7WK3wBTqNbHffUlPKdzwyh1OwRo9/2nJ3/leO9J9ZS/ZJE5Uj qzdGaKL8icvLJouDb5NEH9G0YmCMBK7uunzVmlhLNU58dSD8CZqTX7P893etgSrbdiaA N0h8jRfMoVJtZEZ8RL7/x05eM9mFZ2H8zztdZQlIZr92xoFNkmicVk+atnG2xgyA5mhC vJEG92ShtZ9DW/+G5Vt9wjh2z5dAtd/ROUE46pg3tTvHYPGsZpRdumC7FgwjlBA1HPxw RQHA== X-Gm-Message-State: ANhLgQ1uA+trYNao48I3hlNneAnTDmBDwfvLKJFjj2Uuu5jGGvR9KFH8 lEKAE/8OO/Na0Pxnf5bfQQLyDWI2xnw= X-Received: by 2002:a63:dc11:: with SMTP id s17mr15567880pgg.285.1585626911455; Mon, 30 Mar 2020 20:55:11 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 09/10] tcg/i386: Fix INDEX_op_dup2_vec Date: Mon, 30 Mar 2020 20:54:55 -0700 Message-Id: <20200331035456.6494-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0: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: peter.maydell@linaro.org, qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We were only constructing the 64-bit element, and not replicating the 64-bit element across the rest of the vector. Cc: qemu-stable@nongnu.org Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.inc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 223dba9c8c..7f61eeedd0 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -2855,9 +2855,13 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, goto gen_simd; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_dup2_vec: - /* Constraints have already placed both 32-bit inputs in xmm regs. */ - insn = OPC_PUNPCKLDQ; - goto gen_simd; + /* First merge the two 32-bit inputs to a single 64-bit element. */ + tcg_out_vex_modrm(s, OPC_PUNPCKLDQ, a0, a1, a2); + /* Then replicate the 64-bit elements across the rest of the vector. */ + if (type != TCG_TYPE_V64) { + tcg_out_dup_vec(s, type, MO_64, a0, a0); + } + break; #endif case INDEX_op_abs_vec: insn = abs_insn[vece]; From patchwork Tue Mar 31 03:54:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185084 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3247606ilr; Mon, 30 Mar 2020 21:03:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtLkQelyDnSUsxU7tizxcrPGpXzWenSsDNkBVVHISQkUdsJ783kJYUMLs2jCcBZorQ0SVzJ X-Received: by 2002:a05:6214:1863:: with SMTP id eh3mr15101990qvb.71.1585627413580; Mon, 30 Mar 2020 21:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585627413; cv=none; d=google.com; s=arc-20160816; b=kkzpexqka35qx7NbCprRPR2kqhmDgvJjv770t++rdIe4Jk8X5hGk34zEacf+IbcHrm wjg851ghe6qWV9etreHp4o4oQKkzcqO9+FBd31fKIB5J16VwCr6726rmvB0KWjxlUxMG XmC2FfhUdbd/jEgeAP61dX+w2b3rFJLZ6Xa/c5+K3NzjeYtJB8HXNUzz59oIj+zQCq13 i0WNafjvs0Yz9Fcy4xA00xWB0QSy8f5OL3GfMmn8LjnJleSOyCYWDHqHaGn92FQditzc xAgqooLXhisbpX2ziOb02sMcBPTmTSxxPZyubwwJ32ujkFYMnuOKYRJgNHY8ARFQLiYX NaCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=c+Tp2V6+LD0F/OwBiPn+CFeXg9gywOboZsBIVwTf7gQ=; b=ujb9ZkKrqYtO2ZkCKa8CCraO0qlcTSlAhSlOqGi1Kf+Q0Pd/AnLIZn9rXqNSjU5+fj wMxDEFig9bTOMOahXOBAJUE2eL/KlkEQA59YB1UFMxBMQAgNpGbWrVtm6G//6mA/d1zQ OPAUJXUvihT6Ixc0eal55xyYdBaHVI14cxfkIHRPUEn6pVkzFSQbJOX7asi92fYuhBk5 uA8pwB/WWeHBk6xGmD+3D7p+kUsfceI7g2DLNWYgOT88mTGejJoJgj+Oo0OeR3OZiTxk aK55YkL6zpah75S48loIK1HadwiOmW6qzBNl2MAtzS8ScV1hGQAEK8Bn/l0uGIHd8oRG PmXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MSd+x3bn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z67si9284510qkb.64.2020.03.30.21.03.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 21:03:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MSd+x3bn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ87h-0008Vp-4K for patch@linaro.org; Tue, 31 Mar 2020 00:03:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60955) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zf-0004rp-9Q for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7ze-0008Ls-8b for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:15 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:43782) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7ze-0008Kt-1y for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:14 -0400 Received: by mail-pg1-x532.google.com with SMTP id g20so263334pgk.10 for ; Mon, 30 Mar 2020 20:55:14 -0700 (PDT) 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=c+Tp2V6+LD0F/OwBiPn+CFeXg9gywOboZsBIVwTf7gQ=; b=MSd+x3bnkEVoSxvLeKdHDVtbFsQRFrPR1E6d+c0MH3aPXnlh3U0b20GXJvwkw7sftb nC3ds+5Oq4XVfRUD2E36GM+T7W2K+E2+TuTm0fbe5PzjCcmx4bZDOB4LlO9yIpKaZuXe cPJpko1rPeaBbJgWZv7yj/RjUOhp7ubzr3s2lW6AKHtvA2yUZx4Nz3973e/Iufytc9SK rdijkqbpD7ul2MJuBNGLeJlEIr6S1ws4XmoeqSXN81ihpC98u7RB5vxXDVox8b9s0II2 DM+EdIEYKyhgky/y9bf0l/cICUIbVUDV3xSfuHLm+J4xn7cu9EJRWLBOnLFLurobHGI5 U74g== 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=c+Tp2V6+LD0F/OwBiPn+CFeXg9gywOboZsBIVwTf7gQ=; b=n8STos92U2OWC4ewDRnkkYyWq+yOeon59Cth81s1mYRrsaBJq5dBMb2/62T4hyZXry j8rrO5uv5CkhuwObQdPSWGaq5ljkC6b4N6rp4mQCIAWKc5gSqV+al2eddXoXS+IIgYp/ 0yfCng+EG+LKiUSb/t4W/btj0izwzL+sytabvMqUtyFzicywJ9g0pD4Stgiy6K/LFN2Y +rctbE3VxD99ftFIdrym2JOQ6wvMHqz+e5CO1TgPrlU9RhUfk4x3P+Kk2PhByMhQ8aep PYFDQ8eHN8aaBT9TrR9RX/PzSor3l2ukVke64XgM/QxV2knXf+t+EZJRjeI+A300Q3Cj 0gvw== X-Gm-Message-State: ANhLgQ1MVADVwq01D3KwgwnsyhA898H5IlTDAJgmg9/8Vz3Q5UnZX1Z2 HuL5ivCw/QhMoXNtswDgzOGHg5McToQ= X-Received: by 2002:a63:c712:: with SMTP id n18mr15360690pgg.343.1585626912712; Mon, 30 Mar 2020 20:55:12 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.55.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 10/10] decodetree: Use Python3 floor division operator Date: Mon, 30 Mar 2020 20:54:56 -0700 Message-Id: <20200331035456.6494-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::532 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: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé This script started using Python2, where the 'classic' division operator returns the floor result. In commit 3d004a371 we started to use Python3, where the division operator returns the float result ('true division'). To keep the same behavior, use the 'floor division' operator "//" which returns the floor result. Fixes: 3d004a371 Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200330121345.14665-1-f4bug@amsat.org> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- scripts/decodetree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 2a8f2b6e06..46ab917807 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -1025,7 +1025,7 @@ class SizeTree: if extracted < self.width: output(ind, 'insn = ', decode_function, '_load_bytes(ctx, insn, {0}, {1});\n' - .format(extracted / 8, self.width / 8)); + .format(extracted // 8, self.width // 8)); extracted = self.width # Attempt to aid the compiler in producing compact switch statements. @@ -1079,7 +1079,7 @@ class SizeLeaf: if extracted < self.width: output(ind, 'insn = ', decode_function, '_load_bytes(ctx, insn, {0}, {1});\n' - .format(extracted / 8, self.width / 8)); + .format(extracted // 8, self.width // 8)); extracted = self.width output(ind, 'return insn;\n') # end SizeLeaf