[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4695DCAD.70507@qumranet.com>
Date: Thu, 12 Jul 2007 10:47:57 +0300
From: Avi Kivity <avi@...ranet.com>
To: Rusty Russell <rusty@...tcorp.com.au>
CC: lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
virtualization <virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH] lguest: disable SYSENTER for guests
Rusty Russell wrote:
> The SYSENTER instruction jumps to a pre-programmed address at
> privilege level 0. We must not allow execution of guest code at that
> privilege level, so disable sysenter when we enter the guest (and
> re-enable it on return). This fixes current case where guest
> userspace can crash host.
>
> This save/restore adds 3% to guest context switch times. (If only
> there were some kind of scheduler hook or something which would tell
> us when we were being preempted so we could fix this up lazily. But
> what kind of daredevil coder would propose such a thing?)
>
>
Ah, so this is why you want ->next in preempt hooks. Well, my plan for
this sort of thing (for kvm has the same issues with the *STAR family of
msrs) is to add a new hook on switching from kernel to userspace, and
swap those msrs there. This allows not only the guest1->guest2 case to
be optimized, but also guest->kthread->guest, which is a common pattern
with I/O (and very common with -rt, which runs interrupts in threads).
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists