From: "Woodhouse, David" <dwmw@amazon.co.uk>
To: "peter.maydell@linaro.org" <peter.maydell@linaro.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"cfontana@suse.de" <cfontana@suse.de>
Cc: "ehabkost@redhat.com" <ehabkost@redhat.com>,
"philmd@redhat.com" <philmd@redhat.com>,
"lovemrd@gmail.com" <lovemrd@gmail.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"alxndr@bu.edu" <alxndr@bu.edu>
Subject: Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base
Date: Mon, 29 Nov 2021 11:39:57 +0000 [thread overview]
Message-ID: <1102c315addf2f2fffc49222ab5be118e7ae9b0f.camel@amazon.co.uk> (raw)
In-Reply-To: <20210723112921.12637-1-cfontana@suse.de>
On Fri, 2021-07-23 at 13:29 +0200, Claudio Fontana wrote:
> static void kvm_cpu_instance_init(CPUState *cs)
> {
> X86CPU *cpu = X86_CPU(cs);
> + X86CPUClass *xcc = X86_CPU_GET_CLASS(cpu);
>
> host_cpu_instance_init(cpu);
>
> - if (!kvm_irqchip_in_kernel()) {
> - x86_cpu_change_kvm_default("x2apic", "off");
> - } else if (kvm_irqchip_is_split() && kvm_enable_x2apic()) {
> - x86_cpu_change_kvm_default("kvm-msi-ext-dest-id", "on");
> - }
> -
> - /* Special cases not set in the X86CPUDefinition structs: */
> + if (xcc->model) {
> + /* only applies to builtin_x86_defs cpus */
> + if (!kvm_irqchip_in_kernel()) {
> + x86_cpu_change_kvm_default("x2apic", "off");
> + } else if (kvm_irqchip_is_split() && kvm_enable_x2apic()) {
> + x86_cpu_change_kvm_default("kvm-msi-ext-dest-id", "on");
> + }
>
> - x86_cpu_apply_props(cpu, kvm_default_props);
> + /* Special cases not set in the X86CPUDefinition structs: */
> + x86_cpu_apply_props(cpu, kvm_default_props);
> + }
>
I think this causes a regression in x2apic and kvm-msi-ext-dest-id
support. If you start qemu thus:
qemu-system-x86_64 -machine q35,accel=kvm,usb=off,kernel_irqchip=split -cpu host -smp 288,sockets=9,cores=16,threads=2
The guest now sees those features, but we don't actually call
kvm_enable_x2apic() so the APIC broadcast quirk doesn't get disabled,
and interrupts targeted at APIC ID 255 are interpreted as broadcasts:
[ 73.198504] __common_interrupt: 0.34 No irq handler for vector
[ 73.198515] __common_interrupt: 11.34 No irq handler for vector
[ 73.198517] __common_interrupt: 12.34 No irq handler for vector
[ 73.198521] __common_interrupt: 15.34 No irq handler for vector
[ 73.198524] __common_interrupt: 17.34 No irq handler for vector
[ 73.198528] __common_interrupt: 34.34 No irq handler for vector
[ 73.198529] __common_interrupt: 20.34 No irq handler for vector
[ 73.198533] __common_interrupt: 41.34 No irq handler for vector
[ 73.198539] __common_interrupt: 27.34 No irq handler for vector
[ 73.198542] __common_interrupt: 28.34 No irq handler for vector
Amazon Development Centre (London) Ltd. Registered in England and Wales with registration number 04543232 with its registered office at 1 Principal Place, Worship Street, London EC2A 2FA, United Kingdom.
next prev parent reply other threads:[~2021-11-29 14:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-23 11:29 [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base Claudio Fontana
2021-11-29 11:39 ` Woodhouse, David [this message]
2021-11-29 14:14 ` Claudio Fontana
2021-11-29 15:11 ` David Woodhouse
2021-11-29 16:57 ` Claudio Fontana
2021-11-29 17:03 ` Claudio Fontana
2021-11-29 17:17 ` David Woodhouse
2021-11-29 19:10 ` Claudio Fontana
2021-11-29 19:19 ` David Woodhouse
2021-11-29 19:55 ` Claudio Fontana
2021-11-29 20:29 ` David Woodhouse
2021-11-30 9:00 ` Claudio Fontana
2021-11-30 12:13 ` David Woodhouse
2021-11-30 13:42 ` [PATCH 1/2] target/i386: Fix sanity check on max APIC ID / X2APIC enablement David Woodhouse
2021-11-30 13:42 ` [PATCH 2/2] intel_iommu: Fix irqchip / X2APIC configuration checks David Woodhouse
2021-11-30 14:31 ` Claudio Fontana
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=1102c315addf2f2fffc49222ab5be118e7ae9b0f.camel@amazon.co.uk \
--to=dwmw@amazon.co.uk \
--cc=alxndr@bu.edu \
--cc=cfontana@suse.de \
--cc=ehabkost@redhat.com \
--cc=lovemrd@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).