# [solved]DMAR: BIOS has allocated no shadow GTT; disabl IOMMU

## tuner23

Hy,

i try to set up KVM with PCI-Passthrough.

But the IOMMU could not be activated (not only for graphics..)

I want to pass through a Network-Card.

The bootmessages print out the following:

```

moffat ~ # dmesg | grep -e IOMM -e DMAR

[    0.558109] DMAR: BIOS has allocated no shadow GTT; disabling IOMMU for graphics

```

The  VIRTIO and IOMMU drivers are all enabled:

```
moffat linux # cat .config | grep -e VIRTIO -e IOMMU

CONFIG_GART_IOMMU=y

CONFIG_CALGARY_IOMMU=y

CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y

CONFIG_AMD_IOMMU=y

CONFIG_AMD_IOMMU_STATS=y

CONFIG_IOMMU_HELPER=y

CONFIG_IOMMU_API=y

CONFIG_VIRTIO_BLK=y

CONFIG_VIRTIO_NET=y

CONFIG_VIRTIO_CONSOLE=y

CONFIG_HW_RANDOM_VIRTIO=y

# CONFIG_IOMMU_DEBUG is not set

# CONFIG_IOMMU_STRESS is not set

CONFIG_VIRTIO=y

CONFIG_VIRTIO_RING=y

CONFIG_VIRTIO_PCI=y

CONFIG_VIRTIO_BALLOON=y

```

Then i thought it is because of my onboard-graphics..

so i bought on and activated 

'enable onboard only, when no PCI-E Card is found'

and 

'search first PCI-E'

other options are not possible.

i also googled for my problen..

what means no shadow GTT and what have i to do, to make PCI-Passthrough work?

On my laptop it works without Problems..

Have someone some experience with this problem?

Thanks in advance,

Antonios.Last edited by tuner23 on Mon May 30, 2011 6:16 am; edited 3 times in total

----------

## BradN

I did a little google searching and found threads related to that problem, but no sort of solution other than having a BIOS that sets this up.

But... I did run across a single report:

"I have tried kernel 2.6.36-r5 and 2.6.37. None of them works. The 2.6.36-r5 kernel reported an error that the bios didn't allocate any shadow GTT. This seems to work using the 2.6.37 kernel:"

So, I guess if you are still using 2.6.36, try a newer kernel.  But, it doesn't seem this user was trying to do virtualized devices, but rather trying to get 915 KMS to work.  So, maybe this won't actually fix the problem.  It's worth a try I guess.

----------

## tuner23

Hmm, i will try a bios-update.. 

there are some memory-fixes in a newer version

but what means this f*** exe?^^

windows, on a server, HA!

don't know how to manage this.. :-/

i have one XP-installation for looking DVDs and a windows 7 on my laptop.

i could not create a working rescue-disk with boot-promt.

last thing i tried was installing the hard-drive on my server and boot in secure-mode (blue-screen..)

Kernels 2.6.37 and 2.6.38 did not work.

----------

## cach0rr0

 *tuner23 wrote:*   

> 
> 
> but what means this f*** exe?^^
> 
> windows, on a server, HA!
> ...

 

do they have a DOS version? 

could merge dosemu or similar and run their DOS bios update utility

----------

## tuner23

how does this work? 

i tried a msdos version but could not insert a usb-stick or something like this..

----------

## Hu

I believe app-emulation/dosemu would isolate the update program from the hardware, preventing it from being effective.  You need to boot a real mode OS and run the update from there.  I think this can be done with a combination of syslinux/isolinux as a bootloader and memdisk to give the resulting FreeDOS a memory-backed virtual hard drive containing the required update files.

----------

## cach0rr0

FreeDOS. that's the one i was thinking of (?), not a DOS emulator, sorry. I'm getting senile. 

http://www.freedos.org/freedos/files/

second link is a livecd.

----------

## BradN

I can confirm FreeDOS is usually suitable for running BIOS update utils.

What might work best (assuming CDROM boot is available) is taking a freedos floppy image...

wget http://whereever-one-gets-a-freedos-disk-image-from

mounting it with the loop option...

mkdir /mnt/freedos

mount -o loop myveryownfreedos.img /mnt/freedos

removing extra stuff you don't need to make room (depends on the situation)...

cd /mnt/freedos

rm anything not needed to run bios update

(fyi, you will need kernel.sys at the bare minimum - you CAN use the "specify location of command interpreter" prompt to load any executable with parameters if you elect not to include command.com)

copy your bios update files into the disk image...

cp /path/to/updater.exe /mnt/freedos

cp /path/to/biosfile.bin /mnt/freedos

and lastly unmount the disk image file

umount /mnt/freedos

Now you have a floppy image file that can be burned to a cdrom with floppy emulation mode as a boot image (I know k3b can do this, and otherwise mkisofs can be used from the command line to create an .iso with the floppy image embedded - you will have to check the command line options needed)

That's all - with any luck it should work.

----------

## tuner23

aehm, another thing.

the problem is now, the bios-update-file is ~3.2MB.

too big for a floppy-image.

the iso's are only ro-images,

and they does not support USB (on my mainboard at least)

Have you a tip for managing this?

Greets,

Antonis.

----------

## BradN

Ok, then you will have to use FreeDOS in a bootable floppy emulation, with the BIOS update on the actual ISO itself (like a normal data file), and load FreeDOS CD-ROM drivers - hopefully the BIOS program doesn't have to extract files, or you'll need to set up a ramdisk additionally!

Edit:  Apparently there is also a hard disk emulation boot mode, but I'm not sure of all the details on setting up the image for it.  One way offhand I can think of to get the filesystem correct is either making the partition with fdisk and then manually creating a loop device to access the partition (ie, offset from start of the device), then formatting that and installing proper bootloaders, etc.  This may be a lot of messing around.

Another way would be making a hard drive image, then booting a FreeDOS floppy image with an emulator like bochs or qemu and then installing FreeDOS to the "hard drive" image using that.  But that still leaves the BIOS update file to be loaded in, which would require yet another step.

Edit 2:  Ok, another way to get the BIOS update file into the hard drive image is by using the unix "split" utility to split the BIOS file into 4 files, and loading (up to) 1MB at a time, then use the ms-dos copy "+" operator to concatenate the files onto a virtual hard drive file.

example:

COPY A:BIOS.P01 C:BIOS1.TMP

reboot with next disk

COPY C:BIOS1.TMP+A:BIOS.P02 C:BIOS2.TMP

DEL C:BIOS1.TMP

reboot with next disk

COPY C:BIOS2.TMP+A:BIOS.P03 C:BIOS3.TMP

DEL C:BIOS2.TMP

reboot with next disk

COPY C:BIOS3.TMP+A:BIOS.P04 C:BIOSUTIL.EXE

DEL C:BIOS3.TMP

I'm starting to feel nostalgic already...

----------

## tuner23

ouh, 

i know now what all for nothing means, haha..

did not work with the dos-utils, last i tried was http://www.hiren.info/pages/bootcd

then i lend me a win7 cd, updated my bios, destroyed my copy with a hammer, but this did not work..

do someone knows a good mainboard for servers, where pci-passthrough and miscellaneous functions are working for a i5/i7-core?

thanks,

antonios.

----------

## tuner23

Okay,

i updated BIOS and with support from Gigabyte i enabled VT-d.

It works also with qflash integrated in BIOS-option and the BIOS-Update *.exe-file is an selfextracting archive.

You load the bin-file in a USB-Stick, enable "Legacy USB storage detect" and start qflash with f9 (you have to do some more thinks, best is to look at the homepage of your manufacturer or ask them for support.

--> Activating VT-d works by pressing Strg+F1 in the Advanced Chipset Features - Menu,

you get some more options then..

But in the end it did not solve my problem right now, cause now i have a message that my BIOS is broken, but i will handle this in another topic,

cause i think it is another problem.

Greets and thanks,

Antonios Dimtsoudis.

----------

## tuner23

Hy,

i want to enable PCI-passthrough and for this i need working DMA-remapping (DMAR).

Now i get the following error-message from kernel:

```

# dmesg | grep -e IOMMU -e DMAR

[ 0.000000] ACPI: DMAR 00000000d77ea940 000E8 (v01 IntelR AWRDACPI 322E3030 DRWA 00000002)

[ 0.000000] Your BIOS is broken; DMAR reported at address fed91000 returns all ones!

[ 0.012743] DMAR: Host address width 36

[ 0.012823] DMAR: DRHD base: 0x000000fed90000 flags: 0x0

[ 0.012908] IOMMU 0: reg_base_addr fed90000 ver 1:0 cap c9008020e30272 ecap 1000

[ 0.013046] DMAR: DRHD base: 0x000000fed91000 flags: 0x0

[ 0.013132] DMAR: parse DMAR table failure.

```

Ok, this means that the BIOS-manufactorer did not do propper work and returnd wrong values..

This is described here:

https://patchwork.kernel.org/patch/42841/

The docu of the IOMUMU is described here:

http://www.mjmwired.net/kernel/Documentation/Intel-IOMMU.txt

and this is the c-code that make me sweat:

http://lxr.free-electrons.com/source/drivers/pci/dmar.c

I'm not a BIOS-hacker or sth like this, so i can't really solve the problem in the right way (and i also have not enough mainboards for trial and error).

But i need my virtualized machine getting to work, so:

1. Are there some workarrounds for managing pci-passthrough on BIOSes with broken DMA-remapping table?

    I think there is maybe a software(-kernel)-based module, or maybe a solution in KVM to pass through PCI-Slots without working BIOS.

2. I have a 1156-Sloted mainboard with i5-Core 760 have someone a working mainboard for this?

    With dmesg and VT-d enabled there should be some output like:

```

     ...

     DMAR:DRHD base: 0x000000feb03000 flags: 0x0

     IOMMU feb03000: ver 1:0 cap c9008020e30260 ecap 1000

     ...

```

Look here:

http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM

Thanks in Advance,

Antonios Dimtsoudis.

----------

## s4e8

i5 760 don't support VT-d/DMAR at all.

----------

## tuner23

Okay, thanks.

Now i found the necessary Information:

http://ark.intel.com/ProductCollection.aspx?series=42913

so when i buy one with VT-d support you think it should work?

Or are there also other things to consider?

Maybe this one?

http://ark.intel.com/Product.aspx?id=52208&processor=i5-2400S&spec-codes=SR00S

But i have also to by a new mainboard with socket 1155?

Is there maybe a software solution for passing through PCI-slots?

Greets,

Antonios.

----------

## nixnut

merged above three posts here.

----------

## tuner23

Ok, 

so my Problem is not solved right now..

I want to buy maybe a iCore i5 2400S (maybe AMD is not so confusing with their Product IDs^^).

So i have also to by a new mainboard with socket 1155? 

Are there no CPUs with working VT-d for socket 1156? 

Or is there maybe a software solution for passing through PCI-slots (by the Kernel or with KVM)?

Greets,

Antonios.

----------

## s4e8

@tuner23

you can upgrade to core i7 860/870/875.

----------

## tuner23

Hy,

thank you for this hint very much.. 

i looked for a few cores and they all hadn't VT-d.

So i thought it's the whole series.

Now it seems to work.

Greets,

Antonios.

----------

