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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08C60C25B0E for ; Tue, 16 Aug 2022 20:47:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237088AbiHPUrn (ORCPT ); Tue, 16 Aug 2022 16:47:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbiHPUrm (ORCPT ); Tue, 16 Aug 2022 16:47:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47D5589800 for ; Tue, 16 Aug 2022 13:47:41 -0700 (PDT) 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-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-316-Ew1wESaJPzmPz9vYjNve1w-1; Tue, 16 Aug 2022 16:47:39 -0400 X-MC-Unique: Ew1wESaJPzmPz9vYjNve1w-1 Received: by mail-qk1-f197.google.com with SMTP id l15-20020a05620a28cf00b006b46997c070so10284890qkp.20 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=lBzP+U6MpTusZW0D5okx1hN4uFjP/f575ljXm3TM+keZudVe5MpCGBhpKnkK4GfDO7 4NmlorDp3kF/WhYjMTMFObacWPO6pYZuUwJU8cB37bI9gTyn2BGQ27Z9uRlu3dVUmQXJ L7fRRc6MtfznXThQXhuLW8HcUJ0ZYPnKvuL0k1wjlJMrRpGiV0bLTAR0txn1gngxy1ma S/qL4rzjFMzdr1Iq3FeYJYVDV7wRZzhaSTU5gM64FxUVAAOahiFtUVY7ZtukPHxiVRcg RzePZRKtvHG15zNKIFxHVrQVhMVrLdp9FHNzhQC6/X+Kz0pTLgFxGAneR1SZs2zngmVp JfKg== X-Gm-Message-State: ACgBeo3dnYlYc0yMWQ6YBO4nBa5BYWA0YOncoDu9aj/fdV8hr8DcZiIF RkNxftzrGsBQz4GMJOjJnFcOMExu28w8W7VcndALdQhpC0Ie+Ya5gbu/IWV5fBf87cSjVskTnOs 8jgCIRgsbNbwR1+YkP+zViXeK X-Received: by 2002:ac8:4e45:0:b0:343:5faf:3af6 with SMTP id e5-20020ac84e45000000b003435faf3af6mr20160984qtw.340.1660682857449; 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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