Skip to content

Instantly share code, notes, and snippets.

View CptSpaceToaster's full-sized avatar

CptSpaceToaster

View GitHub Profile

###Context Trying to achieve VGA passthrough to an HVM Windows8.1 pro subdomain (for gaming) on Xen 4.5.0. Currently, the PC has two graphics cards in slots 01:00.0 (Nvidia GTX 970) and 04:00:0 (Radeon HD6870). When the PC first starts, BIOS and beginning Xen chatter show on the Right monitor (which is Nvidia's) and sometime when Xen PCI-back grabs the card, or when the kernel realizes that the Nouveau drivers are blacklisted, the output switches to the Left monitor (Radeon's). Linux then behaves quite nicely.

Distribution: elementaryOS Luna 0.2

toaster@toaster:~$ uname -a
Linux toaster 3.9.11-030911-generic #201307202035 SMP Sun Jul 21 00:35:53 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Motherboard: Gigabyte 990fxaUd3 rev1.1, latest firmware
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.2.0-75-generic (buildd@kissel) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #110-Ubuntu SMP Tue Dec 16 19:11:55 UTC 2014 (Ubuntu 3.2.0-75.110-generic 3.2.64)
[ 0.000000] Command line: root=UUID=e8cdc0ee-e280-4c63-88c2-51aee8514d0b ro console=hvc0 quiet splash $vt_handoff
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls
[ 0.000000] ACPI in unprivileged domain disabled
[ 0.000000] Released 0 pages of unused memory
Xen 4.5.0
(XEN) Xen version 4.5.0 (box@) (gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2) debug=n Tue Jan 20 15:51:52 EST 2015
(XEN) Latest ChangeSet: Mon Jan 12 11:30:05 2015 -0500 git:a8ac229
(XEN) Bootloader: GRUB 2.02~beta2-9ubuntu1
(XEN) Command line: placeholder loglvl=all guest_loglvl=all console_to_ring com1=115200,8n1 console=vga,com1
(XEN) Video information:
(XEN) VGA is text mode 80x25, font 8x16
(XEN) Disc information:
(XEN) Found 1 MBR signatures
(XEN) Found 1 EDD information structures
Xen 4.5.0
(XEN) Xen version 4.5.0 (box@) (gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2) debug=y Wed Jan 21 16:19:13 EST 2015
(XEN) Latest ChangeSet: Mon Jan 12 11:30:05 2015 -0500 git:a8ac229-dirty
(XEN) Bootloader: GRUB 2.02~beta2-9ubuntu1
(XEN) Command line: placeholder loglvl=all guest_loglvl=all console_to_ring com1=115200,8n1 console=vga,com1
(XEN) Video information:
(XEN) VGA is text mode 80x25, font 8x16
(XEN) Disc information:
(XEN) Found 1 MBR signatures
(XEN) Found 1 EDD information structures

###Context I have been trying to achieve VGA passthrough to an HVM Windows8.1 pro subdomain (for gaming) on Xen 4.5.0 (compiled from source). Currently, the PC has two graphics cards in slots 01:00.0 (Nvidia GTX 970) and 04:00:0 (Radeon HD6870). When the PC first starts, BIOS and beginning Xen chatter show on the Right monitor (which is Nvidia's) and sometime when Xen PCI-back grabs the card, or when the kernel realizes that the Nouveau drivers are blacklisted, the output switches to the Left monitor (Radeon's). Linux then behaves quite nicely.

Distribution: elementaryOS Luna 0.2

toaster@toaster:~$ uname -a
Linux toaster 3.18.1 #4 SMP Sun Feb 1 21:33:33 EST 2015 x86_64 x86_64 x86_64 GNU/Linux

Motherboard: Gigabyte 990fxaUd3 rev1.1, latest firmware
IOMMU and Virtualization enabled
$cat pom-default.xml
###############################################################
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.cricketcraft.chisel</groupId>
<artifactId>workspace</artifactId>
<version>2.3.4.5c6a64e</version>
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=40
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Xen 4.5.0 / elementaryOS Luna 0.2 / Linux 3.18.0-031800 / credit scheduler" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'

The Xen kernel boots, but the 3.18.4 linux kernel I compiled isn't happy.

I have a known good 3.18.0 kernel, and I used its config to compile the 3.18.4, however I changed:

CONFIG_XEN_PCIDEV_FRONTEND=m
CONFIG_XEN_PCIDEV_BACKEND=m

to

# $1 = row
# $2 = in
# $3 = out
function wrap_line()
{
if [[ -z $1 ]] ; then
echo Missing Row
return 1
fi
if [[ ! -f $2 ]] ; then