PCI and VGA passthrough on Xen

In 2012 I was testing Xen for PCI and VGA graphics card passthrough. I used Xen 4.1.2 on Gentoo Linux and had partial success with an ATI graphics card. Although the guest OS (Windows XP) was running stable, video output disappeared after rebooting the virtual machine or became stuck from time to time. However, I'm uploading the config file and scripts for reference.

See also my howto about PCI passthrough on Citrix XenServer