Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1295891iog; Thu, 16 Jun 2022 03:25:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sO017Nyv0HXolqDwV2+DI9nUEy/ZUpitgl36gUdomZAiv9xyapYnvGprjYt3YWEjMr51rs X-Received: by 2002:a63:1b26:0:b0:3fd:8db8:9602 with SMTP id b38-20020a631b26000000b003fd8db89602mr3901126pgb.239.1655375110857; Thu, 16 Jun 2022 03:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655375110; cv=none; d=google.com; s=arc-20160816; b=Z4d1bqy93tZROsZqPQkcgvUf+UlZY6Cq1TI+4b5sp27cIHu1dwd/HxEBXCXB7FgVFq SXKBPwWYE+8GvzZld83B6e4pHGq2KZt6S2dPmj7lrhE6zSs9ysCHOGFsTAl2cVNz+TBq PwvV1qNXJFp/LyLJ8aaxU6s7UL9Tt1OGY7FUJWckFVdFCleSTqulVm6h8qby2OszXNOE U/RpHCATPbTixgIFMpSQKbKJUm8Axkpvw4xD/3lq7bVuhYzF/YbNQRXkf5/HlrbEtB4x 8zpkNLd/kAGBfsidGyYDDOhEf9xKhBEWRKMdeDFn86d4QbUo7n2bQzcQu8Ot6Bnmn0UZ sDbw== 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=CgVWCHgWJJT3XNAbwXXT31wUhHpLBydJuqr4cEkRcRg=; b=HyLfRoNuCiShIzCzXHZEMXyz98xTd47vC/5UULrwf7PJjaxwEiJQ/7xU7G+luoflD7 zHy0MX7cVkwWXpRfr3N1hC+V7tw1tR1T0WYHSl96e5BY1j7SwnJuVzK4GLXmNKybPXfi BLaCJVdWygvR2N7GyENGWDr16m2bi8f1BSENmm5FtHP9nLHRXtVb0GlWFNF61ZTJdaBy 9IDrXJvN7uz47cWaJ5Gc82oq/uXoiKxtSfco+GOE8D1XvazJbeXWaqhh22z6hME/3cuD 1pZobHpxxJhhpddZ0TBZ9ojpKy8+ng9lWcAKB9Cq9XnB5Pw59GRuM+gG4b1W1h7aJMmR TFGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=svndT7e0; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v7-20020aa799c7000000b0051bbc660065si1886727pfi.328.2022.06.16.03.24.59; Thu, 16 Jun 2022 03:25:10 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=svndT7e0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359661AbiFPKBV (ORCPT + 99 others); Thu, 16 Jun 2022 06:01:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231838AbiFPKBU (ORCPT ); Thu, 16 Jun 2022 06:01:20 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6808B5C872 for ; Thu, 16 Jun 2022 03:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CgVWCHgWJJT3XNAbwXXT31wUhHpLBydJuqr4cEkRcRg=; b=svndT7e0vHjSg2FVR5ABLL492R IBtvGgXVEG5zhGj5aNFh88vSwSzeRBdB1MBdUnYvsy9jCMe2cA+Wt0G4hjDRsv7wJbDrxi6i7BIDU 7R1xPG91BSSXR6pN3fWYbtYx8ONsk5qrJgZBqZUqfCP1UHoZ2miHsNV1Gac7VMH747b5J1vn/1ijN VyRNaMy9QDV+NANfFtZ+IfN5dRQ+wvP3CezJog+UrECePy2EoNzEmF68hlLHwODy9dd5ylyEQF9pY 2y98Qiax+HEcswDRZS2wlgcugb3gUJ3VVKg+ORcJKrjVJWkGX9gSOmvCVWRkOvyHlcaH++RCuqJsc 4W4FsX0A==; Received: from dhcp-077-249-017-003.chello.nl ([77.249.17.3] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1mJ9-001r0b-S3; Thu, 16 Jun 2022 10:00:59 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 1BE763006C2; Thu, 16 Jun 2022 12:00:58 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F2E97201A4015; Thu, 16 Jun 2022 12:00:57 +0200 (CEST) Date: Thu, 16 Jun 2022 12:00:57 +0200 From: Peter Zijlstra To: "Kirill A. Shutemov" Cc: Dave Hansen , Andy Lutomirski , 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 OPTIONAL 8/8] x86/mm: Extend LAM to support to LAM_U48 Message-ID: References: <20220610143527.22974-1-kirill.shutemov@linux.intel.com> <20220610143527.22974-9-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220610143527.22974-9-kirill.shutemov@linux.intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 On Fri, Jun 10, 2022 at 05:35:27PM +0300, Kirill A. Shutemov wrote: > LAM_U48 allows to encode 15 bits of tags into address. > > LAM_U48 steals bits above 47-bit for tags and makes it impossible for > userspace to use full address space on 5-level paging machine. > > Make these features mutually exclusive: whichever gets enabled first > blocks the other one. This patch is broken in that it doesn't fix untag_pointer() *If* you really want to continue down this road; you'll need something like: #define untagged_addr(mm, addr) ({ \ u64 __addr = (__force u64)(addr); \ s64 sign = (s64)__addr >> 63; \ __addr ^= sign; \ __addr &= (mm)->context.untag_mask[sign & 1]; \ __addr ^= sign; \ (__force __typeof__(addr))__addr; \ }) Which uses a different mask for kernel and user pointers. Anyway, without this U48 patch on, the mask could be a constant, no need to keep this variable, we can unconditionally unmask U57. Let me go reply to that other mail too.