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

Re: [Xen-devel] [RFC PATCH V3 2/3] Tool/ACPI: DSDT extension to support more vcpus



On Wed, Sep 13, 2017 at 12:52:48AM -0400, Lan Tianyu wrote:
> This patch is to change DSDT table for processor object to support >128 vcpus
> accroding to ACPI spec 8.4 Declaring Processors
> 
> Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx>
> ---
>  tools/libacpi/mk_dsdt.c | 31 +++++++++++++++++++++++++------
>  1 file changed, 25 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c
> index 2daf32c..09c1529 100644
> --- a/tools/libacpi/mk_dsdt.c
> +++ b/tools/libacpi/mk_dsdt.c
> @@ -24,6 +24,8 @@
>  #include <xen/arch-arm.h>
>  #endif
>  
> +#define CPU_NAME_FMT      "P%.03X"
> +
>  static unsigned int indent_level;
>  static bool debug = false;
>  
> @@ -196,10 +198,27 @@ int main(int argc, char **argv)
>      /* Define processor objects and control methods. */
>      for ( cpu = 0; cpu < max_cpus; cpu++)
>      {
> -        push_block("Processor", "PR%02X, %d, 0x0000b010, 0x06", cpu, cpu);
>  
> -        stmt("Name", "_HID, \"ACPI0007\"");
> +#ifdef CONFIG_X86
> +        unsigned int apic_id = cpu * 2;

As said earlier, I don't like have some many places where apic id is
calculated. Please look into unifying those.

Also, declaring a new variable here is wrong.

> +
> +        if ( apic_id > 254 )

255? An APIC ID of 255 should still be fine.

> +        {
> +            push_block("Device", CPU_NAME_FMT, cpu);
> +        }
> +        else
> +#endif
> +        {
> +            if (cpu > 255)
> +            {
> +                fprintf(stderr, "Exceed the range of processor ID \n");
> +                return -1;
> +            }

I'm not sure whether ARM shoudln't just use Device processor objects
directly. x86 has to use Processor because of compatibility reasons,
but I guess that's not an issue for ARM.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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