[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2020-03-27 Thread phoenixdavidwebb
i am actually having trouble to get my gpu assignable i just dont get the 
pci back working i tried everything now updated grub and efi/xen.cfg with 
everything i found but its not working properly 

On Wednesday, June 22, 2016 at 5:26:50 PM UTC+2, Marcus at WetwareLabs 
wrote:
>
> Hello all,
>
> I've been tinkering with GPU passthrough these couple of weeks and I 
> thought I should now share some of my findings. It's not so much unlike the 
> earlier report on GPU passthrough here (
> https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/cmPRMOkxkdA/gIV68O0-CQAJ
> ).
>
> I started with *Nvidia GTX 980*, but I had no luck with ANY of the Xen 
> hypervisors or Qubes versions. Please see my other thread for more 
> information (
> https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/PuZLWxhTgM0/pWe7LXI-AgAJ
> ).
>
> However after I switched to *Radeon 6950*, I've had success with all the 
> Xen versions. So I guess it's a thing with Nvidia driver initialization. On 
> a side note, someone should really test this with Nvidia Quadros that are 
> officially supported to be used in VMs. (And of course, there are the hacks 
> to convert older Geforces to Quadros..)
>
> Anyway, here's a quick and most likely incomplete list (for most users) 
> for getting GPU passthrough working on Win 8.1 VM. (works identically on 
> Win7)
>
> Enclosed are the VM configuration file and HCL file for information about 
> my hardware setup (feel free to add this to HW compatibility list!)
>
> TUTORIAL
>
>
>- *Check which PCI addresses correspond to your GPU (and optionally, 
>USB host) with lspci.*
>
> Here's mine:
> ...
> # lspci
> 
> 03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] 
> Cayman XT [Radeon HD 6970]
> 03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cayman/
> Antilles HDMI Audio [Radeon HD 6900 Series]
>
> Note that you have to pass both of these devices if you have similar GPU 
> with dual functionality.
>
>
>- *Edit /etc/default/grub and add following options *(change the pci 
>address if needed*):*
>
> GRUB_CMDLINE_LINUX=" rd.qubes.hide_pci=03:00.0,03:00.1 
> modprobe=xen-pciback.passthrough=1 xen-pciback.permissive"
> GRUB_CMDLINE_XEN_DEFAULT="... dom0_mem=min:1024M dom0_mem=max:4096M"
>
>
> For extra logging:
> GRUB_CMDLINE_XEN_DEFAULT="... apic_verbosity=debug loglvl=all 
> guest_loglvl=all iommu=verbose"
>
>
> There are many other options available, but I didn't see any difference in 
> success rate. See here:
> http://xenbits.xen.org/docs/unstable/misc/xen-command-line.html
> http://wiki.xenproject.org/wiki/Xen_PCI_Passthrough
> http://wiki.xenproject.org/wiki/XenVGAPassthrough
>
>
>- *Update grub:*
>
> # grub2-mkconfig -o /boot/grub2/grub.cfg
>
>
>- *Reboot. Check that VT-t is enabled:*
>
> # xl dmesg
> ...
> (XEN) Intel VT-d iommu 0 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d iommu 1 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d Snoop Control not enabled.
> (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.
> (XEN) Intel VT-d Queued Invalidation enabled.
> (XEN) Intel VT-d Interrupt Remapping enabled.
> (XEN) Intel VT-d Shared EPT tables enabled.
> (XEN) I/O virtualisation enabled
> (XEN)  - Dom0 mode: Relaxed
>
>
>- *Check that pci devices are available to be passed:*
>
> # xl pci-assignable list
> :03:00.0
> :03:00.1
>
>
>- *Create disk images:*
>
> # dd if=/dev/zero of=win8.img bs=1M count=3
> # dd if=/dev/zero of=win8-user.img bs=1M count=3
>
>
>- *Install VNC server into Dom0*
>
> # qubes-dom0-update vnc
>
>
>- *Modify the win8.hvm:*
>
>
>-  Check that the disk images and Windows installation CDROM image are 
>   correct, and that the IP address does not conflict with any other VM (I 
>   haven't figured out yet how to set up dhcp)
>   -  Check that 'pci = [  ]' is commented for now
>
>
>- *Start the VM ( -V option runs automatically VNC client)*
>
> # xl create win8.hvm -V
>
>
> If you happen to close the client (but VM is still running), start it 
> again with
> # xl vncviewer win8
>
> Note that I had success starting the VM only as root. Also killing the VM 
> with 'xl destroy win8' would leave the qemu process lingering if not done 
> as root (if that occurs, you have to kill that process manually)
>
>- *Install Windows*
>- *Partition the user image using 'Disk Manager'*
>- *Download signed paravirtualized drivers here* (Qubes PV drivers 
>work only in Win 7):
>
>
> http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x64_signed_0.11.0.373.msi
> Don't mind the name, it works on Win 8.1 as well.
> For more info: 
> http://wiki.univention.com/index.php?title=Installing-signed-GPLPV-drivers
>
>
>- *Move the drivers inside user image partition* (shut down VM first):
>
> # losetup   (Check for free loop device)
> # losetup -P /dev/loop10 win8-user.img   (Setup loop 

[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2018-02-13 Thread lemondezurich
On Wednesday, June 22, 2016 at 8:26:50 AM UTC-7, Marcus at WetwareLabs wrote:
> Hello all,
> 
> I've been tinkering with GPU passthrough these couple of weeks and I thought 
> I should now share some of my findings. It's not so much unlike the earlier 
> report on GPU passthrough here 
> (https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/cmPRMOkxkdA/gIV68O0-CQAJ).
> 
> I started with Nvidia GTX 980, but I had no luck with ANY of the Xen 
> hypervisors or Qubes versions. Please see my other thread for more 
> information 
> (https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/PuZLWxhTgM0/pWe7LXI-AgAJ).
> 
> However after I switched to Radeon 6950, I've had success with all the Xen 
> versions. So I guess it's a thing with Nvidia driver initialization. On a 
> side note, someone should really test this with Nvidia Quadros that are 
> officially supported to be used in VMs. (And of course, there are the hacks 
> to convert older Geforces to Quadros..)
> 
> Anyway, here's a quick and most likely incomplete list (for most users) for 
> getting GPU passthrough working on Win 8.1 VM. (works identically on Win7)
> 
> Enclosed are the VM configuration file and HCL file for information about my 
> hardware setup (feel free to add this to HW compatibility list!)
> 
> TUTORIAL
> 
> Check which PCI addresses correspond to your GPU (and optionally, USB host) 
> with lspci.Here's mine:
> ...
> 
> 
> # lspci
> 
> 03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] 
> Cayman XT [Radeon HD 6970]
> 03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cayman/Antilles 
> HDMI Audio [Radeon HD 6900 Series]
> Note that you have to pass both of these devices if you have similar GPU with 
> dual functionality.
> 
> Edit /etc/default/grub and add following options (change the pci address if 
> needed):
> 
> GRUB_CMDLINE_LINUX=" rd.qubes.hide_pci=03:00.0,03:00.1 
> modprobe=xen-pciback.passthrough=1 xen-pciback.permissive"
> GRUB_CMDLINE_XEN_DEFAULT="... dom0_mem=min:1024M dom0_mem=max:4096M"
> 
> For extra logging:
> 
> 
> GRUB_CMDLINE_XEN_DEFAULT="... apic_verbosity=debug loglvl=all 
> guest_loglvl=all iommu=verbose"
> 
> There are many other options available, but I didn't see any difference in 
> success rate. See here:
> http://xenbits.xen.org/docs/unstable/misc/xen-command-line.html
> http://wiki.xenproject.org/wiki/Xen_PCI_Passthrough
> http://wiki.xenproject.org/wiki/XenVGAPassthrough
> 
> Update grub:
> 
> # grub2-mkconfig -o /boot/grub2/grub.cfg
> Reboot. Check that VT-t is enabled:
> 
> # xl dmesg
> ...
> (XEN) Intel VT-d iommu 0 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d iommu 1 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d Snoop Control not enabled.
> (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.
> (XEN) Intel VT-d Queued Invalidation enabled.
> (XEN) Intel VT-d Interrupt Remapping enabled.
> (XEN) Intel VT-d Shared EPT tables enabled.
> (XEN) I/O virtualisation enabled
> (XEN)  - Dom0 mode: Relaxed
> Check that pci devices are available to be passed:
> 
> # xl pci-assignable list
> :03:00.0
> :03:00.1
> Create disk images:
> 
> # dd if=/dev/zero of=win8.img bs=1M count=3
> # dd if=/dev/zero of=win8-user.img bs=1M count=3
> Install VNC server into Dom0
> 
> # qubes-dom0-update vnc
> Modify the win8.hvm: Check that the disk images and Windows installation 
> CDROM image are correct, and that the IP address does not conflict with any 
> other VM (I haven't figured out yet how to set up dhcp) Check that 'pci = [ 
>  ]' is commented for nowStart the VM ( -V option runs automatically VNC 
> client)
> 
> # xl create win8.hvm -V
> 
> If you happen to close the client (but VM is still running), start it again 
> with
> 
> 
> # xl vncviewer win8
> Note that I had success starting the VM only as root. Also killing the VM 
> with 'xl destroy win8' would leave the qemu process lingering if not done as 
> root (if that occurs, you have to kill that process manually)
> Install WindowsPartition the user image using 'Disk Manager'Download signed 
> paravirtualized drivers here (Qubes PV drivers work only in Win 
> 7):http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x64_signed_0.11.0.373.msi
> Don't mind the name, it works on Win 8.1 as well.
> For more info: 
> http://wiki.univention.com/index.php?title=Installing-signed-GPLPV-drivers
> 
> Move the drivers inside user image partition (shut down VM first):
> 
> # losetup   (Check for free loop device)
> # losetup -P /dev/loop10 win8-user.img   (Setup loop device and scan 
> partition. Assuming loop10 is free)
> # mount /dev/loop10p1 /mnt/removable  ( Mount the first partition )- copy the 
> driver there and unmount.
> 
> Reboot VM, install paravirtual drivers and reboot againCreate this script 
> inside sys-firewall (check that the sys-net vm ip address 10.137.1.1 is 
> correct though):
> 
> fwcfg.sh:
> #!/bin/bash
>    

[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2017-04-08 Thread squared . beta
Did anyone have any luck with GPU passthrough in gaming laptops with discrete 
GPU and iGPU?

W dniu środa, 22 czerwca 2016 17:26:50 UTC+2 użytkownik Marcus at WetwareLabs 
napisał:
> Hello all,
> 
> I've been tinkering with GPU passthrough these couple of weeks and I thought 
> I should now share some of my findings. It's not so much unlike the earlier 
> report on GPU passthrough here 
> (https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/cmPRMOkxkdA/gIV68O0-CQAJ).
> 
> I started with Nvidia GTX 980, but I had no luck with ANY of the Xen 
> hypervisors or Qubes versions. Please see my other thread for more 
> information 
> (https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/PuZLWxhTgM0/pWe7LXI-AgAJ).
> 
> However after I switched to Radeon 6950, I've had success with all the Xen 
> versions. So I guess it's a thing with Nvidia driver initialization. On a 
> side note, someone should really test this with Nvidia Quadros that are 
> officially supported to be used in VMs. (And of course, there are the hacks 
> to convert older Geforces to Quadros..)
> 
> Anyway, here's a quick and most likely incomplete list (for most users) for 
> getting GPU passthrough working on Win 8.1 VM. (works identically on Win7)
> 
> Enclosed are the VM configuration file and HCL file for information about my 
> hardware setup (feel free to add this to HW compatibility list!)
> 
> TUTORIAL
> 
> Check which PCI addresses correspond to your GPU (and optionally, USB host) 
> with lspci.Here's mine:
> ...
> 
> 
> # lspci
> 
> 03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] 
> Cayman XT [Radeon HD 6970]
> 03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cayman/Antilles 
> HDMI Audio [Radeon HD 6900 Series]
> Note that you have to pass both of these devices if you have similar GPU with 
> dual functionality.
> 
> Edit /etc/default/grub and add following options (change the pci address if 
> needed):
> 
> GRUB_CMDLINE_LINUX=" rd.qubes.hide_pci=03:00.0,03:00.1 
> modprobe=xen-pciback.passthrough=1 xen-pciback.permissive"
> GRUB_CMDLINE_XEN_DEFAULT="... dom0_mem=min:1024M dom0_mem=max:4096M"
> 
> For extra logging:
> 
> 
> GRUB_CMDLINE_XEN_DEFAULT="... apic_verbosity=debug loglvl=all 
> guest_loglvl=all iommu=verbose"
> 
> There are many other options available, but I didn't see any difference in 
> success rate. See here:
> http://xenbits.xen.org/docs/unstable/misc/xen-command-line.html
> http://wiki.xenproject.org/wiki/Xen_PCI_Passthrough
> http://wiki.xenproject.org/wiki/XenVGAPassthrough
> 
> Update grub:
> 
> # grub2-mkconfig -o /boot/grub2/grub.cfg
> Reboot. Check that VT-t is enabled:
> 
> # xl dmesg
> ...
> (XEN) Intel VT-d iommu 0 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d iommu 1 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d Snoop Control not enabled.
> (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.
> (XEN) Intel VT-d Queued Invalidation enabled.
> (XEN) Intel VT-d Interrupt Remapping enabled.
> (XEN) Intel VT-d Shared EPT tables enabled.
> (XEN) I/O virtualisation enabled
> (XEN)  - Dom0 mode: Relaxed
> Check that pci devices are available to be passed:
> 
> # xl pci-assignable list
> :03:00.0
> :03:00.1
> Create disk images:
> 
> # dd if=/dev/zero of=win8.img bs=1M count=3
> # dd if=/dev/zero of=win8-user.img bs=1M count=3
> Install VNC server into Dom0
> 
> # qubes-dom0-update vnc
> Modify the win8.hvm: Check that the disk images and Windows installation 
> CDROM image are correct, and that the IP address does not conflict with any 
> other VM (I haven't figured out yet how to set up dhcp) Check that 'pci = [ 
>  ]' is commented for nowStart the VM ( -V option runs automatically VNC 
> client)
> 
> # xl create win8.hvm -V
> 
> If you happen to close the client (but VM is still running), start it again 
> with
> 
> 
> # xl vncviewer win8
> Note that I had success starting the VM only as root. Also killing the VM 
> with 'xl destroy win8' would leave the qemu process lingering if not done as 
> root (if that occurs, you have to kill that process manually)
> Install WindowsPartition the user image using 'Disk Manager'Download signed 
> paravirtualized drivers here (Qubes PV drivers work only in Win 
> 7):http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x64_signed_0.11.0.373.msi
> Don't mind the name, it works on Win 8.1 as well.
> For more info: 
> http://wiki.univention.com/index.php?title=Installing-signed-GPLPV-drivers
> 
> Move the drivers inside user image partition (shut down VM first):
> 
> # losetup   (Check for free loop device)
> # losetup -P /dev/loop10 win8-user.img   (Setup loop device and scan 
> partition. Assuming loop10 is free)
> # mount /dev/loop10p1 /mnt/removable  ( Mount the first partition )- copy the 
> driver there and unmount.
> 
> Reboot VM, install paravirtual drivers and reboot againCreate this script 
> inside sys-firewall (check 

[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-12-18 Thread celaaerab
Le mercredi 22 juin 2016 11:26:50 UTC-4, Marcus at WetwareLabs a écrit :
> Hello all,
> 
> I've been tinkering with GPU passthrough these couple of weeks and I thought 
> I should now share some of my findings. It's not so much unlike the earlier 
> report on GPU passthrough here 
> (https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/cmPRMOkxkdA/gIV68O0-CQAJ).
> 
> I started with Nvidia GTX 980, but I had no luck with ANY of the Xen 
> hypervisors or Qubes versions. Please see my other thread for more 
> information 
> (https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/PuZLWxhTgM0/pWe7LXI-AgAJ).
> 
> However after I switched to Radeon 6950, I've had success with all the Xen 
> versions. So I guess it's a thing with Nvidia driver initialization. On a 
> side note, someone should really test this with Nvidia Quadros that are 
> officially supported to be used in VMs. (And of course, there are the hacks 
> to convert older Geforces to Quadros..)
> 
> Anyway, here's a quick and most likely incomplete list (for most users) for 
> getting GPU passthrough working on Win 8.1 VM. (works identically on Win7)
> 
> Enclosed are the VM configuration file and HCL file for information about my 
> hardware setup (feel free to add this to HW compatibility list!)
> 
> TUTORIAL
> 
> Check which PCI addresses correspond to your GPU (and optionally, USB host) 
> with lspci.Here's mine:
> ...
> 
> 
> # lspci
> 
> 03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] 
> Cayman XT [Radeon HD 6970]
> 03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cayman/Antilles 
> HDMI Audio [Radeon HD 6900 Series]
> Note that you have to pass both of these devices if you have similar GPU with 
> dual functionality.
> 
> Edit /etc/default/grub and add following options (change the pci address if 
> needed):
> 
> GRUB_CMDLINE_LINUX=" rd.qubes.hide_pci=03:00.0,03:00.1 
> modprobe=xen-pciback.passthrough=1 xen-pciback.permissive"
> GRUB_CMDLINE_XEN_DEFAULT="... dom0_mem=min:1024M dom0_mem=max:4096M"
> 
> For extra logging:
> 
> 
> GRUB_CMDLINE_XEN_DEFAULT="... apic_verbosity=debug loglvl=all 
> guest_loglvl=all iommu=verbose"
> 
> There are many other options available, but I didn't see any difference in 
> success rate. See here:
> http://xenbits.xen.org/docs/unstable/misc/xen-command-line.html
> http://wiki.xenproject.org/wiki/Xen_PCI_Passthrough
> http://wiki.xenproject.org/wiki/XenVGAPassthrough
> 
> Update grub:
> 
> # grub2-mkconfig -o /boot/grub2/grub.cfg
> Reboot. Check that VT-t is enabled:
> 
> # xl dmesg
> ...
> (XEN) Intel VT-d iommu 0 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d iommu 1 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d Snoop Control not enabled.
> (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.
> (XEN) Intel VT-d Queued Invalidation enabled.
> (XEN) Intel VT-d Interrupt Remapping enabled.
> (XEN) Intel VT-d Shared EPT tables enabled.
> (XEN) I/O virtualisation enabled
> (XEN)  - Dom0 mode: Relaxed
> Check that pci devices are available to be passed:
> 
> # xl pci-assignable list
> :03:00.0
> :03:00.1
> Create disk images:
> 
> # dd if=/dev/zero of=win8.img bs=1M count=3
> # dd if=/dev/zero of=win8-user.img bs=1M count=3
> Install VNC server into Dom0
> 
> # qubes-dom0-update vnc
> Modify the win8.hvm: Check that the disk images and Windows installation 
> CDROM image are correct, and that the IP address does not conflict with any 
> other VM (I haven't figured out yet how to set up dhcp) Check that 'pci = [ 
>  ]' is commented for nowStart the VM ( -V option runs automatically VNC 
> client)
> 
> # xl create win8.hvm -V
> 
> If you happen to close the client (but VM is still running), start it again 
> with
> 
> 
> # xl vncviewer win8
> Note that I had success starting the VM only as root. Also killing the VM 
> with 'xl destroy win8' would leave the qemu process lingering if not done as 
> root (if that occurs, you have to kill that process manually)
> Install WindowsPartition the user image using 'Disk Manager'Download signed 
> paravirtualized drivers here (Qubes PV drivers work only in Win 
> 7):http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x64_signed_0.11.0.373.msi
> Don't mind the name, it works on Win 8.1 as well.
> For more info: 
> http://wiki.univention.com/index.php?title=Installing-signed-GPLPV-drivers
> 
> Move the drivers inside user image partition (shut down VM first):
> 
> # losetup   (Check for free loop device)
> # losetup -P /dev/loop10 win8-user.img   (Setup loop device and scan 
> partition. Assuming loop10 is free)
> # mount /dev/loop10p1 /mnt/removable  ( Mount the first partition )- copy the 
> driver there and unmount.
> 
> Reboot VM, install paravirtual drivers and reboot againCreate this script 
> inside sys-firewall (check that the sys-net vm ip address 10.137.1.1 is 
> correct though):
> 
> fwcfg.sh:
> #!/bin/bash
>    vmip=$1
> 

Re: [qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-11-24 Thread Jean-Philippe Ouellet
On Thu, Nov 24, 2016 at 8:51 AM, Marek Marczykowski-Górecki
 wrote:
> Actually, generic PCI passthrough should just work in both cases now.
> Don't know if GPU passthrough is any special here, but I wouldn't be
> surprised if it is...

At least for intel-integrated stuff I can confirm that it definitely is.

The relevant drivers poke at pci config space registers of other pci
devices besides only the GPU, and expect them to be the actual hw with
the intended physical-world side-effects, not qemu.

It is currently making my effort to get hardware accelerated graphics
in non-dom0 difficult :(

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/CABQWM_CezYfMDQOVAbuJ-Ouj-16EWNin78DtMju4G2WR2U03YA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-11-24 Thread Marek Marczykowski-Górecki
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On Thu, Nov 24, 2016 at 11:08:33AM -0800, Grzesiek Chodzicki wrote:
> W dniu czwartek, 24 listopada 2016 14:51:14 UTC+1 użytkownik Marek 
> Marczykowski-Górecki napisał:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA256
> > 
> > On Wed, Nov 23, 2016 at 10:48:23PM -0800, tom...@gmail.com wrote:
> > > So, after Marek's fix here, 
> > > https://github.com/QubesOS/qubes-issues/issues/1659
> > > is it true that I can expect this from it:
> > > - HVM passthrough working using stub domain via xl ?
> > >   (following your guide above, exlcuding 'qemu-xen-traditional')
> > > And not:
> > > - HVM passthrough working via VM created with Qubes manager and started 
> > > with it / qvm-start ?
> > 
> > Actually, generic PCI passthrough should just work in both cases now.
> > Don't know if GPU passthrough is any special here, but I wouldn't be
> > surprised if it is...
> > 
> 
> I've tried passing through a USB controller to my windows hvm. Despite 
> setting the pci_strictreset to false, qvm-start still fails with 
> libvirt.libvirtError: internal error: libxenlight failed to create new domain 
> 'windows-7'

Do you have VT-d (aka IOMMU) supported and enabled? You can check for
details in /var/log/libvirt/libxl/libxl-driver.log.

- -- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJYN25VAAoJENuP0xzK19csxxAH/R2x4FXcoikNcZqj2LycK35n
G3+zJe5c84HreQVTRi4f512IsOc0oyenDxqXPJ8Y3Bud/Fyk6LObFRU8qCpFe/U4
s/8KSQ8H94eI3bPQ5dyrLJSY8KkgPDbwIkeNJaFUxxjWpAPfbZLKr6ibmkO3ivD+
brvD87vS14oZQQ0ffoUQ14AI+jAK6Jx+f4WKz8zmi3G3ZTVAhjr4cbHyI039mZ0u
K9um9tN94a2TK5xUfT6+ciRWLicRYgxd8szgjXQIlcT51rud/E/EVlQbUrBXBrYp
QZv6zWXGykZfzRRzq400aXOdXDFxL62J8ZgywYcOPCxiSbmdMEy24VhXMTHa4Io=
=WZz9
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/20161124224851.GA1145%40mail-itl.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-11-24 Thread Grzesiek Chodzicki
W dniu czwartek, 24 listopada 2016 14:51:14 UTC+1 użytkownik Marek 
Marczykowski-Górecki napisał:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
> 
> On Wed, Nov 23, 2016 at 10:48:23PM -0800, tom...@gmail.com wrote:
> > So, after Marek's fix here, 
> > https://github.com/QubesOS/qubes-issues/issues/1659
> > is it true that I can expect this from it:
> > - HVM passthrough working using stub domain via xl ?
> >   (following your guide above, exlcuding 'qemu-xen-traditional')
> > And not:
> > - HVM passthrough working via VM created with Qubes manager and started 
> > with it / qvm-start ?
> 
> Actually, generic PCI passthrough should just work in both cases now.
> Don't know if GPU passthrough is any special here, but I wouldn't be
> surprised if it is...
> 
> - -- 
> Best Regards,
> Marek Marczykowski-Górecki
> Invisible Things Lab
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v2
> 
> iQEcBAEBCAAGBQJYNvBNAAoJENuP0xzK19csycgH/jSvl5JNBfFzSAyj2BFB4WsD
> Ig6+VUNBSKCXdL4wEl2RTIE4EylU3/0hjEIaw1mSRLAx4NLRmmZVOUAq51rMMlBz
> /RXQIzggOzcqdyUXa4Hi185SZg3SJeVV04Lm9YBTV4hQ5i7AKw0+Sn3/PBaoui2D
> 9A0HPUGV9c+bMvUWc0yp26podxVoicz0v7en3WAOvJVhoDare9ioLRQKhQ7inNrY
> Kp7/1S/WAMF4c2tbThrfFjAN/ou87UWyKhhWTzDBa+crC8t/75lHpQp8sS6Ec1tU
> 51t3eiGPKWEghlvHY2sCwQRAKtZjkqSGxu73RCxPYDZ1nuUf/yw7hsmC1uRwUNQ=
> =ViLz
> -END PGP SIGNATURE-

I've tried passing through a USB controller to my windows hvm. Despite setting 
the pci_strictreset to false, qvm-start still fails with libvirt.libvirtError: 
internal error: libxenlight failed to create new domain 'windows-7'

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/1c6e9df6-332b-4f8f-955b-09772dce2ca5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-11-24 Thread Marek Marczykowski-Górecki
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On Wed, Nov 23, 2016 at 10:48:23PM -0800, tom...@gmail.com wrote:
> So, after Marek's fix here, 
> https://github.com/QubesOS/qubes-issues/issues/1659
> is it true that I can expect this from it:
> - HVM passthrough working using stub domain via xl ?
>   (following your guide above, exlcuding 'qemu-xen-traditional')
> And not:
> - HVM passthrough working via VM created with Qubes manager and started with 
> it / qvm-start ?

Actually, generic PCI passthrough should just work in both cases now.
Don't know if GPU passthrough is any special here, but I wouldn't be
surprised if it is...

- -- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJYNvBNAAoJENuP0xzK19csycgH/jSvl5JNBfFzSAyj2BFB4WsD
Ig6+VUNBSKCXdL4wEl2RTIE4EylU3/0hjEIaw1mSRLAx4NLRmmZVOUAq51rMMlBz
/RXQIzggOzcqdyUXa4Hi185SZg3SJeVV04Lm9YBTV4hQ5i7AKw0+Sn3/PBaoui2D
9A0HPUGV9c+bMvUWc0yp26podxVoicz0v7en3WAOvJVhoDare9ioLRQKhQ7inNrY
Kp7/1S/WAMF4c2tbThrfFjAN/ou87UWyKhhWTzDBa+crC8t/75lHpQp8sS6Ec1tU
51t3eiGPKWEghlvHY2sCwQRAKtZjkqSGxu73RCxPYDZ1nuUf/yw7hsmC1uRwUNQ=
=ViLz
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/20161124135107.GT1145%40mail-itl.
For more options, visit https://groups.google.com/d/optout.


[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-11-23 Thread tomhet
So, after Marek's fix here, https://github.com/QubesOS/qubes-issues/issues/1659
is it true that I can expect this from it:
- HVM passthrough working using stub domain via xl ?
  (following your guide above, exlcuding 'qemu-xen-traditional')
And not:
- HVM passthrough working via VM created with Qubes manager and started with it 
/ qvm-start ?

regards,
  tom



-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/26ac8cbc-1490-4df6-80ec-1e48d7008c40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-09-27 Thread emergencymexican
On Wednesday, June 22, 2016 at 8:26:50 AM UTC-7, Marcus at WetwareLabs wrote:
> Hello all,
> 
> I've been tinkering with GPU passthrough these couple of weeks and I thought 
> I should now share some of my findings. It's not so much unlike the earlier 
> report on GPU passthrough here 
> (https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/cmPRMOkxkdA/gIV68O0-CQAJ).
> 
> I started with Nvidia GTX 980, but I had no luck with ANY of the Xen 
> hypervisors or Qubes versions. Please see my other thread for more 
> information 
> (https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/PuZLWxhTgM0/pWe7LXI-AgAJ).
> 
> However after I switched to Radeon 6950, I've had success with all the Xen 
> versions. So I guess it's a thing with Nvidia driver initialization. On a 
> side note, someone should really test this with Nvidia Quadros that are 
> officially supported to be used in VMs. (And of course, there are the hacks 
> to convert older Geforces to Quadros..)
> 
> Anyway, here's a quick and most likely incomplete list (for most users) for 
> getting GPU passthrough working on Win 8.1 VM. (works identically on Win7)
> 
> Enclosed are the VM configuration file and HCL file for information about my 
> hardware setup (feel free to add this to HW compatibility list!)
> 
> TUTORIAL
> 
> Check which PCI addresses correspond to your GPU (and optionally, USB host) 
> with lspci.Here's mine:
> ...
> 
> 
> # lspci
> 
> 03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] 
> Cayman XT [Radeon HD 6970]
> 03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cayman/Antilles 
> HDMI Audio [Radeon HD 6900 Series]
> Note that you have to pass both of these devices if you have similar GPU with 
> dual functionality.
> 
> Edit /etc/default/grub and add following options (change the pci address if 
> needed):
> 
> GRUB_CMDLINE_LINUX=" rd.qubes.hide_pci=03:00.0,03:00.1 
> modprobe=xen-pciback.passthrough=1 xen-pciback.permissive"
> GRUB_CMDLINE_XEN_DEFAULT="... dom0_mem=min:1024M dom0_mem=max:4096M"
> 
> For extra logging:
> 
> 
> GRUB_CMDLINE_XEN_DEFAULT="... apic_verbosity=debug loglvl=all 
> guest_loglvl=all iommu=verbose"
> 
> There are many other options available, but I didn't see any difference in 
> success rate. See here:
> http://xenbits.xen.org/docs/unstable/misc/xen-command-line.html
> http://wiki.xenproject.org/wiki/Xen_PCI_Passthrough
> http://wiki.xenproject.org/wiki/XenVGAPassthrough
> 
> Update grub:
> 
> # grub2-mkconfig -o /boot/grub2/grub.cfg
> Reboot. Check that VT-t is enabled:
> 
> # xl dmesg
> ...
> (XEN) Intel VT-d iommu 0 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d iommu 1 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d Snoop Control not enabled.
> (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.
> (XEN) Intel VT-d Queued Invalidation enabled.
> (XEN) Intel VT-d Interrupt Remapping enabled.
> (XEN) Intel VT-d Shared EPT tables enabled.
> (XEN) I/O virtualisation enabled
> (XEN)  - Dom0 mode: Relaxed
> Check that pci devices are available to be passed:
> 
> # xl pci-assignable list
> :03:00.0
> :03:00.1
> Create disk images:
> 
> # dd if=/dev/zero of=win8.img bs=1M count=3
> # dd if=/dev/zero of=win8-user.img bs=1M count=3
> Install VNC server into Dom0
> 
> # qubes-dom0-update vnc
> Modify the win8.hvm: Check that the disk images and Windows installation 
> CDROM image are correct, and that the IP address does not conflict with any 
> other VM (I haven't figured out yet how to set up dhcp) Check that 'pci = [ 
>  ]' is commented for nowStart the VM ( -V option runs automatically VNC 
> client)
> 
> # xl create win8.hvm -V
> 
> If you happen to close the client (but VM is still running), start it again 
> with
> 
> 
> # xl vncviewer win8
> Note that I had success starting the VM only as root. Also killing the VM 
> with 'xl destroy win8' would leave the qemu process lingering if not done as 
> root (if that occurs, you have to kill that process manually)
> Install WindowsPartition the user image using 'Disk Manager'Download signed 
> paravirtualized drivers here (Qubes PV drivers work only in Win 
> 7):http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x64_signed_0.11.0.373.msi
> Don't mind the name, it works on Win 8.1 as well.
> For more info: 
> http://wiki.univention.com/index.php?title=Installing-signed-GPLPV-drivers
> 
> Move the drivers inside user image partition (shut down VM first):
> 
> # losetup   (Check for free loop device)
> # losetup -P /dev/loop10 win8-user.img   (Setup loop device and scan 
> partition. Assuming loop10 is free)
> # mount /dev/loop10p1 /mnt/removable  ( Mount the first partition )- copy the 
> driver there and unmount.
> 
> Reboot VM, install paravirtual drivers and reboot againCreate this script 
> inside sys-firewall (check that the sys-net vm ip address 10.137.1.1 is 
> correct though):
> 
> fwcfg.sh:
> #!/bin/bash
>    

[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-08-04 Thread Marcus at WetwareLabs
On Monday, August 1, 2016 at 10:24:32 PM UTC+3, tom...@gmail.com wrote:
> Hi Marcus,
> 
> I'm bit confused with this
> > Edit /etc/default/grub and add following options (change the pci address if 
> > needed)
> 
> Which version of Qubes is this? Aint 3.1 EFI-only?
> And EFI version of kernel args are to be passed via /boot/efi/EFI/qubes 
> (kernel=)?
> 
> regards,
>   Tom

Hi Tom, 

I use 3.1 and 3.2 rc2. Actually I haven't thought about this before. It seems 
on my system the default state is 'BIOS compatibilty mode' even though it's a 
new motherboard which is running on UEFI firmware. As for the partition table 
type on my SDD, it has always been 'dos' type MBR and that was never converted 
to GPT by Qubes Installer. 

I'm not familiar how to configure EFI type bootloader, but it seems editing  
/boot/efi/EFI/qubes/xen.cfg should work. There's lots of discussion about it 
here: https://github.com/QubesOS/qubes-issues/issues/794

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/b5d085b6-8517-4cc7-9da3-4c2fb8c54eac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-08-01 Thread tomhet
Hi Marcus,

I'm bit confused with this
> Edit /etc/default/grub and add following options (change the pci address if 
> needed)

Which version of Qubes is this? Aint 3.1 EFI-only?
And EFI version of kernel args are to be passed via /boot/efi/EFI/qubes 
(kernel=)?

regards,
  Tom

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/65d87e1b-218a-4cd3-b354-aa85f29d70a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-07-17 Thread voxlympha
On Friday, July 15, 2016 at 6:47:59 AM UTC+10, Marcus at WetwareLabs wrote:
> Some more experimentation with GTX980:
> 
> - Tried Core2Duo CPUID from KVM VM
> - Ported NoSnoop patch from KVM
> 
> Sadly, neither of these would help with BSODs / Code 43 errors.
> 
> I posted the results (with patches and more detailed information) on 
> Xen-devel 
> (https://lists.xenproject.org/archives/html/xen-devel/2016-07/msg01713.html). 
> I hope the experts there might have more suggestions.

I'm guessing that it has to do with the nvidia-specific quirks implemented 
where the PCI BAR's are used to access the PCI Config Space and other BAR's. 
See: https://github.com/qemu/qemu/blob/master/hw/vfio/pci-quirks.c

I think before others worked around it somewhat by reserving the memory and 
having 1:1 mappings ( 
http://www.davidgis.fr/blog/index.php?2011/12/07/860-xen-42unstable-patches-for-vga-pass-through
 ), but that isn't really a proper solution.

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/f0648096-35e1-444a-a276-f0c55379b875%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-07-14 Thread Marcus at WetwareLabs
Some more experimentation with GTX980:

- Tried Core2Duo CPUID from KVM VM
- Ported NoSnoop patch from KVM

Sadly, neither of these would help with BSODs / Code 43 errors.

I posted the results (with patches and more detailed information) on Xen-devel 
(https://lists.xenproject.org/archives/html/xen-devel/2016-07/msg01713.html). I 
hope the experts there might have more suggestions.

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/4d7096ea-a92f-4ba8-aaa3-e3ad40ddb82d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-07-09 Thread Marcus at WetwareLabs
On Saturday, July 9, 2016 at 5:57:42 PM UTC+3, Marcus at WetwareLabs wrote:
> Here's the patch.

Forgot to add that if spoofing is turned on for an already-installed Windows 
VM, there was a BSOD during boot (Windows really doesn't like if hypervisor 
suddenly disappears..). Re-installing Windows (with spoofing on) fixes this 
(maybe fixing installation with rescue CD could work also, but I did not test 
that).

 

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/df99a045-e0b4-41c7-9791-c30debdbfd29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-07-09 Thread Marcus at WetwareLabs
Here's the patch.

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/5a936f01-adc6-4f25-af00-ebeed9a9bb7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff -ur -x .cproject -x .project -x '*.swp' xen-4.6.1/tools/firmware/hvmloader/hvmloader.c xen-4.6.1-new/tools/firmware/hvmloader/hvmloader.c
--- xen-4.6.1/tools/firmware/hvmloader/hvmloader.c	2016-02-09 16:44:19.0 +0200
+++ xen-4.6.1-new/tools/firmware/hvmloader/hvmloader.c	2016-07-04 23:31:32.81500 +0300
@@ -127,9 +127,11 @@
 
 if ( !strcmp("XenVMMXenVMM", signature) )
 break;
+if ( !strcmp("ZenZenZenZen", signature) )
+break;
 }
 
-BUG_ON(strcmp("XenVMMXenVMM", signature) || ((eax - base) < 2));
+BUG_ON( (strcmp("XenVMMXenVMM", signature) && strcmp("ZenZenZenZen", signature) ) || ((eax - base) < 2));
 
 /* Fill in hypercall transfer pages. */
 cpuid(base + 2, , , , );
diff -ur -x .cproject -x .project -x '*.swp' xen-4.6.1/tools/libxl/libxl_create.c xen-4.6.1-new/tools/libxl/libxl_create.c
--- xen-4.6.1/tools/libxl/libxl_create.c	2016-07-09 16:47:05.18100 +0300
+++ xen-4.6.1-new/tools/libxl/libxl_create.c	2016-07-04 23:49:54.80200 +0300
@@ -284,6 +284,8 @@
 libxl_defbool_setdefault(_info->u.hvm.acpi_s4,true);
 libxl_defbool_setdefault(_info->u.hvm.nx, true);
 libxl_defbool_setdefault(_info->u.hvm.viridian,   false);
+libxl_defbool_setdefault(_info->u.hvm.spoof_viridian, false);
+libxl_defbool_setdefault(_info->u.hvm.spoof_xen,  false);
 libxl_defbool_setdefault(_info->u.hvm.hpet,   true);
 libxl_defbool_setdefault(_info->u.hvm.vpt_align,  true);
 libxl_defbool_setdefault(_info->u.hvm.nested_hvm, false);
@@ -1263,6 +1265,11 @@
 libxl__device_console_add(gc, domid, , state, );
 libxl__device_console_dispose();
 
+LOG(DEBUG, "wetware - checking spoofing for guest (domid %d): xen %d, vir %d", domid,
+	 libxl_defbool_val(d_config->b_info.u.hvm.spoof_xen),
+	 libxl_defbool_val(d_config->b_info.u.hvm.spoof_viridian)
+ );
+
 dcs->dmss.dm.guest_domid = domid;
 if (libxl_defbool_val(d_config->b_info.device_model_stubdomain))
 libxl__spawn_stub_dm(egc, >dmss);
diff -ur -x .cproject -x .project -x '*.swp' xen-4.6.1/tools/libxl/libxl_dom.c xen-4.6.1-new/tools/libxl/libxl_dom.c
--- xen-4.6.1/tools/libxl/libxl_dom.c	2016-07-09 16:47:05.21200 +0300
+++ xen-4.6.1-new/tools/libxl/libxl_dom.c	2016-07-04 23:31:32.81900 +0300
@@ -287,6 +287,10 @@
 libxl_defbool_val(info->u.hvm.nested_hvm));
 xc_hvm_param_set(handle, domid, HVM_PARAM_ALTP2M,
 libxl_defbool_val(info->u.hvm.altp2m));
+xc_hvm_param_set(handle, domid, HVM_PARAM_SPOOF_XEN,
+libxl_defbool_val(info->u.hvm.spoof_xen));
+xc_hvm_param_set(handle, domid, HVM_PARAM_SPOOF_VIRIDIAN,
+libxl_defbool_val(info->u.hvm.spoof_viridian));
 }
 
 int libxl__build_pre(libxl__gc *gc, uint32_t domid,
diff -ur -x .cproject -x .project -x '*.swp' xen-4.6.1/tools/libxl/libxl_types.idl xen-4.6.1-new/tools/libxl/libxl_types.idl
--- xen-4.6.1/tools/libxl/libxl_types.idl	2016-02-09 16:44:19.0 +0200
+++ xen-4.6.1-new/tools/libxl/libxl_types.idl	2016-07-09 16:31:16.18100 +0300
@@ -468,6 +468,8 @@
("viridian", libxl_defbool),
("viridian_enable",  libxl_bitmap),
("viridian_disable", libxl_bitmap),
+   ("spoof_viridian",   libxl_defbool),
+   ("spoof_xen",libxl_defbool),
("timeoffset",   string),
("hpet", libxl_defbool),
("vpt_align",libxl_defbool),
diff -ur -x .cproject -x .project -x '*.swp' xen-4.6.1/tools/libxl/xl_cmdimpl.c xen-4.6.1-new/tools/libxl/xl_cmdimpl.c
--- xen-4.6.1/tools/libxl/xl_cmdimpl.c	2016-07-09 16:47:05.02700 +0300
+++ xen-4.6.1-new/tools/libxl/xl_cmdimpl.c	2016-07-04 23:32:38.04600 +0300
@@ -1507,6 +1507,10 @@
 xlu_cfg_get_defbool(config, "hpet", _info->u.hvm.hpet, 0);
 xlu_cfg_get_defbool(config, "vpt_align", _info->u.hvm.vpt_align, 0);
 
+xlu_cfg_get_defbool(config, "spoof_xen", _info->u.hvm.spoof_xen, 0);
+xlu_cfg_get_defbool(config, "spoof_viridian", 

[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-07-09 Thread Marcus at WetwareLabs
I've continued experimenting with GTX 980 passthrough with Arch Linux. I 
noticed that the xf86-video-nouveau does NOT in fact have Maxwell support. One 
would think otherwise looking at their Feature Matrix here: 
https://nouveau.freedesktop.org/wiki/FeatureMatrix/
NV110 is the Maxwell family (GTX 980 including). But the mode-setting driver 
can be used instead, so *I finally got GTX 980 PT working in Arch Linux*:

Add this file to  /etc/X11/xorg.conf.d/20-nouveau.conf
```
Section "Device"
  Identifier "NVidia Card"
  Driver "modesetting"
  BusID "PCI:0:5:0"
EndSection
```

Note that the PCI address is the address that the GPU has inside the VM (use 
lspci IN the vm to find out that).  Also "pci_msitranslate=0" has to be set in 
VM configuration, otherwise VM will hang when X is started.

This is tested with Arch linux (up to date 8.7.2016), with Linux 4.6.3-1-ARCH, 
modesetting and X versions 1.18.3.

-

Ok, now that it's proven that newer Nvidia cards CAN in fact be passed through 
in Xen, I tried the official NVidia binary driver, but it failed with error 
message "The NVIDIA GPU at PCI:0:5:0 is not supported by the 367.27 NVIDIA 
driver".

I think that's the proprietary driver refusing to work when it detects that 
it's running under hypervisor (the Code 43 issue in Windows). Since KVM has for 
a while supported hiding both the "KVMKVMKVMKVM" signature (with "-cpu kvm=off" 
flag) as well as the Viridian hypervisor signature ("-cpu hv_vendor_id="..." 
flag), and currently there's no such functionality in Xen, I patched  it in 
quite similar way to what Alex Willimson did to KVM.

Attached is a patch for Xen 4.6.1 that spoofs Xen signature ("XenVMMXenVMM" to 
"ZenZenZenZen") and Viridian signature ("Microsoft Hv" to "Wetware Labs") when 
"spoof_xen=1" and "spoof_viridian=1" are added VM configuration file.

The signatures are currently hard-coded, and currently there's no way to modify 
them (beyond re-compiling Xen), since HVMLoader also uses a hard-coded string 
to detect Xen and there's no API (understandably) to change that signature in 
real-time.

WARNING! In case you try the patch, you MUST re-compile and install also 
core-libvirt (in addition to vmm-xen) packages. Otherwise starting all DomUs 
will fail! You have been warned :)

-

With this patch, the *NVidia binary driver (version 367.27) works also on Arch 
Linux* :)

However this was not enough on Windows 7 and 8.1 VMs (driver version 368.39) 
still announce Error 43 :(

I would love if others could test this as well. Maybe the Windows driver uses 
some other functionality to check for hypervisor, or maybe it's not a spoofing 
issue at all.

More investigation coming in..




-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/716e4cc4-548e-4cb0-8f75-82894cd29eef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-06-26 Thread Marcus at WetwareLabs


On Wednesday, June 22, 2016 at 6:26:50 PM UTC+3, Marcus at WetwareLabs 
wrote:
>
> Hello all,
>
> I've been tinkering with GPU passthrough these couple of weeks and I 
> thought I should now share some of my findings. It's not so much unlike the 
> earlier report on GPU passthrough here (
> https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/cmPRMOkxkdA/gIV68O0-CQAJ
> ).
>
> I started with *Nvidia GTX 980*, but I had no luck with ANY of the Xen 
> hypervisors or Qubes versions. Please see my other thread for more 
> information (
> https://groups.google.com/forum/#!searchin/qubes-users/passthrough/qubes-users/PuZLWxhTgM0/pWe7LXI-AgAJ
> ).
>
> However after I switched to *Radeon 6950*, I've had success with all the 
> Xen versions. So I guess it's a thing with Nvidia driver initialization. On 
> a side note, someone should really test this with Nvidia Quadros that are 
> officially supported to be used in VMs. (And of course, there are the hacks 
> to convert older Geforces to Quadros..)
>
> Anyway, here's a quick and most likely incomplete list (for most users) 
> for getting GPU passthrough working on Win 8.1 VM. (works identically on 
> Win7)
>
> Enclosed are the VM configuration file and HCL file for information about 
> my hardware setup (feel free to add this to HW compatibility list!)
>
> TUTORIAL
>
>
>- *Check which PCI addresses correspond to your GPU (and optionally, 
>USB host) with lspci.*
>
> Here's mine:
> ...
> # lspci
> 
> 03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] 
> Cayman XT [Radeon HD 6970]
> 03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cayman/
> Antilles HDMI Audio [Radeon HD 6900 Series]
>
> Note that you have to pass both of these devices if you have similar GPU 
> with dual functionality.
>
>
>- *Edit /etc/default/grub and add following options *(change the pci 
>address if needed*):*
>
> GRUB_CMDLINE_LINUX=" rd.qubes.hide_pci=03:00.0,03:00.1 
> modprobe=xen-pciback.passthrough=1 xen-pciback.permissive"
> GRUB_CMDLINE_XEN_DEFAULT="... dom0_mem=min:1024M dom0_mem=max:4096M"
>
>
> For extra logging:
> GRUB_CMDLINE_XEN_DEFAULT="... apic_verbosity=debug loglvl=all 
> guest_loglvl=all iommu=verbose"
>
>
> There are many other options available, but I didn't see any difference in 
> success rate. See here:
> http://xenbits.xen.org/docs/unstable/misc/xen-command-line.html
> http://wiki.xenproject.org/wiki/Xen_PCI_Passthrough
> http://wiki.xenproject.org/wiki/XenVGAPassthrough
>
>
>- *Update grub:*
>
> # grub2-mkconfig -o /boot/grub2/grub.cfg
>
>
>- *Reboot. Check that VT-t is enabled:*
>
> # xl dmesg
> ...
> (XEN) Intel VT-d iommu 0 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d iommu 1 supported page sizes: 4kB, 2MB, 1GB.
> (XEN) Intel VT-d Snoop Control not enabled.
> (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.
> (XEN) Intel VT-d Queued Invalidation enabled.
> (XEN) Intel VT-d Interrupt Remapping enabled.
> (XEN) Intel VT-d Shared EPT tables enabled.
> (XEN) I/O virtualisation enabled
> (XEN)  - Dom0 mode: Relaxed
>
>
>- *Check that pci devices are available to be passed:*
>
> # xl pci-assignable list
> :03:00.0
> :03:00.1
>
>
>- *Create disk images:*
>
> # dd if=/dev/zero of=win8.img bs=1M count=3
> # dd if=/dev/zero of=win8-user.img bs=1M count=3
>
>
>- *Install VNC server into Dom0*
>
> # qubes-dom0-update vnc
>
>
>- *Modify the win8.hvm:*
>
>
>-  Check that the disk images and Windows installation CDROM image are 
>   correct, and that the IP address does not conflict with any other VM (I 
>   haven't figured out yet how to set up dhcp)
>   -  Check that 'pci = [  ]' is commented for now
>
>
>- *Start the VM ( -V option runs automatically VNC client)*
>
> # xl create win8.hvm -V
>
>
> If you happen to close the client (but VM is still running), start it 
> again with
> # xl vncviewer win8
>
> Note that I had success starting the VM only as root. Also killing the VM 
> with 'xl destroy win8' would leave the qemu process lingering if not done 
> as root (if that occurs, you have to kill that process manually)
>
>- *Install Windows*
>- *Partition the user image using 'Disk Manager'*
>- *Download signed paravirtualized drivers here* (Qubes PV drivers 
>work only in Win 7):
>
>
> http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x64_signed_0.11.0.373.msi
> Don't mind the name, it works on Win 8.1 as well.
> For more info: 
> http://wiki.univention.com/index.php?title=Installing-signed-GPLPV-drivers
>
>
>- *Move the drivers inside user image partition* (shut down VM first):
>
> # losetup   (Check for free loop device)
> # losetup -P /dev/loop10 win8-user.img   (Setup loop device and scan 
> partition. Assuming loop10 is free)
> # mount /dev/loop10p1 /mnt/removable  ( Mount the first partition )
> - copy the driver there and unmount.
>
>
>- *Reboot VM, install 

Re: [qubes-users] Re: SUCCESS: GPU passthrough on Qubes 3.1 (Xen 4.6.1) / Radeon 6950 / Win 7 & Win 8.1 (TUTORIAL + HCL)

2016-06-23 Thread Marek Marczykowski-Górecki
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On Thu, Jun 23, 2016 at 12:07:29PM -0700, 
'01938'019384'091843'091843'09183'04918'029348'019 wrote:
> Hello,
> 
> wow cool. 
> 
> 
> Would this mean, I can in some way (extra manual work) use the full GPU power 
> in a WindowsVM or a LinuxVM, without security issues for the hole QubesOS 
> System?
> (Or should I first use this setup on a separate machine or some Qubes-Qubes 
> Dual boot machine).

I haven't reviewed the instruction details, but it most likely involve
running qemu process in dom0, which is a huge security drawback for the
whole system.

- -- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJXbDXdAAoJENuP0xzK19csZJkH/0eH6sttRaGVL5FWbPrWkEN8
BrhB/9WA6fI/c0pVkNAQI0uzZwRlL+yQuKzI6Epi08kQXgO8AK/sUnc8C5l8u+jX
0Gv0fDwG9vEAsmMfCBkAnPun509JUjMonKgxE5KBb4mrz+3/KlLjj40+djRSDxRg
vr5U96EMeqDfLr7ikx1CMUSTGAAypQFXE7YyGKW+q9z/6mO3ya7bM7DVZhZEzBy7
vbK4Kau27ycpGCgWZ/T7ftQsrLbxC2O6fHHdl9AEeRBWPtiMfKktRa3QfoHwF7wc
xWDliQy7bQ3ieAd7n+lfbXd0Nxtu/Kv3UwQVJXOLSYrmc9/YkzMafAzR6rQPd6A=
=m+57
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/20160623191749.GN1593%40mail-itl.
For more options, visit https://groups.google.com/d/optout.