Xen 4.3.0 is out. Time to test it for VGA Passthrough.

Download Xen 4.3.0 sources

wget http://bits.xensource.com/oss-xen/release/4.3.0/xen-4.3.0.tar.gz
tar xvzf xen-4.3.0.tar.gz 
cd xen-4.3.0

Configure

CURL=$(which curl-config) XML=$(which xml2-config) ./configure --prefix=/usr

Make a first build for tools and cleanup the folder

  • Make a first build for tools
    cd tools
    make -j4
  • Clean up the folder
    make clean

Download and apply the patches

  • Download and apply the 1st patch. This patch aims at overpassing the 3-4GB of RAM limitation for domU. It helps to have more than 3-4GB of RAM for domU
    cd qemu-xen
    wget "http://marc.info/?l=qemu-devel&m=136177475215360&q=raw" -O - | patch -p1
  • Download and apply the 2nd patch. This patch adds support for ATI Card (VGA passthrough)
    cd ../..
    wget ftp://ftp.enjellic.com/pub/xen/xen-4.2.0.ati-passthrough.patch -O - | patch -p1
  • We have to modify tools/qemu-xen-traditional/hw/pt-graphics.c file so we can run build stubdom
    for i in 0 3;do sed -i "s:^.*iopl(${i});$://iopl(${i});:g" tools/qemu-xen-traditional/hw/pt-graphics.c;done

    NOTICE if this workaround is not apply then you should have this error

    .../stubdom/mini-os-x86_64-ioemu/mini-os.o: In function `ati_hw_out':
    .../stubdom/ioemu/hw/pt-graphics.c:84: undefined reference to `iopl'
    .../stubdom/mini-os-x86_64-ioemu/mini-os.o: In function `ati_hw_in':
    .../stubdom/ioemu/hw/pt-graphics.c:72: undefined reference to `iopl'
    .../stubdom/ioemu/hw/pt-graphics.c:74: undefined reference to `iopl' 

Build and install xen and stubdom

  • Build
    make -j4 xen && make -j4 stubdom
  • Install
    make install-xen && make install-stubdom

Build and install tools

  • Cleanup tools
    cd tools
    make clean
  • Reverse the workaround
    cd ..
    for i in 0 3;do sed -i "s:^.*iopl(${i});$:iopl(${i});:g" tools/qemu-xen-traditional/hw/pt-graphics.c;done
  • Build and install tools
    make -j4 tools
    make install-tools PYTHON_PREFIX_ARG=

Linux script to manage domU (start/stop....)

Download the Linux shell script ftp://ftp.enjellic.com/pub/xen/run-passthrough and updated it to your own needs