Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp371082ybv; Fri, 7 Feb 2020 00:49:16 -0800 (PST) X-Google-Smtp-Source: APXvYqzOJ+U3JOntlqjROYBsSK/HtJKeelSVLO6GNZKUsh5DBA3EcxwFtVqfo/cLuMhVpGa/7m/2 X-Received: by 2002:aca:d507:: with SMTP id m7mr1310095oig.48.1581065356379; Fri, 07 Feb 2020 00:49:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581065356; cv=none; d=google.com; s=arc-20160816; b=C2tKMIfr69OxVib9/jAoYQey5SjKDOkLKsP+9sKVh7s4SFhHIWjBAYrZXSamF+gUVw B71Xu0AE/MuAEyaL/nx//8AaI8Z96+lPioN6CqXV9l09RSYxm/t6WiHqux3CiSe4AV8M im8fNLLZUox7rXyMxbdDTkJQDuP9aKxhne4jLnXK8AFJM3+EgWr/gaaynoj92rpLmRuy qMOvb4t7BUfpBvl6qi7viXCFc8OBTBJW4WcMySfOeoZZF+uRDlfsg9XPrqqI1cUBwtZJ xRh16IS7fpv8PjQ+XWxkwzck7afe/q9xtfF2bCfVtdQtOC/O33UY3do6Gxv7AiLEWxDW p2FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=309I1I7pmnmndXbQ/NrLjRZ5f4RF1ubjPE99EH9brrw=; b=tsIIBkWLtqy7hJ+37FpPz1CRSIXNs+to/KmFqj5Qwc3WyFCHt1RytgR3noXA8oNKuk Bx6UayQFEX8QbdyYj99S8CQH7keyvV45XvLnUKrn/PASG9T+LcNDAHqOxSf5pldTVTcA wmke3/EthcSKq13V7DyAr4tX7PK5b3b4X9RZeIdilyWh8bLSVvw/G1XxxL4ndAXkctMB uW6FeWpjLiwvw3YbTGNNEtegXawSFk3K+leS9fa3Whibhn1y4jfYvXKBgZ2l+Gnb3xvp t4199Cj7iFNe5MdhgN6JuPcgsauVNE3RjjSWKeSL9imQeFMpmYYy3DdBzOWbrBIw1FAw OfFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IB3SDQMe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si1284091ota.19.2020.02.07.00.49.04; Fri, 07 Feb 2020 00:49:16 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=IB3SDQMe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726901AbgBGIro (ORCPT + 99 others); Fri, 7 Feb 2020 03:47:44 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39016 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgBGIro (ORCPT ); Fri, 7 Feb 2020 03:47:44 -0500 Received: by mail-wm1-f65.google.com with SMTP id c84so1740694wme.4 for ; Fri, 07 Feb 2020 00:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=309I1I7pmnmndXbQ/NrLjRZ5f4RF1ubjPE99EH9brrw=; b=IB3SDQMetP4BY0/eWhuXAQOym90cQN+0zLfSkhbRZYzUZ74jSGXrVyDm3f4e3jqS4s dmWvlHVO58GacxDzmsAZSthT9AIwjna7LXWIyp92G9LWRJN7lfc8sFJ3W5X4OhlrnKRB lXaxxocvYowIZ9RYRJCWxgmZWPhsvOITOJrYcQijufHHhDcCbDuRHK91DfysrPHJ1VPq RRmugKvN9NMDF0AlrjJ6achOuMLYc+f7u6uNEogy/6ur0qedNqQsxwbdtC7ZfWWI3vBk MN4icM1zoWDA96M7ZqwT9cv/4gBo5MCejS38NmQ1d2O6Gah3ObeXeIxLWMN6Zc3yO7aS 8Z9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=309I1I7pmnmndXbQ/NrLjRZ5f4RF1ubjPE99EH9brrw=; b=LvW89rrV/p801HNS2tRrfbT18q+bu7yTy641ea7Eo8zpW5RQq30PKnZbNPggdsi9LF pOQNI5T0FVnL9bpCyXGHqWmFbKQ67C3+qOsE3Sh70RWrGXbJ7EfZ0tJ3q3ppY9m9OcEd JFMNy3KM9JMYLVtj3FVUsntuTtchFs7CKGlhxPtAYDzMIL8AImSELeLRjQSRHZStr5bb 0rW9kJk1tOsnuistTyGHsWAA9L7GQfo17AzpnRmMzayXQb0sMzffd4CnTXFXOZDz9d6L CoNSJE/8ME9ynQvJUdkwcz0gKovSDzkbZdVjisUOHlveGEsOnh9YiMNZtDH95CwDrxHH BCSA== X-Gm-Message-State: APjAAAXpp0Locc7IfLks3NCKknBSGnPHhpDbOchUREc1/n7Eyk92M0c1 acUmV2fft7nYlbdSuL8PNrbHTQ== X-Received: by 2002:a7b:c386:: with SMTP id s6mr3116111wmj.105.1581065261841; Fri, 07 Feb 2020 00:47:41 -0800 (PST) Received: from myrica ([2001:171b:c9ad:af70:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id c141sm2495221wme.41.2020.02.07.00.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 00:47:41 -0800 (PST) Date: Fri, 7 Feb 2020 09:47:32 +0100 From: Jean-Philippe Brucker To: Jacob Pan Cc: Alex Williamson , iommu@lists.linux-foundation.org, LKML , Lu Baolu , Joerg Roedel , David Woodhouse , Yi Liu , "Tian, Kevin" , Raj Ashok , Christoph Hellwig , Jean-Philippe Brucker , Jonathan Cameron , Eric Auger Subject: Re: [PATCH 3/3] iommu/uapi: Add helper function for size lookup Message-ID: <20200207084732.GA1994440@myrica> References: <1580277724-66994-1-git-send-email-jacob.jun.pan@linux.intel.com> <1580277724-66994-4-git-send-email-jacob.jun.pan@linux.intel.com> <20200129144046.3f91e4c1@w520.home> <20200129151951.2e354e37@w520.home> <20200131155125.53475a72@jacob-builder> <20200203112708.14174ce2@w520.home> <20200203124143.05061d1e@jacob-builder> <20200203141236.4e2d7a74@w520.home> <20200203144102.643f9684@jacob-builder> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200203144102.643f9684@jacob-builder> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 03, 2020 at 02:41:02PM -0800, Jacob Pan wrote: > Yeah, that would work as well. I just feel IOMMU UAPI is unlikely to get > updated frequently, should be much less than adding new capabilities. > I think argsz could be viewed as the version field set by the > user, minsz is what kernel current code supports. > > So let me summarize the options we have > 1. Disallow adding new members to each structure other than reuse > padding bits or adding union members at the end. > 2. Allow extension of the structures beyond union, but union size has > to be fixed with reserved spaces > 3. Adopt VFIO argsz scheme, I don't think we need version for each > struct anymore. argsz implies the version that user is using assuming > UAPI data is extension only. > > Jean, Eric, any comments? My preference is #1. In the apocalyptic event > when we run out of padding, perhaps we can introduce a new API_v2 :) I agree, new extensions will most likely want to extend the vendor specific structures at the end rather than introduce new common fields, so I prefer #1 which avoids fixing the union size. Thanks, Jean