From patchwork Wed Mar 1 02:55:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 657740 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp3269301wrb; Tue, 28 Feb 2023 18:58:09 -0800 (PST) X-Google-Smtp-Source: AK7set+AmLZ7rhi/D6acNquskNMz6wm/6cOktryFaHlhOFnJmp/PzodWOCrdTkCE49xX+tkgzQLy X-Received: by 2002:a05:6214:cc6:b0:56e:99f2:1b91 with SMTP id 6-20020a0562140cc600b0056e99f21b91mr10984854qvx.23.1677639489060; Tue, 28 Feb 2023 18:58:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677639489; cv=none; d=google.com; s=arc-20160816; b=Dk0pVpO4WY63K2qDys1NqimXEua0qD/8fa30QITURN3CTw5TrZoCq5GR1MOghMAdye sFFnkRys8Ww03ICg8leYf/4KNiPOUewIAt1GlOZvnHvVsrC8Putw8vJKyQAxj2SrBB// QFageL0C1SJgzf2go0QYxf5/+vs11xicdEnGLvDjxqa5oBlOq7E84YVyEDuXal/2V63y MvfLl9lTfNH1R6qhX38BkufGBLuRhyP4Sl0Om0TaSvefDuqEta2u7ZzWIJY8dc7kACb8 +4WmtzksHJoyZrykj9w9hk08lcQw+bRbVrDWfPNUCiZ8dVCfusDNNVK08/aUEVrFq9XR LAyQ== 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=zEdQpqU9ueZEOo8eKz0oCLuTG410P44mvFlHhoCt7h0=; b=PdNOI/E3EfCIDAzCH3YbJuxHO90/kogUn8dkEPWaWMKQPctcyNuqKwvQVLtx207zm6 h0B/MGi/ATZJG3w8rgslseYhF99pLWeCjNWsqy44HTS04IRGfBgF5lA6WPHgIt/f+zcl nCBDIP3Oo+H8C19aToGOlZ5VgxPpeXQlZix7BeEYwt8+3VyvYucGEjS9TyLz2cpOYIpu ziXFBUUysF0fOuC6TrGEBimaA23P7G4T3C7/9fJKGbmLbHyhE9SDcBrgDhDWumBR81c0 dqw/tv/mE9jrr7Ss4XMRZJlAisjwzzb3w3bxY/ucJZ9j5w27UISrXgscooapdpgpfcC0 cgBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IZM5a17y; 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 j10-20020a0c9cca000000b0056eb019cf92si8909460qvf.118.2023.02.28.18.58.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Feb 2023 18:58:09 -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=IZM5a17y; 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 1pXCee-0008Vr-Kx; Tue, 28 Feb 2023 21:57:20 -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 1pXCeb-0008Q2-6O for qemu-devel@nongnu.org; Tue, 28 Feb 2023 21:57:17 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXCeV-000353-EN for qemu-devel@nongnu.org; Tue, 28 Feb 2023 21:57:14 -0500 Received: by mail-pj1-x102d.google.com with SMTP id x34so11954514pjj.0 for ; Tue, 28 Feb 2023 18:57:02 -0800 (PST) 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:subject:date :message-id:reply-to; bh=zEdQpqU9ueZEOo8eKz0oCLuTG410P44mvFlHhoCt7h0=; b=IZM5a17yH/sLpVf4i6uxEj4GzFnDKBRupYYFY5P9anLEJWKzX+RQTwAIf0sT3jGzsu T7YukuA9JWmHnbtXgpzsvDCV/jhlhjoUuY3+SuxMNGjsVjwX3ykKyffTvfdBGBnk/7/R trnm/qY0fd6ddrtf7dDHl2jD7va4eysAgG0el2mCPHBjo0qL34kN/2xLhQkEzL3eRHtz jJExoGd5wTvWOfeaV164ol+LCHDlPUva3kE4NOWRf+kw7RH3kcgbJ29rIlH+XNE+grRj Mph0dBN+fQqzPmcDVY5IcoFUBmIOqfbHtaYUjgeDEPMhBcR/izZS3ogNjYyxvs7nEP0k 5O4w== 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 :subject:date:message-id:reply-to; bh=zEdQpqU9ueZEOo8eKz0oCLuTG410P44mvFlHhoCt7h0=; b=OVAVxcw8Zi3aJgz4iGzENTo06RJ7fAavGDUMrfzOiSzVYcOlPHRNX0QPIAtgxbjuo0 1bxsE2xSR+hRZwGEDNy974ERw0l2wfVQmLH2p40C7/WIFc4LBqHfbqyccXalYqx2ccuE scB7SfM3HZOK9n8SEYBDpTnqVM0ytVd/mokLO9G/sV/fRikpnkvXwr64qgIKE7KRSoOr kgbmdZhL1I/A6vp66L/lyG+RDKslsDeuIB1NiQxwoQ/9u88d3eX0FgTxdDHM99QYHpQg KzGxTMGr4s9CZNE03Tz2rKG6ozpbIDlV0Lo9Yc2Mj/suDssIJ5reXiuCQ1bcj80F2K0z x0yA== X-Gm-Message-State: AO0yUKUNs9KjjTFZROgVcyNuxrPfs6Nnpf0kdkya1tb+pKnjtaO0s8w6 kL//81N0fPAS+IvA4qD4/uepY19PmHuSIqlmnX0= X-Received: by 2002:a17:902:da88:b0:19e:31a3:1a87 with SMTP id j8-20020a170902da8800b0019e31a31a87mr5472929plx.39.1677639421689; Tue, 28 Feb 2023 18:57:01 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id jg15-20020a17090326cf00b0019adbef6a63sm7210120plb.235.2023.02.28.18.57.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 18:57:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Anton Johansson , =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= Subject: [PULL 09/62] include/exec: Replace `TARGET_TB_PCREL` with `CF_PCREL` Date: Tue, 28 Feb 2023 16:55:50 -1000 Message-Id: <20230301025643.1227244-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230301025643.1227244-1-richard.henderson@linaro.org> References: <20230301025643.1227244-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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 From: Anton Johansson via Signed-off-by: Anton Johansson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230227135202.9710-6-anjo@rev.ng> Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 1574eabac8..6af001bfde 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -506,22 +506,20 @@ struct tb_tc { }; struct TranslationBlock { -#if !TARGET_TB_PCREL /* * Guest PC corresponding to this block. This must be the true * virtual address. Therefore e.g. x86 stores EIP + CS_BASE, and * targets like Arm, MIPS, HP-PA, which reuse low bits for ISA or * privilege, must store those bits elsewhere. * - * If TARGET_TB_PCREL, the opcodes for the TranslationBlock are - * written such that the TB is associated only with the physical - * page and may be run in any virtual address context. In this case, - * PC must always be taken from ENV in a target-specific manner. + * If CF_PCREL, the opcodes for the TranslationBlock are written + * such that the TB is associated only with the physical page and + * may be run in any virtual address context. In this case, PC + * must always be taken from ENV in a target-specific manner. * Unwind information is taken as offsets from the page, to be * deposited into the "current" PC. */ target_ulong pc; -#endif /* * Target-specific data associated with the TranslationBlock, e.g.: @@ -615,22 +613,19 @@ struct TranslationBlock { uintptr_t jmp_dest[2]; }; -/* Hide the read to avoid ifdefs for TARGET_TB_PCREL. */ -static inline target_ulong tb_pc(const TranslationBlock *tb) -{ -#if TARGET_TB_PCREL - qemu_build_not_reached(); -#else - return tb->pc; -#endif -} - /* Hide the qatomic_read to make code a little easier on the eyes */ static inline uint32_t tb_cflags(const TranslationBlock *tb) { return qatomic_read(&tb->cflags); } +/* Hide the read to avoid ifdefs for CF_PCREL. */ +static inline target_ulong tb_pc(const TranslationBlock *tb) +{ + assert(!(tb_cflags(tb) & CF_PCREL)); + return tb->pc; +} + static inline tb_page_addr_t tb_page_addr0(const TranslationBlock *tb) { #ifdef CONFIG_USER_ONLY