[PATCH] PPC64: Add VMX save flag to VPA

Kumar Gala kumar.gala at freescale.com
Sat Aug 6 03:38:50 EST 2005


Olaf,

Out of interest, I'm assuming this extension to pacaData is part of  
some software spec?  Or is this specific to Linux.

I ask because one of the issues we are going to run into when merging  
ppc32/ppc64 is the lack of public information about hypervisor  
interfaces.

- kumar

On Aug 4, 2005, at 11:02 PM, Olof Johansson wrote:

> Hi,
>
> We need to indicate to the hypervisor that it needs to save our VMX
> registers when switching partitions on a shared-processor system, just
> as it needs to for FP and PMC registers.
>
> This could be made to be on-demand when VMX is used, but we don't do
> that for FP nor PMC right now either so let's not overcomplicate  
> things.
>
>
> Signed-off-by: Olof Johansson <olof at lixom.net>
>
>
> Index: 2.6/arch/ppc64/kernel/pacaData.c
> ===================================================================
> --- 2.6.orig/arch/ppc64/kernel/pacaData.c    2005-08-03
> 19:53:16.000000000 -0500
> +++ 2.6/arch/ppc64/kernel/pacaData.c    2005-08-04 19:26:26.000000000
> -0500
> @@ -59,6 +59,7 @@ extern unsigned long __toc_start;
>          .fpregs_in_use = 1,
> \
>          .end_of_quantum = 0xfffffffffffffffful,
> \
>          .slb_count = 64,
> \
> +        .vmxregs_in_use = 0,
> \
>      },
> \
>
>  #ifdef CONFIG_PPC_ISERIES
> Index: 2.6/include/asm-ppc64/lppaca.h
> ===================================================================
> --- 2.6.orig/include/asm-ppc64/lppaca.h    2005-08-04  
> 19:25:54.000000000
> -0500
> +++ 2.6/include/asm-ppc64/lppaca.h    2005-08-04 19:26:15.000000000
> -0500
> @@ -108,7 +108,7 @@ struct lppaca
>      volatile u32 virtual_decr;    // Virtual DECR for shared
> procsx78-x7B
>      u16    slb_count;        // # of SLBs to maintain
> x7C-x7D
>      u8    idle;            // Indicate OS is idle
> x7E
> -    u8    reserved5;        // Reserved
> x7F
> +    u8    vmxregs_in_use;        // VMX registers in use
> x7F
>
>
>
> // 
> ======================================================================
> =======
> Index: 2.6/arch/ppc64/kernel/pSeries_lpar.c
> ===================================================================
> --- 2.6.orig/arch/ppc64/kernel/pSeries_lpar.c    2005-08-03
> 19:53:16.000000000 -0500
> +++ 2.6/arch/ppc64/kernel/pSeries_lpar.c    2005-08-04
> 19:35:41.000000000 -0500
> @@ -267,6 +267,10 @@ void vpa_init(int cpu)
>
>      /* Register the Virtual Processor Area (VPA) */
>      flags = 1UL << (63 - 18);
> +
> +    if (cpu_has_feature(CPU_FTR_ALTIVEC))
> +        paca[cpu].lppaca.vmxregs_in_use = 1;
> +
>      ret = register_vpa(flags, hwcpu, __pa(vpa));
>
>      if (ret)
> _______________________________________________
> Linuxppc64-dev mailing list
> Linuxppc64-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc64-dev
>




More information about the Linuxppc64-dev mailing list