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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F50DC43334 for ; Tue, 19 Jul 2022 00:07:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:Subject:From:References:To:Cc: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=q+a90ig2bN89qBZoyOX+ztYslE2f5UpcEFGToY+83i0=; b=N0XzU+Tnsvk2SD uCsktkS+Y6XHi+qx/+A05Rkb/eNCIf0G3aghECZXXVnXnxQ8DJl20MSJ8vGwwMq7+zT262mB3w8OX kvdibQtMF2T/AVLUuNq9FJUmhQBOWN1kDZqj15oSCQsKI/He3MxiXC0UYgB7wvb4oaJQba5ijTIps TLVYAjIX1Rx3I1GjTeMCcsotgvBu2/jqJm8oUDe/FI/4Ogz6CJ0CNT/7UwOQMyo6xGSaoQn/L5rY/ vkMUUEtUce6NFJZSw/bj488uoQAPJwW1sSxrF9fsScbuh5589vfeGxrymZBTrBGUYCQci4RHSmF6j GanJbr/AON/va8hASAOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDal0-002xVt-4c; Tue, 19 Jul 2022 00:06:34 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDakv-002xTa-Lt for linux-arm-kernel@lists.infradead.org; Tue, 19 Jul 2022 00:06:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658189189; x=1689725189; h=message-id:date:mime-version:cc:to:references:from: subject:in-reply-to:content-transfer-encoding; bh=29irNU69Aaj6YHBxBjzfv6PGD4zSfN7x3EpWcwWR9p4=; b=LZFKGBaovh6A8l610cihptRrpvKxo0z+C7eMibjgIBlJKD2QCIpuwwCc 4MuB8maPb5qEGCSjgdH3J3WWzMJvB0+q4+KcKlBRFbi9Z7yl3Accmy9FQ C512nqTDUg5XuHriNzStU9hkmVRf6hZicI2IZRM0SDOMnu/iEzCs6Scji 5Yq9uPaVW9qTBvIgIKv3cx97tQoDX8dWTQ+trN7eDQYerCPccrSoA9lv2 4vB3ozxyxOs2HHf/MLStoIkpqXAborvj2f6LuVS/fqD6daoZdAYbNlrA3 gL9bY3dVvfbJakYoLWFplazi2FAEhw7K7cZTYlb/CQkzmmwYHZWTBi4h4 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10412"; a="312034260" X-IronPort-AV: E=Sophos;i="5.92,282,1650956400"; d="scan'208";a="312034260" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2022 17:06:22 -0700 X-IronPort-AV: E=Sophos;i="5.92,282,1650956400"; d="scan'208";a="547694963" Received: from blu2-mobl3.ccr.corp.intel.com (HELO [10.254.213.128]) ([10.254.213.128]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2022 17:06:19 -0700 Message-ID: <9614fd81-5feb-b9c9-8317-26ca82d30d55@linux.intel.com> Date: Tue, 19 Jul 2022 08:06:02 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: baolu.lu@linux.intel.com, will@kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, suravee.suthikulpanit@amd.com, vasant.hegde@amd.com, mjrosato@linux.ibm.com, gerald.schaefer@linux.ibm.com, schnelle@linux.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Content-Language: en-US To: Robin Murphy , joro@8bytes.org References: <894db0ccae854b35c73814485569b634237b5538.1657034828.git.robin.murphy@arm.com> <903a1677-4217-d793-6295-3927143d98fb@linux.intel.com> <6557623d-3e4e-9f3e-e735-fd9654305f65@arm.com> From: Lu Baolu Subject: Re: [PATCH v3 01/15] iommu/vt-d: Handle race between registration and device probe In-Reply-To: <6557623d-3e4e-9f3e-e735-fd9654305f65@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_170629_759228_B25B949E X-CRM114-Status: GOOD ( 12.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Robin, On 2022/7/15 20:37, Robin Murphy wrote: >> In fact the rmrr list in the Intel IOMMU driver is always static after >> parsing the ACPI/DMAR tables. There's no need to protect it with a lock. >> Hence we can safely remove below down/up_read(). > > IIRC that leads to RCU warnings via for_each_dev_scope(), though. I did > try replacing this down_read() with rcu_read_lock(), but then it doesn't > like the GFP_KERNEL allocation in iommu_alloc_resv_region(), and that's > where I gave up :) > > I'm mostly left wondering whether the dmar_drhd_units list really needs > to be RCU protected at all, as that seems to be the root of most of the > problems here. I just posted a fix patch here: https://lore.kernel.org/linux-iommu/20220718235325.3952426-1-baolu.lu@linux.intel.com/ It can remove the recursive locking and RCU warnings. Can you please take a look at it? Best regards, baolu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel