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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 378E5C25B0E for ; Tue, 16 Aug 2022 20:47:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BDE6B8D0001; Tue, 16 Aug 2022 16:47:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B8D5E6B0074; Tue, 16 Aug 2022 16:47:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A2DFB8D0001; Tue, 16 Aug 2022 16:47:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 9310B6B0073 for ; Tue, 16 Aug 2022 16:47:41 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5E06614140C for ; Tue, 16 Aug 2022 20:47:41 +0000 (UTC) X-FDA: 79806641922.18.91FB34C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf06.hostedemail.com (Postfix) with ESMTP id B81B11801A3 for ; Tue, 16 Aug 2022 20:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660682860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3JoZZmMRTLKhHqlvu8uJZ3OdJLMTuykuadzU2PRUVyo=; b=HfULhG6FF0CDCsfYL0BbhyoZM2GPxb6aovAEAMbfFiyRwIX9tCC60XYpfnzpBAsbLAqj5R leHFy0T0fyBNNHGcEjAohXqEdlSpTyH5P7A6YOgbSpX9FFVhJzZ8Ld0P5VglkfXf6XpdRX qGm2wWpm8Ahi1CNaJl5hDz5C5kMbDZc= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-316-8AY7TyPVOOmSuJQwnVlqqg-1; Tue, 16 Aug 2022 16:47:39 -0400 X-MC-Unique: 8AY7TyPVOOmSuJQwnVlqqg-1 Received: by mail-qk1-f198.google.com with SMTP id bi22-20020a05620a319600b006b92f4b2ebbso10255089qkb.22 for ; Tue, 16 Aug 2022 13:47:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=3JoZZmMRTLKhHqlvu8uJZ3OdJLMTuykuadzU2PRUVyo=; b=HkxduHPwyJBjdWW8WfoyLCLQwFJ9QIoX68r390PvpaWLcHRle/ZVpCiwI+qoKdjYgX pZ6iV16NkbUSJA/i3cP6L37XTJPMryUEkL0ICIU2OZN7xNZb1HpHZ14OVUWX3RB6vn53 HzGXGya197sqDG9NPY15MLqpyWEYF7eWCwc52tFHptLvjdIUpmHbZHvVFrPNxqskSHBI NRUZYf2Nujslbl/9n6Ux/YD9mYEvjI//B/R3OvtyLUNiwYNa3d+Rd61dytmKFHPwQpuO uA2txeNs9n0l9Js9IJnsm4KQWJq5ZRYEGNj3d/Vn9jutvOFN7fRAtHjCQ382hIFZXhpB sRlA== X-Gm-Message-State: ACgBeo2E0QlVItH2H1lBwETHjIVPOaEbt0fypx5z4q298jP5z04Ub64u LnTYeUHXSCCyf6ThRfS/3LqWhkjpmihgBfOtHijNXymKNQyYgp7hfirG8qVNlq9/wE09WXzBpBm pZUdYrde87Rg= X-Received: by 2002:ac8:4e45:0:b0:343:5faf:3af6 with SMTP id e5-20020ac84e45000000b003435faf3af6mr20160987qtw.340.1660682857451; Tue, 16 Aug 2022 13:47:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR6IwiJJXWm5YftOp/luO9AW0MDhFAjgzItfksuHh5hDaCvWVcPNx39suKAdXZ2GyDmA+23zUg== X-Received: by 2002:ac8:4e45:0:b0:343:5faf:3af6 with SMTP id e5-20020ac84e45000000b003435faf3af6mr20160915qtw.340.1660682855766; Tue, 16 Aug 2022 13:47:35 -0700 (PDT) Received: from xz-m1.local (bras-base-aurron9127w-grc-35-70-27-3-10.dsl.bell.ca. [70.27.3.10]) by smtp.gmail.com with ESMTPSA id h5-20020a05620a400500b006b615cd8c13sm12717718qko.106.2022.08.16.13.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Aug 2022 13:47:35 -0700 (PDT) Date: Tue, 16 Aug 2022 16:47:34 -0400 From: Peter Xu To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, David Hildenbrand , "Dr . David Alan Gilbert" , John Hubbard , Linux MM Mailing List , Andrew Morton , Paolo Bonzini , Andrea Arcangeli Subject: Re: [PATCH v2 3/3] kvm/x86: Allow to respond to generic signals during slow page faults Message-ID: References: <20220721000318.93522-1-peterx@redhat.com> <20220721000318.93522-4-peterx@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660682860; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3JoZZmMRTLKhHqlvu8uJZ3OdJLMTuykuadzU2PRUVyo=; b=fCFXl+7Nz6MTCx9oIN2Zy+HVw492iBBCkjY5NL85YZ0TXW8TKaMw5lX6rRm05BpkmU70qW zx4fl6fSRW7IAzSgmUOihwnK5CIFg/y5NTQ1s4fxWVegnxFAzZ11YTmCBFowTFmthVNOk7 hM91uWPWMnPLk4BTBxG6GqjRQY1UQZw= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HfULhG6F; spf=pass (imf06.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660682860; a=rsa-sha256; cv=none; b=Adym+1mM9Pc7Nv5oMA+XKYSi+zhluXQeWflPuP9HVpS2R0E7qyfGfOHkcYdsPkltJaUlz9 s+Lw5hV4toTkEv4jQI2lA6GpMkGF3G9UedH25LxxbVctJa/BGo1/xQddQsY8q6h+LUqyZa G803HQn7xP5Dts6SSQxNgXPGsKgYyiI= X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B81B11801A3 X-Rspam-User: Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HfULhG6F; spf=pass (imf06.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: shp9m5npwok9mjdacc4i6wutr39hsfwk X-HE-Tag: 1660682860-169360 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Aug 15, 2022 at 09:26:37PM +0000, Sean Christopherson wrote: > On Thu, Aug 11, 2022, Peter Xu wrote: > > On Thu, Aug 11, 2022 at 08:12:38PM +0000, Sean Christopherson wrote: > > > > diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c > > > > index 17252f39bd7c..aeafe0e9cfbf 100644 > > > > --- a/arch/x86/kvm/mmu/mmu.c > > > > +++ b/arch/x86/kvm/mmu/mmu.c > > > > @@ -3012,6 +3012,13 @@ static int kvm_handle_bad_page(struct kvm_vcpu *vcpu, gfn_t gfn, kvm_pfn_t pfn) > > > > static int handle_abnormal_pfn(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault, > > > > unsigned int access) > > > > { > > > > + /* NOTE: not all error pfn is fatal; handle sigpending pfn first */ > > > > + if (unlikely(is_sigpending_pfn(fault->pfn))) { > > > > > > Move this into kvm_handle_bad_page(), then there's no need for a comment to call > > > out that this needs to come before the is_error_pfn() check. This _is_ a "bad" > > > PFN, it just so happens that userspace might be able to resolve the "bad" PFN. > > > > It's a pity it needs to be in "bad pfn" category since that's the only > > thing we can easily use, but true it is now. > > Would renaming that to kvm_handle_error_pfn() help? I agree that "bad" is poor > terminology now that it handles a variety of errors, hence the quotes. It could be slightly helpful I think, at least it starts to match with how we name KVM_PFN_ERR_*. Will squash the renaming into the same patch. Thanks, -- Peter Xu