[pve-devel] [PATCH] disable hyper-v enlightement for xvga pci passthrough

Alexandre Derumier aderumier at odiso.com
Mon Feb 16 10:17:56 CET 2015


user report that hyper-v conflict with nvidia drviers

http://forum.proxmox.com/threads/19682-kvm-gpu-passthrough-windows-vm?p=107280#post107280

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 9847254..e57ecf1 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2718,6 +2718,8 @@ sub config_to_command {
 
     push @$devices, '-device', print_tabletdevice_full($conf) if $tablet;
 
+    my $xvga_enabled = undef;
+
     # host pci devices
     for (my $i = 0; $i < $MAX_HOSTPCI_DEVICES; $i++)  {
 	my $d = parse_hostpci($conf->{"hostpci$i"});
@@ -2734,10 +2736,8 @@ sub config_to_command {
 	my $rombar = $d->{rombar} && $d->{rombar} eq 'off' ? ",rombar=0" : "";
 	my $driver = $d->{driver} && $d->{driver} eq 'vfio' ? "vfio-pci" : "pci-assign";
 	my $xvga = $d->{'x-vga'} && $d->{'x-vga'} eq 'on' ? ",x-vga=on" : "";
-	if ($xvga && $xvga ne '') {
-	    push @$cpuFlags, 'kvm=off';
-	    $vga = 'none';
-	}
+
+	$xvga_enabled = 1 if $xvga && $xvga ne '';
 	$driver = "vfio-pci" if $xvga ne '';
 	my $pcidevices = $d->{pciid};
 	my $multifunction = 1 if @$pcidevices > 1;
@@ -2833,6 +2833,11 @@ sub config_to_command {
 	$i++;
     }
 
+    if ($xvga_enabled) {
+	push @$cpuFlags, 'kvm=off';
+	$vga = 'none';
+    }
+
     push @$cmd, '-boot', "menu=on,strict=on,reboot-timeout=1000";
 
     push @$cmd, '-no-acpi' if defined($conf->{acpi}) && $conf->{acpi} == 0;
@@ -2864,11 +2869,11 @@ sub config_to_command {
 	    push @$globalFlags, 'kvm-pit.lost_tick_policy=discard';
 	    push @$cmd, '-no-hpet';
 	    #push @$cpuFlags , 'hv_vapic" if !$nokvm;  #fixme, my win2008R2 hang at boot with this
-	    push @$cpuFlags , 'hv_spinlocks=0xffff' if !$nokvm;
+	    push @$cpuFlags , 'hv_spinlocks=0xffff' if !$nokvm && !$xvga_enabled;
 	}
 
 	if ($ost eq 'win7' || $ost eq 'win8') {
-	    push @$cpuFlags , 'hv_relaxed' if !$nokvm;
+	    push @$cpuFlags , 'hv_relaxed' if !$nokvm && !$xvga_enabled;
 	}
     }
 
-- 
1.7.10.4




More information about the pve-devel mailing list