From patchwork Thu Sep 26 03:22:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaoqin Huang X-Patchwork-Id: 13812773 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49514CCFA10 for ; Thu, 26 Sep 2024 03:27:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=utrx0K/+VugFVIukkmcrJK6P1DSpckYEB9F1vob9W3U=; b=1nLvfPjFlxEh4BV4fSQ+Bq/Y9t Fz+HLJiTyQ6pLc1gaI1Hhw4Gw9W2KOJ2+GSwPPPmAUEoOSgLY2t0+Y4DwTzmk8UHw4hClCcOWVIHK RmY94UohxVTnYoWdud9kk2Y6UKnVc3J768c920jEPdOW5j6MKvxlGKmqYPMkKcRCbaXcQsck9+Fbd 93AGzhDcP2rbX/iCVeird8hY9KtWi0ziYD0D+Y0EhPZtAv2I9AJJW9rgBKPAiIwRAr6WRsiRhpQvs fVYM6EuXwrwJRZb+ULDwtOtf/CIbISqEzfLuJEJ11bfM42Y8HpH/diedc2iPTKqAkQcS2od7a62gp /6MaR36w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stfA6-000000074uR-454S; Thu, 26 Sep 2024 03:27:26 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stf7m-000000074eS-2Ngg for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2024 03:25:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727321100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=utrx0K/+VugFVIukkmcrJK6P1DSpckYEB9F1vob9W3U=; b=IF9FqEAEF+j5RDPexX8z8p51iYEVYKyreQWYR9eSEJ0RUGBV0gITysGH2SZasPIbOT1Nl6 xws13oxKkXGMkAE02o0W/cMdsf1jyGyKwVzO3QrnDTkYY3ICFOSIgkxxDNOtvf1VGe0jwn +EkWo4lsJZR4x184z6qjW9qO5JoNoMw= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-7yAz8LruPE6dXZbcRoFGBw-1; Wed, 25 Sep 2024 23:23:16 -0400 X-MC-Unique: 7yAz8LruPE6dXZbcRoFGBw-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B8B8E19373E5; Thu, 26 Sep 2024 03:23:14 +0000 (UTC) Received: from virt-mtcollins-01.lab.eng.rdu2.redhat.com (unknown [10.8.1.196]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1217A19560A3; Thu, 26 Sep 2024 03:23:11 +0000 (UTC) From: Shaoqin Huang To: Oliver Upton , Marc Zyngier , kvmarm@lists.linux.dev Cc: Eric Auger , Sebastian Ott , Cornelia Huck , Shaoqin Huang , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Paolo Bonzini , Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [RFC PATCH v1 2/2] KVM: arm64: Allow the RAS feature bit in ID_AA64PFR0_EL1 writable from userspace Date: Wed, 25 Sep 2024 23:22:40 -0400 Message-Id: <20240926032244.3666579-3-shahuang@redhat.com> In-Reply-To: <20240926032244.3666579-1-shahuang@redhat.com> References: <20240926032244.3666579-1-shahuang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240925_202502_745834_3AC1E8FA X-CRM114-Status: GOOD ( 12.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently FEAT_RAS is not writable, this makes migration fail between systems where this feature differ. Allow the FEAT_RAS writable in ID_AA64PFR0_EL1 to let the migration possible when the RAS is differ between two machines. Also update the kselftest to test the RAS field. Signed-off-by: Shaoqin Huang --- arch/arm64/kvm/sys_regs.c | 1 - tools/testing/selftests/kvm/aarch64/set_id_regs.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index b09f8ba3525b..51ff66a11793 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -2364,7 +2364,6 @@ static const struct sys_reg_desc sys_reg_descs[] = { .val = ~(ID_AA64PFR0_EL1_AMU | ID_AA64PFR0_EL1_MPAM | ID_AA64PFR0_EL1_SVE | - ID_AA64PFR0_EL1_RAS | ID_AA64PFR0_EL1_GIC | ID_AA64PFR0_EL1_AdvSIMD | ID_AA64PFR0_EL1_FP), }, diff --git a/tools/testing/selftests/kvm/aarch64/set_id_regs.c b/tools/testing/selftests/kvm/aarch64/set_id_regs.c index d20981663831..d2dd78ce0e02 100644 --- a/tools/testing/selftests/kvm/aarch64/set_id_regs.c +++ b/tools/testing/selftests/kvm/aarch64/set_id_regs.c @@ -126,6 +126,7 @@ static const struct reg_ftr_bits ftr_id_aa64pfr0_el1[] = { REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, CSV2, 0), REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, DIT, 0), REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, SEL2, 0), + REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, RAS, 0), REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, EL3, 0), REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, EL2, 0), REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, EL1, 0),