Message ID | 20240726235234.228822-5-seanjc@google.com |
---|---|
State | New |
Headers | show
Return-Path: <kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=yloPoSVz; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=C/UvVZLk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WW5sY0905z1ybY for <incoming@patchwork.ozlabs.org>; Sat, 27 Jul 2024 11:01:02 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID :References:Mime-Version:In-Reply-To:Date:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3dHsa8iUFx6bEpxHiHA2Tbn/HPKbNbl7XVATB4sLKVM=; b=yloPoSVzcJFaPO +8dRbTU1XQUDSNYcXHOOCRQGJcbmhmavKNNKCdgWG052KvMfFQRAr5Q4C3Hew+NwWSF78VFifJH9E 9ocaW+CKIlyZST6FuHQ+uvf4kZXeU6S7PDmyy/sfvzqvr1VpsqeVjTpJfIRqeySAXTro60Vg+kjbZ xgHtjOITXoQgHStNUSi18+dkSwtjMX7FaF9027mBYxNYYxPHm0Fp24/Zj7RP7opevLhWCWdRf7Er2 Dwft8jC58dnPrqWJuueD43uVc4m8t8+p2nC0Qv10zfsRVO2wmrw4xLVEyYmfBzobPNwiCD3kb0bbm tkc/1qU5F6UiUqSsuzVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXVnw-00000005nO8-1g6Y; Sat, 27 Jul 2024 01:01:00 +0000 Received: from mail-pf1-x44a.google.com ([2607:f8b0:4864:20::44a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXUjv-00000005PBs-0VLd for kvm-riscv@lists.infradead.org; Fri, 26 Jul 2024 23:52:49 +0000 Received: by mail-pf1-x44a.google.com with SMTP id d2e1a72fcca58-70d188c9cabso1355984b3a.0 for <kvm-riscv@lists.infradead.org>; Fri, 26 Jul 2024 16:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1722037966; x=1722642766; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=xiBZUTde5/yOu+VhqaXt4CYe/LeOwSdHW5ydN5gOuKQ=; b=C/UvVZLkZ4F6Rt5/HCv5SHiklzFOUg5x++bUB4Zx/yNmtMxOWXgkZ5pdeRwFJrmMS1 tfksl1URwEirZcfc2oR6J7aEnhWuXJr8O7Us9uVLZppwoJ2gAQ1OvEyg8UEJ+DVZ0b4w lUsup/LIqazSvP+Q7T8bWuABqPCGcxNIAN8QEgvk8iJmOdZW1CshL8zWsXUz7SZdXxRn XaaKkuO0yvCZjpGCc/7pgb30A8fF6Z4EhXLcabcYekP5E7s8FmSevht1N4v/LcPKWhij 0D7BkfCMt7YMNcJ4h1KJhG1ZGoUh2E4GbivtRiCZl7SFH3Fv9e4KmCXkKaEtqAzXYRTa 7e7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722037966; x=1722642766; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xiBZUTde5/yOu+VhqaXt4CYe/LeOwSdHW5ydN5gOuKQ=; b=M2DOPJ0IDwaqhjophYrPpBj62abmmqn1ZMkzaFndwA55mrbNan9mYlT4YWvnQuV2J1 imY4Z6TBDLWoYG/OWZOMAF9+wo/qJfzrZo80jS6z1Dntwm2zEhzxwwj0sq7sc9tmVv/Z ViFq5PkiPy0A+hNG8qhbS8qnRAWDKBBqowX2NlHVwYC1Atm/plg/r7ZyzB93iyWSZ3NN RIWV1IQwhIAkFcT6HeiW33s2VYvm5kgJ12srATVGMq3UODOKlDX83AHmO9mtFscUaV3P r18w2+9X8Z7RzagrAuFOxH3S4YJfXV9N+9fErsofjX/flfgJ2ALcqnIfjf4oCTyuaeBk Oxfw== X-Forwarded-Encrypted: i=1; AJvYcCXJp7jHs8CIHix7UwqIgMDQgUp5nmupkyuIDk7+wS/9QJFSEu5igSFvFGfgwdpwxNO5OxbzziEdKwATCoA19RO0TVpFaKPfoAkB92aqhw== X-Gm-Message-State: AOJu0Yy4Agm0BuOiZf6ql4E3E4jJXJBIgAIvuONAaI+wRrmvRpw6rtHz cx7GFa8CETejJSyhYPz5VTBQu07QTc1sLTlvXCNYPo2m3epHfR1Mn6ukWGqNnBsi9SbGQAlhND+ krQ== X-Google-Smtp-Source: AGHT+IFeDzTSYc0yloJqv412y/9OHddQLGngXAZq8SjSSTQr+cl72qk3J3BVbl3XjHWFKDqTN/CvEh64V1I= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:8703:b0:70d:1285:bbcf with SMTP id d2e1a72fcca58-70ece93a09amr3050b3a.0.1722037965825; Fri, 26 Jul 2024 16:52:45 -0700 (PDT) Date: Fri, 26 Jul 2024 16:51:13 -0700 In-Reply-To: <20240726235234.228822-1-seanjc@google.com> Mime-Version: 1.0 References: <20240726235234.228822-1-seanjc@google.com> X-Mailer: git-send-email 2.46.0.rc1.232.g9752f9e123-goog Message-ID: <20240726235234.228822-5-seanjc@google.com> Subject: [PATCH v12 04/84] KVM: Allow calling kvm_release_page_{clean,dirty}() on a NULL page pointer From: Sean Christopherson <seanjc@google.com> To: Paolo Bonzini <pbonzini@redhat.com>, Marc Zyngier <maz@kernel.org>, Oliver Upton <oliver.upton@linux.dev>, Tianrui Zhao <zhaotianrui@loongson.cn>, Bibo Mao <maobibo@loongson.cn>, Huacai Chen <chenhuacai@kernel.org>, Michael Ellerman <mpe@ellerman.id.au>, Anup Patel <anup@brainfault.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Christian Borntraeger <borntraeger@linux.ibm.com>, Janosch Frank <frankja@linux.ibm.com>, Claudio Imbrenda <imbrenda@linux.ibm.com>, Sean Christopherson <seanjc@google.com> Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, David Matlack <dmatlack@google.com>, David Stevens <stevensd@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_165247_334250_8283203E X-CRM114-Status: GOOD ( 10.57 ) X-Spam-Score: -9.5 (---------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Allow passing a NULL @page to kvm_release_page_{clean,dirty}(), there's no tangible benefit to forcing the callers to pre-check @page, and it ends up generating a lot of duplicate boilerplate code. Signed-off-by: Sean Christopherson <seanjc@google.com> --- virt/kvm/kvm_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Content analysis details: (-9.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:44a listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <kvm-riscv.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/kvm-riscv>, <mailto:kvm-riscv-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/kvm-riscv/> List-Post: <mailto:kvm-riscv@lists.infradead.org> List-Help: <mailto:kvm-riscv-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/kvm-riscv>, <mailto:kvm-riscv-request@lists.infradead.org?subject=subscribe> Reply-To: Sean Christopherson <seanjc@google.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kvm-riscv" <kvm-riscv-bounces@lists.infradead.org> Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
KVM: Stop grabbing references to PFNMAP'd pages
|
expand
|
Sean Christopherson <seanjc@google.com> writes: > Allow passing a NULL @page to kvm_release_page_{clean,dirty}(), there's no > tangible benefit to forcing the callers to pre-check @page, and it ends up > generating a lot of duplicate boilerplate code. > > Signed-off-by: Sean Christopherson <seanjc@google.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index fd8c212b8de7..656e931ac39e 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -3186,7 +3186,7 @@ static void kvm_set_page_accessed(struct page *page) void kvm_release_page_clean(struct page *page) { - if (WARN_ON(!page)) + if (!page) return; kvm_set_page_accessed(page); @@ -3211,7 +3211,7 @@ EXPORT_SYMBOL_GPL(kvm_release_pfn_clean); void kvm_release_page_dirty(struct page *page) { - if (WARN_ON(!page)) + if (!page) return; kvm_set_page_dirty(page);
Allow passing a NULL @page to kvm_release_page_{clean,dirty}(), there's no tangible benefit to forcing the callers to pre-check @page, and it ends up generating a lot of duplicate boilerplate code. Signed-off-by: Sean Christopherson <seanjc@google.com> --- virt/kvm/kvm_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)