Received: by 10.213.65.68 with SMTP id h4csp1726815imn; Mon, 19 Mar 2018 11:33:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELsolxK5CBZGAb0jzM1fsgUKlILf9MalSWePZrPFRcUNE9kX3Jp+t2q1wC1rhmE5F0eg7Pt2 X-Received: by 10.99.132.72 with SMTP id k69mr9865712pgd.367.1521484412094; Mon, 19 Mar 2018 11:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521484412; cv=none; d=google.com; s=arc-20160816; b=Gck+RHskd4Y7rIIRo88ccYKVWvvdASfqgn2yutUs4+M711DtAArJrEp4t2iBh7/vcr rL8ft0zs2CKYj8hPkGrWvus2TAezDmjrLlAPeZOUbn1ggFbPPWe8gjm+IzCdZCjnDuj+ KQcS76hpMHlBfrTK1CYH760lXC8oLdi5ELUxwdsZYMsCwD7/814UvzOsxMpqe3CaqUWh CIvNowQQf6yV+pDozbQRh01gf5wyEhS/76+TR75XcjTFCUOPXosoEWv/eaoyJdRJc8Hf LwWIebXcPsqtVqBMtYpZ7xRzobxuz4sl/pSRiFm/bXMXXzX6z6UbI2j5gHgOCX8IZ9zC h9qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3lxF/794OiCt2nhz7ujEhXCy5gmJcBbCFHLxZou1OLU=; b=uDWb3RPY/+gQeHgyc+PcFNUuplAkZ+7fWJ/FkkUxOZxYdnG9zeP4aia4eIHWi7ngv0 n8T5iUmXZTx+EN5KdR8DH5O9jhF0OnIBIdTJPw/QSkxSG1C4klZA6Id7ufPPtI4nwygY GejAD/7ouP8rxmrzia8TxzZ5vntMLuwZ5zINEjVa/Sd4vHhZv/QFAb2Zn4INrZhdg6RF 57DvBpxPg1GCTtLSOAfkDpusTmuuJIekb1Hw4qiTIBBYBwjQ26e+vxIm+uA+aebNg/fR nKxm8o+gJFYvAxOTXEyenADn0jm6iC1atL7uOJL/93+ySAueC6vZbOVfG+G04QPyNP1C kb/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6-v6si423710pll.391.2018.03.19.11.33.18; Mon, 19 Mar 2018 11:33:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031985AbeCSSao (ORCPT + 99 others); Mon, 19 Mar 2018 14:30:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53292 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031755AbeCSSal (ORCPT ); Mon, 19 Mar 2018 14:30:41 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7B85B1224; Mon, 19 Mar 2018 18:30:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoffer Dall , Andre Przywara , Marc Zyngier Subject: [PATCH 4.14 23/41] kvm: arm/arm64: vgic-v3: Tighten synchronization for guests using v2 on v3 Date: Mon, 19 Mar 2018 19:08:23 +0100 Message-Id: <20180319180733.751463832@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180732.195217948@linuxfoundation.org> References: <20180319180732.195217948@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marc Zyngier commit 27e91ad1e746e341ca2312f29bccb9736be7b476 upstream. On guest exit, and when using GICv2 on GICv3, we use a dsb(st) to force synchronization between the memory-mapped guest view and the system-register view that the hypervisor uses. This is incorrect, as the spec calls out the need for "a DSB whose required access type is both loads and stores with any Shareability attribute", while we're only synchronizing stores. We also lack an isb after the dsb to ensure that the latter has actually been executed before we start reading stuff from the sysregs. The fix is pretty easy: turn dsb(st) into dsb(sy), and slap an isb() just after. Cc: stable@vger.kernel.org Fixes: f68d2b1b73cc ("arm64: KVM: Implement vgic-v3 save/restore") Acked-by: Christoffer Dall Reviewed-by: Andre Przywara Signed-off-by: Marc Zyngier Signed-off-by: Greg Kroah-Hartman --- virt/kvm/arm/hyp/vgic-v3-sr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/virt/kvm/arm/hyp/vgic-v3-sr.c +++ b/virt/kvm/arm/hyp/vgic-v3-sr.c @@ -215,7 +215,8 @@ void __hyp_text __vgic_v3_save_state(str * are now visible to the system register interface. */ if (!cpu_if->vgic_sre) { - dsb(st); + dsb(sy); + isb(); cpu_if->vgic_vmcr = read_gicreg(ICH_VMCR_EL2); }