Received: by 10.213.65.68 with SMTP id h4csp1732052imn; Mon, 19 Mar 2018 11:43:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELvlWzEtZAfzDn9MH3fHNrhsLzaDu5JutD4Fep3a3rR+7IsnUUPLJIXLTW2jHPEhHDdHDlOl X-Received: by 2002:a17:902:32a2:: with SMTP id z31-v6mr13162620plb.32.1521484998970; Mon, 19 Mar 2018 11:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521484998; cv=none; d=google.com; s=arc-20160816; b=aZ5xL1/RJy9NOnlFY0oDvlVeyR2Lz5DMqsrr4DO4kMDPx8dw0ZwDKrnOqP/NQnSaWo gkid+51FP/i4U/ymLClycfnFLPVLg12DWAfyQ8TbYO0GevoSpjY45LNlQOMEQzVpeABe wlVwBZMcPpjKPouV82zTgG6sKzxmR0FBdjciF9VYmaMdo/KgDDwhCbKUpyl0e8l2uFb0 JrVQNGahF1duKmpXRo7DRcc0cA+c9DjkXmRz57hHsDXEf0+RNMG402+uejTJOG0LbWan 7DICt9reuGDs88sMuA8W63McykBByDJh4d6nPP/mg9tTFJVnAaUsZ1pCPMAbnVLCEFJH YTaA== 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=LA7rcr221Bgol8h3rhn653vzkC1mi96ie8ykYnigkHM=; b=YPt/YTYDgE/gSYU/2OQZo9k3g8j1K9vFoGPg5DfohztXnybaZLugud72nQ8SEGcBbZ WMiNZzjU5vwi2/rhZQS2G4Cgi0h9ybEBZjsjDPE7xCwF7GqcZPrWo/Qim2UIeg8q3bqu PgsPEs6HmVpX6ZsYkHb8b6s9DC5+FvWnaC5plXpBLpx5HPfurnSDK2bmTMW1XwrHBxwP iSrF/3YRdorJPu9Kqf5dphY4r539cGbyP9dbG1zLT3AbowA+7b5HRqrReqSHhDqsuhym Z84VWK57X7e+XfS3rK/RAAxiz0c3HlL3jRIV4050A1PF9y5E5pJJUjtTr9VkWpjitt/m 09gw== 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 v186si386741pfv.21.2018.03.19.11.43.03; Mon, 19 Mar 2018 11:43:18 -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 S970200AbeCSSct (ORCPT + 99 others); Mon, 19 Mar 2018 14:32:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53672 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S970238AbeCSSbs (ORCPT ); Mon, 19 Mar 2018 14:31:48 -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 2DF051291; Mon, 19 Mar 2018 18:31:48 +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.15 23/52] kvm: arm/arm64: vgic-v3: Tighten synchronization for guests using v2 on v3 Date: Mon, 19 Mar 2018 19:08:21 +0100 Message-Id: <20180319180736.394562711@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180734.976730813@linuxfoundation.org> References: <20180319180734.976730813@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.15-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); }