From patchwork Fri Mar 1 23:05:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777113 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1603787wrn; Fri, 1 Mar 2024 15:16:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUvSixzCnzFs+fNE4UEOfm/8dMR4pokVWCUZ+IoqgTnFWed59b7nm7ZKyTsgQR0OGWmseahhQvaodRWuLQjlqWW X-Google-Smtp-Source: AGHT+IGDscf6vgHWOuD+Fu8L1NtvBj41thvNRM2XLsg9nmhtK0b3AqTRrfWCH7kL5BQdeBG+5Nta X-Received: by 2002:a05:6870:f6a2:b0:21f:236:a316 with SMTP id el34-20020a056870f6a200b0021f0236a316mr3571899oab.50.1709335000969; Fri, 01 Mar 2024 15:16:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709335000; cv=none; d=google.com; s=arc-20160816; b=eaAjQvk8zU2Wu6lWhc5c2Pd7VUQqJbJ6FYjGEx451geaXyxh00TKUVqC9OSemVhOCl /RPptVEjf/28tMh9DQW71GRywXo63g6MZ3JZUtcsS9FfyuJymhC0wkQ+BJbL6sB+jK6f cM/sXM9CS6QYZcLoGeLQJdLKGF/wr9QadAJ9W/xInXkjzn2eCtLZMY0Hxt4UkmeE9RWA z0i1YkPYZOMCqCHnNBZFt+k6Sp3e0nIw2rjRpbhN4l5ySZlZCX7sEOkeI2PM6DtWRkqr AOs5gDlNn0AgSc2GDS+J97NNINjf+/5nu5deR+jOqzY0Caza5p8YIp1FQgP1Ol0kR89F 4g7Q== 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=fbd4Ecfy8JMl3KBDsfREKw/XoTdmL6bXM1y/Mphtiy0PEUa3uY0LIl5Y43Io6IURco Z19I7IKZyUDCP+GeK1QPHEWEXkcKbBCGyEqvGA2cmFImZ5X1JDZilevoBpTNsVPW2lWy uJ3iGGudWjtOKp9vOmL/l+d24xtL69M1ZJNnYSOxNAUsfmt8WjIIYS4yyfkU3Ph/IqQP OZ1E8SHo8D4MQOiDn/c2VS04lbOsuINaPuxz6vFZDYLstL2nD8LOh4LHrDXyy/ewFqNn bhICD5GjtkJ7KiqBxt0hmsrzwGU2XhXmVc20da9HwvMbhf4cgIkmPNgqc8BE1YjJlK21 wcyQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ya5qaDan; 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 ee1-20020a05620a800100b0078802532997si4022392qkb.717.2024.03.01.15.16.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 15:16:40 -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=ya5qaDan; 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 1rgByV-0006Aa-7m; Fri, 01 Mar 2024 18:07:31 -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 1rgByC-0005ZP-2L for qemu-devel@nongnu.org; Fri, 01 Mar 2024 18:07:12 -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 1rgByA-0004L5-Ke for qemu-devel@nongnu.org; Fri, 01 Mar 2024 18:07:11 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1d944e8f367so20482885ad.0 for ; Fri, 01 Mar 2024 15:07:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709334429; x=1709939229; 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=ya5qaDan/hzcEgpsytylYs8ciE4to310wI8aeCp65LDnbsv0vdSJBSA/e21XZxVRNO R4B35v6x/m6YlWfqSWVOgUORewCM2MLH9sMH0FbiZ+6khp41Cazbg9JlHYSIvC60qc1r y6ug2xy9U2Heoljesuo/VTGuhEqSzHFSgFgRaEoR+CrRNwz2HFZfb7dx4lqygCuWHmgh GlYPHOOZXpE/y2Igsk/nBEpfSDShWYB5R8NNCsmnRa8Lm/smgXlsgUnF+wJRapp/Cfsh uFZk1RhVDtSz0d1ghZVWPCFBeI3jlvbZvtbNXHcO9zWf/o/KrxRuaCmaiUDqEIauzfde bHSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709334429; x=1709939229; 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=Yh+veHN60ciofydIRp/3veAjJdQ8htkN/4YiAiQbMlN3RYOxYfgQ/ItBV3/kWhR5gs diwDID5Tj442p2yzQ2cXNCFMROmf8QL5DQM2SAapQ3TZeyV7UaOWCMVNH/qU/49U1Zdf lQGJQOCPrS3PYBJVuDrchG43TxHzthK3+PGs/wTq4xz0rEIxtvDOhJ8dSvMdSyPojeS7 iQ3JsKLvcPGlAfn92w353BEZATnWEd/yKW/i9XWp1vStLPpCfw0R2VDaLreoT5AjM6QQ lXjW6EmfFzYzfrB76qx4MvC36d+MQezFlqtz1JrvjoXM2n8g/VRqEu2cNYvDcXz+2qMS g0dQ== X-Gm-Message-State: AOJu0Yyn7a/g+Nx820Le60qBBKDDoXfKQaKoPlcP6P2jEsaBf4PAbIAS tejksMiJHwlOLJT6HYazHP6u4VPwdEULQrdDutDcZNyNrY2DNRSfjkijY9Ca8MqLUx4PRHEnXUW A X-Received: by 2002:a17:902:9a07:b0:1dc:7890:cb27 with SMTP id v7-20020a1709029a0700b001dc7890cb27mr3006831plp.48.1709334429464; Fri, 01 Mar 2024 15:07:09 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id lc11-20020a170902fa8b00b001dc668e145asm3988580plb.200.2024.03.01.15.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 15:07:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich , Helge Deller Subject: [PATCH 33/60] linux-user: Remove qemu_host_page_size from main Date: Fri, 1 Mar 2024 13:05:52 -1000 Message-Id: <20240301230619.661008-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240301230619.661008-1-richard.henderson@linaro.org> References: <20240301230619.661008-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 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);