From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19B22C433EF for ; Fri, 29 Oct 2021 11:32:28 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C93276108F for ; Fri, 29 Oct 2021 11:32:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C93276108F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CWQBGOhucD0ugtQRh9ri9F/I19Ml08rXdqxgIBCpkpQ=; b=IRsbh49vDRlFKk MwKThAHiEH/tjhirOsyUKSJmZLP3sxScMHma6ZI6FSI9sK6tiAnTcgem3cN19XISiKAbWYqdGtZhH gDhHURxLVJJj7d+IhH7jnL1G3sGE4uqG020HqcoAbY1xCGZBO7E39nRDOFYuo0GUdJqW/IzvZliTe uUaQYZLHyh3ZvijxlpydYEU6/4rg1hPp63FitkLrfSEj998nhmsZGt+1OJkTnQNuyZV4+WBXytzta 6CZt1/4itpeVP+S87fPM5i5fTS0XthazDIKJpBArSHmJLYRJ0qG33KByIIh6aIcm63lRhFgghcvzp PNlFrkrmcSNHbk5fCHQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgQ6V-00AkjU-5M; Fri, 29 Oct 2021 11:31:23 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgQ6R-00Akin-EW for linux-arm-kernel@lists.infradead.org; Fri, 29 Oct 2021 11:31:20 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ED34361167; Fri, 29 Oct 2021 11:31:18 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mgQ6O-002P4Z-QB; Fri, 29 Oct 2021 12:31:16 +0100 Date: Fri, 29 Oct 2021 12:31:16 +0100 Message-ID: <87k0hw9iez.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Andrew Jones , Peter Shier , Ricardo Koller , Reiji Watanabe Subject: Re: [PATCH 3/3] KVM: arm64: Raise KVM's reported debug architecture to v8.2 In-Reply-To: <20211029003202.158161-4-oupton@google.com> References: <20211029003202.158161-1-oupton@google.com> <20211029003202.158161-4-oupton@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oupton@google.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, drjones@redhat.com, pshier@google.com, ricarkol@google.com, reijiw@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211029_043119_538498_4DFF7420 X-CRM114-Status: GOOD ( 23.56 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 29 Oct 2021 01:32:02 +0100, Oliver Upton wrote: > > The additions made to the Debug architecture between v8.0 and v8.2 are > only applicable to external debug. KVM does not (and likely will never) > support external debug, so KVM can proudly report support for v8.2 to > its guests. > > Raise the reported Debug architecture to v8.2. Additionally, v8.2 makes > FEAT_DoubleLock optional. Even though KVM never supported it in the > first place, report DoubleLock as not implemented now as the > architecture permits it for v8.2. > > Cc: Reiji Watanabe > Cc: Ricardo Koller > Suggested-by: Marc Zyngier > Signed-off-by: Oliver Upton > --- > arch/arm64/kvm/sys_regs.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > index 0840ae081290..f56ee5830d18 100644 > --- a/arch/arm64/kvm/sys_regs.c > +++ b/arch/arm64/kvm/sys_regs.c > @@ -1109,9 +1109,14 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu, > ARM64_FEATURE_MASK(ID_AA64ISAR1_GPI)); > break; > case SYS_ID_AA64DFR0_EL1: > - /* Limit debug to ARMv8.0 */ > + /* Limit debug to ARMv8.2 */ > val &= ~ARM64_FEATURE_MASK(ID_AA64DFR0_DEBUGVER); > - val |= FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64DFR0_DEBUGVER), 6); > + val |= FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64DFR0_DEBUGVER), 8); > + > + /* Hide DoubleLock from guests */ > + val &= ~ARM64_FEATURE_MASK(ID_AA64DFR0_DOUBLELOCK); > + val |= FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64DFR0_DOUBLELOCK), 0CF); > + One issue with that is that this will break migration from an older kernel (DFR0 will be different between source and destination). You'll need a set_user handler and deal with it in a similar way to CSV2/CSV3. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel