[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <s5hwqgry3x2.wl%tiwai@suse.de>
Date: Wed, 19 Feb 2014 08:09:29 +0100
From: Takashi Iwai <tiwai@...e.de>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Konstantin Ozerkov <kozerkov@...allels.com>,
"Denis V. Lunev" <den@...nvz.org>,
Jaroslav Kysela <perex@...ex.cz>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
alsa-devel@...a-project.org
Subject: Re: snd_intel8x0_inside_vm()
At Tue, 18 Feb 2014 19:48:11 -0800,
H. Peter Anvin wrote:
>
> I just stumbled upon the function snd_intel8x0_inside_vm(), and quite
> frankly the code seems bizarre:
>
> /* detect KVM and Parallels virtual environments */
> result = kvm_para_available();
> #ifdef X86_FEATURE_HYPERVISOR
> result = result || boot_cpu_has(X86_FEATURE_HYPERVISOR);
> #endif
> if (!result)
> goto fini;
>
> Why don't we simply rely on the PCI SSIDs?
The original code checking kvm_para_available() and boot_cpu_has() was
supposed to work for also VirtualBox and VMware. The PCI SSID checks
have been introduced later, and looking at the code again, this might
have broken VirtualBox and VMware workaround. Hmm.
Besides that, the kvm_para_available() and boot_cpu_has() checks are
still left for avoiding unnecessary kernel message (enable/disable VM
workaround) on non-VM kernels.
Takashi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists