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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B342C433EF for ; Mon, 27 Jun 2022 12:01:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A76008E0001; Mon, 27 Jun 2022 08:01:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A26346B0072; Mon, 27 Jun 2022 08:01:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 914278E0001; Mon, 27 Jun 2022 08:01:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 81E636B0071 for ; Mon, 27 Jun 2022 08:01:08 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 5A76F10C2 for ; Mon, 27 Jun 2022 12:01:08 +0000 (UTC) X-FDA: 79623875016.18.785B542 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf16.hostedemail.com (Postfix) with ESMTP id 58502180055 for ; Mon, 27 Jun 2022 12:01:05 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C905A61507; Mon, 27 Jun 2022 12:01:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01681C3411D; Mon, 27 Jun 2022 12:00:57 +0000 (UTC) Date: Mon, 27 Jun 2022 13:00:54 +0100 From: Catalin Marinas To: "Kirill A. Shutemov" Cc: Dave Hansen , Will Deacon , Dave Hansen , Andy Lutomirski , Peter Zijlstra , x86@kernel.org, Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , "H . J . Lu" , Andi Kleen , Rick Edgecombe , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv3 7/8] x86: Expose untagging mask in /proc/$PID/arch_status Message-ID: References: <20220610143527.22974-1-kirill.shutemov@linux.intel.com> <20220610143527.22974-8-kirill.shutemov@linux.intel.com> <144af1ab-1e7e-b75c-331c-d9c2e55b9062@intel.com> <20220611012830.hs437yikbjgwlije@black.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220611012830.hs437yikbjgwlije@black.fi.intel.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656331267; a=rsa-sha256; cv=none; b=SjiPOmGXVxPNbmx0FqIyyBkkOvRMJghneaj1yUzGTzOT+ip7HeqPmbsEfbO6KlyPdzdQsL y6/ajDWu/Giqj6fz47s08+bgWmpRv2Ac3Mz+pwJJErcXwuI7963ka2US693kNQTckqsDqZ Xg8BgG//x2WBeuWQDBFc9YTkaRvrkIw= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf16.hostedemail.com: domain of cmarinas@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cmarinas@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656331267; h=from:from:sender: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=8yLVP34JiAxOLzBlULG5DAduycAlc1VLeqBG6S6Okvk=; b=fW2H7os5R/Qqes975e9M2/elhx+30WsPcYqFlCeA1RwlP9opf8Jm60NNAzrp1RhpPAdOuo SFDtjNFPA4X/j1ParpaFWU/oX1oNaQurpdRU+viRLDgV3twr0KaT0NP+Y0fWOJUr2aRbhA yXC/tDD4rIqU+j2/9tUd8t48fmol6+k= X-Stat-Signature: k3mwyamoixtx1w17by9wbohth46bcqoc X-Rspamd-Queue-Id: 58502180055 Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf16.hostedemail.com: domain of cmarinas@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cmarinas@kernel.org X-Rspamd-Server: rspam10 X-Rspam-User: X-HE-Tag: 1656331265-967940 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: Hi Kirill, Sorry, this fell through the cracks (thanks to Will for reminding me). On Sat, Jun 11, 2022 at 04:28:30AM +0300, Kirill A. Shutemov wrote: > On Fri, Jun 10, 2022 at 08:24:38AM -0700, Dave Hansen wrote: > > On 6/10/22 07:35, Kirill A. Shutemov wrote: > > > +/* > > > + * Report architecture specific information > > > + */ > > > +int proc_pid_arch_status(struct seq_file *m, struct pid_namespace *ns, > > > + struct pid *pid, struct task_struct *task) > > > +{ > > > + /* > > > + * Report AVX512 state if the processor and build option supported. > > > + */ > > > + if (cpu_feature_enabled(X86_FEATURE_AVX512F)) > > > + avx512_status(m, task); > > > + > > > + seq_printf(m, "untag_mask:\t%#lx\n", mm_untag_mask(task->mm)); > > > + > > > + return 0; > > > +} > > > > Arch-specific gunk is great for, well, arch-specific stuff. AVX-512 and > > its, um, "quirks", really won't show up anywhere else. But x86 isn't > > even the first to be doing this address tagging business. > > > > Shouldn't we be talking to the ARM folks about a common way to do this? > > + Catalin, Will. > > I guess we can expose the mask via proc for ARM too, but I'm not sure if > we can unify interface further without breaking existing TBI users: TBI is > enabled per-thread while LAM is per-process. Hardware TBI is enabled for all user space at boot (it was like this form the beginning). The TBI syscall interface is per-thread (TIF flag) but it doesn't change any hardware behaviour. The mask is fixed in hardware, unchangeable. I'm fine with reporting an untag_mask in a common way, only that setting it won't be possible on arm64. If arm64 ever gains support for a modifiable untag_mask, it's a good chance it would be per mm as well since the controls for TBI are per page table. -- Catalin