public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* %fs PDA & KVM
@ 2007-03-11 12:24 Ingo Molnar
       [not found] ` <20070311122441.GA10774-X9Un+BFzKDI@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2007-03-11 12:24 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel


hm, i just noticed that in vmx_vcpu_run() KVM restores %fs quite late. 

This is a bit awkward under v2.6.21 x86 because there we use %fs for the 
KERNEL_PDA area. Things like 'current' rely on it. So maybe we should 
just do this unconditionally in assembly:

        movl $(__KERNEL_PDA), %edx;
        movl %edx, %fs

it's also a problem with -rt too, which has that whole codepath up to 
the load_fs() call preemptible.

i'm also wondering about this bit:

        kvm_run->exit_type = 0;
        if (fail) {
                kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY;
                kvm_run->exit_reason = vmcs_read32(VM_INSTRUCTION_ERROR);
                kvm_cr3_cache_sync(vcpu);
                r = 0;
        } else {
                if (fs_gs_ldt_reload_needed) {
                        load_ldt(ldt_sel);
                        load_fs(fs_sel);

are you sure we dont need an FS reload in the 'fail' case?

	Ingo

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

end of thread, other threads:[~2007-03-11 22:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-11 12:24 %fs PDA & KVM Ingo Molnar
     [not found] ` <20070311122441.GA10774-X9Un+BFzKDI@public.gmane.org>
2007-03-11 12:38   ` Avi Kivity
     [not found]     ` <45F3F85D.7000509-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-03-11 12:41       ` Ingo Molnar
     [not found]         ` <20070311124146.GA15115-X9Un+BFzKDI@public.gmane.org>
2007-03-11 12:52           ` [patch] KVM: always reload segment selectors Ingo Molnar
     [not found]             ` <20070311125233.GA17328-X9Un+BFzKDI@public.gmane.org>
2007-03-11 13:04               ` Avi Kivity
2007-03-11 22:19   ` %fs PDA & KVM Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox