[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 01/15] xen/commom/dt-overlay: Fix missing lock when remove the device


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Henry Wang <xin.wang2@xxxxxxx>
  • Date: Wed, 24 Apr 2024 14:02:12 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N1SzlAlu4mvg6KH36iAeFziAGC68TiZYtx695q0ymeU=; b=A/aCWeNM6UVIjrsmDXMpcIciTJMjrCz/ZkgTQDsMvnoSKkPxexypdlFVQRHVThRP6aTT6E44QMviooc8qsAgeTfI5sQGlaDLJ7Pp5rqWSaiXW5xDUqRgQa/mEdHDnWGWyyuiYZmGTe1PAhGg4hqk6J6mMhyUVwQjbZXDYnhlvLGGhOFjrMnhNmUSrZ67rrefHvFn1gos2fVkAJTXPoukWcy94IcFlRxjv2ImCGPqroj9jtCj3OvwUOi22stCqSEg/MFr/uIbhaR++Y1+1vOyCkbIPJYXEtoYPhpfsRfOjOW1+AoCKE0MWhVaMfJ1mlKAQAfRutUnVPHiPBmw3O4ArA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JUwrUnXJ0xnOq/cNF9Ar42tHQjh2JwK6DVlDUO1lrIcBIxHViTTD7PJLkIF+BCz0e762o413NRYXH/r5cwH5GG56nTxXx1SMkX6a9/28d7zf9adrsQPMYk9xSXNW174UMPmSmhZRhKrfMw3uwWk2Uh2x1t/tzeGi+yMi3mbJX1QlWILk3HFJfgsn+9/G+pPfKKnEIvijJzg9K4VXs1FuGelTwOIpASze83zEXUHA6C+IAMGDpjByTgKCZOmk60UI3/z16uxLUwI8d0MLis8rEKFM/O9p7kAhVZVbShlXSzUFZjIZUIOAaPCtN5uy5uCbOCceuDdQ14+a8cyUSPVhow==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 24 Apr 2024 06:02:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Jan,

On 4/24/2024 1:58 PM, Jan Beulich wrote:
On 24.04.2024 05:34, Henry Wang wrote:
--- a/xen/common/dt-overlay.c
+++ b/xen/common/dt-overlay.c
@@ -381,9 +381,14 @@ static int remove_node_resources(struct dt_device_node 
*device_node)
      {
          if ( dt_device_is_protected(device_node) )
          {
+            write_lock(&dt_host_lock);
              rc = iommu_remove_dt_device(device_node);
Any particular reason you add two call sites to the unlock function,
instead of putting it here?

Oh...you are correct. It is indeed better to put the unlock here. If this is the only comment for this patch, can I respin this only patch as a v1.1 or would one of the committers be ok to fix on commit? Sorry for the trouble and thanks for the suggestion.

Kind regards,
Henry

Jan

              if ( rc < 0 )
+            {
+                write_unlock(&dt_host_lock);
                  return rc;
+            }
+            write_unlock(&dt_host_lock);
          }
      }




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.