From nobody Sun Apr 12 05:51:25 2026 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=1771007284; cv=none; d=zohomail.com; s=zohoarc; b=emQSW73x41SR0DKf+w7jU2VBULP3hRyx3k+RC+0zJQ6Zg3H6Qdo4P/YbSAkOJYEthYwXwYTdoRz4tw8tZsJN5T3IRxe81uzH82jfZcUiV8A2uKpTr843GJiBOrLXS4BrYE/O7Ge5qYENw3q1QiA+yiAPAuXj+MTe5YbDTp/qKmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771007284; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=77qp8FLiJwBN5TF68fSF77CWuEI2EM/pcGaKg31STP8=; b=SpR/3HUwt7DDgOCQBppalRuz1nVnDCLLRhY8vElqV8YyUSyPNOUd+/rfMWXUzZaXzHnRwY35Dwi8hibsRUaTRt0lEeI8jBjrtahjkUxOCw7fccP3bJ1ionzGovAWC1xmpfcFrv/ynaX4qbwyNHVqXRq8BCtP/ZdB+mraY5ZRK2c= 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 1771007284348229.00495426163843; Fri, 13 Feb 2026 10:28:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqxt6-0007Cs-4h; Fri, 13 Feb 2026 13:27:33 -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 1vqxt2-0007Ca-5v for qemu-devel@nongnu.org; Fri, 13 Feb 2026 13:27:28 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vqxt0-00061w-Az for qemu-devel@nongnu.org; Fri, 13 Feb 2026 13:27:27 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-48069a48629so11263565e9.0 for ; Fri, 13 Feb 2026 10:27:24 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48370a53c51sm22991145e9.6.2026.02.13.10.27.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Feb 2026 10:27:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771007242; x=1771612042; 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=77qp8FLiJwBN5TF68fSF77CWuEI2EM/pcGaKg31STP8=; b=S/xx7x+E4deaRLuPLQINzTCP7nez7THKOohO1EgwTyA3MA+o90AWZo6qeIODT6zh6n u2roywvLV53JD56qUhbDJR4/vXK1kuRkIET2pY2J+Vn5Elm3Gwsmby4TUBi5GMyh61F1 ZQNWLEHv2wMoOAam4qVrfnn7ZGU1veVUILJRC+xH5g3E1UsCFbTJKmFJ0rsMJSNG0BFY +Yyj/Ka8O/Awrj4rMUrehvw8s5v6P4Fw7re74pn/207Q1I+We1G39nxgrOAlbiX2giFM UymGeNJwf5LOk3NVq8KScAcmRD5d/fr1YSQeP4zaZne7tHXKAgOAlqSb/YV2MJZRUjnZ qvzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771007242; x=1771612042; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=77qp8FLiJwBN5TF68fSF77CWuEI2EM/pcGaKg31STP8=; b=AlJTP2VvBIgF/vwcYo3j+uo2fpkAUBl/MOW8nWWYre2/4K9FBxwzB7S1raY/Nm/ibo Zfpj8ZYeWYi/D8ZF9niYPDtVj66BUl5+7E3pqihiDfwm9yKCTTa6dPjzfzHBJi3RpGa2 Jh2Gm8lGOxcIbM9xqZDyhumHalxqEhQlI0rfCWvZwed64vZzKdhabSiF8fVjG2a/uZ5k l/hOKQcDZsjhw3mCRp2kAlXhuoQpSC1H6YrFJlLKjM2wCikQOHF1bLoFefUkYd0b0thx phccRF8VaOp4KU9WhknvKZ5sxLgWbUncbx3iDkI/IlQF7O93FbHwZJhCp2P8H8y8TxXM zQ6A== X-Gm-Message-State: AOJu0YxXAFvtODTlTGBRVnxf8/RvuwLZA8fF6aD7/na+Kca5hmEsmqs5 JQCTZTf+/yqYSTwO5UaHzkDJ3tOW1pdNaL/sYIQioBoKgM4+Zuy79P/+LoDcYOxGhJrfaWR7peH QIRXNBvQ= X-Gm-Gg: AZuq6aL0qBf4ZET1J8ANOujWb9IsSCYXb6D96XyFwTTAZe0ifVgCw95T/keHa6jKEKv XqT24P1bmPpvma2a83CHTh2b3YjCQ1owFzpQ1YIRYk4kgjDsQKSw5KRPCb9VUIQnTtn+GB7/jfJ yivjWBb6FMzdjQ/nY4YyL9zQlBHd43/PCWhscCt11E7nn70f21cGg59bXhBsw9K7Vtvf6M1hji6 Ls405khqotTH0YWG3cJ0tuFoTjLYhjTB4oxquqeOgVySdKCibvl5FGbh5lNBEJInOeAqnd8N9GO 9Q29FFa7rU0zLz2WNYPj1CeeAPf/bhm2fsUJmaNNizBxs5kSR/NQRri+4wyN3f1wBD25AtSmRae MRMYmwNUnUTb8tlAOLaaAN3xhuiV6GsKtMvJmuC1IS0RJmOET8t84o4IEpIMazO2+5PmOxkQldI VE1AFQbkEN1y0OY0FWr5L1GpAQgvxqJ2YXMghits5Y7KR1dDx2KPIGP/JCY9yrG5BGHjGAMVs3 X-Received: by 2002:a05:600c:6808:b0:483:2c98:4368 with SMTP id 5b1f17b1804b1-48373a3e755mr46236355e9.18.1771007242394; Fri, 13 Feb 2026 10:27:22 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH 1/5] qemu/target_info: Add target_page_bits_vary() helper Date: Fri, 13 Feb 2026 19:27:09 +0100 Message-ID: <20260213182713.44924-2-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260213182713.44924-1-philmd@linaro.org> References: <20260213182713.44924-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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: qemu development 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: 1771007289665154100 Add a helper returning whether a target support variable page sizes (only ARM targets so far). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/qemu/target-info-impl.h | 2 ++ include/qemu/target-info.h | 7 +++++++ configs/targets/aarch64-softmmu.c | 1 + configs/targets/arm-softmmu.c | 1 + target-info-stub.c | 5 +++++ target-info.c | 5 +++++ 6 files changed, 21 insertions(+) diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-imp= l.h index e446585bf53..537aad04fa8 100644 --- a/include/qemu/target-info-impl.h +++ b/include/qemu/target-info-impl.h @@ -19,6 +19,8 @@ typedef struct TargetInfo { SysEmuTarget target_arch; /* runtime equivalent of TARGET_LONG_BITS definition */ unsigned long_bits; + /* runtime equivalent of TARGET_PAGE_BITS_VARY definition */ + bool page_bits_vary; /* runtime equivalent of CPU_RESOLVING_TYPE definition */ const char *cpu_type; /* QOM typename machines for this binary must implement */ diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index e3287334304..0d2269e0401 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -23,6 +23,13 @@ const char *target_name(void); */ unsigned target_long_bits(void); =20 +/** + * target_page_bits_vary: + * + * Returns: whether the target support variable page sizes + */ +bool target_page_bits_vary(void); + /** * target_machine_typename: * diff --git a/configs/targets/aarch64-softmmu.c b/configs/targets/aarch64-so= ftmmu.c index 4e1e2f64da1..f9fb73a41c6 100644 --- a/configs/targets/aarch64-softmmu.c +++ b/configs/targets/aarch64-softmmu.c @@ -15,6 +15,7 @@ static const TargetInfo target_info_aarch64_system =3D { .target_name =3D "aarch64", .target_arch =3D SYS_EMU_TARGET_AARCH64, .long_bits =3D 64, + .page_bits_vary =3D true, .cpu_type =3D TYPE_ARM_CPU, .machine_typename =3D TYPE_TARGET_AARCH64_MACHINE, .endianness =3D ENDIAN_MODE_LITTLE, diff --git a/configs/targets/arm-softmmu.c b/configs/targets/arm-softmmu.c index 9b3fdd2854a..a3bca3c9f0d 100644 --- a/configs/targets/arm-softmmu.c +++ b/configs/targets/arm-softmmu.c @@ -15,6 +15,7 @@ static const TargetInfo target_info_arm_system =3D { .target_name =3D "arm", .target_arch =3D SYS_EMU_TARGET_ARM, .long_bits =3D 32, + .page_bits_vary =3D true, .cpu_type =3D TYPE_ARM_CPU, .machine_typename =3D TYPE_TARGET_ARM_MACHINE, .endianness =3D ENDIAN_MODE_LITTLE, diff --git a/target-info-stub.c b/target-info-stub.c index 65220cc7820..a6a080295f0 100644 --- a/target-info-stub.c +++ b/target-info-stub.c @@ -20,6 +20,11 @@ static const TargetInfo target_info_stub =3D { .target_name =3D TARGET_NAME, .target_arch =3D glue(SYS_EMU_TARGET_, TARGET_ARCH), .long_bits =3D TARGET_LONG_BITS, +#ifdef TARGET_PAGE_BITS_VARY + .page_bits_vary =3D true, +#else + .page_bits_vary =3D false, +#endif .cpu_type =3D CPU_RESOLVING_TYPE, .machine_typename =3D TYPE_MACHINE, .endianness =3D TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITT= LE, diff --git a/target-info.c b/target-info.c index a26532f660f..06bf329de72 100644 --- a/target-info.c +++ b/target-info.c @@ -22,6 +22,11 @@ unsigned target_long_bits(void) return target_info()->long_bits; } =20 +bool target_page_bits_vary(void) +{ + return target_info()->page_bits_vary; +} + SysEmuTarget target_arch(void) { return target_info()->target_arch; --=20 2.52.0 From nobody Sun Apr 12 05:51:25 2026 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=1771007319; cv=none; d=zohomail.com; s=zohoarc; b=MpxzVOyuOB2xCMt3cn6RlKVFhR0BIyhDiL3Y2E6VGAHjIKaTf2xChWif4/2BjfrY8zA2/YFPsbw+1Ix/U41oykPAgzr6oWQeJ6BFXlyT6HeICoaSwxikUZarADAvqc1q+KIv7eldHiRLNgLuHm+1OeYz6O3uBAr0EoIbHEBDTEE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771007319; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=wRcTQI36rdFbgS0RaM9tbsJGf2KLXWBx5voTCVv7K6s=; b=lUc/xquupFe9QZmDRPjSfoyxn0SRWR46Fx0QEkSLJTa1jyWN4mxRj7ka/a9QvLnq+KFlm6oDzXI5C1/ETsEMoZh7dNCqNWnDAk0MFkg/pLPMJr5JZvxkKZ9THXozWwHTr9B8ccNkYavl8LeynjeqU8Gvtl0NZRKnQe6Lc9AH2rI= 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 1771007319911196.3642275908702; Fri, 13 Feb 2026 10:28:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqxtA-0007Dc-Ke; Fri, 13 Feb 2026 13:27:36 -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 1vqxt7-0007D4-A3 for qemu-devel@nongnu.org; Fri, 13 Feb 2026 13:27:34 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vqxt5-00062c-5w for qemu-devel@nongnu.org; Fri, 13 Feb 2026 13:27:33 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4806cc07ce7so11232315e9.1 for ; Fri, 13 Feb 2026 10:27:30 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796abc8b1sm7698227f8f.23.2026.02.13.10.27.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Feb 2026 10:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771007249; x=1771612049; 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=wRcTQI36rdFbgS0RaM9tbsJGf2KLXWBx5voTCVv7K6s=; b=fN6uYqHEXLWsguuplbm1YwYr7jiM6mnZWo1zzey4WS3E84oM3dxICbUvUnuGTDslxD MceZfDlKWm1fffyYcLl9WfapRw2aXi57bhzlRy72oXSWu/UV3MCLs6dS19Qs425D/xl3 mAzCqY1SVZHSEAmn6pVXtc2jUBuGxAc/2Hc+Jj0ccV3ZLCheN1XmyOQGB3kkMY/Zy+uk ZQfXL7Wc2HHebRhgRRY6oZtXzFl5T3VBluvMyhHj9hIA94tQxP5L/3zT29ntSQcaoIke 7fAKdnDrLAeqQWHzjFptTfQyRZsO2Maz5Gihci/O6XBkopGbFDQxLT9UnwR1sOrvGjuV vQSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771007249; x=1771612049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wRcTQI36rdFbgS0RaM9tbsJGf2KLXWBx5voTCVv7K6s=; b=Y16XzmdOjszNm4kJUlQNErEzvOnFDgRvgajPV+IhQ78kJeAPeBkdQKXnsgCKDbPp5C Z6LK0FsEilxRM3VCUL9QY8ATZ6c/By1QQKqHFPCfmK4D7C/SJMyrSVGXU5ql9SD2BChO kXfrV+vNEpH/Gltm+CMtsqsq83gtgk9wNFdp6FUojH78zurNocRFoZpcR1Ego5uwl2nN agDzrUS7M21eyENYQz+3QKah8hERw1Qin/Y+3pm6ey/Vd/ZE10C7+lDGBxCrEMeV23K4 B79FUXvz3kHCk6S4H8TN4zwE+8D/dDKr7xHElJWVm2riKNXiqIT9vpNk8myIdS0bAK7S LZoA== X-Gm-Message-State: AOJu0YzRLVts8p+dm0MEyXF5EEZuQS2G5RlMpRxnW19OYGZht31RXazt qJGh3X/gjC4BpJK/o/WVsouGhmAwnZD8/coYB5owknf3VaVYMk9JOY2Xcy0X+sFKqQT4uRT/9B8 svb6I01s= X-Gm-Gg: AZuq6aKOJtcO3KQG1K5OTWy3Plwf35oUmTp1mLUk5clllLKVO/hQFrLoAH9tgvW/8r5 hMfI8DpUGtUQjDlYkQiRo2721a5Od4BehfWkeZWf+3vjxkFZPg48CeRdzCS2CTcuzQaVj+vFZYI I+vQs4xj8QtwVjE/o9OO6bLF8/vlWJXcNb0pbeH8Swa5f6MyNzrekCOusmfvXGqobB90DgDNsu6 ITh10QB8nBfPPHsQlMF2MatXX9Uhr6dU8EmduXG0TuPQ8ClIC1coljd8zD8aogpVqoNpTxLQKBm apaUzYSvxnhLrtq8YBezWpkUmiasMVL+RyWHauj9p/JL0kr14jUOqfdmWGrA9eKOyidzKhqZ6cq Loqefcpx9UbHjJ9jue2kc1FjxO/Kf7cwTKYHg2b7qZnLtb/3Y+ovwzq+zNdDi+V6rJ2Ae9fQfYk d+RpNTKHaai0FZnEA48IP8K6feQiB4Z4arZXbCaeASCGVAaXtGNcWjueNgbI0vVqHoPH3wbHyi X-Received: by 2002:a05:6000:1a8f:b0:435:a9c9:159 with SMTP id ffacd0b85a97d-437978d11d0mr4962786f8f.18.1771007249114; Fri, 13 Feb 2026 10:27:29 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH 2/5] page-vary: Expose TARGET_PAGE_BITS_MIN definition Date: Fri, 13 Feb 2026 19:27:10 +0100 Message-ID: <20260213182713.44924-3-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260213182713.44924-1-philmd@linaro.org> References: <20260213182713.44924-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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: qemu development 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: 1771007321656158500 We'll use TARGET_PAGE_BITS_MIN in page-vary-common.c, so expose it via "exec/page-vary.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/exec/page-vary.h | 14 ++++++++++++++ page-vary-target.c | 15 --------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/include/exec/page-vary.h b/include/exec/page-vary.h index 101c25911c1..3c77689ca52 100644 --- a/include/exec/page-vary.h +++ b/include/exec/page-vary.h @@ -20,6 +20,20 @@ #ifndef EXEC_PAGE_VARY_H #define EXEC_PAGE_VARY_H =20 +/* + * For system mode, the minimum comes from the number of bits + * required for maximum alignment (6) and the number of bits + * required for TLB_FLAGS_MASK (3). + * + * For user mode, TARGET_PAGE_BITS_VARY is a hack to allow the target + * page size to match the host page size. Mostly, this reduces the + * ordinary target page size to run on a host with 4KiB pages (i.e. x86). + * There is no true minimum required by the implementation, but keep the + * same minimum as for system mode for sanity. + * See linux-user/mmap.c, mmap_h_lt_g and mmap_h_gt_g. + */ +#define TARGET_PAGE_BITS_MIN 9 + typedef struct { bool decided; int bits; diff --git a/page-vary-target.c b/page-vary-target.c index 49a32b4fe51..ab92da4539d 100644 --- a/page-vary-target.c +++ b/page-vary-target.c @@ -23,21 +23,6 @@ #include "exec/page-vary.h" #include "exec/target_page.h" =20 - -/* - * For system mode, the minimum comes from the number of bits - * required for maximum alignment (6) and the number of bits - * required for TLB_FLAGS_MASK (3). - * - * For user mode, TARGET_PAGE_BITS_VARY is a hack to allow the target - * page size to match the host page size. Mostly, this reduces the - * ordinary target page size to run on a host with 4KiB pages (i.e. x86). - * There is no true minimum required by the implementation, but keep the - * same minimum as for system mode for sanity. - * See linux-user/mmap.c, mmap_h_lt_g and mmap_h_gt_g. - */ -#define TARGET_PAGE_BITS_MIN 9 - #ifndef TARGET_PAGE_BITS_VARY QEMU_BUILD_BUG_ON(TARGET_PAGE_BITS < TARGET_PAGE_BITS_MIN); #endif --=20 2.52.0 From nobody Sun Apr 12 05:51:25 2026 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=1771007292; cv=none; d=zohomail.com; s=zohoarc; b=Wc+kgntkUHsC8VlMpnh0yjnZEHYAscTB4c0BS4sMLsnKeWMghOrLjdVFkrY1tAAT6pfvGblmKPe8apd+CdEJxL04xCm1NJ+TnqTOYyKeW18AY4z5BL4SXUGJn/A6ScGOwloIDLhDSvnNuQ0blEwlT7pPFZy8hW2zBoK0XQiSR8k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771007292; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=yI+Mv4GQHxCw9O8vk7u+Ssd80Cd3/VBhYa0FvH/zNGU=; b=LF3ajbfXFToo4jwYvsISlP2Aql7u6mWpux30nFyUstom8c6ttnZJeqPI4JVNrMVoa164FufSJDhM06ZNEyg/SjgSJ7KTQ2HJ0XTKebnvUgsAkycG5KciGl5rekZpjFXrZopCIv+WwP788PRZ6WkZxONwkS2pHDjd/JWxKGx3RXU= 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 1771007292165784.8313470017836; Fri, 13 Feb 2026 10:28:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqxtF-0007EZ-2a; Fri, 13 Feb 2026 13:27:41 -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 1vqxtD-0007ED-Fs for qemu-devel@nongnu.org; Fri, 13 Feb 2026 13:27:39 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vqxtC-000639-2L for qemu-devel@nongnu.org; Fri, 13 Feb 2026 13:27:39 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-435f177a8f7so1323653f8f.1 for ; Fri, 13 Feb 2026 10:27:37 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796abcda5sm8359465f8f.19.2026.02.13.10.27.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Feb 2026 10:27:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771007256; x=1771612056; 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=yI+Mv4GQHxCw9O8vk7u+Ssd80Cd3/VBhYa0FvH/zNGU=; b=DkVWbNoR2qdjQktYZ3+uNLZEES0fSgDldV0n1oyyGm6yi8Y+zgFghVCm6xe8u4P7pd h0EahOe0W6t3sMjgsc42LjadCFQpjdhZud3K05pm8XpIoXJ0JxENln7l3VnxVVO6quvg Foy8O+KvhhpPymGyIUq7pZdtPSZjBF/lrnbxcaWgh/XvRtyI9OZu+odHiPlSTd2jnJu2 1WgtAMMK8ZOx9zBT/cEvi3RhoBXtE1FhOavIqliGWUIh90aeUU4n7xJeixPuklwUe6Ou NUS8I6VpgvdGR0HJssOoog7icu7+ic++4NTQwcyOYXswTgfQ9gGUoFDqGIIxURgdAW/A Z7gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771007256; x=1771612056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=yI+Mv4GQHxCw9O8vk7u+Ssd80Cd3/VBhYa0FvH/zNGU=; b=Z3qcX4ThauLhDf1rlX+xmcm5M2tsQ4f5zxd1i4CwyKhGhc5ieeH+DTs2dxJHo9RAK6 ZFW94iTVV9FsQYOoFCYlA9S8Kjqq2YGQ8zz9HIZQ8nrWj+GiX6nCFSeA+d3gBp7AZtQV ZjOMMNEjc+40rR/bFnasUmQUCV8OI2k3Ev7yJMq+Fpeu+1vWEZtusHoV2z0w2mwoBIwc kW3ULGYXcW2wagd5ztUtgZRcLBgwC3LJB6GCXxmwju+LallKJ8ecNV56ZpCce+g/I51I e0DjWWxKmnHdf89i6R4G0W+KUr5gCzW1lkNYjhunvZT9tUTcapPtfCdt5S1EI/KfsloE 3BlA== X-Gm-Message-State: AOJu0YwNS7KLe1vXYC5ebYwdWCLZKFxQ/mBdBcoTr7o4PA6qKnd7dDaV zc0pBkDhH+CHD6u/8EdPBFNmwFoF0Sj2w6gUKIbWuWQoiVrfi71KE5RuB/8RKo0B/daujwJZHYf 4laltVzc= X-Gm-Gg: AZuq6aKSTLsKUnG4OXxlLs+rLKzxNZknIVpCgvd9RLpFq6ROZXFzRJqYrft4OlP8akf Mn9TY0P59/OaVuTUSO13s9TJBYcVurkqjhLmAEmhRYJEuuya5XFp9XZTcNx4BxxxtyWcpdJCRw+ jkQ7qLpwaOpdlT4NPYnI1QzRtDrPmywpm95J/j8uG01NT5xM4DLuTSq1AR++4ywVXDRxVYu7d+G 2Sy1hBAXywmqpF2+EYZ/dPhRHId+OMd8pxBpZbvYDaYobV/vGt94QZQflULjDx5WpSY5IxGko3M gL3Hl4NVpr2Pn37UntPKwGXz0uz2wQ0PIPdhkhtw10rNeEKI5cCbqgcHd60ro+t+T+vPxJBPzQ0 VcqQwMyoxIftZ0+M2YffHw9JNqLNBEmBEhdbPql1Au6vXsiB2edWlEh3O9VXS8mcmJ9C+vZvF8X rfeNN3/goHDguURX08ZDFJitcOgkoQPQDgyfBhBmF7B4bkt+iRKGd2yTqxm8lmp871tdaDIaJG X-Received: by 2002:a05:6000:2406:b0:435:b776:304c with SMTP id ffacd0b85a97d-4379db9349dmr763757f8f.30.1771007255943; Fri, 13 Feb 2026 10:27:35 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH 3/5] page-vary: Use target_page_bits_vary in set_preferred_target_page_bits Date: Fri, 13 Feb 2026 19:27:11 +0100 Message-ID: <20260213182713.44924-4-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260213182713.44924-1-philmd@linaro.org> References: <20260213182713.44924-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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: qemu development 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: 1771007293718158500 Rather checking whether the target uses variable page sizes at runtime calling target_page_bits_vary(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- page-vary-target.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/page-vary-target.c b/page-vary-target.c index ab92da4539d..5fb79eb5752 100644 --- a/page-vary-target.c +++ b/page-vary-target.c @@ -20,6 +20,7 @@ #define IN_PAGE_VARY 1 =20 #include "qemu/osdep.h" +#include "qemu/target-info.h" #include "exec/page-vary.h" #include "exec/target_page.h" =20 @@ -46,11 +47,10 @@ int migration_legacy_page_bits(void) bool set_preferred_target_page_bits(int bits) { assert(bits >=3D TARGET_PAGE_BITS_MIN); -#ifdef TARGET_PAGE_BITS_VARY - return set_preferred_target_page_bits_common(bits); -#else + if (target_page_bits_vary()) { + return set_preferred_target_page_bits_common(bits); + } return true; -#endif } =20 void finalize_target_page_bits(void) --=20 2.52.0 From nobody Sun Apr 12 05:51:25 2026 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=1771007292; cv=none; d=zohomail.com; s=zohoarc; b=CSN1dphLEFfY5EwyjbJH3snTXi/jWEOke7Nx7jPp+qt9B0yeO+pV0kBI8dZYyyIEEQ3ETZzhH9JXcEC+t4jMN2zHBXJZo4F1+W4QwSZUySf93END3XK5vNAa2C+jrUhGHIwlon05S6AZ3QsuWgWgdRd4yR6Lrafh8rlSiPd8qDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771007292; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=H/K35hnw1YfjsQjH2gQ+ALFmPtNIwNBwDPgyu0NG3wY=; b=BEhUTbFS6qmQ+m2m/j35RIyCTPOfeRhL0bCmk4kW8ZmDFsJ2ZhKVtJ3DHkg7ysxI6sGruA+j5cx3D5/7myHKFtcda5VyRQA/3TFHKB8+vMtNAJ+FTpgyrVTu5LBujHllE2WSuzdlbmD6S711sFchR4Aqj90i1pEDv8wcB4qgOBY= 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 1771007292701292.73869302257094; Fri, 13 Feb 2026 10:28:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqxtL-0007F5-4I; Fri, 13 Feb 2026 13:27:47 -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 1vqxtK-0007Ew-9O for qemu-devel@nongnu.org; Fri, 13 Feb 2026 13:27:46 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vqxtI-00063r-PG for qemu-devel@nongnu.org; Fri, 13 Feb 2026 13:27:46 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4806ce0f97bso9620175e9.0 for ; Fri, 13 Feb 2026 10:27:44 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4834d82a1c2sm410793915e9.9.2026.02.13.10.27.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Feb 2026 10:27:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771007263; x=1771612063; 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=H/K35hnw1YfjsQjH2gQ+ALFmPtNIwNBwDPgyu0NG3wY=; b=Mqv73W2lKeDtge7vVlWQ1uCtghmZbsMSdjoos0uGrriRS6b0SUzQKnvXUfzoztGBx7 MH8sUNn6vGLD6D95YMEmbeO97n6pMi2BdpoHUc3JqRDFECuznSnVRRK2QwP/ZciQkozK 6DfVk7znhU/iIU6pCLrvQqcxYkCp4zub8QM4adU9qpod3Xlv3vY7eTpylUds91+i2R0B Gvbhx3VA4mzlSv6UUEHlwjeBMw6I4GuPaieYtkVQkENtIJaAknprLb8mM40yzCl2cf9f ipwQcde8BaaAFLzCC9aVQR4PWOYZKFcBmM3AUC4QjafsZInLpR+zcjRkgNi5kC3RGkJt wqLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771007263; x=1771612063; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=H/K35hnw1YfjsQjH2gQ+ALFmPtNIwNBwDPgyu0NG3wY=; b=eZgWxo3sVFh7BjV5OTRtdR8RjKF/Tgp271vZ4eDlG2AGpKCHqLL8uBn1OKISmuqdTc aELQMBN0liyCtJEKhGmZhTV+h9laWT609xSJie3iSLUSQtvuvIshitxl2IiN8cKmNCHk IksZ2sn3CleO+nDJbhySWpzuo7JN6AIa6RCx5EUeGo2D/zz+I/WgNFKHgVORJAflkh/k fuhUGKUtcmOkubJ6MKjeVCCwYjLix5+4M0F4xOuhkqifkYZvrOSN9OuowEx7QXWpZNnR afqMdf0ss/lP1uXtyoKEb3AihnF4V+JopJ5qdvMeseU0uhNZgnM+MjMHzHIpuPxJCuuN uhnw== X-Gm-Message-State: AOJu0YwEXxmUC0gHDU7rjEZ0ngV01aQql5f/3CVX97oObvPMLrSdlhAI wZ4Ew47+3lmz+sivd9OS3+c9Qai4rYC6a5H+N+8KlSnJWkS8ol3hHUkd12zzlLKX+ZsQ5ZWLrf7 M1qO2K1Y= X-Gm-Gg: AZuq6aKb9lWCC22eKWH45sWJgmKPUVfQApbZjHn6caHHMsXEpVTTvM+J6ZbLoV+JbV7 jl/4O7lEyxvY4ymyCUXEdb8DZLwHvmqOhFRaSxe0L3Aui4o/op8KuQfKeppM5spq6Wq3gct4Zu0 4rbLFf6Kk9WplB2vFxaXrry4Oc6h1FsZL3/+BoYhabFY+x7VBIOLKy1+3PWJfmRrtjkfGT0adKx rSZrSxIgWS7rMVJQv5sRkkJbu7VFXdIUcOCv5y1Zfexw0tZFRq9vFwgLltmVSk9qRrQl4CgimKJ K7xvGwSNBJabL4ib/Kik4vS03/Ga/cxROXtyNRM1mnts2UA7QUaQq6L7c1nT3AlHFq0gNwu421Q 0sfiqAejURmKySsQCMnZ4wB6uNh7blWLY9WdcrWnoXRUD8Emvo2xO9ln3r0N9JEjLWr255jxDMV z85qeyTjOg/O3gjIHzmT7/yH4rhTVN9wMt2A9EiIEUokqzkKVvlvoVwRIg5lrY5gLLVbxQ6fwG X-Received: by 2002:a05:600c:1907:b0:479:3a86:dc1c with SMTP id 5b1f17b1804b1-48373a7a0eamr46674505e9.36.1771007262793; Fri, 13 Feb 2026 10:27:42 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH 4/5] page-vary: Build set_preferred_target_page_bits() as common code Date: Fri, 13 Feb 2026 19:27:12 +0100 Message-ID: <20260213182713.44924-5-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260213182713.44924-1-philmd@linaro.org> References: <20260213182713.44924-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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: qemu development 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: 1771007295897154100 set_preferred_target_page_bits() doesn't have any target specific restriction anymore; move it to the common counterpart. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- page-vary-common.c | 10 ++++++++++ page-vary-target.c | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/page-vary-common.c b/page-vary-common.c index ab77672dd41..a2417354cc5 100644 --- a/page-vary-common.c +++ b/page-vary-common.c @@ -20,6 +20,7 @@ #define IN_PAGE_VARY 1 =20 #include "qemu/osdep.h" +#include "qemu/target-info.h" #include "exec/page-vary.h" =20 /* WARNING: This file must *not* be complied with -flto. */ @@ -43,6 +44,15 @@ bool set_preferred_target_page_bits_common(int bits) return true; } =20 +bool set_preferred_target_page_bits(int bits) +{ + assert(bits >=3D TARGET_PAGE_BITS_MIN); + if (target_page_bits_vary()) { + return set_preferred_target_page_bits_common(bits); + } + return true; +} + void finalize_target_page_bits_common(int min) { if (target_page.bits =3D=3D 0) { diff --git a/page-vary-target.c b/page-vary-target.c index 5fb79eb5752..a81c91410b3 100644 --- a/page-vary-target.c +++ b/page-vary-target.c @@ -20,7 +20,6 @@ #define IN_PAGE_VARY 1 =20 #include "qemu/osdep.h" -#include "qemu/target-info.h" #include "exec/page-vary.h" #include "exec/target_page.h" =20 @@ -44,15 +43,6 @@ int migration_legacy_page_bits(void) } #endif =20 -bool set_preferred_target_page_bits(int bits) -{ - assert(bits >=3D TARGET_PAGE_BITS_MIN); - if (target_page_bits_vary()) { - return set_preferred_target_page_bits_common(bits); - } - return true; -} - void finalize_target_page_bits(void) { #ifndef TARGET_PAGE_BITS_VARY --=20 2.52.0 From nobody Sun Apr 12 05:51:25 2026 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=1771007296; cv=none; d=zohomail.com; s=zohoarc; b=J7WfcZb/1CBQ1qJbb8OYYEFJQVph0BY+XvYbO+TBqbboj9NUdeYbp40qvbRCteCXRP3ikvLc79HWWwVsqHWFP3H7Mtv2QTUcMY++byDdm5ElWkpUNtgKEI4VJrNXcQa87MZ/3Qb0qQB1Rt03e1J9roke3EToKirl8lNndA2tdS8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771007296; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=tsrTVhXyENyB3MoHInBSDRjS9vH5n3zQs9EUXUebqfk=; b=LFOHdXpTNAcb1X+FSJZe4Zwawk/CjeM/W7onWjzZ6Kk2qbQG7h/ToTWmyofQFBBi90/OHEvuZ9zamAkHgoHWbSCEsTLLYtXT6KB5e9UoFg8g0uXhewjnvPJ6t2crtPuEQ6B3lVaHxKzftyX5VM8zVBrPC1HKgASGbEAxb+lXYJk= 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 1771007296848111.04718668106102; Fri, 13 Feb 2026 10:28:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqxtT-0007Ff-8R; Fri, 13 Feb 2026 13:27:55 -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 1vqxtR-0007FW-AW for qemu-devel@nongnu.org; Fri, 13 Feb 2026 13:27:53 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vqxtP-00064C-S0 for qemu-devel@nongnu.org; Fri, 13 Feb 2026 13:27:53 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-436356740e6so1360269f8f.2 for ; Fri, 13 Feb 2026 10:27:51 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796a5acaasm7209327f8f.6.2026.02.13.10.27.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Feb 2026 10:27:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771007270; x=1771612070; 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=tsrTVhXyENyB3MoHInBSDRjS9vH5n3zQs9EUXUebqfk=; b=Su6PigSqiklNvdXEVIJNGJzbQfENSIfsoQeKi3RdqxklON0tvJwCnDf+RIWHCD/hbn XTz0VMiv8FKgVcVlJVPchd771am08D4Z8XRihOC3ZZP50VzGDYGKO63PuDqOko8acI6P qwTHcTvj6d7T/ZrBU9k+dYgB3rabdz8f6L1vgfC6HwJ2njuat8oD6D52h7BYxmSAI54l 4iQWswQT7sMNV7Gd/g6Ue0l8RidUgyGW/SbPFpfoK0DOvOjokF8GOL1YTRxqrLPTAyTu czaPJYHc+vqqonlgFlrDAl9BQIsYIjOTz2Kzk21OBuKYKuRKRDVF6s0TwbHMbsPlmw9H d+Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771007270; x=1771612070; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tsrTVhXyENyB3MoHInBSDRjS9vH5n3zQs9EUXUebqfk=; b=NwhLX40US2kGzFiM2ZsdHUB4nABIICX2dOwsL+7UVduR5Wff1dtDHnRbbv1BI9bFmm VsI31ShHG92ZuQAp92zxyufgrySbomIxGhHA6GM+uAx3xdTcP2uVCk8hgTdZVJG7W+N/ fp/Fb0kFJ40c3Lih3nYRNfpBCGa50TvYjqFZW+2DCXtKx5Lk8ZDsKOqa0wPbtQwS3o+Z jZCYesnPzUVQs/URfUc8CyKIu4QwLQtB6d/bjZh+2H6zvEdvQJBQvOtzadQbWCcu0iwk o2F9FfQDjjm3/kxkAUaJJmeZMnLyQ7l2gzDY07413q7x+kAbQ+UfbBKAlWvkNr9NqQ8T +dig== X-Gm-Message-State: AOJu0YyqMFzJQYqhsWUw6t5DRAtABTBxtnZOMZMrpfKvMKV+W7YAbT9S Lld3yPMnbAYlGWn++PgrLMhhuHApHxrHjwNXCc8TpL1/0eLA34rrravVf4xS8/qd2KIBxFOb3Lf uJys0eok= X-Gm-Gg: AZuq6aKb/v/VxdYr3Hip1shse1WIWbfv6tDfCkxRUpzqnp3/wotWTMfkyOKd151ZXME gtv778CmgYLhswaCQn8Axolcf5YCRURHLqLkMJaFHFIwPjxmsOJSqmS17NvVMITdIrv1e6tkEMs Dn2DD1GxYzvJkRB60L6a/DpSfgwg9clTpUtqZ0I/ldjFFhIpm7QCEk9Hzu5tHH+VhIykhCMVd7z c/abbAkybuYCumsNIIhgdvEAQvzB4/GmjIEGUmKB/ARqEt7rfbRoCI5fhjo+r1Dr0pSpUYhU9FF T7LJ0Q4vXGrXJh9h5mogvgqm0LHPmxRL+hSA4E5UsryT4az/TJMC8WqGO4mV6Hmlxv3x2w06CZ3 w7BzJKCPWacXhpHLNWYYGLOQ4UY6WhJUx8ZzuN/fsiaIzyttzEqBYMEHbYMezzPIfgX7NjNetmr wmbMndtKkaMOFbOHkvU4tlkyHmknBDf6hvlKe/+LbOLJPOUNtZ3/YxoBeSaU0L7LsemlLmsFAu X-Received: by 2002:a05:6000:2203:b0:436:173c:b8e3 with SMTP id ffacd0b85a97d-4379db93b3amr793442f8f.29.1771007270053; Fri, 13 Feb 2026 10:27:50 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH 5/5] page-vary: Inline set_preferred_target_page_bits_common() Date: Fri, 13 Feb 2026 19:27:13 +0100 Message-ID: <20260213182713.44924-6-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260213182713.44924-1-philmd@linaro.org> References: <20260213182713.44924-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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: qemu development 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: 1771007297927154100 set_preferred_target_page_bits_common() is only used once in set_preferred_target_page_bits(): inline it there and remove its prototype. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/exec/page-vary.h | 1 - page-vary-common.c | 33 +++++++++++++++------------------ 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/include/exec/page-vary.h b/include/exec/page-vary.h index 3c77689ca52..c4dc56634bc 100644 --- a/include/exec/page-vary.h +++ b/include/exec/page-vary.h @@ -41,7 +41,6 @@ typedef struct { } TargetPageBits; =20 #ifdef IN_PAGE_VARY -bool set_preferred_target_page_bits_common(int bits); void finalize_target_page_bits_common(int min); #endif =20 diff --git a/page-vary-common.c b/page-vary-common.c index a2417354cc5..e2ccc7b0ead 100644 --- a/page-vary-common.c +++ b/page-vary-common.c @@ -27,29 +27,26 @@ =20 TargetPageBits target_page; =20 -bool set_preferred_target_page_bits_common(int bits) -{ - /* - * The target page size is the lowest common denominator for all - * the CPUs in the system, so we can only make it smaller, never - * larger. And we can't make it smaller once we've committed to - * a particular size. - */ - if (target_page.bits =3D=3D 0 || target_page.bits > bits) { - if (target_page.decided) { - return false; - } - target_page.bits =3D bits; - } - return true; -} - bool set_preferred_target_page_bits(int bits) { assert(bits >=3D TARGET_PAGE_BITS_MIN); + if (target_page_bits_vary()) { - return set_preferred_target_page_bits_common(bits); + /* + * The target page size is the lowest common denominator for all + * the CPUs in the system, so we can only make it smaller, never + * larger. And we can't make it smaller once we've committed to + * a particular size. + */ + if (target_page.bits =3D=3D 0 || target_page.bits > bits) { + if (target_page.decided) { + return false; + } + target_page.bits =3D bits; + } + return true; } + return true; } =20 --=20 2.52.0