Message ID | 20241010182427.1434605-21-seanjc@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A79FFCFC5F3 for <linux-arm-kernel@archiver.kernel.org>; Thu, 10 Oct 2024 18:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type: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=LNPEWcjaz+dEwpcBQF1ZcKP3HAxUc/LzxURpjzN7wyY=; b=w4NBikKynckdtQ k/d547lXkMdHQn0FLJbTy4VdvDrIiifFHMl2eSvNYSUKln3IBbNcfu2Grs0dKOKa7BZnT/VCs364x P0MGfVC/qLijzMVK/BUq5YLLQc/NoRoiBcExwHFZ6wMxiPBneKwnKaGpMILHSF0J3dvbdpVRN6k2u 8K1JmDfMajPG0Oas1HqpeYymINaCEpyZHs01QpBd7dl7c9Z1AeMfj6OtCOxRlnbbyI7jtQ0Ofepgf /kaajRiGFC1T/crinMNtGXBc6KLhDGe7SJLNZ5FrjEn0X4rZ5v18VEAQ3YNEfZ/lqOD7TTS1jrs/1 QDys8rmO802aNWRyr4GQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syyDl-0000000DzTY-0t0M; Thu, 10 Oct 2024 18:49:09 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syxqy-0000000Dq9k-15LO for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2024 18:25:38 +0000 Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-2e2dcea0f03so997753a91.1 for <linux-arm-kernel@lists.infradead.org>; Thu, 10 Oct 2024 11:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728584735; x=1729189535; darn=lists.infradead.org; h=content-transfer-encoding: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=LNPEWcjaz+dEwpcBQF1ZcKP3HAxUc/LzxURpjzN7wyY=; b=cQVMlHY01P5GUGimI1EwUwV1gMXDWO1YhRNQgRRZRp00tcXkR3VxYVS8SFNZdGUHSM +EnHGdT46sR1K/IGTWajJMmoGBn0sNYOYBl9jKHyXHiRccxDMQz2SiMM8mPBIPgc36qO Po18p81ZhZKkcywvYLdtTn92U0KOy4krcXQi8HumWxBuK6fva1EYc44wJf8gFuc/2fd6 KE22Z93ZbqXtSHgYYN/h+5IQDFU3/qaj+6FgQnJ80jSJFdyR2wG6J4Jnw+f04poLAqTP dsiF1M/Sh525nq3aLtvs5dKB47INji3eZlodpB9Gp1tMy1RepfdgGfZF+37O8j4+KXr8 aD+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728584735; x=1729189535; h=content-transfer-encoding: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=LNPEWcjaz+dEwpcBQF1ZcKP3HAxUc/LzxURpjzN7wyY=; b=O+WF9wIObXGtOSHBZiAdiNZUFEAxvIvtYSckMT5hYgcxxhkaJEaOM/bLH5B11OHu4Q wVeYDiEsYMzdtAsi5dzVBxhX9QU+LcXEPD5Sivn739YkB/Z8CAU2C4QTXOKqikuT66OG EIWzdS48EaOZ8VW/jqoeN2WcB6bLkgZ5rE0LVCcMBKkgl5fHJBbyMLIRDvBZ+QiHKmdZ LEY4ImkwVfHmKqwEFbCgW2UE0TDw9pER1ueGYQTZIR3k8M/Pru8OAoYgmjVKIsM4VHPc QX1LlMgVXMG18e11x7ZvgT5TFG3mp1GbceogLuddk7rpm/yHn8OHtmjleLDV9e5NXrh2 Pr+w== X-Forwarded-Encrypted: i=1; AJvYcCWHaX5wYhi2DjT1hciLF2uBxYmrBWKFibR1Wthgu3aJK5kW4rpCGxV+Grmk9z1sWGdsmvErikjT734h7bG15Yn/@lists.infradead.org X-Gm-Message-State: AOJu0YyR5Xu6n0eNmDbNnjPx896qH4i9LxvLSy9k0xA4sODONySEXe2y mts1Z449dw8R0fDoCzgQ8reohiWZevnoCJE34R68iC7D6zlEPv+9GKitSeNHK2vmRP8+v3945j6 BJA== X-Google-Smtp-Source: AGHT+IEnZEGZphhdHlQgb0iOcJfNRdGKMtxwSRuFd5MkDGpZIOhDcg8ohYIeF4ySSwO5bqKUu8yK4lYjZ+4= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:9d:3983:ac13:c240]) (user=seanjc job=sendgmr) by 2002:a17:90a:8595:b0:2e2:d600:3862 with SMTP id 98e67ed59e1d1-2e2f0d9dbfemr89a91.8.1728584735013; Thu, 10 Oct 2024 11:25:35 -0700 (PDT) Date: Thu, 10 Oct 2024 11:23:22 -0700 In-Reply-To: <20241010182427.1434605-1-seanjc@google.com> Mime-Version: 1.0 References: <20241010182427.1434605-1-seanjc@google.com> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Message-ID: <20241010182427.1434605-21-seanjc@google.com> Subject: [PATCH v13 20/85] KVM: Remove pointless sanity check on @map param to kvm_vcpu_(un)map() 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, " =?utf-8?q?Alex_Benn=C3=A9e?= " <alex.bennee@linaro.org>, Yan Zhao <yan.y.zhao@intel.com>, David Matlack <dmatlack@google.com>, David Stevens <stevensd@chromium.org>, Andrew Jones <ajones@ventanamicro.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_112536_434301_07919371 X-CRM114-Status: GOOD ( 11.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Reply-To: Sean Christopherson <seanjc@google.com> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
KVM: Stop grabbing references to PFNMAP'd pages
|
expand
|
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 52629ac26119..c7691bc40389 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -3071,9 +3071,6 @@ int kvm_vcpu_map(struct kvm_vcpu *vcpu, gfn_t gfn, struct kvm_host_map *map) void *hva = NULL; struct page *page = KVM_UNMAPPED_PAGE; - if (!map) - return -EINVAL; - pfn = gfn_to_pfn(vcpu->kvm, gfn); if (is_error_noslot_pfn(pfn)) return -EINVAL; @@ -3101,9 +3098,6 @@ EXPORT_SYMBOL_GPL(kvm_vcpu_map); void kvm_vcpu_unmap(struct kvm_vcpu *vcpu, struct kvm_host_map *map, bool dirty) { - if (!map) - return; - if (!map->hva) return;