RE: [PATCH V2 2/5] X86: Hyper-V: Enable IPI enlightenments

2018-05-09 Thread Michael Kelley (EOSG)
> -Original Message-
> From: k...@linuxonhyperv.com 
> Sent: Thursday, May 3, 2018 11:08 PM
> To: x...@kernel.org; gre...@linuxfoundation.org; linux-kernel@vger.kernel.org;
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com; 
> jasow...@redhat.com;
> t...@linutronix.de; h...@zytor.com; Stephen Hemminger 
> ;
> Michael Kelley (EOSG) ; vkuzn...@redhat.com
> Cc: KY Srinivasan 
> Subject: [PATCH V2 2/5] X86: Hyper-V: Enable IPI enlightenments
> 
> From: "K. Y. Srinivasan" 
> 
> Hyper-V supports hypercalls to implement IPI; use them.
> 
> Signed-off-by: K. Y. Srinivasan 
> ---

Reviewed-by: Michael Kelley 


RE: [PATCH V2 2/5] X86: Hyper-V: Enable IPI enlightenments

2018-05-09 Thread Michael Kelley (EOSG)
> -Original Message-
> From: k...@linuxonhyperv.com 
> Sent: Thursday, May 3, 2018 11:08 PM
> To: x...@kernel.org; gre...@linuxfoundation.org; linux-kernel@vger.kernel.org;
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com; 
> jasow...@redhat.com;
> t...@linutronix.de; h...@zytor.com; Stephen Hemminger 
> ;
> Michael Kelley (EOSG) ; vkuzn...@redhat.com
> Cc: KY Srinivasan 
> Subject: [PATCH V2 2/5] X86: Hyper-V: Enable IPI enlightenments
> 
> From: "K. Y. Srinivasan" 
> 
> Hyper-V supports hypercalls to implement IPI; use them.
> 
> Signed-off-by: K. Y. Srinivasan 
> ---

Reviewed-by: Michael Kelley 


Re: [PATCH V2 2/5] X86: Hyper-V: Enable IPI enlightenments

2018-05-04 Thread kbuild test robot
Hi Srinivasan,

I love your patch! Yet something to improve:

[auto build test ERROR on v4.17-rc3]
[also build test ERROR on next-20180504]
[cannot apply to tip/x86/core]
[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/kys-linuxonhyperv-com/X86-Hyper-V-APIC-enlightenments/20180505-045627
config: x86_64-randconfig-a0-05050447 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

   arch/x86/hyperv/hv_apic.c: In function 'hv_apic_read':
   arch/x86/hyperv/hv_apic.c:69:10: error: implicit declaration of function 
'native_apic_mem_read'; did you mean 'hv_apic_icr_read'? 
[-Werror=implicit-function-declaration]
  return native_apic_mem_read(reg);
 ^~~~
 hv_apic_icr_read
   arch/x86/hyperv/hv_apic.c: In function 'hv_apic_write':
   arch/x86/hyperv/hv_apic.c:83:3: error: implicit declaration of function 
'native_apic_mem_write'; did you mean 'hv_apic_icr_write'? 
[-Werror=implicit-function-declaration]
  native_apic_mem_write(reg, val);
  ^
  hv_apic_icr_write
   arch/x86/hyperv/hv_apic.c: In function 'hv_send_ipi':
>> arch/x86/hyperv/hv_apic.c:153:12: error: invalid use of undefined type 
>> 'struct apic'
  orig_apic.send_IPI(cpu, vector);
   ^
   arch/x86/hyperv/hv_apic.c: In function 'hv_send_ipi_mask':
   arch/x86/hyperv/hv_apic.c:159:12: error: invalid use of undefined type 
'struct apic'
  orig_apic.send_IPI_mask(mask, vector);
   ^
   arch/x86/hyperv/hv_apic.c: In function 'hv_send_ipi_mask_allbutself':
   arch/x86/hyperv/hv_apic.c:172:12: error: invalid use of undefined type 
'struct apic'
  orig_apic.send_IPI_mask_allbutself(mask, vector);
   ^
   arch/x86/hyperv/hv_apic.c: In function 'hv_send_ipi_all':
   arch/x86/hyperv/hv_apic.c:183:12: error: invalid use of undefined type 
'struct apic'
  orig_apic.send_IPI_all(vector);
   ^
   arch/x86/hyperv/hv_apic.c: In function 'hv_send_ipi_self':
   arch/x86/hyperv/hv_apic.c:189:12: error: invalid use of undefined type 
'struct apic'
  orig_apic.send_IPI_self(vector);
   ^
   arch/x86/hyperv/hv_apic.c: In function 'hv_apic_init':
>> arch/x86/hyperv/hv_apic.c:199:16: error: 'apic' undeclared (first use in 
>> this function)
  orig_apic = *apic;
   ^~~~
   arch/x86/hyperv/hv_apic.c:199:16: note: each undeclared identifier is 
reported only once for each function it appears in
>> arch/x86/hyperv/hv_apic.c:199:13: error: 'orig_apic' has an incomplete type 
>> 'struct apic'
  orig_apic = *apic;
^
   arch/x86/hyperv/hv_apic.c:211:3: error: implicit declaration of function 
'apic_set_eoi_write'; did you mean 'hv_apic_eoi_write'? 
[-Werror=implicit-function-declaration]
  apic_set_eoi_write(hv_apic_eoi_write);
  ^~
  hv_apic_eoi_write
   arch/x86/hyperv/hv_apic.c: At top level:
>> arch/x86/hyperv/hv_apic.c:35:20: error: storage size of 'orig_apic' isn't 
>> known
static struct apic orig_apic;
   ^
   cc1: some warnings being treated as errors

vim +153 arch/x86/hyperv/hv_apic.c

34  
  > 35  static struct apic orig_apic;
36  
37  static u64 hv_apic_icr_read(void)
38  {
39  u64 reg_val;
40  
41  rdmsrl(HV_X64_MSR_ICR, reg_val);
42  return reg_val;
43  }
44  
45  static void hv_apic_icr_write(u32 low, u32 id)
46  {
47  u64 reg_val;
48  
49  reg_val = SET_APIC_DEST_FIELD(id);
50  reg_val = reg_val << 32;
51  reg_val |= low;
52  
53  wrmsrl(HV_X64_MSR_ICR, reg_val);
54  }
55  
56  static u32 hv_apic_read(u32 reg)
57  {
58  u32 reg_val, hi;
59  
60  switch (reg) {
61  case APIC_EOI:
62  rdmsr(HV_X64_MSR_EOI, reg_val, hi);
63  return reg_val;
64  case APIC_TASKPRI:
65  rdmsr(HV_X64_MSR_TPR, reg_val, hi);
66  return reg_val;
67  
68  default:
69  return native_apic_mem_read(reg);
70  }
71  }
72  
73  static void hv_apic_write(u32 reg, u32 val)
74  {
75  switch (reg) {
76  case APIC_EOI:
77  wrmsr(HV_X64_MSR_EOI, val, 0);
78  break;
79  case APIC_TASKPRI:
80  wrmsr(HV_X64_MSR_TPR, val, 0);
81  break;
82  default:
  > 83  native_apic_mem_write(reg, val);
84  }
85  }
86  
87  static void hv_apic_eoi_write(u32 reg, u32 val)
88  {
89  wrmsr(HV_X64_MSR_EOI, val, 

Re: [PATCH V2 2/5] X86: Hyper-V: Enable IPI enlightenments

2018-05-04 Thread kbuild test robot
Hi Srinivasan,

I love your patch! Yet something to improve:

[auto build test ERROR on v4.17-rc3]
[also build test ERROR on next-20180504]
[cannot apply to tip/x86/core]
[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/kys-linuxonhyperv-com/X86-Hyper-V-APIC-enlightenments/20180505-045627
config: x86_64-randconfig-a0-05050447 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

   arch/x86/hyperv/hv_apic.c: In function 'hv_apic_read':
   arch/x86/hyperv/hv_apic.c:69:10: error: implicit declaration of function 
'native_apic_mem_read'; did you mean 'hv_apic_icr_read'? 
[-Werror=implicit-function-declaration]
  return native_apic_mem_read(reg);
 ^~~~
 hv_apic_icr_read
   arch/x86/hyperv/hv_apic.c: In function 'hv_apic_write':
   arch/x86/hyperv/hv_apic.c:83:3: error: implicit declaration of function 
'native_apic_mem_write'; did you mean 'hv_apic_icr_write'? 
[-Werror=implicit-function-declaration]
  native_apic_mem_write(reg, val);
  ^
  hv_apic_icr_write
   arch/x86/hyperv/hv_apic.c: In function 'hv_send_ipi':
>> arch/x86/hyperv/hv_apic.c:153:12: error: invalid use of undefined type 
>> 'struct apic'
  orig_apic.send_IPI(cpu, vector);
   ^
   arch/x86/hyperv/hv_apic.c: In function 'hv_send_ipi_mask':
   arch/x86/hyperv/hv_apic.c:159:12: error: invalid use of undefined type 
'struct apic'
  orig_apic.send_IPI_mask(mask, vector);
   ^
   arch/x86/hyperv/hv_apic.c: In function 'hv_send_ipi_mask_allbutself':
   arch/x86/hyperv/hv_apic.c:172:12: error: invalid use of undefined type 
'struct apic'
  orig_apic.send_IPI_mask_allbutself(mask, vector);
   ^
   arch/x86/hyperv/hv_apic.c: In function 'hv_send_ipi_all':
   arch/x86/hyperv/hv_apic.c:183:12: error: invalid use of undefined type 
'struct apic'
  orig_apic.send_IPI_all(vector);
   ^
   arch/x86/hyperv/hv_apic.c: In function 'hv_send_ipi_self':
   arch/x86/hyperv/hv_apic.c:189:12: error: invalid use of undefined type 
'struct apic'
  orig_apic.send_IPI_self(vector);
   ^
   arch/x86/hyperv/hv_apic.c: In function 'hv_apic_init':
>> arch/x86/hyperv/hv_apic.c:199:16: error: 'apic' undeclared (first use in 
>> this function)
  orig_apic = *apic;
   ^~~~
   arch/x86/hyperv/hv_apic.c:199:16: note: each undeclared identifier is 
reported only once for each function it appears in
>> arch/x86/hyperv/hv_apic.c:199:13: error: 'orig_apic' has an incomplete type 
>> 'struct apic'
  orig_apic = *apic;
^
   arch/x86/hyperv/hv_apic.c:211:3: error: implicit declaration of function 
'apic_set_eoi_write'; did you mean 'hv_apic_eoi_write'? 
[-Werror=implicit-function-declaration]
  apic_set_eoi_write(hv_apic_eoi_write);
  ^~
  hv_apic_eoi_write
   arch/x86/hyperv/hv_apic.c: At top level:
>> arch/x86/hyperv/hv_apic.c:35:20: error: storage size of 'orig_apic' isn't 
>> known
static struct apic orig_apic;
   ^
   cc1: some warnings being treated as errors

vim +153 arch/x86/hyperv/hv_apic.c

34  
  > 35  static struct apic orig_apic;
36  
37  static u64 hv_apic_icr_read(void)
38  {
39  u64 reg_val;
40  
41  rdmsrl(HV_X64_MSR_ICR, reg_val);
42  return reg_val;
43  }
44  
45  static void hv_apic_icr_write(u32 low, u32 id)
46  {
47  u64 reg_val;
48  
49  reg_val = SET_APIC_DEST_FIELD(id);
50  reg_val = reg_val << 32;
51  reg_val |= low;
52  
53  wrmsrl(HV_X64_MSR_ICR, reg_val);
54  }
55  
56  static u32 hv_apic_read(u32 reg)
57  {
58  u32 reg_val, hi;
59  
60  switch (reg) {
61  case APIC_EOI:
62  rdmsr(HV_X64_MSR_EOI, reg_val, hi);
63  return reg_val;
64  case APIC_TASKPRI:
65  rdmsr(HV_X64_MSR_TPR, reg_val, hi);
66  return reg_val;
67  
68  default:
69  return native_apic_mem_read(reg);
70  }
71  }
72  
73  static void hv_apic_write(u32 reg, u32 val)
74  {
75  switch (reg) {
76  case APIC_EOI:
77  wrmsr(HV_X64_MSR_EOI, val, 0);
78  break;
79  case APIC_TASKPRI:
80  wrmsr(HV_X64_MSR_TPR, val, 0);
81  break;
82  default:
  > 83  native_apic_mem_write(reg, val);
84  }
85  }
86  
87  static void hv_apic_eoi_write(u32 reg, u32 val)
88  {
89  wrmsr(HV_X64_MSR_EOI, val,