From patchwork Tue May 4 05:52:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 430805 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp3489407jao; Mon, 3 May 2021 22:58:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd+koJdnO6SeibgO3HzeMj/Ffc14pUSUnOX7iZtGbSA8MzZap1btcfRPofyJ5wjuncYFFG X-Received: by 2002:ac8:6954:: with SMTP id n20mr21605390qtr.314.1620107928100; Mon, 03 May 2021 22:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620107928; cv=none; d=google.com; s=arc-20160816; b=vnHH1eaTL77y59guK0FPnW5vJhO1klDxrU+qHtx1p0zoPolaj4J0CbfwsC2TMBkPGC xiHEseC7mU8KBBlL5839gwgWbOnOlE/DKq35tMc0lf5UmYtWJJwyB5e/zIe0vz+eBArl OBJIre63WZUxqMdJeWg1oe1hXyjQKkkluvSstv0NYGRXvAv3cGFKtcdGeZbBG4blcKax h3zr7c4yH+Q0Ewjy2aus0wC9H4tuEcaTFZKWqbdWrHR7WcSWm/Z4PK7cLb2rTC8LXgGs lYsP6wzj3fVC0/xIHGFLa4aIok6b+6UMkBDfuMCCLF/FlqyyR4HS9vePawLul/d0ho/i 0fzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=dYxoT5SVSOt+HvhFKBqdZWZt9SLOcJdVViDaZ1ciOj8=; b=uWEq5MpF/P+PANFTyY1UF+bIJLZoTkHMVbkbuxmxlo8HM0qKcO76JQzRuPJ1J2FIuf NHMeO9lYSaPp1SVmCeb0lAkD6q7uXY44Zaqi1izVCsklTWlNEcXG/TCPOVEgme5uJ8uX hfZXBtf5OnJEbl2JDh/a0HAkVVFWbZR/juCnPHlI0p21rznbTjLHQ5hhT39/aAKazEvp 8Lkph2W/11tBGrV34r6TOrnYG3QkRHrWRfq/I5vyT/ZSk01OtMyIPxKx9v8xIeU67Q4t 10oVVcYHJZKereOUfniHvQ2BDg4TNGUeNd1Ymj+8eaECXz6v/nDam5/EsR3/VKTyKqKd IRew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gibson.dropbear.id.au header.s=201602 header.b=I7leRdoP; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t17si5206172qkm.316.2021.05.03.22.58.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 May 2021 22:58:48 -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=fail header.i=@gibson.dropbear.id.au header.s=201602 header.b=I7leRdoP; 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" Received: from localhost ([::1]:56680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldo51-0001Y2-Hj for patch@linaro.org; Tue, 04 May 2021 01:58:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldnzu-0005B7-LC; Tue, 04 May 2021 01:53:32 -0400 Received: from ozlabs.org ([203.11.71.1]:51761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldnzs-0004fS-0V; Tue, 04 May 2021 01:53:29 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4FZ8CK0rvwz9sWC; Tue, 4 May 2021 15:53:17 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1620107597; bh=QN9OGBLE2HmT8V/0wRszHECV89IjJIxItnBzN/dvEDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I7leRdoPnCOG4Zb4KWK9sKd64s3IYRQklnOsX8pvnvyReir5IXHLmrGva9kRiVduk JLV40zniKYAI5iE2NsSgHaTSvVZKj3NWdjczPcfDgD8oKzRFpxVST5VTmqgby/XRrs 3kMo+tTLJgRwwS2illfeOfiPt2Rmw3UmrpQV1+D8= From: David Gibson To: peter.maydell@linaro.org, groug@kaod.org Subject: [PULL 06/46] target/ppc: Retain hflags_nmsr only for migration Date: Tue, 4 May 2021 15:52:32 +1000 Message-Id: <20210504055312.306823-7-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210504055312.306823-1-david@gibson.dropbear.id.au> References: <20210504055312.306823-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Received-SPF: pass client-ip=203.11.71.1; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , David Gibson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson We have eliminated all normal uses of hflags_nmsr. We need not even compute it except when we want to migrate. Rename the field to emphasize this. Remove the fixme comment for migrating access_type. This value is only ever used with the current executing instruction, and is never live when the cpu is halted for migration. Signed-off-by: Richard Henderson Message-Id: <20210315184615.1985590-6-richard.henderson@linaro.org> Reviewed-by: Cédric Le Goater Signed-off-by: David Gibson --- target/ppc/cpu.h | 4 ++-- target/ppc/helper_regs.c | 2 -- target/ppc/machine.c | 9 ++++++--- 3 files changed, 8 insertions(+), 7 deletions(-) -- 2.31.1 diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 061d2eed1b..79c4033a42 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1105,8 +1105,8 @@ struct CPUPPCState { #endif /* These resources are used only in QEMU core */ - target_ulong hflags; /* hflags is MSR & HFLAGS_MASK */ - target_ulong hflags_nmsr; /* specific hflags, not coming from MSR */ + target_ulong hflags; + target_ulong hflags_compat_nmsr; /* for migration compatibility */ int immu_idx; /* precomputed MMU index to speed up insn accesses */ int dmmu_idx; /* precomputed MMU index to speed up data accesses */ diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c index 95b9aca61f..a87e354ca2 100644 --- a/target/ppc/helper_regs.c +++ b/target/ppc/helper_regs.c @@ -104,8 +104,6 @@ void hreg_compute_hflags(CPUPPCState *env) */ uint32_t le = extract32(env->spr[SPR_HID0], 3, 1); env->hflags |= le << MSR_LE; - /* Retain for backward compatibility with migration. */ - env->hflags_nmsr = le << MSR_LE; } } diff --git a/target/ppc/machine.c b/target/ppc/machine.c index f6eeda9642..1f7a353c78 100644 --- a/target/ppc/machine.c +++ b/target/ppc/machine.c @@ -310,6 +310,10 @@ static int cpu_pre_save(void *opaque) } } + /* Retain migration compatibility for pre 6.0 for 601 machines. */ + env->hflags_compat_nmsr = (env->flags & POWERPC_FLAG_HID0_LE + ? env->hflags & MSR_LE : 0); + return 0; } @@ -829,9 +833,8 @@ const VMStateDescription vmstate_ppc_cpu = { /* Supervisor mode architected state */ VMSTATE_UINTTL(env.msr, PowerPCCPU), - /* Internal state */ - VMSTATE_UINTTL(env.hflags_nmsr, PowerPCCPU), - /* FIXME: access_type? */ + /* Backward compatible internal state */ + VMSTATE_UINTTL(env.hflags_compat_nmsr, PowerPCCPU), /* Sanity checking */ VMSTATE_UINTTL_TEST(mig_msr_mask, PowerPCCPU, cpu_pre_2_8_migration),