Commits on Oct 14, 2023

  1. target/hppa: Update to SeaBIOS-hppa version 10

    Enhancements:
    - Initial support for 64-bit CPUs with Astro/Elroy (e.g. C3700
      workstation)
    - USB support (OHCI)
    - better PCI support
    - esp-scsi fixes from Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    
    Signed-off-by: Helge Deller <deller@gmx.de>
    hdeller committed Oct 14, 2023
    Copy the full SHA
    ce32a9e View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2023

  1. hw/hppa: Require at least SeaBIOS-hppa version 10

    The new SeaBIOS-hppa version 10 includes initial support
    for PA2.0 CPUs.
    Additionally update copyright and drop commented-out code.
    
    Signed-off-by: Helge Deller <deller@gmx.de>
    hdeller committed Oct 17, 2023
    Copy the full SHA
    a536f56 View commit details
    Browse the repository at this point in the history
  2. pci_ids/tulip: Add PCI vendor ID for HP and use it in tulip

    Signed-off-by: Helge Deller <deller@gmx.de>
    hdeller committed Oct 17, 2023
    Copy the full SHA
    2e90154 View commit details
    Browse the repository at this point in the history
  3. lasips2: LASI PS/2 devices are not user-createable

    Those PS/2 ports are created with the LASI controller when
    a 32-bit PA-RISC machine is created.
    
    Mark them not user-createable to avoid showing them in
    the qemu device list.
    
    Signed-off-by: Helge Deller <deller@gmx.de>
    Cc: qemu-stable@nongnu.org
    hdeller committed Oct 17, 2023
    Copy the full SHA
    a1e6a5c View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2023

  1. vdpa: Use iovec for vhost_vdpa_net_cvq_add()

    Next patches in this series will no longer perform an
    immediate poll and check of the device's used buffers
    for each CVQ state load command. Consequently, there
    will be multiple pending buffers in the shadow VirtQueue,
    making it a must for every control command to have its
    own buffer.
    
    To achieve this, this patch refactor vhost_vdpa_net_cvq_add()
    to accept `struct iovec`, which eliminates the coupling of
    control commands to `s->cvq_cmd_out_buffer` and `s->status`,
    allowing them to use their own buffer.
    
    Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
    Acked-by: Eugenio Pérez <eperezma@redhat.com>
    Message-Id: <8a328f146fb043f34edb75ba6d043d2d6de88f99.1697165821.git.yin31149@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    JiaweiHawk authored and mstsirkin committed Oct 18, 2023
    Copy the full SHA
    0e6bff0 View commit details
    Browse the repository at this point in the history
  2. vdpa: Avoid using vhost_vdpa_net_load_*() outside vhost_vdpa_net_load()

    Next patches in this series will refactor vhost_vdpa_net_load_cmd()
    to iterate through the control commands shadow buffers, allowing QEMU
    to send CVQ state load commands in parallel at device startup.
    
    Considering that QEMU always forwards the CVQ command serialized
    outside of vhost_vdpa_net_load(), it is more elegant to send the
    CVQ commands directly without invoking vhost_vdpa_net_load_*() helpers.
    
    Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
    Acked-by: Eugenio Pérez <eperezma@redhat.com>
    Message-Id: <254f0618efde7af7229ba4fdada667bb9d318991.1697165821.git.yin31149@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    JiaweiHawk authored and mstsirkin committed Oct 18, 2023
    Copy the full SHA
    327dedb View commit details
    Browse the repository at this point in the history
  3. vdpa: Check device ack in vhost_vdpa_net_load_rx_mode()

    Considering that vhost_vdpa_net_load_rx_mode() is only called
    within vhost_vdpa_net_load_rx() now, this patch refactors
    vhost_vdpa_net_load_rx_mode() to include a check for the
    device's ack, simplifying the code and improving its maintainability.
    
    Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
    Acked-by: Eugenio Pérez <eperezma@redhat.com>
    Message-Id: <68811d52f96ae12d68f0d67d996ac1642a623943.1697165821.git.yin31149@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    JiaweiHawk authored and mstsirkin committed Oct 18, 2023
    Copy the full SHA
    24e59cf View commit details
    Browse the repository at this point in the history
  4. vdpa: Move vhost_svq_poll() to the caller of vhost_vdpa_net_cvq_add()

    This patch moves vhost_svq_poll() to the caller of
    vhost_vdpa_net_cvq_add() and introduces a helper funtion.
    
    By making this change, next patches in this series is
    able to refactor vhost_vdpa_net_load_x() only to delay
    the polling and checking process until either the SVQ
    is full or control commands shadow buffers are full.
    
    Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
    Message-Id: <196cadb55175a75275660c6634a538289f027ae3.1697165821.git.yin31149@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    JiaweiHawk authored and mstsirkin committed Oct 18, 2023
    Copy the full SHA
    a864a32 View commit details
    Browse the repository at this point in the history
  5. vdpa: Introduce cursors to vhost_vdpa_net_loadx()

    This patch introduces two new arugments, `out_cursor`
    and `in_cursor`, to vhost_vdpa_net_loadx(). Addtionally,
    it includes a helper function
    vhost_vdpa_net_load_cursor_reset() for resetting these
    cursors.
    
    Furthermore, this patch refactors vhost_vdpa_net_load_cmd()
    so that vhost_vdpa_net_load_cmd() prepares buffers
    for the device using the cursors arguments, instead
    of directly accesses `s->cvq_cmd_out_buffer` and
    `s->status` fields.
    
    By making these change, next patches in this series
    can refactor vhost_vdpa_net_load_cmd() directly to
    iterate through the control commands shadow buffers,
    allowing QEMU to send CVQ state load commands in parallel
    at device startup.
    
    Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
    Message-Id: <1c6516e233a14cc222f0884e148e4e1adceda78d.1697165821.git.yin31149@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    JiaweiHawk authored and mstsirkin committed Oct 18, 2023
    Copy the full SHA
    1d7e2a8 View commit details
    Browse the repository at this point in the history
  6. vhost: Expose vhost_svq_available_slots()

    Next patches in this series will delay the polling
    and checking of buffers until either the SVQ is
    full or control commands shadow buffers are full,
    no longer perform an immediate poll and check of
    the device's used buffers for each CVQ state load command.
    
    To achieve this, this patch exposes
    vhost_svq_available_slots(), allowing QEMU to know
    whether the SVQ is full.
    
    Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
    Acked-by: Eugenio Pérez <eperezma@redhat.com>
    Message-Id: <25938079f0bd8185fd664c64e205e629f7a966be.1697165821.git.yin31149@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    JiaweiHawk authored and mstsirkin committed Oct 18, 2023
    Copy the full SHA
    99d6a32 View commit details
    Browse the repository at this point in the history
  7. vdpa: Send cvq state load commands in parallel

    This patch enables sending CVQ state load commands
    in parallel at device startup by following steps:
    
      * Refactor vhost_vdpa_net_load_cmd() to iterate through
    the control commands shadow buffers. This allows different
    CVQ state load commands to use their own unique buffers.
    
      * Delay the polling and checking of buffers until either
    the SVQ is full or control commands shadow buffers are full.
    
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1578
    Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
    Acked-by: Eugenio Pérez <eperezma@redhat.com>
    Message-Id: <9350f32278e39f7bce297b8f2d82dac27c6f8c9a.1697165821.git.yin31149@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    JiaweiHawk authored and mstsirkin committed Oct 18, 2023
    Copy the full SHA
    acec5f6 View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2023

  1. qapi: re-establish linting baseline

    Some very minor housekeeping to make the linters happy once more.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Message-ID: <20231004230532.3002201-4-jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    jnsnow authored and Markus Armbruster committed Oct 19, 2023
    Copy the full SHA
    a6c5d15 View commit details
    Browse the repository at this point in the history
  2. qapi: Belatedly update CompatPolicy documentation for unstable

    Commit 57df0df (qapi: Extend -compat to set policy for unstable
    interfaces) neglected to update the "Limitation" paragraph to mention
    feature 'unstable' in addition to feature 'deprecated'.  Do that now.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-ID: <20231009110449.4015601-1-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Markus Armbruster committed Oct 19, 2023
    Copy the full SHA
    0a59c02 View commit details
    Browse the repository at this point in the history
  3. qapi: provide a friendly string representation of QAPI classes

    If printing a QAPI schema object for debugging we get the classname and
    a hex value for the instance:
    
      <qapi.schema.QAPISchemaEnumType object at 0x7f0ab4c2dad0>
      <qapi.schema.QAPISchemaObjectType object at 0x7f0ab4c2dd90>
      <qapi.schema.QAPISchemaArrayType object at 0x7f0ab4c2df90>
    
    With this change we instead get the classname and the human friendly
    name of the QAPI type instance:
    
      <QAPISchemaEnumType:CpuS390State at 0x7f0ab4c2dad0>
      <QAPISchemaObjectType:CpuInfoS390 at 0x7f0ab4c2dd90>
      <QAPISchemaArrayType:CpuInfoFastList at 0x7f0ab4c2df90>
    
    Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-ID: <20231018120500.2028642-1-berrange@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    [Conditional swapped to avoid negation]
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    [Tweaked to mollify pylint]
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    berrange authored and Markus Armbruster committed Oct 19, 2023
    Copy the full SHA
    e307a81 View commit details
    Browse the repository at this point in the history
  4. hw/arm: Move raspberrypi-fw-defs.h to the include/hw/arm/ folder

    The file is obviously related to the raspberrypi machine, so
    it should reside in hw/arm/ instead of hw/misc/. And while we're
    at it, also adjust the wildcard in MAINTAINERS so that it covers
    this file, too.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Acked-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Message-id: 20231012073458.860187-1-thuth@redhat.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    huth authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    29ecf2d View commit details
    Browse the repository at this point in the history
  5. hw/arm/exynos4210: Get arm_boot_info declaration from 'hw/arm/boot.h'

    struct arm_boot_info is declared in "hw/arm/boot.h".
    By including the correct header we don't need to declare
    it again in "target/arm/cpu-qom.h".
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20231013130214.95742-1-philmd@linaro.org
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    philmd authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    85c90d4 View commit details
    Browse the repository at this point in the history
  6. xlnx-bbram: hw/nvram: Remove deprecated device reset

    This change implements the ResettableClass interface for the device.
    
    Signed-off-by: Tong Ho <tong.ho@amd.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Message-id: 20231003052345.199725-1-tong.ho@amd.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Tong Ho authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    213bf5c View commit details
    Browse the repository at this point in the history
  7. xlnx-zynqmp-efuse: hw/nvram: Remove deprecated device reset

    This change implements the ResettableClass interface for the device.
    
    Signed-off-by: Tong Ho <tong.ho@amd.com>
    Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
    Message-id: 20231004055713.324009-1-tong.ho@amd.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Tong Ho authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    7667b51 View commit details
    Browse the repository at this point in the history
  8. xlnx-versal-efuse: hw/nvram: Remove deprecated device reset

    This change implements the ResettableClass interface for the device.
    
    Signed-off-by: Tong Ho <tong.ho@amd.com>
    Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
    Message-id: 20231004055339.323833-1-tong.ho@amd.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Tong Ho authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    51244b5 View commit details
    Browse the repository at this point in the history
  9. xlnx-bbram: hw/nvram: Use dot in device type name

    This replaces the comma (,) to dot (.) in the device type name
    so the name can be used with the 'driver=' command line option.
    
    Signed-off-by: Tong Ho <tong.ho@amd.com>
    Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
    Message-id: 20231003052139.199665-1-tong.ho@amd.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Tong Ho authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    b65b4b7 View commit details
    Browse the repository at this point in the history
  10. elf2dmp: limit print length for sign_rsds

    String sign_rsds isn't terminated, so the print length must be limited.
    
    Fixes: Coverity CID 1521598
    Signed-off-by: Viktor Prutyanov <viktor@daynix.com>
    Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
    Message-id: 20230930235317.11469-2-viktor@daynix.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    viktor-prutyanov authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    8b01683 View commit details
    Browse the repository at this point in the history
  11. elf2dmp: check array bounds in pdb_get_file_size

    Index in file_size array must be checked against num_files, because the
    entries we are looking for may be absent in the PDB.
    
    Fixes: Coverity CID 1521597
    Signed-off-by: Viktor Prutyanov <viktor@daynix.com>
    Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Message-id: 20230930235317.11469-3-viktor@daynix.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    viktor-prutyanov authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    9d9c06b View commit details
    Browse the repository at this point in the history
  12. target/arm: Fix CNTPCT_EL0 trapping from EL0 when HCR_EL2.E2H is 0

    On an attempt to access CNTPCT_EL0 from EL0 using a guest running on top
    of Xen, a trap from EL2 was observed which is something not reproducible
    on HW (also, Xen does not trap accesses to physical counter).
    
    This is because gt_counter_access() checks for an incorrect bit (1
    instead of 0) of CNTHCTL_EL2 if HCR_EL2.E2H is 0 and access is made to
    physical counter. Refer ARM ARM DDI 0487J.a, D19.12.2:
    When HCR_EL2.E2H is 0:
     - EL1PCTEN, bit [0]: refers to physical counter
     - EL1PCEN, bit [1]: refers to physical timer registers
    
    Drop entire block "if (hcr & HCR_E2H) {...} else {...}" from EL0 case
    and fall through to EL1 case, given that after fixing checking for the
    correct bit, the handling is the same.
    
    Fixes: 5bc8437 ("target/arm: Update timer access for VHE")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Tested-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Message-id: 20230928094404.20802-1-michal.orzel@amd.com
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    orzelmichal authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    d01448c View commit details
    Browse the repository at this point in the history
  13. {include/}hw/arm: refactor virt PPI logic

    GIC Private Peripheral Interrupts (PPI) are defined as GIC INTID 16-31.
    As in, PPI0 is INTID16 .. PPI15 is INTID31.
    Arm's Base System Architecture specification (BSA) lists the mandated and
    recommended private interrupt IDs by INTID, not by PPI index. But current
    definitions in virt define them by PPI index, complicating cross
    referencing.
    
    Meanwhile, the PPI(x) macro counterintuitively adds 16 to the input value,
    converting a PPI index to an INTID.
    
    Resolve this by redefining the BSA-allocated PPIs by their INTIDs,
    and replacing the PPI(x) macro with an INTID_TO_PPI(x) one where required.
    
    Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
    Message-id: 20230919090229.188092-2-quic_llindhol@quicinc.com
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    leiflindholm authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    9036e91 View commit details
    Browse the repository at this point in the history
  14. include/hw/arm: move BSA definitions to bsa.h

    virt.h defines a number of IRQs that are ultimately described by Arm's
    Base System Architecture specification. Move these to a dedicated header
    so that they can be reused by other platforms that do the same.
    Include that header from virt.h to minimise churn.
    
    While we're moving the definitions, sort them into numerical order,
    and add the ARCH_TIMER_NS_EL2_VIRT_IRQ definition used by sbsa-ref
    and which will eventually be needed by virt also.
    
    Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
    Message-id: 20230919090229.188092-3-quic_llindhol@quicinc.com
    [PMM: Remove unused PPI_TO_INTID macro; sort numerically;
     add ARCH_TIMER_NS_EL2_VIRT_IRQ]
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    leiflindholm authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    2419ce8 View commit details
    Browse the repository at this point in the history
  15. hw/arm/sbsa-ref: use bsa.h for PPI definitions

    Use the private peripheral interrupt definitions from bsa.h instead of
    defining them locally. Refactor to use the INTIDs defined there instead
    of the PPI# used previously.
    
    Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
    Message-id: 20230919090229.188092-4-quic_llindhol@quicinc.com
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    leiflindholm authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    d40ab06 View commit details
    Browse the repository at this point in the history
  16. arm/kvm: convert to kvm_set_one_reg

    We can neaten the code by switching to the kvm_set_one_reg function.
    
    Reviewed-by: Gavin Shan <gshan@redhat.com>
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Message-id: 20231010142453.224369-2-cohuck@redhat.com
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    cohuck authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    6c8b9a7 View commit details
    Browse the repository at this point in the history
  17. arm/kvm: convert to kvm_get_one_reg

    We can neaten the code by switching the callers that work on a
    CPUstate to the kvm_get_one_reg function.
    
    Reviewed-by: Gavin Shan <gshan@redhat.com>
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Message-id: 20231010142453.224369-3-cohuck@redhat.com
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    cohuck authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    40d45b8 View commit details
    Browse the repository at this point in the history
  18. target/arm: Permit T32 LDM with single register

    For the Thumb T32 encoding of LDM, if only a single register is
    specified in the register list this instruction is UNPREDICTABLE,
    with the following choices:
     * instruction UNDEFs
     * instruction is a NOP
     * instruction loads a single register
     * instruction loads an unspecified set of registers
    
    Currently we choose to UNDEF (a behaviour chosen in commit
    4b22254 in 2019; previously we treated it as "load the
    specified single register").
    
    Unfortunately there is real world code out there (which shipped in at
    least Android 11, 12 and 13) which incorrectly uses this
    UNPREDICTABLE insn on the assumption that it does a single register
    load, which is (presumably) what it happens to do on real hardware,
    and is also what it does on the equivalent A32 encoding.
    
    Revert to the pre-4b222545dbf30 behaviour of not UNDEFing
    for this T32 encoding.
    
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1799
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20230927101853.39288-1-peter.maydell@linaro.org
    pm215 committed Oct 19, 2023
    Copy the full SHA
    a530e47 View commit details
    Browse the repository at this point in the history
  19. hw/arm/smmuv3: Update ID register bit field definitions

    Update the SMMUv3 ID register bit field definitions to the
    set in the most recent specification (IHI0700 F.a).
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Mostafa Saleh <smostafa@google.com>
    Reviewed-by: Eric Auger <eric.auger@redhat.com>
    Message-id: 20230914145705.1648377-2-peter.maydell@linaro.org
    pm215 committed Oct 19, 2023
    Copy the full SHA
    cbaf940 View commit details
    Browse the repository at this point in the history
  20. hw/arm/smmuv3: Sort ID register setting into field order

    In smmuv3_init_regs() when we set the various bits in the ID
    registers, we do this almost in order of the fields in the
    registers, but not quite. Move the initialization of
    SMMU_IDR3.RIL and SMMU_IDR5.OAS into their correct places.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Mostafa Saleh <smostafa@google.com>
    Reviewed-by: Eric Auger <eric.auger@redhat.com>
    Message-id: 20230914145705.1648377-3-peter.maydell@linaro.org
    pm215 committed Oct 19, 2023
    Copy the full SHA
    27fd85d View commit details
    Browse the repository at this point in the history
  21. hw/arm/smmuv3: Advertise SMMUv3.1-XNX feature

    The SMMUv3.1-XNX feature is mandatory for an SMMUv3.1 if S2P is
    supported, so we should theoretically have implemented it as part of
    the recent S2P work.  Fortunately, for us the implementation is a
    no-op.
    
    This feature is about interpretation of the stage 2 page table
    descriptor XN bits, which control execute permissions.
    
    For QEMU, the permission bits passed to an IOMMU (via MemTxAttrs and
    IOMMUAccessFlags) only indicate read and write; we do not distinguish
    data reads from instruction reads outside the CPU proper.  In the
    SMMU architecture's terms, our interconnect between the client device
    and the SMMU doesn't have the ability to convey the INST attribute,
    and we therefore use the default value of "data" for this attribute.
    
    We also do not support the bits in the Stream Table Entry that can
    override the on-the-bus transaction attribute permissions (we do not
    set SMMU_IDR1.ATTR_PERMS_OVR=1).
    
    These two things together mean that for our implementation, it never
    has to deal with transactions with the INST attribute, and so it can
    correctly ignore the XN bits entirely.  So we already implement
    FEAT_XNX's "XN field is now 2 bits, not 1" behaviour to the extent
    that we need to.
    
    Advertise the presence of the feature in SMMU_IDR3.XNX.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Mostafa Saleh <smostafa@google.com>
    Reviewed-by: Eric Auger <eric.auger@redhat.com>
    Message-id: 20230914145705.1648377-4-peter.maydell@linaro.org
    pm215 committed Oct 19, 2023
    Copy the full SHA
    4cdd146 View commit details
    Browse the repository at this point in the history
  22. target/arm: Implement FEAT_HPMN0

    FEAT_HPMN0 is a small feature which defines that it is valid for
    MDCR_EL2.HPMN to be set to 0, meaning "no PMU event counters provided
    to an EL1 guest" (previously this setting was reserved). QEMU's
    implementation almost gets HPMN == 0 right, but we need to fix
    one check in pmevcntr_is_64_bit(). That is enough for us to
    advertise the feature in the 'max' CPU.
    
    (We don't need to make the behaviour conditional on feature
    presence, because the FEAT_HPMN0 behaviour is within the range
    of permitted UNPREDICTABLE behaviour for a non-FEAT_HPMN0
    implementation.)
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20230921185445.3339214-1-peter.maydell@linaro.org
    pm215 committed Oct 19, 2023
    Copy the full SHA
    3d80bbf View commit details
    Browse the repository at this point in the history
  23. target/arm/kvm64.c: Remove unused include

    The include of hw/arm/virt.h in kvm64.c is unnecessary and also a
    layering violation since the generic KVM code shouldn't need to know
    anything about board-specifics.  The include line is an accidental
    leftover from commit 1561335, where we cleaned up the code
    to not depend on virt board internals but forgot to also remove the
    now-redundant include line.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Gavin Shan <gshan@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Message-id: 20230925110429.3917202-1-peter.maydell@linaro.org
    pm215 committed Oct 19, 2023
    Copy the full SHA
    4fd79a9 View commit details
    Browse the repository at this point in the history
  24. target/arm/common-semi-target.h: Remove unnecessary boot.h include

    The hw/arm/boot.h include in common-semi-target.h is not actually
    needed, and it's a bit odd because it pulls a hw/arm header into a
    target/arm file.
    
    This include was originally needed because the semihosting code used
    the arm_boot_info struct to get the base address of the RAM in system
    emulation, to use in a (bad) heuristic for the return values for the
    SYS_HEAPINFO semihosting call.  We've since overhauled how we
    calculate the HEAPINFO values in system emulation, and the code no
    longer uses the arm_boot_info struct.
    
    Remove the now-redundant include line, and instead directly include
    the cpu-qom.h header that we were previously getting via boot.h.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20230925112219.3919261-1-peter.maydell@linaro.org
    pm215 committed Oct 19, 2023
    Copy the full SHA
    30722e0 View commit details
    Browse the repository at this point in the history
  25. target/arm/arm-powerctl: Correctly init CPUs when powered on to lower EL

    The code for powering on a CPU in arm-powerctl.c has two separate
    use cases:
     * emulation of a real hardware power controller
     * emulation of firmware interfaces (primarily PSCI) with
       CPU on/off APIs
    
    For the first case, we only need to reset the CPU and set its
    starting PC and X0.  For the second case, because we're emulating the
    firmware we need to ensure that it's in the state that the firmware
    provides.  In particular, when we reset to a lower EL than the
    highest one we are emulating, we need to put the CPU into a state
    that permits correct running at that lower EL.  We already do a
    little of this in arm-powerctl.c (for instance we set SCR_HCE to
    enable the HVC insn) but we don't do enough of it.  This means that
    in the case where we are emulating EL3 but also providing emulated
    PSCI the guest will crash when a secondary core tries to use a
    feature that needs an SCR_EL3 bit to be set, such as MTE or PAuth.
    
    The hw/arm/boot.c code also has to support this "start guest code in
    an EL that's lower than the highest emulated EL" case in order to do
    direct guest kernel booting; it has all the necessary initialization
    code to set the SCR_EL3 bits.  Pull the relevant boot.c code out into
    a separate function so we can share it between there and
    arm-powerctl.c.
    
    This refactoring has a few code changes that look like they
    might be behaviour changes but aren't:
     * if info->secure_boot is false and info->secure_board_setup is
       true, then the old code would start the first CPU in Hyp
       mode but without changing SCR.NS and NSACR.{CP11,CP10}.
       This was wrong behaviour because there's no such thing
       as Secure Hyp mode. The new code will leave the CPU in SVC.
       (There is no board which sets secure_boot to false and
       secure_board_setup to true, so this isn't a behaviour
       change for any of our boards.)
     * we don't explicitly clear SCR.NS when arm-powerctl.c
       does a CPU-on to EL3. This was a no-op because CPU reset
       will reset to NS == 0.
    
    And some real behaviour changes:
     * we no longer set HCR_EL2.RW when booting into EL2: the guest
       can and should do that themselves before dropping into their
       EL1 code. (arm-powerctl and boot did this differently; I
       opted to use the logic from arm-powerctl, which only sets
       HCR_EL2.RW when it's directly starting the guest in EL1,
       because it's more correct, and I don't expect guests to be
       accidentally depending on our having set the RW bit for them.)
     * if we are booting a CPU into AArch32 Secure SVC then we won't
       set SCR.HCE any more. This affects only the vexpress-a15 and
       raspi2b machine types. Guests booting in this case will either:
        - be able to set SCR.HCE themselves as part of moving from
          Secure SVC into NS Hyp mode
        - will move from Secure SVC to NS SVC, and won't care about
          behaviour of the HVC insn
        - will stay in Secure SVC, and won't care about HVC
     * on an arm-powerctl CPU-on we will now set the SCR bits for
       pauth/mte/sve/sme/hcx/fgt features
    
    The first two of these are very minor and I don't expect guest
    code to trip over them, so I didn't judge it worth convoluting
    the code in an attempt to keep exactly the same boot.c behaviour.
    The third change fixes issue 1899.
    
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1899
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20230926155619.4028618-1-peter.maydell@linaro.org
    pm215 committed Oct 19, 2023
    Copy the full SHA
    3a45f4f View commit details
    Browse the repository at this point in the history
  26. hw/timer/npcm7xx_timer: Prevent timer from counting down past zero

    The counter register is only 24-bits and counts down.  If the timer is
    running but the qtimer to reset it hasn't fired off yet, there is a chance
    the regster read can return an invalid result.
    
    Signed-off-by: Chris Rauer <crauer@google.com>
    Message-id: 20230922181411.2697135-1-crauer@google.com
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    chrisrauer authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    9ef2629 View commit details
    Browse the repository at this point in the history
  27. contrib/elf2dmp: Use g_malloc(), g_new() and g_free()

    QEMU coding style uses the glib memory allocation APIs, not
    the raw libc malloc/free. Switch the allocation and free
    calls in elf2dmp to use these functions (dropping the now-unneeded
    checks for failure).
    
    Signed-off-by: Suraj Shirvankar <surajshirvankar@gmail.com>
    Message-id: 169753938460.23804.11418813007617535750-1@git.sr.ht
    [PMM: also remove NULL checks from g_malloc() calls;
     beef up commit message]
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    h0lyalg0rithm authored and pm215 committed Oct 19, 2023
    Copy the full SHA
    2a052b4 View commit details
    Browse the repository at this point in the history
  28. tests: test-smp-parse: Add the test for cores/threads per socket helpers

    Use the different ways to calculate cores/threads per socket, so that
    the new CPU topology levels won't be missed in these 2 helpes:
    
    * machine_topo_get_cores_per_socket()
    * machine_topo_get_threads_per_socket()
    
    Test the commit a1d027b ("machine: Add helpers to get cores/
    threads per socket").
    
    Suggested-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Acked-by: Igor Mammedov <imammedo@redhat.com>
    Message-Id: <20230928125943.1816922-2-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    364c752 View commit details
    Browse the repository at this point in the history
  29. tests: bios-tables-test: Prepare the ACPI table change for smbios typ…

    …e4 count test
    
    Following the guidelines in tests/qtest/bios-tables-test.c, this
    is step 1 - 3.
    
    List the ACPI tables that will be added to test the type 4 count.
    
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Message-Id: <20230928125943.1816922-3-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    9717aa0 View commit details
    Browse the repository at this point in the history
  30. tests: bios-tables-test: Add test for smbios type4 count

    This tests the commit d79a284 ("hw/smbios: Fix smbios_smp_sockets
    calculation").
    
    In smbios_get_tables() (hw/smbios/smbios.c), smbios type4 table is built
    for each socket, so the count of type4 tables should be equal to the
    number of sockets.
    
    Thus for the topology in this case, there're the following considerations:
    1. The topology should include multiple sockets to ensure smbios could
       create type4 tables for each socket.
    2. In addition to sockets, for the more general topology, we should also
       configure as many topology levels as possible (multiple dies, no
       module since x86 hasn't supported it), to ensure that smbios is able
       to exclude the effect of other topology levels to create the type4
       tables only for sockets.
    3. The original miscalculation bug also misused "smp.cpus", so it's
       necessary to configure "cpus" (presented threads for machine) and
       "maxcpus" (total threads for machine) as well to make sure that
       configuring unpluged CPUs in smp (cpus < maxcpus) does not affect
       the correctness of the count of type4 tables.
    
    Based on these considerations, select the topology as the follow:
    
    -smp cpus=100,maxcpus=120,sockets=5,dies=2,cores=4,threads=3
    
    The expected count of type4 tables = sockets (5).
    
    Suggested-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Message-Id: <20230928125943.1816922-4-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    a0380d4 View commit details
    Browse the repository at this point in the history
  31. tests: bios-tables-test: Add ACPI table binaries for smbios type4 cou…

    …nt test
    
    Following the guidelines in tests/qtest/bios-tables-test.c, this
    is step 5 and 6.
    
    Changes in the tables:
    FACP:
    
    +/*
    + * Intel ACPI Component Architecture
    + * AML/ASL+ Disassembler version 20200925 (64-bit version)
    + * Copyright (c) 2000 - 2020 Intel Corporation
    + *
    + * Disassembly of /tmp/aml-W37791, Wed Aug 23 10:36:32 2023
    + *
    + * ACPI Data Table [FACP]
    + *
    + * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue
    + */
    +
    +[000h 0000   4]                    Signature : "FACP"    [Fixed ACPI Description Table (FADT)]
    +[004h 0004   4]                 Table Length : 000000F4
    +[008h 0008   1]                     Revision : 03
    +[009h 0009   1]                     Checksum : B3
    +[00Ah 0010   6]                       Oem ID : "BOCHS "
    +[010h 0016   8]                 Oem Table ID : "BXPC    "
    +[018h 0024   4]                 Oem Revision : 00000001
    +[01Ch 0028   4]              Asl Compiler ID : "BXPC"
    +[020h 0032   4]        Asl Compiler Revision : 00000001
    +
    +[024h 0036   4]                 FACS Address : 00000000
    +[028h 0040   4]                 DSDT Address : 00000000
    +[02Ch 0044   1]                        Model : 01
    +[02Dh 0045   1]                   PM Profile : 00 [Unspecified]
    +[02Eh 0046   2]                SCI Interrupt : 0009
    +[030h 0048   4]             SMI Command Port : 000000B2
    +[034h 0052   1]            ACPI Enable Value : 02
    +[035h 0053   1]           ACPI Disable Value : 03
    +[036h 0054   1]               S4BIOS Command : 00
    +[037h 0055   1]              P-State Control : 00
    +[038h 0056   4]     PM1A Event Block Address : 00000600
    +[03Ch 0060   4]     PM1B Event Block Address : 00000000
    +[040h 0064   4]   PM1A Control Block Address : 00000604
    +[044h 0068   4]   PM1B Control Block Address : 00000000
    +[048h 0072   4]    PM2 Control Block Address : 00000000
    +[04Ch 0076   4]       PM Timer Block Address : 00000608
    +[050h 0080   4]           GPE0 Block Address : 00000620
    +[054h 0084   4]           GPE1 Block Address : 00000000
    +[058h 0088   1]       PM1 Event Block Length : 04
    +[059h 0089   1]     PM1 Control Block Length : 02
    +[05Ah 0090   1]     PM2 Control Block Length : 00
    +[05Bh 0091   1]        PM Timer Block Length : 04
    +[05Ch 0092   1]            GPE0 Block Length : 10
    +[05Dh 0093   1]            GPE1 Block Length : 00
    +[05Eh 0094   1]             GPE1 Base Offset : 00
    +[05Fh 0095   1]                 _CST Support : 00
    +[060h 0096   2]                   C2 Latency : 0FFF
    +[062h 0098   2]                   C3 Latency : 0FFF
    +[064h 0100   2]               CPU Cache Size : 0000
    +[066h 0102   2]           Cache Flush Stride : 0000
    +[068h 0104   1]            Duty Cycle Offset : 00
    +[069h 0105   1]             Duty Cycle Width : 00
    +[06Ah 0106   1]          RTC Day Alarm Index : 00
    +[06Bh 0107   1]        RTC Month Alarm Index : 00
    +[06Ch 0108   1]            RTC Century Index : 32
    +[06Dh 0109   2]   Boot Flags (decoded below) : 0002
    +               Legacy Devices Supported (V2) : 0
    +            8042 Present on ports 60/64 (V2) : 1
    +                        VGA Not Present (V4) : 0
    +                      MSI Not Supported (V4) : 0
    +                PCIe ASPM Not Supported (V4) : 0
    +                   CMOS RTC Not Present (V5) : 0
    +[06Fh 0111   1]                     Reserved : 00
    +[070h 0112   4]        Flags (decoded below) : 000484A5
    +      WBINVD instruction is operational (V1) : 1
    +              WBINVD flushes all caches (V1) : 0
    +                    All CPUs support C1 (V1) : 1
    +                  C2 works on MP system (V1) : 0
    +            Control Method Power Button (V1) : 0
    +            Control Method Sleep Button (V1) : 1
    +        RTC wake not in fixed reg space (V1) : 0
    +            RTC can wake system from S4 (V1) : 1
    +                        32-bit PM Timer (V1) : 0
    +                      Docking Supported (V1) : 0
    +               Reset Register Supported (V2) : 1
    +                            Sealed Case (V3) : 0
    +                    Headless - No Video (V3) : 0
    +        Use native instr after SLP_TYPx (V3) : 0
    +              PCIEXP_WAK Bits Supported (V4) : 0
    +                     Use Platform Timer (V4) : 1
    +               RTC_STS valid on S4 wake (V4) : 0
    +                Remote Power-on capable (V4) : 0
    +                 Use APIC Cluster Model (V4) : 1
    +     Use APIC Physical Destination Mode (V4) : 0
    +                       Hardware Reduced (V5) : 0
    +                      Low Power S0 Idle (V5) : 0
    +
    +[074h 0116  12]               Reset Register : [Generic Address Structure]
    +[074h 0116   1]                     Space ID : 01 [SystemIO]
    +[075h 0117   1]                    Bit Width : 08
    +[076h 0118   1]                   Bit Offset : 00
    +[077h 0119   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[078h 0120   8]                      Address : 0000000000000CF9
    +
    +[080h 0128   1]         Value to cause reset : 0F
    +[081h 0129   2]    ARM Flags (decoded below) : 0000
    +                              PSCI Compliant : 0
    +                       Must use HVC for PSCI : 0
    +
    +[083h 0131   1]          FADT Minor Revision : 00
    +[084h 0132   8]                 FACS Address : 0000000000000000
    +[08Ch 0140   8]                 DSDT Address : 0000000000000000
    +[094h 0148  12]             PM1A Event Block : [Generic Address Structure]
    +[094h 0148   1]                     Space ID : 01 [SystemIO]
    +[095h 0149   1]                    Bit Width : 20
    +[096h 0150   1]                   Bit Offset : 00
    +[097h 0151   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[098h 0152   8]                      Address : 0000000000000600
    +
    +[0A0h 0160  12]             PM1B Event Block : [Generic Address Structure]
    +[0A0h 0160   1]                     Space ID : 00 [SystemMemory]
    +[0A1h 0161   1]                    Bit Width : 00
    +[0A2h 0162   1]                   Bit Offset : 00
    +[0A3h 0163   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0A4h 0164   8]                      Address : 0000000000000000
    +
    +[0ACh 0172  12]           PM1A Control Block : [Generic Address Structure]
    +[0ACh 0172   1]                     Space ID : 01 [SystemIO]
    +[0ADh 0173   1]                    Bit Width : 10
    +[0AEh 0174   1]                   Bit Offset : 00
    +[0AFh 0175   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0B0h 0176   8]                      Address : 0000000000000604
    +
    +[0B8h 0184  12]           PM1B Control Block : [Generic Address Structure]
    +[0B8h 0184   1]                     Space ID : 00 [SystemMemory]
    +[0B9h 0185   1]                    Bit Width : 00
    +[0BAh 0186   1]                   Bit Offset : 00
    +[0BBh 0187   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0BCh 0188   8]                      Address : 0000000000000000
    +
    +[0C4h 0196  12]            PM2 Control Block : [Generic Address Structure]
    +[0C4h 0196   1]                     Space ID : 00 [SystemMemory]
    +[0C5h 0197   1]                    Bit Width : 00
    +[0C6h 0198   1]                   Bit Offset : 00
    +[0C7h 0199   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0C8h 0200   8]                      Address : 0000000000000000
    +
    +[0D0h 0208  12]               PM Timer Block : [Generic Address Structure]
    +[0D0h 0208   1]                     Space ID : 01 [SystemIO]
    +[0D1h 0209   1]                    Bit Width : 20
    +[0D2h 0210   1]                   Bit Offset : 00
    +[0D3h 0211   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0D4h 0212   8]                      Address : 0000000000000608
    +
    +[0DCh 0220  12]                   GPE0 Block : [Generic Address Structure]
    +[0DCh 0220   1]                     Space ID : 01 [SystemIO]
    +[0DDh 0221   1]                    Bit Width : 80
    +[0DEh 0222   1]                   Bit Offset : 00
    +[0DFh 0223   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0E0h 0224   8]                      Address : 0000000000000620
    +
    +[0E8h 0232  12]                   GPE1 Block : [Generic Address Structure]
    +[0E8h 0232   1]                     Space ID : 00 [SystemMemory]
    +[0E9h 0233   1]                    Bit Width : 00
    +[0EAh 0234   1]                   Bit Offset : 00
    +[0EBh 0235   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0ECh 0236   8]                      Address : 0000000000000000
    +
    ...
    
    APIC:
    
    +/*
    + * Intel ACPI Component Architecture
    + * AML/ASL+ Disassembler version 20200925 (64-bit version)
    + * Copyright (c) 2000 - 2020 Intel Corporation
    + *
    + * Disassembly of /tmp/aml-687791, Wed Aug 23 10:36:32 2023
    + *
    + * ACPI Data Table [APIC]
    + *
    + * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue
    + */
    +
    +[000h 0000   4]                    Signature : "APIC"    [Multiple APIC Description Table (MADT)]
    +[004h 0004   4]                 Table Length : 00000430
    +[008h 0008   1]                     Revision : 03
    +[009h 0009   1]                     Checksum : C5
    +[00Ah 0010   6]                       Oem ID : "BOCHS "
    +[010h 0016   8]                 Oem Table ID : "BXPC    "
    +[018h 0024   4]                 Oem Revision : 00000001
    +[01Ch 0028   4]              Asl Compiler ID : "BXPC"
    +[020h 0032   4]        Asl Compiler Revision : 00000001
    +
    +[024h 0036   4]           Local Apic Address : FEE00000
    +[028h 0040   4]        Flags (decoded below) : 00000001
    +                         PC-AT Compatibility : 1
    +
    +[02Ch 0044   1]                Subtable Type : 00 [Processor Local APIC]
    +[02Dh 0045   1]                       Length : 08
    +[02Eh 0046   1]                 Processor ID : 00
    +[02Fh 0047   1]                Local Apic ID : 00
    +[030h 0048   4]        Flags (decoded below) : 00000001
    +                           Processor Enabled : 1
    +                      Runtime Online Capable : 0
    +
    +[034h 0052   1]                Subtable Type : 00 [Processor Local APIC]
    +[035h 0053   1]                       Length : 08
    +[036h 0054   1]                 Processor ID : 01
    +[037h 0055   1]                Local Apic ID : 01
    +[038h 0056   4]        Flags (decoded below) : 00000001
    +                           Processor Enabled : 1
    +                      Runtime Online Capable : 0
    
    [snip]
    
    +[3E4h 0996   1]                Subtable Type : 00 [Processor Local APIC]
    +[3E5h 0997   1]                       Length : 08
    +[3E6h 0998   1]                 Processor ID : 77
    +[3E7h 0999   1]                Local Apic ID : 9E
    +[3E8h 1000   4]        Flags (decoded below) : 00000000
    +                           Processor Enabled : 0
    +                      Runtime Online Capable : 0
    +
    +[3ECh 1004   1]                Subtable Type : 01 [I/O APIC]
    +[3EDh 1005   1]                       Length : 0C
    +[3EEh 1006   1]                  I/O Apic ID : 00
    +[3EFh 1007   1]                     Reserved : 00
    +[3F0h 1008   4]                      Address : FEC00000
    +[3F4h 1012   4]                    Interrupt : 00000000
    +
    +[3F8h 1016   1]                Subtable Type : 02 [Interrupt Source Override]
    +[3F9h 1017   1]                       Length : 0A
    +[3FAh 1018   1]                          Bus : 00
    +[3FBh 1019   1]                       Source : 00
    +[3FCh 1020   4]                    Interrupt : 00000002
    +[400h 1024   2]        Flags (decoded below) : 0000
    +                                    Polarity : 0
    +                                Trigger Mode : 0
    +
    +[402h 1026   1]                Subtable Type : 02 [Interrupt Source Override]
    +[403h 1027   1]                       Length : 0A
    +[404h 1028   1]                          Bus : 00
    +[405h 1029   1]                       Source : 05
    +[406h 1030   4]                    Interrupt : 00000005
    +[40Ah 1034   2]        Flags (decoded below) : 000D
    +                                    Polarity : 1
    +                                Trigger Mode : 3
    +
    +[40Ch 1036   1]                Subtable Type : 02 [Interrupt Source Override]
    +[40Dh 1037   1]                       Length : 0A
    +[40Eh 1038   1]                          Bus : 00
    +[40Fh 1039   1]                       Source : 09
    +[410h 1040   4]                    Interrupt : 00000009
    +[414h 1044   2]        Flags (decoded below) : 000D
    +                                    Polarity : 1
    +                                Trigger Mode : 3
    +
    +[416h 1046   1]                Subtable Type : 02 [Interrupt Source Override]
    +[417h 1047   1]                       Length : 0A
    +[418h 1048   1]                          Bus : 00
    +[419h 1049   1]                       Source : 0A
    +[41Ah 1050   4]                    Interrupt : 0000000A
    +[41Eh 1054   2]        Flags (decoded below) : 000D
    +                                    Polarity : 1
    +                                Trigger Mode : 3
    +
    +[420h 1056   1]                Subtable Type : 02 [Interrupt Source Override]
    +[421h 1057   1]                       Length : 0A
    +[422h 1058   1]                          Bus : 00
    +[423h 1059   1]                       Source : 0B
    +[424h 1060   4]                    Interrupt : 0000000B
    +[428h 1064   2]        Flags (decoded below) : 000D
    +                                    Polarity : 1
    +                                Trigger Mode : 3
    +
    +[42Ah 1066   1]                Subtable Type : 04 [Local APIC NMI]
    +[42Bh 1067   1]                       Length : 06
    +[42Ch 1068   1]                 Processor ID : FF
    +[42Dh 1069   2]        Flags (decoded below) : 0000
    +                                    Polarity : 0
    +                                Trigger Mode : 0
    +[42Fh 1071   1]         Interrupt Input LINT : 01
    +
    ...
    
    DSDT:
    
    +/*
    + * Intel ACPI Component Architecture
    + * AML/ASL+ Disassembler version 20200925 (64-bit version)
    + * Copyright (c) 2000 - 2020 Intel Corporation
    + *
    + * Disassembling to symbolic ASL+ operators
    + *
    + * Disassembly of /tmp/aml-8G8791, Wed Aug 23 10:36:32 2023
    + *
    + * Original Table Header:
    + *     Signature        "DSDT"
    + *     Length           0x0000489D (18589)
    + *     Revision         0x01 **** 32-bit table (V1), no 64-bit math support
    + *     Checksum         0xDB
    + *     OEM ID           "BOCHS "
    + *     OEM Table ID     "BXPC    "
    + *     OEM Revision     0x00000001 (1)
    + *     Compiler ID      "BXPC"
    + *     Compiler Version 0x00000001 (1)
    + */
    +DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC    ", 0x00000001)
    +{
    +    Scope (\)
    +    {
    +        OperationRegion (DBG, SystemIO, 0x0402, One)
    +        Field (DBG, ByteAcc, NoLock, Preserve)
    +        {
    +            DBGB,   8
    +        }
    +
    +        Method (DBUG, 1, NotSerialized)
    +        {
    +            ToHexString (Arg0, Local0)
    +            ToBuffer (Local0, Local0)
    +            Local1 = (SizeOf (Local0) - One)
    +            Local2 = Zero
    +            While ((Local2 < Local1))
    +            {
    +                DBGB = DerefOf (Local0 [Local2])
    +                Local2++
    +            }
    +
    +            DBGB = 0x0A
    +        }
    +    }
    +
    
    [snip]
    
    +
    +            Processor (C000, 0x00, 0x00000000, 0x00)
    +            {
    +                Method (_STA, 0, Serialized)  // _STA: Status
    +                {
    +                    Return (CSTA (Zero))
    +                }
    +
    +                Name (_MAT, Buffer (0x08)  // _MAT: Multiple APIC Table Entry
    +                {
    +                     0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00   // ........
    +                })
    +                Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
    +                {
    +                    COST (Zero, Arg0, Arg1, Arg2)
    +                }
    +            }
    +
    +            Processor (C001, 0x01, 0x00000000, 0x00)
    +            {
    +                Method (_STA, 0, Serialized)  // _STA: Status
    +                {
    +                    Return (CSTA (One))
    +                }
    +
    +                Name (_MAT, Buffer (0x08)  // _MAT: Multiple APIC Table Entry
    +                {
    +                     0x00, 0x08, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00   // ........
    +                })
    +                Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device, x=0-9
    +                {
    +                    CEJ0 (One)
    +                }
    +
    +                Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
    +                {
    +                    COST (One, Arg0, Arg1, Arg2)
    +                }
    +            }
    
    [snip]
    
    +            Processor (C077, 0x77, 0x00000000, 0x00)
    +            {
    +                Method (_STA, 0, Serialized)  // _STA: Status
    +                {
    +                    Return (CSTA (0x77))
    +                }
    +
    +                Name (_MAT, Buffer (0x08)  // _MAT: Multiple APIC Table Entry
    +                {
    +                     0x00, 0x08, 0x77, 0x9E, 0x01, 0x00, 0x00, 0x00   // ..w.....
    +                })
    +                Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device, x=0-9
    +                {
    +                    CEJ0 (0x77)
    +                }
    +
    +                Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
    +                {
    +                    COST (0x77, Arg0, Arg1, Arg2)
    +                }
    +            }
    +        }
    +    }
    +
    ...
    
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Message-Id: <20230928125943.1816922-5-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    488be11 View commit details
    Browse the repository at this point in the history
  32. tests: bios-tables-test: Prepare the ACPI table change for smbios typ…

    …e4 core count test
    
    Following the guidelines in tests/qtest/bios-tables-test.c, this
    is step 1 - 3.
    
    List the ACPI tables that will be added to test the type 4 core count
    field.
    
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Message-Id: <20230928125943.1816922-6-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    c1ead6f View commit details
    Browse the repository at this point in the history
  33. tests: bios-tables-test: Add test for smbios type4 core count

    This tests the commit 196ea60 ("hw/smbios: Fix core count in
    type4").
    
    In smbios_build_type_4_table() (hw/smbios/smbios.c), if the number of
    cores in the socket is not more than 255, then smbios type4 table
    encodes cores per socket into the core count field.
    
    So for the topology in this case, there're the following considerations:
    1. cores per socket should be not more than 255 to ensure we could cover
       the core count field.
    2. The original bug was that cores per socket was miscalculated, so now
       we should include as many topology levels as possible (mutiple
       sockets & dies, no module since x86 hasn't supported it) to cover
       more general topology scenarios, to ensure that the cores per socket
       encoded in the core count field is correct.
    
    Based on these considerations, select the topology with multiple sockets
    and dies:
    
    -smp 54,sockets=2,dies=3,cores=3,threads=3
    
    The expected core count = cores per socket = cores (3) * dies (3) = 9.
    
    Suggested-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Message-Id: <20230928125943.1816922-7-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    216cee8 View commit details
    Browse the repository at this point in the history
  34. tests: bios-tables-test: Add ACPI table binaries for smbios type4 cor…

    …e count test
    
    Following the guidelines in tests/qtest/bios-tables-test.c, this
    is step 5 and 6.
    
    Changes in the tables:
    FACP:
    
    +/*
    + * Intel ACPI Component Architecture
    + * AML/ASL+ Disassembler version 20200925 (64-bit version)
    + * Copyright (c) 2000 - 2020 Intel Corporation
    + *
    + * Disassembly of /tmp/aml-Y6WW91, Wed Aug 23 15:43:43 2023
    + *
    + * ACPI Data Table [FACP]
    + *
    + * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue
    + */
    +
    +[000h 0000   4]                    Signature : "FACP"    [Fixed ACPI Description Table (FADT)]
    +[004h 0004   4]                 Table Length : 000000F4
    +[008h 0008   1]                     Revision : 03
    +[009h 0009   1]                     Checksum : B3
    +[00Ah 0010   6]                       Oem ID : "BOCHS "
    +[010h 0016   8]                 Oem Table ID : "BXPC    "
    +[018h 0024   4]                 Oem Revision : 00000001
    +[01Ch 0028   4]              Asl Compiler ID : "BXPC"
    +[020h 0032   4]        Asl Compiler Revision : 00000001
    +
    +[024h 0036   4]                 FACS Address : 00000000
    +[028h 0040   4]                 DSDT Address : 00000000
    +[02Ch 0044   1]                        Model : 01
    +[02Dh 0045   1]                   PM Profile : 00 [Unspecified]
    +[02Eh 0046   2]                SCI Interrupt : 0009
    +[030h 0048   4]             SMI Command Port : 000000B2
    +[034h 0052   1]            ACPI Enable Value : 02
    +[035h 0053   1]           ACPI Disable Value : 03
    +[036h 0054   1]               S4BIOS Command : 00
    +[037h 0055   1]              P-State Control : 00
    +[038h 0056   4]     PM1A Event Block Address : 00000600
    +[03Ch 0060   4]     PM1B Event Block Address : 00000000
    +[040h 0064   4]   PM1A Control Block Address : 00000604
    +[044h 0068   4]   PM1B Control Block Address : 00000000
    +[048h 0072   4]    PM2 Control Block Address : 00000000
    +[04Ch 0076   4]       PM Timer Block Address : 00000608
    +[050h 0080   4]           GPE0 Block Address : 00000620
    +[054h 0084   4]           GPE1 Block Address : 00000000
    +[058h 0088   1]       PM1 Event Block Length : 04
    +[059h 0089   1]     PM1 Control Block Length : 02
    +[05Ah 0090   1]     PM2 Control Block Length : 00
    +[05Bh 0091   1]        PM Timer Block Length : 04
    +[05Ch 0092   1]            GPE0 Block Length : 10
    +[05Dh 0093   1]            GPE1 Block Length : 00
    +[05Eh 0094   1]             GPE1 Base Offset : 00
    +[05Fh 0095   1]                 _CST Support : 00
    +[060h 0096   2]                   C2 Latency : 0FFF
    +[062h 0098   2]                   C3 Latency : 0FFF
    +[064h 0100   2]               CPU Cache Size : 0000
    +[066h 0102   2]           Cache Flush Stride : 0000
    +[068h 0104   1]            Duty Cycle Offset : 00
    +[069h 0105   1]             Duty Cycle Width : 00
    +[06Ah 0106   1]          RTC Day Alarm Index : 00
    +[06Bh 0107   1]        RTC Month Alarm Index : 00
    +[06Ch 0108   1]            RTC Century Index : 32
    +[06Dh 0109   2]   Boot Flags (decoded below) : 0002
    +               Legacy Devices Supported (V2) : 0
    +            8042 Present on ports 60/64 (V2) : 1
    +                        VGA Not Present (V4) : 0
    +                      MSI Not Supported (V4) : 0
    +                PCIe ASPM Not Supported (V4) : 0
    +                   CMOS RTC Not Present (V5) : 0
    +[06Fh 0111   1]                     Reserved : 00
    +[070h 0112   4]        Flags (decoded below) : 000484A5
    +      WBINVD instruction is operational (V1) : 1
    +              WBINVD flushes all caches (V1) : 0
    +                    All CPUs support C1 (V1) : 1
    +                  C2 works on MP system (V1) : 0
    +            Control Method Power Button (V1) : 0
    +            Control Method Sleep Button (V1) : 1
    +        RTC wake not in fixed reg space (V1) : 0
    +            RTC can wake system from S4 (V1) : 1
    +                        32-bit PM Timer (V1) : 0
    +                      Docking Supported (V1) : 0
    +               Reset Register Supported (V2) : 1
    +                            Sealed Case (V3) : 0
    +                    Headless - No Video (V3) : 0
    +        Use native instr after SLP_TYPx (V3) : 0
    +              PCIEXP_WAK Bits Supported (V4) : 0
    +                     Use Platform Timer (V4) : 1
    +               RTC_STS valid on S4 wake (V4) : 0
    +                Remote Power-on capable (V4) : 0
    +                 Use APIC Cluster Model (V4) : 1
    +     Use APIC Physical Destination Mode (V4) : 0
    +                       Hardware Reduced (V5) : 0
    +                      Low Power S0 Idle (V5) : 0
    +
    +[074h 0116  12]               Reset Register : [Generic Address Structure]
    +[074h 0116   1]                     Space ID : 01 [SystemIO]
    +[075h 0117   1]                    Bit Width : 08
    +[076h 0118   1]                   Bit Offset : 00
    +[077h 0119   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[078h 0120   8]                      Address : 0000000000000CF9
    +
    +[080h 0128   1]         Value to cause reset : 0F
    +[081h 0129   2]    ARM Flags (decoded below) : 0000
    +                              PSCI Compliant : 0
    +                       Must use HVC for PSCI : 0
    +
    +[083h 0131   1]          FADT Minor Revision : 00
    +[084h 0132   8]                 FACS Address : 0000000000000000
    +[08Ch 0140   8]                 DSDT Address : 0000000000000000
    +[094h 0148  12]             PM1A Event Block : [Generic Address Structure]
    +[094h 0148   1]                     Space ID : 01 [SystemIO]
    +[095h 0149   1]                    Bit Width : 20
    +[096h 0150   1]                   Bit Offset : 00
    +[097h 0151   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[098h 0152   8]                      Address : 0000000000000600
    +
    +[0A0h 0160  12]             PM1B Event Block : [Generic Address Structure]
    +[0A0h 0160   1]                     Space ID : 00 [SystemMemory]
    +[0A1h 0161   1]                    Bit Width : 00
    +[0A2h 0162   1]                   Bit Offset : 00
    +[0A3h 0163   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0A4h 0164   8]                      Address : 0000000000000000
    +
    +[0ACh 0172  12]           PM1A Control Block : [Generic Address Structure]
    +[0ACh 0172   1]                     Space ID : 01 [SystemIO]
    +[0ADh 0173   1]                    Bit Width : 10
    +[0AEh 0174   1]                   Bit Offset : 00
    +[0AFh 0175   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0B0h 0176   8]                      Address : 0000000000000604
    +
    +[0B8h 0184  12]           PM1B Control Block : [Generic Address Structure]
    +[0B8h 0184   1]                     Space ID : 00 [SystemMemory]
    +[0B9h 0185   1]                    Bit Width : 00
    +[0BAh 0186   1]                   Bit Offset : 00
    +[0BBh 0187   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0BCh 0188   8]                      Address : 0000000000000000
    +
    +[0C4h 0196  12]            PM2 Control Block : [Generic Address Structure]
    +[0C4h 0196   1]                     Space ID : 00 [SystemMemory]
    +[0C5h 0197   1]                    Bit Width : 00
    +[0C6h 0198   1]                   Bit Offset : 00
    +[0C7h 0199   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0C8h 0200   8]                      Address : 0000000000000000
    +
    +[0D0h 0208  12]               PM Timer Block : [Generic Address Structure]
    +[0D0h 0208   1]                     Space ID : 01 [SystemIO]
    +[0D1h 0209   1]                    Bit Width : 20
    +[0D2h 0210   1]                   Bit Offset : 00
    +[0D3h 0211   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0D4h 0212   8]                      Address : 0000000000000608
    +
    +[0DCh 0220  12]                   GPE0 Block : [Generic Address Structure]
    +[0DCh 0220   1]                     Space ID : 01 [SystemIO]
    +[0DDh 0221   1]                    Bit Width : 80
    +[0DEh 0222   1]                   Bit Offset : 00
    +[0DFh 0223   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0E0h 0224   8]                      Address : 0000000000000620
    +
    +[0E8h 0232  12]                   GPE1 Block : [Generic Address Structure]
    +[0E8h 0232   1]                     Space ID : 00 [SystemMemory]
    +[0E9h 0233   1]                    Bit Width : 00
    +[0EAh 0234   1]                   Bit Offset : 00
    +[0EBh 0235   1]         Encoded Access Width : 00 [Undefined/Legacy]
    +[0ECh 0236   8]                      Address : 0000000000000000
    
    ...
    
    APIC:
    
    +/*
    + * Intel ACPI Component Architecture
    + * AML/ASL+ Disassembler version 20200925 (64-bit version)
    + * Copyright (c) 2000 - 2020 Intel Corporation
    + *
    + * Disassembly of /tmp/aml-FFXW91, Wed Aug 23 15:43:43 2023
    + *
    + * ACPI Data Table [APIC]
    + *
    + * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue
    + */
    +
    +[000h 0000   4]                    Signature : "APIC"    [Multiple APIC Description Table (MADT)]
    +[004h 0004   4]                 Table Length : 00000220
    +[008h 0008   1]                     Revision : 03
    +[009h 0009   1]                     Checksum : 3C
    +[00Ah 0010   6]                       Oem ID : "BOCHS "
    +[010h 0016   8]                 Oem Table ID : "BXPC    "
    +[018h 0024   4]                 Oem Revision : 00000001
    +[01Ch 0028   4]              Asl Compiler ID : "BXPC"
    +[020h 0032   4]        Asl Compiler Revision : 00000001
    +
    +[024h 0036   4]           Local Apic Address : FEE00000
    +[028h 0040   4]        Flags (decoded below) : 00000001
    +                         PC-AT Compatibility : 1
    +
    +[02Ch 0044   1]                Subtable Type : 00 [Processor Local APIC]
    +[02Dh 0045   1]                       Length : 08
    +[02Eh 0046   1]                 Processor ID : 00
    +[02Fh 0047   1]                Local Apic ID : 00
    +[030h 0048   4]        Flags (decoded below) : 00000001
    +                           Processor Enabled : 1
    +                      Runtime Online Capable : 0
    
    [snip]
    
    +[1D4h 0468   1]                Subtable Type : 00 [Processor Local APIC]
    +[1D5h 0469   1]                       Length : 08
    +[1D6h 0470   1]                 Processor ID : 35
    +[1D7h 0471   1]                Local Apic ID : 6A
    +[1D8h 0472   4]        Flags (decoded below) : 00000001
    +                           Processor Enabled : 1
    +                      Runtime Online Capable : 0
    +
    +[1DCh 0476   1]                Subtable Type : 01 [I/O APIC]
    +[1DDh 0477   1]                       Length : 0C
    +[1DEh 0478   1]                  I/O Apic ID : 00
    +[1DFh 0479   1]                     Reserved : 00
    +[1E0h 0480   4]                      Address : FEC00000
    +[1E4h 0484   4]                    Interrupt : 00000000
    +
    +[1E8h 0488   1]                Subtable Type : 02 [Interrupt Source Override]
    +[1E9h 0489   1]                       Length : 0A
    +[1EAh 0490   1]                          Bus : 00
    +[1EBh 0491   1]                       Source : 00
    +[1ECh 0492   4]                    Interrupt : 00000002
    +[1F0h 0496   2]        Flags (decoded below) : 0000
    +                                    Polarity : 0
    +                                Trigger Mode : 0
    +
    +[1F2h 0498   1]                Subtable Type : 02 [Interrupt Source Override]
    +[1F3h 0499   1]                       Length : 0A
    +[1F4h 0500   1]                          Bus : 00
    +[1F5h 0501   1]                       Source : 05
    +[1F6h 0502   4]                    Interrupt : 00000005
    +[1FAh 0506   2]        Flags (decoded below) : 000D
    +                                    Polarity : 1
    +                                Trigger Mode : 3
    +
    +[1FCh 0508   1]                Subtable Type : 02 [Interrupt Source Override]
    +[1FDh 0509   1]                       Length : 0A
    +[1FEh 0510   1]                          Bus : 00
    +[1FFh 0511   1]                       Source : 09
    +[200h 0512   4]                    Interrupt : 00000009
    +[204h 0516   2]        Flags (decoded below) : 000D
    +                                    Polarity : 1
    +                                Trigger Mode : 3
    +
    +[206h 0518   1]                Subtable Type : 02 [Interrupt Source Override]
    +[207h 0519   1]                       Length : 0A
    +[208h 0520   1]                          Bus : 00
    +[209h 0521   1]                       Source : 0A
    +[20Ah 0522   4]                    Interrupt : 0000000A
    +[20Eh 0526   2]        Flags (decoded below) : 000D
    +                                    Polarity : 1
    +                                Trigger Mode : 3
    +
    +[210h 0528   1]                Subtable Type : 02 [Interrupt Source Override]
    +[211h 0529   1]                       Length : 0A
    +[212h 0530   1]                          Bus : 00
    +[213h 0531   1]                       Source : 0B
    +[214h 0532   4]                    Interrupt : 0000000B
    +[218h 0536   2]        Flags (decoded below) : 000D
    +                                    Polarity : 1
    +                                Trigger Mode : 3
    +
    +[21Ah 0538   1]                Subtable Type : 04 [Local APIC NMI]
    +[21Bh 0539   1]                       Length : 06
    +[21Ch 0540   1]                 Processor ID : FF
    +[21Dh 0541   2]        Flags (decoded below) : 0000
    +                                    Polarity : 0
    +                                Trigger Mode : 0
    +[21Fh 0543   1]         Interrupt Input LINT : 01
    
    ...
    
    DSDT:
    
    +/*
    + * Intel ACPI Component Architecture
    + * AML/ASL+ Disassembler version 20200925 (64-bit version)
    + * Copyright (c) 2000 - 2020 Intel Corporation
    + *
    + * Disassembling to symbolic ASL+ operators
    + *
    + * Disassembly of /tmp/aml-9ZXW91, Wed Aug 23 15:43:43 2023
    + *
    + * Original Table Header:
    + *     Signature        "DSDT"
    + *     Length           0x00003271 (12913)
    + *     Revision         0x01 **** 32-bit table (V1), no 64-bit math support
    + *     Checksum         0xAF
    + *     OEM ID           "BOCHS "
    + *     OEM Table ID     "BXPC    "
    + *     OEM Revision     0x00000001 (1)
    + *     Compiler ID      "BXPC"
    + *     Compiler Version 0x00000001 (1)
    + */
    +DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC    ", 0x00000001)
    +{
    +    Scope (\)
    +    {
    +        OperationRegion (DBG, SystemIO, 0x0402, One)
    +        Field (DBG, ByteAcc, NoLock, Preserve)
    +        {
    +            DBGB,   8
    +        }
    +
    +        Method (DBUG, 1, NotSerialized)
    +        {
    +            ToHexString (Arg0, Local0)
    +            ToBuffer (Local0, Local0)
    +            Local1 = (SizeOf (Local0) - One)
    +            Local2 = Zero
    +            While ((Local2 < Local1))
    +            {
    +                DBGB = DerefOf (Local0 [Local2])
    +                Local2++
    +            }
    +
    +            DBGB = 0x0A
    +        }
    +    }
    
    [snip]
    
    +        Device (\_SB.CPUS)
    +        {
    +            Name (_HID, "ACPI0010" /* Processor Container Device */)  // _HID: Hardware ID
    +            Name (_CID, EisaId ("PNP0A05") /* Generic Container Device */)  // _CID: Compatible ID
    +            Method (CTFY, 2, NotSerialized)
    +            {
    +                If ((Arg0 == Zero))
    +                {
    +                    Notify (C000, Arg1)
    +                }
    +
    +                If ((Arg0 == One))
    +                {
    +                    Notify (C001, Arg1)
    +                }
    
    [snip]
    
    +                If ((Arg0 == 0x35))
    +                {
    +                    Notify (C035, Arg1)
    +                }
    +            }
    
    [snip]
    
    +            Processor (C000, 0x00, 0x00000000, 0x00)
    +            {
    +                Method (_STA, 0, Serialized)  // _STA: Status
    +                {
    +                    Return (CSTA (Zero))
    +                }
    +
    +                Name (_MAT, Buffer (0x08)  // _MAT: Multiple APIC Table Entry
    +                {
    +                     0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00   // ........
    +                })
    +                Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
    +                {
    +                    COST (Zero, Arg0, Arg1, Arg2)
    +                }
    +            }
    +
    +            Processor (C001, 0x01, 0x00000000, 0x00)
    +            {
    +                Method (_STA, 0, Serialized)  // _STA: Status
    +                {
    +                    Return (CSTA (One))
    +                }
    +
    +                Name (_MAT, Buffer (0x08)  // _MAT: Multiple APIC Table Entry
    +                {
    +                     0x00, 0x08, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00   // ........
    +                })
    +                Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device, x=0-9
    +                {
    +                    CEJ0 (One)
    +                }
    +
    +                Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
    +                {
    +                    COST (One, Arg0, Arg1, Arg2)
    +                }
    +            }
    
    [snip]
    
    +            Processor (C035, 0x35, 0x00000000, 0x00)
    +            {
    +                Method (_STA, 0, Serialized)  // _STA: Status
    +                {
    +                    Return (CSTA (0x35))
    +                }
    +
    +                Name (_MAT, Buffer (0x08)  // _MAT: Multiple APIC Table Entry
    +                {
    +                     0x00, 0x08, 0x35, 0x6A, 0x01, 0x00, 0x00, 0x00   // ..5j....
    +                })
    +                Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device, x=0-9
    +                {
    +                    CEJ0 (0x35)
    +                }
    +
    +                Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
    +                {
    +                    COST (0x35, Arg0, Arg1, Arg2)
    +                }
    +            }
    
    ...
    
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Message-Id: <20230928125943.1816922-8-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    0fb2bcb View commit details
    Browse the repository at this point in the history
  35. tests: bios-tables-test: Prepare the ACPI table change for smbios typ…

    …e4 core count2 test
    
    Following the guidelines in tests/qtest/bios-tables-test.c, this
    is step 1 - 3.
    
    List the ACPI tables that will be changed about the type 4 core count2
    test case.
    
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Message-Id: <20230928125943.1816922-9-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    cdfb71f View commit details
    Browse the repository at this point in the history
  36. tests: bios-tables-test: Extend smbios core count2 test to cover gene…

    …ral topology
    
    The commit 196ea60 ("hw/smbios: Fix core count in type4") fixed
    the miscalculation of cores per socket.
    
    The original core count2 test (with the topology configured by
    "-smp 275") didn't recognize that topology-related but because it just
    created a special topology with only one socket and one die by default,
    ignoring the effect of more topology levels (between socket and core) on
    the cores per socket calculation.
    
    So for the topology in this case, there're the following considerations:
    1. cores per socket should be more than 255 to ensure we could cover
       the core count2 field.
    2. The original bug was that cores per socket was miscalculated, so now
       we should include as many topology levels as possible (mutiple
       sockets or dies, no module since x86 hasn't supported it) to cover
       more general topology scenarios, to ensure that the cores per socket
       encoded in the core count2 field is correct.
    
    Based on these considerations, select the topology with multiple dies:
    
    -smp 260,dies=2,cores=130,threads=1
    
    Note, here we doesn't configure multiple sockets to avoid the error
    ("kvm_init_vcpu: kvm_get_vcpu failed (*): Too many open files") if user
    uses the default ulimit seeting on his machine.
    
    And the cores per socket calculation for multiple sockets has already
    been covered by the core count test case, so that only multiple dies
    configuration is enough.
    
    The expected core count2 = cores per socket = cores (130) * dies (2) =
    260.
    
    Suggested-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Acked-by: Igor Mammedov <imammedo@redhat.com>
    Message-Id: <20230928125943.1816922-10-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    9b6eed0 View commit details
    Browse the repository at this point in the history
  37. tests: bios-tables-test: Update ACPI table binaries for smbios core c…

    …ount2 test
    
    Change the core count2 from 275 to 260.
    
    Following the guidelines in tests/qtest/bios-tables-test.c, this
    is step 5 and 6.
    
    Changes in the tables:
    APIC:
    
     /*
      * Intel ACPI Component Architecture
      * AML/ASL+ Disassembler version 20200925 (64-bit version)
      * Copyright (c) 2000 - 2020 Intel Corporation
      *
    - * Disassembly of tests/data/acpi/q35/APIC.core-count2, Wed Aug 23 16:29:51 2023
    + * Disassembly of /tmp/aml-KQDX91, Wed Aug 23 16:29:51 2023
      *
      * ACPI Data Table [APIC]
      *
      * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue
      */
    
     [000h 0000   4]                    Signature : "APIC"    [Multiple APIC Description Table (MADT)]
    -[004h 0004   4]                 Table Length : 000009AE
    +[004h 0004   4]                 Table Length : 00000CA6
     [008h 0008   1]                     Revision : 03
    -[009h 0009   1]                     Checksum : CE
    +[009h 0009   1]                     Checksum : FA
     [00Ah 0010   6]                       Oem ID : "BOCHS "
     [010h 0016   8]                 Oem Table ID : "BXPC    "
     [018h 0024   4]                 Oem Revision : 00000001
     [01Ch 0028   4]              Asl Compiler ID : "BXPC"
     [020h 0032   4]        Asl Compiler Revision : 00000001
    
     [024h 0036   4]           Local Apic Address : FEE00000
     [028h 0040   4]        Flags (decoded below) : 00000001
                              PC-AT Compatibility : 1
    
     [02Ch 0044   1]                Subtable Type : 00 [Processor Local APIC]
     [02Dh 0045   1]                       Length : 08
     [02Eh 0046   1]                 Processor ID : 00
     [02Fh 0047   1]                Local Apic ID : 00
     [030h 0048   4]        Flags (decoded below) : 00000001
                                Processor Enabled : 1
    @@ -1051,1256 +1051,1136 @@
     [42Ch 1068   1]                Subtable Type : 00 [Processor Local APIC]
     [42Dh 1069   1]                       Length : 08
     [42Eh 1070   1]                 Processor ID : 80
     [42Fh 1071   1]                Local Apic ID : 80
     [430h 1072   4]        Flags (decoded below) : 00000001
                                Processor Enabled : 1
                           Runtime Online Capable : 0
    
     [434h 1076   1]                Subtable Type : 00 [Processor Local APIC]
     [435h 1077   1]                       Length : 08
     [436h 1078   1]                 Processor ID : 81
     [437h 1079   1]                Local Apic ID : 81
     [438h 1080   4]        Flags (decoded below) : 00000001
                                Processor Enabled : 1
                           Runtime Online Capable : 0
    
    -[43Ch 1084   1]                Subtable Type : 00 [Processor Local APIC]
    -[43Dh 1085   1]                       Length : 08
    -[43Eh 1086   1]                 Processor ID : 82
    -[43Fh 1087   1]                Local Apic ID : 82
    -[440h 1088   4]        Flags (decoded below) : 00000001
    -                           Processor Enabled : 1
    -                      Runtime Online Capable : 0
    -
    -[444h 1092   1]                Subtable Type : 00 [Processor Local APIC]
    -[445h 1093   1]                       Length : 08
    -[446h 1094   1]                 Processor ID : 83
    -[447h 1095   1]                Local Apic ID : 83
    -[448h 1096   4]        Flags (decoded below) : 00000001
    -                           Processor Enabled : 1
    -                      Runtime Online Capable : 0
    
    [snip]
    
    -
    -[964h 2404   1]                Subtable Type : 01 [I/O APIC]
    -[965h 2405   1]                       Length : 0C
    -[966h 2406   1]                  I/O Apic ID : 00
    -[967h 2407   1]                     Reserved : 00
    -[968h 2408   4]                      Address : FEC00000
    -[96Ch 2412   4]                    Interrupt : 00000000
    -
    -[970h 2416   1]                Subtable Type : 02 [Interrupt Source Override]
    -[971h 2417   1]                       Length : 0A
    -[972h 2418   1]                          Bus : 00
    -[973h 2419   1]                       Source : 00
    -[974h 2420   4]                    Interrupt : 00000002
    -[978h 2424   2]        Flags (decoded below) : 0000
    +[43Ch 1084   1]                Subtable Type : 09 [Processor Local x2APIC]
    +[43Dh 1085   1]                       Length : 10
    +[43Eh 1086   2]                     Reserved : 0000
    +[440h 1088   4]          Processor x2Apic ID : 00000100
    +[444h 1092   4]        Flags (decoded below) : 00000001
    +                           Processor Enabled : 1
    +[448h 1096   4]                Processor UID : 00000082
    +
    +[44Ch 1100   1]                Subtable Type : 09 [Processor Local x2APIC]
    +[44Dh 1101   1]                       Length : 10
    +[44Eh 1102   2]                     Reserved : 0000
    +[450h 1104   4]          Processor x2Apic ID : 00000101
    +[454h 1108   4]        Flags (decoded below) : 00000001
    +                           Processor Enabled : 1
    +[458h 1112   4]                Processor UID : 00000083
    +
    
    [snip]
    
    +
    +[C68h 3176   1]                Subtable Type : 02 [Interrupt Source Override]
    +[C69h 3177   1]                       Length : 0A
    +[C6Ah 3178   1]                          Bus : 00
    +[C6Bh 3179   1]                       Source : 00
    +[C6Ch 3180   4]                    Interrupt : 00000002
    +[C70h 3184   2]        Flags (decoded below) : 0000
                                         Polarity : 0
                                     Trigger Mode : 0
    
    -[97Ah 2426   1]                Subtable Type : 02 [Interrupt Source Override]
    -[97Bh 2427   1]                       Length : 0A
    -[97Ch 2428   1]                          Bus : 00
    -[97Dh 2429   1]                       Source : 05
    -[97Eh 2430   4]                    Interrupt : 00000005
    -[982h 2434   2]        Flags (decoded below) : 000D
    +[C72h 3186   1]                Subtable Type : 02 [Interrupt Source Override]
    +[C73h 3187   1]                       Length : 0A
    +[C74h 3188   1]                          Bus : 00
    +[C75h 3189   1]                       Source : 05
    +[C76h 3190   4]                    Interrupt : 00000005
    +[C7Ah 3194   2]        Flags (decoded below) : 000D
                                         Polarity : 1
                                     Trigger Mode : 3
    
    -[984h 2436   1]                Subtable Type : 02 [Interrupt Source Override]
    -[985h 2437   1]                       Length : 0A
    -[986h 2438   1]                          Bus : 00
    -[987h 2439   1]                       Source : 09
    -[988h 2440   4]                    Interrupt : 00000009
    -[98Ch 2444   2]        Flags (decoded below) : 000D
    +[C7Ch 3196   1]                Subtable Type : 02 [Interrupt Source Override]
    +[C7Dh 3197   1]                       Length : 0A
    +[C7Eh 3198   1]                          Bus : 00
    +[C7Fh 3199   1]                       Source : 09
    +[C80h 3200   4]                    Interrupt : 00000009
    +[C84h 3204   2]        Flags (decoded below) : 000D
                                         Polarity : 1
                                     Trigger Mode : 3
    
    -[98Eh 2446   1]                Subtable Type : 02 [Interrupt Source Override]
    -[98Fh 2447   1]                       Length : 0A
    -[990h 2448   1]                          Bus : 00
    -[991h 2449   1]                       Source : 0A
    -[992h 2450   4]                    Interrupt : 0000000A
    -[996h 2454   2]        Flags (decoded below) : 000D
    +[C86h 3206   1]                Subtable Type : 02 [Interrupt Source Override]
    +[C87h 3207   1]                       Length : 0A
    +[C88h 3208   1]                          Bus : 00
    +[C89h 3209   1]                       Source : 0A
    +[C8Ah 3210   4]                    Interrupt : 0000000A
    +[C8Eh 3214   2]        Flags (decoded below) : 000D
                                         Polarity : 1
                                     Trigger Mode : 3
    
    -[998h 2456   1]                Subtable Type : 02 [Interrupt Source Override]
    -[999h 2457   1]                       Length : 0A
    -[99Ah 2458   1]                          Bus : 00
    -[99Bh 2459   1]                       Source : 0B
    -[99Ch 2460   4]                    Interrupt : 0000000B
    -[9A0h 2464   2]        Flags (decoded below) : 000D
    +[C90h 3216   1]                Subtable Type : 02 [Interrupt Source Override]
    +[C91h 3217   1]                       Length : 0A
    +[C92h 3218   1]                          Bus : 00
    +[C93h 3219   1]                       Source : 0B
    +[C94h 3220   4]                    Interrupt : 0000000B
    +[C98h 3224   2]        Flags (decoded below) : 000D
                                         Polarity : 1
                                     Trigger Mode : 3
    
    -[9A2h 2466   1]                Subtable Type : 0A [Local x2APIC NMI]
    -[9A3h 2467   1]                       Length : 0C
    -[9A4h 2468   2]        Flags (decoded below) : 0000
    +[C9Ah 3226   1]                Subtable Type : 0A [Local x2APIC NMI]
    +[C9Bh 3227   1]                       Length : 0C
    +[C9Ch 3228   2]        Flags (decoded below) : 0000
                                         Polarity : 0
                                     Trigger Mode : 0
    -[9A6h 2470   4]                Processor UID : FFFFFFFF
    -[9AAh 2474   1]         Interrupt Input LINT : 01
    -[9ABh 2475   3]                     Reserved : 000000
    +[C9Eh 3230   4]                Processor UID : FFFFFFFF
    +[CA2h 3234   1]         Interrupt Input LINT : 01
    +[CA3h 3235   3]                     Reserved : 000000
    
    ...
    
    DSDT:
    
     /*
      * Intel ACPI Component Architecture
      * AML/ASL+ Disassembler version 20200925 (64-bit version)
      * Copyright (c) 2000 - 2020 Intel Corporation
      *
      * Disassembling to symbolic ASL+ operators
      *
    - * Disassembly of tests/data/acpi/q35/DSDT.core-count2, Wed Aug 23 16:29:51 2023
    + * Disassembly of /tmp/aml-6DDX91, Wed Aug 23 16:29:51 2023
      *
      * Original Table Header:
      *     Signature        "DSDT"
    - *     Length           0x00007EEF (32495)
    + *     Length           0x000083EA (33770)
      *     Revision         0x01 **** 32-bit table (V1), no 64-bit math support
    - *     Checksum         0x52
    + *     Checksum         0x01
      *     OEM ID           "BOCHS "
      *     OEM Table ID     "BXPC    "
      *     OEM Revision     0x00000001 (1)
      *     Compiler ID      "BXPC"
      *     Compiler Version 0x00000001 (1)
      */
     DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC    ", 0x00000001)
     {
         Scope (\)
         {
             OperationRegion (DBG, SystemIO, 0x0402, One)
             Field (DBG, ByteAcc, NoLock, Preserve)
             {
                 DBGB,   8
             }
    
    @@ -4196,107 +4196,32 @@
                     }
    
                     If ((Arg0 == 0x0101))
                     {
                         Notify (C101, Arg1)
                     }
    
                     If ((Arg0 == 0x0102))
                     {
                         Notify (C102, Arg1)
                     }
    
                     If ((Arg0 == 0x0103))
                     {
                         Notify (C103, Arg1)
                     }
    -
    -                If ((Arg0 == 0x0104))
    -                {
    -                    Notify (C104, Arg1)
    -                }
    -
    -                If ((Arg0 == 0x0105))
    -                {
    -                    Notify (C105, Arg1)
    -                }
    -
    -                If ((Arg0 == 0x0106))
    -                {
    -                    Notify (C106, Arg1)
    -                }
    -
    
    [snip]
    
    -                If ((Arg0 == 0x0112))
    -                {
    -                    Notify (C112, Arg1)
    -                }
                 }
    
                 Method (CSTA, 1, Serialized)
                 {
                     Acquire (\_SB.PCI0.PRES.CPLK, 0xFFFF)
                     \_SB.PCI0.PRES.CSEL = Arg0
                     Local0 = Zero
                     If ((\_SB.PCI0.PRES.CPEN == One))
                     {
                         Local0 = 0x0F
                     }
    
                     Release (\_SB.PCI0.PRES.CPLK)
                     Return (Local0)
                 }
    
    @@ -4306,33 +4231,33 @@
                     \_SB.PCI0.PRES.CSEL = Arg0
                     \_SB.PCI0.PRES.CEJ0 = One
                     Release (\_SB.PCI0.PRES.CPLK)
                 }
    
                 Method (CSCN, 0, Serialized)
                 {
                     Acquire (\_SB.PCI0.PRES.CPLK, 0xFFFF)
                     Name (CNEW, Package (0xFF) {})
                     Local3 = Zero
                     Local4 = One
                     While ((Local4 == One))
                     {
                         Local4 = Zero
                         Local0 = One
                         Local1 = Zero
    -                    While (((Local0 == One) && (Local3 < 0x0113)))
    +                    While (((Local0 == One) && (Local3 < 0x0104)))
                         {
                             Local0 = Zero
                             \_SB.PCI0.PRES.CSEL = Local3
                             \_SB.PCI0.PRES.CCMD = Zero
                             If ((\_SB.PCI0.PRES.CDAT < Local3))
                             {
                                 Break
                             }
    
                             If ((Local1 == 0xFF))
                             {
                                 Local4 = One
                                 Break
                             }
    
                             Local3 = \_SB.PCI0.PRES.CDAT
    @@ -7220,3281 +7145,3281 @@
    
                     Name (_MAT, Buffer (0x08)  // _MAT: Multiple APIC Table Entry
                     {
                          0x00, 0x08, 0x81, 0x81, 0x01, 0x00, 0x00, 0x00   // ........
                     })
                     Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device, x=0-9
                     {
                         CEJ0 (0x81)
                     }
    
                     Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
                     {
                         COST (0x81, Arg0, Arg1, Arg2)
                     }
                 }
    
    -            Processor (C082, 0x82, 0x00000000, 0x00)
    +            Device (C082)
                 {
    +                Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
    +                Name (_UID, 0x82)  // _UID: Unique ID
                     Method (_STA, 0, Serialized)  // _STA: Status
                     {
                         Return (CSTA (0x82))
                     }
    
    -                Name (_MAT, Buffer (0x08)  // _MAT: Multiple APIC Table Entry
    +                Name (_MAT, Buffer (0x10)  // _MAT: Multiple APIC Table Entry
                     {
    -                     0x00, 0x08, 0x82, 0x82, 0x01, 0x00, 0x00, 0x00   // ........
    +                    /* 0000 */  0x09, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,  // ........
    +                    /* 0008 */  0x01, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00   // ........
                     })
                     Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device, x=0-9
                     {
                         CEJ0 (0x82)
                     }
    
                     Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
                     {
                         COST (0x82, Arg0, Arg1, Arg2)
                     }
                 }
    
    -            Processor (C083, 0x83, 0x00000000, 0x00)
    +            Device (C083)
                 {
    +                Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
    +                Name (_UID, 0x83)  // _UID: Unique ID
                     Method (_STA, 0, Serialized)  // _STA: Status
                     {
                         Return (CSTA (0x83))
                     }
    
    -                Name (_MAT, Buffer (0x08)  // _MAT: Multiple APIC Table Entry
    +                Name (_MAT, Buffer (0x10)  // _MAT: Multiple APIC Table Entry
                     {
    -                     0x00, 0x08, 0x83, 0x83, 0x01, 0x00, 0x00, 0x00   // ........
    +                    /* 0000 */  0x09, 0x10, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,  // ........
    +                    /* 0008 */  0x01, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00   // ........
                     })
                     Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device, x=0-9
                     {
                         CEJ0 (0x83)
                     }
    
                     Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
                     {
                         COST (0x83, Arg0, Arg1, Arg2)
                     }
                 }
    
    -            Processor (C084, 0x84, 0x00000000, 0x00)
    +            Device (C084)
                 {
    +                Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
    +                Name (_UID, 0x84)  // _UID: Unique ID
                     Method (_STA, 0, Serialized)  // _STA: Status
                     {
                         Return (CSTA (0x84))
                     }
    
    -                Name (_MAT, Buffer (0x08)  // _MAT: Multiple APIC Table Entry
    +                Name (_MAT, Buffer (0x10)  // _MAT: Multiple APIC Table Entry
                     {
    -                     0x00, 0x08, 0x84, 0x84, 0x01, 0x00, 0x00, 0x00   // ........
    +                    /* 0000 */  0x09, 0x10, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,  // ........
    +                    /* 0008 */  0x01, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00   // ........
                     })
                     Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device, x=0-9
                     {
                         CEJ0 (0x84)
                     }
    
                     Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
                     {
                         COST (0x84, Arg0, Arg1, Arg2)
                     }
                 }
    
    [snip]
    
    -            Processor (C0FE, 0xFE, 0x00000000, 0x00)
    +            Device (C0FE)
                 {
    +                Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
    +                Name (_UID, 0xFE)  // _UID: Unique ID
                     Method (_STA, 0, Serialized)  // _STA: Status
                     {
                         Return (CSTA (0xFE))
                     }
    
    -                Name (_MAT, Buffer (0x08)  // _MAT: Multiple APIC Table Entry
    +                Name (_MAT, Buffer (0x10)  // _MAT: Multiple APIC Table Entry
                     {
    -                     0x00, 0x08, 0xFE, 0xFE, 0x01, 0x00, 0x00, 0x00   // ........
    +                    /* 0000 */  0x09, 0x10, 0x00, 0x00, 0x7C, 0x01, 0x00, 0x00,  // ....|...
    +                    /* 0008 */  0x01, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00   // ........
                     })
                     Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device, x=0-9
                     {
                         CEJ0 (0xFE)
                     }
    
                     Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
                     {
                         COST (0xFE, Arg0, Arg1, Arg2)
                     }
                 }
    
    ...
    
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Message-Id: <20230928125943.1816922-11-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    a2608f4 View commit details
    Browse the repository at this point in the history
  38. tests: bios-tables-test: Prepare the ACPI table change for smbios typ…

    …e4 thread count test
    
    Following the guidelines in tests/qtest/bios-tables-test.c, this
    is step 1 - 3.
    
    List the ACPI tables that will be added to test the thread count field
    of smbios type4 table.
    
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Message-Id: <20230928125943.1816922-12-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    ec535cb View commit details
    Browse the repository at this point in the history
  39. tests: bios-tables-test: Add test for smbios type4 thread count

    This tests the commit 7298fd7 ("hw/smbios: Fix thread count in
    type4").
    
    In smbios_build_type_4_table() (hw/smbios/smbios.c), if the number of
    threads in the socket is not more than 255, then smbios type4 table
    encodes threads per socket into the thread count field.
    
    So for the topology in this case, there're the following considerations:
    1. threads per socket should be not more than 255 to ensure we could
       cover the thread count field.
    2. The original bug was that threads per socket was miscalculated, so
       now we should configure as many topology levels as possible (mutiple
       sockets & dies, no module since x86 hasn't supported it) to cover
       more general topology scenarios, to ensure that the threads per
       socket encoded in the thread count field is correct.
    3. For the more general topology, we should also add "cpus" (presented
       threads for machine) and "maxcpus" (total threads for machine) to
       make sure that configuring unpluged CPUs in smp (cpus < maxcpus)
       does not affect the correctness of threads per socket for thread
       count field.
    
    Based on these considerations, select the topology as the follow:
    
    -smp cpus=15,maxcpus=54,sockets=2,dies=3,cores=3,threads=3
    
    The expected thread count = threads per socket = threads (3) * cores (3)
    * dies (3) = 27.
    
    Suggested-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
    Acked-by: Igor Mammedov <imammedo@redhat.com>
    Message-Id: <20230928125943.1816922-13-zhao1.liu@linux.intel.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    trueptolemy authored and mstsirkin committed Oct 19, 2023
    Copy the full SHA
    353a6a8 View commit details
    Browse the repository at this point in the history