Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275304
b: refs/heads/master
c: 65c397d
h: refs/heads/master
v: v3
  • Loading branch information
Konstantin Ozerkov authored and Takashi Iwai committed Nov 9, 2011
1 parent fec817c commit f69061a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55c0008be67a27944b6705251d9a8d4c56c67701
refs/heads/master: 65c397d6b58d5e401bee7c24608d3a33a220a63a
30 changes: 19 additions & 11 deletions trunk/sound/pci/intel8x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2937,6 +2937,24 @@ static unsigned int sis_codec_bits[3] = {
ICH_PCR, ICH_SCR, ICH_SIS_TCR
};

static int __devinit snd_intel8x0_inside_vm(void)
{
int result = inside_vm;

if (result < 0) {
/* detect KVM and Parallels virtual environments */
result = kvm_para_available();
#if defined(__i386__) || defined(__x86_64__)
result = result || boot_cpu_has(X86_FEATURE_HYPERVISOR);
#endif
}

if (result)
printk(KERN_INFO "intel8x0: enable KVM optimization\n");

return result;
}

static int __devinit snd_intel8x0_create(struct snd_card *card,
struct pci_dev *pci,
unsigned long device_type,
Expand Down Expand Up @@ -3004,9 +3022,7 @@ static int __devinit snd_intel8x0_create(struct snd_card *card,
if (xbox)
chip->xbox = 1;

chip->inside_vm = inside_vm;
if (inside_vm)
printk(KERN_INFO "intel8x0: enable KVM optimization\n");
chip->inside_vm = snd_intel8x0_inside_vm();

if (pci->vendor == PCI_VENDOR_ID_INTEL &&
pci->device == PCI_DEVICE_ID_INTEL_440MX)
Expand Down Expand Up @@ -3250,14 +3266,6 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
buggy_irq = 0;
}

if (inside_vm < 0) {
/* detect KVM and Parallels virtual environments */
inside_vm = kvm_para_available();
#if defined(__i386__) || defined(__x86_64__)
inside_vm = inside_vm || boot_cpu_has(X86_FEATURE_HYPERVISOR);
#endif
}

if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data,
&chip)) < 0) {
snd_card_free(card);
Expand Down

0 comments on commit f69061a

Please sign in to comment.