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 96C15C25B0E for ; Tue, 16 Aug 2022 22:51:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FB946B0073; Tue, 16 Aug 2022 18:51:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D2F06B0074; Tue, 16 Aug 2022 18:51:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 073868D0001; Tue, 16 Aug 2022 18:51:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id EACDC6B0073 for ; Tue, 16 Aug 2022 18:51:44 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id B60DD80445 for ; Tue, 16 Aug 2022 22:51:44 +0000 (UTC) X-FDA: 79806954528.04.AB6084C Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by imf03.hostedemail.com (Postfix) with ESMTP id 58965201C3 for ; Tue, 16 Aug 2022 22:51:44 +0000 (UTC) Received: by mail-lf1-f48.google.com with SMTP id v2so16844907lfi.6 for ; Tue, 16 Aug 2022 15:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=C5zMKo6O1AIsX4SXPjK2YwIObu5P/amVe0VlPQFbfBE=; b=CynbWLTVxPjEZ04QKDb+B7lkPK95HwhJrWBYD8Umnd5gBFVozIexI7kjFjy3r2cWVI AjjfGL1VpcpVr98f4taYq7I1iOqUTbGo5lm3Uu0yYTtIWdoxrVDfFpaxLElZdOXyT7m0 aiMCjqJR2PMhUoVBKSMXCkMRK0Gx/yTeDnl7YMF191o3c6f0x1FAGOO7BERvsL3xVN+o A0qAUwsA9Qh+wxb5jnD70v5Yk/rGYofQ6zvLyXvEmmuJUSIWlkv1o5Z6pX0szb6421++ wzWKMKZwo7Z+rNfo7KdzPUhkatfHdfEkIyzcv8dBV59sTvKQb3kxa3BdKq1JlJa+Y4j3 znJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=C5zMKo6O1AIsX4SXPjK2YwIObu5P/amVe0VlPQFbfBE=; b=zOMJ4UrY2dYhGCg0ddlsOepCzkLyo5+vHhI1oFcKLsY5DHPMBvScsT+wEBpE0XLZaK KkKKL3UFsGl2CNR6cBLCcExlES3GtqG8hI8hFqjWRZGAlS/U7GiQ8oOaeiTEplKVgExI I3eZCNTpuoQbNtEqlOIYxP+2BaoLVH6uNJoR9bHFJPRZnsCXr21lvxzdvsdvg/ObXOxT XmTcKVbguYyg3RHR2pznITRX71e7Y/+vqvYVfGAMW+aUUFAkc15s4azGBzUZtfarz94f QIIzRh7sBxUk6QyTL3zT5UczdTD4ETU3hBK8Lc+VIuU70f/6GIHWe+Vf4KM50Wpmwekd jRQw== X-Gm-Message-State: ACgBeo3h3OjcWxnyEeqEPhPql7tpva7DsPmvEZBzM45U3hLFvlLgrt// JtTlvnECnBpeOu9tQOr4K77s2JRw/hga0rEtfW3egw== X-Google-Smtp-Source: AA6agR6rJNvdSkzkbUXOVijt+M3uVg+AKWY4Rwoarf4HzU6Y8fZ5UPEco2eMKTOoZVLNdMeLVqQB34m6QXpYtLxR534= X-Received: by 2002:ac2:4c4f:0:b0:48b:1358:67e3 with SMTP id o15-20020ac24c4f000000b0048b135867e3mr7555661lfk.441.1660690302541; Tue, 16 Aug 2022 15:51:42 -0700 (PDT) MIME-Version: 1.0 References: <20220721000318.93522-1-peterx@redhat.com> <20220721000318.93522-4-peterx@redhat.com> In-Reply-To: From: David Matlack Date: Tue, 16 Aug 2022 15:51:16 -0700 Message-ID: Subject: Re: [PATCH v2 3/3] kvm/x86: Allow to respond to generic signals during slow page faults To: Peter Xu Cc: Sean Christopherson , LKML , kvm list , David Hildenbrand , "Dr . David Alan Gilbert" , John Hubbard , Linux MM Mailing List , Andrew Morton , Paolo Bonzini , Andrea Arcangeli Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660690304; a=rsa-sha256; cv=none; b=TAL84ZRCWysrXsbf/YoaGlK/HXeXx+ANFLHajRfA+16eO9GEsEAq11FFljXi0f23AkXIcs MQUaiTpCz+e+b1+NWEcoTVxUCU+Twf4Gg8jeP4bYUK1JC+8aaIaDqOg/KgsqyuMJ07OFh+ pWH4rvq/UMDU+vAAU17ENeOMEfhMf2Y= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=CynbWLTV; spf=pass (imf03.hostedemail.com: domain of dmatlack@google.com designates 209.85.167.48 as permitted sender) smtp.mailfrom=dmatlack@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660690304; 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=C5zMKo6O1AIsX4SXPjK2YwIObu5P/amVe0VlPQFbfBE=; b=C14YMq+XralboctQ9gnIAB2T0Z25lFiNPHQvovaot+WTpO5NhUceRKOb22MHguJpwPBVJR MEsdZnQ87taWeYo0KMYSGN5cvuVhdZQEg/X0v5udIHor3XpCgua/UFUNAWW0nZYVs0ZIIR ZcefK3tRNRYHMwsn/RaOUuq8Ls56p+w= Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=CynbWLTV; spf=pass (imf03.hostedemail.com: domain of dmatlack@google.com designates 209.85.167.48 as permitted sender) smtp.mailfrom=dmatlack@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 58965201C3 X-Stat-Signature: x9zjfzo188jibk9apy5wjoprydzkzjut X-Rspam-User: X-HE-Tag: 1660690304-108323 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 Tue, Aug 16, 2022 at 1:48 PM Peter Xu wrote: > > 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. +1 to kvm_handle_error_pfn(). Weirdly I proposed the same as part of another series yesterday [1]. That being said I'm probably going to drop my cleanup patch (specifically patches 7-9) since it conflicts with your changes and there is a bug in the last patch. [1] https://lore.kernel.org/kvm/20220815230110.2266741-8-dmatlack@google.com/ > > Thanks, > > -- > Peter Xu >