From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Christopherson Date: Thu, 8 Aug 2024 06:16:46 -0700 Subject: [PATCH v12 13/84] KVM: Annotate that all paths in hva_to_pfn() might sleep In-Reply-To: <87bk23ql6n.fsf@draig.linaro.org> References: <20240726235234.228822-1-seanjc@google.com> <20240726235234.228822-14-seanjc@google.com> <87bk23ql6n.fsf@draig.linaro.org> Message-ID: List-Id: To: kvm-riscv@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thu, Aug 08, 2024, Alex Benn?e wrote: > Sean Christopherson writes: > > > 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(). > > The commentary for hva_to_pfn_fast disagrees. > > /* > * 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) > > 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=>pfn and hva=>pfn APIs removed support for doing so in order to simplify hva_to_pfn() as a whole. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF68318DF75 for ; Thu, 8 Aug 2024 13:16:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723123010; cv=none; b=CqRhG1iUKRzSie+gc0K/Swaw5kcc24/ICAEA+mdQrbE2/qX8pyv8h6Llp006H7d6iYcFAmWJm6UxWJmn1bkB9t3KmojeOO1pdbtPH1HwQwcfINy15Vvcx6ifD1UdGnbnrJLrO/Bd+7ftYzwrkTPvjJTLAxQUQSKQvckW5cvM8xc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723123010; c=relaxed/simple; bh=SIRHTk+m4P1RNpcxL6rwR5xC8tZQja2BIbrMKp2HGV0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=XbhNpKlVvKyap+C9ThE7Uoorq0Dku4W6ubjVp1PumEyudO5sD6a/AGxRXpsW2sXOjmcPiwkcNh+YKKBpXxroYq0hO7qvsqq8Wlv7YsP9QPwck8q7Grb/0KItX7wCX0jqTJBFBtwvgvGKzoy24bw/fJ4MKibdlIMp6G1+9QplF1I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EsJQWJmP; arc=none smtp.client-ip=209.85.210.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EsJQWJmP" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-70d1a747ee6so1088241b3a.2 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.linux.dev; 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=EsJQWJmPoNQ84VMOpavP3ll3u7lGZzJywbfhAODIUVOCOnI0mn5Ncy7sIct+bZ22Dn fj92WOFc0Jm51XwOLqosRowsQ3O9ttHWLVSYBY9mwG8NVFL8/j4u0QBTt2tEmORpvx1f XORB3QAmxwvTLvwPiKVb3PlfrzdKT6ejKzM/oEJ8XLN5n6eCGPmhx4PCJWk91EL3wrFF ijCg3WWin86Yyxx+vpA97l14/Suf2B+kWEsWbvsmO+ssQaxza9CBZXV2+rjkRVVhjmas I048xvK0Oo8hTSnsVMJENFHEsg2n5IUvWhkSYVs0TWIdSsaXh17vPI+XZyYxEwNQVGQ/ GsNg== 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=T5dWNhoK8oDF1lnZ7jqrcpqafi2n81TQyf3WPniN9bA53b6+Y9XOrgKgDj3BLAV5BY j24QrKLonegAa5S5GZ1POzEM3WuLP5PsYsjRGfTngF9tk/OwcEpHNGiCPhFQaUIsQVwz Cecv4tmEjUTvzVhc3RBENrsEtI3mo7Wti99wehLFhf4twvt2IOKFGUkA9ZhWPUe72HQG KjbIf6NHh0YYXai2AZXs25R9K9PeiPmuz8CJhGkRVgT/9JyBm/hN1xvBgIu59jG6R2nd ZQRA/qFOp62p755iF22gWZ78RbQo9lIXdcZRh5cuXJ8G53kVtrq+YhaPCZAJhyw3ihK4 bpUQ== X-Forwarded-Encrypted: i=1; AJvYcCU1w20hrcEcCzFgZ4/kRXpWu46vA5vi0hxZXwSBtaHP9erOnytI4ptB74hoTtRHgjidVN98qopXewUD24t7JyJVjQAaaRVr X-Gm-Message-State: AOJu0Yxq2mGSzPdyV3oKDz+NLFwJhpOPOnEUiA0oe4zyXl7BuwBP4Cey 10x6CgUUG3GiBVwqOD8/5zke+G0ujeAwff44+WZcUAF2o/QWtio8jREW80zTkimUF1rciy+d1za 9bA== 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> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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. 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 90C67C52D6F for ; Thu, 8 Aug 2024 13:18:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=5qtWgdi6W7wNRP4IS5A3WpzXUxUZYIFFEpqTjws3fw0=; b=k14Q4YjGSGiwo2lXamGcROmBTg I8BFMZOBdWA7TpuwWzdURAa1fpbK+1P4E0wGTMCCd14rLWhgV0pF+eIgbSq7kET+aJowJHbVTYDTk OXflPSf+aJZF4uNJYMbQUHXz0EcGGfvixEc0fRk0pi2Fnjo35aL5BC74/UVUCR1UOUvMVOQs/sxUA PzR40tvg89XftWVHVmsjMo3sPtnjPvdpFM2U1di1KtQDsfa/6f6appSRyi6W/O3aDxOehWxCRftkx GPwRxBTIc8FtiEQ5GlkfFqq0DJ4uzmjCnfm0zhDe3rVk2FDMCGa+OK1ILRTkZUsJi5dS7TRhdB9KC Urgs2iCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc31n-00000008Llj-2co9; Thu, 08 Aug 2024 13:18:03 +0000 Received: from mail-pf1-x449.google.com ([2607:f8b0:4864:20::449]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc30b-00000008LP9-2Mwt for linux-riscv@lists.infradead.org; Thu, 08 Aug 2024 13:16:51 +0000 Received: by mail-pf1-x449.google.com with SMTP id d2e1a72fcca58-70e910f309eso1141153b3a.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=sPPDwaBluschjKNLfyZI/BQp49hW3TOexdKUtTMQ8i3nHgE5G9Q9Yrzw7lnumPwOVo N+XBrYs0E3NNBwiDeuqYBM7BGgU6yQ5WaK4TDyIN9FeinlfnXzmJg8lwYt1+WdH2ZKQo 9N6e4mfwv4/0aqXuzIf9a9PbGtgkMh3Lu+NNTNYi/6Ynk7CIYFI3pTeRMSGfRu52StQK 795cxpRX7fPXHdGcOtZtChF1f/Kz9ECxNl7Bdj+T5uioavuTiUZabuqULhYiItdhpWMH FBdSiXM651Scf0RK1WiGPnU/fWX9yUwAuRTfh3FF5H/MCIURZWVHBzm1n6iVslMYXsIF gIow== X-Forwarded-Encrypted: i=1; AJvYcCW/HXTe8y4IJa6sLW4oPLna6nHxhiPvjp6DoB6lVKrvPlnqQbEpCnRpucPhCFCQqSeWa0pcI3Puu1lPCID8+wffxWv2IcerfRv1rCj5xNgI X-Gm-Message-State: AOJu0YxYHZhbrHhJBOWq5tpjOLN6z1a1xMO1YNgAQUnM+3DZDzNqXh4p dFpl03fKsIdlSHnYVcY2dZXZhPpjX9VaBn/5a9Gi1Xt7I2dhKfGmH3Pp88Bn38mTkSOiv3JgATd H0A== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_061649_634203_E606C521 X-CRM114-Status: GOOD ( 11.71 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org T24gVGh1LCBBdWcgMDgsIDIwMjQsIEFsZXggQmVubsOpZSB3cm90ZToKPiBTZWFuIENocmlzdG9w aGVyc29uIDxzZWFuamNAZ29vZ2xlLmNvbT4gd3JpdGVzOgo+IAo+ID4gTm93IHRoYXQgaHZhX3Rv X3BmbigpIG5vIGxvbmdlciBzdXBwb3J0cyBiZWluZyBjYWxsZWQgaW4gYXRvbWljIGNvbnRleHQs Cj4gPiBtb3ZlIHRoZSBtaWdodF9zbGVlcCgpIGFubm90YXRpb24gZnJvbSBodmFfdG9fcGZuX3Ns b3coKSB0bwo+ID4gaHZhX3RvX3BmbigpLgo+IAo+IFRoZSBjb21tZW50YXJ5IGZvciBodmFfdG9f cGZuX2Zhc3QgZGlzYWdyZWVzLgo+IAo+ICAgLyoKPiAgICAqIFRoZSBmYXN0IHBhdGggdG8gZ2V0 IHRoZSB3cml0YWJsZSBwZm4gd2hpY2ggd2lsbCBiZSBzdG9yZWQgaW4gQHBmbiwKPiAgICAqIHRy dWUgaW5kaWNhdGVzIHN1Y2Nlc3MsIG90aGVyd2lzZSBmYWxzZSBpcyByZXR1cm5lZC4gIEl0J3Mg YWxzbyB0aGUKPiAgICAqIG9ubHkgcGFydCB0aGF0IHJ1bnMgaWYgd2UgY2FuIGluIGF0b21pYyBj b250ZXh0Lgo+ICAgICovCj4gICBzdGF0aWMgYm9vbCBodmFfdG9fcGZuX2Zhc3Qoc3RydWN0IGt2 bV9mb2xsb3dfcGZuICprZnAsIGt2bV9wZm5fdCAqcGZuKQo+IAo+IEF0IHdoaWNoIHBvaW50IGRp ZCBpdCBsb29zZSB0aGUgYWJpbGl0eSB0byBydW4gaW4gdGhlIGF0b21pYyBjb250ZXh0PyBJCj4g Y291bGRuJ3Qgd29yayBpdCBvdXQgZnJvbSB0aGUgY29tbWl0cy4KCkl0IGRpZG4ndCBsb3NlIHRo ZSBhYmlsaXR5IHBlciBzZSAoY2FsbGluZyBodmFfdG9fcGZuX2Zhc3QoKSBpbiBhdG9taWMgY29u dGV4dAp3b3VsZCBzdGlsbCBiZSBmdW5jdGlvbmFsbHkgb2spLCByYXRoZXIgdGhlIHByZXZpb3Vz IHBhdGNoCgogIEtWTTogRHJvcCBAYXRvbWljIHBhcmFtIGZyb20gZ2ZuPT5wZm4gYW5kIGh2YT0+ cGZuIEFQSXMKCnJlbW92ZWQgc3VwcG9ydCBmb3IgZG9pbmcgc28gaW4gb3JkZXIgdG8gc2ltcGxp ZnkgaHZhX3RvX3BmbigpIGFzIGEgd2hvbGUuCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fXwpsaW51eC1yaXNjdiBtYWlsaW5nIGxpc3QKbGludXgtcmlzY3ZA bGlzdHMuaW5mcmFkZWFkLm9yZwpodHRwOi8vbGlzdHMuaW5mcmFkZWFkLm9yZy9tYWlsbWFuL2xp c3RpbmZvL2xpbnV4LXJpc2N2Cg== 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.