Message ID | 20241010182427.1434605-14-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 5F5A1D2444A for <linux-arm-kernel@archiver.kernel.org>; Thu, 10 Oct 2024 20:00:58 +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=F0+KYw/6HzWsmGATvSxbQuKdqCcRS3waqcwxHrAen8Y=; b=pjcqYxRy1T1KOr TTmdQXtbcDQU+vrDnwL6tFpSCcrYTI/Y6c2GlFMB9bSQn3PYVaR9TW7fcprOMkXWO60dnpWcwphLy YuTVGsufCesD91PAIWcQlgch1aJrCb2fhIw8U4xFqGJSBrUkfScNAxmk6MAbdLaMp0GE6kb1nd0jC mOT93fbpIj6WEwbbuR0xGW/w51LUYR/brJAEnEZ69YIXVatjsx+R/u8O2O7MHa0ZMjWOE8Ed5ed2A sXSMeNaUGR32nG+uNyHD9M+noo3AkOQb7Uqhqm8EBYnnh7q1DBUy/fZSq5GOu4mMyH74nk0wTCMrC Zg+odOanpGz47CX1/tPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syzL4-0000000EDRD-12gq; Thu, 10 Oct 2024 20:00:46 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syxqi-0000000DpwJ-2qnY for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2024 18:25:22 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-6e2261adfdeso21181207b3.2 for <linux-arm-kernel@lists.infradead.org>; Thu, 10 Oct 2024 11:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728584719; x=1729189519; 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=F0+KYw/6HzWsmGATvSxbQuKdqCcRS3waqcwxHrAen8Y=; b=xcx2ikl1tbRLIGweKlp3E/XnLAXCMQRCQXm9TtYfNf9DGLbpCrsIFndqhSqsrjmSat qbIwnWEGdAd/nLXZAcHBPN1kvhcatnmCn/IV2PUU4hvQAUC0GtQOG/uesI9giBA68Vdl P8krWUymc0mzim/EeROqSoFIeSbbx3oMeiXZ0tVASZm3sdADhAR1QaWws2RKxwvjQLlU QuZptrSMsSy1XH5GGusvv0oBwN4fcKmhVFZQJ9iPkBVYw0QATlMg251iOM1Fe+gpWxFP XM+6I7qL7tGGMZT5M5+DeqRp9HNjhyKl/Q1MkapmvaxgyFylhv2ThxWRjBfsgRywaBUZ W1aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728584719; x=1729189519; 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=F0+KYw/6HzWsmGATvSxbQuKdqCcRS3waqcwxHrAen8Y=; b=E/vZ4kUcY9AjoMUFpP14PNqkOzRH2Yfa8EeaMdRRKxOsyF1kaOER2Ipb8q8Xnxek1h Ri81YZUj0RxBlkscfpFbqI5ZNLNUJjMT3Xn74+IL09svxRVuP4anFuHkZyT7X89wFO+a AsY9JXuj4P41I7nA13CxLKctmox6Fu/b6nBUeiSU+33ib+S4gdDWWoSqfnDLH88XOrLO t/GEXVbLmRHRDb1sAvXvxeNHr1cZIr4uCyglqVIixNc8b4WavtcWznPzjuzqKVJ2o2k6 3vYAly5TqXX4Qiho6ZTPjK9LtZspvUAWiChbYaRcSOOVKIklNqInGsXGj3cDLdF+rL+n unIg== X-Forwarded-Encrypted: i=1; AJvYcCX4zE4Oq2cYbmwyLt5iJqm40sBo9CgecTddfT+1nkfcT598f5fxUVXJwvVsRFEyP/ZJd2MQp5kkGdjfe/0BEXc7@lists.infradead.org X-Gm-Message-State: AOJu0Yxzw7gF1MrxiP059pTLLapMnCEd2vWgnQ43PxRTNqY2lEXcJN9M wwKgQjMhDv7Kw7Cep8i6+bGKadgRlEq7nBP/I04ftE+xGnkwzirZ2TcbYvW2BDRqNGiktbor0ch kAA== X-Google-Smtp-Source: AGHT+IEeBu92qjGJ6/8zutZUBi8WOanw4UupdtztXpUfLE+vAeLHZHNkVuFOksmpHMU427MoGYN+Q9YZlwU= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:9d:3983:ac13:c240]) (user=seanjc job=sendgmr) by 2002:a05:690c:3204:b0:62c:f976:a763 with SMTP id 00721157ae682-6e322185b22mr897567b3.1.1728584719334; Thu, 10 Oct 2024 11:25:19 -0700 (PDT) Date: Thu, 10 Oct 2024 11:23:15 -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-14-seanjc@google.com> Subject: [PATCH v13 13/85] KVM: Annotate that all paths in hva_to_pfn() might sleep 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_112520_758822_1C8D01E3 X-CRM114-Status: GOOD ( 11.39 ) 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 0bc077213d3e..17acc75990a5 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2804,8 +2804,6 @@ static int hva_to_pfn_slow(unsigned long addr, bool *async, bool write_fault, struct page *page; int npages; - might_sleep(); - if (writable) *writable = write_fault; @@ -2939,6 +2937,8 @@ kvm_pfn_t hva_to_pfn(unsigned long addr, bool interruptible, bool *async, kvm_pfn_t pfn; int npages, r; + might_sleep(); + if (hva_to_pfn_fast(addr, write_fault, writable, &pfn)) return pfn;