Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4077038rwb; Tue, 16 Aug 2022 14:06:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR79bu4JzL9rrYr5Cgslf+LPS3XjGNUjrCiCth3FUsyUMoXZ4Gbe8TUKeLh1ej9sME3T0nW1 X-Received: by 2002:a05:6402:194d:b0:43d:8001:984b with SMTP id f13-20020a056402194d00b0043d8001984bmr20188240edz.327.1660683980586; Tue, 16 Aug 2022 14:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660683980; cv=none; d=google.com; s=arc-20160816; b=ofaXlwMV2Um3ecfC4w1l2gconwb8zZDDYq4ETdkG8mfMNw01fryq7fIF5rxlunFTZW PBLhrUqS5WoHOyxYs2TjifrSVwh3fQaIWctgsrT0Ua2v2hV7KIeMz2Nl5To0nYVZs4qA 1YsP6n9QcnB8md1egcn/dVMhMS4ntKBt7GqNNKtZTu9WLa2tYWP9tWnzt5apcTMahSWM Y/9tWkMYQj2kNc1KQMLx69dw3H/8X5mMffBL7GLdqNbWAKFmzgWOSP2wqo2DPFEC3vDn Ojc3o0/fOeuP8Xyo4k38rKCNL0dxaEXspnD4YK8kay00ZSaJmuuESEN7QnRmVjLrVoAq KhDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3JoZZmMRTLKhHqlvu8uJZ3OdJLMTuykuadzU2PRUVyo=; b=Rxc+i1+DGLyHGAd1ONnk6D8A7um6d1Vg9ArwP9XlaY5i3qDF3qtguSOBYBA9eJyCcz tWfvHHlGVB4sErPjru7s9cY/NL13D+7NeqwfyEt/hHBlDTB+mpuSrldM9TMXaBEtZfu8 +0HUL2vPXWdv1R03Udmer25mCBqRPjdGRC25WYkXy1x9LE2xmEzHCz18shUOwVtqLEa1 IsUPlq4OGrn0n/1YF61zON/8zWo1uWthYF+/WNexArmY9Blq8SY8xvH9TChP62s70QSj oEIFNVGQT2GpyAFr2Q4x5ou2iRW/1+Ac0szm4sZkER+FQmSe2dzI3FLKyRNQ+ukk8fUQ XIdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HfULhG6F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv18-20020a17090760d200b0073068883291si12987609ejc.836.2022.08.16.14.05.52; Tue, 16 Aug 2022 14:06:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HfULhG6F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237063AbiHPUrn (ORCPT + 99 others); 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-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: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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