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 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67AC1C388F9 for ; Wed, 11 Nov 2020 22:03:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 E1A3E2087D for ; Wed, 11 Nov 2020 22:03:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DKNcjFvI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="jldkB27k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1A3E2087D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WNmgT8FtaN2f1+6TRUdRi5FRH5qYXH3MiR8/64Jk+ys=; b=DKNcjFvI5AbJrmj0fLvlt6IGW exSYohdwXH+DOaeymnTf6tDPpDEby2Ovg/mgn14PJZYaenep1Oa69mzZLclMtCtReWOh+RDeT0tST F82WB2Lvm/pHXZrgK3SVDBDRfu/j47NkVRfcO2p0BF1iNNdlKqw83MDbN3cE0XS1XTTF+KozK88cu 13tgPqWG6B1zdHcKS8Ys60+MZkmt1ygEpTfUCzAb7OYRSCZ0MMZVRHKmwtVCiRrzrHiJYODSaqCCN V5dL7IN3JiiGCvXSSBlGvpmpyjtLm/GEIxmOW/+sbdOdyy4LqroRiM574upqig/dBCk7NAJMCE/oH GqVjUWOSA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcyB2-0005HI-4G; Wed, 11 Nov 2020 22:01:16 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcyAz-0005Gp-GX for linux-arm-kernel@lists.infradead.org; Wed, 11 Nov 2020 22:01:14 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (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 A4BED20709; Wed, 11 Nov 2020 22:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605132071; bh=yfmnLKnD360CSGBWVhdrKZ/Sup7sBNsW6MAI3Nfho2k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jldkB27kxTY+vA/vzf03GgekORhjmJNW639J6cu9somkjx6HWjYcF8OJiQ+JOZyDe J40iTJ/dweKJYW5WKzVpWdSZN3qjSDRKYdcvOgim6L3+ObB/PIyVJ2//I/+WFWJmxA h3dl5YO5W+jPMlChG6KmNmqrkRnIJVIBbKLpnva4= Date: Wed, 11 Nov 2020 22:01:06 +0000 From: Will Deacon To: Marc Zyngier Subject: Re: [PATCH v2 1/3] KVM: arm64: Allow setting of ID_AA64PFR0_EL1.CSV2 from userspace Message-ID: <20201111220105.GA18414@willie-the-truck> References: <20201110141308.451654-1-maz@kernel.org> <20201110141308.451654-2-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201110141308.451654-2-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201111_170113_700473_017AE7FA X-CRM114-Status: GOOD ( 18.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, Suzuki K Poulose , Peng Liang , James Morse , Julien Thierry , kernel-team@android.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org 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 Tue, Nov 10, 2020 at 02:13:06PM +0000, Marc Zyngier wrote: > We now expose ID_AA64PFR0_EL1.CSV2=1 to guests running on hosts > that are immune to Spectre-v2, but that don't have this field set, > most likely because they predate the specification. > > However, this prevents the migration of guests that have started on > a host the doesn't fake this CSV2 setting to one that does, as KVM > rejects the write to ID_AA64PFR0_EL2 on the grounds that it isn't > what is already there. > > In order to fix this, allow userspace to set this field as long as > this doesn't result in a promising more than what is already there > (setting CSV2 to 0 is acceptable, but setting it to 1 when it is > already set to 0 isn't). > > Fixes: e1026237f9067 ("KVM: arm64: Set CSV2 for guests on hardware unaffected by Spectre-v2") > Reported-by: Peng Liang > Signed-off-by: Marc Zyngier > --- > arch/arm64/include/asm/kvm_host.h | 2 ++ > arch/arm64/kvm/arm.c | 16 ++++++++++++ > arch/arm64/kvm/sys_regs.c | 42 ++++++++++++++++++++++++++++--- > 3 files changed, 56 insertions(+), 4 deletions(-) Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel