Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3061695imm; Sun, 1 Jul 2018 11:20:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcpTQEAvAs0b97rgpWadZzXnpLiCTL5YaLt5mup6f/huEAIM//BM3YA8R6u9Wy843Qggcf+ X-Received: by 2002:a62:138c:: with SMTP id 12-v6mr22659205pft.34.1530469226204; Sun, 01 Jul 2018 11:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530469226; cv=none; d=google.com; s=arc-20160816; b=cvJWxF7hNViGggi/0NJx2FkjBxZZdSwxXz8S4BBQ83VECnr0v3nNgXeVpWCRDxy/Q7 i8vgVwvvkdnxKii3OFKjL+LFV7R+qOTaHbfquwy8pUkYqQmhrgQeysHL+AQAC8fejgIH b4Z/YEcdXV0RAHy4wI2OFlRg6U7ibKun1fUi2ta3fJRb96kyxVlLIk8RMGERT/Jx3ooO zLCw1TBA9EyD2ZNHPgxA8B5c71esRPuBCkp0R32kY9LQ5T0QMAWBMy5XQ5AZpReckf4H m9EP+YospDKb344T+rWS5RBSc/ebYOY7OxCkDm2D1i+yDvvqpVx+pCV+7uZhF4+AbDAo WTGA== 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=EulEgogDx6T8zLsH5qmEZ1CPnpocn/ssIjRWKJ2Hmho=; b=qfrto69TnJ5RcoQ73PkANi4dD8Uk+A067s8z/jE2ELQ3TTt4tbt6kPIL+19rmYIwqU E8RfZwJc/yVVS9pwkXIZdpfL9RUKHrtEv0NQSZtlwAVN4CuwXU1oojUhL7d4Pag/1Nrx e0Ki7mVRF6siUYfa0JMW2Q1EKGIZvoMdoTwaSS30aOszMOW1xHA+BXZZAAmTSS5hHpIM 5o2aGuPsnp+c8kMZxS+2PqTXoKkoDa/q374I01SQbw89NtoWVpbe2hLtBGgOnIs+PPLD WDfZmjmobH6nfMJlawzQvERB5HOhEfq/y/w98Bky52fN+BlTsP1SAPvG7lOy1uT2M2e4 d6iw== 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 3-v6si14075830plx.351.2018.07.01.11.20.12; Sun, 01 Jul 2018 11:20:26 -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 S1753577AbeGAQZi (ORCPT + 99 others); Sun, 1 Jul 2018 12:25:38 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33700 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753514AbeGAQZf (ORCPT ); Sun, 1 Jul 2018 12:25:35 -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 0FF7EACD; Sun, 1 Jul 2018 16:25:34 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Rutland , Will Deacon , Catalin Marinas Subject: [PATCH 4.9 032/101] arm64: mm: Ensure writes to swapper are ordered wrt subsequent cache maintenance Date: Sun, 1 Jul 2018 18:21:18 +0200 Message-Id: <20180701160758.445886785@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Will Deacon commit 71c8fc0c96abf8e53e74ed4d891d671e585f9076 upstream. When rewriting swapper using nG mappings, we must performance cache maintenance around each page table access in order to avoid coherency problems with the host's cacheable alias under KVM. To ensure correct ordering of the maintenance with respect to Device memory accesses made with the Stage-1 MMU disabled, DMBs need to be added between the maintenance and the corresponding memory access. This patch adds a missing DMB between writing a new page table entry and performing a clean+invalidate on the same line. Fixes: f992b4dfd58b ("arm64: kpti: Add ->enable callback to remap swapper using nG mappings") Cc: # 4.16.x- Acked-by: Mark Rutland Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- arch/arm64/mm/proc.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -186,8 +186,9 @@ ENDPROC(idmap_cpu_replace_ttbr1) .macro __idmap_kpti_put_pgtable_ent_ng, type orr \type, \type, #PTE_NG // Same bit for blocks and pages - str \type, [cur_\()\type\()p] // Update the entry and ensure it - dc civac, cur_\()\type\()p // is visible to all CPUs. + str \type, [cur_\()\type\()p] // Update the entry and ensure + dmb sy // that it is visible to all + dc civac, cur_\()\type\()p // CPUs. .endm /*