Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4171456ybg; Tue, 29 Oct 2019 03:16:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQDdAL7X/7Yl6xY3W3vKZlYQuB/3eWBQW9Ecq9YEMrqC/8AxejeDGB/Hgipn6qaG7Da5WY X-Received: by 2002:aa7:d755:: with SMTP id a21mr12627328eds.98.1572344172878; Tue, 29 Oct 2019 03:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572344172; cv=none; d=google.com; s=arc-20160816; b=LXiPmQnteA306OghOCbUQk0FkzGwjMx6OGgGneBe2VI+fbX3REAsmmwt0Mo6wFu47V xPoS4OW2dzIi7rpWWaoq/y8lKi5lZoP421y872D5C2w/ZamVnV5zKC8tX8sbp5GO6u4s 52yAZIKf2L0fIRe8+kwnMX+LnohAYaIHFKB3yNPMwBW/Gh2Xp5dDNPl30rIblo9D+Ngw n4g5x4Z/d6RtHtcofZJs9nSNIrHcV6vKsmlQd4ToLTHmkK4V36OZriJNBvMRvJNL52GU pDLULg+ref7uD89J3Mb1k0q1T+qqbjQa/Qki9/oWS8/4NPkNG+5gfV/43bzFO67E/pdN hsMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Xez2J0gdWTQqquZ7HMjmzRRSRKuRWvTSCcnNPVHNA/g=; b=SfRVQM/KKsvDv8vSzT5+Do3i6ECko33vMhqSKLsXWCDD7WnIzGcQJI86nGzqtPbxE1 hjmO83UiLplgMtOMcmFwfQaIRDKUCthUwKBmV9Exz99vHN7dGtTNGCDQvtlTUyaKa3Bo sZHuxvsVyPs09YhT2gEUsHCHv9fy0ixImJIBPcfKuxyEsyWBSeHxeTlxIyFGONuUtX36 e0TuPEjrowvrUEhdTpQL3/kGebTZFMY3ot/0j77Ex/v5rJWI9xV+frjxYazqf4814Eyz LIe1YkwRx3FfXgcDF0IctVrN+H7TDqRRBrStCkeQd5UYFK2l5/iXv/xekghYmX07AOA8 0gmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ahVlpW42; 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 r8si8068871eju.426.2019.10.29.03.15.49; Tue, 29 Oct 2019 03:16:12 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ahVlpW42; 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 S1730250AbfJ2I4v (ORCPT + 99 others); Tue, 29 Oct 2019 04:56:51 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38224 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727931AbfJ2I4u (ORCPT ); Tue, 29 Oct 2019 04:56:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Xez2J0gdWTQqquZ7HMjmzRRSRKuRWvTSCcnNPVHNA/g=; b=ahVlpW42taty0lSMLliukzweJ 8X1ZH4o3vxmyak/TqNyxf+gECDUZYtp8vOeQ6+PqM84XwgzJLbPzwd6Qt5PG44zLYkayeKOqdVGWk EBvmbYDmTM/qMF9WUUuSFuzj2Yrw62cJy0fL24dBwAnFV6zbi4EHYEPP2hiqc6+RuQoBTvJooa8iE dBkUF5CznIhOc0ErpTfWlgg77CpH39CI/28hg7lS84MVEc7lexhWN9OMfGXalAzlEx+6LluZy7E9b SEEoo+KVUU78wyle+Ct+G9N34+5ZPTjrbW0oiZMpsHqpx6uZJTKYLC8hTHFiDG1UVwmoIq3RDBTuP 2ebVCEniw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPNIL-0008JR-Rv; Tue, 29 Oct 2019 08:56:06 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 74473306091; Tue, 29 Oct 2019 09:55:01 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 20B0220D7FEE3; Tue, 29 Oct 2019 09:56:02 +0100 (CET) Date: Tue, 29 Oct 2019 09:56:02 +0100 From: Peter Zijlstra To: "Kirill A. Shutemov" Cc: Dan Williams , Mike Rapoport , Linux Kernel Mailing List , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Dave Hansen , James Bottomley , Steven Rostedt , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Linux API , linux-mm , the arch/x86 maintainers , Mike Rapoport Subject: Re: [PATCH RFC] mm: add MAP_EXCLUSIVE to create exclusive user mappings Message-ID: <20191029085602.GI4114@hirez.programming.kicks-ass.net> References: <1572171452-7958-1-git-send-email-rppt@kernel.org> <1572171452-7958-2-git-send-email-rppt@kernel.org> <20191028123124.ogkk5ogjlamvwc2s@box> <20191028130018.GA7192@rapoport-lnx> <20191028131623.zwuwguhm4v4s5imh@box> <20191029064318.s4n4gidlfjun3d47@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191029064318.s4n4gidlfjun3d47@box> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 29, 2019 at 09:43:18AM +0300, Kirill A. Shutemov wrote: > But some CPUs don't like to have two TLB entries for the same memory with > different sizes at the same time. See for instance AMD erratum 383. > > Getting it right would require making the range not present, flush TLB and > only then install huge page. That's what we do for userspace. > > It will not fly for the direct mapping. There is no reasonable way to > exclude other CPU from accessing the range while it's not present (call > stop_machine()? :P). Moreover, the range may contain the code that doing > the collapse or data required for it... > > BTW, looks like current __split_large_page() in pageattr.c is susceptible > to the errata. Maybe we can get away with the easy way... As you write above, there is just no way we can have a (temporary) hole in the direct map. We are careful about that other errata, and make sure both translations are identical wrt everything else.