# X in xen dom0 + fglrx

## lgael

Hello,

I'm a gentoo user for some time now and want to try xen in replacement of virtualbox. I upgraded my kernel to support dom0, but X doesn't start at reboot.

I can't determine if it is a bad configuration or a hardware limitation. I have an ATI 5770 and my motherboard (GA-MA785GT-UD3H) contains an HD4200 IGP which I don't use.

My xorg.conf :

```

Section "Device"

        Identifier  "aticonfig-Device[0]-0"

        Driver      "fglrx"

        VendorName  "ATI Technologies Inc"

        BoardName   "ATI Radeon HD 5770 (fglrx)"

        Option      "TexturedVideo" "On"

        Option      "VideoOverlay" "On"

        BusID       "PCI:1:0:0"

EndSection

```

Looking at Xorg.log I have :

```

grep "WW\|EE" /var/log/Xorg.0.log.old 

        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.

[    14.215] (II) Loading extension MIT-SCREEN-SAVER

[    15.209] (WW) Falling back to old probe method for fglrx

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:17:0) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:18:0) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:18:1) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:18:2) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:19:0) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:19:1) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:19:2) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:20:0) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:20:1) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:20:2) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:20:3) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:20:4) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@0:20:5) found

[    15.331] (WW) fglrx: No matching Device section for instance (BusID PCI:0@1:0:1) found

[    15.745] (WW) System lacks support for changing MTRRs

[    15.771] (EE) fglrx(0): V_BIOS address 0x0 out of range

[    15.979] (WW) fglrx(0): board is an unknown third party board, chipset is supported

[    16.945] (WW) fglrx(0): Option "VideoOverlay" is not used

[    16.945] (WW) fglrx(0): Option "VendorName" is not used

[    16.945] (WW) fglrx(0): Option "ModelName" is not used

[    19.261] (EE) XKB: Could not invoke xkbcomp

[    19.261] (EE) XKB: Couldn't compile keymap

[    19.261] (EE) XKB: Failed to load keymap. Loading default keymap instead.

[    19.267] (EE) XKB: Could not invoke xkbcomp

[    19.267] (EE) XKB: Couldn't compile keymap

```

which is unusual for these lines (all others warnings were always here):

```

[    15.745] (WW) System lacks support for changing MTRRs

[    15.771] (EE) fglrx(0): V_BIOS address 0x0 out of range

[    19.261] (EE) XKB: Could not invoke xkbcomp

[    19.261] (EE) XKB: Couldn't compile keymap

[    19.261] (EE) XKB: Failed to load keymap. Loading default keymap instead.

[    19.267] (EE) XKB: Could not invoke xkbcomp

[    19.267] (EE) XKB: Couldn't compile keymap

```

Looking at kern.log I have :

```

[   19.309834] [fglrx:fireglAsyncioIntDisableMsgHandler] *ERROR* IRQMGR returned error 2 when trying to disable interrupt source ff000064

[   19.309850] [fglrx:fireglAsyncioIntDisableMsgHandler] *ERROR* IRQMGR returned error 2 when trying to disable interrupt source ff000032

[   19.309858] [fglrx:fireglAsyncioIntDisableMsgHandler] *ERROR* IRQMGR returned error 2 when trying to disable interrupt source 10000000

[   19.309866] [fglrx:fireglAsyncioIntDisableMsgHandler] *ERROR* IRQMGR returned error 2 when trying to disable interrupt source ff000065

[   19.341121] X:2016 freeing invalid memtype d1120000-d1420000

```

3.1.0 Kernel with xen 4.1.1-r2

```

grep XEN /usr/src/linux/.config

CONFIG_XEN=y

CONFIG_XEN_DOM0=y

CONFIG_XEN_PRIVILEGED_GUEST=y

CONFIG_XEN_PVHVM=y

CONFIG_XEN_MAX_DOMAIN_MEMORY=128

CONFIG_XEN_SAVE_RESTORE=y

# CONFIG_XEN_DEBUG_FS is not set

# CONFIG_XEN_DEBUG is not set

CONFIG_PCI_XEN=y

CONFIG_XEN_PCIDEV_FRONTEND=y

CONFIG_XEN_BLKDEV_FRONTEND=y

CONFIG_XEN_BLKDEV_BACKEND=y

CONFIG_XEN_NETDEV_FRONTEND=y

CONFIG_XEN_NETDEV_BACKEND=y

CONFIG_HVC_XEN=y

CONFIG_XEN_FBDEV_FRONTEND=y

CONFIG_XEN_BALLOON=y

CONFIG_XEN_SELFBALLOONING=y

CONFIG_XEN_SCRUB_PAGES=y

CONFIG_XEN_DEV_EVTCHN=y

CONFIG_XEN_BACKEND=y

CONFIG_XENFS=y

CONFIG_XEN_COMPAT_XENFS=y

CONFIG_XEN_SYS_HYPERVISOR=y

CONFIG_XEN_XENBUS_FRONTEND=y

CONFIG_XEN_GNTDEV=y

CONFIG_XEN_GRANT_DEV_ALLOC=y

CONFIG_XEN_PLATFORM_PCI=y

CONFIG_SWIOTLB_XEN=y

CONFIG_XEN_TMEM=y

CONFIG_XEN_PCIDEV_BACKEND=y

```

I've found this thread relating the same problem but no workaround. In his xorg.conf, BusID "PCI:1:5:0" correspond to my IGP, but in my xorg.conf i use 5770 GPU...

So I'm looking for any direction to solve this first step with xen, maybe someone have a tip  :Smile: 

I will try to deactivate totally my igp in bios if possible...

----------

## JohnLM

Let's start with the obvious

Check if CONFIG_MTRR is set in your kernel build.

Use something like this

```
grep CONFIG_MTRR /usr/src/linux/.config
```

----------

## lgael

Thanks, yes CONFIG_MTRR is set.

 *Quote:*   

> localhost ~ # grep X86_PAT /usr/src/linux/.config
> 
> CONFIG_X86_PAT=y
> 
> localhost ~ # grep MTRR /usr/src/linux/.config
> ...

 

I've found that the "nopat" option (in grub config) resolves XKB problem, allowing X to start. Maybe CONFIG_X86_PAT is in conflict with fglrx (It seems that fglrx has a built-in PAT support).

 *Quote:*   

> PAT (Page Attribute Table)
> 
> 	x86 Page Attribute Table (PAT) allows for setting the memory attribute at the
> 
> 	page level granularity. PAT is complementary to the MTRR settings which allows
> ...

 

 *Quote:*   

> MTRR (Memory Type Range Register) control
> 
> 	  On Intel P6 family processors (Pentium Pro, Pentium II and later)
> 
> 	  the Memory Type Range Registers (MTRRs) may be used to control
> ...

 

But MTRR and V_BIOS errors remain for now.

Both PAT and MTRR have to be set in kerne for a standard use (without xen), right ?

Will try to play with kernel config/boot options ...

----------

## rsnfunky

Hi lgael,

I have a Gigabyte 880GA-UD3H and a discrete Radeon 4770.  I was facing the same problem that you were facing. 

I did the following to resolve it (From the BIOS) -

1) From the Bios (MIT Section) > IGX Configuration>Internal Graphics mode  = Disable

2) Advance Bios Features > Init Display First > PEG

It started working post that. 

If you want I can send you my xorg.conf file.

Regards,

----------

## beefsprocket

Have this issue as well. Booting with nopat results in a working KDM display manager, but then xen (xm/virsh) don't work. Very strange.

http://wiki.xen.org/xenwiki/XenPVOPSDRM.html#head-9c758a38297c9b507ee808eaa3908b39c3985f13 indicates it isn't just fglrx, and that fedora experience the issue as well.

Looks like there was a patch that was reverted? http://wiki.xen.org/wiki/Paravirtualized_DRM#Upstream_status_.28Linux_3.0_and_higher.29

----------

