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=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 EF6FCC43457 for ; Wed, 14 Oct 2020 19:58:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3C2882225C for ; Wed, 14 Oct 2020 19:58:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="dZ4P2/EN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C2882225C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5B30D6B005D; Wed, 14 Oct 2020 15:58:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 53ED86B0062; Wed, 14 Oct 2020 15:58:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 406236B0068; Wed, 14 Oct 2020 15:58:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id 0FD186B005D for ; Wed, 14 Oct 2020 15:58:29 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A917A1EE6 for ; Wed, 14 Oct 2020 19:58:28 +0000 (UTC) X-FDA: 77371593096.23.turn06_5d000542720e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 9878437608 for ; Wed, 14 Oct 2020 19:58:28 +0000 (UTC) X-HE-Tag: turn06_5d000542720e X-Filterd-Recvd-Size: 3390 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Wed, 14 Oct 2020 19:58:27 +0000 (UTC) Received: from zn.tnic (p200300ec2f0c4400a8a63b86eef17592.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:4400:a8a6:3b86:eef1:7592]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 7DFFB1EC0493; Wed, 14 Oct 2020 21:58:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1602705506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=uVK0IVgQlEoTLJbQHod8IqvQSLETuGNRNz6XABf3VLk=; b=dZ4P2/ENBkzVR3E/jykivRdYFeSM0709RXOdeXsygIC/ruApxwjwwpAWUzsPzZSJZhIjNS GP7PCo1zI76n/GfLb4/0Hxtw/LYFXH/rk2j/4DIQDCf2Whxo1qupCW5EGY9cuPx/lHxkVw VO9yU79WqRRJVimHtXFamo/IqyNJbn4= Date: Wed, 14 Oct 2020 21:58:23 +0200 From: Borislav Petkov To: Andy Lutomirski Cc: Ankur Arora , LKML , Linux-MM , "Kirill A. Shutemov" , Michal Hocko , Boris Ostrovsky , Konrad Rzeszutek Wilk , Thomas Gleixner , Ingo Molnar , X86 ML , "H. Peter Anvin" , Arnd Bergmann , Andrew Morton , Ira Weiny , linux-arch Subject: Re: [PATCH 5/8] x86/clear_page: add clear_page_uncached() Message-ID: <20201014195823.GC18196@zn.tnic> References: <20201014083300.19077-1-ankur.a.arora@oracle.com> <20201014083300.19077-6-ankur.a.arora@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 Wed, Oct 14, 2020 at 08:45:37AM -0700, Andy Lutomirski wrote: > On Wed, Oct 14, 2020 at 1:33 AM Ankur Arora wrote: > > > > Define clear_page_uncached() as an alternative_call() to clear_page_nt() > > if the CPU sets X86_FEATURE_NT_GOOD and fallback to clear_page() if it > > doesn't. > > > > Similarly define clear_page_uncached_flush() which provides an SFENCE > > if the CPU sets X86_FEATURE_NT_GOOD. > > As long as you keep "NT" or "MOVNTI" in the names and keep functions > in arch/x86, I think it's reasonable to expect that callers understand > that MOVNTI has bizarre memory ordering rules. But once you give > something a generic name like "clear_page_uncached" and stick it in > generic code, I think the semantics should be more obvious. Why does it have to be a separate call? Why isn't it behind the clear_page() alternative machinery so that the proper function is selected at boot? IOW, why does a user of clear_page functionality need to know at all about an "uncached" variant? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette