All of lore.kernel.org
 help / color / mirror / Atom feed
* Blocking CR and MSR writes via mem_access?
@ 2014-10-02 10:49 Razvan Cojocaru
  2014-10-02 11:39 ` Jan Beulich
  2014-10-03 12:32 ` Tamas K Lengyel
  0 siblings, 2 replies; 26+ messages in thread
From: Razvan Cojocaru @ 2014-10-02 10:49 UTC (permalink / raw)
  To: xen-devel@lists.xen.org

Hello,

Currently hvm_memory_event_cr3() and the other hvm_memory_event_*()
functions in hvm.c can pause the VCPU and send a mem_event with the new
value of the respective register, but especially in the case of CR
events (as opposed to MSR events), this is done _after_ the value is set
(please see hvm_set_cr3() in hvm.c).

It would be interesting from a memory introspection application's point
of view to be able to receive a mem_event _before_ the value is set, and
important to be able to veto the change.

A few questions:

1. Would it be acceptable to move the CR3 event sending code so that a
mem_access client would receive the event _before_ the write takes
place? Is this likely to break other mem_event clients that might rely
on the event being received _after_ the value has been set?

2. I see that mem_event responses from all these cases (EPT violations,
CR, MSR) are handled in p2m.c's p2m_mem_access_resume() (seems to be
confirmed by testing). Is this correct?

3. What would be the sanest, most elegant way to modify Xen so that
after a mem_event reply is being received for one of these cases (CR,
MSR), the write will then be rejected? I'm asking because, as always,
ideally this would also benefit other Xen users and an elegant patch is
always more likely to find its way into mainline than a quick hack.


Thanks,
Razvan Cojocaru

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2014-10-27 16:10 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-02 10:49 Blocking CR and MSR writes via mem_access? Razvan Cojocaru
2014-10-02 11:39 ` Jan Beulich
2014-10-02 11:46   ` Razvan Cojocaru
2014-10-02 11:51     ` Andrew Cooper
2014-10-02 11:54       ` Razvan Cojocaru
2014-10-02 11:51     ` Jan Beulich
2014-10-02 12:04       ` Razvan Cojocaru
2014-10-03 12:32 ` Tamas K Lengyel
2014-10-03 12:37   ` Andrew Cooper
2014-10-03 13:00     ` Razvan Cojocaru
2014-10-03 16:22     ` Tamas K Lengyel
2014-10-03 18:13       ` Razvan Cojocaru
2014-10-06 14:25       ` Razvan Cojocaru
2014-10-07  8:59         ` Tamas K Lengyel
2014-10-07 10:21           ` Razvan Cojocaru
2014-10-07 10:48             ` Razvan Cojocaru
2014-10-07 12:30               ` Tamas K Lengyel
2014-10-07 12:40                 ` Jan Beulich
2014-10-07 12:46                   ` Tamas K Lengyel
2014-10-07 12:49                     ` Andrew Cooper
2014-10-07 12:55                       ` Razvan Cojocaru
2014-10-07 12:58                         ` Tamas K Lengyel
2014-10-07 13:06                           ` Razvan Cojocaru
2014-10-07 12:48                   ` Razvan Cojocaru
2014-10-27 16:10         ` Razvan Cojocaru
2014-10-03 12:42   ` Razvan Cojocaru

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.