From patchwork Thu Jan 11 11:04:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 761827 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2337861wrz; Thu, 11 Jan 2024 03:11:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEES0MfBzsUlzhiEmqmYPoI1liV8gSq5FkUQXRvnl+zOVl7JnGmorl8fRQcyYzrX8ZDSAE6 X-Received: by 2002:a05:6214:76c:b0:681:172f:a989 with SMTP id f12-20020a056214076c00b00681172fa989mr1043745qvz.107.1704971496735; Thu, 11 Jan 2024 03:11:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704971496; cv=none; d=google.com; s=arc-20160816; b=EcEyiwPcO8I8sndMVRPtCak6Ts1yejCUoxQKYXMq6iqCjq4jp5QbpJfeTcL3D5V+7W QHd0fcpNZEOf1BtsKSy7aZq5NBsADeL4ABcPmGmdkv3LVISC6vH/zRlYBoNoVSP3+Zxw eOHzIeeUh/jnVSTUUOXeM8751fxF0i69WtZWOGIBezHudLL1MnhBkkkthMa3lVTM0hXZ UkGQdzzMfv3JyAfZThekxVQUFq6i3alrY3Jg4VfzozmWT6ZPNYgpp9Mg+qL8SJ1twyvn c2oRGQAkJRpH3ivOwHzhiZgN7NtHlDDBfWBwJAv6ni40CFb3E0Xj/Q/y5wbTg5Wrf7Qn kocw== 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:to:from :dkim-signature; bh=H2twb/r8sx0w6+zjm6Opwu2RcD6Eydz3aISuZWYaH3g=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=zBBHJbszBhv0CYm7NjEhaU4Iu1P+mC/RQJkmTV+w2F/lsKERlofrj6asLAGOCWCDV5 dE9ssMzi960Sx3SkTBmRxC+Ea9+7xt5WcIG1I33KeDDN1yku/LmwLfGaWcnfoA7pd9Cn vIEPbCQ3os+rcBy24ysxTQwiEfRHm5C1AYK3rhBXwsLjT6RJ8PE4NrosahuqIyq/sqhs tabHU21oPQM9kReE12PUNaqI9B3HWDnR9dRhnhqe/96/16XW1nsXILMVuHeCu3Uqj2u1 cTyO8+tix6o1cG5PVKsbvyx03VEVB5XGwe+iHk0GwpFYHjd/l56gZPwKMtCb6PsUMPaG aDYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D7MtU716; 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 j6-20020a0cab86000000b00680c567b656si580006qvb.196.2024.01.11.03.11.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jan 2024 03:11:36 -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=D7MtU716; 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 1rNssU-0001Rh-7q; Thu, 11 Jan 2024 06:05:38 -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 1rNss8-0001M0-VR for qemu-devel@nongnu.org; Thu, 11 Jan 2024 06:05:17 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNss6-0004Q1-Lu for qemu-devel@nongnu.org; Thu, 11 Jan 2024 06:05:16 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-336c9acec03so4519277f8f.2 for ; Thu, 11 Jan 2024 03:05:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704971113; x=1705575913; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=H2twb/r8sx0w6+zjm6Opwu2RcD6Eydz3aISuZWYaH3g=; b=D7MtU716tFInI84HEdAxtdbTgM6gYEurt7lzh9pbY8t3ULctBtg//U3oqvpPIYE7Pc OLH5cNghkjzNbihKsb8bOU3eGUNJo9Qiq+aGWtIXpGYFN2b6ppAXAG6Tukn8G6kEuscS bNxNWZKm2TQ5ORwzK1dAdB+qArZAN6Y/XKmA2K/k3JPB4nwkdaJjhhyzc4xslh7yeZXt DW9o60MqtodYimr+jEXraW4rvkY/kb7R15hWbnK25GnEktlA/XpgPSBv2T7WRcOD7wJq hCz5wFa80yhnTOLtmuqjpjmd/FWJASEicyGIt5rSoUI3RHYuby0cmpCyJFiP1rTjFi5K Lh4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704971113; x=1705575913; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H2twb/r8sx0w6+zjm6Opwu2RcD6Eydz3aISuZWYaH3g=; b=CyMGJpzlBZPM7GA4CoQteygZ0psaKfQJiSX4B6uA6p0hUbFdLq9El5nQPVH38UIE1n iXovQbEdFEJ+lBcaW/rzmfZ9n01x5t06AhAszWomxGePasdeWESZuq0GstU2ZHgBxao6 BISLDxYy8XGYdeuRVvnMLagv1EKsoeTjOdWdfP2LComzNGTE7imeZF0jnK7LbLjRDimD iMvITfWaxqirPARLP7Hry1cW+FZuxeZs5rLCOayffBezjOm8cZgLF6zThOsR9v0Xav7F QhyX9PtRY4zoY8MYnBI5JBM+T0W6oWQo4FyOu89HbHoS8ZqW6BSQYdGq3r9flRNVGOv+ +76g== X-Gm-Message-State: AOJu0Yw5ZpeAAtcVYeM1mvPh/H4MifZU5HDGI3s/M2RcmBRTr6bC99C0 +Wm2zFO/VX7kJxmHFua4T5yTaTcNmn0Y4DQ3PKMeOGON39k= X-Received: by 2002:a5d:690f:0:b0:337:62c6:cd1c with SMTP id t15-20020a5d690f000000b0033762c6cd1cmr635279wru.80.1704971112946; Thu, 11 Jan 2024 03:05:12 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id v30-20020adf8b5e000000b0033690139ea5sm951323wra.44.2024.01.11.03.05.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 03:05:12 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/41] target/arm: Allow use of upper 32 bits of TBFLAG_A64 Date: Thu, 11 Jan 2024 11:04:38 +0000 Message-Id: <20240111110505.1563291-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240111110505.1563291-1-peter.maydell@linaro.org> References: <20240111110505.1563291-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x434.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The TBFLAG_A64 TB flag bits go in flags2, which for AArch64 guests we know is 64 bits. However at the moment we use FIELD_EX32() and FIELD_DP32() to read and write these bits, which only works for bits 0 to 31. Since we're about to add a flag that uses bit 32, switch to FIELD_EX64() and FIELD_DP64() so that this will work. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Tested-by: Miguel Luis --- target/arm/cpu.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 8da6bfda228..6dd0f642581 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3237,12 +3237,14 @@ FIELD(TBFLAG_A64, NAA, 30, 1) FIELD(TBFLAG_A64, ATA0, 31, 1) /* - * Helpers for using the above. + * Helpers for using the above. Note that only the A64 accessors use + * FIELD_DP64() and FIELD_EX64(), because in the other cases the flags + * word either is or might be 32 bits only. */ #define DP_TBFLAG_ANY(DST, WHICH, VAL) \ (DST.flags = FIELD_DP32(DST.flags, TBFLAG_ANY, WHICH, VAL)) #define DP_TBFLAG_A64(DST, WHICH, VAL) \ - (DST.flags2 = FIELD_DP32(DST.flags2, TBFLAG_A64, WHICH, VAL)) + (DST.flags2 = FIELD_DP64(DST.flags2, TBFLAG_A64, WHICH, VAL)) #define DP_TBFLAG_A32(DST, WHICH, VAL) \ (DST.flags2 = FIELD_DP32(DST.flags2, TBFLAG_A32, WHICH, VAL)) #define DP_TBFLAG_M32(DST, WHICH, VAL) \ @@ -3251,7 +3253,7 @@ FIELD(TBFLAG_A64, ATA0, 31, 1) (DST.flags2 = FIELD_DP32(DST.flags2, TBFLAG_AM32, WHICH, VAL)) #define EX_TBFLAG_ANY(IN, WHICH) FIELD_EX32(IN.flags, TBFLAG_ANY, WHICH) -#define EX_TBFLAG_A64(IN, WHICH) FIELD_EX32(IN.flags2, TBFLAG_A64, WHICH) +#define EX_TBFLAG_A64(IN, WHICH) FIELD_EX64(IN.flags2, TBFLAG_A64, WHICH) #define EX_TBFLAG_A32(IN, WHICH) FIELD_EX32(IN.flags2, TBFLAG_A32, WHICH) #define EX_TBFLAG_M32(IN, WHICH) FIELD_EX32(IN.flags2, TBFLAG_M32, WHICH) #define EX_TBFLAG_AM32(IN, WHICH) FIELD_EX32(IN.flags2, TBFLAG_AM32, WHICH)