From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256AbaBSHJc (ORCPT ); Wed, 19 Feb 2014 02:09:32 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49337 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170AbaBSHJa (ORCPT ); Wed, 19 Feb 2014 02:09:30 -0500 Date: Wed, 19 Feb 2014 08:09:29 +0100 Message-ID: From: Takashi Iwai To: "H. Peter Anvin" Cc: Konstantin Ozerkov , "Denis V. Lunev" , Jaroslav Kysela , Linux Kernel Mailing List , alsa-devel@alsa-project.org Subject: Re: snd_intel8x0_inside_vm() In-Reply-To: <5304297B.8050201@zytor.com> References: <5304297B.8050201@zytor.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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