From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88252CA9EAE for ; Tue, 29 Oct 2019 11:00:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 44AEE214B2 for ; Tue, 29 Oct 2019 11:00:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="MSsmJk7A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44AEE214B2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9C5006B0005; Tue, 29 Oct 2019 07:00:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9775D6B0006; Tue, 29 Oct 2019 07:00:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8641F6B0007; Tue, 29 Oct 2019 07:00:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 62BF16B0005 for ; Tue, 29 Oct 2019 07:00:26 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 107007597 for ; Tue, 29 Oct 2019 11:00:26 +0000 (UTC) X-FDA: 76096528452.30.sand05_781c176ba5317 X-HE-Tag: sand05_781c176ba5317 X-Filterd-Recvd-Size: 5354 Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Tue, 29 Oct 2019 11:00:25 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id 195so10169543lfj.6 for ; Tue, 29 Oct 2019 04:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NKg7u5dI/aetXjjN3SsmoQlpBiwrKqqloqLlWWxFfVQ=; b=MSsmJk7AsyIrbYG663mQnrA14v+NrqCOvnBRseZt2FopMZ9uTpUI1uOR5dR4fHu1gw FdmTJYosQ1xm+kJCwJkiAOO8nZx5j4QTGpymQYtbfTWCteuDsHYWDaCZl2pLc7vcRuSb c6Q9pbUd4WTNvpMp8/BvmIT1A7InVptd/VHSKmpDflICy8t1DrZzOz9/351E1JWbB3oo AtGltGjkkd67KkvekD5lyOpgdy17ZyO5fSmzF3cw8pldgoFFz0h3MKfuln6D/1IZvq86 wdq2peV4QeI6PagkdlhXVpJyu/Jp0oOV6Xs9u62tAyHG4K/xHabybrybipUrHF09EOeR gJsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NKg7u5dI/aetXjjN3SsmoQlpBiwrKqqloqLlWWxFfVQ=; b=gcokzIUdzv2OA5KtXmafs42L1fiFbFXw8g9Gk2GbfbbM1/0u6QVuwKFLXhw2emd4T6 HGmJPYnJzokkXscD4FijiDTMxDjMAVQXMSsFc6fbao6rPLP6ZUNyNggCsDqFa/V3aqwg vxAsf6Cf8XrXeWKYMo0VdZCUT0JXQ6i/vHsOzpxoA7+j2fKlszczMJo4jkzo8n803ymx mdbRJysFXkbl3fHJkn6Il7n3VlCLYzjUIpqfAgto5sjv6y63QgOdRRh6ZkE+u6y2ILw0 OVaIrScUP4AMN508HYmQ+va2impV6CrO92L2l5vxKgmY/WtXpXTF8/erdcscnzbYbpdM NTXg== X-Gm-Message-State: APjAAAU2fes/qpEq6s1h/UnqKuHEW3L+rBgk7glDnZ9yRcxUKlLw4s+K v9ykRmhQgsQ7TGiuJfshThxIkQ== X-Google-Smtp-Source: APXvYqwmI4WVp++wXBW/3hIg2fhQrc/nvc0g7ASX0cSTIRCEgK0Qc7IA/ofesxVbkFKz3qX07wnEHQ== X-Received: by 2002:a19:e017:: with SMTP id x23mr2005378lfg.88.1572346823685; Tue, 29 Oct 2019 04:00:23 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id q15sm5071450lfb.84.2019.10.29.04.00.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 04:00:22 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 73C11100240; Tue, 29 Oct 2019 14:00:24 +0300 (+03) Date: Tue, 29 Oct 2019 14:00:24 +0300 From: "Kirill A. Shutemov" To: Peter Zijlstra 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: <20191029110024.yjytp22lhd2vekrv@box> 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> <20191029085602.GI4114@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191029085602.GI4114@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180716 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Oct 29, 2019 at 09:56:02AM +0100, Peter Zijlstra wrote: > 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. It's not clear if it is enough to avoid the issue. "under a highly specific and detailed set of conditions" is not very specific set of conditions :P -- Kirill A. Shutemov