Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3196723rwa; Mon, 22 Aug 2022 23:53:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR4eSoMahtKWB66u2JvVAgapqErHoE52R6d0/yLqH0Pee3TL9RGyNbvn2cJL85IfU7xxdqVw X-Received: by 2002:a05:6402:4244:b0:446:ff0f:6559 with SMTP id g4-20020a056402424400b00446ff0f6559mr2361469edb.411.1661237605019; Mon, 22 Aug 2022 23:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661237605; cv=none; d=google.com; s=arc-20160816; b=0E4vSzK57nYV64G34FaBV3yOYmx7uKTnBBu2EopmEFptH5VEMLIDJru52PpfdFllju 1p+UMSvg713X91K+ny9HPLJtx0n9qVsTrHcP8SLlWZRmwR9bANZLv7x4UjVREx3gjBKK iOgSgzmflg5iGG0i99UhG2UM7oDqYyw33clmj70aRygO1MnwCh0PNF8AnJ91ebRU75zr eypNOzMQxkaW+8iK2dlYtLe++8ze3ipU7Jk2VZIMZ1d//ZYK6uVHCt4yJ4MdwNZF7A5k mpi5/f5rZcNa2q6pegjpjYfHlRByFOv4SU3LrztAHIhKTXyGj+IH8WhauzR91A1vqctm a6fg== 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:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=dLuhDzGp1DpNGBjdU1OoSJ+PHObXDbHRnhuUxKzePLA=; b=MS7wSKsvqLBewJrdWu/gJGanvc/dQKTgx04JCxeMbIS8OlKbn4aEtNc6VBKT1fZYJp Ll9IT0+qWUL9uUfukAEIUeRXUH88V44dJwqNGbql3AQB53hb/EJ68Jv6sL94MlJhspPV 9jS//oBu2I99Je4phu/bQwm/lwqEUVenXXBKkeW9YbYEd3meX8urSTV+SD8sB2lS00FJ W/KHMCzlnlwu3Yv5Oi8kWEfiyRwVIOw3zyTIFA+FO8bV2b/56UD4KjdfASGUGND1TAPB 6PtVVjYPzxAiGDo/AXoOjV/LbCvumsZE5884kIbblTJB/FUGEmLKmmyg4mRrsMNWW3Cx UxaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XSNbStby; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a056402090800b004461a2cbb05si1184248edz.394.2022.08.22.23.52.57; Mon, 22 Aug 2022 23:53:25 -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=@intel.com header.s=Intel header.b=XSNbStby; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240605AbiHWG00 (ORCPT + 99 others); Tue, 23 Aug 2022 02:26:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240579AbiHWG0Z (ORCPT ); Tue, 23 Aug 2022 02:26:25 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D949C60690 for ; Mon, 22 Aug 2022 23:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661235984; x=1692771984; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=mFPEXWqVfNGpmhdTzE8CaxKEhae+4dG8ZW90cX5pwwk=; b=XSNbStbyEsOQdhw2hqwumuhkbOX9HW9Npl1brffJjrRSBArm4f88eEj/ fHjqesX9hVTfANQFC4ClMwmsmSlM0VNwEZXDh6luTO5GCI8VRHjRttEZb +S54OmUFfGXIDfE45TJo+obsvvWfu2QccnluVHyXsKfcogf8Yhrx/RQe7 7+PgiCK0cpyEksENN3Kwv1JTuzvwep+X6hgHUlIq8Z1SbVp3GAs+zUj5/ N9ZRFDuTraNGbJ3JZNhpH+LSMdfGlDxxhK5uQiunlk3bHD9P/tFGvYZ/Y 9QTL7u/mmcsOK59D/0tCgA/YwvIY6ErCEWWimv7FNZFQC5rOqRI6F9TYn A==; X-IronPort-AV: E=McAfee;i="6500,9779,10447"; a="293602748" X-IronPort-AV: E=Sophos;i="5.93,256,1654585200"; d="scan'208";a="293602748" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2022 23:26:24 -0700 X-IronPort-AV: E=Sophos;i="5.93,256,1654585200"; d="scan'208";a="642324549" Received: from xujinlon-mobl.ccr.corp.intel.com (HELO [10.254.211.102]) ([10.254.211.102]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2022 23:26:22 -0700 Message-ID: Date: Tue, 23 Aug 2022 14:26:19 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: baolu.lu@linux.intel.com, Joerg Roedel , Will Deacon , Robin Murphy , Kevin Tian , yi.l.liu@intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] iommu/vt-d: Fix possible recursive lock in iommu_flush_dev_iotlb() Content-Language: en-US To: iommu@lists.linux.dev References: <20220817025650.3253959-1-baolu.lu@linux.intel.com> From: Baolu Lu In-Reply-To: <20220817025650.3253959-1-baolu.lu@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, 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 2022/8/17 10:56, Lu Baolu wrote: > The per domain spinlock is acquired in iommu_flush_dev_iotlb(), which > is possbile to be called in the interrupt context. For instance, > > > iommu_flush_dev_iotlb > iommu_flush_iotlb_psi > intel_iommu_tlb_sync > iommu_iotlb_sync > __iommu_dma_unmap > ? nvme_unmap_data > nvme_unmap_data > nvme_pci_complete_rq > nvme_irq > __handle_irq_event_percpu > handle_irq_event_percpu > handle_irq_event > handle_edge_irq > __common_interrupt > common_interrupt > > This coverts the spin_lock/unlock() into the irq save/restore varieties > to avoid the possible recursive locking issues. > > Fixes: ffd5869d93530 ("iommu/vt-d: Replace spin_lock_irqsave() with spin_lock()") > Signed-off-by: Lu Baolu This patch has been queued: https://lore.kernel.org/linux-iommu/20220823061557.1631056-1-baolu.lu@linux.intel.com/ Best regards, baolu