Re: [PATCH 01/11] KVM: PPC: add pt_regs into kvm_vcpu_arch and move vcpu->arch.gpr[] into it

2018-05-03 Thread Simon Guo
On Thu, May 03, 2018 at 03:34:01PM +1000, Paul Mackerras wrote:
> On Wed, Apr 25, 2018 at 07:54:34PM +0800, wei.guo.si...@gmail.com wrote:
> > From: Simon Guo 
> > 
> > Current regs are scattered at kvm_vcpu_arch structure and it will
> > be more neat to organize them into pt_regs structure.
> > 
> > Also it will enable reconstruct MMIO emulation code with
> 
> "reimplement" would be clearer than "reconstruct" here, I think.
> 
ok.

> > @@ -438,7 +438,7 @@ int main(void)
> > OFFSET(VCPU_TAR, kvm_vcpu, arch.tar);
> >  #endif
> > OFFSET(VCPU_CR, kvm_vcpu, arch.cr);
> > -   OFFSET(VCPU_PC, kvm_vcpu, arch.pc);
> > +   OFFSET(VCPU_PC, kvm_vcpu, arch.nip);
> 
> This hunk shouldn't be in this patch.
Yes. sorry my patch split has some issue in patch 00/01.

> 
> Paul.

Thanks,
- Simon


Re: [PATCH 01/11] KVM: PPC: add pt_regs into kvm_vcpu_arch and move vcpu->arch.gpr[] into it

2018-05-03 Thread Paul Mackerras
On Wed, Apr 25, 2018 at 07:54:34PM +0800, wei.guo.si...@gmail.com wrote:
> From: Simon Guo 
> 
> Current regs are scattered at kvm_vcpu_arch structure and it will
> be more neat to organize them into pt_regs structure.
> 
> Also it will enable reconstruct MMIO emulation code with

"reimplement" would be clearer than "reconstruct" here, I think.

> @@ -438,7 +438,7 @@ int main(void)
>   OFFSET(VCPU_TAR, kvm_vcpu, arch.tar);
>  #endif
>   OFFSET(VCPU_CR, kvm_vcpu, arch.cr);
> - OFFSET(VCPU_PC, kvm_vcpu, arch.pc);
> + OFFSET(VCPU_PC, kvm_vcpu, arch.nip);

This hunk shouldn't be in this patch.

Paul.


Re: [PATCH 01/11] KVM: PPC: add pt_regs into kvm_vcpu_arch and move vcpu->arch.gpr[] into it

2018-04-27 Thread Simon Guo
On Fri, Apr 27, 2018 at 11:47:21AM +0800, kbuild test robot wrote:
> Hi Simon,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on powerpc/next]
> [also build test ERROR on v4.17-rc2 next-20180426]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/wei-guo-simon-gmail-com/KVM-PPC-add-pt_regs-into-kvm_vcpu_arch-and-move-vcpu-arch-gpr-into-it/20180427-055410
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
> config: powerpc-defconfig (attached as .config)
> compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=powerpc 
> 
> Note: the 
> linux-review/wei-guo-simon-gmail-com/KVM-PPC-add-pt_regs-into-kvm_vcpu_arch-and-move-vcpu-arch-gpr-into-it/20180427-055410
>  HEAD 92a7de2f1920f80f57d625d6d07731a00ea99161 builds fine.
>   It only hurts bisectibility.
> 
> All error/warnings (new ones prefixed by >>):
> 
>In file included from arch/powerpc/include/asm/kvm_book3s.h:271:0,
> from arch/powerpc/kernel/asm-offsets.c:57:
>arch/powerpc/include/asm/kvm_book3s_64.h: In function 
> 'copy_from_checkpoint':
> >> arch/powerpc/include/asm/kvm_book3s_64.h:493:20: error: 'struct 
> >> kvm_vcpu_arch' has no member named 'gpr'; did you mean 'qpr'?
>  memcpy(vcpu->arch.gpr, vcpu->arch.gpr_tm,
>^~~
>qpr
>arch/powerpc/include/asm/kvm_book3s_64.h:494:27: error: 'struct 
> kvm_vcpu_arch' has no member named 'gpr'; did you mean 'qpr'?
> sizeof(vcpu->arch.gpr));
>   ^~~
>   qpr
>arch/powerpc/include/asm/kvm_book3s_64.h: In function 'copy_to_checkpoint':
>arch/powerpc/include/asm/kvm_book3s_64.h:510:39: error: 'struct 
> kvm_vcpu_arch' has no member named 'gpr'; did you mean 'qpr'?
>  memcpy(vcpu->arch.gpr_tm, vcpu->arch.gpr,
>   ^~~
>   qpr
>arch/powerpc/include/asm/kvm_book3s_64.h:511:27: error: 'struct 
> kvm_vcpu_arch' has no member named 'gpr'; did you mean 'qpr'?
> sizeof(vcpu->arch.gpr));
>   ^~~
>   qpr
>In file included from arch/powerpc/kernel/asm-offsets.c:30:0:
>arch/powerpc/kernel/asm-offsets.c: In function 'main':
> >> include/linux/compiler-gcc.h:170:2: error: 'struct kvm_vcpu_arch' has no 
> >> member named 'nip'
>  __builtin_offsetof(a, b)
>  ^
>include/linux/kbuild.h:6:62: note: in definition of macro 'DEFINE'
>  asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val))
>  ^~~
>include/linux/stddef.h:17:32: note: in expansion of macro 
> '__compiler_offsetof'
> #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
>^~~
> >> include/linux/kbuild.h:11:14: note: in expansion of macro 'offsetof'
>  DEFINE(sym, offsetof(struct str, mem))
>  ^~~~
> >> arch/powerpc/kernel/asm-offsets.c:441:2: note: in expansion of macro 
> >> 'OFFSET'
>  OFFSET(VCPU_PC, kvm_vcpu, arch.nip);
>  ^~
>make[2]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1
>make[2]: Target '__build' not remade because of errors.
>make[1]: *** [prepare0] Error 2
>make[1]: Target 'prepare' not remade because of errors.
>make: *** [sub-make] Error 2
> 
> vim +493 arch/powerpc/include/asm/kvm_book3s_64.h
> 
> 4bb3c7a0 Paul Mackerras 2018-03-21  481  
> 4bb3c7a0 Paul Mackerras 2018-03-21  482  #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
> 4bb3c7a0 Paul Mackerras 2018-03-21  483  static inline void 
> copy_from_checkpoint(struct kvm_vcpu *vcpu)
> 4bb3c7a0 Paul Mackerras 2018-03-21  484  {
> 4bb3c7a0 Paul Mackerras 2018-03-21  485   vcpu->arch.cr  = 
> vcpu->arch.cr_tm;
> 4bb3c7a0 Paul Mackerras 2018-03-21  486   vcpu->arch.xer = 
> vcpu->arch.xer_tm;
> 4bb3c7a0 Paul Mackerras 2018-03-21  487   vcpu->arch.lr  = 
> vcpu->arch.lr_tm;
> 4bb3c7a0 Paul Mackerras 2018-03-21  488   vcpu->arch.ctr = 
> vcpu->arch.ctr_tm;
> 4bb3c7a0 Paul Mackerras 2018-03-21  489   vcpu->arch.amr = 
> vcpu->arch.amr_tm;
> 4bb3c7a0 Paul Mackerras 2018-03-21  490   vcpu->arch.ppr = 
> vcpu->arch.ppr_tm;
> 4bb3c7a0 Paul Mackerras 2018-03-21  491   vcpu->arch.dscr = 
> vcpu->arch.dscr_tm;
> 4bb3c7a0 Paul Mackerras 2018-03-21  492   vcpu->arch.tar = 
> vcpu->arch.tar_tm;
> 4bb3c7a0 Paul Mackerras 2018-03-21 @493   memcpy(vcpu->arch.gpr, 
> vcpu->arch.gpr_tm,
> 4bb3c7a0 Paul Mackerras 2018-03-21  494  

Re: [PATCH 01/11] KVM: PPC: add pt_regs into kvm_vcpu_arch and move vcpu->arch.gpr[] into it

2018-04-26 Thread kbuild test robot
Hi Simon,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.17-rc2 next-20180426]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/wei-guo-simon-gmail-com/KVM-PPC-add-pt_regs-into-kvm_vcpu_arch-and-move-vcpu-arch-gpr-into-it/20180427-055410
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc 

Note: the 
linux-review/wei-guo-simon-gmail-com/KVM-PPC-add-pt_regs-into-kvm_vcpu_arch-and-move-vcpu-arch-gpr-into-it/20180427-055410
 HEAD 92a7de2f1920f80f57d625d6d07731a00ea99161 builds fine.
  It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

   In file included from arch/powerpc/include/asm/kvm_book3s.h:271:0,
from arch/powerpc/kernel/asm-offsets.c:57:
   arch/powerpc/include/asm/kvm_book3s_64.h: In function 'copy_from_checkpoint':
>> arch/powerpc/include/asm/kvm_book3s_64.h:493:20: error: 'struct 
>> kvm_vcpu_arch' has no member named 'gpr'; did you mean 'qpr'?
 memcpy(vcpu->arch.gpr, vcpu->arch.gpr_tm,
   ^~~
   qpr
   arch/powerpc/include/asm/kvm_book3s_64.h:494:27: error: 'struct 
kvm_vcpu_arch' has no member named 'gpr'; did you mean 'qpr'?
sizeof(vcpu->arch.gpr));
  ^~~
  qpr
   arch/powerpc/include/asm/kvm_book3s_64.h: In function 'copy_to_checkpoint':
   arch/powerpc/include/asm/kvm_book3s_64.h:510:39: error: 'struct 
kvm_vcpu_arch' has no member named 'gpr'; did you mean 'qpr'?
 memcpy(vcpu->arch.gpr_tm, vcpu->arch.gpr,
  ^~~
  qpr
   arch/powerpc/include/asm/kvm_book3s_64.h:511:27: error: 'struct 
kvm_vcpu_arch' has no member named 'gpr'; did you mean 'qpr'?
sizeof(vcpu->arch.gpr));
  ^~~
  qpr
   In file included from arch/powerpc/kernel/asm-offsets.c:30:0:
   arch/powerpc/kernel/asm-offsets.c: In function 'main':
>> include/linux/compiler-gcc.h:170:2: error: 'struct kvm_vcpu_arch' has no 
>> member named 'nip'
 __builtin_offsetof(a, b)
 ^
   include/linux/kbuild.h:6:62: note: in definition of macro 'DEFINE'
 asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val))
 ^~~
   include/linux/stddef.h:17:32: note: in expansion of macro 
'__compiler_offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
   ^~~
>> include/linux/kbuild.h:11:14: note: in expansion of macro 'offsetof'
 DEFINE(sym, offsetof(struct str, mem))
 ^~~~
>> arch/powerpc/kernel/asm-offsets.c:441:2: note: in expansion of macro 'OFFSET'
 OFFSET(VCPU_PC, kvm_vcpu, arch.nip);
 ^~
   make[2]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1
   make[2]: Target '__build' not remade because of errors.
   make[1]: *** [prepare0] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [sub-make] Error 2

vim +493 arch/powerpc/include/asm/kvm_book3s_64.h

4bb3c7a0 Paul Mackerras 2018-03-21  481  
4bb3c7a0 Paul Mackerras 2018-03-21  482  #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
4bb3c7a0 Paul Mackerras 2018-03-21  483  static inline void 
copy_from_checkpoint(struct kvm_vcpu *vcpu)
4bb3c7a0 Paul Mackerras 2018-03-21  484  {
4bb3c7a0 Paul Mackerras 2018-03-21  485 vcpu->arch.cr  = 
vcpu->arch.cr_tm;
4bb3c7a0 Paul Mackerras 2018-03-21  486 vcpu->arch.xer = 
vcpu->arch.xer_tm;
4bb3c7a0 Paul Mackerras 2018-03-21  487 vcpu->arch.lr  = 
vcpu->arch.lr_tm;
4bb3c7a0 Paul Mackerras 2018-03-21  488 vcpu->arch.ctr = 
vcpu->arch.ctr_tm;
4bb3c7a0 Paul Mackerras 2018-03-21  489 vcpu->arch.amr = 
vcpu->arch.amr_tm;
4bb3c7a0 Paul Mackerras 2018-03-21  490 vcpu->arch.ppr = 
vcpu->arch.ppr_tm;
4bb3c7a0 Paul Mackerras 2018-03-21  491 vcpu->arch.dscr = 
vcpu->arch.dscr_tm;
4bb3c7a0 Paul Mackerras 2018-03-21  492 vcpu->arch.tar = 
vcpu->arch.tar_tm;
4bb3c7a0 Paul Mackerras 2018-03-21 @493 memcpy(vcpu->arch.gpr, 
vcpu->arch.gpr_tm,
4bb3c7a0 Paul Mackerras 2018-03-21  494sizeof(vcpu->arch.gpr));
4bb3c7a0 Paul Mackerras 2018-03-21  495 vcpu->arch.fp  = 
vcpu->arch.fp_tm;
4bb3c7a0 Paul Mackerras 2018-03-21  496 vcpu->arch.vr  = 
vcpu->arch.vr_tm;
4bb3c7a0 Paul Mackerras 2018-03-21  497 vcpu->arch.vrsave =