Re: [PATCH] KVM: MIPS/Emulate: Fix preemption warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 14, 2017 at 12:05:15AM +0000, James Hogan wrote:

> Host kernels with preemption enabled will emit the following preemption
> warning when the guest FPU is used:
> 
> BUG: using smp_processor_id() in preemptible [00000000] code: qemu-system-mip/1495
> caller is kvm_mips_emulate_CP0+0xa48/0xea0 [kvm]
> ...
> Call Trace:
> [<ffffffff81122d50>] show_stack+0x88/0xa8
> [<ffffffff814307ac>] dump_stack+0x9c/0xd0
> [<ffffffff81459f24>] check_preemption_disabled+0x124/0x130
> [<ffffffffc000e908>] kvm_mips_emulate_CP0+0xa48/0xea0 [kvm]
> [<ffffffffc000f9f0>] kvm_mips_emulate_inst+0x190/0x268 [kvm]
> [<ffffffffc0016220>] kvm_trap_emul_handle_cop_unusable+0x48/0x160 [kvm]
> [<ffffffffc000c120>] kvm_mips_handle_exit+0x520/0x7e0 [kvm]
> 
> This is due to the use of current_cpu_data.fpu_id from a preemptible
> context to read the MIPS_FPIR_F64 bit. We don't currently support
> asymmetric FPU capabilities with KVM, so just use boot_cpu_data instead
> to silence the warning.
> 
> Fixes: 6cdc65e31d4f ("MIPS: KVM: Emulate FPU bits in COP0 interface")
> Signed-off-by: James Hogan <james.hogan@xxxxxxxxxx>
> Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> Cc: "Radim Krčmář" <rkrcmar@xxxxxxxxxx>
> Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx>
> Cc: linux-mips@xxxxxxxxxxxxxx
> Cc: kvm@xxxxxxxxxxxxxxx
> Cc: <stable@xxxxxxxxxxxxxxx> # 4.1.x-

Acked-by: Ralf Baechle <ralf@xxxxxxxxxxxxxx>

James, we've fixed too many of these warnings over the past years, we
should look for a solution to kill this whole class of bugs.

  Ralf




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux