Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Kevin O'Connor <kevin@koconnor.net>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: seabios@seabios.org, kvm@vger.kernel.org
Subject: Re: [PATCHv3 4/4] acpi: automatically generated ssdt proc
Date: Tue, 4 Oct 2011 22:52:33 -0400	[thread overview]
Message-ID: <20111005025233.GA12015@morn.localdomain> (raw)
In-Reply-To: <2dcf16cf5ba62dfb998bda6c623ad3333cda173b.1317734661.git.mst@redhat.com>

On Tue, Oct 04, 2011 at 03:26:19PM +0200, Michael S. Tsirkin wrote:
> Get rid of manually cut and pasted ssdt_proc,
> use ssdt compiled by iasl and offsets extracted
> by acpi_extract instead.

Thanks - I like the idea of auto-generating the offsets.

[...]
> +#define AmlCode static ssdp_proc_aml
> +#include "ssdt-proc.hex"
> +#undef AmlCode

Side note - since you're post-processing the acpi data, it would be
nice to update the name in the hex file too.

> +/* 0x5B 0x83 ProcessorOp PkgLength NameString ProcID */
> +#define SD_OFFSET_CPUHEX (*ssdt_proc_name - *ssdt_proc_start + 2)
> +#define SD_OFFSET_CPUID1 (*ssdt_proc_name - *ssdt_proc_start + 4)
> +#define SD_OFFSET_CPUID2 (*ssdt_proc_id - *ssdt_proc_start)
> +#define SD_SIZEOF (*ssdt_proc_end - *ssdt_proc_start)
> +#define SD_PROC (ssdp_proc_aml + *ssdt_proc_start)
[...]
>  DefinitionBlock ("ssdt-proc.aml", "SSDT", 0x01, "BXPC", "BXSSDT", 0x1)
> -/*  v------------------ DO NOT EDIT ------------------v */
>  {
> +    ACPI_EXTRACT_PROCESSOR_START ssdt_proc_start
> +    ACPI_EXTRACT_PROCESSOR_END ssdt_proc_end
> +    ACPI_EXTRACT_PROCESSOR_STRING ssdt_proc_name
>      Processor (CPAA, 0xAA, 0x0000b010, 0x06) {

Since the acpi.c code needs to know the processor object format
anyway, what about making a generic "ACPI_EXTRACT" indicator that
exports the location, size, and parameter location in one go.
Something like:

    ACPI_EXTRACT ssdt_proc_obj
    Processor (CPAA, 0xAA, 0x0000b010, 0x06) {

which would produce something like:

static struct aml_object ssdt_proc_obj = {.addr=0x24, .size=0x40, .param=0x28};

As for the other parts of this patch series - I'm still leary of
changing the DSDT dynamically.  I'd be curious to see if we can add
the following to ssdt-proc.dsl:

    ACPI_EXTRACT hotplug_obj
    Device (SL00) {
        ACPI_EXTRACT_NAME_DWORD_CONST hotplog_id
        Name (ID, 0xAABBCCDD)
        Name (_ADR, ID)
        Method (_EJ0, 1) { Return(PCEJ(ID)) }
        Name (_SUN, ID)
    }

and then just memcpy the "hotplug_obj" N number of times into the ssdt
for each available slot.  (This would be on top of the DSDT
simplification patch series that I posted previously.)

-Kevin

  reply	other threads:[~2011-10-05  2:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 13:25 [PATCHv3 0/4] acpi: DSDT/SSDT runtime patching Michael S. Tsirkin
2011-10-04 13:26 ` [PATCHv3 1/4] acpi: generate and parse mixed asl/aml listing Michael S. Tsirkin
2011-10-04 13:26 ` [PATCHv3 2/4] acpi: EJ0 method name patching Michael S. Tsirkin
2011-10-04 13:26 ` [PATCHv3 3/4] acpi: remove _RMV Michael S. Tsirkin
2011-10-04 13:26 ` [PATCHv3 4/4] acpi: automatically generated ssdt proc Michael S. Tsirkin
2011-10-05  2:52   ` Kevin O'Connor [this message]
2011-10-05 10:35     ` Michael S. Tsirkin
2011-10-06  2:15       ` Kevin O'Connor
2011-10-17 17:47         ` [SeaBIOS] " Isaku Yamahata
2011-10-18  3:47           ` Kevin O'Connor
2011-10-17 18:16         ` Michael S. Tsirkin
2011-10-13  1:27   ` Kevin O'Connor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111005025233.GA12015@morn.localdomain \
    --to=kevin@koconnor.net \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=seabios@seabios.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox