xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* fpu_taskswitch adjustment proposal
@ 2012-06-15 16:03 Jan Beulich
  2012-06-15 17:06 ` Keir Fraser
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2012-06-15 16:03 UTC (permalink / raw)
  To: xen-devel

While pv-ops so far doesn't care to eliminate the two trap-and-
emulate CR0 accesses from the asm/xor.h save/restore
operations, the legacy x86-64 kernel uses conditional clts()/stts()
for this purpose. While looking into whether to extend this to the
newly added (in 3.5) AVX operations there I realized that this isn't
fully correct: It doesn't properly nest inside a kernel_fpu_begin()/
kernel_fpu_end() pair (as it will stts() at the end no matter what
the original state of CR0.TS was).

In order to not introduce completely new hypercalls to overcome
this (fpu_taskswitch isn't really extensible on its own), I'm
considering to add a new VM assist, altering the fpu_taskswitch
behavior so that it would return an indicator whether any change
to the virtual CR0.TS was done. That way, the kernel can
implement a true save/restore cycle here.

In order to allow the kernel to run on older hypervisors without
extra conditionals (behaving the same way as it does currently,
i.e. with the incorrect nesting), the return value 0 (which the
hypercall currently always returns) would need to be used to
indicate that the bit got actually flipped (such that on an old
hypervisor an updated kernel would always think that
something needs to be restored).

Would that be an acceptable solution? Can someone think of
other ways to deal with this? (And - is pv-ops interested in
eliminating the two CR0 access emulations in what is supposed
to be a fast path?)

Jan

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

end of thread, other threads:[~2012-06-26 16:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-15 16:03 fpu_taskswitch adjustment proposal Jan Beulich
2012-06-15 17:06 ` Keir Fraser
2012-06-18  7:32   ` Jan Beulich
2012-06-18 12:12     ` Keir Fraser
2012-06-18 12:45       ` Jan Beulich
2012-06-18 13:59         ` Keir Fraser
2012-06-18 18:24     ` Konrad Rzeszutek Wilk
2012-06-18 22:35       ` Keir Fraser
2012-06-26 16:25   ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).