All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	KVM <kvm@vger.kernel.org>,
	"Paul E. McKenney" <paulmck@kernel.org>
Subject: [patch 0/2] x86/kvm: Sanitize async page fault
Date: Sat, 07 Mar 2020 00:42:04 +0100	[thread overview]
Message-ID: <20200306234204.847674001@linutronix.de> (raw)

Hi!

This emerged from the ongoing efforts to consolidate the entry code maze on
x86 along with the tracing and instrumentation induced violations of RCU
constraints.

While working on this I stumbled over the KVM async page fault handler and
kvm_async_pf_task_wait() in particular. It took me a while to realize that
the randomly sprinkled around rcu_irq_enter()/exit() invocations are just
cargo cult programming. Several patches "fixed" RCU splats by curing the
symptoms without realizing that the code is fundametally flawed from a
design perspective.

Aside of that Andy noticed that the way the async page fault handler is
implemented can be improved which in turn allows further simplification
vs. CR2 consistency and the general exception entry handling on x86.

I'm sending this out as a stand alone series against mainline, but I'd
prefer to take this along with the rest if the entry code rework.

If you look at the changelog then don't be afraid, most of the added lines
are comments which were painfully absent in the original code.

Thanks,

	tglx
---
 entry/entry_32.S       |    8 --
 entry/entry_64.S       |    4 -
 include/asm/kvm_para.h |   21 ++++-
 include/asm/x86_init.h |    2 
 kernel/kvm.c           |  193 +++++++++++++++++++++++++++++++++----------------
 kernel/traps.c         |    2 
 kernel/x86_init.c      |    1 
 kvm/mmu/mmu.c          |    2 
 mm/fault.c             |   19 ++++
 9 files changed, 171 insertions(+), 81 deletions(-)


             reply	other threads:[~2020-03-07  0:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 23:42 Thomas Gleixner [this message]
2020-03-06 23:42 ` [patch 1/2] x86/kvm: Handle async page faults directly through do_page_fault() Thomas Gleixner
2020-03-17  8:47   ` [x86/kvm] aec3011ae9: WARNING:at_arch/x86/kernel/kvm.c:#kvm_guest_init kernel test robot
2020-03-17  8:47     ` kernel test robot
2020-03-06 23:42 ` [patch 2/2] x86/kvm: Sanitize kvm_async_pf_task_wait() Thomas Gleixner
2020-03-07  0:22   ` Paul E. McKenney
2020-03-07  1:02     ` Thomas Gleixner
2020-03-07  3:48       ` Paul E. McKenney
2020-03-07  2:18   ` Andy Lutomirski
2020-03-07 10:01     ` Thomas Gleixner
2020-03-07 15:10       ` Andy Lutomirski
2020-03-07 15:51         ` Andy Lutomirski
2020-03-07 19:18           ` Thomas Gleixner
2020-03-07 19:30             ` Andy Lutomirski
2020-03-07 15:52         ` Thomas Gleixner
2020-03-07 16:06           ` Andy Lutomirski
2020-03-07 20:08             ` Thomas Gleixner

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=20200306234204.847674001@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.