Patchwork [v5,00/23] qemu: generate acpi tables for the guest

login
register
mail settings
Submitter Michael S. Tsirkin
Date Sept. 26, 2013, 10:18 p.m.
Message ID <20130926221826.GB26765@redhat.com>
Download mbox | patch
Permalink /patch/278283/
State New
Headers show

Comments

Michael S. Tsirkin - Sept. 26, 2013, 10:18 p.m.
On Wed, Sep 25, 2013 at 03:26:12PM +0200, Gerd Hoffmann wrote:
> > > > > [root@fedora ~]# cat /proc/ioports 
> > > > >   [ ... ]
> > > > >   afe0-afe3 : ACPI GPE0_BLK
> > > > >   b010-b015 : ACPI CPU throttle
> > > > >   b100-b10f : 0000:00:01.3
> > > > >     b100-b107 : piix4_smbus
> > > > >   e400-e43f : 0000:00:01.3
> > > > >     e400-e403 : ACPI PM1a_EVT_BLK
> > > > >     e404-e405 : ACPI PM1a_CNT_BLK
> > > > >     e408-e40b : ACPI PM_TMR
> > > > > 
> > > > > "ACPI CPU throttle" looks wrong, probably hardcoded to 0xb010 instead of
> > > > > pmbase+0x10.
> > > > 
> > > > Hmm hardcoded where? Do you know where this comes from?
> > > 
> > > [root@fedora acpi]# grep -i b010 *.dsl
> > > SSDT.dsl:        Processor (CP00, 0x00, 0x0000B010, 0x06)
> > > 
> > > cheers,
> > >   Gerd
> 
> > Sorry I wasn't clear.
> > Where *should* the value come from?
> > Does QEMU have any hardware at that address?
> 
> It is part of the piix4 acpi bar, with seabios it looks like this:
> 
>   b000-b03f : 0000:00:01.3
>     b000-b003 : ACPI PM1a_EVT_BLK
>     b004-b005 : ACPI PM1a_CNT_BLK
>     b008-b00b : ACPI PM_TMR
>     b010-b015 : ACPI CPU throttle
> 
> I don't think we have virtual cpu throttling, as far I know nothing in
> qemu does actually listens at that address.  Maybe the CorrectThing[tm]
> to do would be passing 0 there (not fully sure how to express "no power
> management here" in acpi).
> 
> cheers,
>   Gerd
> 
> 

ACPI gives a way to do this: supply PBlockLength = 0.

I applied the following: though this means bytecode
is not 1:1 identical to what we have with seabios,
so I will keep it as a separate commit.

commit cbb0ddf058758e51a07cd77fcff22a286583d45b
Author: Michael S. Tsirkin <mst@redhat.com>
Date:   Fri Sep 27 01:15:14 2013 +0300

    ssdt: fix PBLK length
    
    We don't really support CPU throttling, so supply 0 PBLK length.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Gerd Hoffmann - Sept. 27, 2013, 9:34 a.m.
Hi,

> ACPI gives a way to do this: supply PBlockLength = 0.
> 
> I applied the following: though this means bytecode
> is not 1:1 identical to what we have with seabios,
> so I will keep it as a separate commit.

Sure.

Retested -- works fine now with both seabios + coreboot.
Glad to see this finally working out nicely.

cheers,
  Gerd

Patch

diff --git a/hw/i386/ssdt-proc.dsl b/hw/i386/ssdt-proc.dsl
index 58333c7..8229bfd 100644
--- a/hw/i386/ssdt-proc.dsl
+++ b/hw/i386/ssdt-proc.dsl
@@ -37,7 +37,7 @@  DefinitionBlock ("ssdt-proc.aml", "SSDT", 0x01, "BXPC", "BXSSDT", 0x1)
     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) {
+    Processor(CPAA, 0xAA, 0x00000000, 0x0) {
         ACPI_EXTRACT_NAME_BYTE_CONST ssdt_proc_id
         Name(ID, 0xAA)
 /*