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 X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDFAFC433DF for ; Wed, 8 Jul 2020 02:23:21 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 BD7E5206DF for ; Wed, 8 Jul 2020 02:23:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD7E5206DF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8BB4988BA4; Wed, 8 Jul 2020 02:23:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XkXWvgcNdahB; Wed, 8 Jul 2020 02:23:17 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id A6FA488B72; Wed, 8 Jul 2020 02:23:17 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 89F31C0893; Wed, 8 Jul 2020 02:23:17 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9E4C0C016F for ; Wed, 8 Jul 2020 02:23:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 50D88854D7 for ; Wed, 8 Jul 2020 02:22:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IvyV9wvm69LN for ; Wed, 8 Jul 2020 02:22:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by fraxinus.osuosl.org (Postfix) with ESMTPS id C0D03853D9 for ; Wed, 8 Jul 2020 02:22:30 +0000 (UTC) IronPort-SDR: wyTHage9kBgAA9e2EMPWJjWCgpfN3feosfgV+sQBfEfol3mXT9MWRwwpgfd4UF839BLA0BztMg Cl7usVzspAXQ== X-IronPort-AV: E=McAfee;i="6000,8403,9675"; a="147733946" X-IronPort-AV: E=Sophos;i="5.75,326,1589266800"; d="scan'208";a="147733946" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2020 19:22:29 -0700 IronPort-SDR: Dub4eZxS1kKjSuV6NwX9XzDX6FaUagWCkFLSQmolcN99NKKf1q5pwCvp2sUjBA7TVjV7LNC0ut yh+Ya6gjxBSw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,326,1589266800"; d="scan'208";a="457325128" Received: from allen-box.sh.intel.com (HELO [10.239.159.139]) ([10.239.159.139]) by orsmga005.jf.intel.com with ESMTP; 07 Jul 2020 19:22:26 -0700 Subject: Re: [PATCH v4 3/5] iommu/uapi: Use named union for user data To: Jacob Pan , iommu@lists.linux-foundation.org, LKML , Joerg Roedel , Alex Williamson References: <1594165429-20075-1-git-send-email-jacob.jun.pan@linux.intel.com> <1594165429-20075-4-git-send-email-jacob.jun.pan@linux.intel.com> From: Lu Baolu Message-ID: <3b36c219-4120-402b-b03e-62b076db865c@linux.intel.com> Date: Wed, 8 Jul 2020 10:17:57 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <1594165429-20075-4-git-send-email-jacob.jun.pan@linux.intel.com> Content-Language: en-US Cc: "Tian, Kevin" , Raj Ashok , Jonathan Corbet , Jean-Philippe Brucker , Christoph Hellwig , David Woodhouse X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" Hi Jacob, On 7/8/20 7:43 AM, Jacob Pan wrote: > IOMMU UAPI data size is filled by the user space which must be validated > by ther kernel. To ensure backward compatibility, user data can only be > extended by either re-purpose padding bytes or extend the variable sized > union at the end. No size change is allowed before the union. Therefore, > the minimum size is the offset of the union. > > To use offsetof() on the union, we must make it named. > > Link:https://lkml.org/lkml/2020/6/11/834 Please use lore.kernel.org links. Best regards, baolu _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu