Re: [RFC v3 0/8] x86, xsave: rework of extended state handling, LWPsupport

From: Ingo Molnar
Date: Wed May 18 2011 - 07:23:15 EST



* Hans Rosenfeld <hans.rosenfeld@xxxxxxx> wrote:

> > Here are a couple of suggestions to LWP hardware designers:
> >
> > - the fact that LWP cannot count kernel events right now is unfortunate -
> > there's no reason not to allow privileged user-space to request ring 3
> > events as well - hopefully this misfeature will be fixed in future
> > iterations of the hardware.
> >
> > - it would be nice to allow the per task masking/unmasking of LWP without
> > having to modify the cr0 (which can be expensive). A third mode
> > implemented in the LWP_CFG MSG would suffice: it would make the LWP
> > instructions privileged, but would otherwise allow LWP event collection
> > to occur even on sandboxed code.
> >
> > - it would be nice to also log the previous retired instruction in the
> > trace entry, to ease decoding of the real instruction that generated
> > an event. (Fused instructions can generate their RIP at the first
> > instruction.)
>
> I will forward this to our hardware designers, but I have my doubts about the
> first two of your suggestions. They seem to be orthogonal to what LWP is
> supposed to be.

Not sure why you think those two suggestions are 'orthogonal to LWP', they are
not:

- the second suggestion adds a third security model to the current
all-or-nothing nature of LWP instructions.

- the first suggestion is a variation of its current security model as well:
it allows LWP driven event collection in kernel mode, not just user mode.

There is nothing fundamentally ring-3-only about the concept of 'light weight
profiling' - while ring-3-only event collection is understandably necessary for
unprivileged user-space, it is not the only interesting mode of lightweight
event collection.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/