From patchwork Fri Aug 4 01:45:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 710217 Delivered-To: patch@linaro.org Received: by 2002:a05:6359:606:b0:129:c516:61db with SMTP id eh6csp233180rwb; Thu, 3 Aug 2023 18:47:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIoTXrw1haQqwhyfIhpzCfbMouOoA+mG+EY1y2Lp1/XU1nzXFe/rqmjdXMXePcD9e9iQvT X-Received: by 2002:a05:6214:310c:b0:63c:627b:9ac6 with SMTP id ks12-20020a056214310c00b0063c627b9ac6mr329922qvb.59.1691113664649; Thu, 03 Aug 2023 18:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691113664; cv=none; d=google.com; s=arc-20160816; b=tb33dNRlq/GFZe9g3BTyuWskWSJapWVG1HwTIux07KFQBkkqy+Lh0OhxabCiZYz/Bl Zfm5PZe1yjp/XQziRRk28t/FKYQPxQCR6QY+OjjCCWB/Ati/s/xcViSeudhq6bBPDCeA JRPAnFi/eqJHU/ARR42dz6f6qZthuPcGZOUOcHmYlB2uqgyN7/aoUsBLecHm/216z33a vks1bwCb2EpENmvQ6lvXRI0rlPUal51dKFIIsrtooz1W6+9jy/gqV60MoQjAVN6Dk5RK zJIHy9+TJXuPCkl4p5M6K0kuf4TneIDW74cf8q2zRe8BrdWH4fWweShK+0zoeq7EKMZ+ 1EAA== 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=ixv99LquuqtXKj4m2MuqwATlbOBr82tZDoKAbP0Cr28=; fh=oY0Hqs0mb1Sbw8XbQT7Frqsb6/GXc1LASz4nvWEMVJQ=; b=sU9A2TRRvBsS8T7GI5Ju0kgjboCwD8iNl3qLHclYk66aiCyy7GGAVgHk1CzPIb2ArV KQeSWNqC7RO1mrsU8df4Q84uU0QEXidE7Yhoh5LwwknyeWEC2m9hu3Ntn33pfimX4uPz 7L2w/IDO5u5a4dT4UU+NFgmLZkch9tpkZjdvAAr2ByDlfzYUZ9Lt17sffxUFVBIejyt2 BsHkXBjq78W5Z/7X9eIFioARRT9oPOairFG0M9Zh1vf7tJOWCu4wQoKg1r3PTHT7/JxH 6SIERX5BOrxdHZj9YOFDJ54eNgqQIg/CloMJzxCPsXQ805R5QYxyK3G/o/CAMQaSY+KB VOKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=StMNcGhL; 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 o4-20020a0ccb04000000b0063d3734a508si600150qvk.394.2023.08.03.18.47.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Aug 2023 18:47:44 -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=StMNcGhL; 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 1qRjsu-0002gd-Dl; Thu, 03 Aug 2023 21:45:44 -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 1qRjsY-0002ca-Cm for qemu-devel@nongnu.org; Thu, 03 Aug 2023 21:45:28 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qRjsW-00056d-Ij for qemu-devel@nongnu.org; Thu, 03 Aug 2023 21:45:22 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-686f38692b3so1471852b3a.2 for ; Thu, 03 Aug 2023 18:45:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691113518; x=1691718318; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ixv99LquuqtXKj4m2MuqwATlbOBr82tZDoKAbP0Cr28=; b=StMNcGhLuUJgTvJQzEZhJKep+Xdshe0xuiVJ27mDdJH36GK/tsFD7gpCkEmZhAEjeB ncPCe6RAoAMV2e7QzSDwwujAGfihsjeB2POUjTx5iEjY7Yg8bCQTzzle537fHz24w98c TCOX1+MMSJ50lBjpBGwumbEDNIwP1G4C7ayRzKtD8ogrpRV/gcIPjfVYCJ2reakzYg7b VOI8tuQUpjVBkDbq8CfbMcRzE9OnRnVxrmSbgm+sIFapyBzr3J4YCxDibyXkzH1fAVM2 IAFTZQhUfnek7MG2RI93cvmLNy+IXOOQz+jWLqzXVadgHrAsQjC4JGKWl0v4eTWxcHwg 9Bwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691113518; x=1691718318; 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=ixv99LquuqtXKj4m2MuqwATlbOBr82tZDoKAbP0Cr28=; b=fNit41mdvcHAQ96Bw2y+BLKS6PmPULUhX/Eywktib/7mOm4bdhkIgm6u8fx5rHN+Lg l+wTitC0Ce3D4UcE8tHmjH6kKfCC9s2ecefbYnPat1m7CLCWcYTIOEy4OCEeyCPaRdKS MLjVEsCZjRxHJtERUE5W3eyj3FFM0K7uf1xSm8OPk1RSICh9iHb9ilwnzOlP9pvwYE+l Qv5c1oRH7z47V+vmaH0VA6csmMtNMFtWwaeI1EAqYTj5dyX2Rm3RiW8FWKiQB5zi+RE5 ehfuIJvTTk5GrcEdojsRHJxprHkZMlFs7ALzdBWubemWXSuQB3jKO5qHN7h+Q8cxufn6 a41g== X-Gm-Message-State: AOJu0YzRfWHMNuO0rP3AnhRuoQMMTUy8Vw+d2EbxIOWZ06NhjuOZufj8 NIvpmZczKwBfiwPBI7060JCMMnTyC90RBh8+kWM= X-Received: by 2002:a05:6a20:3c8a:b0:130:11e4:d693 with SMTP id b10-20020a056a203c8a00b0013011e4d693mr363622pzj.53.1691113518622; Thu, 03 Aug 2023 18:45:18 -0700 (PDT) Received: from stoup.. ([2602:47:d490:6901:9d52:4fe8:10ce:5c3]) by smtp.gmail.com with ESMTPSA id c5-20020aa78c05000000b0066f37665a63sm456138pfd.73.2023.08.03.18.45.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 18:45:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: joel@jms.id.au, akihiko.odaki@daynix.com, laurent@vivier.eu, deller@gmx.de Subject: [PATCH for-8.1 v8 00/17] linux-user: brk fixes Date: Thu, 3 Aug 2023 18:45:00 -0700 Message-Id: <20230804014517.6361-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::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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 Changes for v8: * Remove adjustments to the image mapping for host page size. Instead, rely on target_mmap to do its job in that respect. This was the root cause of the 64k host page size issues. Please review. 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 (10): linux-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: Define ELF_ET_DYN_BASE in $guest/target_mman.h linux-user: Use MAP_FIXED_NOREPLACE for initial image mmap linux-user: Use elf_et_dyn_base for ET_DYN with interpreter linux-user: Properly set image_info.brk in flatload linux-user: Do not adjust image mapping for host page size linux-user: Do not adjust zero_bss for host page size linux-user: Use zero_bss for PT_LOAD with no file contents too 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 ++ linux-user/elfload.c | 181 ++++++++++++--------------- linux-user/flatload.c | 2 +- linux-user/main.c | 35 +++++- linux-user/mmap.c | 68 ++++++---- linux-user/syscall.c | 69 +++------- 27 files changed, 417 insertions(+), 192 deletions(-)