Commit dd6d87 breaks serial console
Hello,
The following commit:
commit dd6d87a4fcc8350c752e389abb3bcd8479c37555
Author: Jan Beulich <[email protected]> Date: Fri Jun 20 10:26:37 2014 +0200
VT-d: drop redundant calls to invalidate_sync()
The call tree iommu_flush_iec_index() -> __iommu_flush_iec() already invokes invalidate_sync(). Removing the superfluous instances at once allows the function to become static.
Breaks serial console on my box, this is all the output I get with this commit applied:
PXELINUX 4.02 debian-20101014 Copyright (C) 1994-2010 H. Peter Anvin et al boot:
Loading xen/xen_pvh7.gz... ok
Loading linux/vmlinuz-3.15.0-rc3+... ok
Loading linux/initrd.img-3.15.0-rc3+... ok
__ __ _ _ ____ _ _ _
\ \/ /___ _ __ | || | | ___| _ _ _ __ ___| |_ __ _| |__ | | ___ \ // _ \ '_ \ | || |_ |___ \ __| | | | '_ \/ __| __/ _` | '_ \| |/ _ \ / \ __/ | | | |__ _| ___) |__| |_| | | | \__ \ || (_| | |_) | | __/ /_/\_\___|_| |_| |_|(_)____/ \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
(XEN) Xen version 4.5-unstable (root@) (gcc (FreeBSD Ports Collection) 4.6.4) debug=y Mon Jul 14 18:01:10 CEST 2014 (XEN) Latest ChangeSet: Fri Jul 11 11:32:33 2014 +0800 git:7bddc6b
(XEN) Bootloader: PXELINUX 4.02 debian-20101014
(XEN) Command line: ioapic_ack=old dom0_max_vcpus=6 dom0_mem=1024M com1=115200,8n1 guest_loglvl=all loglvl=all console=com1 (XEN) Video information:
(XEN) VGA is text mode 80x25, font 8x16
(XEN) VBE/DDC methods: V2; EDID transfer time: 1 seconds
(XEN) Disc information:
(XEN) Found 2 MBR signatures
(XEN) Found 2 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN) 0000000000000000 - 0000000000092400 (usable) (XEN) 00000000000f0000 - 0000000000100000 (reserved) (XEN) 0000000000100000 - 00000000dfdf9c00 (usable) (XEN) 00000000dfdf9c00 - 00000000dfe4bc00 (ACPI NVS) (XEN) 00000000dfe4bc00 - 00000000dfe4dc00 (ACPI data) (XEN) 00000000dfe4dc00 - 00000000e0000000 (reserved) (XEN) 00000000f8000000 - 00000000fd000000 (reserved) (XEN) 00000000fe000000 - 00000000fed00400 (reserved) (XEN) 00000000fee00000 - 00000000fef00000 (reserved) (XEN) 00000000ffb00000 - 0000000100000000 (reserved) (XEN) 0000000100000000 - 00000001a0000000 (usable) (XEN) ACPI: RSDP 000FEC30, 0024 (r2 DELL ) (XEN) ACPI: XSDT 000FCCC7, 007C (r1 DELL B10K 15 ASL 61) (XEN) ACPI: FACP 000FCDB7, 00F4 (r3 DELL B10K 15 ASL 61) (XEN) ACPI: DSDT FFE9E951, 4A74 (r1 DELL dt_ex 1000 INTL 20050624) (XEN) ACPI: FACS DFDF9C00, 0040 (XEN) ACPI: SSDT FFEA34D6, 009C (r1 DELL st_ex 1000 INTL 20050624) (XEN) ACPI: APIC 000FCEAB, 015E (r1 DELL B10K 15 ASL 61) (XEN) ACPI: BOOT 000FD009, 0028 (r1 DELL B10K 15 ASL 61) (XEN) ACPI: ASF! 000FD031, 0096 (r32 DELL B10K 15 ASL 61) (XEN) ACPI: MCFG 000FD0C7, 003C (r1 DELL B10K 15 ASL 61) (XEN) ACPI: HPET 000FD103, 0038 (r1 DELL B10K 15 ASL 61) (XEN) ACPI: TCPA 000FD35F, 0032 (r1 DELL B10K 15 ASL 61) (XEN) ACPI: DMAR 000FD391, 00C8 (r1 DELL B10K 15 ASL 61) (XEN) ACPI: SLIC 000FD13B, 0176 (r1 DELL B10K 15 ASL 61)
(XEN) ACPI: SSDT DFE4DC00, 276C (r1 INTEL PPM RCM 80000001 INTL 20061109) (XEN) System RAM: 6141MB (6288940kB)
(XEN) No NUMA configuration found
(XEN) Faking a node at 0000000000000000-00000001a0000000
(XEN) Domain heap initialised
(XEN) DMI 2.5 present.
(XEN) Using APIC driver default
(XEN) ACPI: PM-Timer IO Port: 0x808
(XEN) ACPI: SLEEP INFO: pm1x_cnt[1:804,1:0], pm1x_evt[1:800,1:0]
(XEN) ACPI: wakeup_vec[dfdf9c0c], vec_size[20]
(XEN) ACPI: Local APIC address 0xfee00000
(XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
(XEN) Processor #0 7:10 APIC version 21
(XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)
(XEN) Processor #2 7:10 APIC version 21
(XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x04] enabled)
(XEN) Processor #4 7:10 APIC version 21
(XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x06] enabled)
(XEN) Processor #6 7:10 APIC version 21
(XEN) ACPI: LAPIC (acpi_id[0x05] lapic_id[0x01] enabled)
(XEN) Processor #1 7:10 APIC version 21
(XEN) ACPI: LAPIC (acpi_id[0x06] lapic_id[0x03] enabled)
(XEN) Processor #3 7:10 APIC version 21
(XEN) ACPI: LAPIC (acpi_id[0x07] lapic_id[0x05] enabled)
(XEN) Processor #5 7:10 APIC version 21
(XEN) ACPI: LAPIC (acpi_id[0x08] lapic_id[0x07] enabled)
(XEN) Processor #7 7:10 APIC version 21
(XEN) ACPI: LAPIC (acpi_id[0x09] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x10] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x11] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x12] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x13] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x14] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x15] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x16] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x17] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x18] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x19] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x1a] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x1b] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x1c] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x1d] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x1e] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x1f] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC (acpi_id[0x20] lapic_id[0x00] disabled)
(XEN) ACPI: LAPIC_NMI (acpi_id[0xff] high level lint[0x1])
(XEN) ACPI: IOAPIC (id[0x08] address[0xfec00000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 8, version 32, address 0xfec00000, GSI 0-23
(XEN) ACPI: IOAPIC (id[0x09] address[0xfec80000] gsi_base[24])
(XEN) IOAPIC[1]: apic_id 9, version 32, address 0xfec80000, GSI 24-47
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
(XEN) ACPI: IRQ0 used by override.
(XEN) ACPI: IRQ2 used by override.
(XEN) ACPI: IRQ9 used by override.
(XEN) Enabling APIC mode: Flat. Using 2 I/O APICs
(XEN) ACPI: HPET id: 0x8086a301 base: 0xfed00000
(XEN) ERST table was not found
(XEN) Using ACPI (MADT) for SMP configuration information
(XEN) SMP: Allowing 32 CPUs (24 hotplug CPUs)
(XEN) IRQ limits: 48 GSI, 1504 MSI/MSI-X
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 3066.835 MHz processor.
(XEN) Initing memory sharing.
(XEN) mce_intel.c:719: MCA Capability: BCAST 1 SER 0 CMCI 1 firstbank 0 extended MCE MSR 0 (XEN) Intel machine check reporting enabled
(XEN) alt table ffff82d0802d0450 -> ffff82d0802d1050
(XEN) PCI: MCFG configuration 0: base f8000000 segment 0000 buses 00 - 3f (XEN) PCI: MCFG area at f8000000 reserved in E820
(XEN) PCI: Using MCFG for segment 0000 bus 00-3f
(XEN) Intel VT-d iommu 0 supported page sizes: 4kB.
(XEN) Intel VT-d Snoop Control enabled.
(XEN) Intel VT-d Dom0 DMA Passthrough not enabled.
(XEN) Intel VT-d Queued Invalidation enabled.
(XEN) Intel VT-d Interrupt Remapping enabled.
(XEN) Intel VT-d Shared EPT tables not enabled.
(XEN) I/O virtualisation enabled
(XEN) - Dom0 mode: Relaxed
(XEN) Interrupt remapping enabled
(XEN) ENABLING IO-APIC IRQs
(XEN) -> Using old ACK method
(XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1
(XEN) Platform timer is 14.318MHz HPET
(XEN) Allocated console ring of 64 KiB.
(XEN) mwait-idle: MWAIT substates: 0x1120
(XEN) mwait-idle: v0.4 model 0x1a
(XEN) mwait-idle: lapic_timer_reliable_states 0x2
(XEN) HPET: 0 timers usable for broadcast (4 total)
(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) HVM: ASIDs enabled.
(XEN) HVM: VMX enabled
(XEN) HVM: Hardware Assisted Paging (HAP) detected (XEN) HVM: HAP page sizes: 4kB, 2MB
(
I'm attaching a revert of this patch, which makes serial output on my box work as expected.
Roger.
Quoted 1 line
From
0d3f767f4cd5a30909b8c9d76e15e10a45d7a05dMon Sep 17 00:00:00 2001
From: Roger Pau Monne <[email protected]>
Date: Mon, 14 Jul 2014 17:54:49 +0200
Subject: [PATCH] Revert "VT-d: drop redundant calls to invalidate_sync()"
This reverts commit dd6d87a4fcc8350c752e389abb3bcd8479c37555.
The call tree iommu_flush_iec_index() -> __iommu_flush_iec() already invokes invalidate_sync(). Removing the superfluous instances at once allows the function to become static.
--- xen/drivers/passthrough/vtd/extern.h | 1 + xen/drivers/passthrough/vtd/intremap.c | 2 ++ xen/drivers/passthrough/vtd/qinval.c | 2 +- 3 files changed, 4 insertions(+), 1 deletions(-)
xen/drivers/passthrough/vtd/extern.h +1 -0
@@ -42,6 +42,7 @@ void iommu_flush_cache_page(void *addr, unsigned long npages);int iommu_alloc (struct acpi_drhd_unit *drhd);void iommu_free (struct acpi_drhd_unit *drhd); +int invalidate_sync (struct iommu *iommu);int iommu_flush_iec_global (struct iommu *iommu);int iommu_flush_iec_index (struct iommu *iommu,u8 im,u16 iidx);void clear_fault_bits (struct iommu *iommu);
xen/drivers/passthrough/vtd/intremap.c +2 -0
@@ -358,6 +358,7 @@ static int ioapic_rte_to_remap_entry(struct iommu *iommu,memcpy (iremap_entry, &new_ire,sizeof (struct iremap_entry ));iommu_flush_cache_entry (iremap_entry,sizeof (struct iremap_entry ));iommu_flush_iec_index (iommu,0 , index); +invalidate_sync (iommu);unmap_vtd_domain_page (iremap_entries);spin_unlock_irqrestore (&ir_ctrl->iremap_lock, flags);
@@ -642,6 +643,7 @@ static int msi_msg_to_remap_entry(memcpy (iremap_entry, &new_ire,sizeof (struct iremap_entry ));iommu_flush_cache_entry (iremap_entry,sizeof (struct iremap_entry ));iommu_flush_iec_index (iommu,0 , index); +invalidate_sync (iommu);unmap_vtd_domain_page (iremap_entries);spin_unlock_irqrestore (&ir_ctrl->iremap_lock, flags);
xen/drivers/passthrough/vtd/qinval.c +1 -1
@@ -181,7 +181,7 @@ static int queue_invalidate_wait(struct iommu *iommu,return -EOPNOTSUPP ; } -static int invalidate_sync (struct iommu *iommu) +int invalidate_sync (struct iommu *iommu) {struct qi_ctrl *qi_ctrl =iommu_qi_ctrl (iommu);
Signature · 1 line
1.7.7.5 (Apple Git-26)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 14 lines · Roger Pau Monné
Hello,
The following commit:
commit
dd6d87a4fcc8350c752e389abb3bcd8479c37555Author: Jan Beulich <[email protected]> Date: Fri Jun 20 10:26:37 2014 +0200VT-d: drop redundant calls to
invalidate_sync()The call tree
iommu_flush_iec_index()->__iommu_flush_iec()already invokesinvalidate_sync(). Removing the superfluous instances at once allows the function to become static.
Quoted 6 lines
Signed-off-by Jan Beulich <[email protected]>Reviewed-by Andrew Cooper <[email protected]>Acked-by Yang Zhang <[email protected]>Breaks serial console on my box, this is all the output I get with this commit applied:
Are you sure you have bisected this correctly?
Unless there is some hardware side-effect of issuing two qinvalidate wait descriptors back-to-back, the change still looks to be good. Alternately, are we missing a hardware erratum for your system?
~Andrew
Quoted 19 lines · Andrew Cooper
Quoted 18 lines · Roger Pau Monné
Hello,
The following commit:
commit
dd6d87a4fcc8350c752e389abb3bcd8479c37555Author: Jan Beulich <[email protected]> Date: Fri Jun 20 10:26:37 2014 +0200VT-d: drop redundant calls to
invalidate_sync()The call tree
iommu_flush_iec_index()->__iommu_flush_iec()already invokesinvalidate_sync(). Removing the superfluous instances at once allows the function to become static.Signed-off-by Jan Beulich <[email protected]>Reviewed-by Andrew Cooper <[email protected]>Acked-by Yang Zhang <[email protected]>
Quoted 8 lines
Quoted 2 lines
Breaks serial console on my box, this is all the output I get with this commit applied:
Are you sure you have bisected this correctly?
Unless there is some hardware side-effect of issuing two qinvalidate wait descriptors back-to-back, the change still looks to be good. Alternately, are we missing a hardware erratum for your system?
Just for the record, setting iommu=no-intremap solves the problem, so I'm quite sure I've bisected it right. This is on a Xeon W3550, I can provide whatever other hardware information is needed.
Roger.
Roger Pau Monné wrote on 2014-07-15:
Quoted 24 lines · Andrew Cooper
Quoted 23 lines · Roger Pau Monné
Quoted 14 lines
Hello,
The following commit:
commit
dd6d87a4fcc8350c752e389abb3bcd8479c37555Author: Jan Beulich <[email protected]> Date: Fri Jun 20 10:26:37 2014 +0200VT-d: drop redundant calls to
invalidate_sync()The call tree
iommu_flush_iec_index()->__iommu_flush_iec()already invokesinvalidate_sync(). Removing the superfluous instances at once allows the function to become static.Quoted 5 lines
Signed-off-by Jan Beulich <[email protected]>Reviewed-by Andrew Cooper <[email protected]>Acked-by Yang Zhang <[email protected]>Breaks serial console on my box, this is all the output I get with this commit applied:
Are you sure you have bisected this correctly?
Quoted 7 lines
Quoted 3 lines
Unless there is some hardware side-effect of issuing two qinvalidate wait descriptors back-to-back, the change still looks to be good. Alternately, are we missing a hardware erratum for your system?
Just for the record, setting iommu=no-intremap solves the problem, so I'm quite sure I've bisected it right. This is on a Xeon W3550, I can provide whatever other hardware information is needed.
It is so strange. The patch is really simple. Does Xen still alive when serial console breaks? Also, can you try to add invalidate_sync one by one to figure which one caused the problem?
Quoted 2 lines
Roger.
Best regards,
Yang
Quoted 17 lines
Quoted 1 line
Quoted 1 line · On 14.07.14 at 18:07, <[email protected]> wrote:
The following commit:
commit
dd6d87a4fcc8350c752e389abb3bcd8479c37555Author: Jan Beulich <[email protected]> Date: Fri Jun 20 10:26:37 2014 +0200VT-d: drop redundant calls to
invalidate_sync()The call tree
iommu_flush_iec_index()->__iommu_flush_iec()already invokesinvalidate_sync(). Removing the superfluous instances at once allows the function to become static.Signed-off-by Jan Beulich <[email protected]>Reviewed-by Andrew Cooper <[email protected]>Acked-by Yang Zhang <[email protected]>
Quoted 5 lines
Breaks serial console on my box, this is all the output I get with this commit applied:
[...]
I'm attaching a revert of this patch, which makes serial output on my box work as expected.
Just to augment what others already said - in situations like this, requesting a revert without any understanding/explanation of what's actually wrong, or at least under what specific conditions the issue occurs (since clearly the serial console has been working fine for me and likely others) is generally insufficient.
Jan
Quoted 29 lines · Yang Z
Roger Pau Monné wrote on 2014-07-15:
Quoted 28 lines · Andrew Cooper
Quoted 26 lines · Roger Pau Monné
Quoted 14 lines
Hello,
The following commit:
commit
dd6d87a4fcc8350c752e389abb3bcd8479c37555Author: Jan Beulich <[email protected]> Date: Fri Jun 20 10:26:37 2014 +0200VT-d: drop redundant calls to
invalidate_sync()The call tree
iommu_flush_iec_index()->__iommu_flush_iec()already invokesinvalidate_sync(). Removing the superfluous instances at once allows the function to become static.Quoted 5 lines
Signed-off-by Jan Beulich <[email protected]>Reviewed-by Andrew Cooper <[email protected]>Acked-by Yang Zhang <[email protected]>Breaks serial console on my box, this is all the output I get with this commit applied:
Are you sure you have bisected this correctly?
Unless there is some hardware side-effect of issuing two qinvalidate wait descriptors back-to-back, the change still looks to be good. Alternately, are we missing a hardware erratum for your system?
Quoted 5 lines
Quoted 3 lines
Just for the record, setting iommu=no-intremap solves the problem, so I'm quite sure I've bisected it right. This is on a Xeon W3550, I can provide whatever other hardware information is needed.
It is so strange. The patch is really simple. Does Xen still alive when serial console breaks? Also, can you try to add
invalidate_syncone by one to figure which one caused the problem?
Yes, Xen seems to work fine (apart from the serial console), I can access Dom0 using ssh and create guests.
The invalidate_sync that prevents this problem is the one in ioapic_rte_to_remap_entry, I have successfully removed the other invalidate_sync in msi_msg_to_remap_entry without problems.
Roger.
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 23.07.14 at 10:31, <[email protected]> wrote:
Quoted 1 line · Yang Z
It is so strange. The patch is really simple. Does Xen still alive when
serial console breaks? Also, can you try to add
invalidate_syncone by one to figure which one caused the problem?
Quoted 6 lines
Yes, Xen seems to work fine (apart from the serial console), I can access Dom0 using ssh and create guests.
The
invalidate_syncthat prevents this problem is the one inioapic_rte_to_remap_entry, I have successfully removed the otherinvalidate_syncinmsi_msg_to_remap_entrywithout problems.
That's meaningless, as MSI isn't involved in serial console handling.
Jan