Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp983442iob; Fri, 13 May 2022 18:33:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFF0bomdzsype2fe1CGnvUudBLvT9f5BZD9JyfmiAdFK557EKWTY+sPiTYcA4qTRdrAJ4S X-Received: by 2002:a5d:4a86:0:b0:20c:c5e4:11f0 with SMTP id o6-20020a5d4a86000000b0020cc5e411f0mr5704898wrq.454.1652491987872; Fri, 13 May 2022 18:33:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652491987; cv=none; d=google.com; s=arc-20160816; b=SJWUzDlRAyQ7oK7LSWaAtEScxpip5OC2LJ527k0clWZXRRXvo69hMt9fdfa+UeKu5R f9wqOmKAFmCWcSqsMqyjK2iHWSWJOjO9PluFL0AccwKOA7VGqEbw8s/ZmKvlAks8TByl WzL5tGGtrmiNXUDGe/ji/85bhhdz/wi7XKp+FciM03zlUG6HBEIO4tUvlP9+taDlajG/ yb7tT5O4NSKCR2RZYw+G2DluhUqe95x6zpsz4R0C6FHkzVRhf5GkrStPpDd3oUKQEgic yJZrY0THgAD5XZ75kkhuixjNsJq48CKUTc+m0TipC4ha9zRXKXGxlAkNRKzZ8SYoSB0m OtGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+te11kMiQn1wAaGnvrzw5FU1YDy3n162ybzqTsqCXWw=; b=hxhQzjc/JXsieBNmzqsK5YCcUZ/2hpBQFsJIa6B2DeokwZqVFDN5TqBkMLfTHcz6VV bMAtnxydK/p2PKeRHjdo4keYWnrkjghqDuHkK6xfUqbMX5Ib5Nx/HX2DGGGNdPcKbIY6 BiEIpnwQ6VlhTwv4UHkTTFDHnDx6AkMkGrnR8zQdVbozho3+SbodOtc1LeGS6M/pIaDO 0kf6FCM3UisXQi69D3FvL0+iv1HUhTca7SBy1y+zdG51SjmrnRFlzfvP0ljFfWRagvGj stmVG8upIqotL0GrrGpOFM4UsttTfEJ6SQly2o+hcLpZNBNtTGgGGfZDAuaYAN31Q3RO h6kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O02+VUPf; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i9-20020a0560001ac900b0020784366e5bsi3474512wry.708.2022.05.13.18.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:33:07 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O02+VUPf; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 989BD3CA690; Fri, 13 May 2022 17:01:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359717AbiEMAJP (ORCPT + 99 others); Thu, 12 May 2022 20:09:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230336AbiEMAJN (ORCPT ); Thu, 12 May 2022 20:09:13 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F2922854BF for ; Thu, 12 May 2022 17:09:12 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id e24so6640297pjt.2 for ; Thu, 12 May 2022 17:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+te11kMiQn1wAaGnvrzw5FU1YDy3n162ybzqTsqCXWw=; b=O02+VUPfxLERX+aEvxOOMv58BTXCIigcUQ2GGXQIYGGfH84rhIFoxvB+3DjdKXdNe3 mla74cDOBOyK50JZVrzFkQSXaBfrmmgwNRX1P3AiIkgOHVGe/zGNlI2Cg4F6mJIhpFot fM7vYEUE06CYFzNMu7Vbpwn4X71ZrwbvkgFv6aJlPxEmjeZYYug6VX8ZWyOFJl3FG+oI qHd8i1wIyWvK5hQQniAKpC9g9jFqu/sa1ZxaVtgGUzuUtbsoOVr8wykJUmzZiLL46ud8 sMSvNdeIQEW2nT5LSsWLWrf744oOVEa5yJ1NOxLDiCPPxtT5qlt8PofyyPJ/XbjZdi4W Dwxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+te11kMiQn1wAaGnvrzw5FU1YDy3n162ybzqTsqCXWw=; b=uIaPgFMAd9FMYK8ApEGYepSd2S3oy1QfDZ/Azz6k7ZYmV3+zf/z9C6bF2O2UBI6mv4 QLIwD45BNrnkurIEWzznjARZIfOKhPrCp2w2ER1Sat4MDYtUcEN6yQh9B4rmz/EivQNV hXTo9CUu2WRQSDVQHK8u5fPBJoREN2yPFR3/7nR9P11e23naKH4f/whgJeKmZKVzLj8o GdhCfsRe9KY31adksOj9WdjHhWnoU517VEqsejsFoWtcwE4idzIxSwk5hF2V1ZHFNhtJ 8rVXUnJpSPJQShPxihPyVGrtFRrDjomR1FPcbwVTUnIanB5VhhPXVu82hW9ev5srB/GS I+bA== X-Gm-Message-State: AOAM533fXr01A3/M27xq0AtL9Inwi8/VMX1uySQSJCgRpdWpQyErQTJM CGcWW0P73PF15oAiCZdN5mzBU9/bug0h/4aLxvg= X-Received: by 2002:a17:902:bcc6:b0:15f:4990:baec with SMTP id o6-20020a170902bcc600b0015f4990baecmr1897019pls.102.1652400551692; Thu, 12 May 2022 17:09:11 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <87o802tjd7.ffs@tglx> From: "H.J. Lu" Date: Thu, 12 May 2022 17:08:35 -0700 Message-ID: Subject: Re: [RFCv2 00/10] Linear Address Masking enabling To: Thomas Gleixner Cc: Dave Hansen , Peter Zijlstra , "Kirill A. Shutemov" , Dave Hansen , Andy Lutomirski , "the arch/x86 maintainers" , Alexander Potapenko , Dmitry Vyukov , Andi Kleen , Rick Edgecombe , Linux-MM , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 Thu, May 12, 2022 at 4:35 PM Thomas Gleixner wrote: > > On Thu, May 12 2022 at 15:10, H. J. Lu wrote: > > On Thu, May 12, 2022 at 2:51 PM Dave Hansen wrote: > >> On 5/12/22 12:39, Thomas Gleixner wrote: > >> >> It's OK for a debugging build that runs on one kind of hardware. But, > >> >> if we want LAM-using binaries to be portable, we have to do something > >> >> different. > >> >> > >> >> One of the stated reasons for adding LAM hardware is that folks want to > >> >> use sanitizers outside of debugging environments. To me, that means > >> >> that LAM is something that the same binary might run with or without. > >> > On/off yes, but is there an actual use case where such a mechanism would > >> > at start time dynamically chose the number of bits? > >> > >> I'd love to hear from folks doing the userspace side of this. Will > >> userspace be saying: "Give me all the bits you can!". Or, will it > >> really just be looking for 6 bits only, and it doesn't care whether it > >> gets 6 or 15, it will use only 6? > >> > >> Do the sanitizers have more overhead with more bits? Or *less* overhead > >> because they can store more metadata in the pointers? > >> > >> Will anyone care about the difference about potentially missing 1/64 > >> issues with U57 versus 1/32768 with U48? > > > > The only LAM usage I know so far is LAM_U57 in HWASAN. > > That's at least a halfways useful answer. > > > An application can ask for LAM_U48 or LAM_U57. But the decision should > > be made by application. > > It can ask for whatever, but the decision whether it's granted is made > by the kernel for obvious reasons. > > > When an application asks for LAM_U57, I expect it will store tags in > > upper 6 bits, even if the kernel enables LAM_U48. > > The kernel does not enable LAM_U48 when the application only wants to > have LAM_U57, because that would restrict the address space of the > application to 47 bits on 5-level capable system for no reason. > > So what are you trying to tell me? > I am expecting applications to ask for LAM_U48 or LAM_U57, not just LAM. -- H.J.