From: Peter Xu <peterx@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Sean Christopherson <seanjc@google.com>,
David Hildenbrand <david@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Andrea Arcangeli <aarcange@redhat.com>,
peterx@redhat.com, Paolo Bonzini <pbonzini@redhat.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Linux MM Mailing List <linux-mm@kvack.org>,
John Hubbard <jhubbard@nvidia.com>
Subject: [PATCH v3 3/3] kvm/x86: Allow to respond to generic signals during slow page faults
Date: Tue, 16 Aug 2022 20:36:14 -0400 [thread overview]
Message-ID: <20220817003614.58900-4-peterx@redhat.com> (raw)
In-Reply-To: <20220817003614.58900-1-peterx@redhat.com>
Enable x86 slow page faults to be able to respond to non-fatal signals.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
arch/x86/kvm/mmu/mmu.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 23dc46da2f18..4a7d387a762a 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -4177,7 +4177,12 @@ static int kvm_faultin_pfn(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault)
}
}
- fault->pfn = __gfn_to_pfn_memslot(slot, fault->gfn, false, false, NULL,
+ /*
+ * Allow gup to bail on pending non-fatal signals when it's also allowed
+ * to wait for IO. Note, gup always bails if it is unable to quickly
+ * get a page and a fatal signal, i.e. SIGKILL, is pending.
+ */
+ fault->pfn = __gfn_to_pfn_memslot(slot, fault->gfn, false, true, NULL,
fault->write, &fault->map_writable,
&fault->hva);
return RET_PF_CONTINUE;
--
2.32.0
next prev parent reply other threads:[~2022-08-17 0:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-17 0:36 [PATCH v3 0/3] kvm/mm: Allow GUP to respond to non fatal signals Peter Xu
2022-08-17 0:36 ` [PATCH v3 1/3] mm/gup: Add FOLL_INTERRUPTIBLE Peter Xu
2022-08-17 0:36 ` [PATCH v3 2/3] kvm: Add new pfn error KVM_PFN_ERR_SIGPENDING Peter Xu
2022-10-07 1:39 ` Sean Christopherson
2022-10-07 15:03 ` Peter Xu
2022-08-17 0:36 ` Peter Xu [this message]
2022-08-17 1:37 ` [PATCH v3 0/3] kvm/mm: Allow GUP to respond to non fatal signals Peter Xu
2022-10-06 20:47 ` Peter Xu
2022-10-07 1:40 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220817003614.58900-4-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=jhubbard@nvidia.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).