Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2713779rwo; Thu, 3 Aug 2023 13:50:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlFY6YbamSLhnW4XOwjv0Q9yfZDiPUwOYXpMy0rksUczrjR2uXzCVwukOCO1qd+kx5wYkcqu X-Received: by 2002:a05:6a20:2583:b0:132:f61e:7d41 with SMTP id k3-20020a056a20258300b00132f61e7d41mr25328026pzd.5.1691095808537; Thu, 03 Aug 2023 13:50:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691095808; cv=none; d=google.com; s=arc-20160816; b=QyJ3jJ4Y/d86JZwndf9UTc0F4eV8/K74UqWRK6SqxMFEst9nINm4EQ7ecB1ux6PVG+ CHrdDh5CTQSuoHkVeENcCg0b+VJusodcb8OQZiyFCHNPx8CNjZU47m/uS9Lb4yWWtyY0 T8tzTPqaUmB1Mg2p7mKTf5mttx1oW/JEwqOvtva4hB1EIx3Q7r0LmJoNScnkR2G8JJCK rYA8rb9JFcmtFKIYhE2BdWZ2vyhVVWPkvPai6b1dpsESrcB0aDis1WFgUCa+BHUQafqd umksS3Z/92i4XAJupBuWqw8QAFArV3reqCOvNn4HDgfqD4Y9QwHybSJSn3tM9SxRBM1n LQiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=1QAbc+4fCOMN1wq3LOwJ4k1bsXl9R1Q+x4bhgj3rFIg=; fh=TNDHcBxEiwip4umDW7M19VEeAWZOOykbx4G5yTye0wA=; b=V9+q21PyIkNvsnQwvauCSYla2AV5vbmYnUtNgtCIKzI7sAu3XMpvaAYZHF9GbpdRP0 YWMeddVEkJaOTMdPyxsJtXX94LWMUwkshh4HorNRNqVvAwTFdfa53qJ3YUsLicN2i73h dSMclkJ5nRV/IVl1BaHZhLR0INWF/Ryu1lMTsDaHNq9o1tOoDBhx6YnzyHJHudsnwCwS 2v6nank/t3WMaItJHCkSdchPszvhkf2RXXdqbJjNwTI+Oe/B+TaxxVnQtVn1Ci5VDZfM 5DNwU6gZ65f+MPVA+gft/nNsQ4Tzmo9dykMDDr0voVvZbGhdhgrvJJHyQvO3gPXJiGJC IAxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=DSNF3uKl; 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 l65-20020a639144000000b0055c9d23b482si570482pge.314.2023.08.03.13.49.56; Thu, 03 Aug 2023 13:50:08 -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=DSNF3uKl; 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 S229986AbjHCTQI (ORCPT + 99 others); Thu, 3 Aug 2023 15:16:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231160AbjHCTQC (ORCPT ); Thu, 3 Aug 2023 15:16:02 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 695BE3A9A for ; Thu, 3 Aug 2023 12:15:58 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id 41be03b00d2f7-5635233876bso892519a12.0 for ; Thu, 03 Aug 2023 12:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691090157; x=1691694957; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=1QAbc+4fCOMN1wq3LOwJ4k1bsXl9R1Q+x4bhgj3rFIg=; b=DSNF3uKlxbN1/j9sGPdV4RLbiLmTPzUp9Zu3X+X+jI/CXp8qoKO4kiLFxh0eWH4ras 3UHMbP1YaoUXHaU6RKc0xiD6OqP0/G8GaXsxhmkMXaXcobPCXbuINlBumVapPQ9eL9WI SQMF6MIyr2Twu3rQpgN63Ty4xEmvWMdFcq1qk0s/bO53R4WtT4D6mxqEq84CrHbE24tW R+R0wb7QBQEWXSd0EQn3phD4GyYVVYig+DH6wM230PxAw/bTqhOS8nPt+LaY5XqmbBEo 2lNVu9E2Fm9D/OSL8FvXxR34+QmBLtfkxeWiU2TVRkIK5+koZ6XE0PUmvWk9wsqvFkyB PpQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691090157; x=1691694957; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1QAbc+4fCOMN1wq3LOwJ4k1bsXl9R1Q+x4bhgj3rFIg=; b=C2WPcLj2qNxxYuhLUWiuLkmYaNvKHrFEcM8Kn1l08YiHud+SpTNmbNGBePzZ88tVNI Sa+WoZY9kqO1sDL6GmYjGLCf8rO0P5dGZ2UoUkONuis+bfQs0DApko6WbQJKMlIQ2gWp GTf7C2bgd07v7hPZgLv/qlpucOZNRFHDzJX1Ur1nIWDABeeR+4IPRmQlFsvCKK06R0Yo OphegXZMMuYUsP/OlAHCuis9GRNhjQtuItPPvzZqnbJkhje+T/7reyNmEejEvUfcCYpb R2r1X62CFKZMat1pStLQwrMk3iNsueFG87W4Bj6mjELzzKLeSnweX0Gu+AahwDq4PRko rXrg== X-Gm-Message-State: ABy/qLbl4a7PkxenRBt80i3i8ceByAjojxKBvnArv0IC67kLwciAA/la vzQlgWQnEKnClbrFGTVPz/oBI8Wze6KG X-Received: from afranji.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:47f1]) (user=afranji job=sendgmr) by 2002:a63:295a:0:b0:563:5065:9d40 with SMTP id bu26-20020a63295a000000b0056350659d40mr129290pgb.5.1691090157410; Thu, 03 Aug 2023 12:15:57 -0700 (PDT) Date: Thu, 3 Aug 2023 19:15:54 +0000 In-Reply-To: <20230718234512.1690985-13-seanjc@google.com> Mime-Version: 1.0 References: <20230718234512.1690985-13-seanjc@google.com> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog Message-ID: <20230803191554.205599-1-afranji@google.com> Subject: Re: [RFC PATCH v11 12/29] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory From: Ryan Afranji To: seanjc@google.com Cc: ackerleytng@google.com, akpm@linux-foundation.org, anup@brainfault.org, aou@eecs.berkeley.edu, chao.p.peng@linux.intel.com, chenhuacai@kernel.org, david@redhat.com, isaku.yamahata@gmail.com, jarkko@kernel.org, jmorris@namei.org, kirill.shutemov@linux.intel.com, kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.linux.dev, liam.merwick@oracle.com, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, mail@maciej.szmigiero.name, maz@kernel.org, michael.roth@amd.com, mpe@ellerman.id.au, oliver.upton@linux.dev, palmer@dabbelt.com, paul.walmsley@sifive.com, paul@paul-moore.com, pbonzini@redhat.com, qperret@google.com, serge@hallyn.com, tabba@google.com, vannapurve@google.com, vbabka@suse.cz, wei.w.wang@intel.com, willy@infradead.org, yu.c.zhang@linux.intel.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_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 > +static struct folio *kvm_gmem_get_folio(struct file *file, pgoff_t index) > +{ > + struct folio *folio; > + > + /* TODO: Support huge pages. */ > + folio = filemap_grab_folio(file->f_mapping, index); > + if (!folio) > + return NULL; In Linux 6.4, filemap_grab_folio() may also return an error value. Instead of just checking for NULL, "IS_ERR_OR_NULL(folio)" will be needed.