From patchwork Thu Feb 22 20:43:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 774896 Delivered-To: patch@linaro.org Received: by 2002:adf:a356:0:b0:33b:4db1:f5b3 with SMTP id d22csp43467wrb; Thu, 22 Feb 2024 12:46:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXQorg8myYL86q1bJ5f3A4MkWNJeoFg4X2PENWaEiKzQ0r/ZAGXYnGTrtfSA4Kml03PmJ8HsIgcn/rT2sAx+7yu X-Google-Smtp-Source: AGHT+IGu5YZU/7bP2WnVnoowktyLtxTWQ4aulwVw/mzJc0I46OKDaGJ0oaCjoA2JN64UhYkK7d7M X-Received: by 2002:ac8:5a53:0:b0:42e:3fad:fd9e with SMTP id o19-20020ac85a53000000b0042e3fadfd9emr319036qta.31.1708634796039; Thu, 22 Feb 2024 12:46:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708634796; cv=none; d=google.com; s=arc-20160816; b=kRZdm6gT2QaaeuxOh4ASciwoB/xeFE5KfQbsq3ux4I+Z7XyGJgJbmQHm7kHwNrASju RTvNa8O6ivmkrFwvkeMe3bBj1+xLlSWKwP02LyhOLki5mJNwQi0FVX26qPLPvHe/UeMX jlw6xIkf32bOZaQuffuXoPS6mzt79Gv9iKV/hQUi8/hz3VxhiPsn9uw00MmTNgOac34b JGMlBFt6mU/V/pMFuI3eeaj5+90sQ5i8wb8pN4C9MDFuQx0aL4pmVd1z1CLtRdFB5bWn hYEUb4ah2bipR1rI85hBuMezfOGfr3JErSxFQODjg74CCgHBYpIHLFhWKutid6d7jPz6 7J4A== 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=MJwI7j8qAfDRGrC+KBy3NdL40EXjR4qHacqKh2GDQwg=; fh=H/IsS+LNYM6dBDHt5BZPsM5V9tnyjdUlJ92VVuTs62g=; b=wsarkmxzZ3oHpfPSig6ChYG8N+EdOzgcsy/FCB7YKKRRJsyxn3q2ZSE/fbWekTDnWm TA1qFp2u9zMYwx+fYvjWdX9CK3V+VhyQk4KfAgV+FvRLYe4gTMfg719SL6Ogd89NOXsu s34VHqZ9XJvX1rqJzsgWIWfW8Rxz++M2HgAw0pOnRY9PMWTqcKJVIXdD7Yf4Yv1ckFB4 FVdgWhmw5TDjUmnRT+2vDD7mceWAXf/tThWEgjPxgW+lvxBqD9xkH7BxgsiKQuKb+toT Qs5FT2iUa3NmqGgsfxWHfXyjixkNg9ImN+UVHgfVWfA1Ilv7xclJp/JO3JgsqXu52wiB 9Eug==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RsyXnn73; 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 f24-20020ac84718000000b0042e5a818adasi934368qtp.189.2024.02.22.12.46.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Feb 2024 12:46:36 -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=RsyXnn73; 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 1rdFvG-0007RX-Ao; Thu, 22 Feb 2024 15:44:02 -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 1rdFvA-0007Ji-UE for qemu-devel@nongnu.org; Thu, 22 Feb 2024 15:43:56 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rdFv9-0002i0-A2 for qemu-devel@nongnu.org; Thu, 22 Feb 2024 15:43:56 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1dbd32cff0bso2134855ad.0 for ; Thu, 22 Feb 2024 12:43:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708634634; x=1709239434; 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=MJwI7j8qAfDRGrC+KBy3NdL40EXjR4qHacqKh2GDQwg=; b=RsyXnn73y57gyDkwUIBbtfDXsXCLbEgFRPqiHqLp6amJH+kLAIDmwi8MJjINWCFoME wXouhiMID6n8fYRH+kj1g3K1NL3wb6l98oacuiUY/q/8MPRteHv5kQNTlMNuu0H6sTFb GtPfSiTspdPDWlxXHtp7McSJvGQQK+hJ+yR/OCmIOIRNJi+4fUGzAOLMoVyNHTascPZR EgKDdgXYBU1suo1HRRPEuUh2HCnGyYzbgS8V8jCWFnjmofnhxAmLOdvsMQmWgA51qmIO PpEoAH7LMG8cDXGeMc1CbZ4UPJsuHAYw4VP6HP6hayayhybTDipNufgR2Zl+wIrjeqXH /xlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708634634; x=1709239434; 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=MJwI7j8qAfDRGrC+KBy3NdL40EXjR4qHacqKh2GDQwg=; b=TT0DvIduE7/opdyHNJQvtK6Aqjp3VOTXbnJM9rZ8FZcuepVxEC05wGvwasrjf7enjJ fCrqr0P/ofnr/8jOBEjDBTeIkexHnWpp8ftnyj+ouV+zrwmxVsdhTSFeKvDeasDyUeKw aSeF8Nt4KD7g14AXv32QfB4bXafb5QZVdcDBrbHbMTqDxxyL9RwSQLawPMzWEh8XqLfP QqfXwP6f+znxmixs7q8EWeWyTUFpcgVO0hFBoyxxTDUoKGNre36WWP0GZPbFtcBPewOj 91gNcUWQoBhiT76/cKvYg9HUOH+khqDZGzx03pTavveLGkOH8Qdl602KbAzGA0yLLjaW 3qNg== X-Gm-Message-State: AOJu0YwjMxuokF7tlpMdosFfi0SNwNzcrw0+zP3bO0wbh4VmgCZXO7Q9 leZFyupzyJmp3dGGYjzVGBXq3raZygnBRBI+JoajwzXPlSxN7hgAOjwTKFCvchMn19NmrncQ26X L X-Received: by 2002:a17:902:ecc1:b0:1dc:43d:964 with SMTP id a1-20020a170902ecc100b001dc043d0964mr12783669plh.48.1708634633879; Thu, 22 Feb 2024 12:43:53 -0800 (PST) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id l12-20020a170902d34c00b001d8f81ecebesm10275500plk.192.2024.02.22.12.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 12:43:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich , Helge Deller Subject: [PULL 18/39] linux-user: Remove qemu_host_page_size from main Date: Thu, 22 Feb 2024 10:43:02 -1000 Message-Id: <20240222204323.268539-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222204323.268539-1-richard.henderson@linaro.org> References: <20240222204323.268539-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 Use qemu_real_host_page_size() instead. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ilya Leoshkevich Acked-by: Helge Deller Message-Id: <20240102015808.132373-16-richard.henderson@linaro.org> --- 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 74b2fbb393..e540acb84a 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -781,7 +781,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); @@ -804,8 +804,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); @@ -902,7 +904,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);