From patchwork Wed Dec 5 16:32:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 1842151 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A2DF63FCF2 for ; Wed, 5 Dec 2012 16:32:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752810Ab2LEQci (ORCPT ); Wed, 5 Dec 2012 11:32:38 -0500 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:39225 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752216Ab2LEQch (ORCPT ); Wed, 5 Dec 2012 11:32:37 -0500 Received: from mudshark.cambridge.arm.com (mudshark.cambridge.arm.com [10.1.79.58]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id qB5GWSUO007984; Wed, 5 Dec 2012 16:32:28 GMT Received: by mudshark.cambridge.arm.com (Postfix, from userid 1000) id 3D120C2A9C; Wed, 5 Dec 2012 16:32:27 +0000 (GMT) From: Will Deacon To: kvm@vger.kernel.org Cc: penberg@kernel.org, marc.zyngier@arm.com, Marc Zyngier , Will Deacon Subject: [PATCH 1/3] kvm-tool: ARM: set interrupt priority mask in secondary boot path Date: Wed, 5 Dec 2012 16:32:15 +0000 Message-Id: <1354725137-18077-1-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 1.8.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Zyngier A bug in the KVM GIC init code set the priority mask to the highest possible value, while the reset value should be zero. Now that the kernel bug is fixed, kvm-tool must properly configure its GIC CPU interface in order to receive the boot IPI. Just set the GICC_PMR register to the maximum value (0xff), and it "just works". Cc: Pekka Enberg Signed-off-by: Marc Zyngier [will: added #define for PMR offset] Signed-off-by: Will Deacon --- tools/kvm/arm/aarch32/smp-pen.S | 4 ++++ tools/kvm/arm/include/arm-common/gic.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/tools/kvm/arm/aarch32/smp-pen.S b/tools/kvm/arm/aarch32/smp-pen.S index 0861171..1e63c95 100644 --- a/tools/kvm/arm/aarch32/smp-pen.S +++ b/tools/kvm/arm/aarch32/smp-pen.S @@ -17,6 +17,10 @@ smp_pen_start: mov r1, #GIC_CPUI_CTLR_EN str r1, [r0] + @ Set the priority mask to accept any interrupt + mov r1, #GIC_CPUI_PMR_MIN_PRIO + str r1, [r0, #GIC_CPUI_OFF_PMR] + @ Now wait for the primary to poke us adr r0, smp_jump_addr ldr r1, =AARCH32_SMP_BAD_MAGIC diff --git a/tools/kvm/arm/include/arm-common/gic.h b/tools/kvm/arm/include/arm-common/gic.h index d534174..d6a18e1 100644 --- a/tools/kvm/arm/include/arm-common/gic.h +++ b/tools/kvm/arm/include/arm-common/gic.h @@ -19,6 +19,9 @@ #define GIC_FDT_IRQ_PPI_CPU_MASK (0xff << GIC_FDT_IRQ_PPI_CPU_SHIFT) #define GIC_CPUI_CTLR_EN (1 << 0) +#define GIC_CPUI_PMR_MIN_PRIO 0xff + +#define GIC_CPUI_OFF_PMR 4 #define GIC_MAX_CPUS 8 #define GIC_MAX_IRQ 255