From patchwork Sun Jul 9 18:28:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 700907 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp4829867wrs; Sun, 9 Jul 2023 11:41:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlGVuvTcc+OqPiTq5jDAAsxgBmp+Q9H2AjfAO+CdEimAyJEtrxAZe94arGAn/hfMTqfBM/WY X-Received: by 2002:a05:620a:4416:b0:766:fb05:d7b4 with SMTP id v22-20020a05620a441600b00766fb05d7b4mr11191942qkp.57.1688928111557; Sun, 09 Jul 2023 11:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688928111; cv=none; d=google.com; s=arc-20160816; b=rh5PmMHXsV5rq4otmwiThQgWtGwKy08YCTcjDF5PMhwJgFkGT0Tl1Yn8uocLMVdSAT CHn2om3lFiD8V4ctl6RZbnOenknglHlNiyYQjxa24akOw1yzkefeeiRwvcQ0qQMvf5wC dzGtW5gKA1xMbmfoY5m/8qt5totiedgll6PO8Vb9D9bNDn/xaRh09O21qMUa/GZF6lHg 4iNscNUGdIZmQaDC0YbQR5V9yJ7kJiRgYhldKoKkw91hnoS+AVf6cMzh3tVrOdx1LRiE JFPuZrhBbIU1IVLS/i9rCjIx/Plvo21PfdNXaU7tQh3WeAo/i3fMeIA2kJVOL5Kb/oTC wXwQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C1Ndh6I1tE5UeDqHZyfe4FN5fGzwUfKgv00siQ2QsL0=; fh=EsDPbv9tLFEVj/5Rbuvnb8455Ixt2+kw/VbBqBCm3P0=; b=03kIcZeGX7GJ/9c0NAbEmUIrR4a1GE4LLn4033pDhaTBPQKXXHRSJUxHucGZTxAHnL gzMkM4Gavf3QsBgqUWQQMHR9+EU3k+0KEJ7PuUTcy8T5mDhK0AQfwChtY998nW/Lzbe3 sor6uUiJ7JXMO6jsLLxEAE/pDZifwui0XpYw0fUKjTm5PUQ+75qZg8/rYqWLioQTqboK q4AA5WFWwSI/PhdKgW0/r+TbBz3UR3oYtltyL100On+UOU5hHV3GAUjQ6HN9MrlgDW7z b7/ckmwEfqdjfwQGYfrA2emeK/nvgtyoatm/07tZsK/93abSo3zBS0uHcgetsy9u5GIG U5LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jPDN9xZf; 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 dy33-20020a05620a60e100b00746af257e8fsi4726424qkb.714.2023.07.09.11.41.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jul 2023 11:41:51 -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=jPDN9xZf; 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 1qIZAq-0008WU-5x; Sun, 09 Jul 2023 14:30:20 -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 1qIZAj-0008Sl-Ex for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:30:13 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qIZAh-00013z-8k for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:30:13 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fbc244d307so43912185e9.1 for ; Sun, 09 Jul 2023 11:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688927410; x=1691519410; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C1Ndh6I1tE5UeDqHZyfe4FN5fGzwUfKgv00siQ2QsL0=; b=jPDN9xZfxi+4wLPYpkE1ZMOamKewzhn+K9ojLubUf0gpsiVG+k70qf5dMIQsgW3XPr BsoFKzkRzMuZqFER917PrZ/I3sUhuHIOZnRVYkddyppPk1wQmCfnFoQdtk3AcLR9clWd QLJpI8KdSWQQywu3MyKxb/ggga15u6iPfrkBqdEoVY6/E+iBWTp1vneex63ZDLha8Xg+ pWwyzRkBXunSs5f3vgY0TtFtkFl0TOTo/QToUL2jiBpIqDMNtmKk4wxe22CoQUI0RG5Y 4r2lcoxp9B8GyHExTXAbtJB9/XZAczqiMw+338/mHx+TogGxRta7fMdaHi8Jiqp9pMck AOWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688927410; x=1691519410; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C1Ndh6I1tE5UeDqHZyfe4FN5fGzwUfKgv00siQ2QsL0=; b=dCAxpytnzxak42GwFtGAWyhytCWihnQ7ItO5HTd9rsXvxi2/fNrdjr3PKIckwwFzz2 LbZ5fnMkGMbp62M2fgWph06h7ZnyepT1G8ow2VSg33ynRkXWO/DiwylySajJ5R+6wlNp cWqY+fZfvqZGEWDq+tEuWNh+afY1oN9YvIxmJipGSPPz5l7cVJXWNBw/i4VybOj6u4a3 amujZ7bxhoefgcQ073wJqVRq0qBNW5qHwQwmybt7Xm8LXSk6JMdWzOvIuqvsLDDWcZ1e qQ3tHwi4tZpmC2eMR8AEiDTa6QGOLznB49eCHXZKedP5hhpaSuh31ymaD3foTNFK3SWC m+TQ== X-Gm-Message-State: ABy/qLanf80IorSXUz0wsBrWKPMZHLybHXa7zoiUvkCiyeHV3/oJVAq6 99C5TKQtgQ2wyz4c7FMT2KkOv4VQCflxYABZUdMXmA== X-Received: by 2002:a7b:c5d3:0:b0:3fa:934c:8356 with SMTP id n19-20020a7bc5d3000000b003fa934c8356mr3151501wmk.10.1688927410002; Sun, 09 Jul 2023 11:30:10 -0700 (PDT) Received: from stoup.. ([148.252.133.210]) by smtp.gmail.com with ESMTPSA id q15-20020a7bce8f000000b003fbe791a0e8sm8317108wmj.0.2023.07.09.11.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jul 2023 11:30:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, Andreas Schwab Subject: [PATCH 20/45] linux-user: Make sure initial brk(0) is page-aligned Date: Sun, 9 Jul 2023 19:28:51 +0100 Message-Id: <20230709182934.309468-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230709182934.309468-1-richard.henderson@linaro.org> References: <20230709182934.309468-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x333.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 From: Andreas Schwab Fixes: 86f04735ac ("linux-user: Fix brk() to release pages") Signed-off-by: Andreas Schwab Message-Id: Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8b12774fba..04e07cf261 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -806,7 +806,7 @@ static abi_ulong brk_page; void target_set_brk(abi_ulong new_brk) { - target_brk = new_brk; + target_brk = TARGET_PAGE_ALIGN(new_brk); brk_page = HOST_PAGE_ALIGN(target_brk); }