From nobody Wed Feb 11 00:37:05 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=1660683286; cv=none; d=zohomail.com; s=zohoarc; b=XbirPhSKBXHUqRn8kO7II7C5p61M79jPEie0zJueHvGikc9bVCIVCcd1h3wYbUJ39oLdTBoJNaXiaiIxjqc27z5pc76g9K9wYfb0tqI9zvu6dG5d9KTd6KmdFI/hmwq6lmKkMNZVkOu1gYkGnQXkwP67BepKGe+ak4xmuPKi++Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1660683286; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PnxOd469lmAdC/RQB8O6SvRIgXAOuOZ1V4tulDNdRcM=; b=lZGMEUJ4aFCnicy4Wag0jr115x2fPJtRCKnPacRO3Y0LDsnhCQ5J/0V3nFcYIGu+7O+Dzza4ttd7UNnV+GXjHnE/UI/kbiCGLxMRpFCu6R9iAW8AA4DoquwynJhwKHeoCqT8oTWBzBZlFdx65WYADRbH6DFQR273JbDdY2iU0Rc= 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 1660683286430393.59507708527065; Tue, 16 Aug 2022 13:54:46 -0700 (PDT) Received: from localhost ([::1]:43790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oO3aH-0004Em-CL for importer@patchew.org; Tue, 16 Aug 2022 16:54:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oO3H1-0004yb-FR for qemu-devel@nongnu.org; Tue, 16 Aug 2022 16:34:51 -0400 Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]:44711) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oO3Gr-0004aZ-No for qemu-devel@nongnu.org; Tue, 16 Aug 2022 16:34:50 -0400 Received: by mail-ot1-x334.google.com with SMTP id t11-20020a05683014cb00b0063734a2a786so8170974otq.11 for ; Tue, 16 Aug 2022 13:34:41 -0700 (PDT) Received: from stoup.. ([2605:ef80:80f6:61fa:9bc2:5095:d612:5e22]) by smtp.gmail.com with ESMTPSA id y23-20020a056870b01700b0010ef8ccde67sm2285220oae.13.2022.08.16.13.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Aug 2022 13:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=PnxOd469lmAdC/RQB8O6SvRIgXAOuOZ1V4tulDNdRcM=; b=X92Dz0ywDzYVawuTMHXDyda7X6TRtqlFqLPovKxZ9n41nVF+255bVQKGefligoePjf D31wpZrBOtdUxNRExGjCMxIwoz27vzmPrnp1LBkKeDWxeB0D48eY6At1R8e665gMcLoU VCgLjMyX2qNN6AIg3hCATLwsEGiApUrdR9xJ9cnjy6IHjqB5eLtOPdwJPAcxkR//zGrq UzAMaJJhCKTBIGdpfT3trc+2ZsCAE7izJSrazlVnA5a/xSz/FsnaqbXI9jRoErv5hk/b GW4MhjN9+rMW3RdIdC+SGgAAUN/WS7CqeRA2Sm6J8HtgIzMruWFZRtcEqxZ4iC+Pbdil aKjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=PnxOd469lmAdC/RQB8O6SvRIgXAOuOZ1V4tulDNdRcM=; b=KVRwcyoTDm0AhUrH/IQ8HbbBx5BqOFXanSHHUEgpbv58C5vdo97EmhR4PU5yqmzPVF 7MLVprEpkUJq4DGdyQkx6jZ7nw2kR+nMG8D4Hnueut3p2pNdgt+0zylr9QajIeDTKQ73 JIiT+wJEYj2uacrzmoYTWZBmBLbzfghm59cVf60OaIBSFLUbu8u+0FwAunVeLXIjaXu8 pAX2TuPHCTtCeNvG9T7zEsaDdEtSHOR3ikZA9vlWOjPJXfY5ZT+4uRhPyNu1qIr3ZkwP 8Z0BlgqPQX4oD9HJg31/jq8FPnAJh4nY2mks6ToDZDqsbK12Bgy+6fOM+1hnR5s2hoFv nGVQ== X-Gm-Message-State: ACgBeo3Ywc8X2JrK2mIfgXgGriuIvad9Ww8+DXbilo2sieHjRxFeHPTQ FHfutJZqCa8rx1Du8Y/AGvU21+xH6dbiHw== X-Google-Smtp-Source: AA6agR6yl7Qnimj3IyIacPNSmD9eJDnO919G+6ORJeewh7oAI0+GovcnGbCxYwcHfQmtlL9qM+54sw== X-Received: by 2002:a05:6830:2646:b0:638:b172:92d5 with SMTP id f6-20020a056830264600b00638b17292d5mr3498326otu.75.1660682080696; Tue, 16 Aug 2022 13:34:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, alex.bennee@linaro.org, iii@linux.ibm.com Subject: [PATCH v2 15/33] accel/tcg: Introduce is_same_page() Date: Tue, 16 Aug 2022 15:33:42 -0500 Message-Id: <20220816203400.161187-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220816203400.161187-1-richard.henderson@linaro.org> References: <20220816203400.161187-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::334; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x334.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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1660683287065100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Introduce a function that checks whether a given address is on the same page as where disassembly started. Having it improves readability of the following patches. Signed-off-by: Ilya Leoshkevich Message-Id: <20220811095534.241224-3-iii@linux.ibm.com> Reviewed-by: Richard Henderson [rth: Make the DisasContextBase parameter const.] Signed-off-by: Richard Henderson --- include/exec/translator.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/exec/translator.h b/include/exec/translator.h index 7db6845535..0d0bf3a31e 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -187,4 +187,14 @@ FOR_EACH_TRANSLATOR_LD(GEN_TRANSLATOR_LD) =20 #undef GEN_TRANSLATOR_LD =20 +/* + * Return whether addr is on the same page as where disassembly started. + * Translators can use this to enforce the rule that only single-insn + * translation blocks are allowed to cross page boundaries. + */ +static inline bool is_same_page(const DisasContextBase *db, target_ulong a= ddr) +{ + return ((addr ^ db->pc_first) & TARGET_PAGE_MASK) =3D=3D 0; +} + #endif /* EXEC__TRANSLATOR_H */ --=20 2.34.1