Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp976613rwb; Fri, 28 Jul 2023 02:52:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlGbQEVPbY71Ot/X5y2C0xB7lhCxvFTkWUD1iQvZ36T7X/BA+Y+4XTQLIU1ITBYCnPyDKB7D X-Received: by 2002:a05:6358:7213:b0:132:d333:4a5c with SMTP id h19-20020a056358721300b00132d3334a5cmr3160596rwa.10.1690537941923; Fri, 28 Jul 2023 02:52:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690537941; cv=none; d=google.com; s=arc-20160816; b=tp0BRpbFHMbwRbqCQtAHwXqDh8WhyUtsO2uHKiGaykzhp1LjveJz48NK6uJBP6hCqI LvRS9wshS8Hklwi98+2j4oFYUH83I/c1hxap8ff7dVqlsUarKy9F7qWkigisH2fAhx+K o46KLTka3VaoAtPG5F/U2PibozzroSmbmNN78T0j0gneCgxWVKcGH3xPgsrsrVlkoE4d Eg86sYE8tBGbEECfVFEA7fGuy5c0UDwpnme6+qyl79sgYw44FOmFqsX6oGgPbGDMHZGQ 4NH8Q6W9HTmolWW4IYE8R3Hj5JegTD09KSAAKTaJFL1qKXhO1l46aQWaj56HJDW/s/za TUng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MyDeksRVqGtJNd0fe/itajI8E9fXoiZCjVyZ7emrXms=; fh=8HrYXzg75zYUbC6KQ87QT8fcKQDkvzDi/B2eBx1O0JM=; b=s3o5z1SACcj+5iG9sa/kPsBOdJo1R+TlYRyWBJGpzPcZLd4j76lBsGbdOhaLs5ii7Y AwCQ0ESP7izUgIo9PPTXc/Zm0ErMNW6eoHO6Wx7wvyHXVZWKUEIJBjHh3apvf9cr0xg8 hmJiNHdAZ809Y8eHe65zwgkbjtU9RtvMJ9m6ChhqfLHq/ZZOLscnMGbH7eA5pXcAQtDs 3YV6Tu58cD0XoKHsEd13B6az5aBfO5K9xsZIOFuTha0BZVriTsgPUpzC8DuCh4QKRC5U BuJ3atOylsUGWdyNSTsVgu5WCukuvYcj6P+YOCzHxu6VuTzPBc7l+QkBgVols8Z/DBjr cTzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=yZlBBa+Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h185-20020a6383c2000000b0055ba8970e7asi2699122pge.616.2023.07.28.02.52.09; Fri, 28 Jul 2023 02:52:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=yZlBBa+Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235601AbjG1J23 (ORCPT + 99 others); Fri, 28 Jul 2023 05:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234250AbjG1J2D (ORCPT ); Fri, 28 Jul 2023 05:28:03 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 312C64C0C for ; Fri, 28 Jul 2023 02:25:28 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-52256241c50so2728709a12.3 for ; Fri, 28 Jul 2023 02:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690536326; x=1691141126; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MyDeksRVqGtJNd0fe/itajI8E9fXoiZCjVyZ7emrXms=; b=yZlBBa+QgG6A3izqrAvYrZmjNARnJqe9UVJDDaWeo1ngnmOt9VRY93kWsBg3OxlgJ6 BNgAnv6T/0ObsR7NeaCjk+WNJnmyD7Q59yeCq15kUZEqjsFvHdvXA60zH7S6F25/qIjt fm8Sg5o5MpunPrL/BqoXYGZy7msDjit8jc0wg2EmQ6Q8Th8F7S82AjrHRl+/FMq8bTJh sEoAOBkEqP29Krhf8xqYypp/joUWh9VUOF8DEcZIisv2V3iWTfC6qxmMhKHNjRW9HI9T TolK5KmZ7NzIlhfQCguxbwjQDJpXunGMqxws18N6XaE4FtdLuzrmk4BalRM99UvIXMiI LjuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690536326; x=1691141126; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MyDeksRVqGtJNd0fe/itajI8E9fXoiZCjVyZ7emrXms=; b=B7Eo2Sa8ej7NwHmzu+WFbKPrO5es2OBjsqTcEUv9l2jSkAn7JHg+AVKvNMd1mz4Qg0 jpO5WuMjGKMBayDbKKSVWdxGOL5g10NQ+xe4uXMWiOz9epygW5uVBNyB6/oA1rOdJCnt Z6GceCF7qfakdSsLaVSMKgX1nlVPOVP+2UqrP1X0M0iAckVa39BytESIbFPeLdpc7swK cCdjrP+No/oJsvnYpICuPxjhEiIK9vg1yMsylH/e0SVwvW3fPHYiBbBiuS1h8spX3pAP lBt5lG3XrZKkLt5oV5zQWzWIdUYpIupO5ey4b4T1KwLhHX0DTuLLX/j+lcv2vlkry0Rj 2h+Q== X-Gm-Message-State: ABy/qLbgVKLmX0y8EnWIEk8tuLhCdIwJ/VRCEfoGorpFy6ktAmohZIaJ wsreMoOf+vfYvuBwLxDHZVa8cw== X-Received: by 2002:a17:906:8454:b0:994:1fee:3065 with SMTP id e20-20020a170906845400b009941fee3065mr1975862ejy.15.1690536326590; Fri, 28 Jul 2023 02:25:26 -0700 (PDT) Received: from google.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id n12-20020a170906688c00b00992c92af6f4sm1857653ejr.144.2023.07.28.02.25.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 02:25:26 -0700 (PDT) Date: Fri, 28 Jul 2023 09:25:22 +0000 From: Quentin Perret To: Sean Christopherson Cc: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Matthew Wilcox (Oracle)" , Andrew Morton , Paul Moore , James Morris , "Serge E. Hallyn" , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Chao Peng , Fuad Tabba , Jarkko Sakkinen , Yu Zhang , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , Vlastimil Babka , David Hildenbrand , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" Subject: Re: [RFC PATCH v11 06/29] KVM: Introduce KVM_SET_USER_MEMORY_REGION2 Message-ID: References: <20230718234512.1690985-1-seanjc@google.com> <20230718234512.1690985-7-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230718234512.1690985-7-seanjc@google.com> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,FSL_HELO_FAKE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 18 Jul 2023 at 16:44:49 (-0700), Sean Christopherson wrote: > --- a/include/uapi/linux/kvm.h > +++ b/include/uapi/linux/kvm.h > @@ -95,6 +95,16 @@ struct kvm_userspace_memory_region { > __u64 userspace_addr; /* start of the userspace allocated memory */ > }; > > +/* for KVM_SET_USER_MEMORY_REGION2 */ > +struct kvm_userspace_memory_region2 { > + __u32 slot; > + __u32 flags; > + __u64 guest_phys_addr; > + __u64 memory_size; > + __u64 userspace_addr; > + __u64 pad[16]; Should we replace that pad[16] with: __u64 size; where 'size' is the size of the structure as seen by userspace? This is used in other UAPIs (see struct sched_attr for example) and is a bit more robust for future extensions (e.g. an 'old' kernel can correctly reject a newer version of the struct with additional fields it doesn't know about if that makes sense, etc).