[Lguest] [PATCH 4/5] lguest: use KVM hypercalls

Simon Holm Thøgersen odie at cs.aau.dk
Fri Apr 3 08:55:24 EST 2009


fre, 27 03 2009 kl. 10:22 +1030, skrev Rusty Russell:
> From: Matias Zabaljauregui <zabaljauregui at gmail.com>
> 
> Impact: cleanup
> 
> This patch allow us to use KVM hypercalls

Something has broken in relation to this change. I'm not sure it is this
change itself or one following, but I get the following error when using
lguest:

lguest: unhandled trap 6 at 0x418726 (0x0)

> +static bool is_hypercall(struct lg_cpu *cpu)
> +{
> +	u8 insn[3];
> +
> +	/* This must be the Guest kernel trying to do something.
> +	 * The bottom two bits of the CS segment register are the privilege
> +	 * level. */
> +	if ((cpu->regs->cs & 3) != GUEST_PL)
> +		return false;
> +
> +	/* Is it a vmcall? */
> +	__lgread(cpu, insn, guest_pa(cpu, cpu->regs->eip), sizeof(insn));

I've put a printk for insn here that shows up twice. The first time insn
holds the values below, and the second time it holds the values that are
patched in by rewrite_hypercall.

> +	return insn[0] == 0x0f && insn[1] == 0x01 && insn[2] == 0xc1;
> +}

I'll investigate further tomorrow, unless someone is already on top of
this. My kernel is 2.6.29-07100-g833bb30 btw.


Simon Holm Thøgersen




More information about the Lguest mailing list