From patchwork Fri Sep 1 02:23:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 719495 Delivered-To: patch@linaro.org Received: by 2002:ab3:1981:0:b0:23f:8cfb:5ad7 with SMTP id 1csp18022lti; Thu, 31 Aug 2023 19:28:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5rUv13y5ON+NmgW/iYuGYxaA2RLlOlu5lyQnyeDnyt0ZZ/lT4ynNzHpv7LeCidqeNKqKS X-Received: by 2002:a05:622a:110d:b0:411:7212:bd66 with SMTP id e13-20020a05622a110d00b004117212bd66mr1923606qty.66.1693535301560; Thu, 31 Aug 2023 19:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693535301; cv=none; d=google.com; s=arc-20160816; b=FTmrN6zJOHwHnGGlDTKs67AIgXI1OXwpXEd5LjG4RelXAd2tUbtG6fZN628U8rc6Ag 6BSvB1bAid0jX49sbseRSR/JCMFw175q+y0pwLlZ+P2GN4xi8GrZfUEQA3HtRwwJySG1 pnwdBa8EyksWmjqpIySQoLf5nQ9/ulL62sToRCDwyRaHtUlKGkKjbLo7O3quqotcNok7 vHLJb/r0S8KXtTePAyVBwyDDIEDlTPX+0yLqsx6nqvPZrB1mt61YHeYOFbtJZYlH1PyW bcfqRqFXUc4ZEHidrB62WRpsyn61ImAXw6994GVZSTxEMAThD5tgFKm1kzKxxjIjqTPQ EGkg== 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=LMSfIZM5KDQOW8rzGrPmwonqS4UNbZW6sqmCOtQy3AM=; fh=r1cPj2GlTGSV4V8jQu3jfCKsZwpJ5ktYEUy+P7GD/+s=; b=in0rj2uZ9ha8B2vhiM6v60ckM3o6/hyx2aVOq4t1sbtK2KPQQ0I044mnpLkYaMUSxN VsE3q/2gXVtGYJ6OOQWn0aeqRjvV53aN5KBGwA1eGECBjYWnDyRI4j38Y5mQis1s8Gs/ oR7kP+B4oI06W12hAaT0/GN+XEVCfyy1Y7gyX/vmCsEuLnJFG1kmfg7x9AGp+rTSbjzH r7SwL2BDGJpi9rTuIKP7t2eyKilr6MBhuOV1xpSUYp2zl8JzNLI9L/qrROvlru9JvO1G gFphZG4Vn+prRQIh6RBIjwuOYXzpTNd8Fdjl/A7dmJJMhCIIwyCPabN1JbqPBt2EWGsy 1VYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ewC4cww5; 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 p9-20020a0ce189000000b0062103dad3d3si1654692qvl.538.2023.08.31.19.28.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Aug 2023 19:28:21 -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=ewC4cww5; 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 1qbtp7-0006Y5-OR; Thu, 31 Aug 2023 22:23:49 -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 1qbtp6-0006X6-Fd for qemu-devel@nongnu.org; Thu, 31 Aug 2023 22:23:48 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbtp4-0001QL-9i for qemu-devel@nongnu.org; Thu, 31 Aug 2023 22:23:48 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-56963f2e48eso1134650a12.1 for ; Thu, 31 Aug 2023 19:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693535025; x=1694139825; 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=LMSfIZM5KDQOW8rzGrPmwonqS4UNbZW6sqmCOtQy3AM=; b=ewC4cww5K2LjJSWEuc2hv5DOMcp3VBNVXgrbIc4na5J650IR9g0Y2IlR/MeYRzUbXJ j7vqOJ3a+vHQtj9ynnPnKsKuaavu302aAg+IMaUW9SHGaBsDwiwMI9+zVr6HkbNou/V0 LqWSEvfIO5PVm+siFPNK7prUxvfrmEAfhsNEFS1ER2eNVN5ma9C7syCZRgTF+T4/YhnW Xne86JvU4APCYSIrkU1qR0G4tfEiasuaBST87dE7pk2oogKzCQ5xM+IiYbPHxH8A+w7w JAJKQBxp7yrv3UjlmETyBXnfxe6dT5iw8Am+BovOXCwOpzurkNf0vkR1QMriOtEeMLCQ Lo8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693535025; x=1694139825; 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=LMSfIZM5KDQOW8rzGrPmwonqS4UNbZW6sqmCOtQy3AM=; b=CGEHfzYYyaZiZjRQV+HWfThz8gKK9hlcMX1eVSq6GyhoKZpkkpqBclLwM2JLzI++iw VQQOkgXmPOgO9vWsUdOLsTjaJUohqqVOR+1y36x8rxusujHWo24ELOn8mqOI6njUtJsh jw0+i49z6hbXOR81lqHu8qt+K2TIkye7lcw+TzGWE0QZhxP2EAxq1IZ8MMWPfe6KaJ55 tFAEfvPWSKzhU9bt+AVGOuHe1UDfUXupSQsMEOKu7BIGYLEe2Vhgls23cLpvceqB6Oht eZWGO9ARxCd/nqlvm/msVUpCaTnLjogkxo0DdweBOWhKyKU/zN/WBL4+H9AEcKfNBohh c/kQ== X-Gm-Message-State: AOJu0YwJPpf1Q5tmnMOGkw8PkNmUKUxhzNjg6ArXIIOc+G3ha/w/+9FH RmCkChFpcWGGH8K3tf1XyAH7vW6gw7yoEwu2+d8= X-Received: by 2002:a05:6a21:99a5:b0:14e:6c19:60f6 with SMTP id ve37-20020a056a2199a500b0014e6c1960f6mr1616975pzb.50.1693535024880; Thu, 31 Aug 2023 19:23:44 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id c25-20020aa781d9000000b0068a54866ca8sm1906977pfn.134.2023.08.31.19.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 19:23:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, alex.bennee@linaro.org Subject: [PATCH v2 15/33] linux-user: Remove qemu_host_page_size from main Date: Thu, 31 Aug 2023 19:23:13 -0700 Message-Id: <20230901022331.115247-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230901022331.115247-1-richard.henderson@linaro.org> References: <20230901022331.115247-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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 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 Use qemu_real_host_page_size() instead. Signed-off-by: Richard Henderson --- linux-user/main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 96be354897..c1058abc3c 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -783,7 +783,7 @@ int main(int argc, char **argv, char **envp) } cpu_type = parse_cpu_option(cpu_model); - /* init tcg before creating CPUs and to get qemu_host_page_size */ + /* init tcg before creating CPUs */ { AccelState *accel = current_accel(); AccelClass *ac = ACCEL_GET_CLASS(accel); @@ -806,8 +806,10 @@ int main(int argc, char **argv, char **envp) */ max_reserved_va = MAX_RESERVED_VA(cpu); if (reserved_va != 0) { - if ((reserved_va + 1) % qemu_host_page_size) { - char *s = size_to_str(qemu_host_page_size); + int host_page_size = qemu_real_host_page_size(); + + if ((reserved_va + 1) % host_page_size) { + char *s = size_to_str(host_page_size); fprintf(stderr, "Reserved virtual address not aligned mod %s\n", s); g_free(s); exit(EXIT_FAILURE); @@ -904,7 +906,7 @@ int main(int argc, char **argv, char **envp) * If we're in a chroot with no /proc, fall back to 1 page. */ if (mmap_min_addr == 0) { - mmap_min_addr = qemu_host_page_size; + mmap_min_addr = qemu_real_host_page_size(); qemu_log_mask(CPU_LOG_PAGE, "host mmap_min_addr=0x%lx (fallback)\n", mmap_min_addr);