From patchwork Sun Mar 9 19:37:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 871911 Delivered-To: patch@linaro.org Received: by 2002:a5d:64ce:0:b0:38f:210b:807b with SMTP id f14csp681431wri; Sun, 9 Mar 2025 12:38:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXMtzP+HPHEX8oRmV6XsUwawymyokqu+vjUpFOsP1d8hvO6RhB7PjJQnGRzBQMXMskdsc/o3Q==@linaro.org X-Google-Smtp-Source: AGHT+IHpgKscu64O85oIxmJDiJHlqGtFw1E0zVMEJY+pe13UuNsmk92KwAHEdlre77yEYkuj6UJ1 X-Received: by 2002:ad4:5bee:0:b0:6e8:9c30:237e with SMTP id 6a1803df08f44-6e900701463mr113971666d6.45.1741549086563; Sun, 09 Mar 2025 12:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741549086; cv=none; d=google.com; s=arc-20240605; b=HS8qW5hjvMIVc+Es6QrNTjG5A5YnfX+7cs8EXCCCTQIc4vKQIbac0ScCjE9h3ZjaCB WsRSEW8EPvAEgwXJFUihqCkGLJ7BMK6RPMvD/eHUBz2cStOvRB1bjo/yVxsurJXacSxo CVewmdpN/wr1VcM3il8wxe6C9oPIR3m7wS2k1rAJtd3G+AzpeIwASMh/ZJBTTp/9fI27 pWTIi4K1gDYfNnznDJ2hkaIkuxJKSNGAZOU5GXia2W2m/5T6fmX6h9uGDkeYMv+vCHdm 3eruce0N1owwKP9W2dDjDZDEMjxEcxb6vIuM3DNgT/E4dIuqey94csVgPA7J6O7PT3gP yEkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=MT3STjDQDcCpuKL/24twGSo6UOkr+VDdVFMMCjf6edc=; fh=aDWUXR3nugwhW4ABdhOQJ3/V9uAJcJSbdkYlN4TEt5I=; b=QoDuke1/6sJ+QmIDJKefBxQmNgkpJx5NkWI2kmgOtb6YCbBd2VdWZ6oXq9uQDYpQzg Tc6Uq+UKGYnCjCo69FGz8d2IAZoWpkiXecNtNpOnkq8zyN97wLsiRj1jepayAp2yVsRU hhYQPV8lnNUcQLoHsaRCNXcHidoX2EdiPJvCLTLU7Ru9Q2bsbvrHvARNUFqDmoEhhGZD W7c8ePqYoYT7pZi8DoiItP3BovyMnvT7am07nHHhjU+ruiHrJQNxoBGUlOxGwAtVORkx doASNHGB1ikyFsCB0d1s1IwVknFg2UCfgew333jJScG5ZPuiv2SanBqA382aSN8XPiWg Mz3w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yUJQVXzU; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e8f7094214si79321056d6.156.2025.03.09.12.38.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Mar 2025 12:38:06 -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=yUJQVXzU; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1trMSn-00012Z-1z; Sun, 09 Mar 2025 15:37:29 -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 1trMSk-00010u-Jq for qemu-devel@nongnu.org; Sun, 09 Mar 2025 15:37:27 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1trMSh-0006TE-Py for qemu-devel@nongnu.org; Sun, 09 Mar 2025 15:37:25 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-224191d92e4so56256635ad.3 for ; Sun, 09 Mar 2025 12:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741549042; x=1742153842; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MT3STjDQDcCpuKL/24twGSo6UOkr+VDdVFMMCjf6edc=; b=yUJQVXzUZtdj4RY1Ly8ovBtdu/Yh1JIcASCGLZJHXRkShnIfKtZVeO/bE7sTfWteKd vPn5NUuaCobUJwUo+R1YHmLnAMwvpbX4HAuhgwjAQTwElHef8aBT1SN0zq4J8wQYsVP8 RkNCqLJOwOsMt8tyypXTJfmDJPRJrZE0SnPfpFj+uy4COcSZXsBlJKj3K//bVNFq7t7D 1rCXr6WUWLKYak4AlTvdm2IbsIsTw4sCtAqSdx0dE4gzAEgEdX12fWAMpAt2SgEZEoXF OG/zVQytytOTb9Sbs2tQwVQz3g/Ke/qMzHKiRiy67TIT1TfDbjFrqk6j+fe7uJqRLi9/ 1ukA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741549042; x=1742153842; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MT3STjDQDcCpuKL/24twGSo6UOkr+VDdVFMMCjf6edc=; b=jeX3U6DLK1harTUgSbKyaH/Wh2sQXE5BkSiLuyhyy2sl9Gtl/NRSQFvEBA6MVJMRPl CnqMqd2iup58ZYvbrC8O9WJJ/mVSYGzE5b//g4D9EYfTQLjmR7K5J5hzneQ1IKoUJ9hg DQKC37S9wqj4M6tPKzfvmAKyE0eqxZSBgvwNDLGyzZTxo7ovMlUOtdX/di97cfD5Vpz4 BkMhKi/w5KDDe1W/l6DXCFVy3o11Lt1da9qUwTTs8/RYOw7+z51YS0qBn6cGAxJ52dQL /14DmwRU/xcDnqzCDNVWyGmMUQbPrpCXQ1Ek5QTEj2ppNSwWGXE/9VbbpLX8v/FbUX6X L1ug== X-Gm-Message-State: AOJu0YwP9B3rgPa1GD0zUj3giekKdwTL0bw+pNv2DJ0NAPD5r/LZZAOI WtpAw908egpAfwMXtPdcSvjsTpxO11oWsDlZU0Z7mEazRVBfdGZkdaq+loiC15EbVZq7PUay+bq j X-Gm-Gg: ASbGncu0OlsZGzuPcLY1fdCc2jhDFpbPt/xMxI9uJneboAu9+OWrXihKrHCXDrWjt74 khaBzHq6jxOF4cqHJiBFpIQcwBY/qDn+qhmggwU6ZGhiW2K9w3zqNXb6UeoV+tVB7sB+p6s/rFC f05rVtrSLbuTk/S6QD/46Nu0AgLYJ9A4pLNgG022yrcR8NoNV+H80Ars8tBPqaZn+Cck8+zwAp1 Di7TW4q+3U/0bhaTODYqDfKVltgg8K+5RS/sF162v8aJB8sDWGt1nOL6UNA1po47XUp9KBVCzfL WlNn1C3q+qyal4rz7jjYGaXFHKt27mZPXnyhYQSpMmJa X-Received: by 2002:a05:6a21:6f07:b0:1f5:79c4:5da2 with SMTP id adf61e73a8af0-1f579c473bdmr2368337637.31.1741549041722; Sun, 09 Mar 2025 12:37:21 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-af281093136sm6278945a12.18.2025.03.09.12.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Mar 2025 12:37:21 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Hildenbrand , Peter Xu , Pierrick Bouvier Subject: [PATCH] system: initialize target_page_bits as soon as possible Date: Sun, 9 Mar 2025 12:37:12 -0700 Message-Id: <20250309193712.1405766-1-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x634.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 Allow device init functions to use it, which can be convenient in some cases (like hw/hyperv/hyperv.c). Signed-off-by: Pierrick Bouvier --- system/physmem.c | 1 - system/vl.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/system/physmem.c b/system/physmem.c index 8df9f30a0bb..c5fb784a9e1 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3281,7 +3281,6 @@ void cpu_exec_init_all(void) * do this much later, rather than requiring board models to state * up front what their requirements are. */ - finalize_target_page_bits(); io_mem_init(); memory_map_init(); } diff --git a/system/vl.c b/system/vl.c index ec93988a03a..c64f8c8e808 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2848,6 +2848,9 @@ void qemu_init(int argc, char **argv) bool userconfig = true; FILE *vmstate_dump_file = NULL; + /* Set target page info before creating machine and associated devices */ + finalize_target_page_bits(); + qemu_add_opts(&qemu_drive_opts); qemu_add_drive_opts(&qemu_legacy_drive_opts); qemu_add_drive_opts(&qemu_common_drive_opts);