[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] 答复: [PATCH v3] x86/cpu: Add supports for zhaoxin x86 platform


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: David Wang <DavidWang@xxxxxxxxxxx>
  • Date: Fri, 4 May 2018 02:54:31 +0000
  • Accept-language: zh-CN, en-US
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Fiona Li\(BJ-RD\)" <FionaLi@xxxxxxxxxxx>
  • Delivery-date: Fri, 04 May 2018 03:09:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHT4vC+98GNzkdLnU+DKg+vnfyrSqQezDqW
  • Thread-topic: [PATCH v3] x86/cpu: Add supports for zhaoxin x86 platform

________________________________________
发件人: Jan Beulich <JBeulich@xxxxxxxx>
发送时间: 2018年5月3日 23:09
收件人: David Wang
抄送: xen-devel; Fiona Li(BJ-RD)
主题: Re: [PATCH v3] x86/cpu: Add supports for zhaoxin x86 platform

>>> On 03.05.18 at 06:43, <Davidwang@xxxxxxxxxxx> wrote:
> From: DavidWang <davidwang@xxxxxxxxxxx>
>
> Zhaoxin is a x86 IC designer. Its SOC products support both CPU
> virtualization and I/O virtualization, which are compatible with Intel
> VMX and VT-d respectively. Zhaoxin has 'Shanghai' CPU vendor ID.
>
> Signed-off-by: DavidWang <davidwang@xxxxxxxxxxx>
> ---

Please have a brief list of changes from the previous version here.
OK, thank you.

> --- a/xen/arch/x86/cpu/intel_cacheinfo.c
> +++ b/xen/arch/x86/cpu/intel_cacheinfo.c
> @@ -176,7 +176,9 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c)
>        * Don't use cpuid2 if cpuid4 is supported. For P4, we use cpuid2 for
>        * trace cache
>        */
> -     if ((num_cache_leaves == 0 || c->x86 == 15) && c->cpuid_level > 1) {
> +     if ( (num_cache_leaves == 0 || c->x86 == 15) && c->cpuid_level > 1 &&
> +         c->x86_vendor != X86_VENDOR_SHANGHAI )
> +     {

There's again a mixup of indentation styles here.

> --- /dev/null
> +++ b/xen/arch/x86/cpu/shanghai.c
> @@ -0,0 +1,30 @@
> +#include <xen/bitops.h>
> +#include <xen/init.h>
> +#include <asm/processor.h>
> +#include "cpu.h"
> +
> +static void init_shanghai(struct cpuinfo_x86 *c)
> +{
> +    unsigned int l2 = 0;

What use is this local variable, considering ...

> +    if ( cpu_has(c, X86_FEATURE_ITSC) )
> +    {
> +        __set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
> +        __set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
> +        __set_bit(X86_FEATURE_TSC_RELIABLE, c->x86_capability);
> +    }
> +
> +    l2 = init_intel_cacheinfo(c);
> +}

... this is its only use?
Yes, it Only be used to save the return value. I think it is unnecessary but 
calls of  init_intel_cacheinfo() (in init_intel()) make me confused. Can i 
delete it in patch v4?
David


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.