From nobody Tue Nov 26 22:32:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704160745; cv=none; d=zohomail.com; s=zohoarc; b=MBwMUu7iK2AR+/taInGgjfZCWSN6c9auDKVC+f4WfkYWDzkr0PYj//ACBRbZaMcQ34sf94lUyk6hrMjuSoSHJaPE7Pzno0Adswv5VS2rwojdqY2BKpUtE2cm9RgavPz5mIK8iM8tae8knr7WuvuUboPQCWIgTT8ml5cgb//cRNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704160745; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=bGbmvk3+bB4juRZKIWkw0J9XlNF5J8UzTPZ/yNXv5VY=; b=HxN/s1NGxrDJPiV4VIUrNRSURkl2wXkUCy2/28lti5G7pcM4euWIjlhgEdKj3sZTTJ+Cxn1UAvliqQ5SBCoyFtC2u/ISsA8zV6dKy1wOZ7Ptv9Ikm2i1VfHsAFW72ant5NozPLBdhAIgW8rqgyzBoZd2nTqVYZueUOMQ04AQxJ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704160745424413.3314247467491; Mon, 1 Jan 2024 17:59:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKU3M-0003LC-NQ; Mon, 01 Jan 2024 20:58:48 -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 1rKU3K-0003Kp-Ac for qemu-devel@nongnu.org; Mon, 01 Jan 2024 20:58:46 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rKU3I-00072D-TF for qemu-devel@nongnu.org; Mon, 01 Jan 2024 20:58:46 -0500 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6d9af1f12d5so5211405b3a.3 for ; Mon, 01 Jan 2024 17:58:44 -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.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 17:58:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704160724; x=1704765524; 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=bGbmvk3+bB4juRZKIWkw0J9XlNF5J8UzTPZ/yNXv5VY=; b=XQJ9ASJb+HSGq8F+KtKQyb4Gi6vTlxQCOwxtwbaUkaU6VjmmdNF07qHoHN+fJ8znd2 WzlDdwHkvIYGKaosDG2rxsAiFbp80Z4KYsh21VWaOBVEVsrHXlxlNFc4bX9JBXCYiSQ4 j4vnguviUCHlqMlp0pjffckfgxXQ8ulHZVxr3TOAu5ZyJ5H+vbKby4suMfhwOiFDSFXM cdq6WgCksfV2bx1jgYuMr6w4oFI+r0Tx4mL1s/qdhCyVCq4GvRTSNNiuHHZEco2GrOSa c3rE3B9Py8NwyAZjf3MEhn/LpSoK8dOEkE4uEGxytVECyfAFnwPqfwYX1ITg2OeHUC8B ynZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704160724; x=1704765524; 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=bGbmvk3+bB4juRZKIWkw0J9XlNF5J8UzTPZ/yNXv5VY=; b=isf4yx8eqlyX3zpYhSpNwvE8feed9llp9sfHMG/jShKlOQLLS9gbHKmRjkYu+Msq9d aP0vcyuoaQ3JBb9Y0UilLR0mW4OLyqYtjWeN8r8Xjk7oTESp2q9wmDnw1hAGdKvHcnVw 0zuUnX6YjAw1c+uG6BVmpp2Nf8yfn2g4pnm/nWSRCvc/0QLVTqhIzv5LJeaFukORzNZi 5maYXr/x/14TEMrmiAEeveLPmvMFTPHJGvDq8y/3awV0kYu9ylnZRAm1gVQvH96S13HF ac7Ln0n/yo+KC5DB5+ff2e9E4xBsrTI4bevvOHaPlFvdQVcugA3OeDcjcodBYNgAYatq n4LA== X-Gm-Message-State: AOJu0YwFhvT2IgphgvuKVesmHEOrrU+WqAiypZoLa/3i+Wd9Dnc3/Y18 RZCy66lPRB4Yd92QfvOKGxFAOS6S7n0V1ZPc3G4M1SuZDKg= X-Google-Smtp-Source: AGHT+IEs6pHKaLYXaeVOlhAnctcsXIKewSB1Pe3TeNMUNLmFV0apX+RD893/3JkslgeN4tbZvgiY7Q== X-Received: by 2002:a05:6a00:17a9:b0:6d9:b320:94c9 with SMTP id s41-20020a056a0017a900b006d9b32094c9mr17630407pfg.33.1704160723757; Mon, 01 Jan 2024 17:58:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 15/33] linux-user: Remove qemu_host_page_size from main Date: Tue, 2 Jan 2024 12:57:50 +1100 Message-Id: <20240102015808.132373-16-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704160747296100003 Content-Type: text/plain; charset="utf-8" Use qemu_real_host_page_size() instead. Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 0cdaf30d34..5f217cc2a8 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 =3D parse_cpu_option(cpu_model); =20 - /* init tcg before creating CPUs and to get qemu_host_page_size */ + /* init tcg before creating CPUs */ { AccelState *accel =3D current_accel(); AccelClass *ac =3D ACCEL_GET_CLASS(accel); @@ -806,8 +806,10 @@ int main(int argc, char **argv, char **envp) */ max_reserved_va =3D MAX_RESERVED_VA(cpu); if (reserved_va !=3D 0) { - if ((reserved_va + 1) % qemu_host_page_size) { - char *s =3D size_to_str(qemu_host_page_size); + int host_page_size =3D qemu_real_host_page_size(); + + if ((reserved_va + 1) % host_page_size) { + char *s =3D 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 =3D=3D 0) { - mmap_min_addr =3D qemu_host_page_size; + mmap_min_addr =3D qemu_real_host_page_size(); qemu_log_mask(CPU_LOG_PAGE, "host mmap_min_addr=3D0x%lx (fallback)\n", mmap_min_addr); --=20 2.34.1