Patchwork [1/4] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register

login
register
mail settings
Submitter Alexander Graf
Date June 6, 2014, 10:44 a.m.
Message ID <53919B83.4070308@suse.de>
Download mbox | patch
Permalink /patch/356782/
State New
Headers show

Comments

Alexander Graf - June 6, 2014, 10:44 a.m.
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 <aneesh.kumar@linux.vnet.ibm.com>

For some reason BUG() doesn't always trigger the "execution stops here" 
logic in gcc. So I've squashed this patch into yours.


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
Aneesh Kumar K.V - June 6, 2014, 4:27 p.m.
Alexander Graf <agraf@suse.de> 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 <aneesh.kumar@linux.vnet.ibm.com>
>
> 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 <asm/bug.h>

-aneesh

--
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

Patch

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__