qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] eee822: acpi-build: fix misaligned access


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] eee822: acpi-build: fix misaligned access
Date: Mon, 24 Mar 2014 12:30:06 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: eee822e3595bbdd69e71198edd65dd29db27a6e5
      
https://github.com/qemu/qemu/commit/eee822e3595bbdd69e71198edd65dd29db27a6e5
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2014-03-12 (Wed, 12 Mar 2014)

  Changed paths:
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  acpi-build: fix misaligned access

clang build reported a misaligned access:
    runtime error: store to misaligned address 0x2b5aa47dfb19 for type
    'uint16_t' (aka 'unsigned short'), which requires 2 byte alignment
    0x2b5aa47dfb19: note: pointer points here
     45 53 54  0b ff ff 5b 80 50 45 4f  52 01 50 45 53 54 01 5b  81 0b 50
    45 4f 52 01 50  45 50 54 08 14

fix this up

Reported-by: Peter Maydell <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 3dd46eb4969baaf32f490eaf57ed23672f1daad2
      
https://github.com/qemu/qemu/commit/3dd46eb4969baaf32f490eaf57ed23672f1daad2
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2014-03-18 (Tue, 18 Mar 2014)

  Changed paths:
    M tests/acpi-test-data/pc/SSDT
    M tests/acpi-test-data/q35/SSDT

  Log Message:
  -----------
  acpi-test: update expected SSDT files

commit 13f65b2e1073cf7e2c8fb3880c77d8a53fa2f95e
    acpi-test: update expected SSDT files

set an incorrect SSDT.
rebuild it.

Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 1d14ac5af04fab9ee734cc4c810f022df6745278
      
https://github.com/qemu/qemu/commit/1d14ac5af04fab9ee734cc4c810f022df6745278
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-03-18 (Tue, 18 Mar 2014)

  Changed paths:
    M include/hw/acpi/cpu_hotplug_defs.h

  Log Message:
  -----------
  acpi: Add ACPI_CPU_HOTPLUG_ID_LIMIT macro

The new macro will be helpful to allow us to detect too large SMP limits
before it is too late.

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 5ff020b7b02dce36a66c106df986ff68f8452542
      
https://github.com/qemu/qemu/commit/5ff020b7b02dce36a66c106df986ff68f8452542
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-03-18 (Tue, 18 Mar 2014)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  pc: Refuse CPU hotplug if the resulting APIC ID is too large

The ACPI CPU hotplug code requires APIC IDs to be smaller than
ACPI_CPU_HOTPLUG_ID_LIMIT, so enforce the limit before trying to hotplug
a new vCPU, returning an error instead of crashing.

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 39ee3af3a85fedb55b9eeb1a0bc81a2460eeaa01
      
https://github.com/qemu/qemu/commit/39ee3af3a85fedb55b9eeb1a0bc81a2460eeaa01
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-03-18 (Tue, 18 Mar 2014)

  Changed paths:
    M hw/acpi/cpu_hotplug.c

  Log Message:
  -----------
  acpi: Assert sts array limit on AcpiCpuHotplug_add()

AcpiCpuHotplug_add() can't handle vCPU arch IDs larger than
ACPI_CPU_HOTPLUG_ID_LIMIT. Instead of corrupting memory in case the vCPU
ID is too large, use g_assert() to ensure we are not over the limit.

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 798325ed3856bc1e2f2b640b7e0db60044fdddf9
      
https://github.com/qemu/qemu/commit/798325ed3856bc1e2f2b640b7e0db60044fdddf9
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-03-18 (Tue, 18 Mar 2014)

  Changed paths:
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  acpi: Don't use MAX_CPUMASK_BITS for APIC ID bitmap

MAX_CPUMASK_BITS is a limit for max_cpus and CPU indexes, not for APIC
IDs.

ACPI_CPU_HOTPLUG_ID_LIMIT is the right macro for the limit on APIC IDs
on the ACPI and CPU hotplug code.

There are no functional changes introduced by this patch, as
MAX_CPUMASK_BITS + 1 == 255 + 1 == 256 == ACPI_CPU_HOTPLUG_ID_LIMIT.

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: f03bd716a2935532379cff1c71c6f0f399921b70
      
https://github.com/qemu/qemu/commit/f03bd716a2935532379cff1c71c6f0f399921b70
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-03-18 (Tue, 18 Mar 2014)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  pc: Refuse max_cpus if it results in too large APIC ID

This changes the PC initialization code to reject max_cpus if it results
in an APIC ID that's too large, instead of aborting or erroring out when
it is already too late.

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 9bcc80cd71892df42605e0c097d85c0237ff45d1
      
https://github.com/qemu/qemu/commit/9bcc80cd71892df42605e0c097d85c0237ff45d1
  Author: Laszlo Ersek <address@hidden>
  Date:   2014-03-18 (Tue, 18 Mar 2014)

  Changed paths:
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  i386/acpi-build: allow more than 255 elements in CPON

The build_ssdt() function builds a number of AML objects that are related
to CPU hotplug, and whose IDs form a contiguous sequence of APIC IDs.
(APIC IDs are in fact discontiguous, but this is the traditional
interface: build a contiguous sequence from zero up that covers all
possible APIC IDs.) These objects are:

- a Processor() object for each VCPU,
- a NTFY method, with one branch for each VCPU,
- a CPON package with one element (hotplug status byte) for each VCPU.

The build_ssdt() function currently limits the *count* of processor
objects, and NTFY branches, and CPON elements, in 0xFF (see the assignment
to "acpi_cpus"). This allows for an inclusive APIC ID range of [0..254].
This is incorrect, because the highest APIC ID that we otherwise allow a
VCPU to take is 255.

In order to extend the maximum count to 256, and the traversed APIC ID
range correspondingly to [0..255]:
- the Processor() objects need no change,
- the NTFY method also needs no change,
- the CPON package must be updated, because it is defined with a
  DefPackage, and the number of elements in such a package can be at most
  255. We pick a DefVarPackage instead.

We replace the Op byte, and the encoding of the number of elements.
Compare:

DefPackage     := PackageOp    PkgLength NumElements    PackageElementList
DefVarPackage  := VarPackageOp PkgLength VarNumElements PackageElementList

PackageOp      := 0x12
VarPackageOp   := 0x13

NumElements    := ByteData
VarNumElements := TermArg => Integer

The build_append_int() function implements precisely the following TermArg
encodings (a subset of what the ACPI spec describes):

  TermArg             := DataObject
  DataObject          := ComputationalData
  ComputationalData   := ConstObj | ByteConst | WordConst | DWordConst

  directly encoded in the function, with build_append_byte():
    ConstObj          := ZeroOp | OneOp
      ZeroOp          := 0x00
      OneOp           := 0x01

  call to build_append_value(..., 1):
    ByteConst         := BytePrefix ByteData
      BytePrefix      := 0x0A
      ByteData        := 0x00 - 0xFF

  call to build_append_value(..., 2):
    WordConst         := WordPrefix WordData
      WordPrefix      := 0x0B
      WordData        := ByteData[0:7] ByteData[8:15]

  call to build_append_value(..., 4):
    DWordConst        := DWordPrefix DWordData
      DWordPrefix     := 0x0C
      DWordData       := WordData[0:15] WordData[16:31]

Signed-off-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: d07e0e9cddf02dd2abedbbf7ab0e069c8f5dabfd
      
https://github.com/qemu/qemu/commit/d07e0e9cddf02dd2abedbbf7ab0e069c8f5dabfd
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2014-03-18 (Tue, 18 Mar 2014)

  Changed paths:
    M tests/acpi-test-data/pc/SSDT
    M tests/acpi-test-data/q35/SSDT

  Log Message:
  -----------
  acpi-test: rebuild SSDT

commit 9bcc80cd71892df42605e0c097d85c0237ff45d1
    i386/acpi-build: allow more than 255 elements in CPON

Replaces 0x1 with a smaller One constant.

rebuild expected SSDT.

Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 2fd71f1be2a2554b790fa63fc14b6b4c7683f1f3
      
https://github.com/qemu/qemu/commit/2fd71f1be2a2554b790fa63fc14b6b4c7683f1f3
  Author: Laszlo Ersek <address@hidden>
  Date:   2014-03-18 (Tue, 18 Mar 2014)

  Changed paths:
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  i386/acpi-build: support hotplug of VCPU with APIC ID 0xFF

Building on the previous patch, raise the maximal count of processor
objects / NTFY branches / CPON elements from 255 to 256. This allows the
VCPU with APIC ID 0xFF to be hotplugged.

Signed-off-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: c225aa3c6de64f61fe68de2e5f4e3897544daf0d
      
https://github.com/qemu/qemu/commit/c225aa3c6de64f61fe68de2e5f4e3897544daf0d
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2014-03-18 (Tue, 18 Mar 2014)

  Changed paths:
    M tests/acpi-test.c

  Log Message:
  -----------
  acpi-test: signature endian-ness fixes

acpi table signature is really an ASCII string.
Treat it as such in tests.

Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 821e3227863ea8db057190e578efa0f1f57ed9de
      
https://github.com/qemu/qemu/commit/821e3227863ea8db057190e578efa0f1f57ed9de
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2014-03-18 (Tue, 18 Mar 2014)

  Changed paths:
    M hw/i386/acpi-build.c
    M hw/i386/acpi-defs.h

  Log Message:
  -----------
  acpi: fix endian-ness for table ids

when using signature for table ID, we forgot to byte-swap it.
signatures are really ASCII strings, let's treat them as such.
While at it, get rid of most of _SIGNATURE macros.

Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: d2995916ea262bca40788f275c7f53f1c0a0b606
      
https://github.com/qemu/qemu/commit/d2995916ea262bca40788f275c7f53f1c0a0b606
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-03-19 (Wed, 19 Mar 2014)

  Changed paths:
    M include/sysemu/sysemu.h

  Log Message:
  -----------
  sysemu.h: Document what MAX_CPUMASK_BITS really limits

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: af67ee9264c135f4b213b4bc1a3871c4e9ec7da3
      
https://github.com/qemu/qemu/commit/af67ee9264c135f4b213b4bc1a3871c4e9ec7da3
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-03-19 (Wed, 19 Mar 2014)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: b2c494c3a473adf654144c845e04bebffb05dee0
      
https://github.com/qemu/qemu/commit/b2c494c3a473adf654144c845e04bebffb05dee0
  Author: Cole Robinson <address@hidden>
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
    M ui/spice-input.c

  Log Message:
  -----------
  spice: input: Fix absolute mouse y coordinates

Current tablet + spice is unusable. Regressed with the UI input rework.

Signed-off-by: Cole Robinson <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: dac23a6c05e543590508b48b8ed31d89b0c99c61
      
https://github.com/qemu/qemu/commit/dac23a6c05e543590508b48b8ed31d89b0c99c61
  Author: Marcel Apfelbaum <address@hidden>
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
    M tests/acpi-test.c

  Log Message:
  -----------
  tests/acpi-test: do not fail if iasl is broken

There is an issue with iasl on big endian machines: It
cannot disassemble acpi tables taken from little endian
machines, so we cannot check the expected tables.

The acpi test will check if the expected aml files
can be disassembled, and will issue an warning not
failing the test on those machines until this
problem is solved by the acpica community.

Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: e12b2a4fab75c0771ed21ac6ce06120cbb27b68e
      
https://github.com/qemu/qemu/commit/e12b2a4fab75c0771ed21ac6ce06120cbb27b68e
  Author: Peter Maydell <address@hidden>
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
    M ui/spice-input.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/spice/tags/pull-spice-5' into staging

spice: input: Fix absolute mouse y coordinates

# gpg: Signature made Mon 24 Mar 2014 07:44:11 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <address@hidden>"
# gpg:                 aka "Gerd Hoffmann <address@hidden>"
# gpg:                 aka "Gerd Hoffmann (private) <address@hidden>"

* remotes/spice/tags/pull-spice-5:
  spice: input: Fix absolute mouse y coordinates

Signed-off-by: Peter Maydell <address@hidden>


  Commit: 90c49ef1650698cff1288e0d22aa858d89f820fa
      
https://github.com/qemu/qemu/commit/90c49ef1650698cff1288e0d22aa858d89f820fa
  Author: Peter Maydell <address@hidden>
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
    M hw/acpi/cpu_hotplug.c
    M hw/i386/acpi-build.c
    M hw/i386/acpi-defs.h
    M hw/i386/pc.c
    M include/hw/acpi/cpu_hotplug_defs.h
    M include/sysemu/sysemu.h
    M tests/acpi-test-data/pc/SSDT
    M tests/acpi-test-data/q35/SSDT
    M tests/acpi-test.c
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

acpi,pc,test bug fixes

More small fixes all over the place.
Notably fixes for big-endian hosts by Marcel.

Signed-off-by: Michael S. Tsirkin <address@hidden>

# gpg: Signature made Mon 24 Mar 2014 10:41:07 GMT using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <address@hidden>"
# gpg:                 aka "Michael S. Tsirkin <address@hidden>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  tests/acpi-test: do not fail if iasl is broken
  vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant
  sysemu.h: Document what MAX_CPUMASK_BITS really limits
  acpi: fix endian-ness for table ids
  acpi-test: signature endian-ness fixes
  i386/acpi-build: support hotplug of VCPU with APIC ID 0xFF
  acpi-test: rebuild SSDT
  i386/acpi-build: allow more than 255 elements in CPON
  pc: Refuse max_cpus if it results in too large APIC ID
  acpi: Don't use MAX_CPUMASK_BITS for APIC ID bitmap
  acpi: Assert sts array limit on AcpiCpuHotplug_add()
  pc: Refuse CPU hotplug if the resulting APIC ID is too large
  acpi: Add ACPI_CPU_HOTPLUG_ID_LIMIT macro
  acpi-test: update expected SSDT files
  acpi-build: fix misaligned access

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/e279e252ac7e...90c49ef16506

reply via email to

[Prev in Thread] Current Thread [Next in Thread]