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 5C6F5C3DA4A for ; Thu, 8 Aug 2024 15:33:11 +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=jc21vP9HtcAG8Jx0fCnF54KV0nEotJ+OQOgwzr/gmUk=; b=0ChuoOVjCOKQYmV5jStPl7Qb3H bWOcWVqwCx1zfSsCny637rqjrOUvlIWuZ7SlKbj2ccpKJRRZX7YJcDos/99/mZJ1Yb/xpCodFkV6G 0UQxeuGBglGpD1I6iXTdlttHgZxyuJhTnuF9nMTTjtDSKpepSlAtSYSR/fUOnB2BAlYJYMaaJBSHA MSncMqcCYG5ie3rL12QBAM939pe49yErzaegVEmlzqOQOCNjPh5X+9NZZQbuO3tCZfQcnkYnOsb9E o99cFzjoVrQp1J4FYspmQT16S1QOf51P2VjkFNpKUADrpoJkcAwFavMTPCXfkwd7P56sjkFvAjOF0 GxKKyt9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc58N-00000008mDA-2El0; Thu, 08 Aug 2024 15:32:59 +0000 Received: from mail-pl1-x64a.google.com ([2607:f8b0:4864:20::64a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc57G-00000008lfg-25y7 for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 15:31:52 +0000 Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1fc58790766so11407585ad.3 for ; Thu, 08 Aug 2024 08:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723131108; x=1723735908; 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=jc21vP9HtcAG8Jx0fCnF54KV0nEotJ+OQOgwzr/gmUk=; b=NV//EppF81xT2mOBinYSktmKcb+BxInItv9FmAGoP8k7n5MoiTkPJ1wpqB+iAUl/o7 ZFjVtcK4n1iiOhjcKaA0yyJPLFw9y3TBJGePNOdGbTXA3Wzlk6XjguVK99kZbALszo4S kon8ezjZw1GAgfpVtNOnwWT+qnCXerfL+GraP56RDGDGLP23B9+cY8RoyDNeLtZSiKM2 QyqhgwGfIYJBIZNMTvoaby1kY5Rwa1GBnXKRu9ki/PPSC+bSlodFQJQmQmkMdVCRIbtO LcwaZU3Vt+JSSdhei9/axn8htIIGm3u57iCwKFC1RXlTu9a0lUieMKOLxpho2F4Ir8yL k74A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723131108; x=1723735908; 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=jc21vP9HtcAG8Jx0fCnF54KV0nEotJ+OQOgwzr/gmUk=; b=h3NDG0sNQfRakg937y0RuTfMqlgxh1VFO+xTbav7Du56bw2o/Ro63gkeF5rFmWQ1HR tIKjwIVCXnPsbg5G6SQlip9PCKOFquDb/WSl0Fjb3++OWq9m5hloRLCCCCC/pxIVpztz aoE+CiNDkYN+H4AootaTVwLgo4n+Z7bfliuT9Rx4gyVTsqlhFGdRQL9/gIpX6G91klrX SYIlDTdfsTNwVZ2NTv1GmUxOr3nyYoZns2k6XcBf+14oUOOXF1rIpeVoTKj1216D5C0v jmg++nF3S+ijJUAS7lPakvEICiU/uJKX5LQuX563Tl/V3zUO25khuWOfKJID9cjmFkMU qkTw== X-Forwarded-Encrypted: i=1; AJvYcCU+lwxcZuWneOWnx0ysWKWz1QnZFBnRfOv20ursIS3FFeb9DTvRoYxuL31Ll63PKmV/bpm3xZfdP+SKJ0hXP59bIKEBGjNl4xTQxxH5vRGLJBJQCxY= X-Gm-Message-State: AOJu0Yxx/qGaU1x5ekVPu1pV52HcMbYc3U4PZJEq4bkeCMT9XHksFDZB EpVzb91csR/cDOVvwDxRPUz2wmHjVscHlvRZzn5HVuc4LBU8tV+e5x/ID+0q/youJa1DcoVJN+8 UfA== X-Google-Smtp-Source: AGHT+IGhpuWFvPPS56LNIyARU7ozQJQwYhKu/y/lvyly0zz2F1cJP6/aGqiYnrRnxhwS3wYjMw23Fn2sh0c= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:2445:b0:1fb:7978:6cc with SMTP id d9443c01a7336-20095249cc8mr361865ad.5.1723131108261; Thu, 08 Aug 2024 08:31:48 -0700 (PDT) Date: Thu, 8 Aug 2024 08:31:46 -0700 In-Reply-To: <877ccrqc06.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> <877ccrqc06.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_083150_681768_D2E884E8 X-CRM114-Status: GOOD ( 17.31 ) 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 > > 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 cont= ext, > >> > 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 @pf= n, > >> * true indicates success, otherwise false is returned. It's also t= he > >> * only part that runs if we can in atomic context. > >> */ > >> static bool hva_to_pfn_fast(struct kvm_follow_pfn *kfp, kvm_pfn_t *p= fn) > >>=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 = context > > 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 who= le. >=20 > It still sticks out given the only caller no longer enforces this.=20 Oh, sorry, I should have been more explicit. I'll fix the comment, I simpl= y missed it.