Re: [PATCH v3 6/6] kvm: arm64: Add ACPI support for virt arch timer

2016-02-21 Thread Fu Wei
Hi Marc

On 9 February 2016 at 01:10, Marc Zyngier  wrote:
> On 01/02/16 20:26, fu@linaro.org wrote:
>> From: Fu Wei 
>>
>> This patch adds ACPI/GTDT support for virt arch timer
>> using the API in GTDT driver.
>>
>> Signed-off-by: Fu Wei 
>> ---
>>  virt/kvm/arm/arch_timer.c | 8 
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
>> index 0a279d3..4077347 100644
>> --- a/virt/kvm/arm/arch_timer.c
>> +++ b/virt/kvm/arm/arch_timer.c
>> @@ -385,6 +385,9 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
>>  {
>>   struct device_node *np;
>>   int ret = -EINVAL;
>> +#ifdef CONFIG_ACPI_GTDT
>> + struct arch_timer_data data;
>> +#endif
>>
>>   np = of_find_matching_node(NULL, arch_timer_of_match);
>>   if (!np) {
>> @@ -397,6 +400,11 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
>>   of_node_put(np);
>>
>>  skip_of:
>> +#ifdef CONFIG_ACPI_GTDT
>> + if (!*ppi && !gtdt_arch_timer_data_init(NULL, ))
>> + *ppi = data.virt_ppi;
>> +#endif
>> +
>>   if (*ppi)
>>   return 0;
>>
>>
>
> As I already pointed out in another thread hacking some KVM ACPI stuff,
> this is the wrong approach.
>
> We should have a *common* accessor in the timer code that exports the
> relevant information, whatever the firmware "du jour" is.
>
> See Julien's series, which seems to address the issue in a much more
> convincing way:
>
> https://lists.cs.columbia.edu/pipermail/kvmarm/2016-February/018531.html
>

Thanks for your info, I have read through Julien's patchset in mailing list.
This patch is a improvement from Wei Huang's patch using my GTDT driver,
because his approach is getting info from DTB or ACPI directly.

But It seems Wei Huang is helping Julien on his patchset and trying to
provide Tested-by,
So I will delete these two patches(about kvm), and test Julien's patch also.

> Thanks,
>
> M.
> --
> Jazz is not dead. It just smells funny...



-- 
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021


Re: [PATCH v3 6/6] kvm: arm64: Add ACPI support for virt arch timer

2016-02-21 Thread Fu Wei
Hi Marc

On 9 February 2016 at 01:10, Marc Zyngier  wrote:
> On 01/02/16 20:26, fu@linaro.org wrote:
>> From: Fu Wei 
>>
>> This patch adds ACPI/GTDT support for virt arch timer
>> using the API in GTDT driver.
>>
>> Signed-off-by: Fu Wei 
>> ---
>>  virt/kvm/arm/arch_timer.c | 8 
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
>> index 0a279d3..4077347 100644
>> --- a/virt/kvm/arm/arch_timer.c
>> +++ b/virt/kvm/arm/arch_timer.c
>> @@ -385,6 +385,9 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
>>  {
>>   struct device_node *np;
>>   int ret = -EINVAL;
>> +#ifdef CONFIG_ACPI_GTDT
>> + struct arch_timer_data data;
>> +#endif
>>
>>   np = of_find_matching_node(NULL, arch_timer_of_match);
>>   if (!np) {
>> @@ -397,6 +400,11 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
>>   of_node_put(np);
>>
>>  skip_of:
>> +#ifdef CONFIG_ACPI_GTDT
>> + if (!*ppi && !gtdt_arch_timer_data_init(NULL, ))
>> + *ppi = data.virt_ppi;
>> +#endif
>> +
>>   if (*ppi)
>>   return 0;
>>
>>
>
> As I already pointed out in another thread hacking some KVM ACPI stuff,
> this is the wrong approach.
>
> We should have a *common* accessor in the timer code that exports the
> relevant information, whatever the firmware "du jour" is.
>
> See Julien's series, which seems to address the issue in a much more
> convincing way:
>
> https://lists.cs.columbia.edu/pipermail/kvmarm/2016-February/018531.html
>

Thanks for your info, I have read through Julien's patchset in mailing list.
This patch is a improvement from Wei Huang's patch using my GTDT driver,
because his approach is getting info from DTB or ACPI directly.

But It seems Wei Huang is helping Julien on his patchset and trying to
provide Tested-by,
So I will delete these two patches(about kvm), and test Julien's patch also.

> Thanks,
>
> M.
> --
> Jazz is not dead. It just smells funny...



-- 
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021


Re: [PATCH v3 6/6] kvm: arm64: Add ACPI support for virt arch timer

2016-02-08 Thread Marc Zyngier
On 01/02/16 20:26, fu@linaro.org wrote:
> From: Fu Wei 
> 
> This patch adds ACPI/GTDT support for virt arch timer
> using the API in GTDT driver.
> 
> Signed-off-by: Fu Wei 
> ---
>  virt/kvm/arm/arch_timer.c | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
> index 0a279d3..4077347 100644
> --- a/virt/kvm/arm/arch_timer.c
> +++ b/virt/kvm/arm/arch_timer.c
> @@ -385,6 +385,9 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
>  {
>   struct device_node *np;
>   int ret = -EINVAL;
> +#ifdef CONFIG_ACPI_GTDT
> + struct arch_timer_data data;
> +#endif
>  
>   np = of_find_matching_node(NULL, arch_timer_of_match);
>   if (!np) {
> @@ -397,6 +400,11 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
>   of_node_put(np);
>  
>  skip_of:
> +#ifdef CONFIG_ACPI_GTDT
> + if (!*ppi && !gtdt_arch_timer_data_init(NULL, ))
> + *ppi = data.virt_ppi;
> +#endif
> +
>   if (*ppi)
>   return 0;
>  
> 

As I already pointed out in another thread hacking some KVM ACPI stuff,
this is the wrong approach.

We should have a *common* accessor in the timer code that exports the
relevant information, whatever the firmware "du jour" is.

See Julien's series, which seems to address the issue in a much more
convincing way:

https://lists.cs.columbia.edu/pipermail/kvmarm/2016-February/018531.html

Thanks,

M.
-- 
Jazz is not dead. It just smells funny...


Re: [PATCH v3 6/6] kvm: arm64: Add ACPI support for virt arch timer

2016-02-08 Thread Marc Zyngier
On 01/02/16 20:26, fu@linaro.org wrote:
> From: Fu Wei 
> 
> This patch adds ACPI/GTDT support for virt arch timer
> using the API in GTDT driver.
> 
> Signed-off-by: Fu Wei 
> ---
>  virt/kvm/arm/arch_timer.c | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
> index 0a279d3..4077347 100644
> --- a/virt/kvm/arm/arch_timer.c
> +++ b/virt/kvm/arm/arch_timer.c
> @@ -385,6 +385,9 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
>  {
>   struct device_node *np;
>   int ret = -EINVAL;
> +#ifdef CONFIG_ACPI_GTDT
> + struct arch_timer_data data;
> +#endif
>  
>   np = of_find_matching_node(NULL, arch_timer_of_match);
>   if (!np) {
> @@ -397,6 +400,11 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
>   of_node_put(np);
>  
>  skip_of:
> +#ifdef CONFIG_ACPI_GTDT
> + if (!*ppi && !gtdt_arch_timer_data_init(NULL, ))
> + *ppi = data.virt_ppi;
> +#endif
> +
>   if (*ppi)
>   return 0;
>  
> 

As I already pointed out in another thread hacking some KVM ACPI stuff,
this is the wrong approach.

We should have a *common* accessor in the timer code that exports the
relevant information, whatever the firmware "du jour" is.

See Julien's series, which seems to address the issue in a much more
convincing way:

https://lists.cs.columbia.edu/pipermail/kvmarm/2016-February/018531.html

Thanks,

M.
-- 
Jazz is not dead. It just smells funny...


Re: [PATCH v3 6/6] kvm: arm64: Add ACPI support for virt arch timer

2016-02-07 Thread kbuild test robot
Hi Fu,

[auto build test ERROR on tip/timers/core]
[also build test ERROR on v4.5-rc2 next-20160205]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/fu-wei-linaro-org/acpi-clocksource-kvm-add-GTDT-and-ARM-memory-mapped-timer-support/20160202-043111
config: arm64-allyesconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64 

All errors (new ones prefixed by >>):

   arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c: In function 
'kvm_timer_get_ppi':
>> arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c:404:2: error: implicit 
>> declaration of function 'gtdt_arch_timer_data_init' 
>> [-Werror=implicit-function-declaration]
 if (!*ppi && !gtdt_arch_timer_data_init(NULL, ))
 ^
   cc1: some warnings being treated as errors

vim +/gtdt_arch_timer_data_init +404 
arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c

   398  
   399  *ppi = irq_of_parse_and_map(np, VIRT_PPI);
   400  of_node_put(np);
   401  
   402  skip_of:
   403  #ifdef CONFIG_ACPI_GTDT
 > 404  if (!*ppi && !gtdt_arch_timer_data_init(NULL, ))
   405  *ppi = data.virt_ppi;
   406  #endif
   407  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [PATCH v3 6/6] kvm: arm64: Add ACPI support for virt arch timer

2016-02-07 Thread kbuild test robot
Hi Fu,

[auto build test ERROR on tip/timers/core]
[also build test ERROR on v4.5-rc2 next-20160205]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/fu-wei-linaro-org/acpi-clocksource-kvm-add-GTDT-and-ARM-memory-mapped-timer-support/20160202-043111
config: arm64-allyesconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64 

All errors (new ones prefixed by >>):

   arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c: In function 
'kvm_timer_get_ppi':
>> arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c:404:2: error: implicit 
>> declaration of function 'gtdt_arch_timer_data_init' 
>> [-Werror=implicit-function-declaration]
 if (!*ppi && !gtdt_arch_timer_data_init(NULL, ))
 ^
   cc1: some warnings being treated as errors

vim +/gtdt_arch_timer_data_init +404 
arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c

   398  
   399  *ppi = irq_of_parse_and_map(np, VIRT_PPI);
   400  of_node_put(np);
   401  
   402  skip_of:
   403  #ifdef CONFIG_ACPI_GTDT
 > 404  if (!*ppi && !gtdt_arch_timer_data_init(NULL, ))
   405  *ppi = data.virt_ppi;
   406  #endif
   407  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


[PATCH v3 6/6] kvm: arm64: Add ACPI support for virt arch timer

2016-02-01 Thread fu . wei
From: Fu Wei 

This patch adds ACPI/GTDT support for virt arch timer
using the API in GTDT driver.

Signed-off-by: Fu Wei 
---
 virt/kvm/arm/arch_timer.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 0a279d3..4077347 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -385,6 +385,9 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
 {
struct device_node *np;
int ret = -EINVAL;
+#ifdef CONFIG_ACPI_GTDT
+   struct arch_timer_data data;
+#endif
 
np = of_find_matching_node(NULL, arch_timer_of_match);
if (!np) {
@@ -397,6 +400,11 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
of_node_put(np);
 
 skip_of:
+#ifdef CONFIG_ACPI_GTDT
+   if (!*ppi && !gtdt_arch_timer_data_init(NULL, ))
+   *ppi = data.virt_ppi;
+#endif
+
if (*ppi)
return 0;
 
-- 
2.5.0



[PATCH v3 6/6] kvm: arm64: Add ACPI support for virt arch timer

2016-02-01 Thread fu . wei
From: Fu Wei 

This patch adds ACPI/GTDT support for virt arch timer
using the API in GTDT driver.

Signed-off-by: Fu Wei 
---
 virt/kvm/arm/arch_timer.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 0a279d3..4077347 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -385,6 +385,9 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
 {
struct device_node *np;
int ret = -EINVAL;
+#ifdef CONFIG_ACPI_GTDT
+   struct arch_timer_data data;
+#endif
 
np = of_find_matching_node(NULL, arch_timer_of_match);
if (!np) {
@@ -397,6 +400,11 @@ static int kvm_timer_get_ppi(unsigned int *ppi)
of_node_put(np);
 
 skip_of:
+#ifdef CONFIG_ACPI_GTDT
+   if (!*ppi && !gtdt_arch_timer_data_init(NULL, ))
+   *ppi = data.virt_ppi;
+#endif
+
if (*ppi)
return 0;
 
-- 
2.5.0