From patchwork Tue Jan 2 01:57:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 759339 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp5856135wrw; Mon, 1 Jan 2024 17:59:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVwFPy/ZdurEMhRQWgepriOl+K8t7Ccild1iCbS5tp0aQTOoadgJgVHc2NnH1TzRUUXGET X-Received: by 2002:a05:622a:249:b0:428:1e58:fbc5 with SMTP id c9-20020a05622a024900b004281e58fbc5mr4516707qtx.125.1704160775463; Mon, 01 Jan 2024 17:59:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704160775; cv=none; d=google.com; s=arc-20160816; b=JgRjJxOmmJYLAwyQniagAmjSRn5guRSzictnI7KSqO4DQRdmDRwgnk/f1XfaDpMoSI qZvZAZ8s8PqvKs+CmAkNcEnP1+pHYWJ2f2ghccnqKWwi6OLmUPQZc6jXO7TOK6n5AEYO WgsIcXiPArB3Bim92TsSVLH0uTViLhsh1hJyEUtYdM+dVNhXHWF/MJG+enk9gSPrq2fr ubd1dqhR0G1vczag8c35xLwOK/oeIRWuv0DPFuHZObgCzqpJShdc+RHOH3tvAtqfzDsd USz+oVVDIkHQxwqPaXHLoB+S9Mx013PdZMts8YmCWtO2wMwy+ug57ej39zrGN7GpU87I QELw== 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:to:from :dkim-signature; bh=3V4UcCieB3zB1M+n0kFdLlq+X9hWVNWezL6ktHMn9HU=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=ujdtnTzY1Zb3IbJJBWpG0GD4Lbdgla46EZDlUJzY/9dOONxyYGC3AKvhdWGaQbZwA0 1CYlfL0SI59cxJ8QsygNR9fAPRJZ/uc6Bg3LZrOAuRm+iTl5pPlGRmuZpO/2BqdCglfj CVg+ytGDMaqhWC4vcNdikZBUn9Rex5OzG3ct9B2JWc9NQlepA8dI+1jtLvqDlf+9DRlo UCb2KRQsDtqo97as/ZvhCbaEGWE2ZMU+rJ5dX++whKCqXpTEsqpFF3ko86W6oIS7M6he vBQkPPScfqm4iL7+NRXKbZWY9STl8L5kaxA6N1hTEECh9rw4wQbrjOOrlmeLIzyNVZod lOXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="QOJ1/peM"; 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 u18-20020a05622a14d200b00407dd1bbbf5si26688489qtx.368.2024.01.01.17.59.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jan 2024 17:59:35 -0800 (PST) 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="QOJ1/peM"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKU2y-0003Eu-Dk; Mon, 01 Jan 2024 20:58:24 -0500 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 1rKU2w-0003EG-P3 for qemu-devel@nongnu.org; Mon, 01 Jan 2024 20:58:22 -0500 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rKU2v-0006yh-9w for qemu-devel@nongnu.org; Mon, 01 Jan 2024 20:58:22 -0500 Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3bb53e20a43so7596303b6e.1 for ; Mon, 01 Jan 2024 17:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704160700; x=1704765500; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3V4UcCieB3zB1M+n0kFdLlq+X9hWVNWezL6ktHMn9HU=; b=QOJ1/peMffkk8WtK+wkUiIdjqz7Ix6/gRwd2bpcT/+pTwGm4tuGhQXlni/F1ZmKxn/ VmoqK4TMEt2hCQYfGVFlWNuginiWMM1FWd4AtYpC8RSSBx/rhcHreS3+weO3DepDTQ26 nAJu53DLDbwhh2mzQcGQV90sU+ZDSBbjkf5kOKCTTD41ibaS10sgPsIPzr1edv8DB2Fp ppQR5w/uG15CiZWxf8+DxO0nw01Enec+x9mjU5A3wR1Cgp5V2+JQmJh464aKkVtquuEg JKxabwoa3dc3gwZv6S2ob3CShOCV9xteUIW3jXXZcX2jdB/tyS/J8GcAZmEHhU3muVQM DO1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704160700; x=1704765500; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3V4UcCieB3zB1M+n0kFdLlq+X9hWVNWezL6ktHMn9HU=; b=BSw7t6Kjt3XOMjrF54aDNzqxlGR0gK9Z6mU3MkubQbmCA+AGE6LFWXp9mn4jhHy/m6 coQcPLYQ4tilw58sbeSZiTup6GKiE/5uHKJH0C28tuxbTXYb1CNEx2pJJlaSyJr1cAm0 GeZi1FNUy429dZz31WGZdO7pCqz/v8RBCR62CDtz6WH0nTNrEgO5YX49ef5kO4vdUTlD x4vxOBr+AFh+Aw2z1TMMA4/oiiPPubxTNfbzV9pa3L0xIPmRU9MQ7qQMCXmxq8jj0Qyz 2RDKn7qCVekS6nOXx5rtA78owJp3p++sr0QeL+RhXxCC6VbNHcTIVRbZWfGRTPA1CzYt o5RQ== X-Gm-Message-State: AOJu0Yyper52RGbxBWo/Palq1AMlOhOYxDowx/2E92p69O5WAtVncBWU 3v2Hwz2AasTQ2oB9/BwW21IUTfNRU8aG4xuy0M3NAPlzmd0= X-Received: by 2002:a05:6808:171b:b0:3bb:e8c2:e29a with SMTP id bc27-20020a056808171b00b003bbe8c2e29amr6900189oib.101.1704160700071; Mon, 01 Jan 2024 17:58:20 -0800 (PST) Received: from stoup.. (124-149-254-207.tpgi.com.au. [124.149.254.207]) by smtp.gmail.com with ESMTPSA id g33-20020a635221000000b0058ee60f8e4dsm19561891pgb.34.2024.01.01.17.58.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 17:58:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 03/33] linux-user: Remove qemu_host_page_{size, mask} in probe_guest_base Date: Tue, 2 Jan 2024 12:57:38 +1100 Message-Id: <20240102015808.132373-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240102015808.132373-1-richard.henderson@linaro.org> References: <20240102015808.132373-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22f; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22f.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 The host SHMLBA is by definition a multiple of the host page size. Thus the remaining component of qemu_host_page_size is the target page size. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Reviewed-by: Ilya Leoshkevich --- linux-user/elfload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index f3c1e0fb64..4df565d64b 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2892,7 +2892,7 @@ static bool pgb_addr_set(PGBAddrs *ga, abi_ulong guest_loaddr, /* Add any HI_COMMPAGE not covered by reserved_va. */ if (reserved_va < HI_COMMPAGE) { - ga->bounds[n][0] = HI_COMMPAGE & qemu_host_page_mask; + ga->bounds[n][0] = HI_COMMPAGE & -qemu_real_host_page_size(); ga->bounds[n][1] = HI_COMMPAGE + TARGET_PAGE_SIZE - 1; n++; } @@ -3074,7 +3074,7 @@ void probe_guest_base(const char *image_name, abi_ulong guest_loaddr, abi_ulong guest_hiaddr) { /* In order to use host shmat, we must be able to honor SHMLBA. */ - uintptr_t align = MAX(SHMLBA, qemu_host_page_size); + uintptr_t align = MAX(SHMLBA, TARGET_PAGE_SIZE); /* Sanity check the guest binary. */ if (reserved_va) {