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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 1E809C3DA4A for ; Thu, 8 Aug 2024 13:17:38 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=VIT0UWKf; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Wfndr4tNNz2xgX for ; Thu, 8 Aug 2024 23:17:36 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=VIT0UWKf; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--seanjc.bounces.google.com (client-ip=2607:f8b0:4864:20::449; helo=mail-pf1-x449.google.com; envelope-from=3p8w0zgykdngm84hd6aiiaf8.6igfchorjj6-78pfcmnm.itf45m.ila@flex--seanjc.bounces.google.com; receiver=lists.ozlabs.org) Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Wfnd171Whz2xrC for ; Thu, 8 Aug 2024 23:16:52 +1000 (AEST) Received: by mail-pf1-x449.google.com with SMTP id d2e1a72fcca58-70d1d51f3e9so1230308b3a.0 for ; Thu, 08 Aug 2024 06:16:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723123008; x=1723727808; darn=lists.ozlabs.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=VIT0UWKf1MHjFrlEZuTWukJaV6C4ddo30p0AKG8gtShRnoHIEa+Yhb4IHKVNptu9M1 moMG1kRwK9Pkl5/ihtMcKK31h4voJWXIXvQ1wTVYNhBN0B6kQe5LrppPs2meqVBE/Dqg IAhchb9l7qysuSfq2MGLl3MfY8hhbxLJYoku/GpcYX3JK43EYNnBju8TBRp4WkFAUogy WSpOzpuujY8BhcM0Sc3VTAI5DMy6KZudHrYpMkkGTiEg+wtNm/kw0ibm89WcSlUsvU80 O0y1vKVMxp3QpWs0rruxO9J+K2MXNwESVqiyWuzzqCdJSb7eapcuQwaQjm5SYToQ8SdG Zv0w== 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=mSzQjX7WsUXbmLCZV0NXWq0408pvo2F0OD+oyEz1AYOb4ShpPpGQXqDDnmvwG+wg1y +kRbzjuDvZtE0f8khwvAJp+PoBaEljr4DXXQrmW4carQ/RYjycRAgqVN+IAOM4mrrnJf NOZvXP3BfrUhzs35i62xGUmiAPw/AMW12JffgteIy+c3lCVSaUvM9H+/AXlYuqnadq/A RdvLbEivuyIXT5ar71kiPG0ZULmrYiMsCEjN8SM896eBLLo8a38oyuVh+QTWMK6WmdmC HmArBdt5HAHHCdRYJSgxxSpjjeDTuNvcdsK9PBc4rFCoTtCYr6WLH7AjVwDkQSrU4Ssb 1reA== X-Forwarded-Encrypted: i=1; AJvYcCU/vBX50eVTsyTDU2KWut0Sa5iWrblXDkOzHgvsLqDxElGSN7Xas7+fwC1OwIe38tKu9XThFCvrZQlvieE0juEcMpyIEBK+gbPNfwo96w== X-Gm-Message-State: AOJu0Yz8fv9kSe5MY+fa0Twcs6G1dkGACAsQSAe9j1V7DtZnpGrScwVy sn5MSftFqoYlBTDMZDgDV4WS9J+KwiV4V/tv4wNEP+I59PJUKHfrTZbXmu0gemjQ3U5+bElA4SD JGw== 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?=" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , linux-riscv@lists.infradead.org, Claudio Imbrenda , Janosch Frank , Marc Zyngier , Huacai Chen , Christian Borntraeger , Albert Ou , Bibo Mao , loongarch@lists.linux.dev, Paul Walmsley , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, Oliver Upton , Palmer Dabbelt , David Stevens , kvm-riscv@lists.infradead.org, Anup Patel , Paolo Bonzini , Tianrui Zhao , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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.