Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3133993rwb; Mon, 15 Aug 2022 19:00:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR44MiD1qeZtpIooNTHr8jBxGN1K3CkRMjqGGja1OCUd9Hw1nPeCLkuyOltXUzKmOiZ9NLMk X-Received: by 2002:a17:906:93e8:b0:730:9e5c:b45a with SMTP id yl8-20020a17090693e800b007309e5cb45amr11438168ejb.530.1660615229341; Mon, 15 Aug 2022 19:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660615229; cv=none; d=google.com; s=arc-20160816; b=QGFiMXK1spnke1rMypshc31LO6nSeRKBIPomAYL64xJXCfST5K+WBiqh8lZIX1Opqc PoNSb8234P7mYHrKvhzjIGAiWusCwOKhrGkmg1GtvccEUIPrv0ubuitS7bxVkh2JSFGc mtzVMbF0eJbjLHmaFbPfMEUeq9knyHc3s35GMLkb6g+qrM+JsmcClhIvjRzRrXrnT1K2 OCNn9tSm96ExkJ+1JR2WBz9P7PS4dn7326zUnXJ4vh18lrd3F+4MeV/MACIi8c2iG4Ku vJMoNKCdIKKvBdKLUaeKnEqSKQZ81+uiDhM2Rc4Fu/irxAMetiUIn7xg2zx6HIej7rOk xJIQ== 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=s6C7xjGZFgkJFr5KfYkyBRVqHeZGBiLrMu8lM2DAdGc=; b=0JMtEQUl8VnkJQBtun4jNLbiPriOC/QB2M+OLhky1FxLBDkpXKAPYLul9G+oCIaMnT CHZzEAEJkdiMfqg+tixJCKyey9zJcYR357Sxl0UKwHlK7COzariLEGYJCuTHDAHh6p41 F3ybYTcbedRpzcMybbIMsW0op/sf31786ARpktUNxRnCghm2K3qsx7pDrhPYnz5CsOHc vtFYkZzWSALy7thyrGEGA0SbbgYn5MuZ4gwQRz+T8D1crbP2NJbA4GNKlOdDLqv5t8XF yHFvtHCMm97gz7QDVBfUcqkLM9vuT4EA4Jd2qd/L3+159GMyO3lWkhLtg1s05dXOp++b KcCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AG3J8t9J; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd31-20020a1709076e1f00b007304f4611e6si8475752ejc.719.2022.08.15.19.00.03; Mon, 15 Aug 2022 19:00:29 -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=@google.com header.s=20210112 header.b=AG3J8t9J; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233072AbiHPBga (ORCPT + 99 others); Mon, 15 Aug 2022 21:36:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233219AbiHPBgI (ORCPT ); Mon, 15 Aug 2022 21:36:08 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AFB3E831C for ; Mon, 15 Aug 2022 14:26:42 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id w14so7437505plp.9 for ; Mon, 15 Aug 2022 14:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=s6C7xjGZFgkJFr5KfYkyBRVqHeZGBiLrMu8lM2DAdGc=; b=AG3J8t9JIoa5aHNcIfU8Afi648JK1hym91JEPUZ0dSFr5Vu5y1F0zIWj3okus4yq7j 8SrjoNQWRS//nsxmvCMkWk5+ZtML4OympnohBF9ZypJ8vl3UZvWN6IWIIFXPyNQCw1PI ucQrEA19LX2XEiWOCgX4GP+56VU6Fg+OsQ8WCf2ae6sSq2c0PCH0rSS7aYW8rMg6949Y 46jOZtF9nXRcO3kDvuQpcCjcdnmbi6fI43+d2V1+EJk6zApr7+iOgtfTnxXurQoQ5YSI iZJ4cd/1gtdUwzdgm7U6lWdHkdrKAPobffvwMvfHC7Fh5oAzxw+sZQqSq2Mjlarza+pI 0NxQ== 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=s6C7xjGZFgkJFr5KfYkyBRVqHeZGBiLrMu8lM2DAdGc=; b=ZKSFgE9bVWttO9AUT/5k6NuH2KLkc+GY4LYRS16c5/HR9SQTcnLsGFoJoPmkJqdWt5 N0avCALRa0OxFR+zSyn9UA1fRjYrczpnuys+QyXn/cPAqnStffOL006o8xhhp1az4viV ofIHtq4apv1Q8mNOPmbKUzVh3EjOTU/eNjzGiws/FSLKmLhdhqjkF5XsSWauvSaBLd6a 0YcCLFeQ1t2kTr2fxErf1Hb3s0nAW7YJUY+5q5bycO9DKS16RfBkk+OoKqXUGjgPQQLY MDfNFLCRQQUtEl4AUNVlBN6/G4mxAoLCsYIjuTi0wVKZ4SDQT4CHn8Kx9G0ndCbPbF5x WHuQ== X-Gm-Message-State: ACgBeo39RFd42BJ0UCsqx9oE3pgbFqFBJFhAItWBh9d0dBmXjnWWo/RB sG0joaqJamfhFbaTfN/59CsvPQ== X-Received: by 2002:a17:90b:164b:b0:1f5:15ae:3206 with SMTP id il11-20020a17090b164b00b001f515ae3206mr19855063pjb.140.1660598802001; Mon, 15 Aug 2022 14:26:42 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id w12-20020a170902e88c00b0016a6caacaefsm7476713plg.103.2022.08.15.14.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 14:26:41 -0700 (PDT) Date: Mon, 15 Aug 2022 21:26:37 +0000 From: Sean Christopherson To: Peter Xu 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=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-14.4 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,FSL_HELO_FAKE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=no 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 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.