[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1188324777.5531.73.camel@localhost.localdomain>
Date: Wed, 29 Aug 2007 04:12:57 +1000
From: Rusty Russell <rusty@...tcorp.com.au>
To: Anthony Liguori <aliguori@...ibm.com>
Cc: kvm-devel@...ts.sourceforge.net, Avi Kivity <avi@...ranet.com>,
Ingo Molnar <mingo@...e.hu>, Dor Laor <dor.laor@...ranet.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] Refactor hypercall infrastructure
On Mon, 2007-08-27 at 10:16 -0500, Anthony Liguori wrote:
> This patch refactors the current hypercall infrastructure to better support live
> migration and SMP. It eliminates the hypercall page by trapping the UD
> exception that would occur if you used the wrong hypercall instruction for the
> underlying architecture and replacing it with the right one lazily.
It also reduces the number of hypercall args, which you don't mention
here.
> + er = emulate_instruction(&svm->vcpu, kvm_run, 0, 0);
> +
> + /* we should only succeed here in the case of hypercalls which
> + cannot generate an MMIO event. MMIO means that the emulator
> + is mistakenly allowing an instruction that should generate
> + a UD fault so it's a bug. */
> + BUG_ON(er == EMULATE_DO_MMIO);
This seems... unwise. Firstly we know our emulator is incomplete.
Secondly an SMP guest can exploit this to crash the host.
(Code is in two places).
> +#define KVM_HYPERCALL ".byte 0x0f,0x01,0xc1"
A nice big comment would be nice here, I think. Note that this is big
enough for both "int $0x1f" and "sysenter", so I'm happy.
Cheers,
Rusty.
-
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