Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-2…
Browse files Browse the repository at this point in the history
…0220221-1' into staging

arm, cocoa and misc:
 * MAINTAINERS file updates
 * Mark remaining global TypeInfo instances as const
 * checkpatch: Ensure that TypeInfos are const
 * arm hvf: Handle unknown ID registers as RES0
 * Make KVM -cpu max exactly like -cpu host
 * Fix '-cpu max' for HVF
 * Support PAuth extension for hvf
 * Kconfig: Add I2C_DEVICES device group
 * Kconfig: Add 'imply I2C_DEVICES' on boards with available i2c bus
 * hw/arm/armv7m: Handle disconnected clock inputs
 * osdep.h: pull out various things into new header files
 * hw/timer: fix a9gtimer vmstate
 * hw/arm: add initial mori-bmc board
 * ui/cocoa: Remove allowedFileTypes restriction in SavePanel
 * ui/cocoa: Do not alert even without block devices
 * ui/cocoa: Fix the leak of qemu_console_get_label

# gpg: Signature made Mon 21 Feb 2022 13:30:45 GMT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* remotes/pmaydell/tags/pull-target-arm-20220221-1: (25 commits)
  ui/cocoa: Fix the leak of qemu_console_get_label
  ui/cocoa: Do not alert even without block devices
  ui/cocoa: Remove allowedFileTypes restriction in SavePanel
  hw/arm: add initial mori-bmc board
  hw/timer: fix a9gtimer vmstate
  MAINTAINERS: Add Akihiko Odaki to macOS-relateds
  include: Move hardware version declarations to new qemu/hw-version.h
  include: Move qemu_[id]cache_* declarations to new qemu/cacheinfo.h
  include: Move QEMU_MAP_* constants to mmap-alloc.h
  include: Move qemu_mprotect_*() to new qemu/mprotect.h
  include: Move qemu_madvise() and related #defines to new qemu/madvise.h
  hw/arm/armv7m: Handle disconnected clock inputs
  Kconfig: Add 'imply I2C_DEVICES' on boards with available i2c bus
  Kconfig: Add I2C_DEVICES device group
  target/arm: Support PAuth extension for hvf
  target/arm: Fix '-cpu max' for HVF
  target/arm: Unindent unnecessary else-clause
  target/arm: Make KVM -cpu max exactly like -cpu host
  target/arm: Use aarch64_cpu_register() for 'host' CPU type
  target/arm: Move '-cpu host' code to cpu64.c
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Feb 21, 2022
2 parents e670f6d + ca51160 commit 477c3b9
Show file tree
Hide file tree
Showing 84 changed files with 623 additions and 410 deletions.
5 changes: 5 additions & 0 deletions MAINTAINERS
Expand Up @@ -2189,6 +2189,7 @@ F: tests/qtest/prom-env-test.c

VM Generation ID
S: Orphan
R: Ani Sinha <ani@anisinha.ca>
F: hw/acpi/vmgenid.c
F: include/hw/acpi/vmgenid.h
F: docs/specs/vmgenid.txt
Expand All @@ -2204,13 +2205,15 @@ F: hw/misc/led.c
Unimplemented device
M: Peter Maydell <peter.maydell@linaro.org>
R: Philippe Mathieu-Daudé <f4bug@amsat.org>
R: Ani Sinha <ani@anisinha.ca>
S: Maintained
F: include/hw/misc/unimp.h
F: hw/misc/unimp.c

Empty slot
M: Artyom Tarasenko <atar4qemu@gmail.com>
R: Philippe Mathieu-Daudé <f4bug@amsat.org>
R: Ani Sinha <ani@anisinha.ca>
S: Maintained
F: include/hw/misc/empty_slot.h
F: hw/misc/empty_slot.c
Expand Down Expand Up @@ -2413,6 +2416,7 @@ F: audio/alsaaudio.c
Core Audio framework backend
M: Gerd Hoffmann <kraxel@redhat.com>
R: Christian Schoenebeck <qemu_oss@crudebyte.com>
R: Akihiko Odaki <akihiko.odaki@gmail.com>
S: Odd Fixes
F: audio/coreaudio.c

Expand Down Expand Up @@ -2665,6 +2669,7 @@ F: util/drm.c

Cocoa graphics
M: Peter Maydell <peter.maydell@linaro.org>
R: Akihiko Odaki <akihiko.odaki@gmail.com>
S: Odd Fixes
F: ui/cocoa.m

Expand Down
1 change: 1 addition & 0 deletions accel/tcg/translate-all.c
Expand Up @@ -51,6 +51,7 @@
#include "qemu/qemu-print.h"
#include "qemu/timer.h"
#include "qemu/main-loop.h"
#include "qemu/cacheinfo.h"
#include "exec/log.h"
#include "sysemu/cpus.h"
#include "sysemu/cpu-timers.h"
Expand Down
1 change: 1 addition & 0 deletions backends/hostmem-file.c
Expand Up @@ -14,6 +14,7 @@
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "qemu/madvise.h"
#include "sysemu/hostmem.h"
#include "qom/object_interfaces.h"
#include "qom/object.h"
Expand Down
1 change: 1 addition & 0 deletions backends/hostmem.c
Expand Up @@ -19,6 +19,7 @@
#include "qemu/config-file.h"
#include "qom/object_interfaces.h"
#include "qemu/mmap-alloc.h"
#include "qemu/madvise.h"

#ifdef CONFIG_NUMA
#include <numaif.h>
Expand Down
8 changes: 6 additions & 2 deletions docs/devel/kconfig.rst
Expand Up @@ -192,11 +192,15 @@ declares its dependencies in different ways:
no directive and are not used in the Makefile either; they only appear
as conditions for ``default y`` directives.

QEMU currently has two device groups, ``PCI_DEVICES`` and
``TEST_DEVICES``. PCI devices usually have a ``default y if
QEMU currently has three device groups, ``PCI_DEVICES``, ``I2C_DEVICES``,
and ``TEST_DEVICES``. PCI devices usually have a ``default y if
PCI_DEVICES`` directive rather than just ``default y``. This lets
some boards (notably s390) easily support a subset of PCI devices,
for example only VFIO (passthrough) and virtio-pci devices.
``I2C_DEVICES`` is similar to ``PCI_DEVICES``. It contains i2c devices
that users might reasonably want to plug in to an i2c bus on any
board (and not ones which are very board-specific or that need
to be wired up in a way that can't be done on the command line).
``TEST_DEVICES`` instead is used for devices that are rarely used on
production virtual machines, but provide useful hooks to test QEMU
or KVM.
Expand Down
1 change: 1 addition & 0 deletions docs/system/arm/nuvoton.rst
Expand Up @@ -21,6 +21,7 @@ Hyperscale applications. The following machines are based on this chip :
- ``quanta-gbs-bmc`` Quanta GBS server BMC
- ``quanta-gsj`` Quanta GSJ server BMC
- ``kudo-bmc`` Fii USA Kudo server BMC
- ``mori-bmc`` Fii USA Mori server BMC

There are also two more SoCs, NPCM710 and NPCM705, which are single-core
variants of NPCM750 and NPCM730, respectively. These are currently not
Expand Down
10 changes: 10 additions & 0 deletions hw/arm/Kconfig
Expand Up @@ -46,6 +46,7 @@ config DIGIC

config EXYNOS4
bool
imply I2C_DEVICES
select A9MPCORE
select I2C
select LAN9118
Expand Down Expand Up @@ -184,6 +185,7 @@ config REALVIEW
bool
imply PCI_DEVICES
imply PCI_TESTDEV
imply I2C_DEVICES
select SMC91C111
select LAN9118
select A9MPCORE
Expand Down Expand Up @@ -229,6 +231,7 @@ config SABRELITE

config STELLARIS
bool
imply I2C_DEVICES
select ARM_V7M
select CMSDK_APB_WATCHDOG
select I2C
Expand Down Expand Up @@ -406,6 +409,7 @@ config NPCM7XX

config FSL_IMX25
bool
imply I2C_DEVICES
select IMX
select IMX_FEC
select IMX_I2C
Expand All @@ -414,6 +418,7 @@ config FSL_IMX25

config FSL_IMX31
bool
imply I2C_DEVICES
select SERIAL
select IMX
select IMX_I2C
Expand All @@ -422,6 +427,7 @@ config FSL_IMX31

config FSL_IMX6
bool
imply I2C_DEVICES
select A9MPCORE
select IMX
select IMX_FEC
Expand Down Expand Up @@ -450,6 +456,7 @@ config ASPEED_SOC

config MPS2
bool
imply I2C_DEVICES
select ARMSSE
select LAN9118
select MPS2_FPGAIO
Expand All @@ -466,6 +473,7 @@ config FSL_IMX7
bool
imply PCI_DEVICES
imply TEST_DEVICES
imply I2C_DEVICES
select A15MPCORE
select PCI
select IMX
Expand All @@ -481,6 +489,7 @@ config ARM_SMMUV3

config FSL_IMX6UL
bool
imply I2C_DEVICES
select A15MPCORE
select IMX
select IMX_FEC
Expand All @@ -495,6 +504,7 @@ config MICROBIT

config NRF51_SOC
bool
imply I2C_DEVICES
select I2C
select ARM_V7M
select UNIMP
Expand Down
26 changes: 22 additions & 4 deletions hw/arm/armv7m.c
Expand Up @@ -284,6 +284,12 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
return;
}

/* cpuclk must be connected; refclk is optional */
if (!clock_has_source(s->cpuclk)) {
error_setg(errp, "armv7m: cpuclk must be connected");
return;
}

memory_region_add_subregion_overlap(&s->container, 0, s->board_memory, -1);

s->cpu = ARM_CPU(object_new_with_props(s->cpu_type, OBJECT(s), "cpu",
Expand Down Expand Up @@ -420,8 +426,18 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
&s->sysreg_ns_mem);
}

/* Create and map the systick devices */
qdev_connect_clock_in(DEVICE(&s->systick[M_REG_NS]), "refclk", s->refclk);
/*
* Create and map the systick devices. Note that we only connect
* refclk if it has been connected to us; otherwise the systick
* device gets the wrong answer for clock_has_source(refclk), because
* it has an immediate source (the ARMv7M's clock object) but not
* an ultimate source, and then it won't correctly auto-select the
* CPU clock as its only possible clock source.
*/
if (clock_has_source(s->refclk)) {
qdev_connect_clock_in(DEVICE(&s->systick[M_REG_NS]), "refclk",
s->refclk);
}
qdev_connect_clock_in(DEVICE(&s->systick[M_REG_NS]), "cpuclk", s->cpuclk);
if (!sysbus_realize(SYS_BUS_DEVICE(&s->systick[M_REG_NS]), errp)) {
return;
Expand All @@ -438,8 +454,10 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
*/
object_initialize_child(OBJECT(dev), "systick-reg-s",
&s->systick[M_REG_S], TYPE_SYSTICK);
qdev_connect_clock_in(DEVICE(&s->systick[M_REG_S]), "refclk",
s->refclk);
if (clock_has_source(s->refclk)) {
qdev_connect_clock_in(DEVICE(&s->systick[M_REG_S]), "refclk",
s->refclk);
}
qdev_connect_clock_in(DEVICE(&s->systick[M_REG_S]), "cpuclk",
s->cpuclk);

Expand Down
32 changes: 32 additions & 0 deletions hw/arm/npcm7xx_boards.c
Expand Up @@ -34,6 +34,7 @@
#define QUANTA_GSJ_POWER_ON_STRAPS 0x00001fff
#define QUANTA_GBS_POWER_ON_STRAPS 0x000017ff
#define KUDO_BMC_POWER_ON_STRAPS 0x00001fff
#define MORI_BMC_POWER_ON_STRAPS 0x00001fff

static const char npcm7xx_default_bootrom[] = "npcm7xx_bootrom.bin";

Expand Down Expand Up @@ -429,6 +430,21 @@ static void kudo_bmc_init(MachineState *machine)
npcm7xx_load_kernel(machine, soc);
}

static void mori_bmc_init(MachineState *machine)
{
NPCM7xxState *soc;

soc = npcm7xx_create_soc(machine, MORI_BMC_POWER_ON_STRAPS);
npcm7xx_connect_dram(soc, machine->ram);
qdev_realize(DEVICE(soc), NULL, &error_fatal);

npcm7xx_load_bootrom(machine, soc);
npcm7xx_connect_flash(&soc->fiu[1], 0, "mx66u51235f",
drive_get(IF_MTD, 3, 0));

npcm7xx_load_kernel(machine, soc);
}

static void npcm7xx_set_soc_type(NPCM7xxMachineClass *nmc, const char *type)
{
NPCM7xxClass *sc = NPCM7XX_CLASS(object_class_by_name(type));
Expand Down Expand Up @@ -501,6 +517,18 @@ static void kudo_bmc_machine_class_init(ObjectClass *oc, void *data)
mc->default_ram_size = 1 * GiB;
};

static void mori_bmc_machine_class_init(ObjectClass *oc, void *data)
{
NPCM7xxMachineClass *nmc = NPCM7XX_MACHINE_CLASS(oc);
MachineClass *mc = MACHINE_CLASS(oc);

npcm7xx_set_soc_type(nmc, TYPE_NPCM730);

mc->desc = "Mori BMC (Cortex-A9)";
mc->init = mori_bmc_init;
mc->default_ram_size = 1 * GiB;
}

static const TypeInfo npcm7xx_machine_types[] = {
{
.name = TYPE_NPCM7XX_MACHINE,
Expand All @@ -525,6 +553,10 @@ static const TypeInfo npcm7xx_machine_types[] = {
.name = MACHINE_TYPE_NAME("kudo-bmc"),
.parent = TYPE_NPCM7XX_MACHINE,
.class_init = kudo_bmc_machine_class_init,
}, {
.name = MACHINE_TYPE_NAME("mori-bmc"),
.parent = TYPE_NPCM7XX_MACHINE,
.class_init = mori_bmc_machine_class_init,
},
};

Expand Down
1 change: 1 addition & 0 deletions hw/arm/nseries.c
Expand Up @@ -24,6 +24,7 @@
#include "chardev/char.h"
#include "qemu/cutils.h"
#include "qemu/bswap.h"
#include "qemu/hw-version.h"
#include "sysemu/reset.h"
#include "sysemu/runstate.h"
#include "sysemu/sysemu.h"
Expand Down
2 changes: 1 addition & 1 deletion hw/core/generic-loader.c
Expand Up @@ -207,7 +207,7 @@ static void generic_loader_class_init(ObjectClass *klass, void *data)
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
}

static TypeInfo generic_loader_info = {
static const TypeInfo generic_loader_info = {
.name = TYPE_GENERIC_LOADER,
.parent = TYPE_DEVICE,
.instance_size = sizeof(GenericLoaderState),
Expand Down
2 changes: 1 addition & 1 deletion hw/core/guest-loader.c
Expand Up @@ -129,7 +129,7 @@ static void guest_loader_class_init(ObjectClass *klass, void *data)
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
}

static TypeInfo guest_loader_info = {
static const TypeInfo guest_loader_info = {
.name = TYPE_GUEST_LOADER,
.parent = TYPE_DEVICE,
.instance_size = sizeof(GuestLoaderState),
Expand Down
2 changes: 1 addition & 1 deletion hw/display/bcm2835_fb.c
Expand Up @@ -454,7 +454,7 @@ static void bcm2835_fb_class_init(ObjectClass *klass, void *data)
dc->vmsd = &vmstate_bcm2835_fb;
}

static TypeInfo bcm2835_fb_info = {
static const TypeInfo bcm2835_fb_info = {
.name = TYPE_BCM2835_FB,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(BCM2835FBState),
Expand Down
2 changes: 1 addition & 1 deletion hw/display/i2c-ddc.c
Expand Up @@ -113,7 +113,7 @@ static void i2c_ddc_class_init(ObjectClass *oc, void *data)
isc->send = i2c_ddc_tx;
}

static TypeInfo i2c_ddc_info = {
static const TypeInfo i2c_ddc_info = {
.name = TYPE_I2CDDC,
.parent = TYPE_I2C_SLAVE,
.instance_size = sizeof(I2CDDCState),
Expand Down
4 changes: 2 additions & 2 deletions hw/display/macfb.c
Expand Up @@ -782,14 +782,14 @@ static void macfb_nubus_class_init(ObjectClass *klass, void *data)
device_class_set_props(dc, macfb_nubus_properties);
}

static TypeInfo macfb_sysbus_info = {
static const TypeInfo macfb_sysbus_info = {
.name = TYPE_MACFB,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(MacfbSysBusState),
.class_init = macfb_sysbus_class_init,
};

static TypeInfo macfb_nubus_info = {
static const TypeInfo macfb_nubus_info = {
.name = TYPE_NUBUS_MACFB,
.parent = TYPE_NUBUS_DEVICE,
.instance_size = sizeof(MacfbNubusState),
Expand Down
2 changes: 1 addition & 1 deletion hw/display/virtio-vga.c
Expand Up @@ -220,7 +220,7 @@ static void virtio_vga_base_class_init(ObjectClass *klass, void *data)
virtio_vga_set_big_endian_fb);
}

static TypeInfo virtio_vga_base_info = {
static const TypeInfo virtio_vga_base_info = {
.name = TYPE_VIRTIO_VGA_BASE,
.parent = TYPE_VIRTIO_PCI,
.instance_size = sizeof(VirtIOVGABase),
Expand Down
2 changes: 1 addition & 1 deletion hw/dma/bcm2835_dma.c
Expand Up @@ -394,7 +394,7 @@ static void bcm2835_dma_class_init(ObjectClass *klass, void *data)
dc->vmsd = &vmstate_bcm2835_dma;
}

static TypeInfo bcm2835_dma_info = {
static const TypeInfo bcm2835_dma_info = {
.name = TYPE_BCM2835_DMA,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(BCM2835DMAState),
Expand Down
5 changes: 5 additions & 0 deletions hw/i2c/Kconfig
@@ -1,6 +1,11 @@
config I2C
bool

config I2C_DEVICES
# Device group for i2c devices which can reasonably be user-plugged
# to any board's i2c bus
bool

config SMBUS
bool
select I2C
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/pc_piix.c
Expand Up @@ -867,7 +867,7 @@ static void isa_bridge_class_init(ObjectClass *klass, void *data)
k->class_id = PCI_CLASS_BRIDGE_ISA;
};

static TypeInfo isa_bridge_info = {
static const TypeInfo isa_bridge_info = {
.name = "igd-passthrough-isa-bridge",
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(PCIDevice),
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/sgx-epc.c
Expand Up @@ -167,7 +167,7 @@ static void sgx_epc_class_init(ObjectClass *oc, void *data)
mdc->fill_device_info = sgx_epc_md_fill_device_info;
}

static TypeInfo sgx_epc_info = {
static const TypeInfo sgx_epc_info = {
.name = TYPE_SGX_EPC,
.parent = TYPE_DEVICE,
.instance_size = sizeof(SGXEPCDevice),
Expand Down
1 change: 1 addition & 0 deletions hw/ide/core.c
Expand Up @@ -29,6 +29,7 @@
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
#include "qemu/timer.h"
#include "qemu/hw-version.h"
#include "sysemu/sysemu.h"
#include "sysemu/blockdev.h"
#include "sysemu/dma.h"
Expand Down

0 comments on commit 477c3b9

Please sign in to comment.