All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/6] mini-os: check and fix up against nested events in x86-64 kernel entry
@ 2013-04-11  4:46 Xu Zhang
  2013-04-11  4:46 ` [PATCH V2 1/6] mini-os/x86-64 entry: code clean-ups; no functional changes Xu Zhang
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Xu Zhang @ 2013-04-11  4:46 UTC (permalink / raw)
  To: xen-devel; +Cc: samuel.thibault, jeremy, Xu Zhang, gm281, stefano.stabellini

mini-os almost always use direct iret to return from interrupt.
But this operation is not atomic because Xen uses event mask to
enable/disable event delivery. So there is a window for nested 
events to happen after re-enabling event delivery and before
a direct iret.

The issues come with such non-atomicity have been discussed in:
http://lists.xen.org/archives/html/xen-devel/2007-06/msg00142.html

And also on Xen-devel:
http://markmail.org/message/jkzhzy6fyes6igcf

This patch checks and fixes up against nested events in a similar 
fashion of Linux 32bit pvops.
It checks against re-entrant of critical section in event handling 
callback. Try to fix up by coalescing the two stack frames into
one when the a nested event came. 
It then resumes execution as if the second event never happened.

It also refactors mini-os's x86-64 kernel entry assembly code.

Xu Zhang (6):
  mini-os/x86-64 entry: code clean-ups; no functional changes
  mini-os/x86-64 entry: define macros for registers partial save and
    restore; no functional changes
  mini-os/x86-64 entry: code refactoring; no functional changes
  mini-os/x86-64 entry: remove unnecessary event blocking
  mini-os/x86-64 entry: defer RESTORE_REST until return
  mini-os/x86-64 entry: check against nested events and try to fix up

 extras/mini-os/arch/x86/x86_64.S |  245 ++++++++++++++++++++++++--------------
 1 files changed, 156 insertions(+), 89 deletions(-)

---
Changed since v1:
 * Drop the chunky lookup table; use Linux x86-32's fixup strategy instead,
   as suggested by Jeremy Fitzhardinge;
 * Reflect Samuel Thibault's comments.

-- 
1.7.7.6

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

end of thread, other threads:[~2013-04-22 15:06 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11  4:46 [PATCH V2 0/6] mini-os: check and fix up against nested events in x86-64 kernel entry Xu Zhang
2013-04-11  4:46 ` [PATCH V2 1/6] mini-os/x86-64 entry: code clean-ups; no functional changes Xu Zhang
2013-04-21  0:15   ` Samuel Thibault
2013-04-11  4:46 ` [PATCH V2 2/6] mini-os/x86-64 entry: define macros for registers partial save and restore; " Xu Zhang
2013-04-21  0:16   ` Samuel Thibault
2013-04-11  4:46 ` [PATCH V2 3/6] mini-os/x86-64 entry: code refactoring; " Xu Zhang
2013-04-21  0:14   ` Samuel Thibault
2013-04-11  4:46 ` [PATCH V2 4/6] mini-os/x86-64 entry: remove unnecessary event blocking Xu Zhang
2013-04-11  4:46 ` [PATCH V2 5/6] mini-os/x86-64 entry: defer RESTORE_REST until return Xu Zhang
2013-04-11  4:47 ` [PATCH V2 6/6] mini-os/x86-64 entry: check against nested events and try to fix up Xu Zhang
2013-04-21  0:22   ` Samuel Thibault
2013-04-17 15:14 ` [PATCH V2 0/6] mini-os: check and fix up against nested events in x86-64 kernel entry Ian Campbell
2013-04-21  0:22   ` Samuel Thibault
2013-04-22 12:00     ` Ian Campbell
2013-04-22 15:00       ` Xu Zhang
2013-04-22 15:06         ` Ian Campbell

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.