Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2235299rwb; Thu, 27 Jul 2023 04:26:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlFkCbpAvWshLqB3TL12lQyZDM9dbzdwQBLpm1c+4pD0Lve863yEJqniB2NVdvUp4tMd+ZTl X-Received: by 2002:aa7:df89:0:b0:522:4964:d589 with SMTP id b9-20020aa7df89000000b005224964d589mr1316321edy.17.1690457184092; Thu, 27 Jul 2023 04:26:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690457184; cv=none; d=google.com; s=arc-20160816; b=aLcd/4RiMc24kvk6ciljizDiZml8x/Ddic9hU1nwQQ4EOLvr52ftmHgzpllyE8+HdB hQspZKUDnLJ7T8PGSREkbHmCfEws5wR/FQX6HbiFbicpfPpP88wWdXtyVm6KDgpdb/P2 9QlYhZEnbOLOPHklYJtPbIhCAHuL6LTOy/T1V9AV5GPVqKhSJEJLJqVG47v5seqKW3DE tTF+a92SJB0xhCbrNJvTi5EQyOcT1yHIYPadUugCdwDGnhiW2grcit/7M9Hxq0fCzqRK 6ZQDE5hfTS22SOtv3jxs63bfTPs/YzLV2d/x/eIN8ZPwfFgpKEKVaGLGX2Z1VD2Tg0C/ NHoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sndfUp5VQwyYdDkfd9c4UQTPXsXPqaVmv/x1Ijy8DrI=; fh=w8v2WFrQFuIJlsGzgH2mQqefCf7HJMSSS8pXmt7NM5s=; b=m69T773VU8/+2X+HPIQKXdR1/j0zdvITrHlFjApU6Hd1X/vCujv9SMA0OhbJLYgrOu lVYb0TFRw6m61QYMS+t72j3sTNeLRbvcQo0hqy6clU9PfM97ic+EQr5RjgijVdvaz1V3 ndCE97knAkgz7QTu0onJc9SI7F5v4V1C+Jm/rCRxavZziUlobE47nRd3ybl41oOxvoBQ zY0+QJvLJxzPgn3zmh9ZIJNgcauY/W2Z8UdB3cmbHJOaNFMfnI+5cCGFwL2z863tsAy7 5Y2tz5lRBdIOiLoLGoZ4VHPgs6zbks4CO8qTVCKnI1z+gkYYtZQFsB4GFdj4vcbP56wf UpoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=BRo0MX+z; 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 x19-20020aa7d393000000b0051e33b5ee68si751618edq.250.2023.07.27.04.25.59; Thu, 27 Jul 2023 04:26:24 -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=BRo0MX+z; 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 S234039AbjG0Kkn (ORCPT + 99 others); Thu, 27 Jul 2023 06:40:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233202AbjG0KkT (ORCPT ); Thu, 27 Jul 2023 06:40:19 -0400 Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABC31270F for ; Thu, 27 Jul 2023 03:40:15 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-63cfe6e0c32so5789746d6.1 for ; Thu, 27 Jul 2023 03:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690454415; x=1691059215; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sndfUp5VQwyYdDkfd9c4UQTPXsXPqaVmv/x1Ijy8DrI=; b=BRo0MX+z2r1SS6yWvALim/6/nbcuIraz/dvlfYWOZ9asJfVrKNdNm2FzRqaxLf+dSr gd8iH6tStNBkd23/w31KCfLL9pbPEeNVyPTR03aUqTDZY6wZTMoqJSnBUDPOFUCLZI8l DGkcMHGLOMeyEEgRm2q9vaf0Y5Q5Azvv1tkZ/xFOCXwAaoOvebuUDqbcoCdnlpWZyTyX q38zkUOHeP0Tt+nEWAcZ8JszB60VlCahpErQX1nO7BawFSz3QtUcVh1o5Am/iWB313H6 H0uJV9FuYrV0GCIZde+45ERDs3S4qD78OMMR7S/b1svm4zQQyj/BCkUn3DI2PJoOlxx+ Zjrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690454415; x=1691059215; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sndfUp5VQwyYdDkfd9c4UQTPXsXPqaVmv/x1Ijy8DrI=; b=IRw381D0nD9dTKNvyT9LQMXOsoUE3sR969/XO0YaGDwfwK8DiGk0Zxoxq090zHEj1u Pc8czyZoBIAT196a9forxr5AS8GoMmWLPFMvf9HwOGiF04cxrw8+Pt2osFFArVeIiq+l 97p3q9FQkVptMhwxrbAZsTcV3QRmx5BRe/EJsMiD71Oqr4Idupcm+1Ju1ePD0/W9QW7W 6ntR37V4wom0cGylnfXoChiLk0LrMdSKLKqVlXT61MS3ZgLVhs0fJ0YkS0+eTus9KDbf +ksm8WbnpBTh7NN7vbWaLWzMluGBKWslttPVTiVKiHUMEK/Ob8YytBbaTw4Di56DH9Mj Z6/w== X-Gm-Message-State: ABy/qLYklOBmqUzz/a6IOEyoH2fOA5IpLWFEMOaYdmg1JeQHsKyD5nfv jseeszUly7brxlB2S/0p6T5Fn7E1nRcWlmJkXeAUBw== X-Received: by 2002:a05:6214:12b:b0:63d:218:c83f with SMTP id w11-20020a056214012b00b0063d0218c83fmr4306083qvs.36.1690454414736; Thu, 27 Jul 2023 03:40:14 -0700 (PDT) MIME-Version: 1.0 References: <20230718234512.1690985-1-seanjc@google.com> <20230718234512.1690985-13-seanjc@google.com> In-Reply-To: <20230718234512.1690985-13-seanjc@google.com> From: Fuad Tabba Date: Thu, 27 Jul 2023 11:39:38 +0100 Message-ID: Subject: Re: [RFC PATCH v11 12/29] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory 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 , Jarkko Sakkinen , Yu Zhang , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , Vlastimil Babka , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" Content-Type: text/plain; charset="UTF-8" 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,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 Hi Sean, ... > @@ -5134,6 +5167,16 @@ static long kvm_vm_ioctl(struct file *filp, > case KVM_GET_STATS_FD: > r = kvm_vm_ioctl_get_stats_fd(kvm); > break; > + case KVM_CREATE_GUEST_MEMFD: { > + struct kvm_create_guest_memfd guest_memfd; > + > + r = -EFAULT; > + if (copy_from_user(&guest_memfd, argp, sizeof(guest_memfd))) > + goto out; > + > + r = kvm_gmem_create(kvm, &guest_memfd); > + break; > + } I'm thinking line of sight here, by having this as a vm ioctl (rather than a system iocl), would it complicate making it possible in the future to share/donate memory between VMs? Cheers, /fuad