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 827DCC52D7B for ; Thu, 8 Aug 2024 16:17:08 +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:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QLPa+w6AdBa1cUfelytt4eYDYgnS/jumqOLX9cOCUyA=; b=p8Lb4+sLsdybsTJ3BjLyN0Q+hQ /KQxOZxGRDZkCCq5M2MhZ5LcGLzvmcrRPH+JEZ7J4Uv5gVYAexi/DpIiT8j6TBIrF2jjdDxr5irab PYrVolKyqPoFX8cBxupX1CTL7QfRlPUwABvmOu9kmW9BO8kr1S270E/S2w1UeFow9JWmfyvlocmJR 08O6pjjO7yewCtaxzDAFpYJJ5aM3A7tj0zdDZCKJpMP4VPZ/9Gpy814nh+2DaAA2zA8p9v956iGZz OSBvhH5X/w3b+2a6y5KnWE/uRXw7aETH3LQrWtQkNDqxUPz/6k9WQ3DxB1jmHBPkFXnOUQFQJsRvO UTO4hzZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc5ox-00000008upT-3YzH; Thu, 08 Aug 2024 16:16:59 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc5oK-00000008uaX-3Cfo for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 16:16:22 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ef2c56d9dcso12179931fa.2 for ; Thu, 08 Aug 2024 09:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723133779; x=1723738579; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=QLPa+w6AdBa1cUfelytt4eYDYgnS/jumqOLX9cOCUyA=; b=X5ZcwCrsr/D3ymKDQSEg8lAZzfQMMQ1mgpTG8Kv5Bk3Y4X3jnaICRFs6Y6B2MdpXYx VHraPX4p1erfN1C6bLHCYtoBtzaZmyictJsC0te4DzMPJeiuRo7d/bJ474vnzpykO6xC H+idraIyIyYjOxsNyhi8p1aM2LZ536x7O27i8V1KggoanWsCC2fYnK9nhcpwY2iPtKR+ hwrujjYkzIAPGhCMX30r8twY56ovw9oNLV/wUFn4CX7NaCteYzX6wCo9lICm/Hjp01VO /AWGvxgRrnWiAH8ER7aqJEKf2ERSNDBfPoK2H6xWIvqYi7DZk8zdWbJUI83tngee+V5o Ljdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723133779; x=1723738579; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QLPa+w6AdBa1cUfelytt4eYDYgnS/jumqOLX9cOCUyA=; b=g3w+IRJAMViY1O6HpuHqXaIyeDGBES2Rfrqdzb/NpXHPVN+ji+CTTeAyd+IUTWIxHQ geiVf04NvGEm0hhtuGzO/xwVnuRh8vSRKYqeq1dubqY7u5xt/MqXD+iGkEpqAB31ILwS 9f5VAAD+EsQ5i4hAH7wV1/H4bBGU8xg6UlBeLGr0Hjwo/B+QWO6+bq6hxZ+aVVgdv0uY 2rUltx5RIdDB23MSCnRoSSMEHoBjwSuB/yoEDeKmXHPlBc6J+JPxpQ0jGC8WBJ3uRvu4 Ia2HbaHjkmTtjDOnj5lJWuaDhQM1Nz+loJiiGvaApLf8ulhjhOF9ykWMHhk50V9fDGi2 Urdg== X-Forwarded-Encrypted: i=1; AJvYcCWCWbJPKjjja+/tbn5b9Hew05pxsbjyXIcXxDrk5vjpo/r0yfZiml9ZmIp/HLrhoqVkVvkJ83HoL5LFTiPdYl+xGxsyXZwISkCD7kMhHYvr19at5+0= X-Gm-Message-State: AOJu0YzBdyntkGG4K06cqRs7ajtoxwlsjEq0Gp/rBuvAlThp+BFbjmpg DI1uz3TT2Dkzjx/FaKvHwiLLjuXNzUw3Fms1TniBOAyxYP+Hlzw8PzL7SmfYnwY= X-Google-Smtp-Source: AGHT+IFeg1aw2R2jdtW33+RTmD0GoFD4AbJwR/eufpV8IO4HacBEUsTerwG6znblRji34uNx3VzDqg== X-Received: by 2002:a2e:331a:0:b0:2f0:2d85:2238 with SMTP id 38308e7fff4ca-2f19de75d02mr16453671fa.44.1723133777752; Thu, 08 Aug 2024 09:16:17 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d27229eaasm2377515f8f.103.2024.08.08.09.16.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 09:16:16 -0700 (PDT) Received: from draig (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 824915F769; Thu, 8 Aug 2024 17:16:15 +0100 (BST) From: =?utf-8?Q?Alex_Benn=C3=A9e?= To: Sean Christopherson 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 Subject: Re: [PATCH v12 13/84] KVM: Annotate that all paths in hva_to_pfn() might sleep In-Reply-To: (Sean Christopherson's message of "Thu, 8 Aug 2024 08:31:46 -0700") References: <20240726235234.228822-1-seanjc@google.com> <20240726235234.228822-14-seanjc@google.com> <87bk23ql6n.fsf@draig.linaro.org> <877ccrqc06.fsf@draig.linaro.org> Date: Thu, 08 Aug 2024 17:16:15 +0100 Message-ID: <8734nfq9bk.fsf@draig.linaro.org> MIME-Version: 1.0 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_091620_867282_95587E16 X-CRM114-Status: GOOD ( 15.44 ) 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 Sean Christopherson writes: > 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 con= text, >> >> > 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 @p= fn, >> >> * 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= 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 wh= ole. >>=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 sim= ply > missed it. No worries, with the fixed comment: Reviewed-by: Alex Benn=C3=A9e --=20 Alex Benn=C3=A9e Virtualisation Tech Lead @ Linaro