Message ID | 20230509142235.3284028-7-kristina.martsenko@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2966532vqo; Tue, 9 May 2023 08:18:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6lx+7Q8m0TBL0d/KrOKQNGPdCYt9zX5gbQdw9NCrzF3tnQsvtbjtZ+/0P957pi9r9fKhIW X-Received: by 2002:a17:90b:38c2:b0:24d:f67d:7177 with SMTP id nn2-20020a17090b38c200b0024df67d7177mr21197551pjb.20.1683645538286; Tue, 09 May 2023 08:18:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683645538; cv=none; d=google.com; s=arc-20160816; b=m1wQIeQMFwRtqBcw+JcyST2OEjNLC3Ln02CpChvM4tR9PEU+XJ1PmBRbVLB6uhzMAU 2XtwiyOihYF+r/6mc+tnuiJEE6Q/Yun871javXDVIUDKOMZH/LmRgFrEDhzTM6psxI0A QYJ1DcO/JLf9OGsfX+kr7UocmPCjgKS6qxXQ1U/SbxKucSh0VFpyfsYt0gQa/hN1oKZy D1asDIu7pelEdcChY00i/jvvi2HIiczSHEnHwlW21dtAo2H3dXyKkfu8u9X8wN7Nt7er LJy4S4ih9N5V46qRN8LqqmPqenYzUytmYR2Ih3ocKohzrp2Wd9HyNNMBkpPNTbfY60kl l2Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5xcbzUmsxv9J3W69JnKM74WfS7Uc0TUI2Hyw0DuZLd8=; b=xLKkxeeznpcTtjJFpSVlpEwnYqqVYzd3PZcfv9FaQnm2vgkVUxRTpsNDXdfCBH8F0k TGwbyCYWJfX4IKvmspKBqwioi/dIXxIL9XxzF/639X1S/ttcjW4dh8Tg3kFbuPWPU5RZ KyhW7xxqfP0BRAEqtsvv0lNUJvlIZKw+fCiO+zmaywxlwX+h/B2PsVmqUprVDw4/fmAZ 2q2jR98vto0GRRQg9inZNHiMyOGUL3Rv56PkecbSzKXfRFAnt1Pm5yLE6M5YTTx7W0B6 GbksElkA/UVbEEMBup8fZ1MjlgEbnN0jCdt9XRke7pAJ0/w8GeGG0laGwJa4t8mvpzrF fAfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j20-20020a633c14000000b005303c1de315si1636511pga.853.2023.05.09.08.18.44; Tue, 09 May 2023 08:18:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235890AbjEIOXw (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Tue, 9 May 2023 10:23:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235887AbjEIOXp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 9 May 2023 10:23:45 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 882F54C2C for <linux-kernel@vger.kernel.org>; Tue, 9 May 2023 07:23:35 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 973191063; Tue, 9 May 2023 07:24:19 -0700 (PDT) Received: from e126864.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3ABC93F663; Tue, 9 May 2023 07:23:32 -0700 (PDT) From: Kristina Martsenko <kristina.martsenko@arm.com> To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Cc: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>, Oliver Upton <oliver.upton@linux.dev>, James Morse <james.morse@arm.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, Zenghui Yu <yuzenghui@huawei.com>, Mark Rutland <mark.rutland@arm.com>, Mark Brown <broonie@kernel.org>, Luis Machado <luis.machado@arm.com>, Vladimir Murzin <vladimir.murzin@arm.com>, linux-kernel@vger.kernel.org Subject: [PATCH v2 06/11] KVM: arm64: hide MOPS from guests Date: Tue, 9 May 2023 15:22:30 +0100 Message-Id: <20230509142235.3284028-7-kristina.martsenko@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230509142235.3284028-1-kristina.martsenko@arm.com> References: <20230509142235.3284028-1-kristina.martsenko@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765430303643612136?= X-GMAIL-MSGID: =?utf-8?q?1765430303643612136?= |
Series |
arm64: Support for Armv8.8 memcpy instructions in userspace
|
|
Commit Message
Kristina Martsenko
May 9, 2023, 2:22 p.m. UTC
As FEAT_MOPS is not supported in guests yet, hide it from the ID registers for guests. The MOPS instructions are UNDEFINED in guests as HCRX_EL2.MSCEn is not set in HCRX_GUEST_FLAGS, and will take an exception to EL1 if executed. Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com> --- arch/arm64/kvm/sys_regs.c | 1 + 1 file changed, 1 insertion(+)
Comments
> As FEAT_MOPS is not supported in guests yet, hide it from the ID > registers for guests. > The MOPS instructions are UNDEFINED in guests as HCRX_EL2.MSCEn is not > set in HCRX_GUEST_FLAGS, and will take an exception to EL1 if executed. For my benefit, could you please explain why no support for guests yet? Why not set HCRX_EL2.MSCEn in this series?
On 25/05/2023 20:26, Colton Lewis wrote: >> As FEAT_MOPS is not supported in guests yet, hide it from the ID >> registers for guests. > >> The MOPS instructions are UNDEFINED in guests as HCRX_EL2.MSCEn is not >> set in HCRX_GUEST_FLAGS, and will take an exception to EL1 if executed. > > For my benefit, could you please explain why no support for guests yet? > Why not set HCRX_EL2.MSCEn in this series? There's probably a few more things that need doing for guest support, such as setting the HCRX_EL2.MCE2 bit and handling the mops exception in KVM. I'm currently having a look at guest support. Thanks, Kristina
On Tue, 09 May 2023 15:22:30 +0100, Kristina Martsenko <kristina.martsenko@arm.com> wrote: > > As FEAT_MOPS is not supported in guests yet, hide it from the ID > registers for guests. > > The MOPS instructions are UNDEFINED in guests as HCRX_EL2.MSCEn is not > set in HCRX_GUEST_FLAGS, and will take an exception to EL1 if executed. > > Acked-by: Catalin Marinas <catalin.marinas@arm.com> > Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com> This is very likely to clash with Jing's series that completely reworks the whole idreg series, but as long as this is on its own branch, we can deal with that. Acked-by: Marc Zyngier <maz@kernel.org> M.
On Sat, Jun 03, 2023 at 09:42:18AM +0100, Marc Zyngier wrote: > On Tue, 09 May 2023 15:22:30 +0100, > Kristina Martsenko <kristina.martsenko@arm.com> wrote: > > > > As FEAT_MOPS is not supported in guests yet, hide it from the ID > > registers for guests. > > > > The MOPS instructions are UNDEFINED in guests as HCRX_EL2.MSCEn is not > > set in HCRX_GUEST_FLAGS, and will take an exception to EL1 if executed. > > > > Acked-by: Catalin Marinas <catalin.marinas@arm.com> > > Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com> > > This is very likely to clash with Jing's series that completely > reworks the whole idreg series, but as long as this is on its own > branch, we can deal with that. Yup, we will definitely want to get that ironed out. I'll pull Catalin's branch when this all gets queued up. Acked-by: Oliver Upton <oliver.upton@linux.dev>
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 71b12094d613..6dae7fe91cfa 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1252,6 +1252,7 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu, struct sys_reg_desc const *r ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_GPA3)); if (!cpus_have_final_cap(ARM64_HAS_WFXT)) val &= ~ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_WFxT); + val &= ~ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_MOPS); break; case SYS_ID_AA64DFR0_EL1: /* Limit debug to ARMv8.0 */