Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2911148iog; Mon, 27 Jun 2022 05:36:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uYDLKIrKmPf3WIfbNOTdrOeN195IBQsDShq3KB4B1S3pey1hd6Hgk11wwc0cuOOt38Syl+ X-Received: by 2002:a17:907:c0a:b0:726:22b1:9734 with SMTP id ga10-20020a1709070c0a00b0072622b19734mr12820699ejc.195.1656333360614; Mon, 27 Jun 2022 05:36:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333360; cv=none; d=google.com; s=arc-20160816; b=K0RBb05MXn9UBGkLq+vnvXucrwzArOoswHuqO8TZwKhJJN9EgB9Mk8PTJv516yCmR8 Mk+XI3x+fwLAVDmK8ifcxWjJA/mT+9NXwlHlkCLuAtFJ9bu4Nr8kcwSnyD494D5EyxW/ VMRIJwX/jq4tFccPXcgOKNfFirPR/O8husoemgiMWw29aXJSOzTe9MA5lw+9WlWU3Stp Sw2ry7cyiofNndoXjOQrTe++L2M3yKYglN6+OhEe4xvHJnnqo/RVxLwqL5LkMS+zSbJK IqhSf2uG4yM+Q+4tBSEfd+gsC6LTCPR7AWUGeXcnAPKcZtv7jxrhkWQTf6MdbkiYslLv YsiQ== 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; bh=8yLVP34JiAxOLzBlULG5DAduycAlc1VLeqBG6S6Okvk=; b=fqn8HQHzk5xn9VuPG0cEMspAYm5BQVCoz2YzJYW1Lkxg6yQHAtlIanTPuY6tjS//XQ Mx3DKbw/3w73HjHF5nmqjiITM3A5+VXyrpWXdWYlO3Dk2nmOO1oZDnviS+km2vZuXPAJ xMUhbMg345kK4wOLxoGI9F7XClO6hCYx8DFuxUJckk8eG4KDd6/AqZ+ehdoFIoXM7ESd PsHooLUmJKHonM+kE0jJ8SWoD9enVDK7urQXRRozAOOcbJ38uixxXs+GF4208Xl366tQ qeB7LGOq5smVf24ur0VWNtAX///K84fz8YltDmnK4xW2CWZH7hVdNm6DJa7D+fI1INxw V3ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di18-20020a170906731200b007122faebbdasi9935589ejc.494.2022.06.27.05.35.35; Mon, 27 Jun 2022 05:36:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239792AbiF0MFP (ORCPT + 99 others); Mon, 27 Jun 2022 08:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239790AbiF0ME5 (ORCPT ); Mon, 27 Jun 2022 08:04:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD4E612D0A for ; Mon, 27 Jun 2022 05:01:03 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 6E68CB81063 for ; 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> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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