Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5932449rwr; Tue, 9 May 2023 08:06:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7P3AVZ4B2xSI3N59ovOYgI8EpxdZD2yi+qArNgj3Pq/gHfGrm2NNxidQT7NLTzuP068P9W X-Received: by 2002:a17:903:22c6:b0:1ac:939b:abdb with SMTP id y6-20020a17090322c600b001ac939babdbmr3317676plg.29.1683644801553; Tue, 09 May 2023 08:06:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683644801; cv=none; d=google.com; s=arc-20160816; b=UQdA9Kq3kwmcBvbwK1zaKumlQ78TL3XSV9p3R/6sM36exChSvKXzX78kP0Z47X+jxM mTgP5nY2iR2/xkswCUomZHEHlu7r/u5OezoJtteLbFrCNz/b/o7aszxiJJ8gmxorBAU4 BYsYqQZKR/ekTGFErF7HyOWSfG9WQeM3MpjgBjiu1HPlzoh3hnAhaxR+Or0m/B5ErqMz aFMwWh7ibWsmRFO9eAc8NJUvIJ/9SVwZYDQo1b0eiCRn6TeOCEhVOOtbPQOAzO5h8MVB mfp362z7wedyjISpASk7RQrH6lhzci3BADm1+AdeCCRjgLFvPy7KIJexYU9ZWjNoW5jS Hw4w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 12-20020a63010c000000b005132342a587si1594787pgb.610.2023.05.09.08.06.24; Tue, 09 May 2023 08:06:41 -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 S235889AbjEIOXw (ORCPT + 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 ); 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 ; 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 To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Cc: Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Mark Rutland , Mark Brown , Luis Machado , Vladimir Murzin , 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Kristina Martsenko --- arch/arm64/kvm/sys_regs.c | 1 + 1 file changed, 1 insertion(+) 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 */ -- 2.25.1