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=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 68BA9C433ED for ; Fri, 7 May 2021 09:46:27 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 D2E5061463 for ; Fri, 7 May 2021 09:46:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2E5061463 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XJQW/QOMbYxecXIS0QsXHf6Rr02dC78pwPg5QxWJGSs=; b=Dg/oEUiA+ZHKg17Ubo6il/kWv aZ5OmYka4arbU+4FZrtRlXyErNc8oWjyu8cpd2VGeHZifISz2/ufyeAZd7sTvHWQMacT+V+/uGmxQ Iu2nwbGynBTsfYpeZdvmO2n/c532X0ASDyqRwBAYce74quKDAYT/IxfilbM6Hp7k0bqZy6L6gd3Xm choYh+h6O49xwE7tOe/ZqR71SHlGECj6/f0CbCdhCfU+8s8NBCFGCjQU0qwX30PlCzwW8Wb4Oz1Ws dU/CLFSqFLRr6cGQrGNNJfXbFukkUEeJyJSRbG5Ylnbm0VvbYAsKziOBNikUNe7nNHPU/aEwmUYmT w14QkUNSA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lex2P-006hy1-2e; Fri, 07 May 2021 09:44:50 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lex2M-006hxb-Mu for linux-arm-kernel@desiato.infradead.org; Fri, 07 May 2021 09:44:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=bFxYgIgUawqrTkhks8iFOrLOzrE8Dyj9WIRZnixt7do=; b=RXHdSj/PIS6aRATg5CZFr2olxm fsdTF0KR1SBRfSHsepJ+SGkKsxZpjhO6UOzcdRRiNWmGG4JFvtSuuEfIa2RVTRsI05K+B8LY0NkJl ODeECX81d/nbMdvza4a2/fJYIiB76Qvj6ZXNgZUaKHLGXHC+DlEc5+XJpq1JUpjmclIpCaABORNuW Ny9FuuZ3r0F+MVbV8daDXlcz6ash0Ni12BnNhiwG48hFdDjOYFAF/MMZEGCcEGvRMb2fmwMTyR7BJ DHAfPtHk0BihTAlvTkb8kkZgcWHWog8ggXG7J3AeIXRKWg8jEg7EJJlkHQO2yCw626qb+9RC9Q87V fMfmHFQA==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lex2K-006kVZ-4w for linux-arm-kernel@lists.infradead.org; Fri, 07 May 2021 09:44:45 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CF03C106F; Fri, 7 May 2021 02:44:40 -0700 (PDT) Received: from [192.168.1.179] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 534693F718; Fri, 7 May 2021 02:44:38 -0700 (PDT) Subject: Re: [PATCH v11 5/6] KVM: arm64: ioctl to fetch/store tags in a guest To: Catalin Marinas Cc: Marc Zyngier , Will Deacon , James Morse , Julien Thierry , Suzuki K Poulose , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Martin , Mark Rutland , Thomas Gleixner , qemu-devel@nongnu.org, Juan Quintela , "Dr. David Alan Gilbert" , Richard Henderson , Peter Maydell , Haibo Xu , Andrew Jones References: <20210416154309.22129-1-steven.price@arm.com> <20210416154309.22129-6-steven.price@arm.com> <20210427175844.GB17872@arm.com> <340d35c2-46ed-35ea-43fa-e5cb64c27230@arm.com> From: Steven Price Message-ID: <25c85740-0119-549e-6ddb-aea69c5efc76@arm.com> Date: Fri, 7 May 2021 10:44:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_024444_265989_EDD727F5 X-CRM114-Status: GOOD ( 22.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 04/05/2021 18:44, Catalin Marinas wrote: > On Thu, Apr 29, 2021 at 05:06:07PM +0100, Steven Price wrote: >> On 27/04/2021 18:58, Catalin Marinas wrote: >>> On Fri, Apr 16, 2021 at 04:43:08PM +0100, Steven Price wrote: >>>> diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h >>>> index 24223adae150..2b85a047c37d 100644 >>>> --- a/arch/arm64/include/uapi/asm/kvm.h >>>> +++ b/arch/arm64/include/uapi/asm/kvm.h >>>> @@ -184,6 +184,20 @@ struct kvm_vcpu_events { >>>> __u32 reserved[12]; >>>> }; >>>> +struct kvm_arm_copy_mte_tags { >>>> + __u64 guest_ipa; >>>> + __u64 length; >>>> + union { >>>> + void __user *addr; >>>> + __u64 padding; >>>> + }; >>>> + __u64 flags; >>>> + __u64 reserved[2]; >>>> +}; > [...] >>> Maybe add the two reserved >>> values to the union in case we want to store something else in the >>> future. >> >> I'm not sure what you mean here. What would the reserved fields be unioned >> with? And surely they are no longer reserved in that case? > > In case you want to keep the structure size the same for future > expansion and the expansion only happens via the union, you'd add some > padding in there just in case. We do this for struct siginfo with an > _si_pad[] array in the union. > Ah I see what you mean. In this case "padding" is just a sizer to ensure that flags is always the same alignment - it's not intended to be used. As I noted previously though it's completely pointless as this only on arm64 and even 32 bit Arm would naturally align the following __u64. reserved[] is for expansion and I guess we could have a union over the whole struct (like siginfo) but I think it's generally clearer to just spell out the reserved fields at the end of the struct. TLDR; the union will be gone along with "padding" in the next version. "reserved" remains at the end of the struct for future use. Thanks, Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel