Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp314433pxb; Tue, 12 Apr 2022 02:37:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynMCR/7t0mHBHCTsqSffDpc1ZTT9FpT5oO9R54623dN/1wtmvR41+HXlj/ItDilddbKUXQ X-Received: by 2002:a17:907:7ea3:b0:6e8:92eb:3dcc with SMTP id qb35-20020a1709077ea300b006e892eb3dccmr8284937ejc.75.1649756246201; Tue, 12 Apr 2022 02:37:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649756246; cv=none; d=google.com; s=arc-20160816; b=XmUh9nxJH3i+fyh7iviZIl3NA26p2FgyKMuIIhzQYUsqrlQz83IT7GCQyg44SJl3eX oaG8r5IFYmwvUdjbZanL4DZQ30DkpYEmvDVoOK55pmym+DQMehTh8fhqcijNxm9AfaxK IRJzuLauIqa/xATKfWTmK+ppfky2iOQyNDs9D1wjjyrZkaOD7O2TT3mZvTUbMvJKVbo2 ZAyDJKtromgvX5roV+NWrmecEegEBOMp2IUv2ixrDvR+BpF9Mn6UZ0wE70NPL+i9oXW1 2BVhVpzb86hDUal+4hYJx1jxFzhZwktu5liw0TESCtre2tdrn30XjVlolQcZpF06+RHs gbsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:from:references:cc:to :subject:message-id:dkim-signature; bh=7GopoeoK8zI4GB2l2eUN6bBtjkL/7R2gwbjUIUdvthE=; b=PrQCdsOkcnSoUJy6EX3PWijuaA9xyPfknJyN857pHNsmbTQNFb1U//w1qDvcRx9+r0 IFWVztLfPVPmN5Wx/OqifW9Vx2aM6E3dKmgZzMwWxZp6A/OrJbh13phEL6mNcrbZUutS BKBwsrN94bGUxU0ulxOIB58HfI2xWxjitJ4l4/4+N5yTp1f9mmbNW3oy2UDDZwoO7DYx fvTd5epC5OPtblJw1n1TZmab/tCQIbMXVy9HLepLukdhz6VwUZvjmsm5AuT9gZs3tS6o isI0uEwzopL5MD29VryYTnUbW6CVpliKk7NEjGQCiHfvfBFUmU2Mc3afEJCsGHAMB9Lx UFUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=eW0xstcW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jw12-20020a170906e94c00b006e89b503983si3000157ejb.417.2022.04.12.02.36.46; Tue, 12 Apr 2022 02:37:26 -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=@foxmail.com header.s=s201512 header.b=eW0xstcW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347398AbiDKOqg (ORCPT + 99 others); Mon, 11 Apr 2022 10:46:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344434AbiDKOqf (ORCPT ); Mon, 11 Apr 2022 10:46:35 -0400 X-Greylist: delayed 2611 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 11 Apr 2022 07:44:18 PDT Received: from out162-62-57-210.mail.qq.com (out162-62-57-210.mail.qq.com [162.62.57.210]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5456662CA for ; Mon, 11 Apr 2022 07:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1649688253; bh=7GopoeoK8zI4GB2l2eUN6bBtjkL/7R2gwbjUIUdvthE=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=eW0xstcWUyT4B9NM20y9wT/R8QwUbOSYT12qUzbcidpHB88jhMuili6sd3tHDYBLu aEiTf0MP0DGz/NcR+RcAmeWEO+ykBdqCiDmT1KRD5ivDQIQh3/fa+cn8e1Ld31L1g4 BYWS1a37n6HQTtjc7ufU4bm+8droRJbAhUYkzFdE= Received: from [192.168.0.110] ([36.57.147.99]) by newxmesmtplogicsvrsza9.qq.com (NewEsmtp) with SMTP id B092E6BD; Mon, 11 Apr 2022 22:44:09 +0800 X-QQ-mid: xmsmtpt1649688249tqqsw39z6 Message-ID: X-QQ-XMAILINFO: OUk+E8Vw5ntv/lqYBkZyCcCdpp8XhX2hlX1rqAcTh0BWTUq6rW9TdRRTC2ByXP k679H/OPozXD3bmep3k6pICozuz/THcQtK34zGXbsUR38rBK4pRZGKxWnRhm+1PfBFq7m3dI94nT Z+f0B1bqt0AbD5flZ6QUvO1kkofS2BpEUAONtJuQk0+4/u8l0Opugk4GV9C+noYnBjQ29QPstodw h/h7sJXnXkGRNdzxSYPhqRLMLjXIC2pLPzyUlktJ8uTG/CvrE8iBT0P+hRA13V8DY4MpkPeTR5eH bTZxqIowTrMOr4FwlffUmU4W6YXyuUO81oPOyPbN6nN5aOF/9CdbJTI9jlhav+v6SLNiW+FWFPWI OreZh4wqTZNqnjweUQjeb6iz5oIlMnl7RCfc8Jmr9sbmxqG+Y1bLis5B1ou1G8fbBPPlPTW+bBST YxFSd2/hhDFFBXSjpVzXC6N7A8EtJRkw03N0N2W8qwv/wMX2erwFxZV8FNnDy2b9SOoGYEj8jIy6 3JEOFi05EhlLq3K+4Cef1dDBAmjGbi1pKtr9wLLquWLV2k4kwFG1Rs3FcUT3h6uARFVBse0nrj1/ xnqeKqvrSSQJ3peIKIeN4YxuuOwVqTlusOhrYZn2MIh9uR5736hOzKTNEBPadYgg36UmFzYzSseO 6XXTP2B0x2ImRwuHUs/D+k7nLv8Ly7BwHq0ofcpUMI8QtOXj3waYW6sxRFsHJOcZURfWQ9obyUlf Nox07YsIhL+6Ht5wmBNZrql5BOGE4VhlTgQ+K0d6fRox5Fn+/A0MJL/KWyMeCF0OwVfmKzILK3jG V+yE6tb6R68LUE+WIAkIUB/bhBc3tMwGOMxQOf4ib0CbsWzCobC6zicrHv4CqDcUCWcuJ6IlLok1 2tOLf7HDm97/kydq4Q7ycxg22hdWYiyGZYDZ02FBO0CQQQYPexHbXRmLCcsn4Cbrlvck0as4wEfP 3Fn80RAl9z/5qXlVuObrnCJ41VLPZ3nGHMNenmmMWJAZPRMzpsn0JSq652GkAGa7erphNFAQQ= Subject: Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit To: Dave Hansen , Joerg Roedel , Fenghua Yu , jean-philippe Cc: Ravi V Shankar , Tony Luck , Ashok Raj , Peter Zijlstra , Dave Hansen , x86 , linux-kernel , iommu , Ingo Molnar , Borislav Petkov , Andy Lutomirski , Josh Poimboeuf , Thomas Gleixner References: <20220207230254.3342514-1-fenghua.yu@intel.com> <20220207230254.3342514-6-fenghua.yu@intel.com> <56ed509d-a7cf-1fde-676c-a28eb204989b@intel.com> From: "zhangfei.gao@foxmail.com" X-OQ-MSGID: <88055f44-3106-feca-aeac-d7272f3ee824@foxmail.com> Date: Mon, 11 Apr 2022 22:44:08 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_MUA_MOZILLA, FREEMAIL_FROM,HELO_DYNAMIC_IPADDR,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RDNS_DYNAMIC,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 2022/4/11 下午10:36, Dave Hansen wrote: > On 4/11/22 07:20, zhangfei.gao@foxmail.com wrote: >>> Is there nothing before this call trace?  Usually there will be at least >>> some warning text. >> I added dump_stack() in ioasid_free. > Hold on a sec, though... > > What's the *problem* here? Did something break or are you just saying > that something looks weird to _you_? After this, nginx is not working at all, and hardware reports error. Suppose the the master use the ioasid for init, but got freed. hardware reports: [  152.731869] hisi_sec2 0000:76:00.0: qm_acc_do_task_timeout [error status=0x20] found [  152.739657] hisi_sec2 0000:76:00.0: qm_acc_wb_not_ready_timeout [error status=0x40] found [  152.747877] hisi_sec2 0000:76:00.0: sec_fsm_hbeat_rint [error status=0x20] found [  152.755340] hisi_sec2 0000:76:00.0: Controller resetting... [  152.762044] hisi_sec2 0000:76:00.0: QM mailbox operation timeout! [  152.768198] hisi_sec2 0000:76:00.0: Failed to dump sqc! [  152.773490] hisi_sec2 0000:76:00.0: Failed to drain out data for stopping! [  152.781426] hisi_sec2 0000:76:00.0: QM mailbox is busy to start! [  152.787468] hisi_sec2 0000:76:00.0: Failed to dump sqc! [  152.792753] hisi_sec2 0000:76:00.0: Failed to drain out data for stopping! [  152.800685] hisi_sec2 0000:76:00.0: QM mailbox is busy to start! [  152.806730] hisi_sec2 0000:76:00.0: Failed to dump sqc! [  152.812017] hisi_sec2 0000:76:00.0: Failed to drain out data for stopping! [  152.819946] hisi_sec2 0000:76:00.0: QM mailbox is busy to start! [  152.825992] hisi_sec2 0000:76:00.0: Failed to dump sqc! Thanks > > For instance, if we have: > > nginx: ioasid_alloc()==1 > fork(); // spawn the daemon > exit(); > ioasid_free(1); > > and then a moment later: > > lynx: ioasid_alloc()==1 > fork(); > exit(); > ioasid_free(1); > > There's no problem. The original nginx process with ioasid==1 exited. > The fact that *some* process called nginx is still running doesn't mean > that it still has a reference to asid==1. > > Are you sure the nginx process that allocated the ASID is the same > process you see in ps?