From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 1592FC3DA4A for ; Thu, 8 Aug 2024 13:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: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:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ep+xfrS41+80V4sejFNz0q3mTB6TQE8jTTfF1Jh5lTI=; b=GbyMBPEI72lEi5xt9NONbWQGIb rYisvkaE7VoBxwnbHZ6OP28xJ062CvcbzzwFTY6hRWBfoPHz7Tx/9zGiPKJVRsDdXFwcLzLlF2NrO O5lf7uSlPBZyZLdUQVuYqFLlBP1CQxzSPJjlDxAWr/U+a5IMeiBzaqzS82wyjtgSSFI89GOLTOLOt SJd6f5pyrJEqItydj2NyyMxXrY7hrPp56p33aikbvs9QGYFkslD45LMvXC1SYujXljt+EWNiuScID enve4LambjRSdjsByJpYCYZhPdc1vQ06t4utOuxZrEZwLQAfzqmiQvBr4/qDA8h7+d3u0EM95KE5w T7pky+qQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc32J-00000008Lvx-473H; Thu, 08 Aug 2024 13:18:35 +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 1sc30b-00000008LPA-4BkA for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 13:16:51 +0000 Received: by mail-pf1-x44a.google.com with SMTP id d2e1a72fcca58-70e910f309eso1141156b3a.3 for ; Thu, 08 Aug 2024 06:16:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723123008; x=1723727808; darn=lists.infradead.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=ep+xfrS41+80V4sejFNz0q3mTB6TQE8jTTfF1Jh5lTI=; b=z6A1KYZo1X++IZ+IoefuGK1xPN+ALFkB1CMjsYM8KH0e7R6uWFpW+C0GnNLih4ciNx 205zFlHg8IysUiyZpAp9mNHaXrSdLSmvnwIrIMOs17WJeJ+3J879BJ+8RRW9VNi+yb+4 B0z099LSgtQli3mz9p2kDmUhNqa5npwsHjOGe7Zi/8FOPH9mwejpNd81+5iU/0y3e23g G5r7Syd9lf/5zDB/EmnMSXncjcb5XmZgdLLnRjWPaXOcwRSQMPOJptW5jFubOV0W7ZLK H89tBudY4c09PWsZIPoohoecUDo5SBPnehtDPHVZ7ushKNoUxSfqgJomzYeEzPqoqh3z M5Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723123008; x=1723727808; h=content-transfer-encoding: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=ep+xfrS41+80V4sejFNz0q3mTB6TQE8jTTfF1Jh5lTI=; b=PdRpFCJvJX+1BqpZUZ7bT80wgGZvtNz9PB4EeaTrv/5euDECdLouSrwNLhhSuVCudw PKc0JNbOKAvFECApf8R2UvtWC8iN2xyXUCx2K71LMMQSifSi954TSyVsCFRp2VBXb6S2 39T/9ZbID2PzAp4ZS1k1dEbx8YMqNP6k0Wwn0cdBmhYpSEpU7gE0t94tfLhQ7yHJYEdp Rju+sCrr7UYw6Zk0g5kGbZW9SJo6P90S0GemwSUZKXsYuvJf/MjTzCTvXNKFjH4gfdEZ 8ux3J4y9EBz1wx48Q3shJ7zJTedkbPT6kuneUUyHMCMk+szZo2B6fHJNrXng6vNYdtRd eCdg== X-Forwarded-Encrypted: i=1; AJvYcCVz3QQzoVIAfEcGfinH9ksI6CSUVqNv9umfxFFBFxQcTXw9QbL4b/dC/i7Bj/BGCn3JwyKd12mExEaZCqAvtLH2bnGOp/g3K7jpg8SIdMfXzkVgwwg= X-Gm-Message-State: AOJu0YyWB7uw1kBjU3INN1AzVQPRBX/5eB9kG/+6UzTanuFJE5VwVJ07 0RstCvxDVcEreBjjvY0DLbAiS6qR0XCEK/oJcJAXdBxhEuMdaPjB1wfq2BmdEEhCXoKh738RQtT uXQ== X-Google-Smtp-Source: AGHT+IHJBsGw5UgR/iugxzmSr+QeSrp5dZN/v/XODES4sTP0wn0G9d+/VHKS2R50We/GZxKaCQexvWJSP70= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:2d8c:b0:70d:2a24:245d with SMTP id d2e1a72fcca58-710cae763e9mr108614b3a.3.1723123007877; Thu, 08 Aug 2024 06:16:47 -0700 (PDT) Date: Thu, 8 Aug 2024 06:16:46 -0700 In-Reply-To: <87bk23ql6n.fsf@draig.linaro.org> Mime-Version: 1.0 References: <20240726235234.228822-1-seanjc@google.com> <20240726235234.228822-14-seanjc@google.com> <87bk23ql6n.fsf@draig.linaro.org> Message-ID: Subject: Re: [PATCH v12 13/84] KVM: Annotate that all paths in hva_to_pfn() might sleep From: Sean Christopherson To: "Alex =?utf-8?Q?Benn=C3=A9e?=" Cc: Paolo Bonzini , Marc Zyngier , Oliver Upton , Tianrui Zhao , Bibo Mao , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , 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 , David Stevens 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-20240808_061650_044922_FFD4A8AC X-CRM114-Status: GOOD ( 13.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 08, 2024, Alex Benn=C3=A9e wrote: > Sean Christopherson writes: >=20 > > Now that hva_to_pfn() no longer supports being called in atomic context= , > > move the might_sleep() annotation from hva_to_pfn_slow() to > > hva_to_pfn(). >=20 > The commentary for hva_to_pfn_fast disagrees. >=20 > /* > * The fast path to get the writable pfn which will be stored in @pfn, > * true indicates success, otherwise false is returned. It's also the > * only part that runs if we can in atomic context. > */ > static bool hva_to_pfn_fast(struct kvm_follow_pfn *kfp, kvm_pfn_t *pfn) >=20 > At which point did it loose the ability to run in the atomic context? I > couldn't work it out from the commits. It didn't lose the ability per se (calling hva_to_pfn_fast() in atomic cont= ext would still be functionally ok), rather the previous patch KVM: Drop @atomic param from gfn=3D>pfn and hva=3D>pfn APIs removed support for doing so in order to simplify hva_to_pfn() as a whole.