From patchwork Thu Jan 31 12:30:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 217177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4F30E2C0291 for ; Thu, 31 Jan 2013 23:30:19 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751484Ab3AaMaR (ORCPT ); Thu, 31 Jan 2013 07:30:17 -0500 Received: from cantor2.suse.de ([195.135.220.15]:35778 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751339Ab3AaMaQ convert rfc822-to-8bit (ORCPT ); Thu, 31 Jan 2013 07:30:16 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 2167DA51CB; Thu, 31 Jan 2013 13:30:15 +0100 (CET) Subject: Re: Query about SPE operation fault in e500v2 KVM. thanks. Mime-Version: 1.0 (Apple Message framework v1278) From: Alexander Graf In-Reply-To: Date: Thu, 31 Jan 2013 13:30:06 +0100 Cc: "kvm-ppc@vger.kernel.org" Message-Id: <9CFE1FE9-E0A8-489A-A536-80EDA0E6D413@suse.de> References: To: Gao Guanhua-B22826 X-Mailer: Apple Mail (2.1278) Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org On 31.01.2013, at 13:17, Gao Guanhua-B22826 wrote: > Hello all, > > I met a problem of SPE operation in PowerPC e500v2 KVM, could anyone help to check or provide some suggestions? Thank you. > > Test platform: P1024RDB (e500v2) > Kernel version: Linux p1024rdb 3.0.51-rt75 > Test case description: > Use SPE to handle data that not aligned in guest. When I execute the case, host will report call_trace and guest will be hung. > > Test log: > > Host: > root@p1024rdb:/media/ram# qemu-system-ppc -enable-kvm -nographic -M ppce500v2 -kernel uImage.ppce500v2-kvm -initrd /media/ram/fsl-image-core-p1024rdb.ext2.gz -append "root=/dev/ram rw console=ttyS0,115200" -serial tcp::4444,server,telnet -dtb /usr/share/qemu/ppce500v2.dtb -m 256 -net nic,macaddr=52:54:00:12:34:66 -net tap,script=qemu-ifup -monitor /dev/null & [1] 2264 Created kernel irqchip root@p1024rdb:/media/ram# test for existing bridge br0 BusyBox v1.19.4 (2013-01-26 00:01:45 CST) multi-call binary. > > Usage: brctl COMMAND [BRIDGE [INTERFACE]] > > need to create bridge br0 > br0: port 1(eth0) entering forwarding state > brctl: bridge br0: File exists > br0: port 1(eth0) entering forwarding state > br0: port 1(eth0) entering forwarding state > brctl: bridge br0: Device or resource busy created bridge br0 > bridge name bridge id STP enabled interfaces > br0 8000.00e00c00de00 no eth0 > device tap0 entered promiscuous mode > br0: port 2(tap0) entering forwarding state > br0: port 2(tap0) entering forwarding state QEMU waiting for connection on: telnet:0.0.0.0:4444,server > PHY: mdio@ffe24000:02 - Link is Up - 1000/Full > eth0: no IPv6 routers present > tap0: no IPv6 routers present > br0: port 1(eth0) entering forwarding state > br0: port 2(tap0) entering forwarding state > > root@p1024rdb:/media/ram# exit_nr 5 > ------------[ cut here ]------------ > kernel BUG at arch/powerpc/kvm/booke.c:1273! That means we don't handle ALIGNMENT exits. Could you please check whether the below (completely untested) patch makes this work? Alex --- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index d2f502d..38a62ef 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -182,6 +182,14 @@ static void kvmppc_core_queue_inst_storage(struct kvm_vcpu *vcpu, kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_INST_STORAGE); } +static void kvmppc_core_queue_alignment(struct kvm_vcpu *vcpu, ulong dear_flags, + ulong esr_flags) +{ + vcpu->arch.queued_dear = dear_flags; + vcpu->arch.queued_esr = esr_flags; + kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_ALIGNMENT); +} + void kvmppc_core_queue_program(struct kvm_vcpu *vcpu, ulong esr_flags) { vcpu->arch.queued_esr = esr_flags; @@ -971,6 +979,12 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, r = RESUME_GUEST; break; + case BOOKE_INTERRUPT_ALIGNMENT: + kvmppc_core_queue_alignment(vcpu, vcpu->arch.fault_dear, + vcpu->arch.fault_esr); + r = RESUME_GUEST; + break; + #ifdef CONFIG_KVM_BOOKE_HV case BOOKE_INTERRUPT_HV_SYSCALL: if (!(vcpu->arch.shared->msr & MSR_PR)) {