From patchwork Thu Sep 26 03:22:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaoqin Huang X-Patchwork-Id: 13812772 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 52C55CCFA14 for ; Thu, 26 Sep 2024 03:26:25 +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: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:In-Reply-To:References:List-Owner; bh=G9f4byrjiwH6wxJoG0csJWGAC6yAuVUSWGNgTr0uQkg=; b=iRdySyPJMqPIQ12ujyDkpXb9O3 cL74iUQDytOhSEsCpXZr8yqNmZagCRddiWIN+1q0LiCom76xCcxkVU3UYhsU/qnfQWJmyHFxF6Si8 CMBfVyhKIdoYoKnDqMEoxXg92PSPRvQzyfgwDu3zYEUDRPZewPsDTRDuWrBbQ3LYmuAWr7nazinzG 9NmAGtpWpYvfqqv72/UrL5tryfxi0GokCUZHxPZXnMXVC0JTv9Y5L7DNj16JNhLGiWFYHSAJp+3Qr rTDK4B8nrndVMVmtF2PUpkkMLw9DgHBVsYihKJMlrYPHQsD5bDN28pd31B5wQesc2FAYtMU431v7/ 9FWg+0lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stf8x-000000074n6-2Bdt; Thu, 26 Sep 2024 03:26:15 +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-000000074f0-3nT8 for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2024 03:25:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727321102; 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; bh=G9f4byrjiwH6wxJoG0csJWGAC6yAuVUSWGNgTr0uQkg=; b=YMPDQCtgP3lbZlmQS0Ba9rFtYOPnAU3G1YiFRSvzfhRDzX+wo5mKCh3Ho7AFbNkdd5DUDF zgIWD9T9bgobmoRWW6CWI/xBF9Om/7xThqp2ZZfvY01QgpDs11/jjzXrXJLm0SQ3BEFrMd o68vd+KbwTDfuN/Fpn6MwP7V36L4Upo= Received: from mx-prod-mc-05.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-546-zbadzE0GN4uVCShacfgS2g-1; Wed, 25 Sep 2024 23:23:08 -0400 X-MC-Unique: zbadzE0GN4uVCShacfgS2g-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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A8EBF1933EB5; Thu, 26 Sep 2024 03:23:05 +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 DA91219560A3; Thu, 26 Sep 2024 03:23:00 +0000 (UTC) From: Shaoqin Huang To: Oliver Upton , Marc Zyngier , kvmarm@lists.linux.dev Cc: Eric Auger , Sebastian Ott , Cornelia Huck , Shaoqin Huang , Catalin Marinas , Fuad Tabba , James Morse , Joey Gouly , Kristina Martsenko , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Mark Brown , Paolo Bonzini , Shuah Khan , Suzuki K Poulose , Will Deacon , Zenghui Yu Subject: [RFC PATCH v1 0/2] Allow the RAS feature bit in ID_AA64PFR0_EL1 writable from userspace Date: Wed, 25 Sep 2024 23:22:38 -0400 Message-Id: <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_202503_079561_5D59D051 X-CRM114-Status: GOOD ( 10.04 ) 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 the RAS feature bit is not writable in ID_AA64PFR0EL1, this makes migration fail when migration from the machine which RAS is 1 to another machine which RAS is 2. Allow RAS writable from userspace would make the migration possible between two machines which RAS is different. Shaoqin Huang (2): KVM: arm64: Use kvm_has_feat() to check if FEAT_RAS is advertised to the guest KVM: arm64: Allow the RAS feature bit in ID_AA64PFR0_EL1 writable from userspace arch/arm64/kvm/guest.c | 4 ++-- arch/arm64/kvm/handle_exit.c | 2 +- arch/arm64/kvm/hyp/include/hyp/switch.h | 2 +- arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 7 +++++-- arch/arm64/kvm/sys_regs.c | 3 +-- tools/testing/selftests/kvm/aarch64/set_id_regs.c | 1 + 6 files changed, 11 insertions(+), 8 deletions(-)