From nobody Wed Nov 27 06:41:50 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=1700808120; cv=none; d=zohomail.com; s=zohoarc; b=YZdiRbre4/Z8rRI3SHHasQ2gI8xjQLSWN2VoHMh0P2915O0hTdTNTs1+Hl1nbznujhblGNrq6XL72vpvVlSg7gHhGW5JCxzepv5A419D0WfG5MxXn2uPrY0F8o7Y266a5GWE0wsFhSXd6Y6UV0RwwEy8y4blFXVzXgM1vl/xee4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700808120; h=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=vAfZHkGk9vxz48DJuLY5Nn6nkh7yrBPGZD6fhwC4MOM=; b=KY+Tz23zitpYPySN83jg1MHk+yyNYeOxnBfOnugnNqrlReojj9VCb76SfUm3bkmi7yxSDqlfshwvX5oJ/y5lw+yfJnteFa1COzY6muHdxHsWXa2v52bmKy0Hr8ke/GPRzkxz+XvUyjM1+YrsepjbX5AtPAVlCj/2mO611338xqU= 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 1700808120639126.26549934801244; Thu, 23 Nov 2023 22:42:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6Prl-00021p-8X; Fri, 24 Nov 2023 01:40:41 -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 1r6Prj-000218-8b; Fri, 24 Nov 2023 01:40:39 -0500 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6Prh-00066d-Ti; Fri, 24 Nov 2023 01:40:39 -0500 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3b2f507c03cso889813b6e.2; Thu, 23 Nov 2023 22:40:37 -0800 (PST) Received: from wheely.local0.net ([1.145.239.154]) by smtp.gmail.com with ESMTPSA id y9-20020a62f249000000b006cb8a8a4bbfsm2152013pfl.186.2023.11.23.22.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 22:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700808035; x=1701412835; 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=vAfZHkGk9vxz48DJuLY5Nn6nkh7yrBPGZD6fhwC4MOM=; b=X6PJ0dE6XiD6t72D84hcUe2T8RcV8FVAPxr2+G8PipK+Rn5V59zv3/PGFAxFT7vFuN 0xwbF0d4Rw55L+P+b9VFc6+FOTp9aRcXB5RLZQ7Ckdva4BdnHqpkHbiTFfogrff+XK0i kEbPhYwQn006FQvFdRESxfMLPOFHN6HOvAkujwJMNeJKxFzfrB+KmUFXHcMSkCDr84rG G23zAnFZVeWUG4DeSLFRBme6DTe8hTZnhEG6eOhEnKILSvrmmtWiymqwkj/sD8panTLL 4M+ASpKpe1RoahxXS5yJSpcEzgJv/bEPImSYdqWszPnfHMVR7ZM2VKeX7kv3s+ZASOdD pUaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700808035; x=1701412835; 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=vAfZHkGk9vxz48DJuLY5Nn6nkh7yrBPGZD6fhwC4MOM=; b=oC307pBYRiR99lQmaySyZ/7RkeT5jVGUX+n2T3DZ1Vi7zgK4pDc00LExdIR6BuB80N 3MA1SHky0ru9/bnOIFjSNvGbRatMLCJK3OXCUjbz/KBy09ncupZy0cW1okCvdS4mm6vv E6g/J16Usn/3PzzfAmxV2hdLIQJYpN6wPIuXatEXSVlo95pGLwiKb6lRGfNiSGdNdZLO XvI3gLaO+NRKDz2E6S2njaBwXA+w9vzoz6fHLKelEd3Aqa6Oahaociy8XecCasUAKJ/z /e+UbnypcPfr5Rwe7GjQ/l7yWuMM/D1w2+LBRIq/5q2heEWdMOZ1M345q6c8fG0Vpa3e LG/Q== X-Gm-Message-State: AOJu0YxbEQaFHcWe5lxbfnE2PS06IKvCjFzpgwJZmQ7qAW8qVmRwAiaj 5Qj9aOl8LFCT+vKjzbK6hjKwcGD3y+im9Q== X-Google-Smtp-Source: AGHT+IF+0nJa0g3T1W39U+RzyA2X2Di888/6Fk3wGIFxFAd1YvYDVxNxMGnPjjE7v7AD8xSQAqId0Q== X-Received: by 2002:a05:6808:1520:b0:3a9:ea90:5901 with SMTP id u32-20020a056808152000b003a9ea905901mr2080819oiw.56.1700808035400; Thu, 23 Nov 2023 22:40:35 -0800 (PST) From: Nicholas Piggin To: qemu-ppc@nongnu.org Cc: Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , qemu-devel@nongnu.org Subject: [PATCH v2 1/7] target/ppc: Rename TBL to TB on 64-bit Date: Fri, 24 Nov 2023 16:39:55 +1000 Message-ID: <20231124064001.198572-2-npiggin@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231124064001.198572-1-npiggin@gmail.com> References: <20231124064001.198572-1-npiggin@gmail.com> 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::235; envelope-from=npiggin@gmail.com; helo=mail-oi1-x235.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: 1700808121007100001 Content-Type: text/plain; charset="utf-8" From the earliest PowerPC ISA, TBR (later SPR) 268 has been called TB and accessed with mftb instruction. The problem is that TB is the name of the 64-bit register, and 32-bit implementations can only read the lower half with one instruction, so 268 has also been called TBL and it does only read TBL on 32-bit. Change SPR 268 to be called TB on 64-bit implementations. Signed-off-by: Nicholas Piggin Reviewed-by: C=C3=A9dric Le Goater --- target/ppc/helper_regs.c | 4 ++++ target/ppc/ppc-qmp-cmds.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c index f380342d4d..8c00ed8c06 100644 --- a/target/ppc/helper_regs.c +++ b/target/ppc/helper_regs.c @@ -460,7 +460,11 @@ void register_generic_sprs(PowerPCCPU *cpu) } =20 /* Time base */ +#if defined(TARGET_PPC64) + spr_register(env, SPR_VTBL, "TB", +#else spr_register(env, SPR_VTBL, "TBL", +#endif &spr_read_tbl, SPR_NOACCESS, &spr_read_tbl, SPR_NOACCESS, 0x00000000); diff --git a/target/ppc/ppc-qmp-cmds.c b/target/ppc/ppc-qmp-cmds.c index f9acc21056..ffaff59e78 100644 --- a/target/ppc/ppc-qmp-cmds.c +++ b/target/ppc/ppc-qmp-cmds.c @@ -103,7 +103,11 @@ const MonitorDef monitor_defs[] =3D { { "xer", 0, &monitor_get_xer }, { "msr", offsetof(CPUPPCState, msr) }, { "tbu", 0, &monitor_get_tbu, }, +#if defined(TARGET_PPC64) + { "tb", 0, &monitor_get_tbl, }, +#else { "tbl", 0, &monitor_get_tbl, }, +#endif { NULL }, }; =20 --=20 2.42.0