Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1894803pxf; Sat, 13 Mar 2021 00:48:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwuER/J6HrnleP7ivXHB7oAt0ZopVMCBsu8Nm9z8h3/FvpznV6BpO5+bQI782sVq5sNtF8u X-Received: by 2002:a17:906:9509:: with SMTP id u9mr13064592ejx.225.1615625333404; Sat, 13 Mar 2021 00:48:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615625333; cv=none; d=google.com; s=arc-20160816; b=ocWa/9qkDQqIFMD0KYuTW42nY2j9iqy3R1w2BEJfASeCkt+4bVhZ5jh5muKIMIxp5d OzonO38zrRkavrtXiYDhEGiIwoJF41ztTl+x/PyEtD2mXwiLAzsaH1Q37bjiMyq7fQfk sWQKjwE1lwkl+dwJniP6UKpO6e5uhQkPsNz0jVht9flmOHVxAO/hjavIaFlQ/a/RJT9/ aqhfrDF58WgRjgmML1WKJu47VpMiG1UaSKkBhUYJULkG8PraCRYmxNA54nBve6G5Fxb/ Chy5jmdZJM+P0T8KBeFJKT1tRcX+qAAkVW/rRiwKh8w3biXe2r794uhg+36ox5CxBBuK zbOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Di0j9Fmdz2pkuGSuMTT3DRwRu+d43uTG9S4d5kZrBw4=; b=R/MJBcT0ce+sa+XtULZf5SLGK0+E9N12FGTN1rBqv6CFt2mOF51FfzfAZRAJHHLQbg sGsRd3U6OHFXkSfAZElQH8mRCbHAgCTyC51G6PO/JW/qeDkgopkT7f86t3IJPTZK4yFX fIan0AvGdHsb/kt/XrUxSNCffrvksP8flvpe5WUnvjkGVyrwbs9cHOH8BBdRBwcAacas 7AAAavKspnQjKB+OBVS6MnDc44OFTpoXzIC7E1xieHTHR3mGlRpIahHbImYDLtMDuKZG IMM8XLfnbyzsp+8ZBmT0DOyMOWVPwhBeip6ZlVz/mp0my34+J0eCA11/ssZXYDTyiZuz 60VA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lj22si6370526ejb.614.2021.03.13.00.48.30; Sat, 13 Mar 2021 00:48:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232331AbhCMIq2 (ORCPT + 99 others); Sat, 13 Mar 2021 03:46:28 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:37777 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231938AbhCMIqU (ORCPT ); Sat, 13 Mar 2021 03:46:20 -0500 X-Originating-IP: 2.7.49.219 Received: from debian.home (lfbn-lyo-1-457-219.w2-7.abo.wanadoo.fr [2.7.49.219]) (Authenticated sender: alex@ghiti.fr) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 7EC3A240002; Sat, 13 Mar 2021 08:46:13 +0000 (UTC) From: Alexandre Ghiti To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Nylon Chen , Nick Hu , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com Cc: Alexandre Ghiti , Palmer Dabbelt Subject: [PATCH v3 1/2] riscv: Ensure page table writes are flushed when initializing KASAN vmalloc Date: Sat, 13 Mar 2021 03:45:04 -0500 Message-Id: <20210313084505.16132-2-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210313084505.16132-1-alex@ghiti.fr> References: <20210313084505.16132-1-alex@ghiti.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make sure that writes to kernel page table during KASAN vmalloc initialization are made visible by adding a sfence.vma. Signed-off-by: Alexandre Ghiti Reviewed-by: Palmer Dabbelt --- arch/riscv/mm/kasan_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c index 1b968855d389..57bf4ae09361 100644 --- a/arch/riscv/mm/kasan_init.c +++ b/arch/riscv/mm/kasan_init.c @@ -187,6 +187,8 @@ void __init kasan_shallow_populate(void *start, void *end) } vaddr += PAGE_SIZE; } + + local_flush_tlb_all(); } void __init kasan_init(void) -- 2.20.1