From patchwork Wed May 24 09:37:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 685313 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp149830wrt; Wed, 24 May 2023 02:38:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4zb0x3IFJelVtdcZJCuxMsUhaeVQ577H6/10JbgtXfq+dUhmQ6qrfL1qtrVqeiPz4cxuIr X-Received: by 2002:a05:620a:1d67:b0:75b:23a1:d8c9 with SMTP id dm39-20020a05620a1d6700b0075b23a1d8c9mr7779823qkb.13.1684921114363; Wed, 24 May 2023 02:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684921114; cv=none; d=google.com; s=arc-20160816; b=xa+zLy1bComp/v+PzE4JYAGmXdsHSjiP5fE/HWha2tdfB4sTTQe689KAAACcpYWM0q HcvTpmofvDuyHmFO8i9VjdcfVGXNC9xV6S1HA1injCpKigo5wIEBi9NXRvyhDT3/kOcM dR8EyU8mFkmEy/9RbDT/GZnxW7rUwpUxepoe3EasWZHW6npOFFHiUYYF5q6iawOu5qnq ey8lAIqfN/F5AcHkCDSkxqdLaroqqszJy2loE47XZdK9LvKMp6wpcKdgSuzP2XHVtLCg U3ZVIMBWmIuw6cuV3S5a6lwStg7vwBmqFPJlhUVZ+4xz2qR3YrOUy/8gP1otfWhvLfVy kqPA== 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=NIcA0PvZwprADJczJqLbuRMLXgSZuvk7SexYJ3+yvxo=; b=SPa/4DbZBvAWJ8+I8VDzjrP59v7xAooDRwuFO0QB4W0faljfF9yqD3NmoBVGTxdnKZ cHbovy9lDxPIzCtce8rNrByROdFh/Tqt0vzsUbvNTCW4ai1NqvCFGNVSWZm2hf/uEtIU UBPO69ddonVJtntDgj80LDBSA0VW7Jz7T5qbo8IvN7ewHmzO23cNaTAmZcsLLo6lyTj5 wTz9KbtCXIXO+rmR50adZ94A2O4SPcKUH2dvDbudcSKsusW0+dYe3vZmwgMvLXgq2OeY wEPjHDXhNx5IguSXjAyDu7OfrBlvyrSj/CtPhXoEjtosDn5GzV9JoNb+a/yToSeUtQzZ N/gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=en5yceAZ; 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 p1-20020a05620a112100b007577a865012si5899327qkk.330.2023.05.24.02.38.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 02:38:34 -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=en5yceAZ; 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 1q1kwV-0004hJ-If; Wed, 24 May 2023 05:38:03 -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 1q1kwT-0004S0-2n for qemu-devel@nongnu.org; Wed, 24 May 2023 05:38:01 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1kwQ-0006mf-JD for qemu-devel@nongnu.org; Wed, 24 May 2023 05:38:00 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f42ba32e24so6287065e9.3 for ; Wed, 24 May 2023 02:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684921077; x=1687513077; 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=NIcA0PvZwprADJczJqLbuRMLXgSZuvk7SexYJ3+yvxo=; b=en5yceAZyLoK2aO/2T9Bnfvl5rgwZ49K3a6wWlI9mnaRFxqKIFZbxkNPzH+5UD2TlC yGshVDcVMTUEqdsWqsWXRDHtkTw//aFnDEcq5+LVmYgGyvWoylIPFzvHWwtraQ3BE4O7 w6iD5CLQfN5o9V325ZDO6oY4fsqIZDcj4Bf7s9sQoG1c22Xk14LinrB/wa23zWaquDCT D4ETy0ok8QvBHQZrYUj6H5aISQ8wIt2pE/ql7mOVyxPYP0yTpX+p1YyMXheEVU5QuC+g fANZV8T+riIrpoidczy1SO4zQSe5mNO4wMgo64LHv83zdPLq1bnhVxm+6Cx/ULt+aY/6 90iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684921077; x=1687513077; 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=NIcA0PvZwprADJczJqLbuRMLXgSZuvk7SexYJ3+yvxo=; b=AhgxGRP3PjLBbAm/uYJ9BWF5Pw7vnGy/TKIACuzqLBy/UH+QsqOVfCofqN2RuwR815 MWWwkzhyHZL0QL0jOulWAaJs7bDJce0i3pig2atid+UoXiphCzi9mL7I7Wg5vxWIJ4G+ 2DKBJKujeEInaCSdOr5AEjctlJizYpLcOGOET1ZEwLLPCm1YZTVMLQeBbT1/O27JFyPN A0WJMwJGkQ1ktZyK6ueDpW+bmxdrJRXo5bQUNeUiLG3cNaO0PhiUYtxbRqZ9Yq3h0TeS yvFGD/iJL9lDRNJ1BfRndhMAk7UxqAIPQCxFSG7dDjsn288FpVRZR6bZHoyFaxeLST0F hStA== X-Gm-Message-State: AC+VfDyLLj4XtCHrMCgJZiq2DI08CatLZBJlj6Uje/SPcq+UF7chdJFd 3kPvkqlJjf4X/kwZESe3Y/VTuwINONdWGAy2t1ViFQ== X-Received: by 2002:adf:f683:0:b0:304:8149:239b with SMTP id v3-20020adff683000000b003048149239bmr13080694wrp.50.1684921076839; Wed, 24 May 2023 02:37:56 -0700 (PDT) Received: from localhost.localdomain (fac34-h02-176-184-31-246.dsl.sta.abo.bbox.fr. [176.184.31.246]) by smtp.gmail.com with ESMTPSA id b15-20020a5d4b8f000000b00306344eaebfsm13882355wrt.28.2023.05.24.02.37.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 May 2023 02:37:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fam Zheng , Thomas Huth , Paolo Bonzini , Eric Farman , Peter Xu , Hanna Reitz , Christian Borntraeger , "Michael S. Tsirkin" , Raphael Norwitz , Ilya Leoshkevich , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Eric Auger , "Gonglei (Arei)" , David Hildenbrand , Stefan Hajnoczi , qemu-s390x@nongnu.org, Cornelia Huck , Halil Pasic , qemu-block@nongnu.org, Kevin Wolf Subject: [PATCH v2 01/10] softmmu: Introduce qemu_target_page_mask() helper Date: Wed, 24 May 2023 11:37:35 +0200 Message-Id: <20230524093744.88442-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230524093744.88442-1-philmd@linaro.org> References: <20230524093744.88442-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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=unavailable 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 Since TARGET_PAGE_MASK is poisoned in target-agnostic code, introduce the qemu_target_page_mask() helper to get this value from target-agnostic code at runtime. Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée --- include/exec/target_page.h | 1 + softmmu/physmem.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/exec/target_page.h b/include/exec/target_page.h index bbf37aea17..98ffbb5c23 100644 --- a/include/exec/target_page.h +++ b/include/exec/target_page.h @@ -15,6 +15,7 @@ #define EXEC_TARGET_PAGE_H size_t qemu_target_page_size(void); +int qemu_target_page_mask(void); int qemu_target_page_bits(void); int qemu_target_page_bits_min(void); diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 9d7e172260..8067742df0 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -3354,6 +3354,11 @@ size_t qemu_target_page_size(void) return TARGET_PAGE_SIZE; } +int qemu_target_page_mask(void) +{ + return TARGET_PAGE_MASK; +} + int qemu_target_page_bits(void) { return TARGET_PAGE_BITS;