Re: A clocksource driver for HyperV

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 05, 2010 at 02:36:59PM -0700, Jeremy Fitzhardinge wrote:
> >+static struct dmi_system_id __initconst
> >+hv_timesource_dmi_table[] __maybe_unused  = {
> >+	{
> >+		.ident = "Hyper-V",
> >+		.matches = {
> >+			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
> >+			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
> >+			DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
> >+		},
> >+	},
> >+	{ },
> >+};
> >+MODULE_DEVICE_TABLE(dmi, hv_timesource_dmi_table);
> 
> So you use the DMI signatures to determine whether the module is
> needed, but cpuid to work out if the feature is present?

The DMI and PCI stuff is to handle module autoloading.  Ideally we would
just use the DMI matching, but some distro installers can't handle that,
so we also add the PCI stuff.  The hyperv core already has this in it.

> >+
> >+static struct pci_device_id __initconst
> >+hv_timesource_pci_table[] __maybe_unused = {
> >+	{ PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */
> >+	{ 0 }
> >+};
> >+MODULE_DEVICE_TABLE(pci, hv_timesource_pci_table);
> 
> And/or PCI?
> 
> Seems a bit... ad-hoc?  Is this the official way to determine the
> presence of Hyper-V?

Yeah, it is :(

thanks,

greg k-h
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux