From patchwork Thu Aug 3 01:52:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 709580 Delivered-To: patch@linaro.org Received: by 2002:ab3:5b92:0:b0:238:c968:2573 with SMTP id j18csp1354121ltf; Wed, 2 Aug 2023 18:54:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlE5C8LU53xthpIP2bPAwD+aE9+0ga+hLT9oqoOVOY5q/wmzTcUD7YGFqg5RkOtp0F+pIKU4 X-Received: by 2002:a0c:fa84:0:b0:63c:ebe9:1181 with SMTP id o4-20020a0cfa84000000b0063cebe91181mr16812171qvn.19.1691027668323; Wed, 02 Aug 2023 18:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691027668; cv=none; d=google.com; s=arc-20160816; b=jqkZkSFtsQEO5G2uieMjeKQE5S7eRqDcJTy8qUKFK6pnhYHilENHmYxKagMC3usuxj d1vaUTTbvRcnCjT/GVj0AtOmbxRAXmzeirBRWN5TtJVyKxl7PFcWZ+kyRWs9v1PinkKM PqfLs8Ivd/KXqBKB8KwXeborSC380jXDhl8F4qTvlAmXQFY/ZDEJ9jiudCWLqQ9oz5XY QwQ1W+REJDBc6WYNUjTRqSnWaYSTmX42mRvtb9GqHWLZlgYD7akXUywUL1H7ayRE5ACL MZlj0qt+hVGPXmjait8K1/24tBfhDn1aG9hxNhRCMGqtxhLeF3KDAYgOi3bmGir318Z+ 6KmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=5+EK90UJfX7jj7sXNQRpX2WTAHgncCgalkEWNrdpmx8=; fh=fmVFRXV+XPDbp8+eafcQB359/x6dDRQDsVzPMZJ0Hao=; b=iXgR2LGdkdaEDBxDeS8gRygddY73pWHRXOqbi4axBy0fFvtU+C8vVKFsQU+eD4hlbI kxMp70BNjWsmBWio3ju3fBuIaqG7QGudZcZCNuPAyxweRP1QP6H99OioJKFX5jV2i4DR +pUtOPNkasGd2NNtgDJIFN8jdC00TAOQtuqIdNEnVW9D0cLUpS+W9h93yecHMZVgbAzN Nk2+GZVmHOKuAq8BJWFD4n2BbViKqAMNjR54fs9KSSEKjPNFiblrYZNwJPxgvaSVJYjD 9y3gpBj5OhyggxLKvBaFk5TfuhSsje5hYAH8yMn9xUR7R+hPmIjgYNE2/KZPSNw0PBU0 1rTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bisq2UBJ; 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 y2-20020a0c9a82000000b0063cf5ee0420si9360335qvd.14.2023.08.02.18.54.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 Aug 2023 18:54:28 -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=bisq2UBJ; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRNWY-0000dt-CK; Wed, 02 Aug 2023 21:53:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRNWV-0000dE-R7 for qemu-devel@nongnu.org; Wed, 02 Aug 2023 21:53:07 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qRNWU-0000hL-5j for qemu-devel@nongnu.org; Wed, 02 Aug 2023 21:53:07 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-68783b2e40bso292087b3a.3 for ; Wed, 02 Aug 2023 18:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691027584; x=1691632384; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5+EK90UJfX7jj7sXNQRpX2WTAHgncCgalkEWNrdpmx8=; b=bisq2UBJFEGTiv0/XPuz8m5bKEcIBSetXQbV/N3mCmPa08b/R79A3YLn/+yri1rRB/ IaJlGqPCoP2TKw7eFG+aZHkIZX+O/tk2Uwj5yQztL05NnWAIBReK2sy0JW+WFUZIxQmi LqljGVy2P1Iq31OYUbyKVSdHkoxpcKvotVWLfoNPEGgbp9yRAqhJq7IP/SuEZZSHj++j xmczLVSzcZvg6Ai/7VwkSvAGdBaQFg/sfSjBhUdbpMwuWBG6yd9q7z3dVgqwgnF0LTcB gtbsqwGjwd1rS5bcOn3wu8TGZJ4YXIHqo7vPmL8g2hzQKPSU+ykxzTVsXwHcg/QEYnY6 f/xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691027584; x=1691632384; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5+EK90UJfX7jj7sXNQRpX2WTAHgncCgalkEWNrdpmx8=; b=T6NFd5hNz6GAZqqt8rH/mCEmd0+1ChxuIEPMRLlvuoH+oc9IoHSYKtS07Q+5gkkLMV bRGwVmov2Q/lMiFCNYwIeysL+xjGdBXqc1mDUmo7OdiM1/VdGftunkLoKZA2B0C3XCZI i1q6TJNeD5GXeaJU92aVeu+hyJzTVwl/LNCZMinGi9BnT0M/ZsVwNVPbrDMS+lVmxHy3 AfYJw/99+/cGaFFELK4kSSlLo7k0kLq4Pm23Ik9bIsGwEsRgRoDxRBisjCchYQwADlip Ohns1TVh1J1vY9CqBumpUgjrKr1c9uF/lism0jk5+XYgtwAD5stBGn2M3/Mk5rczk92e Wx3Q== X-Gm-Message-State: AOJu0YybhSAFA3jBumA1ooagzAXdLlDjeunyAuu6u1Eixltj308zPtUl JlUNi46a1vAyp42MfH9b5A0a0ECCzJgcwC2L8QA= X-Received: by 2002:a05:6a00:248d:b0:687:8b52:112e with SMTP id c13-20020a056a00248d00b006878b52112emr519037pfv.14.1691027583892; Wed, 02 Aug 2023 18:53:03 -0700 (PDT) Received: from stoup.. ([2602:47:d490:6901:b659:bbad:1a22:7ef9]) by smtp.gmail.com with ESMTPSA id s25-20020a63a319000000b005649cee408fsm157123pge.0.2023.08.02.18.53.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 18:53:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, laurent@vivier.eu, akihiko.odaki@daynix.com, joel@jms.id.au Subject: [PATCH v7 00/14] linux-user: brk fixes Date: Wed, 2 Aug 2023 18:52:48 -0700 Message-Id: <20230803015302.407219-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Builds on Helge's v6, incorporating my feedback plus some other minor cleanup. r~ Akihiko Odaki (6): linux-user: Unset MAP_FIXED_NOREPLACE for host linux-user: Fix MAP_FIXED_NOREPLACE on old kernels linux-user: Do not call get_errno() in do_brk() linux-user: Use MAP_FIXED_NOREPLACE for do_brk() linux-user: Do nothing if too small brk is specified linux-user: Do not align brk with host page size Helge Deller (1): linux-user: Adjust initial brk when interpreter is close to executable Richard Henderson (7): linux-user: Remove last_brk bsd-user: Remove last_brk linux-user: Adjust task_unmapped_base for reserved_va linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h linux-user: Add ELF_ET_DYN_BASE linux-user: Use elf_et_dyn_base for ET_DYN with interpreter linux-user: Properly set image_info.brk in flatload bsd-user/qemu.h | 1 - linux-user/aarch64/target_mman.h | 13 ++++ linux-user/alpha/target_mman.h | 11 ++++ linux-user/arm/target_mman.h | 11 ++++ linux-user/cris/target_mman.h | 12 ++++ linux-user/hexagon/target_mman.h | 13 ++++ linux-user/hppa/target_mman.h | 6 ++ linux-user/i386/target_mman.h | 16 +++++ linux-user/loongarch64/target_mman.h | 11 ++++ linux-user/m68k/target_mman.h | 5 ++ linux-user/microblaze/target_mman.h | 11 ++++ linux-user/mips/target_mman.h | 10 +++ linux-user/nios2/target_mman.h | 10 +++ linux-user/openrisc/target_mman.h | 10 +++ linux-user/ppc/target_mman.h | 20 ++++++ linux-user/qemu.h | 2 - linux-user/riscv/target_mman.h | 10 +++ linux-user/s390x/target_mman.h | 20 ++++++ linux-user/sh4/target_mman.h | 7 +++ linux-user/sparc/target_mman.h | 25 ++++++++ linux-user/user-mmap.h | 6 +- linux-user/x86_64/target_mman.h | 15 +++++ linux-user/xtensa/target_mman.h | 10 +++ bsd-user/mmap.c | 2 - linux-user/elfload.c | 94 ++++++++++++++++------------ linux-user/flatload.c | 2 +- linux-user/main.c | 43 ++++++++++++- linux-user/mmap.c | 68 ++++++++++++-------- linux-user/syscall.c | 69 +++++--------------- 29 files changed, 401 insertions(+), 132 deletions(-)