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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72032C433EF for ; Mon, 1 Nov 2021 10:35:49 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 3BB3D60F56 for ; Mon, 1 Nov 2021 10:35:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3BB3D60F56 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.219102.379754 (Exim 4.92) (envelope-from ) id 1mhUf3-0007Wa-H5; Mon, 01 Nov 2021 10:35:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 219102.379754; Mon, 01 Nov 2021 10:35:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mhUf3-0007WT-E6; Mon, 01 Nov 2021 10:35:29 +0000 Received: by outflank-mailman (input) for mailman id 219102; Mon, 01 Nov 2021 10:35:28 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mhUf2-0007WN-2K for xen-devel@lists.xenproject.org; Mon, 01 Nov 2021 10:35:28 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mhUf1-0005Wn-T1 for xen-devel@lists.xenproject.org; Mon, 01 Nov 2021 10:35:27 +0000 Received: from iwj (helo=mariner.uk.xensource.com) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1mhUf1-0006ED-S5 for xen-devel@lists.xenproject.org; Mon, 01 Nov 2021 10:35:27 +0000 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.89) (envelope-from ) id 1mhUet-0004g6-GO; Mon, 01 Nov 2021 10:35:19 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=References:In-Reply-To:Subject:Cc:To:Date :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:From; bh=IgsO6RvZpagWAUjAXUbFGYZO/EFRboyzBB0dtXio9vU=; b=DFJ5R6Nr+63bSRrUEkmvU/M5MX homWctrwF+bgnGJqeBZ8aR+4iUeDxMrzudaUKh3JTZ6G/Ml0DtrdMGfNoHrZlhS91tuHkaESFOBtt 8ZypAEpBlJBkjagrtbXYzjvAgfflr3/DV++8Fm/TJcPWHKQWTl82zeY7RqZeAD0FwBFw=; From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <24959.49895.14808.77881@mariner.uk.xensource.com> Date: Mon, 1 Nov 2021 10:35:19 +0000 To: Stefano Stabellini Cc: Julien Grall , Julien Grall , Michal Orzel , xen-devel , Volodymyr Babchuk , Bertrand Marquis , Ian Jackson Subject: Re: [patch-4.16] arm/smmuv1,v2: Protect smmu master list with a lock In-Reply-To: References: <20211026122903.15042-1-michal.orzel@arm.com> <70c30a6c-b779-805e-079a-41bb484894b9@xen.org> <01545115-e82e-2a9d-a8e4-da9676080c0f@xen.org> <4554621d-63da-ea3e-e56a-4e01d0cef347@xen.org> X-Mailer: VM 8.2.0b under 24.5.1 (i686-pc-linux-gnu) Stefano Stabellini writes ("Re: [patch-4.16] arm/smmuv1,v2: Protect smmu master list with a lock"): > In regards to this specific patch and also the conversation about 4.16 > or 4.17: I think it would be fine to take this patch in 4.16 in its > current form. Although it is not required because PCI passthrough is > not going to be complete in 4.16 anyway, I like that this patch makes > the code consistent in terms of protection of rbtree accesses. With > this patch the arm_smmu_master rbtree is consistently protected from > concurrent accesses. Without this patch, it is sometimes protected and > sometimes not, which is not great. It sounds like this is a possible latent bug, or at least a bad state of the code that might lead to the introduction of bad bugs later. So I think I understand the upside. > So I think that is something that could be good to have in 4.16. But > like you said, the patch is not strictly required so it is fine either > way. Can you set out the downside for me too ? What are the risks ? How are the affected code paths used in 4.16 ? A good way to think about this is: if taking this patch for 4.16 causes problems, what would that look like ? Thanks, Ian.