/* Replacing the cpuid so we can turn features off is great for the kernel, but anyone (including userspace) can just use the raw "cpuid" instruction and the Host won't even notice since it isn't privileged. So we try not to get too worked up about it.  */
static void lguest_cpuid(unsigned int *ax, unsigned int *bx, unsigned int *cx, unsigned int *dx)
/* Replacing the cpuid so we can turn features off is great for the kernel, but anyone (including userspace) can just use the raw "cpuid" instruction and the Host won't even notice since it isn't privileged. So we try not to get too worked up about it.  */
static void lguest_cpuid(unsigned int *ax, unsigned int *bx, unsigned int *cx, unsigned int *dx)
{
	int function = *ax;
	native_cpuid(ax, bx, cx, dx);
	switch (function) {
	case 0:
		if (*ax > 5)
			*ax = 5;
		break;
	case 1:
		*cx &= 0x00002201;
		*dx &= 0x07808151;
		*dx |= 0x00002000;
		*ax &= 0xFFFFF0FF;
		*ax |= 0x00000500;
		break;
	case 0x80000000:
		if (*ax > 0x80000008)
			*ax = 0x80000008;
		break;
	case 0x80000001:
		*dx &= ~(1 << 20);
		break;
	}
}