Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp993059iob; Fri, 13 May 2022 18:55:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8Fdp4zK2Eb+pHSNXwm5tgTQPioYJhQeD5TD5v+9LKEZI0TzlDR5H9aXgIWi8rkiYsjt8l X-Received: by 2002:a5d:5749:0:b0:20a:ce36:b29 with SMTP id q9-20020a5d5749000000b0020ace360b29mr5924887wrw.559.1652493303868; Fri, 13 May 2022 18:55:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652493303; cv=none; d=google.com; s=arc-20160816; b=ffdkuoX3bQwq2ktaiTFqRQM0ClzdFEoq2JHiCm9OYqC8mT/pbjGQOR8tyj+y1u9oU3 qP1PGuxpB4Lch5ZiPMuaIkvDmfSy8h2k/H5CPiXZ4EzNuaIyrZTFxJ0U9DDcHpxkjaJH yRidxQMG3xL4v6CcKbUsfTzumbYVfxaafBo5kctfEK9I/U80e/7kuXWf6c4DF7NTVW41 /uV4jifvc9YESyYwLsRSZVDY9iGy1EtTm6jmqh4RKP4YD8VijUNE6jpqzZWmhlfvd5D2 wOtXoIhVAQ6hkbF64pBEz20z/FDus2pN0Jj3qd56xEdukQsD/0kJHLd7rL9ju8Q1c8Fv dHIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=Php+ZJ83A5DPq79iQSx2r7Rgggl0xBFSJkKdjRMuVAM=; b=FDTIT85eHJPC6of9Wvc32WnWF3vBuBplGSe0TZjY+lHZkfvWDO6xl51eGpmPg5JSO0 KY0kRyoXqyQ8WfvSYqphuBh0JmX5nB6c8EkJ1Z8Ff3/kavhyAmtGQHN8+1RxaMGgIubn 9cSvesy5A/3VpwNXAziWiesrgP7rEHQ7vSAn9iQm3Un052VmXRsyCq/CtBGdrIUipypN xAJ+w67e3Vs7yquIFyXW8VEUfPqvuaZqSax0aBFBFKsx/sHp4jGoyyW4QhKP5ElhW5D+ X/1wc8W58Znfkp+fxwSHXVU3vlfg8RpZYhhjYeQmIfp3xZkuk93c/2td9zTu890m8UYG zAQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=n2+cKQf7; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o26-20020a05600c511a00b00394317da936si8836756wms.218.2022.05.13.18.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:55:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=n2+cKQf7; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 751FD1180E; Fri, 13 May 2022 17:18:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379048AbiEMJ11 (ORCPT + 99 others); Fri, 13 May 2022 05:27:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379063AbiEMJ1M (ORCPT ); Fri, 13 May 2022 05:27:12 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BC7820131C for ; Fri, 13 May 2022 02:27:01 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1652434020; 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: in-reply-to:in-reply-to:references:references; bh=Php+ZJ83A5DPq79iQSx2r7Rgggl0xBFSJkKdjRMuVAM=; b=n2+cKQf7QtlEHZ7/6xhAPT21fnqoei1jVHC0efwy9KrOEHxm5OdXniXQw50LIbgdP/Dand APAQ89v6fLyYpX8/V2/Gy2C6g/ucOPN9VgDCh52bk86cuNYe9Zanbs9lK3dQLVdUxbX78J VeMuaPIiA54X8qwtVZ7on71eG9tNSjUIHNG++AwSRh2YtcF4y/9u4pgzC8oJlY5HRDsgkP XtDwGrBbU7w9Ia+jwyOqW/EoiPZMWG+vXUBuvgrkL02inXUULsy0r+eJFzbyCRdafAaWCg 55xL/+MbIoOvNozNrh8SBX82QoOISv888VkvPcHVn5TrExo/mBZmIma8NZwFAA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1652434020; 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: in-reply-to:in-reply-to:references:references; bh=Php+ZJ83A5DPq79iQSx2r7Rgggl0xBFSJkKdjRMuVAM=; b=qLTgxfdko9IOD+Xt5izjeOXBMTbSyXbQH8RnIupuq5f+bqLQWqrtMgG6AsGgk021/VxvDJ ETem9/Ks5+HTOLAA== To: Catalin Marinas Cc: Dave Hansen , "H.J. Lu" , Peter Zijlstra , "Kirill A. Shutemov" , Dave Hansen , Andy Lutomirski , the arch/x86 maintainers , Alexander Potapenko , Dmitry Vyukov , Andi Kleen , Rick Edgecombe , Linux-MM , LKML Subject: Re: [RFCv2 00/10] Linear Address Masking enabling In-Reply-To: References: <20220511022751.65540-1-kirill.shutemov@linux.intel.com> <20220511064943.GR76023@worktop.programming.kicks-ass.net> <20bada85-9203-57f4-2502-57a6fd11f3ea@intel.com> <875ymav8ul.ffs@tglx> <55176b79-90af-4a47-dc06-9f5f2f2c123d@intel.com> <87o802tjd7.ffs@tglx> <67aef839-0757-37b1-a42d-154c0116cbf5@intel.com> <878rr6te6b.ffs@tglx> Date: Fri, 13 May 2022 11:26:59 +0200 Message-ID: <8735hdu6jg.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Fri, May 13 2022 at 10:14, Catalin Marinas wrote: > On Fri, May 13, 2022 at 03:27:24AM +0200, Thomas Gleixner wrote: >> On Thu, May 12 2022 at 17:46, Dave Hansen wrote: >> > On 5/12/22 17:08, H.J. Lu wrote: >> > If I had to take a shot at this today, I think I'd opt for: >> > >> > mask = sys_enable_masking(bits=6, flags=FUZZY_NR_BITS); >> > >> > although I'm not super confident about the "fuzzy" flag. I also don't >> > think I'd totally hate the "blind" interface where the kernel just gets >> > to pick unilaterally and takes zero input from userspace. >> >> That's the only sane choice and you can make it simple for userspace: >> >> ret = prctl(GET_XXX_MASK, &mask); >> >> and then let it decide based on @ret and @mask whether to use it or not. > > Getting the mask would work for arm64 as well (it's always 0xffUL << 56, > top-byte-ignore). Setting the mask from user space won't be of any use > to us, it's baked in hardware. Sure. > Dave indeed mentioned passing a mask to allow a more flexible control > but, as already mentioned in the old thread, for arm64 the feature was > already on, so it didn't make much sense, it seemed more like > over-engineering. Had we known that Intel is pursing something similar, > maybe we'd have designed the interface differently (we didn't get the > hint). Fair enough > Intel's LAM has more flexibility but I don't see the arm64 TBI getting > in the way. Just don't use it as an example because they evolved in > different ways. I'm happy for arm64 to adopt a more flexible interface > while keeping the current one around for backwards compatibility). But > on arm64 we can't control the masking, not even disable it per process > since it has always been on. That's fine. The point is that we want uniform interfaces for the same functionality. It's obviously hardware specific which subset of the interface is supported. >> I'm so tired of this short sighted 'cram my feature in' approach of >> _all_ involved parties. > > Unfortunately it happens occasionally, especially when developers can't > disclose that their companies work on similar features (resctrl is a > good example where arm64 would have benefited from a more generic > approach but at the time MPAM was not public). Yeah. It's a constant pain. Thanks, tglx