/* Version of write_gdt_entry for use at early boot-time needed to update an entry as simply as possible.  */
static __init void xen_write_gdt_entry_boot(struct desc_struct *dt, int entry, const void *desc, int type)
/* Version of write_gdt_entry for use at early boot-time needed to update an entry as simply as possible.  */
static __init void xen_write_gdt_entry_boot(struct desc_struct *dt, int entry, const void *desc, int type)
{
	switch (type) {
	case DESC_LDT:
	case DESC_TSS:
		break;
	default: {
		xmaddr_t maddr = virt_to_machine(&dt[entry]);
		if (HYPERVISOR_update_descriptor(maddr.maddr, *(u64 *)desc))
			dt[entry] = *(struct desc_struct *)desc;
	}
	}
}