/* Now our patch routine is fairly simple (based on the native one in paravirt.c). If we have a replacement, we copy it in and return how much of the available space we used.  */
static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf, unsigned long addr, unsigned len)
/* Now our patch routine is fairly simple (based on the native one in paravirt.c). If we have a replacement, we copy it in and return how much of the available space we used.  */
static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf, unsigned long addr, unsigned len)
{
	unsigned int insn_len;
	if (type >= ARRAY_SIZE(lguest_insns) || !lguest_insns[type].start)
		return paravirt_patch_default(type, clobber, ibuf, addr, len);
	insn_len = lguest_insns[type].end - lguest_insns[type].start;
	if (len < insn_len)
		return paravirt_patch_default(type, clobber, ibuf, addr, len);
	memcpy(ibuf, lguest_insns[type].start, insn_len);
	return insn_len;
}