Thread (118 messages) flat view 118 messages, 7 authors, 2020-07-23

Re: [PATCH v4 63/75] x86/sev-es: Handle #DB Events

From: Peter Zijlstra <peterz@infradead.org>
Date: 2020-07-15 10:13:28
Also in: kvm, lkml

On Wed, Jul 15, 2020 at 12:08:08PM +0200, Joerg Roedel wrote:
On Wed, Jul 15, 2020 at 11:51:36AM +0200, Peter Zijlstra wrote:
quoted
On Wed, Jul 15, 2020 at 11:13:37AM +0200, Joerg Roedel wrote:
quoted
Then my understanding of intrumentation_begin/end() is wrong, I thought
that the kernel will forbid setting breakpoints before
instrumentation_begin(), which is necessary here because a break-point
in the #VC handler might cause recursive #VC-exceptions when #DB is
intercepted.
Maybe you can elaborate on why this makes no sense?
Kernel avoids breakpoints in any noinstr text, irrespective of
instrumentation_begin().

instrumentation_begin() merely allows one to call !noinstr functions.
Right, but the handler calls into various other functions. I actually
started to annotate them all with noinstr, but that was a can of worms
when calling into generic kernel functions. And the only problem with
intrumentation in the #VC handler is the #VC-for-#DB exit-code, so I
decided to only handle this one with instrumentation forbidden and allow
it for the rest of the handler.
OK, then maybe change the comment to something like:

 /*
  * Handle #DB before calling any !noinstr code to avoid
  * recursive #DB.
  */

?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help