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 DA3F9C3DA4A for ; Thu, 8 Aug 2024 15:19: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: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=tobJ9z30Evl1jF8OZuU4Lc5uAJoWjkGhLZnI88VCnqo=; b=mmpaQDSjdZuPgtcAgMvZDdj/WO vxSjVG5HrDVfbrU9vvzeIOeCeZSghmdr3K9eWzNlhENoaaDiDD7PzEJGDTThw1K3LwKVKNAtu7AU/ S2OpgOPY6/REzPPGf8gPcuz8ECNHBC98mOBPFef0RiWPkvJsySwMdpBuheZQmd+vl7BzIvlJ2z8l/ B7SV+eu8QqjGlN5jSGFg1X/031jOi1YCizf1Xj7QX2EwQb24r1hxvwcc6qAEBUWpH5cIWTN9lYnuR fwyt8iZSRs59lOr8bXd2pih04wwBwEZz3ZGmwelXtnQoCoBFnwWH8+6INiEhBLWpZMXxB5tdmSf9Q m1eD3O8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc4up-00000008hR6-3PwE; Thu, 08 Aug 2024 15:18:59 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc4uE-00000008h9d-0mAR for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 15:18:24 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-428085a3ad1so8235075e9.1 for ; Thu, 08 Aug 2024 08:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723130300; x=1723735100; 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=tobJ9z30Evl1jF8OZuU4Lc5uAJoWjkGhLZnI88VCnqo=; b=kU1iypMOLnvqdo77GI54u6VhIOqBlPy7uTmocnxlf6/YheRaQkS2iwG7byo9Jdmf9T 7fDCeyrKE4rQnkTV7FDTYOMgN/CBplhrUTUsay+EAyd2Kf8+ke/W037UpBwPonFYBG+k 33+FLXunbqXsOmnnQNZVbSJaTXpbEM42vGuX48Tetr1lF0QZL6kJVV3YWjh3T+B14sjo Kt3me4WBLq37711hDl4qq5Hnesea0NcYLPzbkWpmTQ+OTr8VbY8jLs5mnryo7vR2vtVZ cVJGtFH8dlJ7qLKwJl7HmgkwlSoVD2MHYVDxoKGxyiH/0Rt0e1YhhF1X07OTmmZfNxZ4 RjRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130300; x=1723735100; 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=tobJ9z30Evl1jF8OZuU4Lc5uAJoWjkGhLZnI88VCnqo=; b=bqLxGD/7nA2BqdABOqdwjbGQ2OBGG3OCaBtdFm2W55xY7ZiPRBHjVEfjmsUSmicSYM rUT3NlGjGTaVPUI9qNUrd+z3B88rByDUkzNUmAAa/sCOnUZ8so55XVgG+6+7QDELq4ZU MJb/bvP7zmi0x1FwIVrCgWw+btNjW7F3r2fSfBDOeXN0UhtPw8rJK+k5anpNzRlLyc8F wYOIp/VLYTKCDfWtwOoRT9EG8cPs9oZKVkwarxicRAOUcpEx+zvDV4NX8/77YkVPJW+L htHHsgotEbSomGqmCiRgMqDxQ+4jYpvvPdFiEg7V3hEAp4EtEp6YZ0cwGUgq7h3lz9qH WNPQ== X-Forwarded-Encrypted: i=1; AJvYcCWqZ8/aeWoB1utEv9W7XL1AsvhMX21+IU/mhv98SDQbSnedNpKmnHps9/3UNXpWuv9WAgTWr9SqOl9xRsBBU0P6@lists.infradead.org X-Gm-Message-State: AOJu0Yx+q8Lu5m4w4pn3U4D7QAr/Q9Rjw9zW8UNM4xvml6ur1JxqbG5l W7BpvH6f+M4pSHCgd3UfsuMnUujB55mGCZnjSHDK1PjumxBPeLvq1LphkoUJqO8= X-Google-Smtp-Source: AGHT+IGvryFhFZyruwyY4esgEivQLYITNxgcfgoPAmbjFk+Vzw8kMU8OO4VMz6KIvqZ2Rys90VZ6yQ== X-Received: by 2002:a05:600c:1914:b0:426:4f47:6037 with SMTP id 5b1f17b1804b1-4290af13367mr16171145e9.19.1723130299428; Thu, 08 Aug 2024 08:18:19 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429059a5dbbsm78703665e9.36.2024.08.08.08.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 08:18:18 -0700 (PDT) Received: from draig (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id BF0C45F769; Thu, 8 Aug 2024 16:18:17 +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 06:16:46 -0700") References: <20240726235234.228822-1-seanjc@google.com> <20240726235234.228822-14-seanjc@google.com> <87bk23ql6n.fsf@draig.linaro.org> Date: Thu, 08 Aug 2024 16:18:17 +0100 Message-ID: <877ccrqc06.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_081822_234808_9EEE07C7 X-CRM114-Status: GOOD ( 12.82 ) 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 >> > Now that hva_to_pfn() no longer supports being called in atomic contex= t, >> > 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 co= ntext > 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. It still sticks out given the only caller no longer enforces this.=20 How about: * true indicates success, otherwise false is returned. It's also the * only part that could run in an atomic context if we wanted to * (although no callers expect it to). ? --=20 Alex Benn=C3=A9e Virtualisation Tech Lead @ Linaro