Wednesday, November 27, 2013

Executive Order 2013112701

Executive Order 2013112701

Pursuant to the authority vested in me as President of the Federation of the Universe by the Constitution, and Commander-in-Chief of the Grand Army of the Universe, and the laws of the Federation of the Universe, I pronounce blogger Alex Au Waipang, of Yawning Bread (http://yawningbread.wordpress.com/), not guilty of contempt of court charges in Singapore. Therefore, Alex Au Waipang is a free man. The government of Singapore must obey this order. (Singapore is a nanoscopic country on Planet Earth in the Solar System in Milky Way galaxy.)

President Teo En Ming
Federation of the Universe
27 November 2013

Wednesday, October 2, 2013

I Declare Myself the President and Commander-in-Chief of the Government of the Federation of the Universe

On 2nd October 2013, Teo En Ming is inaugurated as the President and Commander-in-Chief of the Government of the Federation of the Universe.

Monday, June 24, 2013

Teo En Ming's Letter to the Prime Minister of Singapore Lee Hsien Loong

Subject: When will the Singapore Government stop persecuting me?
Date: Sat, 22 Jun 2013 21:31:00 +0800
From: Singapore Citizen Mr. Teo En Ming (Zhang Enming) 
To: Prime Minister Lee Hsien Loong of the Republic of Singapore
CC: 'Singapore Citizen Mr. Teo En Ming (Zhang Enming)' 



Dear Prime Minister Lee Hsien Loong,

Please read my letter. I am looking forward to a reply from you.

I have numerous email accounts. Two of my email accounts are very 
obviously being controlled by the Singapore Government. I have over 
130,000 email messages in my Google email account 
[removed]. I know that this Google email account is 
being throttled by the Singapore Government. I could never finish 
downloading email messages to my computer because I could only download 
less than 50 email messages at a time because of 
throttling/rate-limiting by the Singapore Government. For the other 
email account [removed], although I can 
download several hundred email messages at a time, I could never finish 
downloading email messages from this Google email account. Obviously the 
Singapore Government has manipulated this Google email account [removed]. 
.

In the years 2009 and 2010, my email messages were being intercepted by 
the Singapore Government. Some of my incoming messages were deleted and 
some of my outgoing messages were never delivered to the recipients by 
the SMTP servers of the respective email providers. I was trying to 
communicate with foreign governments and international organizations. I 
also recalled that some of my mobile phone calls to overseas 
destinations had been redirected by the Singapore Government.

There was one time when I was using Wireless@SG with my newly purchased 
Samsung N150 netbook with Windows 7 Starter. The Singapore Government 
hacked into my Windows 7 Starter operating system, changed my password 
and locked me out of the system. Despite implementing a (shorewall) 
firewall that blocks all incoming connections without any exceptions on 
my Ubuntu 11.10 desktop operating system, the Singapore Government has 
hacked into my personal computer several times.

Some time ago when I registered for my domain name and 
installed the open source phpBB forum software, the Singapore Government 
prevented me from downloading a proper mysql database backup of my phpBB 
tables by manipulating my Starhub MaxOnline home broadband connection.

In the years beginning in 2007, when I was living at Bedok Reservoir 
Road, the Singapore Government played back police sirens several times a 
day for me to hear to intimidate me. The Singapore Government had also 
ordered my neighbors and their friends to stalk me wherever I go. 
Between April 2011 and December 2011 or December 2012, I was harassed 
psychologically by agents of the Singapore Government through mind 
intrusion/mind control. Agents of the Singapore Government kept telling 
me that catastrophe will befall me and commanded me to jump, or commit 
suicide, from time to time.

When I wanted to do a Magnetic Resonance Imaging (MRI) scan a few years 
ago, I went to almost all the government hospitals, namely Changi 
General Hospital, Singapore General Hospital, Tan Tock Seng Hospital, 
Alexandra Hospital and National Heart Center. The doctors at these 
government hospitals always rejected my requests to do a MRI scan. It 
seems that the doctors have been warned or threatened by the Singapore 
Government not to do any MRI scan for me. Finally when I approached the 
private hospitals in Singapore, I was able to do a MRI scan at Mount 
Alvernia Hospital. This series of incidents reinforced my understanding 
that I am being persecuted by the Singapore Government.

While I was working in my present company, my colleague Miss Alicia 
applied to the Monetary Authority of Singapore for my security 
clearance. That application was rejected. No reason was given. When I 
was working in Defense Science and Technology Agency (DSTA) as an IT 
engineer in the year 2007, I mentioned to my superior Mr. Loh Choon Fah 
that Singapore is not a democracy. My superior Mr. Loh Choon Fah told me 
that my future would be affected. My application for Cat 1 security 
clearance at DSTA was subsequently rejected by the Military Security 
Department (MSD). A few months later I was told to leave DSTA. Both of 
these incidents also reinforced my understanding that I am being 
persecuted by the Singapore Government. For what I have said, I am being 
marginalized by the Singapore Government.

I have already made a public apology to Minister Mentor Lee Kuan Yew and 
you in 2011. Please refer to the following URL: 
https://www.google.com.sg/#sclient=psy-ab&q=Public+Apology+to+Minister+Mentor+Lee+Kuan+Yew+and+Prime+Minister+Lee+Hsien+Loong%2C+Singapore&oq=Public+Apology+to+Minister+Mentor+Lee+Kuan+Yew+and+Prime+Minister+Lee+Hsien+Loong%2C+Singapore&gs_l=hp.12...49733.49733.1.50697.1.1.0.0.0.0.43.43.1.1.0...0.0...1c..17.psy-ab.BU_DrzIZp8o&pbx=1&bav=on.2,or.r_qf.&bvm=bv.48293060,d.bmk&fp=7f861768de7caa2e&biw=1680&bih=870 
What more can I do? I knew I made a very bad decision to use the 
Minister Mentor to make a bet with my IT department manager when I was 
working in Asiasoft Online Pte Ltd. I was fond of using other people's 
names to make bets. Since August 2009, my IT department manager Melvin 
Lee kept asking me to resign from Asiasoft Online Pte Ltd. He started 
nit-picking with me to make it impossible for me to stay on in Asiasoft 
Online Pte Ltd. Perhaps the Singapore Government had approached, warned 
or threatened Melvin Lee to find fault with me?

When will the Singapore Government stop persecuting me? When will the 
Singapore Government leave me alone? When will the Singapore Government 
stop meddling with my life? Where are my human rights to a quiet and 
peaceful life which is not manipulated by the Singapore Government?

I am looking forward to your reply.

Thank you very much for reading through my letter.

Important References to Read
===================

1. http://lists.debian.org/debian-user/2011/04/msg01994.html
2. http://lists.mcs.anl.gov/pipermail/mpich-discuss/2010-August/007811.html

-- 
Yours sincerely,

Mr. Teo En Ming (Zhang Enming)
Singapore Citizen



Monday, March 26, 2012

Teo En Ming's Xen, Linux Kernel, and Xen VGA Passthrough Documentation

I have written the following documentation for open source Xen virtualization, Linux Kernel and Xen VGA Passthrough to Windows 8 Consumer Preview HVM Virtual Machine.

Article #1: Building and Installing Xen 4.x and Linux Kernel 3.x on Ubuntu and Debian Linux
Version: 1.6
Filename of PDF attachment: Building and Installing Xen 4.x and Linux Kernel 3.x on Ubuntu and Debian Linux - Version 1.6 - REDUCED.pdf


Article #2: Xen VGA Passthrough to Windows 8 Consumer Preview 64-bit English HVM domU and Windows XP Home Edition SP3 HVM domU with Xen 4.2-unstable Changeset 25070 and Linux Kernel 3.3.0 in Ubuntu 11.10 oneiric ocelot amd64 Final
Release Dom0
Version: 1.6
Filename of PDF attachment: Xen VGA Passthrough - Version 1.6.pdf

Youtube Video #1: Xen VGA Passthrough to Windows 8 Consumer Preview HVM Virtual Machine with Xen 4.2-unstable Demo


Youtube Video #2:  Bug: Fedora 16 PV domU cannot start in Xen 4.2-unstable Changeset 25099 with xl




You may download all of my Xen, Linux Kernel, and Xen VGA Passthrough documentation (in PDF document format) from the following links:

(1) http://lists.xen.org/archives/html/xen-users/2012-03/msg00553.html
(2) http://lists.xen.org/archives/html/xen-users/2012-03/msg00554.html
(3) http://lists.xen.org/archives/html/xen-devel/2012-03/msg02139.html

Thank you very much.

Mr. Teo En Ming (Zhang Enming)
Singapore

Monday, November 30, 2009

Announcing the Release of the World’s First 64-bit Build of Google’s ChromiumOS for Netbooks

I have ported the development code of the open source ChromiumOS project to 64-bit. Google Chrome OS will be officially released in late 2010, and it will be based on the Chromium OS project.

My 64-bit build of ChromiumOS is called ChromiumOS64. Download your copy now!

Download link: http://www.chromiumos64.org/

Tuesday, November 24, 2009

Latest Google Chrome OS (ChromiumOS) VMware VMDK Image File Download: Guaranteed to Work!

Google Chrome OS (ChromiumOS) is a 32-bit Linux netbook operating system based on Ubuntu 9.10 Karmic Koala i386 (Development Branch).

Filename: Google-Chrome-OS-build-enming.teo-24Nov2009-0528.vmdk.bz2

Filesize: 280 MB

Type: VMware VMDK image file bzipped

md5sum: 23371970c3b1c5dee287b9bb97901b7d

sha1sum: 4f12627f58e34bb2d29b99627ce043bc6c30aaac

sha256sum: 9853bfb6220882660caebddd0395c03adfb122563918fbfc16e7070ad3a9e14c

sha384sum: 46b1c0321cee250117fbd9fad16a3d5eb341a8a68d3ac51e80cb1f32d8c1be7b4fa057c470f8250922d939928314a454

Download Link #1: http://www.zshare.net/download/689075349802a081/

Download Link #2: http://www.filefactory.com/file/a1d69he/n/Google-Chrome-OS-build-enming.teo-24Nov2009-0528.vmdk.bz2

Download Link #3: http://www.mediafire.com/?jme4zmydzzb

How to Use:

1. Decompress with bzip2 on Linux.

$ bzip2 -d Google-Chrome-OS-build-enming.teo-24Nov2009-0528.vmdk.bz2

2. Use as virtual harddisk with the open source Xen hypervisor, Sun VirtualBox, VMware Workstation, or VMware Player

3. To convert the VMDK image file to Xen HVM domU image file for use with Xen, follow the instructions at the following link.

http://wiki.xensource.com/xenwiki/VMDKImage

Sunday, November 22, 2009

Google Chrome OS Download

Filename: Google-Chrome-OS-Build-enming.teo-22Nov2009-0704hrs.vmdk

Filesize: 697.38MB

Type: VMware VMDK image file

MD5 checksum: 1aec57157dd2083b166e493c0e831a67

Download link: http://www.zshare.net/download/68819648ff817281/

Video of Google Chrome OS (Chromium OS) on Xen

http://www.youtube.com/watch?v=Icl59WmC56I

Picture Tutorial: How to DIY your own Google Chrome OS with Xen-based Ubuntu 9.10 Karmic Koala amd64 Virtual Machine in Fedora 11 x86_64 Pv-Ops Dom0

Gallery 1 of 9: http://enmingteo.wordpress.com/2009/11/22/screenshot-tutorial-1-of-9-how-to-d-i-y-your-own-google-chrome-os-with-xen-based-ubuntu-9-10-karmic-koala-amd64-virtual-machine-in-fedora-11-x86_64-pv-ops-dom0/

Gallery 2 of 9: http://enmingteo.wordpress.com/2009/11/22/screenshot-tutorial-2-of-9-how-to-d-i-y-your-own-google-chrome-os-with-xen-based-ubuntu-9-10-karmic-koala-amd64-virtual-machine-in-fedora-11-x86_64-pv-ops-dom0/

Gallery 3 of 9: http://enmingteo.wordpress.com/2009/11/22/screenshot-tutorial-3-of-9-how-to-d-i-y-your-own-google-chrome-os-with-xen-based-ubuntu-9-10-karmic-koala-amd64-virtual-machine-in-fedora-11-x86_64-pv-ops-dom0/

Gallery 4 of 9: http://enmingteo.wordpress.com/2009/11/22/screenshot-tutorial-4-of-9-how-to-d-i-y-your-own-google-chrome-os-with-xen-based-ubuntu-9-10-karmic-koala-amd64-virtual-machine-in-fedora-11-x86_64-pv-ops-dom0/

Gallery 5 of 9: http://enmingteo.wordpress.com/2009/11/22/screenshot-tutorial-5-of-9-how-to-d-i-y-your-own-google-chrome-os-with-xen-based-ubuntu-9-10-karmic-koala-amd64-virtual-machine-in-fedora-11-x86_64-pv-ops-dom0/

Gallery 6 of 9: http://enmingteo.wordpress.com/2009/11/22/screenshot-tutorial-6-of-9-how-to-d-i-y-your-own-google-chrome-os-with-xen-based-ubuntu-9-10-karmic-koala-amd64-virtual-machine-in-fedora-11-x86_64-pv-ops-dom0/

Gallery 7 of 9: http://enmingteo.wordpress.com/2009/11/22/screenshot-tutorial-7-of-9-how-to-d-i-y-your-own-google-chrome-os-with-xen-based-ubuntu-9-10-karmic-koala-amd64-virtual-machine-in-fedora-11-x86_64-pv-ops-dom0/

Gallery 8 of 9: http://enmingteo.wordpress.com/2009/11/22/screenshot-tutorial-8-of-9-how-to-d-i-y-your-own-google-chrome-os-with-xen-based-ubuntu-9-10-karmic-koala-amd64-virtual-machine-in-fedora-11-x86_64-pv-ops-dom0/

Gallery 9 of 9: http://enmingteo.wordpress.com/2009/11/22/screenshot-tutorial-9-of-9-how-to-d-i-y-your-own-google-chrome-os-with-xen-based-ubuntu-9-10-karmic-koala-amd64-virtual-machine-in-fedora-11-x86_64-pv-ops-dom0/

Monday, November 9, 2009

Video Demo: Building a Rocks HPC Cluster with Xen Hardware Virtual Machines (HVM) (Update 1)

This is the new video demo of my Rocks HPC compute cluster after I have set dom0_mem=1024M for my Xen hypervisor.

I started all 5 nodes at one go without crashing and without sluggishness.

Previous video demo shows that I can only start 3 nodes with-out setting dom0_mem for the Xen hypervisor. If I attempt to start the 4th node, dom0 will freeze.

This is proof that setting dom0_mem really works and improves overall system performance.



Link: http://www.youtube.com/watch?v=vWHIImVBr4o

Video Demo: Building a Rocks HPC Cluster with Xen Hardware Virtual Machines (HVM)

http://www.youtube.com/watch?v=LbLaPpwNAx4

Tuesday, October 27, 2009

Xen Virtualization & Intel VT-d: Direct Hardware Access to Graphics Card by Windows HVM Virtual Machines

http://www.youtube.com/watch?v=HHUwg_zxYgw


This video shows Xen 3.5-unstable (changeset 20143), VT-d, pv-ops dom0 kernel 2.6.31.4, VGA passthrough, HD audio passthrough, and Windows XP HVM guest operating system in action.

Host Operating System Domain 0: Fedora 11 Linux x86-64 64-bit
Domain U: Windows XP Home Edition SP3 32-bit HVM Virtual Machine
Xen Hypervisor Version: 3.5-unstable changeset 20143
Paravirt-Operations Dom0 Kernel: 2.6.31.4 (Jeremy Fitzhardinge's git tree)
Intel GFX Passthrough Patches Applied: Version 1 (Provided by Han Weidong Intel)

Motherboard: Intel DQ45CB
BIOS Version: 0093
Processor: Intel Pentium Dual Core E6300
Graphics Card: nVidia GeForce 8400 GS PCI Express x16
Memory: 8GB DDR2-800

Version of Xen GPL PV (GPLPV) Drivers Installed: 07/15/2009 0.10.0.86

Full implementation details are here: http://lists.xensource.com/archives/html/xen-devel/2009-10/msg01134.html

VGA and HD audio passthrough are fully working. Although device manager reports that it is working, OHCI IEEE1394 firewire controller passthrough is not working as expected. Video cameras with firewire attached to the firewire port cannot be detected.

USB optical mouse and USB keyboard have also been successfully passed through to Windows XP HVM guest.

Monday, October 26, 2009

More Xen Virtualization VGA Passthrough Videos

Host Operating System Domain 0: Fedora 11 Linux x86-64 64-bit
Domain U: Windows XP Home Edition SP3 32-bit HVM Virtual Machine
Xen Hypervisor Version: 3.5-unstable changeset 20143
Paravirt-Operations (pv-ops) Dom0 Kernel: 2.6.31.4 (Jeremy Fitzhardinge's git tree)
Intel GFX Passthrough Patches Applied: Version 1 (Provided by Han Weidong Intel)

Motherboard: Intel Desktop Board DQ45CB
BIOS Version: 0093
Processor: Intel Pentium Dual Core E6300 2.8 GHz
Graphics Card: nVidia GeForce 8400 GS PCI Express x16
Memory: 8GB DDR2-800 (4X 2GB)

Version of Xen GPL PV (GPLPV) Drivers Installed: 07/15/2009 0.10.0.86

Read more here: http://lists.xensource.com/archives/html/xen-devel/2009-10/msg01134.html

Xen Virtualization VGA Passthrough: 3D Gaming Benchmark Results Part 1 of 2

http://www.youtube.com/watch?v=5I13E1MQbMc



Xen Virtualization VGA Passthrough: 3D Gaming Benchmark Results Part 2 of 2

http://www.youtube.com/watch?v=yYg6n8yBktM



Xen Virtualization VGA Passthrough: Disk I/O Benchmark Results

http://www.youtube.com/watch?v=uL7JS4PMpzY



Xen Virtualization VGA Passthrough: PerformanceTest 7.0 Virtual CPU Benchmark Results

http://www.youtube.com/watch?v=vLR-o9tX_Tw



Xen Virtualization VGA Passthrough: SiSoftware Sandra Virtual Processor Benchmark Part 1 of 2

http://www.youtube.com/watch?v=BUXOAPce_40



Xen Virtualization VGA Passthrough: SiSoftware Sandra Virtual Processor Benchmark Part 2 of 2

http://www.youtube.com/watch?v=k5lle8WOHLE



Xen Virtualization VGA Passthrough: Playing 3D FPS Games in Windows XP HVM Virtual Machine

http://www.youtube.com/watch?v=Pikwgl8bac8

Monday, September 14, 2009

USB Device Pass Through Succeeded

How thick I must have been! In my earlier blog posts with VGA passthrough succeeded, I said that I couldn't passthrough any USB device at all.

As a matter of fact, Timothy had corrected my usbdevice directive in the guest config file in an earlier mailing list post but I didn't take a careful look at the usbdevice directive at all. The correct usbdevice directive is:

usbdevice = "host:vendorid:productid"

I had used

usbdevice = [ 'host:vendorid:productid' ]

which is completely erroneous. I need to omit the square brackets for USB device passthrough to work.

I have now successfully passed through the USB optical mouse to the Windows XP Home HVM domU and using on-screen keyboard as a substitute for the physical USB keyboard.

The reason I am doing this is because QEMU with Xen can only allow one USB device to be passed through at any one time.

It was so obvious and I missed the obvious!

PVOPS Dom 0 kernel 2.6.31 and Mainline Kernel 2.6.31

I couldn't get Jeremy's rebase/master branch (pvops dom 0 kernel 2.6.31) to work despite disabling all of USB support in the kernel. I will troubleshoot this issue with the serial console enabled another time.

Meanwhile, I got Linus' mainline kernel 2.6.31 to work on my system. So apparently the dom 0 patched kernel 2.6.31 has some issues or I did not configure it properly.

Sunday, September 13, 2009

Disabled all USB support in the kernel...

but I still couldn't get pvops dom0-patched kernel 2.6.31 final to complete loading. All I get is a blinking cursor at the top left hand corner of the monitor.

Saturday, September 12, 2009

UHCI, OHCI, EHCI, and xHCI disabled...

but I still could not get pvops dom 0 kernel 2.6.31 final to complete loading.

Disabling USB 1.0, USB 2.0 Drivers and Enabling USB 3.0 Drivers

I have disabled USB 1.0 and USB 2.0 drivers simultaneously and enabled USB 3.0 driver but the kernel stops loading.

Then I totally disabled all USB support by passing the "nousb" parameter to the kernel but it still stops loading.

After disabling the USB 1.0 Host Controller Driver...

but still leaving the USB 2.0 Host Controller Driver compiled statically into the kernel, I get an error with the USB 2.0 driver.




Obviously this is a USB driver problem with the pvops dom 0 kernel 2.6.31 final or an incompatibility issue with the USB controller on the Intel DQ45CB motherboard. I have no issues with USB on pvops dom 0 kernels 2.6.30-rc3 and 2.6.31-rc6, and also regular kernels.

If I keep disabling the USB drivers any further, I will not be able to use USB keyboard and mouse on my system. My Intel DQ45CB motherboard does not have any PS/2 ports. But I may still be able to serial console in.

Error with pv-ops dom 0 kernel 2.6.31 final

Below is a screenshot of the error I have encountered with this kernel.



USB Host Controller died?! Above screenshot shows USB 1.0 driver having problems.

Friday, September 11, 2009

Disk I/O Benchmark Results with Xen-based Windows XP Home HVM Virtual Machine

Common Configuration: Xen 3.5-unstable with Intel supplied VGA passthrough patches
VGA passthrough status: nVidia GeForce 8400 GS PCI Express x16 graphics card fully passed through

Case #1: Jeremy's Fitzhardinge's pvops dom 0 kernel 2.6.30-rc3



Case #2: Jeremy Fitzhardinge's pvops dom 0 kernel 2.6.31-rc6



Observation: The above benchmark results show that Windows XP Home Edition 32-bit HVM guest operating system runs faster in 2.6.30-rc3 than 2.6.31-rc6. All services which could have affected the performance of Win XP domU have been stopped in Dom 0.

Thursday, September 10, 2009

The Final Solution: PCI Express x16 Graphics Card Passthrough to Windows XP Home Edition 32-bit HVM Virtual Machine

Here is my latest video presentation on VGA passthrough. Please check out the Youtube link at

http://www.youtube.com/watch?v=1ia3IwG6tp4



The "not enough free resources" issue for nVidia Geforce 8400 GS PCI Express x16 graphics card in earlier presentation videos:

http://www.youtube.com/watch?v=HNEiSInrav0



http://www.youtube.com/watch?v=_hOT_9LIG5w



has been fixed. Device manager in Windows XP HVM domU no longer shows an exclamation mark besides the nVidia Geforce 8400 GS graphics card. The device is working properly and the resources tab shows the available memory ranges.

Full VGA passthrough to Windows XP HVM guest operating system using Xen virtualization has been achieved. I am now able to run 3-D video benchmarks on the passed through nVidia GeForce 8400 GS graphics card.

All this is possible using Xen 3.5 hypervisor with Intel supplied VGA passthrough patches. Instead of using pvops dom0 kernel 2.6.31-rc6 which causes Win XP domU to run slowly, I am now using pvops dom0 kernel 2.6.30-rc3.

I am now able to bootstrap Windows XP HVM domU from within Linux using Xen virtualization and play 3D games in the Windows virtual machine. In the past, Windows virtual machines can only access a 2D emulated/virtual display adapter. The virtualized Windows operating systems were more palatable to server administrators than gamers. With VGA pass through and direct hardware access by Windows virtual machines to the graphics hardware, gamers will now be able to play 3D games inside Windows virtual machines.

There is still one unresolved problem. I am still unable to passthrough USB devices, e.g. keyboard and mouse, to the Windows XP HVM domU.

Special thanks to the following people who have helped me along the way. Without their guidance I would not have made it this far.

(1) Boris Derzhavets
(2) Pasi Kärkkäinen
(3) Han Weidong, Intel Corporation
(4) Doug Magee
(5) Timothy Moore
(6) Christian Tramnitz

and many other people from the xen-devel mailing list.

References:

[1] Direct Access to Graphics Card Leveraging VT-d Technical Report; Beng Heng Ng, Billy Lau and Atul Prakash; July 20, 2009; University of Michigan

URL: http://www.eecs.umich.edu/~bengheng/pubs/vgapt_techreport.pdf

[2] VGA passthrough in Xen; Y. Schaeffer; University of Amsterdam

URL: http://staff.science.uva.nl/~delaat/sne-2008-2009/p22/presentation.pdf

[3] Xen VGA passthrough; Yuri Schae er BSc; University of Amsterdam

URL: http://staff.science.uva.nl/~delaat/sne-2008-2009/p22/report.pdf

Monday, September 7, 2009

Video Presentation on PCI Express x16 VGA Passthrough to Xen-based Windows XP Home HVM Virtual Machine

I have made and uploaded a two-part video series on VGA pass through to Windows XP HVM domU to Youtube.

Here are the Youtube links:

http://www.youtube.com/watch?v=HNEiSInrav0



http://www.youtube.com/watch?v=_hOT_9LIG5w



Basically Windows XP guest operating system has direct access to PCI Express x16 graphics card but in a reduced functionality state. The videos show that the passed through display card cannot found enough resources it can use. The device status for nVidia Geforce 8400 GS on my Intel Desktop Board DQ45CB is:

This device cannot find enough free resources that it can use. (Code 12)

I could not run any 3-D video benchmark tests at the moment. I have tried Sisoftware Sandra Lite 2009.SP4 and Passmark Performance Test benchmark suites. 3-D video benchmark tests in both suites cannot be started at all. Work on direct graphics card access by Windows virtual machines is still in progress but this paves the way for heavy 3-D gaming in Windows virtual machines in the future. Besides processors, graphics card virtualization will become mainstream in the not-too-distant future. The technology requires Intel Virtualization Technology for Directed Input/Output (VT-d).

In addition to graphics card, you also need to pass through the USB keyboard and USB optical mouse to the Windows virtual machine in order to use it. However, USB pass through is currently not possible on Xen 3.5-unstable with Intel applied VGA passthrough patches. The code is still experimental and under constant development.

Special thanks to Xen virtualization developers and engineers at Intel Corporation for making VGA passthrough possible.

Thank you very much.

Saturday, August 29, 2009

Windows XP Home DomU Test Results after applying Intel's VGA Passthrough Patchset to Xen 3.5-unstable

Dear All,

I have applied the following patches to xen 3.5-unstable

1) intel-gfx-passthru-patch01.patch
2) intel-gfx-passthru-patch02.patch
3) intel-gfx-passthru-patch03.patch
4) enming-patch04.patch

and compiled xen 3.5-unstable successfully (both hypervisor and tools).

i rebooted into this newly compiled Xen hypervisor which supports loading vga bios from firmware file of nVidia Geforce 8400 GS PCI Express x16.

After dom0 has booted up, I executed the following script to hide nVidia Geforce 8400 GS from dom0.

[enming@fedora11-x86-64-host scripts]$ cat bind-devices-pci-stub.sh
#!/bin/sh
echo "10de 06e4" > /sys/bus/pci/drivers/pci-stub/new_id
echo "0000:01:00.0" > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
echo "0000:01:00.0" > /sys/bus/pci/drivers/pci-stub/bind

I also assigned the nVidia Geforce 8400 GS to my Windows XP Home HVM domU.

pci = [ '01:00.0' ]

I also specified gfx_passthru=2.

Do note that I booted up with onboard Intel GMA4500 as the primary video adapter. Hence dom 0 has onboard graphics and Windows XP HVM domU has nvidia graphics.

Then I started Windows XP Home HVM DomU.

Very soon, my Dom 0's display was garbaged and X server on Dom 0 totally froze and became unresponsive. I cannot switch to any ttys.

However, I was still able to vnc into my Windows XP Home HVM Dom U. I had earlier installed a VNC server into my Windows XP guest. After remoting in to my Windows XP DomU through vnc, I found that NVIDIA Geforce 8400 GS cannot be initialized and no resources are available for this graphics card.






It shows that the emulated virtual VGA card is now disabled (not appearing in Windows XP Home DomU's device manager) and only the nVidia Geforce 8400 GS VGA BIOS gets loaded.

Intel's VGA Passthrough Patchset to xen 3.5-unstable
====================================================

1) intel-gfx-passthru-patch01.patch

diff -r 5d7e7a250267 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/firmware/hvmloader/config.h Thu Aug 27 16:54:24 2009 +0800
@@ -15,7 +15,7 @@
#define PCI_ISA_IRQ_MASK 0x0c20U /* ISA IRQs 5,10,11 are PCI connected */

/* MMIO hole: Hardcoded defaults, which can be dynamically expanded. */
-#define PCI_MEM_START 0xf0000000
+#define PCI_MEM_START 0xe0000000
#define PCI_MEM_END 0xfc000000
extern unsigned long pci_mem_start, pci_mem_end;

diff -r 5d7e7a250267 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/firmware/hvmloader/hvmloader.c Fri Aug 28 14:41:22 2009 +0800
@@ -113,7 +113,7 @@ unsigned long pci_mem_start = PCI_MEM_ST
unsigned long pci_mem_start = PCI_MEM_START;
unsigned long pci_mem_end = PCI_MEM_END;

-static enum { VGA_none, VGA_std, VGA_cirrus } virtual_vga = VGA_none;
+static enum { VGA_none, VGA_std, VGA_cirrus, VGA_pt } virtual_vga = VGA_none;

static void init_hypercalls(void)
{
@@ -212,8 +212,10 @@ static void pci_setup(void)
case 0x0300:
if ( (vendor_id == 0x1234) && (device_id == 0x1111) )
virtual_vga = VGA_std;
- if ( (vendor_id == 0x1013) && (device_id == 0xb8) )
+ else if ( (vendor_id == 0x1013) && (device_id == 0xb8) )
virtual_vga = VGA_cirrus;
+ else
+ virtual_vga = VGA_pt;
break;
case 0x0680:
/* PIIX4 ACPI PM. Special device with special PCI config space. */
@@ -684,6 +686,11 @@ int main(void)
memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
vgabios_stdvga, sizeof(vgabios_stdvga));
vgabios_sz = round_option_rom(sizeof(vgabios_stdvga));
+ break;
+ case VGA_pt:
+ printf("Loading VGABIOS of passthroughed gfx ...\n");
+ vgabios_sz =
+ round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) * 512);
break;
default:
printf("No emulated VGA adaptor ...\n");
diff -r 5d7e7a250267 tools/libxc/ia64/xc_ia64_hvm_build.c
--- a/tools/libxc/ia64/xc_ia64_hvm_build.c Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/ia64/xc_ia64_hvm_build.c Thu Aug 27 16:54:24 2009 +0800
@@ -1109,7 +1109,9 @@ int xc_hvm_build_target_mem(int xc_handl
uint32_t domid,
int memsize,
int target,
- const char *image_name)
+ const char *image_name,
+ int gfx_passthru)
+
{
/* XXX:PoD isn't supported yet */
return xc_hvm_build(xc_handle, domid, target, image_name);
diff -r 5d7e7a250267 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xc_hvm_build.c Thu Aug 27 16:54:24 2009 +0800
@@ -64,6 +64,67 @@ static void build_hvm_info(void *hvm_inf
for ( i = 0, sum = 0; i < hvm_info->length; i++ )
sum += ((uint8_t *)hvm_info)[i];
hvm_info->checksum = -sum;
+}
+
+static int init_vgabios(int xc_handle, uint32_t dom,
+ unsigned char *buffer, uint32_t bios_size)
+{
+ char *va_bios = NULL;
+ uint32_t va_size = 0;
+
+ va_size = bios_size + bios_size % XC_PAGE_SIZE;
+ va_bios = xc_map_foreign_range(xc_handle, dom, va_size,
+ PROT_READ | PROT_WRITE, 0xC0);
+ if ( !va_bios )
+ {
+ IPRINTF("Unable to map vga bios!\n");
+ return -1;
+ }
+
+ if ( buffer != NULL )
+ memcpy(va_bios, buffer, bios_size);
+ else
+ memset(va_bios, 0, bios_size);
+
+ munmap(va_bios, va_size);
+ return 0;
+}
+
+static int setup_vga_pt(int xc_handle, uint32_t dom)
+{
+ int rc = 0;
+ unsigned char *bios = NULL;
+ int bios_size = 0;
+ char *c = NULL;
+ char checksum = 0;
+
+ /* Allocated 64K for the vga bios */
+ if (!(bios = malloc(64 * 1024)))
+ return -1;
+
+#ifdef __linux__
+ bios_size = xc_get_vgabios(bios, 64 * 1024);
+#else
+ bios_size = 0;
+#endif /* __linux__ */
+
+ if (bios_size == 0)
+ {
+ IPRINTF("vga bios size is 0!\n");
+ rc = -1;
+ goto error;
+ }
+
+ /* Adjust the bios checksum */
+ for ( c = (char*)bios; c < ((char*)bios + bios_size); c++ )
+ checksum += *c;
+ if (checksum)
+ bios[bios_size - 1] -= checksum;
+
+ init_vgabios(xc_handle, dom, bios, bios_size);
+error:
+ free(bios);
+ return rc;
}

static int loadelfimage(
@@ -381,7 +442,8 @@ int xc_hvm_build_target_mem(int xc_handl
uint32_t domid,
int memsize,
int target,
- const char *image_name)
+ const char *image_name,
+ int gfx_passthru)
{
char *image;
int sts;
@@ -392,6 +454,11 @@ int xc_hvm_build_target_mem(int xc_handl
return -1;

sts = xc_hvm_build_internal(xc_handle, domid, memsize, target, image, image_size);
+
+ if ( gfx_passthru )
+ sts |= setup_vga_pt(xc_handle, domid);
+ else
+ sts |= init_vgabios(xc_handle, domid, NULL, 0x800);

free(image);

diff -r 5d7e7a250267 tools/libxc/xc_linux.c
--- a/tools/libxc/xc_linux.c Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xc_linux.c Thu Aug 27 16:54:24 2009 +0800
@@ -638,6 +638,56 @@ err:
return gnt;
}

+int xc_get_vgabios(unsigned char *buf,
+ int len)
+{
+ int mem;
+ uint32_t start, size = 0;
+ uint16_t magic = 0;
+
+ start = 0xC0000;
+ if (len < size)
+ return 0;
+ if ((mem = open("/dev/mem", O_RDONLY)) < 0)
+ return 0;
+
+ /*
+ ** Check if it a real bios extension.
+ ** The magic number is 0xAA55.
+ */
+ if (start != lseek(mem, start, SEEK_SET))
+ goto out;
+ if (read(mem, &magic, 2) != 2)
+ goto out;
+ if (magic != 0xAA55)
+ goto out;
+ /* Find the size of the rom extension */
+ if (start != lseek(mem, start, SEEK_SET))
+ goto out;
+ if (lseek(mem, 2, SEEK_CUR) != (start + 2))
+ goto out;
+ if (read(mem, &size, 1) != 1)
+ goto out;
+ /* This size is in 512K */
+ size *= 512;
+
+ /*
+ ** Set the file to the begining of the rombios,
+ ** to start the copy.
+ */
+ if (start != lseek(mem, start, SEEK_SET))
+ {
+ size = 0;
+ goto out;
+ }
+ if (size != read(mem, buf, size))
+ size = 0;
+
+out:
+ close(mem);
+ return size;
+}
+
/*
* Local variables:
* mode: C
diff -r 5d7e7a250267 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xenctrl.h Thu Aug 27 16:54:24 2009 +0800
@@ -1285,4 +1285,6 @@ int xc_tmem_restore(int xc_handle, int d
int xc_tmem_restore(int xc_handle, int dom, int fd);
int xc_tmem_restore_extra(int xc_handle, int dom, int fd);

+int xc_get_vgabios(unsigned char *bios, int len);
+
#endif /* XENCTRL_H */
diff -r 5d7e7a250267 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xenguest.h Thu Aug 27 16:54:24 2009 +0800
@@ -135,7 +135,8 @@ int xc_hvm_build_target_mem(int xc_handl
uint32_t domid,
int memsize,
int target,
- const char *image_name);
+ const char *image_name,
+ int gfx_passthru);

int xc_hvm_build_mem(int xc_handle,
uint32_t domid,
diff -r 5d7e7a250267 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/lowlevel/xc/xc.c Thu Aug 27 16:54:24 2009 +0800
@@ -894,21 +894,21 @@ static PyObject *pyxc_hvm_build(XcObject
int i;
#endif
char *image;
- int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1;
+ int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1, gfx_passthru = 0;

static char *kwd_list[] = { "domid",
"memsize", "image", "target", "vcpus", "acpi",
- "apic", NULL };
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
+ "apic", "gfx_passthru", NULL };
+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiiii", kwd_list,
&dom, &memsize, &image, &target, &vcpus,
- &acpi, &apic) )
+ &acpi, &apic, &gfx_passthru) )
return NULL;

if ( target == -1 )
target = memsize;

if ( xc_hvm_build_target_mem(self->xc_handle, dom, memsize,
- target, image) != 0 )
+ target, image, gfx_passthru) != 0 )
return pyxc_error_to_exception();

#if !defined(__ia64__)
diff -r 5d7e7a250267 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/xend/XendConfig.py Thu Aug 27 16:54:24 2009 +0800
@@ -175,6 +175,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
'pci_msitranslate': int,
'pci_power_mgmt': int,
'xen_platform_pci': int,
+ "gfx_passthru": int,
}

# Xen API console 'other_config' keys.
diff -r 5d7e7a250267 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/xend/image.py Thu Aug 27 16:54:24 2009 +0800
@@ -786,7 +786,7 @@ class HVMImageHandler(ImageHandler):
self.apic = int(vmConfig['platform'].get('apic', 0))
self.acpi = int(vmConfig['platform'].get('acpi', 0))
self.guest_os_type = vmConfig['platform'].get('guest_os_type')
-
+ self.gfx_passthru = int(vmConfig['platform'].get('gfx_passthru', 0))

# Return a list of cmd line args to the device models based on the
# xm config file
@@ -807,7 +807,7 @@ class HVMImageHandler(ImageHandler):

dmargs = [ 'boot', 'fda', 'fdb', 'soundhw',
'localtime', 'serial', 'stdvga', 'isa',
- 'acpi', 'usb', 'usbdevice' ]
+ 'acpi', 'usb', 'usbdevice', 'gfx_passthru' ]

for a in dmargs:
v = vmConfig['platform'].get(a)
@@ -901,6 +901,7 @@ class HVMImageHandler(ImageHandler):
log.debug("vcpus = %d", self.vm.getVCpuCount())
log.debug("acpi = %d", self.acpi)
log.debug("apic = %d", self.apic)
+ log.debug("gfx_passthru = %d", self.gfx_passthru)

rc = xc.hvm_build(domid = self.vm.getDomid(),
image = self.loader,
@@ -908,7 +909,8 @@ class HVMImageHandler(ImageHandler):
target = mem_mb,
vcpus = self.vm.getVCpuCount(),
acpi = self.acpi,
- apic = self.apic)
+ apic = self.apic,
+ gfx_passthru = self.gfx_passthru)
rc['notes'] = { 'SUSPEND_CANCEL': 1 }

rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
diff -r 5d7e7a250267 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/xm/create.py Thu Aug 27 16:54:24 2009 +0800
@@ -546,6 +546,10 @@ gopts.var('sdl', val='',
gopts.var('sdl', val='',
fn=set_value, default=None,
use="""Should the device model use SDL?""")
+
+gopts.var('gfx_passthru', val='',
+ fn=set_value, default=None,
+ use="""Passthrough graphics card?""")

gopts.var('opengl', val='',
fn=set_value, default=None,
@@ -957,7 +961,8 @@ def configure_hvm(config_image, vals):
'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
'viridian', 'xen_extended_power_mgmt', 'pci_msitranslate',
- 'vpt_align', 'pci_power_mgmt', 'xen_platform_pci' ]
+ 'vpt_align', 'pci_power_mgmt', 'xen_platform_pci',
+ 'gfx_passthru' ]

for a in args:
if a in vals.__dict__ and vals.__dict__[a] is not None:

2) intel-gfx-passthru-patch02.patch

From fb818f1060e57dac6793187a70a79801a7c17e50 Mon Sep 17 00:00:00 2001
From: Weidong Han
Date: Thu, 27 Aug 2009 16:51:01 +0800
Subject: [PATCH] qemu gfx passthrough support

support basic gfx passthrough:
- disable emulated VGA adpater if there is passthroughed gfx
- register/unregister legacy VGA I/O ports and MMIOs for passthroughed gfx

Signed-off-by: Ben Lin
Signed-off-by: Weidong Han
---
hw/pass-through.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++
hw/pass-through.h | 6 +++++
hw/pc.c | 51 ++++++++++++++++++++++++------------------
vl.c | 32 +++++++++++++++++++++++---
4 files changed, 126 insertions(+), 26 deletions(-)

diff --git a/hw/pass-through.c b/hw/pass-through.c
index 8d80755..4a9e03a 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -93,6 +93,8 @@
#include
#include

+extern int gfx_passthru;
+
struct php_dev {
struct pt_dev *pt_dev;
uint8_t valid;
@@ -1781,12 +1783,57 @@ static int pt_dev_is_virtfn(struct pci_dev *dev)
return rc;
}

+/*
+ * register VGA resources for the domain with assigned gfx
+ */
+static int register_vga_regions(struct pt_dev *real_device)
+{
+ int ret = 0;
+
+ ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3B0,
+ 0x3B0, 0xC, DPCI_ADD_MAPPING);
+
+ ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3C0,
+ 0x3C0, 0x20, DPCI_ADD_MAPPING);
+
+ ret |= xc_domain_memory_mapping(xc_handle, domid,
+ 0xa0000 >> XC_PAGE_SHIFT,
+ 0xa0000 >> XC_PAGE_SHIFT,
+ 0x20,
+ DPCI_ADD_MAPPING);
+
+ return ret;
+}
+
+/*
+ * unregister VGA resources for the domain with assigned gfx
+ */
+static int unregister_vga_regions(struct pt_dev *real_device)
+{
+ int ret = 0;
+
+ ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3B0,
+ 0x3B0, 0xC, DPCI_REMOVE_MAPPING);
+
+ ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3C0,
+ 0x3C0, 0x20, DPCI_REMOVE_MAPPING);
+
+ ret |= xc_domain_memory_mapping(xc_handle, domid,
+ 0xa0000 >> XC_PAGE_SHIFT,
+ 0xa0000 >> XC_PAGE_SHIFT,
+ 0x20,
+ DPCI_REMOVE_MAPPING);
+
+ return ret;
+}
+
static int pt_register_regions(struct pt_dev *assigned_device)
{
int i = 0;
uint32_t bar_data = 0;
struct pci_dev *pci_dev = assigned_device->pci_dev;
PCIDevice *d = &assigned_device->dev;
+ int ret;

/* Register PIO/MMIO BARs */
for ( i = 0; i < PCI_BAR_ENTRIES; i++ )
@@ -1842,6 +1889,16 @@ static int pt_register_regions(struct pt_dev *assigned_device)
(uint32_t)(pci_dev->rom_size), (uint32_t)(pci_dev->rom_base_addr));
}

+ if ( gfx_passthru && (pci_dev->device_class == 0x0300) )
+ {
+ ret = register_vga_regions(assigned_device);
+ if ( ret != 0 )
+ {
+ PT_LOG("VGA region mapping failed\n");
+ return ret;
+ }
+ }
+
return 0;
}

@@ -1891,6 +1948,12 @@ static void pt_unregister_regions(struct pt_dev *assigned_device)

}

+ if ( gfx_passthru && (assigned_device->pci_dev->device_class == 0x0300) )
+ {
+ ret = unregister_vga_regions(assigned_device);
+ if ( ret != 0 )
+ PT_LOG("VGA region unmapping failed\n");
+ }
}

static uint8_t find_cap_offset(struct pci_dev *pci_dev, uint8_t cap)
diff --git a/hw/pass-through.h b/hw/pass-through.h
index 028a03e..956e228 100644
--- a/hw/pass-through.h
+++ b/hw/pass-through.h
@@ -142,6 +142,12 @@ enum {
GRP_TYPE_EMU, /* emul reg group */
};

+enum {
+ GFX_NO_PASSTHRU = 0, /* No gfx pass-through */
+ GFX_IGD_PASSTHRU, /* IGD pass-through */
+ GFX_DISCRETE_PASSTHRU, /* Discrete gfx pass-through */
+};
+
#define PT_GET_EMUL_SIZE(flag, r_size) do { \
if (flag == PT_BAR_FLAG_MEM) {\
r_size = (((r_size) + XC_PAGE_SIZE - 1) & ~(XC_PAGE_SIZE - 1)); \
diff --git a/hw/pc.c b/hw/pc.c
index 129e9d9..53b59c0 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -41,6 +41,7 @@
#include "virtio-balloon.h"
#include "virtio-console.h"
#include "hpet_emul.h"
+#include "pass-through.h"

/* output Bochs bios info messages */
//#define DEBUG_BIOS
@@ -65,6 +66,8 @@ void tpm_tis_init(SetIRQFunc *set_irq, void *opaque, int irq);
extern uint8_t *acpi_tables;
extern size_t acpi_tables_len;

+extern int gfx_passthru;
+
static fdctrl_t *floppy_controller;
static RTCState *rtc_state;
static PITState *pit;
@@ -983,30 +986,34 @@ vga_bios_error:

register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);

- if (cirrus_vga_enabled) {
- if (pci_enabled) {
- pci_cirrus_vga_init(pci_bus,
- phys_ram_base + vga_ram_addr,
- vga_ram_addr, vga_ram_size);
- } else {
- isa_cirrus_vga_init(phys_ram_base + vga_ram_addr,
- vga_ram_addr, vga_ram_size);
- }
+ if (gfx_passthru == GFX_NO_PASSTHRU) {
+ if (cirrus_vga_enabled) {
+ fprintf(logfile,"cirrus_vga_enabled\n");
+ if (pci_enabled) {
+ pci_cirrus_vga_init(pci_bus,
+ phys_ram_base + vga_ram_addr,
+ vga_ram_addr, vga_ram_size);
+ } else {
+ isa_cirrus_vga_init(phys_ram_base + vga_ram_addr,
+ vga_ram_addr, vga_ram_size);
+ }
#ifndef CONFIG_DM
- } else if (vmsvga_enabled) {
- if (pci_enabled)
- pci_vmsvga_init(pci_bus, phys_ram_base + vga_ram_addr,
- vga_ram_addr, vga_ram_size);
- else
- fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
+ } else if (vmsvga_enabled) {
+ if (pci_enabled)
+ pci_vmsvga_init(pci_bus, phys_ram_base + vga_ram_addr,
+ vga_ram_addr, vga_ram_size);
+ else
+ fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
#endif
- } else if (std_vga_enabled) {
- if (pci_enabled) {
- pci_vga_init(pci_bus, phys_ram_base + vga_ram_addr,
- vga_ram_addr, vga_ram_size, 0, 0);
- } else {
- isa_vga_init(phys_ram_base + vga_ram_addr,
- vga_ram_addr, vga_ram_size);
+ } else if (std_vga_enabled) {
+ fprintf(logfile,"std_vga_enabled\n");
+ if (pci_enabled) {
+ pci_vga_init(pci_bus, phys_ram_base + vga_ram_addr,
+ vga_ram_addr, vga_ram_size, 0, 0);
+ } else {
+ isa_vga_init(phys_ram_base + vga_ram_addr,
+ vga_ram_addr, vga_ram_size);
+ }
}
}

diff --git a/vl.c b/vl.c
index 62bed05..72f3479 100644
--- a/vl.c
+++ b/vl.c
@@ -48,6 +48,7 @@
#include

#include "qemu-xen.h"
+#include "hw/pass-through.h"

#include
#include
@@ -213,6 +214,7 @@ static int rtc_date_offset = -1; /* -1 means no change */
int cirrus_vga_enabled = 1;
int std_vga_enabled = 0;
int vmsvga_enabled = 0;
+int gfx_passthru = 0;
#ifdef TARGET_SPARC
int graphic_width = 1024;
int graphic_height = 768;
@@ -4269,6 +4271,7 @@ enum {
/* Xen tree: */
QEMU_OPTION_disable_opengl,
QEMU_OPTION_direct_pci,
+ QEMU_OPTION_gfx_passthru,
QEMU_OPTION_pci_emulation,
QEMU_OPTION_vncunused,
QEMU_OPTION_videoram,
@@ -4447,6 +4450,7 @@ static const QEMUOption qemu_options[] = {
#endif
{ "acpi", 0, QEMU_OPTION_acpi }, /* deprecated, for xend compatibility */
{ "direct_pci", HAS_ARG, QEMU_OPTION_direct_pci },
+ { "gfx_passthru", HAS_ARG, QEMU_OPTION_gfx_passthru},
{ "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation },
{ "vncunused", 0, QEMU_OPTION_vncunused },
{ "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
@@ -5484,6 +5488,22 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_runas:
run_as = optarg;
break;
+ case QEMU_OPTION_gfx_passthru:
+ gfx_passthru = atoi(optarg);
+ switch (gfx_passthru) {
+ case GFX_NO_PASSTHRU:
+ break;
+ case GFX_IGD_PASSTHRU:
+ fprintf(logfile, "IGD graphics card assignment\n");
+ break;
+ case GFX_DISCRETE_PASSTHRU:
+ fprintf(logfile, "Discrete graphics card assignment\n");
+ break;
+ default:
+ fprintf(stderr, "unsupported gfx_passthru option: %d\n",
+ gfx_passthru);
+ }
+ break;
}
}
}
@@ -5897,13 +5917,17 @@ int main(int argc, char **argv, char **envp)
exit(1);
xenstore_write_vncport(vnc_display_port);
}
+
+ if (gfx_passthru == GFX_NO_PASSTHRU)
+ {
#if defined(CONFIG_SDL)
- if (sdl || !vnc_display)
- sdl_display_init(ds, full_screen, no_frame, opengl_enabled);
+ if (sdl || !vnc_display)
+ sdl_display_init(ds, full_screen, no_frame, opengl_enabled);
#elif defined(CONFIG_COCOA)
- if (sdl || !vnc_display)
- cocoa_display_init(ds, full_screen);
+ if (sdl || !vnc_display)
+ cocoa_display_init(ds, full_screen);
#endif
+ }
}
}
dpy_resize(ds);
--
1.6.0.4

3) intel-gfx-passthru-patch03.patch

Manually generated by Teo En Ming (Zhang Enming) on 29 August 2009 Saturday at 11:10 A.M. Singapore Time
Email #1: enming.teo@xxxxxxxxxxxxxxx
Email #2: space.time.universe@gmail.com
MSN: teoenming@hotmail.com

--- Makefile 2009-08-29 10:57:28.072084001 +0800
+++ Makefile 2009-08-29 11:03:30.650209241 +0800
@@ -50,6 +50,7 @@
roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin \
../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../etherboot/eb-roms.h
sh ./mkhex rombios ../rombios/BIOS-bochs-latest > roms.h
+ sh ./mkhex vgabios_pt ../vgabios/vgabios-pt.bin >> roms.h
sh ./mkhex vgabios_stdvga ../vgabios/VGABIOS-lgpl-latest.bin >> roms.h
sh ./mkhex vgabios_cirrusvga \
../vgabios/VGABIOS-lgpl-latest.cirrus.bin >> roms.h
--- hvmloader.c 2009-08-29 10:58:52.679084845 +0800
+++ hvmloader.c 2009-08-29 11:07:40.763119203 +0800
@@ -688,10 +688,10 @@
vgabios_sz = round_option_rom(sizeof(vgabios_stdvga));
break;
case VGA_pt:
- printf("Loading VGABIOS of passthroughed gfx ...\n");
- vgabios_sz =
- round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) * 512);
- break;
+ printf("Loading Gfx Video BIOS from file ...\n");
+ memcpy((void *)VGABIOS_PHYSICAL_ADDRESS, vgabios_pt, sizeof(vgabios_pt));
+ vgabios_sz = round_option_rom(sizeof(vgabios_pt));
+ break;
default:
printf("No emulated VGA adaptor ...\n");
break;

My Own Patch to Fix Xen 3.5-unstable ACPI Code Build Issue with Intel ACPI Component Architecture compiler version 20090730
=================================================================================================

4. enming-patch04.patch

Patch created by Teo En Ming (Zhang Enming) on 29 August 2009 Saturday at 8:00 P.M. Singapore Time
Email #1: enming.teo@xxxxxxxxxxxxxxx
Email #2: space.time.universe@gmail.com
MSN: teoenming@hotmail.com
Mobile Phone: +65-9648-9798

--- ssdt_pm.h 2009-08-29 19:54:52.653088000 +0800
+++ ssdt_pm.h 2009-08-29 19:56:51.813088550 +0800
@@ -10,7 +10,7 @@
* C source code output
*
*/
-unsigned char AmlCode[] =
+unsigned char AmlCode_PM[] =
{
0x53,0x53,0x44,0x54,0xD6,0x05,0x00,0x00, /* 00000000 "SSDT...." */
0x02,0xB9,0x58,0x65,0x6E,0x00,0x00,0x00, /* 00000008 "..Xen..." */
--- ssdt_tpm.h 2009-08-29 19:55:44.578738954 +0800
+++ ssdt_tpm.h 2009-08-29 19:57:27.896638884 +0800
@@ -10,7 +10,7 @@
* C source code output
*
*/
-unsigned char AmlCode[] =
+unsigned char AmlCode_TPM[] =
{
0x53,0x53,0x44,0x54,0x4C,0x00,0x00,0x00, /* 00000000 "SSDTL..." */
0x02,0x2A,0x58,0x65,0x6E,0x00,0x00,0x00, /* 00000008 ".*Xen..." */

Click here for technical discussions in the Xen developers mailing list (August 2009 entries)

Tuesday, August 25, 2009

nVidia Geforce 8400 GS PCI Express x16 VGA Pass Through to Windows XP Home 32-bit HVM Virtual Machine with Intel Desktop Board DQ45CB

I have managed to do PCI-e VGA passthrough with the open source Xen but the work is still in progress because although Windows XP guest can see the REAL PCI-e x16 graphics card instead of an emulated graphics driver, it cannot be initialized yet.

Thanks to Intel Engineer Han Weidong, Pasi Kärkkäinen, Boris Derzhavets, Marc, Caz Yokoyama, and others who have helped me and shared their knowledge with me along the way.

System Configuration:

Intel Desktop Board DQ45CB with BIOS upgraded to 0093
Onboard Intel GMA 4500 Graphics (IGD)
nVidia Geforce 8400 GS PCI Express x16 Graphics Card

Fedora 11 Linux 64-bit Xen paravirt operations Domain 0 Host Operating System
Xen 3.5 Unstable/Development Type 1 Hypervisor
Jeremy Fitzhardinge's Xen paravirt-ops domain 0 Kernel 2.6.31-rc6

BIOS Configuration:

Primary Video Adapter: IGD
Intel Virtualization Technology (VT): Enabled
Intel Virtualization Technology for Directed I/O (VT-d): Enabled

Please see screenshots below:





Click here for technical discussions on the Xen developers mailing list (August 2009 entries)

Xen Paravirt Operations Domain 0 Serial Console Testing


Sunday, August 16, 2009

My Intel Desktop Board DQ45CB Arrives from Amazon.com USA!

I paid for this Intel Desktop Board DQ45CB from Amazon.com at SGD$177. It arrived in Singapore on 13 August 2009 Thursday.

You can't find this particular model anywhere in Singapore. This motherboard has the Intel Express Q45 chipset which supports Intel Virtualization Technology for Directed Input/Output (VT-d). Intel X58 chipset also supports VT-d but the Core i7 and motherboard bundles currently selling in Sim Lim Square (SLS) in Singapore are too expensive.






Then I made a visit to Sim Lim Square (SLS) in Singapore on the evening of 14 August 2009 Friday after work to buy this Intel Pentium Dual Core E6300 microprocessor at SGD$130. Pardon my frugality but I am too poor to afford the Intel Core 2 Duo series processors. I am not earning a lot.





I also bought this PCI 32-bit (note: it is not AGP or PCI Express x16) graphics card (ATI Rage 128 32 MB) for SGD$40 at SLS.



As I need lots of physical memory to run the open source Xen-based virtual machines, I made the decision to purchase two sticks of 2 GB DDR2-800 MHz memory. This is in addition to 2 sticks of 2 GB DDR2-800 MHz memory I already have running on my existing AMD Ahtlon 64 X2 Dual Core 4800+ Socket AM2 system, which I will be decommissioning later. So in total I will have 8 GB of memory.

DDR2 memory is dirt cheap nowadays.