[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions fo
From: |
Woodhouse, David |
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 |
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.
- Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base,
Woodhouse, David <=
- Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base, Claudio Fontana, 2021/11/29
- Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base, David Woodhouse, 2021/11/29
- Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base, Claudio Fontana, 2021/11/29
- Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base, Claudio Fontana, 2021/11/29
- Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base, David Woodhouse, 2021/11/29
- Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base, Claudio Fontana, 2021/11/29
- Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base, David Woodhouse, 2021/11/29
- Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base, Claudio Fontana, 2021/11/29
- Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base, David Woodhouse, 2021/11/29
- Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base, Claudio Fontana, 2021/11/30