From patchwork Thu Feb 15 06:19:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 772848 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp681123wre; Wed, 14 Feb 2024 22:24:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX30xNsBg5ImSifwOFmQhRXCF6XO2a0wdD7lqmI8Tk4TMz4yEIsdscFHxHFUiSQ9e/OdI6JeU8nVTxPtis0g4W9 X-Google-Smtp-Source: AGHT+IH1jUIW6yQw3sDTuC6kwyg7ChXQQVF39orERctTao2yS7887gj9qdoaBqtOhwTF+IUkVRMp X-Received: by 2002:a05:6214:d6f:b0:68c:62e2:65bd with SMTP id 15-20020a0562140d6f00b0068c62e265bdmr1409063qvs.46.1707978262431; Wed, 14 Feb 2024 22:24:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707978262; cv=none; d=google.com; s=arc-20160816; b=CMPIrymuBStYZt/XEtaOvG8juEPPkRBe1YdXe2L/4i3K8fo6b1ElufaFwcrDt9PQpq utBHZNm+iQPAFbyCehe4LSPC4LvK6IHZUzybS0BBtIovZTu64C6KYokHg4ragzwBfnQM FG7LvdaYBSKs+t6dEiVv0mkI/5q0sEK1Oqcw/f+OdRkAXMhUK/CKmst7AOqhSmszUYSW epsYfu3z29wlb35VRoxCVYqJEUC/a0dW8XVny68Hx8TUMzbBUtmB5DdQe0491P6ZRZUU O0ROAZ3afR6gI9wKxt1iHWWrTyPvS1KWNSZRWCRSDq1+TQKSAVJZF1+3Un0uigGihvSY fLAA== 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=4czMnwy4ONozXZRRucTuxGhHSF3+8ljKdOePhx3D1do=; fh=v7v6q89OJlq+NxHejbJ/ziw7VE+fSww09twjGPM2dQM=; b=Ws33qalVQJzpbBA5H0QNk+5mkKz5cefaOLWbv+2yXRFxndhx70C8LD+7HjFI4OEM+h 3XeMBMCFBwygu7cQkak3NK+pEL/Smr/BVsZjl28x93F1lI5XH7obLmJYlTuiqZaLkbNQ +AlRBclIwHH9bc5s5GQ961QuA1mnQCBEKKJ6f8MJBxuqlMnalZSwegsAqbP8McFIRsKI 0hS6Um4XldLWSpIAO09VWY+7v4k2FABHzD8Rkgq4yoVxYnfFF0/xHCqu7RY2D32ufu6g T69e4eQs0G68rRQwaEAtYYnxEJSLUK/fXZmP7Do+jKDc4+wQrzGAGJN0hP/mtMXy55WJ RVJg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cNoxOKoj; 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 if7-20020a0562141c4700b0068f07fbcbffsi800483qvb.43.2024.02.14.22.24.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Feb 2024 22:24:22 -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=pass header.i=@linaro.org header.s=google header.b=cNoxOKoj; 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 1raV6k-0002Fe-49; Thu, 15 Feb 2024 01:20:30 -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 1raV6i-0002FE-BE for qemu-devel@nongnu.org; Thu, 15 Feb 2024 01:20:28 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raV6g-0005KJ-Nv for qemu-devel@nongnu.org; Thu, 15 Feb 2024 01:20:28 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1d95d67ff45so3822795ad.2 for ; Wed, 14 Feb 2024 22:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707978025; x=1708582825; darn=nongnu.org; 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=4czMnwy4ONozXZRRucTuxGhHSF3+8ljKdOePhx3D1do=; b=cNoxOKojC4UzF4AI7na1FxJY3m+K4nHX7XgnBCbuMD6ROJIsL87b5JC5wJQHTVuTOu 1vbHxKLb+Jx3fivdH/YzcnFTaNzLE6Q9HSIxEuLvhERzFCur+qqCJLo9rbuRhsUhmMZG akU7NT5PbdDenhOlQaDqhW0uINQuoJ9pmAKp2fZ9uMOqQj24w7M3UOlD8WLQLZU7j1u4 YPcnRkst3Dh31yU2H07Mhn/Mk7v3S2p246opv5g6l2Av9V33ihg9CtSsViiozHwhioWc uIloU01jvGekARzCtVv5+CknWYl5v06ou7b5kICQCdd1JYHCnSLheKILsiLtBad2P05K rYlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707978025; x=1708582825; 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=4czMnwy4ONozXZRRucTuxGhHSF3+8ljKdOePhx3D1do=; b=ZwLsXbXtiBjXYQrXDWUJzWVpYLh7ineZEglHxiRO+WNF0Evbnx3CurFN1rl4an4VFC 4n7QJOx/fBlvD1vlMQsotYvypCvwgzydmA+/OO4rdFILNtNs7Mxr0Aon+kYHCcEoLII0 TzZ+SgrMVihvTPHZMUf9aM8h/pgHY7sRqvKrI4Fh4ODmOXSnBk25Cg9I0YPgSCNANlmx 0OxGGGdixqa1mYKduZ66HM3qi5JebUNe7Kg1zDIlnLlcb30hVnv0s4+K96Qd9RedORLL LKNUY/QJUOVz6Pd8p/Vr7CikxyBM0xTfnh22CThJiUUcafG+otlaqjjJrMFCfGTNa45p maDA== X-Gm-Message-State: AOJu0YwoGFWgUq8iGS7DKboDwWFtsi+yz0uAIrgP9TnFRQZU/7trk5ug g/YUOFUgOEVkO7Jt8J6Hx6EaYzfIED4SVnTkUmN+PZBxDZUD9vD4OMxrq7lbiAnSonaff1+i5uk F X-Received: by 2002:a17:903:183:b0:1d9:d300:a670 with SMTP id z3-20020a170903018300b001d9d300a670mr1083474plg.15.1707978025383; Wed, 14 Feb 2024 22:20:25 -0800 (PST) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id d5-20020a170902b70500b001d6f29c12f7sm464418pls.135.2024.02.14.22.20.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 22:20:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , Pierrick Bouvier , Helge Deller Subject: [PATCH v4 03/36] linux-user: Remove qemu_host_page_{size, mask} in probe_guest_base Date: Wed, 14 Feb 2024 20:19:45 -1000 Message-Id: <20240215062018.795056-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240215062018.795056-1-richard.henderson@linaro.org> References: <20240215062018.795056-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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: Ilya Leoshkevich Reviewed-by: Pierrick Bouvier Acked-by: Helge Deller Message-Id: <20240102015808.132373-4-richard.henderson@linaro.org> --- 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 e918a13748..e84a201448 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2893,7 +2893,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_mask(); ga->bounds[n][1] = HI_COMMPAGE + TARGET_PAGE_SIZE - 1; n++; } @@ -3075,7 +3075,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) {