Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp27702pxu; Wed, 14 Oct 2020 19:03:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4aoo3J1o/IKdb4HnMA1Yw3Gfgsv2YW0O/oqZ5YhFWHHC/72q9cPTEc85HnOzhkP1wADs2 X-Received: by 2002:a17:906:3c05:: with SMTP id h5mr2054432ejg.70.1602727416223; Wed, 14 Oct 2020 19:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602727416; cv=none; d=google.com; s=arc-20160816; b=dv17feXcJvvaNhZS1U1JkfghsB+MtEwgPKijQ9CLIm9mrYhE9jtJ3aSuNyrxAidOg6 FlpEiqRdcJc2pSMlySV24WuW5ap6F7ROnNaBFJN6Sqvf5EDvIZv4K6Xr9b45NC8Dl1m5 GSP7EqamlMQ2Vohlxd6EqS/K8ItgsJ5ayVzm2rDT/a68G1TnKpiD9dR8I87PGsjQk4RT Avr2PsPUXCDABi0JIgWb/qwv+WKndhHLC3lg6FrHHXJAXj4xzJtP/af4U7vGNWNujxJ4 U8WPKkRST/NtXEAPnkRNemXHjWzxmG38Ok9OiCUenJmzCnA0WchLY8y4hqrCrbTt9HEE 8flQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=uVK0IVgQlEoTLJbQHod8IqvQSLETuGNRNz6XABf3VLk=; b=QtnCryOz5a4mlxE6ZSEAGazhjOLeM7uZabdqYpuYZR7IYuEyeWZi6dZQ7Xo6Ph8Pt8 PgkEqhJVpHlZvNxvVLjqPdvEdx43udP6VYFjBSoFrnry4k5Z9GClmYGSE7Dm1n4z35T0 iTj+cZt9JKkxVYzVBnU3Yhhzr50XUUteDKukynOdkBxwt/QIDL/YTQnWNK8g8yUt8ZFU zm5hUDOR57EyfMK/Df0g9uvUVKGapbPiui3d+3hnzwFfZ0xjuKtL9MrfKPVmghdsnCLE t+mg+vsCfBnAVpjhDJbPFq4cZNF6PACBvqr6J9JgUAzUhieP5mlqiwgWSW9odi3OeJjb ziGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="dZ4P2/EN"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id me10si1049107ejb.753.2020.10.14.19.03.14; Wed, 14 Oct 2020 19:03:36 -0700 (PDT) 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; dkim=pass header.i=@alien8.de header.s=dkim header.b="dZ4P2/EN"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728428AbgJNT62 (ORCPT + 99 others); Wed, 14 Oct 2020 15:58:28 -0400 Received: from mail.skyhub.de ([5.9.137.197]:57504 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726111AbgJNT61 (ORCPT ); Wed, 14 Oct 2020 15:58:27 -0400 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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