[Xen-devel] Buggy IOMMU support in Coreboot on Chromebook Pixel 2 i7-5600U

2015-08-14 Thread fowlslegs
On the VT-d troubleshooting page, I was informed to shoot you all a 
message if Xen had to deactivate my VT-d due to errors in my BIOS (in 
this case Coreboot). I am running John Lewis' Coreboot ROM for the 
Chromebook Pixel 2 (samus) w/ the i7-5600U processor and Xen 4.4.2 on 
Qubes. I downloaded and cracked open (for lack of better words) John 
Lewis's Coreboot image (which is a modified version of the one in the 
Google repos) and found that src/arch/x86/acpi.c had the same section 
added by the http://review.coreboot.org/#/c/1654/ commit written by 
Patrick Georgi a few years back that is supposed to provide ACPI DMAR 
tables. The problem might just be the code is out of date for modern 
processors or maybe it has just not been tested against many CPUs.


It does appear that there has been changes to this acpi.c file in the 
Coreboot master branch, which makes me wonder if building against that 
would fix my problems. Realistically though, I have barely any 
experience or knowledge with Coreboot hacking and I'm assuming there is 
a web of dependencies that I couldn't figure out without possibly months 
of research, trial, and error.


Anyway, just wanted to send in this report as maybe you don't get too 
many involving Coreboot and maybe you might find it interesting or in 
the minute chance you might be able to help me out. Anyway, here's the 
output of `xl dmesg`:



Xen 4.4.2-6.fc20
(XEN) Xen version 4.4.2 (user@) (gcc (GCC) 4.8.3 20140911 (Red Hat 
4.8.3-7)) debug=n Thu Jul 23 20:12:15 UTC 2015

(XEN) Latest ChangeSet:
(XEN) Bootloader: GRUB 2.00
(XEN) Command line: placeholder console=none dom0_mem=min:1024M
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN) Disc information:
(XEN)  Found 2 MBR signatures
(XEN)  Found 2 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)   - 0009fc00 (usable)
(XEN)  0009fc00 - 000a (reserved)
(XEN)  000f - 0010 (reserved)
(XEN)  0010 - 7ce27000 (usable)
(XEN)  7ce27000 - 8000 (reserved)
(XEN)  f000 - f400 (reserved)
(XEN)  fed1 - fed1a000 (reserved)
(XEN)  fed4 - fed45000 (reserved)
(XEN)  fed8 - fed85000 (reserved)
(XEN)  0001 - 00047f00 (usable)
(XEN) ACPI: RSDP 000F2760, 0024 (r2 CORE  )
(XEN) ACPI: XSDT 7CF440E0, 004C (r1 CORE   COREBOOT0 CORE
0)
(XEN) ACPI: FACP 7CF48970, 00F4 (r5 CORE   COREBOOT0 CORE
1)
(XEN) ACPI: DSDT 7CF44250, 4720 (r2 COREv4 COREBOOT 20110725 INTL 
20130117)

(XEN) ACPI: FACS 7CF44210, 0040
(XEN) ACPI: HPET 7CF48A70, 0038 (r1 CORE   COREBOOT0 CORE
0)
(XEN) ACPI: APIC 7CF48AB0, 006C (r1 CORE   COREBOOT0 CORE
0)
(XEN) ACPI: MCFG 7CF48B20, 003C (r1 CORE   COREBOOT0 CORE
0)
(XEN) ACPI: SSDT 7CF49BC0, 0FF8 (r2 CORE   COREBOOT   2A CORE   
2A)

(XEN) System RAM: 16317MB (16709400kB)
(XEN) Domain heap initialised
(XEN) Processor #0 7:13 APIC version 21
(XEN) Processor #1 7:13 APIC version 21
(XEN) Processor #3 7:13 APIC version 21
(XEN) Processor #2 7:13 APIC version 21
(XEN) IOAPIC[0]: apic_id 2, version 32, address 0xfec0, GSI 0-39
(XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
(XEN) Not enabling x2APIC: depends on iommu_supports_eim.
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 2394.544 MHz processor.
(XEN) Initing memory sharing.
(XEN) xstate_init: using cntxt_size: 0x340 and states: 0x7
(XEN) I/O virtualisation disabled
(XEN) Enabled directed EOI with ioapic_ack_old on!
(XEN) ENABLING IO-APIC IRQs
(XEN)  - Using old ACK method
(XEN) Platform timer is 14.318MHz HPET
(XEN) Allocated console ring of 16 KiB.
(XEN) VMX: Supported advanced features:
(XEN)  - APIC MMIO access virtualisation
(XEN)  - APIC TPR shadow
(XEN)  - Extended Page Tables (EPT)
(XEN)  - Virtual-Processor Identifiers (VPID)
(XEN)  - Virtual NMI
(XEN)  - MSR direct-access bitmap
(XEN)  - Unrestricted Guest
(XEN) HVM: ASIDs enabled.
(XEN) HVM: VMX enabled
(XEN) HVM: Hardware Assisted Paging (HAP) detected
(XEN) HVM: HAP page sizes: 4kB, 2MB, 1GB
(XEN) Brought up 4 CPUs
(XEN) *** LOADING DOMAIN 0 ***
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x100 - 0x204d000
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   00046800-00047000 (4056562 pages 
to be allocated)

(XEN)  Init. ramdisk: 00047cb6a000-00047f00
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: 8100-8204d000
(XEN)  Init. ramdisk: -
(XEN)  Phys-Mach map: 8204d000-83f92440
(XEN)  Start info:83f93000-83f934b4
(XEN)  Page tables:   83f94000-83fb9000
(XEN)  Boot stack:83fb9000-83fba000
(XEN)  TOTAL: 8000-8440
(XEN)  ENTRY ADDRESS: 

Re: [Xen-devel] Buggy IOMMU support in Coreboot on Chromebook Pixel 2 i7-5600U

2015-08-14 Thread fowlslegs

On 2015-08-14 01:41, Andrew Cooper wrote:

On 14/08/15 08:13, fowlsl...@riseup.net wrote:
On the VT-d troubleshooting page, I was informed to shoot you all a 
message if Xen had to deactivate my VT-d due to errors in my BIOS (in 
this case Coreboot). I am running John Lewis' Coreboot ROM for the 
Chromebook Pixel 2 (samus) w/ the i7-5600U processor and Xen 4.4.2 on 
Qubes. I downloaded and cracked open (for lack of better words) John 
Lewis's Coreboot image (which is a modified version of the one in the 
Google repos) and found that src/arch/x86/acpi.c had the same section 
added by the http://review.coreboot.org/#/c/1654/ commit written by 
Patrick Georgi a few years back that is supposed to provide ACPI DMAR 
tables. The problem might just be the code is out of date for modern 
processors or maybe it has just not been tested against many CPUs.


It does appear that there has been changes to this acpi.c file in the 
Coreboot master branch, which makes me wonder if building against that 
would fix my problems. Realistically though, I have barely any 
experience or knowledge with Coreboot hacking and I'm assuming there 
is a web of dependencies that I couldn't figure out without possibly 
months of research, trial, and error.


Anyway, just wanted to send in this report as maybe you don't get too 
many involving Coreboot and maybe you might find it interesting or in 
the minute chance you might be able to help me out. Anyway, here's the 
output of `xl dmesg`:


Please reboot and use iommu=verbose,debug on the Xen command line,
which will offer more information.

~Andrew



I was already passing iommu=verbose, but not debug as well. Here is the 
new log


 Xen 4.4.2-6.fc20
(XEN) Xen version 4.4.2 (user@) (gcc (GCC) 4.8.3 20140911 (Red Hat 
4.8.3-7)) debug=n Thu Jul 23 20:12:15 UTC 2015

(XEN) Latest ChangeSet:
(XEN) Bootloader: GRUB 2.00
(XEN) Command line: placeholder console=none dom0_mem=min:1024M 
iommu=verbose,debug

(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN) Disc information:
(XEN)  Found 2 MBR signatures
(XEN)  Found 2 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)   - 0009fc00 (usable)
(XEN)  0009fc00 - 000a (reserved)
(XEN)  000f - 0010 (reserved)
(XEN)  0010 - 7ce27000 (usable)
(XEN)  7ce27000 - 8000 (reserved)
(XEN)  f000 - f400 (reserved)
(XEN)  fed1 - fed1a000 (reserved)
(XEN)  fed4 - fed45000 (reserved)
(XEN)  fed8 - fed85000 (reserved)
(XEN)  0001 - 00047f00 (usable)
(XEN) ACPI: RSDP 000F2760, 0024 (r2 CORE  )
(XEN) ACPI: XSDT 7CF440E0, 004C (r1 CORE   COREBOOT0 CORE
0)
(XEN) ACPI: FACP 7CF48970, 00F4 (r5 CORE   COREBOOT0 CORE
1)
(XEN) ACPI: DSDT 7CF44250, 4720 (r2 COREv4 COREBOOT 20110725 INTL 
20130117)

(XEN) ACPI: FACS 7CF44210, 0040
(XEN) ACPI: HPET 7CF48A70, 0038 (r1 CORE   COREBOOT0 CORE
0)
(XEN) ACPI: APIC 7CF48AB0, 006C (r1 CORE   COREBOOT0 CORE
0)
(XEN) ACPI: MCFG 7CF48B20, 003C (r1 CORE   COREBOOT0 CORE
0)
(XEN) ACPI: SSDT 7CF49BC0, 0FF8 (r2 CORE   COREBOOT   2A CORE   
2A)

(XEN) System RAM: 16317MB (16709400kB)
(XEN) Domain heap initialised
(XEN) Processor #0 7:13 APIC version 21
(XEN) Processor #1 7:13 APIC version 21
(XEN) Processor #3 7:13 APIC version 21
(XEN) Processor #2 7:13 APIC version 21
(XEN) IOAPIC[0]: apic_id 2, version 32, address 0xfec0, GSI 0-39
(XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
(XEN) Not enabling x2APIC: depends on iommu_supports_eim.
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 2394.503 MHz processor.
(XEN) Initing memory sharing.
(XEN) xstate_init: using cntxt_size: 0x340 and states: 0x7
(XEN) I/O virtualisation disabled
(XEN) Enabled directed EOI with ioapic_ack_old on!
(XEN) ENABLING IO-APIC IRQs
(XEN)  - Using old ACK method
(XEN) Platform timer is 14.318MHz HPET
(XEN) Allocated console ring of 16 KiB.
(XEN) VMX: Supported advanced features:
(XEN)  - APIC MMIO access virtualisation
(XEN)  - APIC TPR shadow
(XEN)  - Extended Page Tables (EPT)
(XEN)  - Virtual-Processor Identifiers (VPID)
(XEN)  - Virtual NMI
(XEN)  - MSR direct-access bitmap
(XEN)  - Unrestricted Guest
(XEN) HVM: ASIDs enabled.
(XEN) HVM: VMX enabled
(XEN) HVM: Hardware Assisted Paging (HAP) detected
(XEN) HVM: HAP page sizes: 4kB, 2MB, 1GB
(XEN) Brought up 4 CPUs
(XEN) *** LOADING DOMAIN 0 ***
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x100 - 0x204d000
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   00046800-00047000 (4056562 pages 
to be allocated)

(XEN)  Init. ramdisk: 00047cb6a000-00047f00
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: 8100-8204d000
(XEN)  Init. ramdisk: