From patchwork Mon Jul 28 13:25:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 4634511 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 965FD9F36A for ; Mon, 28 Jul 2014 13:25:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A8DAF2012D for ; Mon, 28 Jul 2014 13:25:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D6C5200F4 for ; Mon, 28 Jul 2014 13:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbaG1NZh (ORCPT ); Mon, 28 Jul 2014 09:25:37 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52779 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752256AbaG1NZh (ORCPT ); Mon, 28 Jul 2014 09:25:37 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9E45AAAC3; Mon, 28 Jul 2014 13:25:34 +0000 (UTC) Message-ID: <53D64F4C.80208@suse.de> Date: Mon, 28 Jul 2014 15:25:32 +0200 From: Alexander Graf User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: "Aneesh Kumar K.V" , benh@kernel.crashing.org, paulus@samba.org CC: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH 1/4] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register References: <1401970085-14493-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1401970085-14493-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <53919B83.4070308@suse.de> <874mzyxati.fsf@linux.vnet.ibm.com> In-Reply-To: <874mzyxati.fsf@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 06.06.14 18:27, Aneesh Kumar K.V wrote: > Alexander Graf writes: > >> On 05.06.14 14:08, Aneesh Kumar K.V wrote: >>> virtual time base register is a per VM, per cpu register that needs >>> to be saved and restored on vm exit and entry. Writing to VTB is not >>> allowed in the privileged mode. >>> >>> Signed-off-by: Aneesh Kumar K.V >> For some reason BUG() doesn't always trigger the "execution stops here" >> logic in gcc. So I've squashed this patch into yours. >> >> >> Alex >> >> >> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h >> index 3e7085d..99de6ad 100644 >> --- a/arch/powerpc/include/asm/reg.h >> +++ b/arch/powerpc/include/asm/reg.h >> @@ -1206,6 +1206,7 @@ static inline unsigned long mfvtb (void) >> * capture that. >> */ >> BUG(); >> + return 0; >> } >> >> #ifdef __powerpc64__ > you can then drop the include header change. ie, > > #include Yeah, things are even worse than I thought. I've eventually squashed the following in. a NOP'ed mfspr() won't keep the branch from blr'ing, so we'd never hit the BUG() anyway. Alex 630 */ @@ -1210,12 +1209,6 @@ static inline unsigned long mfvtb (void) if (cpu_has_feature(CPU_FTR_ARCH_207S)) return mfspr(SPRN_VTB); #endif - /* - * The above mfspr will be a no-op on anything before Power8 - * That can result in random values returned. We need to - * capture that. - */ - BUG(); return 0; } --- To unsubscribe from this list: send the line "unsubscribe kvm" 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/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 1f34ef7..c8f3381 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -25,7 +25,6 @@ #ifdef CONFIG_8xx #include #endif /* CONFIG_8xx */ -#include #define MSR_SF_LG 63 /* Enable 64 bit mode */ #define MSR_ISF_LG 61 /* Interrupt 64b mode valid on