Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4900723imm; Fri, 18 May 2018 12:38:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpiZSh9uvPxThm10etkp/dkudxzcRYW2D/7vHRC40EUNCRMdldNfTBrcwpa5T2T+TMlcUvg X-Received: by 2002:a62:449c:: with SMTP id m28-v6mr10604428pfi.145.1526672303958; Fri, 18 May 2018 12:38:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526672303; cv=none; d=google.com; s=arc-20160816; b=O1+q3NiWuSVKjoEXyQ6pvs3Ei/Ca/xJOIXg0usD+JHfPkdD3j3eZ8bpnvRVZOu83FD JA6JfveuIkfnoPHo9W8nVyflyAB6es0uUu66uqn83R+HVAr1HEFrsbkNR7Jfc0p7NXNk JtfcmJMe/18CR++hJUb8OgRGpO7LR949k3x45NNr9fGdCohunBLAhE6SZDuHasx8G4Y0 TzG4wZxjATuU5JKq9v30RIFrr4W86C7EZ63t7hhVCwxlI0Ne4aRKrRAPwNDI6wxLGGzc UmnZGi1BgGWL9qCsicJdn/bOzxbi71zIBwfMl30xg0IVPW2C9eKA99tTmiI53DZASABM WHcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:from :references:cc:to:subject:arc-authentication-results; bh=fbgmIIeT94k2n0QrdGS5GH+vGNwbV4Q2f2X3Oew1MuI=; b=KFQr4AxWdYmEohk0JJEcfPissveMStNcULm3hNIe2IViIdqXHJYwqN58ZUycgxM7ls TNN2+yObZRr3O33c0mLfKklBgXqPKXZSOwgAntYxw5Tni0xOJb2V/lEntrzMdDYdVxgU tPHDzXw4M61J/qXQzzlb9/UWPJImy02W9KVW6HOXeAE+O4OrIkLnX4rSmS+06m3sdWpj jcovjO5tg2jH8uwqufgJwmEOHcgvsxGRnEdGNq0RAs5LzigzEOI7n7O74YUT3njIKxUQ pU83ByjKTXAM/5drGRXNi/NrhveBGoUFu1COWYyhtQz23xeSoJC043fZB5J0mW0TDiXC mexQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a35-v6si8096631pli.85.2018.05.18.12.38.09; Fri, 18 May 2018 12:38:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752165AbeERThw (ORCPT + 99 others); Fri, 18 May 2018 15:37:52 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:11631 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751429AbeERTht (ORCPT ); Fri, 18 May 2018 15:37:49 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1, AES128-SHA) id ; Fri, 18 May 2018 12:38:00 -0700 Received: from HQMAIL104.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 18 May 2018 12:37:49 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 18 May 2018 12:37:49 -0700 Received: from BGMAIL102.nvidia.com (10.25.59.11) by HQMAIL104.nvidia.com (172.18.146.11) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 18 May 2018 19:37:47 +0000 Received: from [10.24.70.199] (10.24.70.199) by bgmail102.nvidia.com (10.25.59.11) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 18 May 2018 19:37:42 +0000 Subject: Re: [PATCH v4 0/2] vfio/mdev: Device namespace protection To: Alex Williamson CC: , , , References: <20180518190145.3187.7620.stgit@gimli.home> X-Nvconfidentiality: public From: Kirti Wankhede Message-ID: <2cb44337-eea6-5953-3df9-b53f3f6e3301@nvidia.com> Date: Sat, 19 May 2018 01:07:33 +0530 MIME-Version: 1.0 In-Reply-To: <20180518190145.3187.7620.stgit@gimli.home> X-Originating-IP: [10.24.70.199] X-ClientProxiedBy: DRBGMAIL104.nvidia.com (10.18.16.23) To bgmail102.nvidia.com (10.25.59.11) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/19/2018 12:40 AM, Alex Williamson wrote: > v4: Fix the 'create' racing 'remove' gap noted by Kirti by moving > removal from mdev_list to mdev_device_release(). Fix missing > mdev_put_parent() cases in mdev_device_create(), also noted > by Kirti. Added documention update regarding serialization as > noted by Cornelia. Added additional commit log comment about > -EAGAIN vs -ENODEV for 'remove' racing 'create'. Added second > patch to re-order sysfs attributes, with this my targeted > scripts can no longer hit the gap where -EAGAIN is regurned. > BTW, the gap where the current code returns -ENODEV in this > race condition is about 50% easier to hit than it exists in > this series with patch 1 alone. > Thanks for fixing this. This patch set looks good to me. Thanks, Kirti > Thanks, > Alex > > --- > > Alex Williamson (2): > vfio/mdev: Check globally for duplicate devices > vfio/mdev: Re-order sysfs attribute creation > > > Documentation/vfio-mediated-device.txt | 5 ++ > drivers/vfio/mdev/mdev_core.c | 102 +++++++++++--------------------- > drivers/vfio/mdev/mdev_private.h | 2 - > drivers/vfio/mdev/mdev_sysfs.c | 14 ++-- > 4 files changed, 49 insertions(+), 74 deletions(-) >