From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 15 Mar 2017 16:28:23 +0100 (CET) Received: from localhost.localdomain ([127.0.0.1]:39170 "EHLO linux-mips.org" rhost-flags-OK-OK-OK-FAIL) by eddie.linux-mips.org with ESMTP id S23990514AbdCOP1vbT0xV (ORCPT ); Wed, 15 Mar 2017 16:27:51 +0100 Received: from h7.dl5rb.org.uk (localhost [127.0.0.1]) by h7.dl5rb.org.uk (8.15.2/8.14.8) with ESMTP id v2FEFhQg009003; Wed, 15 Mar 2017 15:15:43 +0100 Received: (from ralf@localhost) by h7.dl5rb.org.uk (8.15.2/8.15.2/Submit) id v2FEFgme009002; Wed, 15 Mar 2017 15:15:42 +0100 Date: Wed, 15 Mar 2017 15:15:42 +0100 From: Ralf Baechle To: James Hogan Cc: linux-mips@linux-mips.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] KVM: MIPS/Emulate: Fix preemption warning Message-ID: <20170315141542.GF5512@linux-mips.org> References: <20170314000515.26573-1-james.hogan@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170314000515.26573-1-james.hogan@imgtec.com> User-Agent: Mutt/1.8.0 (2017-02-23) Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 57293 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: ralf@linux-mips.org Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips 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: > [] show_stack+0x88/0xa8 > [] dump_stack+0x9c/0xd0 > [] check_preemption_disabled+0x124/0x130 > [] kvm_mips_emulate_CP0+0xa48/0xea0 [kvm] > [] kvm_mips_emulate_inst+0x190/0x268 [kvm] > [] kvm_trap_emul_handle_cop_unusable+0x48/0x160 [kvm] > [] 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 > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Ralf Baechle > Cc: linux-mips@linux-mips.org > Cc: kvm@vger.kernel.org > Cc: # 4.1.x- Acked-by: Ralf Baechle 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