From patchwork Wed Apr 24 23:44:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 791613 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1110550wrq; Wed, 24 Apr 2024 16:45:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWykkQbmTK2JZPSCYgdGp0fBuyTp8FwkdJoAh8kjn+Z0NRWJuyx9ja0CTOzEcGoxckzsHELrjtRuGfS1GMkLo92 X-Google-Smtp-Source: AGHT+IGCsKqC48EmfGwRy98Rw9PMkk9KSnCo3Btdzbm6IOSSoUGBFSBJ85bSKp3uYMBbrwkSihG6 X-Received: by 2002:a0c:eac2:0:b0:699:49d3:fe3a with SMTP id y2-20020a0ceac2000000b0069949d3fe3amr4172077qvp.44.1714002356795; Wed, 24 Apr 2024 16:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714002356; cv=none; d=google.com; s=arc-20160816; b=N1y86zw24cqNrYtqyZ2VN8o82z2J8FXbuXHtSTWVDrUwEG+mpA4FpxSBDq48p5bjwd RmFVg8+p5TnMdCkTZvRmVWsCUHrQqqMdgmnUQW1Tk5zPp5Zp1Jw3mOf3bONfrPRmQMlK Jpyt6OHqVapQk2RAFEtA/tw7aOa5flPHlcMsFpWSRukQi06PidvssFI5w896FYUMkLML pXC+rCiKoon8G0J/PMldp07NpFLi4Z+ORql2j1sEiGtV0do9r2Qm2JtKUahhtQwnmCOL H88ApHQ6NRokHk7TCIEr9HJUevbQN7LP6SayOOcayTDVv7AjjbjPajXD3h+zmIvEhBgK G9ig== 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=UcNiArx2YUV5oHwUywv/QvdvtoymVGfjzxZPBIu3NNw=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=HoObf6785nEo865iSpw5LjvAxiex8iv1MZ4IePBiYCZED6a8QgzQggtKL679b+RAgm eAkhm2/+1Tv3h37eEtve1VPzos2NPkdWc3mpdc+yLyGU2slVQCMLLAETB1VmBxIsHMKO 8xyFOBCXjMETE0cNls+6XKd69azNZf4Kw15ypXThzVr/Z2+1/NILlZ1m4LVgwanPK9DK +69EnysJ2MQ5JgtkTXuFYYBDm6dlFQaMnbjCFtKRlO7IofHpUq9B8ZZXiiTkr5Acr757 k+M7Zi2vV+0t14n6xQyQa5zynnamiKmjayWt8wYKPM7Hx1exKFpmwdM+WxLex6YEcTb9 BvWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fFFJUdcq; 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 gg10-20020a056214252a00b0069615ae66cfsi16446795qvb.311.2024.04.24.16.45.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 16:45:56 -0700 (PDT) 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=fFFJUdcq; 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 1rzmIU-000114-Lw; Wed, 24 Apr 2024 19:45:07 -0400 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 1rzmIL-0000xr-Oi for qemu-devel@nongnu.org; Wed, 24 Apr 2024 19:44:57 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzmIJ-00028Y-KF for qemu-devel@nongnu.org; Wed, 24 Apr 2024 19:44:57 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6ed32341906so481284b3a.1 for ; Wed, 24 Apr 2024 16:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714002291; x=1714607091; 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=UcNiArx2YUV5oHwUywv/QvdvtoymVGfjzxZPBIu3NNw=; b=fFFJUdcqDuP4IdkIj6OWsLwIPzKvfeuL3V5TFiK+TBEI1aD19iVeo+KFXTO1HVBvgi n4KAp1x1xJTgqZNdX3xWyDlTT6iR8w9gW7OPh5Wzj6KGPgQVDMMasXf+rv8jc6r1sZUc 9Goyy9aBkv8WpB7EqLuf2xQousydXSaRktoK7I2wqXm06YfdMmh1ZVtPqhWR42qNGdzZ IFGJKzH68aBWK9tI380nW9IgMqnW7cuKSDtqVlZ/DNaUIoRVZx3wqN1dKtYDrSsET4yy oNynTPHWrGUt+VD3UV2/9jTWus2C0kyVahhtQazgxuYISuzt9bN2sOF+yUL3dCw8UQsi IkWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714002291; x=1714607091; 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=UcNiArx2YUV5oHwUywv/QvdvtoymVGfjzxZPBIu3NNw=; b=msQ9Pv93J6claiU/fkFibx8HAaa63kVoI1jYuMO10MFm5uZ6YybniD88lDSVsuQq4Q o45mkwO68ZVMfTWl+ZF+cSqmZs5NWE15fnEn1emteEFsVRjxrUgAE5ZS6OWrgWZ14Rmz gAE83MElIsLgAchJeVVgQInfaiwDynpnnp/fKHdRb/t7B6BZHZdK3lWm+vRtaAjt+90g 5kv9jrTCj10wgxSbCBjgjDTAVyfYqFpmsvTP3ZG77vYePkpjnuWwKVSgvn5AxurwsUUG a3LbYPkGaQ6Zs+bzVW+uq09hM5xsWByBFEqZQeAtukKoKDhL7/N9KzA7XJYRGKfLIFrw 7DVA== X-Gm-Message-State: AOJu0Yxs1pLJIyh8I71UrPwh4ywGVGpOrMXZfcwlaipnPEBweqvhnp6Y 2UfohijQ0PZ4CLEZoM6TCuxAPzlSLOlZtLaP4+a/DvzWj5Z5TyS491SmX9krepdds4rL0GMFUy4 Q X-Received: by 2002:a05:6a20:3c91:b0:1a3:dc33:2e47 with SMTP id b17-20020a056a203c9100b001a3dc332e47mr4934910pzj.4.1714002291402; Wed, 24 Apr 2024 16:44:51 -0700 (PDT) Received: from stoup.. ([156.19.246.23]) by smtp.gmail.com with ESMTPSA id h17-20020a170902f55100b001e49428f327sm12531642plf.176.2024.04.24.16.44.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 16:44:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/5] target/alpha: Use cpu_env in preference to ALPHA_CPU Date: Wed, 24 Apr 2024 16:44:32 -0700 Message-Id: <20240424234436.995410-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240424234436.995410-1-richard.henderson@linaro.org> References: <20240424234436.995410-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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 ALPHA_CPU has a dynamic object type assert, which is unnecessary considering that these are all class hooks. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/alpha/cpu.c | 15 ++++++--------- target/alpha/helper.c | 8 ++++---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 05f9ee41e9..f98d022671 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -28,25 +28,22 @@ static void alpha_cpu_set_pc(CPUState *cs, vaddr value) { - AlphaCPU *cpu = ALPHA_CPU(cs); - - cpu->env.pc = value; + CPUAlphaState *env = cpu_env(cs); + env->pc = value; } static vaddr alpha_cpu_get_pc(CPUState *cs) { - AlphaCPU *cpu = ALPHA_CPU(cs); - - return cpu->env.pc; + CPUAlphaState *env = cpu_env(cs); + return env->pc; } static void alpha_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data) { - AlphaCPU *cpu = ALPHA_CPU(cs); - - cpu->env.pc = data[0]; + CPUAlphaState *env = cpu_env(cs); + env->pc = data[0]; } static bool alpha_cpu_has_work(CPUState *cs) diff --git a/target/alpha/helper.c b/target/alpha/helper.c index d6d4353edd..c5e4958f8b 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -124,7 +124,7 @@ void alpha_cpu_record_sigsegv(CPUState *cs, vaddr address, MMUAccessType access_type, bool maperr, uintptr_t retaddr) { - AlphaCPU *cpu = ALPHA_CPU(cs); + CPUAlphaState *env = cpu_env(cs); target_ulong mmcsr, cause; /* Assuming !maperr, infer the missing protection. */ @@ -155,9 +155,9 @@ void alpha_cpu_record_sigsegv(CPUState *cs, vaddr address, } /* Record the arguments that PALcode would give to the kernel. */ - cpu->env.trap_arg0 = address; - cpu->env.trap_arg1 = mmcsr; - cpu->env.trap_arg2 = cause; + env->trap_arg0 = address; + env->trap_arg1 = mmcsr; + env->trap_arg2 = cause; } #else /* Returns the OSF/1 entMM failure indication, or -1 on success. */