From patchwork Tue Mar 23 18:43:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 406953 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4735486jai; Tue, 23 Mar 2021 12:37:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0rDV8uhtbBAYNbzxgO/lB40caCLaiM8JyhI9POYzPNLZQMViXUi/adnwfB5rWKiT7/DGr X-Received: by 2002:a92:c6d0:: with SMTP id v16mr5880144ilm.289.1616528260594; Tue, 23 Mar 2021 12:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616528260; cv=none; d=google.com; s=arc-20160816; b=pP9kBU8rjM0qCUcYU+OM0ya+b/nzGNOtK8L/11DqTtgw2rUcOCF8V5SGMar20i7pky BgW0dfWtcJdHy2t9MdU1rbtREMNzQY+LwhhZYV3hEdVttghTgOD+b6COH8lzRyOSItUu bfgc6lpNHSNbiQSaiWdp0lv1XB8ww6n8CgKEaHvjA/E1YeZnHexmCJYBPKPRTDuQjO/m 5I/HZoruhlP/VuSlRe/utO5V9q15ESJRC30/S5+eZAQX5XczS9efcEUMNr0AJAj/GqkC e1YBWq3BF5kqyzJcedIlvnRYP6iBjcLdTFfGyRPkgcTpJSUb/R0JzkcsoYS3ToiDg2HJ S8RA== 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=3FXi8snd//6e3eo194okSdd2MkYemigNkupkO7nrNNk=; b=DjLbtciWqpLqNQ2aTnj75AFesKYjP4ZplT2t1JGBihsXOf4THw0EnhoCO+aHF12/fi MVoK6c5ZqDIVmRpGwQPFxupKJJHrs6DBIY93Ir/sfvywDAzH91IrmiYtglQZm49AK5Wx hh8gc+OJjjVXxkrslbOW6prrYMaBLVOGAnFXMGxH5CFOreNPs4guSGxFCDat1tFOVjbk TUWshTM/k2NRajlxRpXXf3VkTuooRR1lBpH5TJ+KykNiHnfL2QMBENX2ys9c8Y1/dUdU eERvOZMmlrAnvZcF/ALB0Evmo+6j3kvM48mDtGIJuOAciCwZQADXahUiOVw5ss3cCuA7 7qSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yCF3E+0D; 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=fail (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 l5si9459200ilo.148.2021.03.23.12.37.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Mar 2021 12:37:40 -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=@linaro.org header.s=google header.b=yCF3E+0D; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOmqS-0003e0-0k for patch@linaro.org; Tue, 23 Mar 2021 15:37:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOm0y-0008PB-HZ for qemu-devel@nongnu.org; Tue, 23 Mar 2021 14:44:28 -0400 Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]:45749) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOm0V-0003iv-0E for qemu-devel@nongnu.org; Tue, 23 Mar 2021 14:44:28 -0400 Received: by mail-oo1-xc36.google.com with SMTP id n6-20020a4ac7060000b02901b50acc169fso5176859ooq.12 for ; Tue, 23 Mar 2021 11:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3FXi8snd//6e3eo194okSdd2MkYemigNkupkO7nrNNk=; b=yCF3E+0Dv0xrsHmfPUUMtN8UHDFFGLfLjoKwiA02xWM9tTre+sb3pcSXwCGwSTziG8 hX3nwXzOqQ5GoThNfaR4WGqErsj2c8wOBbQI6DBERIhcAP3fMUuQ4fX/Pi1tDgxRzzPT PhlD+FGWUiwQ6IKsZObmkO1Jp+TkOtlPCBpQLohNe6qnBiu9uFRQCYrvNMW52xb86Qy8 12eJ7Dlglm3yTYl2COnzK89xYhcDmZAwT6wzUWjN5UoMsxdpa1VOVdUoYM1ARPdD3D5i b/3wpFbNTlTqEMARy/lxHQpbHTgvTwOuJSqVrGlqdBzm6lMNxm8GrSQUNatHLQJ4x2aZ bsXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3FXi8snd//6e3eo194okSdd2MkYemigNkupkO7nrNNk=; b=H5jC79IrqFsSj0LtQwOgKTbMN5Tua8IhpJKi0xomX3lrYl7YJGL9Mql0OoI7KBDOdv 21jln8XZCYvXdvwQWQiERrK1PtGM2lQNuz+C+nICRgYdhMtVa5N5/Qvhz0scdohuT8e8 aj1NzjUKpKrP37Dh36KvjhqAuZshEC+NN/u/zaaoZ5kBaDjWqkn+l16ASMo8yvx5+Frl wDpqt8NR5qPql3P38GA+T/wEa3jpKbXwWFIhoz8z1gxcAFf4PvjsuBoH08szN6uGgJTS 1Cvjc32dZAu/heLndq7fvZCHMLv1l0Zg5L/QeEt7vFJBVDvxirc9GmDXA0m58JzyKLOy B+dA== X-Gm-Message-State: AOAM531f4MD45EBo3TAbs0CCZ9SMhjYUGAqgp7JJ1i5stw7C4vTGx3Lu X25vbrf+NI8WNMPDywDNzWL3ksdl89u3f/UL X-Received: by 2002:a4a:4958:: with SMTP id z85mr4900641ooa.3.1616525032684; Tue, 23 Mar 2021 11:43:52 -0700 (PDT) Received: from localhost.localdomain (171.189-204-159.bestelclientes.com.mx. [189.204.159.171]) by smtp.gmail.com with ESMTPSA id x23sm3902825ood.28.2021.03.23.11.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 11:43:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 07/10] target/ppc: Remove MSR_SA and MSR_AP from hflags Date: Tue, 23 Mar 2021 12:43:37 -0600 Message-Id: <20210323184340.619757-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210323184340.619757-1-richard.henderson@linaro.org> References: <20210323184340.619757-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c36; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc36.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Nothing within the translator -- or anywhere else for that matter -- checks MSR_SA or MSR_AP on the 602. This may be a mistake. However, for the moment, we need not record these bits in hflags. This allows us to simplify HFLAGS_VSX computation by moving it to overlap with MSR_VSX. Reviewed-by: David Gibson Signed-off-by: Richard Henderson --- target/ppc/cpu.h | 4 +--- target/ppc/helper_regs.c | 10 ++++------ 2 files changed, 5 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 3c28ddb331..2f72f83ee3 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -600,14 +600,12 @@ enum { HFLAGS_DR = 4, /* MSR_DR */ HFLAGS_IR = 5, /* MSR_IR */ HFLAGS_SPE = 6, /* from MSR_SPE if cpu has SPE; avoid overlap w/ MSR_VR */ - HFLAGS_VSX = 7, /* from MSR_VSX if cpu has VSX; avoid overlap w/ MSR_AP */ HFLAGS_TM = 8, /* computed from MSR_TM */ HFLAGS_BE = 9, /* MSR_BE -- from elsewhere on embedded ppc */ HFLAGS_SE = 10, /* MSR_SE -- from elsewhere on embedded ppc */ HFLAGS_FP = 13, /* MSR_FP */ HFLAGS_PR = 14, /* MSR_PR */ - HFLAGS_SA = 22, /* MSR_SA */ - HFLAGS_AP = 23, /* MSR_AP */ + HFLAGS_VSX = 23, /* MSR_VSX if cpu has VSX */ HFLAGS_VR = 25, /* MSR_VR if cpu has VRE */ }; diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c index f85bb14d1d..dd3cd770a3 100644 --- a/target/ppc/helper_regs.c +++ b/target/ppc/helper_regs.c @@ -99,11 +99,8 @@ void hreg_compute_hflags(CPUPPCState *env) QEMU_BUILD_BUG_ON(MSR_DR != HFLAGS_DR); QEMU_BUILD_BUG_ON(MSR_IR != HFLAGS_IR); QEMU_BUILD_BUG_ON(MSR_FP != HFLAGS_FP); - QEMU_BUILD_BUG_ON(MSR_SA != HFLAGS_SA); - QEMU_BUILD_BUG_ON(MSR_AP != HFLAGS_AP); msr_mask = ((1 << MSR_LE) | (1 << MSR_PR) | - (1 << MSR_DR) | (1 << MSR_IR) | - (1 << MSR_FP) | (1 << MSR_SA) | (1 << MSR_AP)); + (1 << MSR_DR) | (1 << MSR_IR) | (1 << MSR_FP)); if (ppc_flags & POWERPC_FLAG_HID0_LE) { /* @@ -143,8 +140,9 @@ void hreg_compute_hflags(CPUPPCState *env) QEMU_BUILD_BUG_ON(MSR_VR != HFLAGS_VR); msr_mask |= 1 << MSR_VR; } - if ((ppc_flags & POWERPC_FLAG_VSX) && (msr & (1 << MSR_VSX))) { - hflags |= 1 << HFLAGS_VSX; + if (ppc_flags & POWERPC_FLAG_VSX) { + QEMU_BUILD_BUG_ON(MSR_VSX != HFLAGS_VSX); + msr_mask |= 1 << MSR_VSX; } if ((ppc_flags & POWERPC_FLAG_TM) && (msr & (1ull << MSR_TM))) { hflags |= 1 << HFLAGS_TM;