Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp818029pxb; Tue, 12 Apr 2022 14:17:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFCZKrva8Pgwe2MubMa0Fd53X1P1x+Jwxmt9s5Q7Oo2aAfovX15ig83vctRoJuSFH8X9c1 X-Received: by 2002:a63:4004:0:b0:39d:8634:fff2 with SMTP id n4-20020a634004000000b0039d8634fff2mr5848187pga.28.1649798262023; Tue, 12 Apr 2022 14:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649798262; cv=none; d=google.com; s=arc-20160816; b=t7yvFcms3qR49/Q6eUpr7NpbNyyVS7lEPGsC9eHlFEGQzZ7xVYwmIQCJbplY/oqo+y EdUFHW9Siv+3AzJ34oyUR+cs73jDtpCaIFEK/XizxcafrHPWHJ+xRV5lutVmkPe58Gp6 xBR0ow7AcjYa028ocVKl/BDSQsHfvKu3WbqewL1dvUrnLTRL2IHkCrFn24xl/yv84B59 Z+rZ8JWEszq4jy++/84HYIErX5H1yRgRjwZRjYVGEYWdGI5AG5am36347AGcyGzthZUx zK93di9J4nbLeV1zQXiqeHapD7sbxj0+lg+jyZTvpufuk6JJD2vFaoPoDJMccqQUEuE1 xbYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=+wjddC9IcFu44bJa8nrZNw2kcG734y4d6Kqfxv0fGe0=; b=uUPxk46sM0xHVfHPRUVHA417F9WaTzO6JR5SqCu6ZXbZ52JvDTak06Z3AdqJLhek5c ZpSrjSrbkkpdcyWxN87l+OhgzVIF28UOLcCvuSBrwLl8PclCsqmu72hAoUpme2K1MmMJ tuEGsKrPJ/hS/O1fMA6Lg6uXqq/y3m80pQBveDQODtQTvrc03I6oQcwhlU35sWVkegeY 4ymEVtQgIZMyrhDVPwuCVhnsmJBxumIk3BXSTpqiMCLComzPeHvqhsLBR8UWClEBPVtc vjcLen/fVYphci3iBrH7jwFbtAPEB3X2qT0yFPAX0+xDNX9N20YvMmSY8uVMvgqdEIV+ /jaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ds8Fxd4t; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d17-20020a056a0024d100b00505a42ba062si10121795pfv.287.2022.04.12.14.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 14:17:42 -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=@intel.com header.s=Intel header.b=ds8Fxd4t; 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=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 871C3F61C2; Tue, 12 Apr 2022 13:31:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347509AbiDKOzJ (ORCPT + 99 others); Mon, 11 Apr 2022 10:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343551AbiDKOzI (ORCPT ); Mon, 11 Apr 2022 10:55:08 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0371319C28 for ; Mon, 11 Apr 2022 07:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649688774; x=1681224774; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=mB8NNTw44eMZUF35h4h29n6vL38O8wnd1LwLHFK4xHE=; b=ds8Fxd4t4VU9DhRM3P/TaXNSPd0EfUWJUBbQ/yz17x044xPYIaqYOwr7 MHpht+QkzWbjuubFwzj8f0y/XQxu8vCqFPHPwu/NsgAh4Yv/m37qShndH fypoO6Qdld6HH2LVWtVEOCqhw7D8Cae+Cgj+2gKAekPMZ2PrH6HagW7sX brtcXNskZXJtZkc2ZuUELhJNOw2cP78M2BvAoRus61ot2ycvjd5VmKcgL uhsXapDvBNogHU2pQ8WV+iOM2oa1FT4VGVJR4GA1gZvJlHtU8/77VH4a6 TbnQ7FqaGeM6LHV4d6o4aQqoCNwEh7F9ShW0oQC5NZg+iBuvkUQFvgp3s Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10314"; a="325045641" X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="325045641" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 07:52:53 -0700 X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="525561650" Received: from srkondle-mobl.amr.corp.intel.com (HELO [10.212.113.6]) ([10.212.113.6]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 07:52:51 -0700 Message-ID: Date: Mon, 11 Apr 2022 07:52:57 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: "zhangfei.gao@foxmail.com" , 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: Dave Hansen Subject: Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 4/11/22 07:44, zhangfei.gao@foxmail.com wrote: > 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! That would have been awfully handy information to have in an initial bug report. :) Is there a chance you could dump out that ioasid alloc *and* free information in ioasid_alloc/free()? This could be some kind of problem with the allocator, or with copying the ioasid at fork.