All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, rkrcmar@redhat.com, ehabkost@redhat.com,
	mst@redhat.com, mtosatti@redhat.com, kevin@koconnor.net,
	pbonzini@redhat.com, lersek@redhat.com, tianyu.lan@intel.com,
	yong.y.wang@intel.com, Luiz Capitulino <lcapitulino@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH for-2.8 00/18] pc: q35: x2APIC support in kvm_apic mode
Date: Thu, 11 Aug 2016 13:10:57 +0800	[thread overview]
Message-ID: <20160811051057.GC18338@pxdev.xzpeter.org> (raw)
In-Reply-To: <20160810105151.1d015388@nial.brq.redhat.com>

On Wed, Aug 10, 2016 at 10:51:51AM +0200, Igor Mammedov wrote:

[...]

> > > Upstream guest kernel 4.7.0+ (d52bd54db) crashes when booting with irq remapping on:
> > > 
> > > ./qemu-system-x86_64 -enable-kvm -smp 1,sockets=9,cores=32,threads=1,maxcpus=288 -device qemu64-x86_64-cpu,socket-id=8,core-id=30,thread-id=0 -bios x2apic_bios.bin  -m 1G -nographic -device intel-iommu,intremap=on -machine q35,kernel-irqchip=split -snapshot -global ioapic.version=0x20 /dev/rhel72
> > > 
> > > 
> > > [    0.350669] smpboot: Max logical packages: 9
> > > [    0.351853] smpboot: APIC(0) Converting physical 0 to logical package 0
> > > [    0.353160] smpboot: APIC(11e) Converting physical 8 to logical package 1
> > > [    0.354627] DMAR: Host address width 39
> > > [    0.355621] DMAR: DRHD base: 0x000000fed90000 flags: 0x1
> > > [    0.356785] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 12008c22260206 ecap f00f1a
> > > [    0.358721] DMAR-IR: IOAPIC id 0 under DRHD base  0xfed90000 IOMMU 0
> > > [    0.360029] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
> > > [    0.364605] DMAR-IR: Enabled IRQ remapping in x2apic mode
> > > [    0.365805] BUG: unable to handle kernel NULL pointer dereference at           (null)
> > > [    0.367965] IP: [<ffffffff8105b025>] x2apic_cluster_probe+0x35/0x70
> > > [    0.369373] PGD 0 
> > > [    0.370258] Oops: 0002 [#1] SMP
> > > [    0.371140] Modules linked in:
> > > [    0.372150] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.7.0+ #647
> > > [    0.373485] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.9.0-143-gbac87e4 04/01/2014
> > > [    0.375622] task: ffff880039ad0000 task.stack: ffff880039ad8000
> > > [    0.376875] RIP: 0010:[<ffffffff8105b025>]  [<ffffffff8105b025>] x2apic_cluster_probe+0x35/0x70
> > > [    0.379066] RSP: 0000:ffff880039adbe28  EFLAGS: 00010202
> > > [    0.380299] RAX: 0000000000000000 RBX: ffffffff81f388a8 RCX: ffff880039e00000
> > > [    0.381677] RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000246
> > > [    0.383096] RBP: ffff880039adbe28 R08: 00000000000000c6 R09: ffff8800000b9b80
> > > [    0.384579] R10: 00000000000000a0 R11: 0000000000000050 R12: 0000000000002000
> > > [    0.385990] R13: 000000000000a118 R14: 000000000000011f R15: 0000000000000120
> > > [    0.387448] FS:  0000000000000000(0000) GS:ffff880039e00000(0000) knlGS:0000000000000000
> > > [    0.389454] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > > [    0.390697] CR2: 0000000000000000 CR3: 0000000001c06000 CR4: 00000000000006f0
> > > [    0.392114] Stack:
> > > [    0.392889]  ffff880039adbe40 ffffffff81da277c 000000000000a110 ffff880039adbe78
> > > [    0.395135]  ffffffff81d9c055 ffffffff81f14c60 ffff880039ad0a58 ffffffff81c95ac0
> > > [    0.397469]  ffffffff818232c0 ffff880039ad0000 ffff880039adbf38 ffffffff81d86293
> > > [    0.399695] Call Trace:
> > > [    0.400529]  [<ffffffff81da277c>] default_setup_apic_routing+0x28/0x69
> > > [    0.401881]  [<ffffffff81d9c055>] native_smp_prepare_cpus+0x223/0x2d2
> > > [    0.403260]  [<ffffffff81d86293>] kernel_init_freeable+0xd8/0x249
> > > [    0.404525]  [<ffffffff816d1b2e>] kernel_init+0xe/0x110
> > > [    0.405703]  [<ffffffff816deb3f>] ret_from_fork+0x1f/0x40
> > > [    0.406966]  [<ffffffff816d1b20>] ? rest_init+0x80/0x80
> > > [    0.408165] Code: 00 31 c0 65 8b 15 2c f1 fa 7e 85 c9 75 01 c3 48 63 ca 55 48 c7 c0 10 d7 00 00 48 8b 0c cd 20 8d d4 81 89 d2 48 89 e5 48 8b 04 08 <f0> 48 0f ab 10 49 c7 c0 60 b0 05 81 48 c7 c1 a0 ae 05 81 ba 01 
> > > [    0.417107] RIP  [<ffffffff8105b025>] x2apic_cluster_probe+0x35/0x70
> > > [    0.418516]  RSP <ffff880039adbe28>
> > > [    0.419461] CR2: 0000000000000000
> > > [    0.420386] ---[ end trace f68728a0d3053b52 ]---  

I failed to reproduce this panic on my machine with parameter:

bin=x86_64-softmmu/qemu-system-x86_64
$bin -M q35,kernel-irqchip=split -enable-kvm -m 2048 \
     -monitor stdio -smp 4 \
     -device intel-iommu,intremap=on \
     -netdev user,id=net0,hostfwd=tcp::5555-:22 \
     -device e1000,netdev=net0 \
     -kernel /root/git/linux/arch/x86/boot/bzImage \
     -append root=/dev/sda3 \
     /root/images/rhel-7.2.qcow2

Guest kernel version is exactly 4.7.0+ (d52bd54db). In the guest, I
see x2apic enabled. Did I miss anything special?

[...]

> adding x2apic_phys to kernel's command line makes it crash but at another place:
> 
> [    0.364909] smpboot: Max logical packages: 9
> [    0.365838] smpboot: APIC(0) Converting physical 0 to logical package 0
> [    0.367183] smpboot: APIC(11e) Converting physical 8 to logical package 1
> [    0.370291] x2apic: IRQ remapping doesn't support X2APIC mode
> [    0.371901] x2apic disabled

Failed to understand why x2apic_phys will affect the system if x2apic
is disabled after all.

Thanks!

-- peterx

  reply	other threads:[~2016-08-11  5:11 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05  9:45 [Qemu-devel] [PATCH for-2.8 00/18] pc: q35: x2APIC support in kvm_apic mode Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 01/18] numa: reduce code duplication by adding helper numa_get_node_for_cpu() Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 02/18] acpi: provide _PXM method for CPU devices if QEMU is started numa enabled Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 03/18] tests: acpi: extend cphp testcase with numa check Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 04/18] linux-headers: update to v4.8-rc1 Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 05/18] pc: acpi: x2APIC support for MADT table Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 06/18] pc: acpi: x2APIC support for SRAT table Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 07/18] acpi: cphp: support x2APIC entry in cpu._MAT Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 08/18] acpi: cphp: force switch to modern cpu hotplug if APIC ID > 254 Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 09/18] pc: leave max apic_id_limit only in legacy cpu hotplug code Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 10/18] pc: apic_common: extend APIC ID property to 32bit Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 11/18] pc: apic_common: restore APIC ID to initial ID on reset Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 12/18] pc: apic_common: reset APIC ID to initial ID when switching into x2APIC mode Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 13/18] pc: kvm_apic: pass APIC ID depending on xAPIC/x2APIC mode Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 14/18] pc: clarify FW_CFG_MAX_CPUS usage comment Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 15/18] increase MAX_CPUMASK_BITS from 255 to 288 Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 16/18] pc: add 'etc/boot-cpus' fw_cfg file for machine with more than 255 CPUs Igor Mammedov
2016-08-07  6:02   ` Michael S. Tsirkin
2016-08-08 11:40     ` Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 17/18] pc: add 2.8 machine Igor Mammedov
2016-08-05  9:46 ` [Qemu-devel] [PATCH for-2.8 18/18] pc: q35: bump max_cpus to 288 Igor Mammedov
2016-08-08  7:41 ` [Qemu-devel] [PATCH for-2.8 00/18] pc: q35: x2APIC support in kvm_apic mode Chao Gao
2016-08-08  8:57   ` Peter Xu
2016-08-09  4:33     ` Chao Gao
2016-08-09  6:18       ` Peter Xu
2016-08-09  6:24         ` Peter Xu
2016-08-09  6:33           ` Jan Kiszka
2016-08-09  7:09             ` Peter Xu
2016-08-09 12:41               ` Radim Krčmář
2016-08-09  8:19         ` Chao Gao
2016-08-09 12:51           ` Radim Krčmář
2016-09-22  4:34             ` Chao Gao
2016-09-23  5:26               ` Peter Xu
2016-09-23  5:58                 ` Lan Tianyu
2016-08-09  8:28     ` Igor Mammedov
2016-08-09 13:35       ` Peter Xu
2016-08-09 13:39         ` Luiz Capitulino
2016-08-10  8:51         ` Igor Mammedov
2016-08-10  8:51           ` [Qemu-devel] " Igor Mammedov
2016-08-11  5:10           ` Peter Xu [this message]
2016-08-11  8:56             ` Igor Mammedov
2016-08-11  8:56               ` [Qemu-devel] " Igor Mammedov
2016-08-08  9:18   ` Igor Mammedov
2016-08-09  3:23     ` Chao Gao
2016-08-09  8:18       ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160811051057.GC18338@pxdev.xzpeter.org \
    --to=peterx@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=kvm@vger.kernel.org \
    --cc=lcapitulino@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkrcmar@redhat.com \
    --cc=tianyu.lan@intel.com \
    --cc=yong.y.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.