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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E2BAC61DA4 for ; Thu, 9 Feb 2023 14:09:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230272AbjBIOJf (ORCPT ); Thu, 9 Feb 2023 09:09:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbjBIOJc (ORCPT ); Thu, 9 Feb 2023 09:09:32 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BE4F5D1F0 for ; Thu, 9 Feb 2023 06:09:31 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id j23so1940554wra.0 for ; Thu, 09 Feb 2023 06:09:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2wWrZfW6w5Lo0h1Oy2ItuQA9D/VzF8nnzUDHyvuMrIU=; b=qucTY+VUgkLKMzXYSk/yBQjtFtNj+c6L7TTuwK1Io3r7kfJFAj3KyITqXu/AW2vv6y FXdqmlgbpFi7gWp9TTtNm3Aao/lrwrh4V62bDLN4gAJD5gQbj7e9CEkTAMgFWIvpL/F2 +EMDd3E+d6HSt0wFZa9G1DxwExyyCorEczfhrmQ/QA8tXN2QUTXxJauRsHWtkMUX5K3J q89nv1MIusbn5ds4ECYKtNBgrKgPUR7Lgro/zOyYEnVK11GhWmc5x4FtgWiVO8vvGWYo C1RSvB0MrHvwXpljDmuImmWC2NBYDBFKIPWOrDy0zBuUzXkj+VZI+KXvoC0wED4Qi6V0 ZshQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2wWrZfW6w5Lo0h1Oy2ItuQA9D/VzF8nnzUDHyvuMrIU=; b=KtqePitPrIMt+86w3mT0wagsHxgC9Lzz6LKUsiXu5/aLK1HgbJ717pMoKXKPUC4eZF RR2g1H5zyD4UTWTklXG95RlKi3rnJ404mm8cEICgsMw36rMJDGNv+WzCwMPLyvjSjdlb 63SVRiIPim29Gyn/ks6h9GB9d5GMKJdNep7GimojnjF03Vjxf9o8ZMxiMXr9R5Z4D7I3 x+UThjhYpTN08m7Klt5mDXCruaT3BH/7U7vq49t8c9kgjLxfcQU54TGNy84LDVSlsOeb 08xQZSkdTb3j7nCzfRPUa7mICEbo7yMl7Rym40DqwhKOfHTQi+UjbrppW/0CJ3RLDrfX Gpnw== X-Gm-Message-State: AO0yUKXfwJoVCfTUHGjUwSPFH+88oRqJF3R7U822CEVR0hTkAZKtcqTe qvOXDzFhJP7Ae/jWFPIW597T0bE0jOBqtnaTGJ0HGQ== X-Google-Smtp-Source: AK7set+1bMzTWNOQIBzf1vZLZYYVwjIVEW9uY+AIm1FM1LTCANjOjwy7DgqukiLUd8hdl+u6TgYhMmTwN8PRU8N0hbk= X-Received: by 2002:adf:d0c1:0:b0:2c3:e5e3:c57 with SMTP id z1-20020adfd0c1000000b002c3e5e30c57mr234444wrh.400.1675951769996; Thu, 09 Feb 2023 06:09:29 -0800 (PST) MIME-Version: 1.0 References: <20230123220500.21077-1-kirill.shutemov@linux.intel.com> <20230123220500.21077-6-kirill.shutemov@linux.intel.com> In-Reply-To: <20230123220500.21077-6-kirill.shutemov@linux.intel.com> From: Alexander Potapenko Date: Thu, 9 Feb 2023 15:08:53 +0100 Message-ID: Subject: Re: [PATCHv15 05/17] mm: Introduce untagged_addr_remote() To: "Kirill A. Shutemov" Cc: Dave Hansen , Andy Lutomirski , Peter Zijlstra , x86@kernel.org, Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Taras Madan , Dmitry Vyukov , "H . J . Lu" , Andi Kleen , Rick Edgecombe , Bharata B Rao , Jacob Pan , Ashok Raj , Linus Torvalds , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 23, 2023 at 11:05 PM Kirill A. Shutemov wrote: > > untagged_addr() removes tags/metadata from the address and brings it to > the canonical form. The helper is implemented on arm64 and sparc. Both of > them do untagging based on global rules. > > However, Linear Address Masking (LAM) on x86 introduces per-process > settings for untagging. As a result, untagged_addr() is now only > suitable for untagging addresses for the current proccess. > > The new helper untagged_addr_remote() has to be used when the address > targets remote process. It requires the mmap lock for target mm to be > taken. > > Export dump_mm() as there's now the first user for it: VFIO can be > compiled as module and untagged_addr_remote() triggers dump_mm() via > mmap_assert_locked(). > > Signed-off-by: Kirill A. Shutemov > Acked-by: Peter Zijlstra (Intel) Tested-by: Alexander Potapenko