From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 657C5C433EF for ; Fri, 24 Sep 2021 13:18:20 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E57F460FC1 for ; Fri, 24 Sep 2021 13:18:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E57F460FC1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id AE601418F8; Fri, 24 Sep 2021 13:18:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D4q23e8QYMwB; Fri, 24 Sep 2021 13:18:19 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 9EFC8405D3; Fri, 24 Sep 2021 13:18:18 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 78BB7C000F; Fri, 24 Sep 2021 13:18:18 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 19795C000D for ; Fri, 24 Sep 2021 13:18:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F0230606C6 for ; Fri, 24 Sep 2021 13:18:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=linutronix.de header.b="38LCLbeP"; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=linutronix.de header.b="lWWFJgrE" Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oTB61BfUJZAg for ; Fri, 24 Sep 2021 13:18:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by smtp3.osuosl.org (Postfix) with ESMTPS id 5E85B60667 for ; Fri, 24 Sep 2021 13:18:16 +0000 (UTC) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1632489492; 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=EkgceDb68aKuyW7Xafy5kre/SZO1C4q0AWs/aSyA1fg=; b=38LCLbePDv45bODUZovEnO4nt0pNY7G7jB8ei2tc2xRJ3U6xCgL8Pk7GK2/q1fIk2LE9y1 5iPxmBzGxqbv9+Szdwp2xLv38MIxT0L/+cEHBwa0ClXSv5S3dndu1wXctu1ziIYzymsc/4 ug6vEGhBQ+8YZiQbtddsj7OXz2UqAu7W0yfnqqgkl5orPRYXMp8Lpe0kHbexqsRkzmeunw RlOIMXcU+BHyBY3k5b1wYDUk++eLgTPPGiK8j/JQ73QFsvbEKsTKB6sNn8eh643c1dcaL2 85zc79fuqHWPnZpfSPYZO5W78OBQxow9SRiymKhSIydJi51f1kQT/nMdjiU26w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1632489492; 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=EkgceDb68aKuyW7Xafy5kre/SZO1C4q0AWs/aSyA1fg=; b=lWWFJgrEx65fA/sjl+oaOFAChukib/QmrFTq4ObEcl9f8EWtFXoZmxOQmcwoY+WqszRrBQ gh0Tb6cgy8/N7ZBQ== To: "Luck, Tony" Subject: Re: [PATCH 5/8] x86/mmu: Add mm-based PASID refcounting In-Reply-To: <87o88jfajo.ffs@tglx> References: <20210920192349.2602141-1-fenghua.yu@intel.com> <20210920192349.2602141-6-fenghua.yu@intel.com> <87y27nfjel.ffs@tglx> <87o88jfajo.ffs@tglx> Date: Fri, 24 Sep 2021 15:18:12 +0200 Message-ID: <87k0j6dsdn.ffs@tglx> MIME-Version: 1.0 Cc: Fenghua Yu , Dave Jiang , Ashok Raj , Ravi V Shankar , Peter Zijlstra , x86 , linux-kernel , Dave Hansen , iommu@lists.linux-foundation.org, Ingo Molnar , Borislav Petkov , Jacob Jun Pan , Andy Lutomirski , Josh Poimboeuf X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Thu, Sep 23 2021 at 19:48, Thomas Gleixner wrote: > On Thu, Sep 23 2021 at 09:40, Tony Luck wrote: > > fpu_write_task_pasid() can just grab the pasid from current->mm->pasid > and be done with it. > > The task exit code can just call iommu_pasid_put_task_ref() from the > generic code and not from within x86. But OTOH why do you need a per task reference count on the PASID at all? The PASID is fundamentaly tied to the mm and the mm can't go away before the threads have gone away unless this magically changed after I checked that ~20 years ago. Thanks, tglx _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 526AFC433EF for ; Fri, 24 Sep 2021 13:32:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C29860E54 for ; Fri, 24 Sep 2021 13:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346456AbhIXNeR (ORCPT ); Fri, 24 Sep 2021 09:34:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346636AbhIXNcb (ORCPT ); Fri, 24 Sep 2021 09:32:31 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61E5BC05BD17 for ; Fri, 24 Sep 2021 06:18:15 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1632489492; 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=EkgceDb68aKuyW7Xafy5kre/SZO1C4q0AWs/aSyA1fg=; b=38LCLbePDv45bODUZovEnO4nt0pNY7G7jB8ei2tc2xRJ3U6xCgL8Pk7GK2/q1fIk2LE9y1 5iPxmBzGxqbv9+Szdwp2xLv38MIxT0L/+cEHBwa0ClXSv5S3dndu1wXctu1ziIYzymsc/4 ug6vEGhBQ+8YZiQbtddsj7OXz2UqAu7W0yfnqqgkl5orPRYXMp8Lpe0kHbexqsRkzmeunw RlOIMXcU+BHyBY3k5b1wYDUk++eLgTPPGiK8j/JQ73QFsvbEKsTKB6sNn8eh643c1dcaL2 85zc79fuqHWPnZpfSPYZO5W78OBQxow9SRiymKhSIydJi51f1kQT/nMdjiU26w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1632489492; 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=EkgceDb68aKuyW7Xafy5kre/SZO1C4q0AWs/aSyA1fg=; b=lWWFJgrEx65fA/sjl+oaOFAChukib/QmrFTq4ObEcl9f8EWtFXoZmxOQmcwoY+WqszRrBQ gh0Tb6cgy8/N7ZBQ== To: "Luck, Tony" Cc: Fenghua Yu , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , Dave Hansen , Lu Baolu , Joerg Roedel , Josh Poimboeuf , Dave Jiang , Jacob Jun Pan , Ashok Raj , Ravi V Shankar , iommu@lists.linux-foundation.org, x86 , linux-kernel Subject: Re: [PATCH 5/8] x86/mmu: Add mm-based PASID refcounting In-Reply-To: <87o88jfajo.ffs@tglx> References: <20210920192349.2602141-1-fenghua.yu@intel.com> <20210920192349.2602141-6-fenghua.yu@intel.com> <87y27nfjel.ffs@tglx> <87o88jfajo.ffs@tglx> Date: Fri, 24 Sep 2021 15:18:12 +0200 Message-ID: <87k0j6dsdn.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 23 2021 at 19:48, Thomas Gleixner wrote: > On Thu, Sep 23 2021 at 09:40, Tony Luck wrote: > > fpu_write_task_pasid() can just grab the pasid from current->mm->pasid > and be done with it. > > The task exit code can just call iommu_pasid_put_task_ref() from the > generic code and not from within x86. But OTOH why do you need a per task reference count on the PASID at all? The PASID is fundamentaly tied to the mm and the mm can't go away before the threads have gone away unless this magically changed after I checked that ~20 years ago. Thanks, tglx