* [Qemu-devel] [PULL 00/11] target-arm queue
@ 2016-07-14 16:29 Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 01/11] virtio-mmio: format transport base address in BusClass.get_dev_path Peter Maydell
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
target-arm patch queue. Some bugfixes, some minor features.
thanks
-- PMM
The following changes since commit 22e28174ae423629e57b0d03f4bbf2d1bedcd58f:
Merge remote-tracking branch 'remotes/xtensa/tags/20160714-xtensa' into staging (2016-07-14 15:57:28 +0100)
are available in the git repository at:
git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20160714
for you to fetch changes up to 79a9f323a80b802ca98895d1c2d4aaf23cff815a:
ast2400: externalize revision numbers (2016-07-14 16:51:39 +0100)
----------------------------------------------------------------
target-arm queue:
* add virtio-mmio transport base address to device path
(avoid an assertion failure with multiple virtio-scsi-devices)
* revert hw/ptimer commit 5a50307 which causes regressions on
SPARC guests
* use Neon to accelerate zero-page checking on AArch64 hosts
* set the MPIDR for TCG to match how KVM does it (and fit with
GICv2/GICv3 restrictions on SGI target lists)
* add some missing AArch32 TLBI hypervisor TLB operations
* m25p80: Fix QIOR/DIOR handling for Winbond
* hw/misc: fix typo in Aspeed SCU hw-strap2 property name
* ast2400: pretend DMAs are done for U-boot
* ast2400: some minor code cleanups
----------------------------------------------------------------
Andrew Jones (2):
gic: provide defines for v2/v3 targetlist sizes
hw/arm/virt: tcg: adjust MPIDR like KVM
Cédric Le Goater (4):
hw/misc: fix typo in Aspeed SCU hw-strap2 property name
ast2400: replace aspeed_smc_is_implemented()
ast2400: pretend DMAs are done for U-boot
ast2400: externalize revision numbers
Dmitry Osipenko (1):
Revert "hw/ptimer: Perform counter wrap around if timer already expired"
Laszlo Ersek (1):
virtio-mmio: format transport base address in BusClass.get_dev_path
Marcin Krzeminski (1):
m25p80: Fix QIOR/DIOR handling for Winbond
Sergey Sorokin (1):
target-arm: Add missed AArch32 TLBI sytem registers
Vijay (1):
target-arm: Use Neon for zero checking
hw/arm/ast2400.c | 2 -
hw/arm/virt.c | 25 ++++++-
hw/block/m25p80.c | 6 +-
hw/core/ptimer.c | 9 +--
hw/misc/aspeed_scu.c | 6 +-
hw/ssi/aspeed_smc.c | 39 +++++------
hw/virtio/virtio-mmio.c | 49 +++++++++++++
include/hw/compat.h | 6 +-
include/hw/intc/arm_gic.h | 3 +
include/hw/intc/arm_gicv3_common.h | 3 +
include/hw/misc/aspeed_scu.h | 5 ++
target-arm/helper.c | 139 +++++++++++++++++++++++++++++++++++++
util/cutils.c | 7 ++
13 files changed, 262 insertions(+), 37 deletions(-)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [PULL 01/11] virtio-mmio: format transport base address in BusClass.get_dev_path
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
@ 2016-07-14 16:29 ` Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 02/11] Revert "hw/ptimer: Perform counter wrap around if timer already expired" Peter Maydell
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
From: Laszlo Ersek <lersek@redhat.com>
At the moment the following QEMU command line triggers an assertion
failure (minimal reproducer by Cole):
qemu-system-aarch64 \
-machine virt-2.6,accel=tcg \
-nodefaults \
-no-user-config \
-nographic -monitor stdio \
-device virtio-scsi-device,id=scsi0 \
-device virtio-scsi-device,id=scsi1 \
-drive file=foo.img,format=raw,if=none,id=d0 \
-device scsi-hd,bus=scsi0.0,drive=d0 \
-drive file=foo.img,format=raw,if=none,id=d1 \
-device scsi-hd,bus=scsi1.0,drive=d1
qemu-system-aarch64: migration/savevm.c:615:
vmstate_register_with_alias_id:
Assertion `!se->compat || se->instance_id == 0' failed.
The reason is that the vmstate sections for the two scsi-hd devices are
not uniquely identifiable by name.
The direct parent buses of the scsi-hd devices -- scsi0.0 and scsi1.0 --
support the BusClass.get_dev_path member function. scsibus_get_dev_path()
formats a device path prefix with the help of its topologically parent
bus, and then appends the chan:id:lun triplet to it. For both scsi-hd
devices, this triplet is 0:0:0.
(Here we use "device path" in the QEMU migration sense, for vmstate
section identification, not in the OFW or UEFI device path senses.)
The virtio-scsi HBA is plugged into the virtio-mmio bus (implemented by
the internal VirtIOMMIOProxy device). This bus class
(TYPE_VIRTIO_MMIO_BUS) inherits, as its get_dev_path() member function,
the virtio_bus_get_dev_path() method from its parent class
(TYPE_VIRTIO_BUS).
virtio_bus_get_dev_path() does not format any kind of device address on
its own; "virtio addresses" are transport-specific. Therefore
virtio_bus_get_dev_path() asks the topologically parent bus of the proxy
object (implementing the specific virtio transport) to format the address
of the proxy object.
(For virtio-pci devices (where the proxy is an instance of VirtIOPCIProxy,
plugged into a PCI bus), this ends up in pcibus_get_dev_path().)
However, VirtIOMMIOProxy is usually (in practice: always) plugged into
"main-system-bus", the singleton TYPE_SYSTEM_BUS object. This BusClass
does not support formatting QEMU vmstate device paths at all (as
SysBusDevice objects can have zero or more IO ports and zero or more MMIO
regions). Hence the formatting request delegated from
virtio_bus_get_dev_path() gets answered with NULL.
The end result is that the two scsi-hd devices end up with the same device
path "0:0:0", which triggers the assert.
We can solve this by recognizing that virtio-mmio transports are
distinguished from each other by their base addresses in MMIO address
space. Implement virtio_mmio_bus_get_dev_path() as follows:
(1) The virtio device whose devpath is to be formatted resides on a
virtio-mmio bus that is implemented by a VirtIOMMIOProxy object. Ask
the parent bus of VirtIOMMIOProxy to format the device path of
VirtIOMMIOProxy, as a path prefix. (This is identical to what
virtio_bus_get_dev_path() does.)
(2) Append the base address of VirtIOMMIOProxy to the device path, such
as:
- virtio-mmio@000000000a003e00,
- virtio-mmio@000000000a003c00.
Given that these device paths are placed in the migration stream, step (2)
above, if done unconditionally, would break migration. So make that step
conditional on a new VirtIOMMIOProxy property, which is enabled for 2.7
machine types and later.
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Cole Robinson <crobinso@redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: Kevin Zhao <kevin.zhao@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Tom Hanson <thomas.hanson@linaro.org>
Reported-by: Kevin Zhao <kevin.zhao@linaro.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1467739394-28357-1-git-send-email-lersek@redhat.com
Fixes: https://bugs.launchpad.net/qemu/+bug/1594239
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/virtio/virtio-mmio.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
include/hw/compat.h | 6 +++++-
2 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c
index eb84b74..13798b3 100644
--- a/hw/virtio/virtio-mmio.c
+++ b/hw/virtio/virtio-mmio.c
@@ -91,6 +91,7 @@ typedef struct {
VirtioBusState bus;
bool ioeventfd_disabled;
bool ioeventfd_started;
+ bool format_transport_address;
} VirtIOMMIOProxy;
static bool virtio_mmio_ioeventfd_started(DeviceState *d)
@@ -469,6 +470,12 @@ assign_error:
/* virtio-mmio device */
+static Property virtio_mmio_properties[] = {
+ DEFINE_PROP_BOOL("format_transport_address", VirtIOMMIOProxy,
+ format_transport_address, true),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void virtio_mmio_realizefn(DeviceState *d, Error **errp)
{
VirtIOMMIOProxy *proxy = VIRTIO_MMIO(d);
@@ -489,6 +496,7 @@ static void virtio_mmio_class_init(ObjectClass *klass, void *data)
dc->realize = virtio_mmio_realizefn;
dc->reset = virtio_mmio_reset;
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+ dc->props = virtio_mmio_properties;
}
static const TypeInfo virtio_mmio_info = {
@@ -500,6 +508,46 @@ static const TypeInfo virtio_mmio_info = {
/* virtio-mmio-bus. */
+static char *virtio_mmio_bus_get_dev_path(DeviceState *dev)
+{
+ BusState *virtio_mmio_bus;
+ VirtIOMMIOProxy *virtio_mmio_proxy;
+ char *proxy_path;
+ SysBusDevice *proxy_sbd;
+ char *path;
+
+ virtio_mmio_bus = qdev_get_parent_bus(dev);
+ virtio_mmio_proxy = VIRTIO_MMIO(virtio_mmio_bus->parent);
+ proxy_path = qdev_get_dev_path(DEVICE(virtio_mmio_proxy));
+
+ /*
+ * If @format_transport_address is false, then we just perform the same as
+ * virtio_bus_get_dev_path(): we delegate the address formatting for the
+ * device on the virtio-mmio bus to the bus that the virtio-mmio proxy
+ * (i.e., the device that implements the virtio-mmio bus) resides on. In
+ * this case the base address of the virtio-mmio transport will be
+ * invisible.
+ */
+ if (!virtio_mmio_proxy->format_transport_address) {
+ return proxy_path;
+ }
+
+ /* Otherwise, we append the base address of the transport. */
+ proxy_sbd = SYS_BUS_DEVICE(virtio_mmio_proxy);
+ assert(proxy_sbd->num_mmio == 1);
+ assert(proxy_sbd->mmio[0].memory == &virtio_mmio_proxy->iomem);
+
+ if (proxy_path) {
+ path = g_strdup_printf("%s/virtio-mmio@" TARGET_FMT_plx, proxy_path,
+ proxy_sbd->mmio[0].addr);
+ } else {
+ path = g_strdup_printf("virtio-mmio@" TARGET_FMT_plx,
+ proxy_sbd->mmio[0].addr);
+ }
+ g_free(proxy_path);
+ return path;
+}
+
static void virtio_mmio_bus_class_init(ObjectClass *klass, void *data)
{
BusClass *bus_class = BUS_CLASS(klass);
@@ -516,6 +564,7 @@ static void virtio_mmio_bus_class_init(ObjectClass *klass, void *data)
k->ioeventfd_assign = virtio_mmio_ioeventfd_assign;
k->has_variable_vring_alignment = true;
bus_class->max_dev = 1;
+ bus_class->get_dev_path = virtio_mmio_bus_get_dev_path;
}
static const TypeInfo virtio_mmio_bus_info = {
diff --git a/include/hw/compat.h b/include/hw/compat.h
index 636befe..9914e7a 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -2,7 +2,11 @@
#define HW_COMPAT_H
#define HW_COMPAT_2_6 \
- /* empty */
+ {\
+ .driver = "virtio-mmio",\
+ .property = "format_transport_address",\
+ .value = "off",\
+ },
#define HW_COMPAT_2_5 \
{\
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PULL 02/11] Revert "hw/ptimer: Perform counter wrap around if timer already expired"
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 01/11] virtio-mmio: format transport base address in BusClass.get_dev_path Peter Maydell
@ 2016-07-14 16:29 ` Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 03/11] target-arm: Use Neon for zero checking Peter Maydell
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
From: Dmitry Osipenko <digetx@gmail.com>
Software should see timer counter wraparound only after IRQ being triggered.
This fixes regression introduced by the commit 5a50307 ("hw/ptimer: Perform
counter wrap around if timer already expired"), resulting in monotonic timer
jumping backwards on SPARC emulated machine running NetBSD guest OS, as
reported by Mark Cave-Ayland.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Message-id: 20160708132206.2080-1-digetx@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/core/ptimer.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c
index 05b0c27..30829ee 100644
--- a/hw/core/ptimer.c
+++ b/hw/core/ptimer.c
@@ -93,7 +93,7 @@ uint64_t ptimer_get_count(ptimer_state *s)
bool oneshot = (s->enabled == 2);
/* Figure out the current counter value. */
- if (s->period == 0 || (expired && (oneshot || use_icount))) {
+ if (expired) {
/* Prevent timer underflowing if it should already have
triggered. */
counter = 0;
@@ -120,7 +120,7 @@ uint64_t ptimer_get_count(ptimer_state *s)
backwards.
*/
- rem = expired ? now - next : next - now;
+ rem = next - now;
div = period;
clz1 = clz64(rem);
@@ -140,11 +140,6 @@ uint64_t ptimer_get_count(ptimer_state *s)
div += 1;
}
counter = rem / div;
-
- if (expired && counter != 0) {
- /* Wrap around periodic counter. */
- counter = s->limit - (counter - 1) % s->limit;
- }
}
} else {
counter = s->delta;
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PULL 03/11] target-arm: Use Neon for zero checking
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 01/11] virtio-mmio: format transport base address in BusClass.get_dev_path Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 02/11] Revert "hw/ptimer: Perform counter wrap around if timer already expired" Peter Maydell
@ 2016-07-14 16:29 ` Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 04/11] gic: provide defines for v2/v3 targetlist sizes Peter Maydell
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
From: Vijay <vijayak@cavium.com>
Use Neon instructions to perform zero checking of
buffer. This is helps in reducing total migration time.
Use case: Idle VM live migration with 4 VCPUS and 8GB ram
running CentOS 7.
Without Neon, the Total migration time is 3.5 Sec
Migration status: completed
total time: 3560 milliseconds
downtime: 33 milliseconds
setup: 5 milliseconds
transferred ram: 297907 kbytes
throughput: 685.76 mbps
remaining ram: 0 kbytes
total ram: 8519872 kbytes
duplicate: 2062760 pages
skipped: 0 pages
normal: 69808 pages
normal bytes: 279232 kbytes
dirty sync count: 3
With Neon, the total migration time is 2.9 Sec
Migration status: completed
total time: 2960 milliseconds
downtime: 65 milliseconds
setup: 4 milliseconds
transferred ram: 299869 kbytes
throughput: 830.19 mbps
remaining ram: 0 kbytes
total ram: 8519872 kbytes
duplicate: 2064313 pages
skipped: 0 pages
normal: 70294 pages
normal bytes: 281176 kbytes
dirty sync count: 3
Signed-off-by: Vijaya Kumar K <vijayak@cavium.com>
Signed-off-by: Suresh <ksuresh@cavium.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1467190029-694-2-git-send-email-vijayak@cavium.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
util/cutils.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/util/cutils.c b/util/cutils.c
index 5830a68..7505fda 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -184,6 +184,13 @@ int qemu_fdatasync(int fd)
#define SPLAT(p) _mm_set1_epi8(*(p))
#define ALL_EQ(v1, v2) (_mm_movemask_epi8(_mm_cmpeq_epi8(v1, v2)) == 0xFFFF)
#define VEC_OR(v1, v2) (_mm_or_si128(v1, v2))
+#elif defined(__aarch64__)
+#include "arm_neon.h"
+#define VECTYPE uint64x2_t
+#define ALL_EQ(v1, v2) \
+ ((vgetq_lane_u64(v1, 0) == vgetq_lane_u64(v2, 0)) && \
+ (vgetq_lane_u64(v1, 1) == vgetq_lane_u64(v2, 1)))
+#define VEC_OR(v1, v2) ((v1) | (v2))
#else
#define VECTYPE unsigned long
#define SPLAT(p) (*(p) * (~0UL / 255))
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PULL 04/11] gic: provide defines for v2/v3 targetlist sizes
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
` (2 preceding siblings ...)
2016-07-14 16:29 ` [Qemu-devel] [PULL 03/11] target-arm: Use Neon for zero checking Peter Maydell
@ 2016-07-14 16:29 ` Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 05/11] hw/arm/virt: tcg: adjust MPIDR like KVM Peter Maydell
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
From: Andrew Jones <drjones@redhat.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
Message-id: 1467378129-23302-2-git-send-email-drjones@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/hw/intc/arm_gic.h | 3 +++
include/hw/intc/arm_gicv3_common.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/include/hw/intc/arm_gic.h b/include/hw/intc/arm_gic.h
index 0971e37..42bb535 100644
--- a/include/hw/intc/arm_gic.h
+++ b/include/hw/intc/arm_gic.h
@@ -23,6 +23,9 @@
#include "arm_gic_common.h"
+/* Number of SGI target-list bits */
+#define GIC_TARGETLIST_BITS 8
+
#define TYPE_ARM_GIC "arm_gic"
#define ARM_GIC(obj) \
OBJECT_CHECK(GICState, (obj), TYPE_ARM_GIC)
diff --git a/include/hw/intc/arm_gicv3_common.h b/include/hw/intc/arm_gicv3_common.h
index f72e499..341a311 100644
--- a/include/hw/intc/arm_gicv3_common.h
+++ b/include/hw/intc/arm_gicv3_common.h
@@ -35,6 +35,9 @@
#define GICV3_MAXIRQ 1020
#define GICV3_MAXSPI (GICV3_MAXIRQ - GIC_INTERNAL)
+/* Number of SGI target-list bits */
+#define GICV3_TARGETLIST_BITS 16
+
/* Minimum BPR for Secure, or when security not enabled */
#define GIC_MIN_BPR 0
/* Minimum BPR for Nonsecure when security is enabled */
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PULL 05/11] hw/arm/virt: tcg: adjust MPIDR like KVM
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
` (3 preceding siblings ...)
2016-07-14 16:29 ` [Qemu-devel] [PULL 04/11] gic: provide defines for v2/v3 targetlist sizes Peter Maydell
@ 2016-07-14 16:29 ` Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 06/11] target-arm: Add missed AArch32 TLBI sytem registers Peter Maydell
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
From: Andrew Jones <drjones@redhat.com>
KVM adjusts the MPIDR of guest vcpus based on the architecture of
the host, 32-bit vs. 64-bit, and, for 64-bit, also on the type of
GIC the guest is using. To be consistent and improve SGI efficiency
we make the same adjustments for TCG as 64-bit KVM hosts. We neglect
to add consistency with 32-bit KVM hosts, as that would reduce SGI
efficiency and KVM is expected to change.
As MPIDR is a system register, and thus guest visible, we only make
adjustments for current and later versioned machines.
Signed-off-by: Andrew Jones <drjones@redhat.com>
Message-id: 1467378129-23302-3-git-send-email-drjones@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/virt.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 4dafd42..a193b5a 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -52,7 +52,8 @@
#include "hw/arm/sysbus-fdt.h"
#include "hw/platform-bus.h"
#include "hw/arm/fdt.h"
-#include "hw/intc/arm_gic_common.h"
+#include "hw/intc/arm_gic.h"
+#include "hw/intc/arm_gicv3_common.h"
#include "kvm_arm.h"
#include "hw/smbios/smbios.h"
#include "qapi/visitor.h"
@@ -82,6 +83,7 @@ typedef struct VirtBoardInfo {
typedef struct {
MachineClass parent;
VirtBoardInfo *daughterboard;
+ bool disallow_affinity_adjustment;
} VirtMachineClass;
typedef struct {
@@ -1165,6 +1167,7 @@ void virt_guest_info_machine_done(Notifier *notifier, void *data)
static void machvirt_init(MachineState *machine)
{
VirtMachineState *vms = VIRT_MACHINE(machine);
+ VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(machine);
qemu_irq pic[NUM_IRQS];
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *secure_sysmem = NULL;
@@ -1181,6 +1184,7 @@ static void machvirt_init(MachineState *machine)
CPUClass *cc;
Error *err = NULL;
bool firmware_loaded = bios_name || drive_get(IF_PFLASH, 0, 0);
+ uint8_t clustersz;
if (!cpu_model) {
cpu_model = "cortex-a15";
@@ -1226,8 +1230,10 @@ static void machvirt_init(MachineState *machine)
*/
if (gic_version == 3) {
virt_max_cpus = vbi->memmap[VIRT_GIC_REDIST].size / 0x20000;
+ clustersz = GICV3_TARGETLIST_BITS;
} else {
virt_max_cpus = GIC_NCPU;
+ clustersz = GIC_TARGETLIST_BITS;
}
if (max_cpus > virt_max_cpus) {
@@ -1281,6 +1287,20 @@ static void machvirt_init(MachineState *machine)
for (n = 0; n < smp_cpus; n++) {
Object *cpuobj = object_new(typename);
+ if (!vmc->disallow_affinity_adjustment) {
+ /* Adjust MPIDR like 64-bit KVM hosts, which incorporate the
+ * GIC's target-list limitations. 32-bit KVM hosts currently
+ * always create clusters of 4 CPUs, but that is expected to
+ * change when they gain support for gicv3. When KVM is enabled
+ * it will override the changes we make here, therefore our
+ * purposes are to make TCG consistent (with 64-bit KVM hosts)
+ * and to improve SGI efficiency.
+ */
+ uint8_t aff1 = n / clustersz;
+ uint8_t aff0 = n % clustersz;
+ object_property_set_int(cpuobj, (aff1 << ARM_AFF1_SHIFT) | aff0,
+ "mp-affinity", NULL);
+ }
if (!vms->secure) {
object_property_set_bool(cpuobj, false, "has_el3", NULL);
@@ -1507,7 +1527,10 @@ static void virt_2_6_instance_init(Object *obj)
static void virt_machine_2_6_options(MachineClass *mc)
{
+ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
+
virt_machine_2_7_options(mc);
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_6);
+ vmc->disallow_affinity_adjustment = true;
}
DEFINE_VIRT_MACHINE(2, 6)
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PULL 06/11] target-arm: Add missed AArch32 TLBI sytem registers
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
` (4 preceding siblings ...)
2016-07-14 16:29 ` [Qemu-devel] [PULL 05/11] hw/arm/virt: tcg: adjust MPIDR like KVM Peter Maydell
@ 2016-07-14 16:29 ` Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 07/11] m25p80: Fix QIOR/DIOR handling for Winbond Peter Maydell
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
From: Sergey Sorokin <afarallax@yandex.ru>
Some PL2 related TLBI system registers are missed in AArch32
implementation. The patch fixes it.
Signed-off-by: Sergey Sorokin <afarallax@yandex.ru>
Message-id: 1468328885-3217862-1-git-send-email-afarallax@yandex.ru
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target-arm/helper.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 139 insertions(+)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 1f9cdac..bdb842c 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -572,6 +572,102 @@ static void tlbimvaa_is_write(CPUARMState *env, const ARMCPRegInfo *ri,
}
}
+static void tlbiall_nsnh_write(CPUARMState *env, const ARMCPRegInfo *ri,
+ uint64_t value)
+{
+ CPUState *cs = ENV_GET_CPU(env);
+
+ tlb_flush_by_mmuidx(cs, ARMMMUIdx_S12NSE1, ARMMMUIdx_S12NSE0,
+ ARMMMUIdx_S2NS, -1);
+}
+
+static void tlbiall_nsnh_is_write(CPUARMState *env, const ARMCPRegInfo *ri,
+ uint64_t value)
+{
+ CPUState *other_cs;
+
+ CPU_FOREACH(other_cs) {
+ tlb_flush_by_mmuidx(other_cs, ARMMMUIdx_S12NSE1,
+ ARMMMUIdx_S12NSE0, ARMMMUIdx_S2NS, -1);
+ }
+}
+
+static void tlbiipas2_write(CPUARMState *env, const ARMCPRegInfo *ri,
+ uint64_t value)
+{
+ /* Invalidate by IPA. This has to invalidate any structures that
+ * contain only stage 2 translation information, but does not need
+ * to apply to structures that contain combined stage 1 and stage 2
+ * translation information.
+ * This must NOP if EL2 isn't implemented or SCR_EL3.NS is zero.
+ */
+ CPUState *cs = ENV_GET_CPU(env);
+ uint64_t pageaddr;
+
+ if (!arm_feature(env, ARM_FEATURE_EL2) || !(env->cp15.scr_el3 & SCR_NS)) {
+ return;
+ }
+
+ pageaddr = sextract64(value << 12, 0, 40);
+
+ tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdx_S2NS, -1);
+}
+
+static void tlbiipas2_is_write(CPUARMState *env, const ARMCPRegInfo *ri,
+ uint64_t value)
+{
+ CPUState *other_cs;
+ uint64_t pageaddr;
+
+ if (!arm_feature(env, ARM_FEATURE_EL2) || !(env->cp15.scr_el3 & SCR_NS)) {
+ return;
+ }
+
+ pageaddr = sextract64(value << 12, 0, 40);
+
+ CPU_FOREACH(other_cs) {
+ tlb_flush_page_by_mmuidx(other_cs, pageaddr, ARMMMUIdx_S2NS, -1);
+ }
+}
+
+static void tlbiall_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri,
+ uint64_t value)
+{
+ CPUState *cs = ENV_GET_CPU(env);
+
+ tlb_flush_by_mmuidx(cs, ARMMMUIdx_S1E2, -1);
+}
+
+static void tlbiall_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri,
+ uint64_t value)
+{
+ CPUState *other_cs;
+
+ CPU_FOREACH(other_cs) {
+ tlb_flush_by_mmuidx(other_cs, ARMMMUIdx_S1E2, -1);
+ }
+}
+
+static void tlbimva_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri,
+ uint64_t value)
+{
+ CPUState *cs = ENV_GET_CPU(env);
+ uint64_t pageaddr = value & ~MAKE_64BIT_MASK(0, 12);
+
+ tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdx_S1E2, -1);
+}
+
+static void tlbimva_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri,
+ uint64_t value)
+{
+ CPUState *other_cs;
+ uint64_t pageaddr = value & ~MAKE_64BIT_MASK(0, 12);
+
+ CPU_FOREACH(other_cs) {
+ tlb_flush_page_by_mmuidx(other_cs, pageaddr, ARMMMUIdx_S1E2, -1);
+ }
+}
+
static const ARMCPRegInfo cp_reginfo[] = {
/* Define the secure and non-secure FCSE identifier CP registers
* separately because there is no secure bank in V8 (no _EL3). This allows
@@ -3273,6 +3369,29 @@ static const ARMCPRegInfo v8_cp_reginfo[] = {
.type = ARM_CP_NO_RAW, .access = PL1_W, .writefn = tlbimva_write },
{ .name = "TLBIMVAAL", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 7,
.type = ARM_CP_NO_RAW, .access = PL1_W, .writefn = tlbimvaa_write },
+ { .name = "TLBIMVALH", .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 5,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbimva_hyp_write },
+ { .name = "TLBIMVALHIS",
+ .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 5,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbimva_hyp_is_write },
+ { .name = "TLBIIPAS2",
+ .cp = 15, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 1,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbiipas2_write },
+ { .name = "TLBIIPAS2IS",
+ .cp = 15, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 1,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbiipas2_is_write },
+ { .name = "TLBIIPAS2L",
+ .cp = 15, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 5,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbiipas2_write },
+ { .name = "TLBIIPAS2LIS",
+ .cp = 15, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 5,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbiipas2_is_write },
/* 32 bit cache operations */
{ .name = "ICIALLUIS", .cp = 15, .opc1 = 0, .crn = 7, .crm = 1, .opc2 = 0,
.type = ARM_CP_NOP, .access = PL1_W },
@@ -3605,6 +3724,26 @@ static const ARMCPRegInfo el2_cp_reginfo[] = {
{ .name = "HTTBR", .cp = 15, .opc1 = 4, .crm = 2,
.access = PL2_RW, .type = ARM_CP_64BIT | ARM_CP_ALIAS,
.fieldoffset = offsetof(CPUARMState, cp15.ttbr0_el[2]) },
+ { .name = "TLBIALLNSNH",
+ .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 4,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbiall_nsnh_write },
+ { .name = "TLBIALLNSNHIS",
+ .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 4,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbiall_nsnh_is_write },
+ { .name = "TLBIALLH", .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 0,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbiall_hyp_write },
+ { .name = "TLBIALLHIS", .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 0,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbiall_hyp_is_write },
+ { .name = "TLBIMVAH", .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 1,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbimva_hyp_write },
+ { .name = "TLBIMVAHIS", .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 1,
+ .type = ARM_CP_NO_RAW, .access = PL2_W,
+ .writefn = tlbimva_hyp_is_write },
{ .name = "TLBI_ALLE2", .state = ARM_CP_STATE_AA64,
.opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 0,
.type = ARM_CP_NO_RAW, .access = PL2_W,
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PULL 07/11] m25p80: Fix QIOR/DIOR handling for Winbond
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
` (5 preceding siblings ...)
2016-07-14 16:29 ` [Qemu-devel] [PULL 06/11] target-arm: Add missed AArch32 TLBI sytem registers Peter Maydell
@ 2016-07-14 16:29 ` Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 08/11] hw/misc: fix typo in Aspeed SCU hw-strap2 property name Peter Maydell
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
From: Marcin Krzeminski <marcin.krzeminski@nokia.com>
Winbond also support continuous read mode, but as an opposite for other
flash type read mode clock cycles are included to dummy cycles number.
This path add proper handling of read mode byte and update needed
dummy cycles. QPI mode and dummy cycles configuration are not supported.
Signed-off-by: Marcin Krzeminski <marcin.krzeminski@nokia.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-id: 1467809036-6986-1-git-send-email-marcin.krzeminski@nokia.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/block/m25p80.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index ca8c12c..9828ee6 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -149,6 +149,7 @@ typedef struct FlashPartInfo {
*/
#define SPANSION_CONTINUOUS_READ_MODE_CMD_LEN 1
+#define WINBOND_CONTINUOUS_READ_MODE_CMD_LEN 1
static const FlashPartInfo known_devices[] = {
/* Atmel -- some are (confusingly) marketed as "DataFlash" */
@@ -777,7 +778,7 @@ static void decode_dio_read_cmd(Flash *s)
/* Dummy cycles modeled with bytes writes instead of bits */
switch (get_man(s)) {
case MAN_WINBOND:
- s->needed_bytes += 8;
+ s->needed_bytes += WINBOND_CONTINUOUS_READ_MODE_CMD_LEN;
break;
case MAN_SPANSION:
s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN;
@@ -816,7 +817,8 @@ static void decode_qio_read_cmd(Flash *s)
/* Dummy cycles modeled with bytes writes instead of bits */
switch (get_man(s)) {
case MAN_WINBOND:
- s->needed_bytes += 8;
+ s->needed_bytes += WINBOND_CONTINUOUS_READ_MODE_CMD_LEN;
+ s->needed_bytes += 4;
break;
case MAN_SPANSION:
s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN;
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PULL 08/11] hw/misc: fix typo in Aspeed SCU hw-strap2 property name
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
` (6 preceding siblings ...)
2016-07-14 16:29 ` [Qemu-devel] [PULL 07/11] m25p80: Fix QIOR/DIOR handling for Winbond Peter Maydell
@ 2016-07-14 16:29 ` Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 09/11] ast2400: replace aspeed_smc_is_implemented() Peter Maydell
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
From: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-id: 1467994016-11678-2-git-send-email-clg@kaod.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/misc/aspeed_scu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
index 23f5175..b61c05e 100644
--- a/hw/misc/aspeed_scu.c
+++ b/hw/misc/aspeed_scu.c
@@ -255,7 +255,7 @@ static const VMStateDescription vmstate_aspeed_scu = {
static Property aspeed_scu_properties[] = {
DEFINE_PROP_UINT32("silicon-rev", AspeedSCUState, silicon_rev, 0),
DEFINE_PROP_UINT32("hw-strap1", AspeedSCUState, hw_strap1, 0),
- DEFINE_PROP_UINT32("hw-strap2", AspeedSCUState, hw_strap1, 0),
+ DEFINE_PROP_UINT32("hw-strap2", AspeedSCUState, hw_strap2, 0),
DEFINE_PROP_END_OF_LIST(),
};
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PULL 09/11] ast2400: replace aspeed_smc_is_implemented()
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
` (7 preceding siblings ...)
2016-07-14 16:29 ` [Qemu-devel] [PULL 08/11] hw/misc: fix typo in Aspeed SCU hw-strap2 property name Peter Maydell
@ 2016-07-14 16:29 ` Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 10/11] ast2400: pretend DMAs are done for U-boot Peter Maydell
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
From: Cédric Le Goater <clg@kaod.org>
aspeed_smc_is_implemented() filters invalid registers in a peculiar
way. Let's remove it and open code the if conditions. It serves the
same purpose, the aesthetic is better, and new registers can easily be
added.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-id: 1467994016-11678-3-git-send-email-clg@kaod.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/ssi/aspeed_smc.c | 35 +++++++++++++++--------------------
1 file changed, 15 insertions(+), 20 deletions(-)
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index a371e30..854474b 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -281,12 +281,6 @@ static void aspeed_smc_reset(DeviceState *d)
aspeed_smc_update_cs(s);
}
-static bool aspeed_smc_is_implemented(AspeedSMCState *s, hwaddr addr)
-{
- return (addr == s->r_conf || addr == s->r_timings || addr == s->r_ce_ctrl ||
- (addr >= s->r_ctrl0 && addr < s->r_ctrl0 + s->num_cs));
-}
-
static uint64_t aspeed_smc_read(void *opaque, hwaddr addr, unsigned int size)
{
AspeedSMCState *s = ASPEED_SMC(opaque);
@@ -300,13 +294,16 @@ static uint64_t aspeed_smc_read(void *opaque, hwaddr addr, unsigned int size)
return 0;
}
- if (!aspeed_smc_is_implemented(s, addr)) {
+ if (addr == s->r_conf ||
+ addr == s->r_timings ||
+ addr == s->r_ce_ctrl ||
+ (addr >= s->r_ctrl0 && addr < s->r_ctrl0 + s->num_cs)) {
+ return s->regs[addr];
+ } else {
qemu_log_mask(LOG_UNIMP, "%s: not implemented: 0x%" HWADDR_PRIx "\n",
- __func__, addr);
+ __func__, addr);
return 0;
}
-
- return s->regs[addr];
}
static void aspeed_smc_write(void *opaque, hwaddr addr, uint64_t data,
@@ -324,20 +321,18 @@ static void aspeed_smc_write(void *opaque, hwaddr addr, uint64_t data,
return;
}
- if (!aspeed_smc_is_implemented(s, addr)) {
+ if (addr == s->r_conf ||
+ addr == s->r_timings ||
+ addr == s->r_ce_ctrl) {
+ s->regs[addr] = value;
+ } else if (addr >= s->r_ctrl0 && addr < s->r_ctrl0 + s->num_cs) {
+ s->regs[addr] = value;
+ aspeed_smc_update_cs(s);
+ } else {
qemu_log_mask(LOG_UNIMP, "%s: not implemented: 0x%" HWADDR_PRIx "\n",
__func__, addr);
return;
}
-
- /*
- * Not much to do apart from storing the value and set the cs
- * lines if the register is a controlling one.
- */
- s->regs[addr] = value;
- if (addr >= s->r_ctrl0 && addr < s->r_ctrl0 + s->num_cs) {
- aspeed_smc_update_cs(s);
- }
}
static const MemoryRegionOps aspeed_smc_ops = {
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PULL 10/11] ast2400: pretend DMAs are done for U-boot
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
` (8 preceding siblings ...)
2016-07-14 16:29 ` [Qemu-devel] [PULL 09/11] ast2400: replace aspeed_smc_is_implemented() Peter Maydell
@ 2016-07-14 16:29 ` Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 11/11] ast2400: externalize revision numbers Peter Maydell
2016-07-14 17:08 ` [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
From: Cédric Le Goater <clg@kaod.org>
U-boot does SPI timing calibration using DMA tranfers. To let the
initialization continue, we fake success by setting the DMA status of
the Interrupt Control Register.
For the moment, DMA support is not required as it is not used in
normal operation.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-id: 1467994016-11678-4-git-send-email-clg@kaod.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/ssi/aspeed_smc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index 854474b..d319e04 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -273,6 +273,9 @@ static void aspeed_smc_reset(DeviceState *d)
memset(s->regs, 0, sizeof s->regs);
+ /* Pretend DMA is done (u-boot initialization) */
+ s->regs[R_INTR_CTRL] = INTR_CTRL_DMA_STATUS;
+
/* Unselect all slaves */
for (i = 0; i < s->num_cs; ++i) {
s->regs[s->r_ctrl0 + i] |= CTRL_CE_STOP_ACTIVE;
@@ -297,6 +300,7 @@ static uint64_t aspeed_smc_read(void *opaque, hwaddr addr, unsigned int size)
if (addr == s->r_conf ||
addr == s->r_timings ||
addr == s->r_ce_ctrl ||
+ addr == R_INTR_CTRL ||
(addr >= s->r_ctrl0 && addr < s->r_ctrl0 + s->num_cs)) {
return s->regs[addr];
} else {
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PULL 11/11] ast2400: externalize revision numbers
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
` (9 preceding siblings ...)
2016-07-14 16:29 ` [Qemu-devel] [PULL 10/11] ast2400: pretend DMAs are done for U-boot Peter Maydell
@ 2016-07-14 16:29 ` Peter Maydell
2016-07-14 17:08 ` [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 16:29 UTC (permalink / raw)
To: qemu-devel
From: Cédric Le Goater <clg@kaod.org>
AST2400_A0_SILICON_REV is defined twice. Fix this by including the
definition in the header file as well as the routine to check if a
silicon revision is supported. It will useful to reuse in other
controllers.
Let's add also AST2500_A0_SILICON_REV for future use.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-id: 1467994016-11678-5-git-send-email-clg@kaod.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/ast2400.c | 2 --
hw/misc/aspeed_scu.c | 4 +---
include/hw/misc/aspeed_scu.h | 5 +++++
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/hw/arm/ast2400.c b/hw/arm/ast2400.c
index 0555843..326fdb3 100644
--- a/hw/arm/ast2400.c
+++ b/hw/arm/ast2400.c
@@ -34,8 +34,6 @@
#define AST2400_FMC_FLASH_BASE 0x20000000
#define AST2400_SPI_FLASH_BASE 0x30000000
-#define AST2400_A0_SILICON_REV 0x02000303
-
static const int uart_irqs[] = { 9, 32, 33, 34, 10 };
static const int timer_irqs[] = { 16, 17, 18, 35, 36, 37, 38, 39, };
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
index b61c05e..c7e2c82 100644
--- a/hw/misc/aspeed_scu.c
+++ b/hw/misc/aspeed_scu.c
@@ -88,8 +88,6 @@
#define PROT_KEY_UNLOCK 0x1688A8A8
#define SCU_IO_REGION_SIZE 0x20000
-#define AST2400_A0_SILICON_REV 0x02000303U
-
static const uint32_t ast2400_a0_resets[ASPEED_SCU_NR_REGS] = {
[SYS_RST_CTRL] = 0xFFCFFEDCU,
[CLK_SEL] = 0xF3F40000U,
@@ -212,7 +210,7 @@ static void aspeed_scu_reset(DeviceState *dev)
static uint32_t aspeed_silicon_revs[] = { AST2400_A0_SILICON_REV, };
-static bool is_supported_silicon_rev(uint32_t silicon_rev)
+bool is_supported_silicon_rev(uint32_t silicon_rev)
{
int i;
diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h
index 6b8e46f..fdfd982 100644
--- a/include/hw/misc/aspeed_scu.h
+++ b/include/hw/misc/aspeed_scu.h
@@ -31,4 +31,9 @@ typedef struct AspeedSCUState {
uint32_t hw_strap2;
} AspeedSCUState;
+#define AST2400_A0_SILICON_REV 0x02000303U
+#define AST2500_A0_SILICON_REV 0x04000303U
+
+extern bool is_supported_silicon_rev(uint32_t silicon_rev);
+
#endif /* ASPEED_SCU_H */
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PULL 00/11] target-arm queue
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
` (10 preceding siblings ...)
2016-07-14 16:29 ` [Qemu-devel] [PULL 11/11] ast2400: externalize revision numbers Peter Maydell
@ 2016-07-14 17:08 ` Peter Maydell
11 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2016-07-14 17:08 UTC (permalink / raw)
To: QEMU Developers
On 14 July 2016 at 17:29, Peter Maydell <peter.maydell@linaro.org> wrote:
> target-arm patch queue. Some bugfixes, some minor features.
>
> thanks
> -- PMM
>
> The following changes since commit 22e28174ae423629e57b0d03f4bbf2d1bedcd58f:
>
> Merge remote-tracking branch 'remotes/xtensa/tags/20160714-xtensa' into staging (2016-07-14 15:57:28 +0100)
>
> are available in the git repository at:
>
>
> git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20160714
>
> for you to fetch changes up to 79a9f323a80b802ca98895d1c2d4aaf23cff815a:
>
> ast2400: externalize revision numbers (2016-07-14 16:51:39 +0100)
>
> ----------------------------------------------------------------
> target-arm queue:
> * add virtio-mmio transport base address to device path
> (avoid an assertion failure with multiple virtio-scsi-devices)
> * revert hw/ptimer commit 5a50307 which causes regressions on
> SPARC guests
> * use Neon to accelerate zero-page checking on AArch64 hosts
> * set the MPIDR for TCG to match how KVM does it (and fit with
> GICv2/GICv3 restrictions on SGI target lists)
> * add some missing AArch32 TLBI hypervisor TLB operations
> * m25p80: Fix QIOR/DIOR handling for Winbond
> * hw/misc: fix typo in Aspeed SCU hw-strap2 property name
> * ast2400: pretend DMAs are done for U-boot
> * ast2400: some minor code cleanups
>
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2016-07-14 17:08 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-14 16:29 [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 01/11] virtio-mmio: format transport base address in BusClass.get_dev_path Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 02/11] Revert "hw/ptimer: Perform counter wrap around if timer already expired" Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 03/11] target-arm: Use Neon for zero checking Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 04/11] gic: provide defines for v2/v3 targetlist sizes Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 05/11] hw/arm/virt: tcg: adjust MPIDR like KVM Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 06/11] target-arm: Add missed AArch32 TLBI sytem registers Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 07/11] m25p80: Fix QIOR/DIOR handling for Winbond Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 08/11] hw/misc: fix typo in Aspeed SCU hw-strap2 property name Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 09/11] ast2400: replace aspeed_smc_is_implemented() Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 10/11] ast2400: pretend DMAs are done for U-boot Peter Maydell
2016-07-14 16:29 ` [Qemu-devel] [PULL 11/11] ast2400: externalize revision numbers Peter Maydell
2016-07-14 17:08 ` [Qemu-devel] [PULL 00/11] target-arm queue Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).