Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp306331pxm; Wed, 2 Mar 2022 15:58:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAmPMubP6neQQrqOVrIJEagX27GGdRNMPz1jcaTuF5GtCOzEiX/ozVAnfQPRMMESWyZBjC X-Received: by 2002:a17:902:b589:b0:14f:3f88:15e2 with SMTP id a9-20020a170902b58900b0014f3f8815e2mr32772608pls.171.1646265520105; Wed, 02 Mar 2022 15:58:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646265520; cv=none; d=google.com; s=arc-20160816; b=r26P6K2IUWFQY3BzdWPrY6ymWwH8gccS+uFLeJUkrD00nsE1glkxnuEvii02GIgkkS h7sUXjWu4HIjnIG5dZB/3mUSjbJTAylm1ho7WQuUc8dTmbidwqlaUkD0tI2U9+zxuAkv JGUJhl+3TgtFUJC9axs3RTtRzSI6fzALUfyX70cl/ExnLvEGpTPlgh+zDc78hk8H6V5L n8PeEV7jkG5LI36nmebcxa9I1Ci2idcGxKJ2hnwzCzQaplfdDtwVklcskpzBZAdaB54v qVV8Nc9XbWUZhQiBrThOJouB+BKnDBWFNdATdtb3CCX13D9IiBZJw7jOJD2mlxTTypDe 2YDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=dkI26oH12rAI/rcHa+Bb6lkfS1t78b0pEHbqKtN0UIk=; b=rm6VW0N2NNOXZIP5HBXsx4fab2Wi2JaetSHO/Zqf/tO8y6qSUriDkzR6xoLpitqkdl 0+dI06egc3XFIvD1xEkX9Z/6wB9IS3LKVVAcppiUHKMvHCAXtHa31TLcvNKr4G40gORS vbg0FUYQbJdDGm3WQgclgHuw9MHCnBIcNaNtuJ2BvJ3nb29xYiMbgk79pkx6FrO1pGWl TLsqbQOJY0UO4c2gVrZEf+POYa2aWnxViDNkFfKuenozQ9Kulvxtr1a+YLRNRJ71m5+d q0FRAMpBh1Z6BHcVERxLkm+jqMPpuVnk9B+xp4O1+UkpzVfAq+6hclugfqn8x99Lk26u E8DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="JG/AbnL4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x2-20020a17090a9dc200b001bc502ebf9csi429825pjv.51.2022.03.02.15.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 15:58:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="JG/AbnL4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DF2FE138592; Wed, 2 Mar 2022 15:18:22 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244669AbiCBSh3 (ORCPT + 99 others); Wed, 2 Mar 2022 13:37:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242218AbiCBSh1 (ORCPT ); Wed, 2 Mar 2022 13:37:27 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 71536D887A for ; Wed, 2 Mar 2022 10:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646246203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dkI26oH12rAI/rcHa+Bb6lkfS1t78b0pEHbqKtN0UIk=; b=JG/AbnL4k5MurG3+LE2PiTDqH5L+zeER9Jm2tfIT76KmxBdHqBZPDDDE/D2TaMcBocLNAm iVmuGIfJkiAmr79H9lhcTggU3EpqthySOUwIw3SXeo9hw/Yv0r3c21SjQnnO57kFjYXTsv waUhITVtQFAaT8Kfd3i6jDtqwJsEPqQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-322-CtMbYqwTOPy6N0xzHisYnw-1; Wed, 02 Mar 2022 13:36:42 -0500 X-MC-Unique: CtMbYqwTOPy6N0xzHisYnw-1 Received: by mail-wm1-f70.google.com with SMTP id n31-20020a05600c3b9f00b003812242973aso1142211wms.4 for ; Wed, 02 Mar 2022 10:36:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=dkI26oH12rAI/rcHa+Bb6lkfS1t78b0pEHbqKtN0UIk=; b=JexkvcZOZkc1MYI5LawpFPQp1vXgAwSQDwyo/xqx6dAehnXcGvGQOTee6zJxo4OPv+ YeG1cfi93eBhuawo3DA+VyYGvHWbSxLe1OHBjlf+ijVXf4lR3FomwbX6GGE/MUjkWvWY kep4WypiVqjJb9K9RFlaQVhlFqnK8TP0u12Cz8A1bZkzFzBsVqt6OnM4U9AIqUliI346 3jI4Y++ClAo3lAqrI3FjgcqdhTcd3/a8FhHVTLy2m6RKiQyCsnyLMkzYdHcU9CnWOsSP wWASo/wZroYDqWh08WrwG34ZilFrw7AOFSp60Ts4tP6+KKl2Qhd/f2YX0ofX+svJIVRj jp8A== X-Gm-Message-State: AOAM533Stdx/sZHj5YD8FZr+Hr1v1ydXAP8l9UQlkbHYz83UwjIRuX6l EDB9gKg1l37e7D7NPYeDbt/CJX8WvWOMIwN9lsD83y1dUQVFDSmhjsGaTm32FVip+MNZKEEkeFC vMqck67uddEQXAv2jpDMRphyP X-Received: by 2002:a7b:cb44:0:b0:381:4dd8:5ec4 with SMTP id v4-20020a7bcb44000000b003814dd85ec4mr931450wmj.12.1646246201232; Wed, 02 Mar 2022 10:36:41 -0800 (PST) X-Received: by 2002:a7b:cb44:0:b0:381:4dd8:5ec4 with SMTP id v4-20020a7bcb44000000b003814dd85ec4mr931433wmj.12.1646246201019; Wed, 02 Mar 2022 10:36:41 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e? ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.googlemail.com with ESMTPSA id g11-20020a5d554b000000b001f0326a23ddsm2875275wrw.70.2022.03.02.10.36.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Mar 2022 10:36:40 -0800 (PST) Message-ID: <764356ef-dd0f-01bd-129c-a821136a4f6e@redhat.com> Date: Wed, 2 Mar 2022 19:36:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 26/28] KVM: selftests: Split out helper to allocate guest mem via memfd Content-Language: en-US To: David Woodhouse , Sean Christopherson , Christian Borntraeger , Janosch Frank , Claudio Imbrenda Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , David Hildenbrand , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Ben Gardon , Mingwei Zhang References: <20220226001546.360188-1-seanjc@google.com> <20220226001546.360188-27-seanjc@google.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE 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 3/1/22 00:36, David Woodhouse wrote: > On Sat, 2022-02-26 at 00:15 +0000, Sean Christopherson wrote: >> Extract the code for allocating guest memory via memfd out of >> vm_userspace_mem_region_add() and into a new helper, kvm_memfd_alloc(). >> A future selftest to populate a guest with the maximum amount of guest >> memory will abuse KVM's memslots to alias guest memory regions to a >> single memfd-backed host region, i.e. needs to back a guest with memfd >> memory without a 1:1 association between a memslot and a memfd instance. >> >> No functional change intended. >> >> Signed-off-by: Sean Christopherson > > While we're at it, please can we make the whole thing go away and just > return failure #ifndef MFD_CLOEXEC, instead of breaking the build on > older userspace? We can just use old school F_SETFD if that's helpful for you. Paolo