From nobody Sun Nov 10 22:14:36 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1705590634; cv=none; d=zohomail.com; s=zohoarc; b=Ak5Rx94BQ2ObUw8Tj+qaiNDWHMQ27BFA8e8Cu1jm0YlXoFwN8j0lSp0gR9EyuQXCv4vzvMZ2rs7YJkhGshMHfTe6jKfIPENHEjNvOfXgunQ/cdm6gYpSmCX2htHTW+ljjKqoqx6IJJdrYsHGcsHOPmra64Hrw8VDYwaACNwyw74= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705590634; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hQWLihokmS/TnFBDfpPUB/usROg0NAddsQkgkjkdaWY=; b=Zf6DdFqz+3xymgT7evjAfS+3A+ELVMfrfq/oCDR7S95mispFFcqk+oDWH6zm4J/UK7E0LtzK2WeQygAP8yhGpE4sf2Ow0HXB+Vw5djruEQepFqI1Wv8Gp/xytMsD9K20lRGb10djEa6qA2g6m+tlqAvku9yqPA/EX96dUoZHOr4= 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 1705590634650582.112329776236; Thu, 18 Jan 2024 07:10:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQTzU-0007Xi-6q; Thu, 18 Jan 2024 10:07:36 -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 1rQTzR-0007So-Tg; Thu, 18 Jan 2024 10:07:34 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQTzP-00081l-FT; Thu, 18 Jan 2024 10:07:33 -0500 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2901f9ea918so556290a91.3; Thu, 18 Jan 2024 07:07:30 -0800 (PST) Received: from wheely.local0.net (124-171-76-150.tpgi.com.au. [124.171.76.150]) by smtp.gmail.com with ESMTPSA id e17-20020a170902cf5100b001d052d1aaf2sm1509401plg.101.2024.01.18.07.07.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 07:07:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705590449; x=1706195249; darn=nongnu.org; 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=hQWLihokmS/TnFBDfpPUB/usROg0NAddsQkgkjkdaWY=; b=m1IW8SPw3UBKY9n9uZYeaxjyZRt2WNm3K9gZAxpstknuQ4Qo/Dp/rFvLWgWsUTGZiP WGQ0pk20CBS8zgK6OdwbmdPGNh3Fj31xN+ajA4ckLoYoFsnAh6fNmL0H79jAnIH5s2+U XOzojrF86Gy6ZGfUEclrIlWSXYFdmOtPUWUhX0NcQOxzUdu9SNRxnPnQp1nRUivsatyZ 9QXUsNHJiKYD+0exrfhe+nyErXa0mJlDPICQIRHIF4V9EPBq7qhDS0jQsTA0Rhh02Uwk OH/FH2u3kDx70xhoxHUGTCw5cqioOgHmF/scfYVy5Wr0TYyRAd0eLnUZsyO5m11igGda TUfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705590449; x=1706195249; 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=hQWLihokmS/TnFBDfpPUB/usROg0NAddsQkgkjkdaWY=; b=LMknM80mf9fprspgvSQ5aHTQxENOZ81u8Px+YzJO2kfNl96oLbYb4rZaEBYVHZmpQ7 Hkr14MF4qEc3tQHsv51fm7lOHZO5qqE/iBT7BPb8Y1LVZqZsPGQpbAq7GVuf8hd+ljLi kp7Ljw1uwXxGWs6rcrj5y1aZsFeTwgYY2XLO8Noyg5CRbxVRU95cg4SbRaPc/IRaLYZK uJxf9uqT8OXuDJiH/r+El5VUsvOKqPH5SLeqqxCMet6nFuHmkhIB3tIvfMZ9pY8PB1cu Zbiuf3GvhYRjHrBIIDghuwlTZPpT12sMSEkadOhMWQyVezEvFXXbt8Qu5gDbtxfNoRwh vV6w== X-Gm-Message-State: AOJu0YwoZkmIn5TDJQnfi+l4oKYaeaD+aDaWdbNir41xHU5vtawC1Jmq ZxLlzd1YHICazvW/tfoP4/OXaLN1lEG0xHLAdTaU6BLKXY0zYkfctHcMqieb X-Google-Smtp-Source: AGHT+IFIRPSFFbmoObuyKtHZuzvQUpEIXD+ct6hERkmPYFwyH4NXWbcTvsaIVIUInIFPS+GSp33UMg== X-Received: by 2002:a17:90a:49c1:b0:28c:caa0:4f00 with SMTP id l1-20020a17090a49c100b0028ccaa04f00mr777707pjm.10.1705590449209; Thu, 18 Jan 2024 07:07:29 -0800 (PST) From: Nicholas Piggin To: qemu-ppc@nongnu.org Cc: Nicholas Piggin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , qemu-devel@nongnu.org Subject: [PATCH 07/26] target/ppc: Improve timebase register defines naming Date: Fri, 19 Jan 2024 01:06:25 +1000 Message-ID: <20240118150644.177371-8-npiggin@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240118150644.177371-1-npiggin@gmail.com> References: <20240118150644.177371-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::102f; envelope-from=npiggin@gmail.com; helo=mail-pj1-x102f.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, FREEMAIL_FROM=0.001, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1705590635518100001 The timebase in ppc started out with the mftb instruction which is like mfspr but addressed timebase registers (TBRs) rather than SPRs. These instructions could be used to read TB and TBU at 268 and 269. Timebase could be written via the TBL and TBU SPRs at 284 and 285. The ISA changed around v2.03 to bring TB and TBU reads into the SPR space at 268 and 269 (access via mftb TBR-space is still supported but will be phased out). Later, VTB was added which is an entirely different register. The SPR number defines in QEMU are understandably inconsistently named. Change SPR 268, 269, 284, 285 to TBL, TBU, WR_TBL, WR_TBU, respectively. Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/cpu.h | 8 ++++---- target/ppc/helper_regs.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index f8101ffa29..848e583c2d 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1750,8 +1750,8 @@ void ppc_compat_add_property(Object *obj, const char = *name, #define SPR_USPRG5 (0x105) #define SPR_USPRG6 (0x106) #define SPR_USPRG7 (0x107) -#define SPR_VTBL (0x10C) -#define SPR_VTBU (0x10D) +#define SPR_TBL (0x10C) +#define SPR_TBU (0x10D) #define SPR_SPRG0 (0x110) #define SPR_SPRG1 (0x111) #define SPR_SPRG2 (0x112) @@ -1764,8 +1764,8 @@ void ppc_compat_add_property(Object *obj, const char = *name, #define SPR_SPRG7 (0x117) #define SPR_ASR (0x118) #define SPR_EAR (0x11A) -#define SPR_TBL (0x11C) -#define SPR_TBU (0x11D) +#define SPR_WR_TBL (0x11C) +#define SPR_WR_TBU (0x11D) #define SPR_TBU40 (0x11E) #define SPR_SVR (0x11E) #define SPR_BOOKE_PIR (0x11E) diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c index 7d8e041fb3..ead4acede4 100644 --- a/target/ppc/helper_regs.c +++ b/target/ppc/helper_regs.c @@ -466,22 +466,22 @@ void register_generic_sprs(PowerPCCPU *cpu) =20 /* Time base */ #if defined(TARGET_PPC64) - spr_register(env, SPR_VTBL, "TB", + spr_register(env, SPR_TBL, "TB", #else - spr_register(env, SPR_VTBL, "TBL", + spr_register(env, SPR_TBL, "TBL", #endif &spr_read_tbl, SPR_NOACCESS, &spr_read_tbl, SPR_NOACCESS, 0x00000000); - spr_register(env, SPR_TBL, "TBL", + spr_register(env, SPR_WR_TBL, "TBL", &spr_read_tbl, SPR_NOACCESS, &spr_read_tbl, &spr_write_tbl, 0x00000000); - spr_register(env, SPR_VTBU, "TBU", + spr_register(env, SPR_TBU, "TBU", &spr_read_tbu, SPR_NOACCESS, &spr_read_tbu, SPR_NOACCESS, 0x00000000); - spr_register(env, SPR_TBU, "TBU", + spr_register(env, SPR_WR_TBU, "TBU", &spr_read_tbu, SPR_NOACCESS, &spr_read_tbu, &spr_write_tbu, 0x00000000); --=20 2.42.0