From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713519831617.9010270579694; Thu, 13 Dec 2018 07:05:19 -0800 (PST) Received: from localhost ([::1]:53127 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSY6-00058U-7k for importer@patchew.org; Thu, 13 Dec 2018 10:05:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSO6-000415-9s for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSO5-00076F-Gn for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:54 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSO5-0006zA-5I for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:53 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSNy-0007FB-F6 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:46 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:09 +0000 Message-Id: <20181213145445.17935-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 01/37] hw: arm: musicpal: drop TYPE_WM8750 in object_property_set_link() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Li Qiang The third argument of object_property_set_link() is the name of property, not related with the QOM type name, using the constant string instead. Signed-off-by: Li Qiang Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 1542880825-2604-1-git-send-email-liq3ea@gmail.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/arm/musicpal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 9648b3af44e..726ae29394e 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1696,7 +1696,7 @@ static void musicpal_init(MachineState *machine) dev =3D qdev_create(NULL, TYPE_MV88W8618_AUDIO); s =3D SYS_BUS_DEVICE(dev); object_property_set_link(OBJECT(dev), OBJECT(wm8750_dev), - TYPE_WM8750, NULL); + "wm8750", NULL); qdev_init_nofail(dev); sysbus_mmio_map(s, 0, MP_AUDIO_BASE); sysbus_connect_irq(s, 0, pic[MP_AUDIO_IRQ]); --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713525396171.8969433272141; Thu, 13 Dec 2018 07:05:25 -0800 (PST) Received: from localhost ([::1]:53129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSYG-0005Dc-AF for importer@patchew.org; Thu, 13 Dec 2018 10:05:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSO5-0003zu-9L for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSO4-00073q-3y for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:53 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSO3-0006zA-Ry for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:52 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSNy-0007FP-Vg for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:46 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:10 +0000 Message-Id: <20181213145445.17935-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 02/37] Allow AArch64 processors to boot from a kernel placed over 4GB X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Ricardo Perez Blanco Architecturally, it's possible for an AArch64 machine to have all of its RAM over the 4GB mark, but our kernel/initrd loading code in boot.c assumes that the upper half of the addresses to load these images to is always zero. Write the whole 64 bit address into the bootloader code fragment, not just the low half. Note that, currently, none of the existing QEMU machines have their main memory over 4GBs, so this was not a user-visible bug. Signed-off-by: Ricardo Perez Blanco [PMM: revised commit message and tweaked some long lines] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/arm/boot.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 586baa9b647..94fce128028 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -63,8 +63,10 @@ typedef enum { FIXUP_TERMINATOR, /* end of insns */ FIXUP_BOARDID, /* overwrite with board ID number */ FIXUP_BOARD_SETUP, /* overwrite with board specific setup code addres= s */ - FIXUP_ARGPTR, /* overwrite with pointer to kernel args */ - FIXUP_ENTRYPOINT, /* overwrite with kernel entry point */ + FIXUP_ARGPTR_LO, /* overwrite with pointer to kernel args */ + FIXUP_ARGPTR_HI, /* overwrite with pointer to kernel args (high hal= f) */ + FIXUP_ENTRYPOINT_LO, /* overwrite with kernel entry point */ + FIXUP_ENTRYPOINT_HI, /* overwrite with kernel entry point (high half) = */ FIXUP_GIC_CPU_IF, /* overwrite with GIC CPU interface address */ FIXUP_BOOTREG, /* overwrite with boot register address */ FIXUP_DSB, /* overwrite with correct DSB insn for cpu */ @@ -83,10 +85,10 @@ static const ARMInsnFixup bootloader_aarch64[] =3D { { 0xaa1f03e3 }, /* mov x3, xzr */ { 0x58000084 }, /* ldr x4, entry ; Load the lower 32-bits of kernel en= try */ { 0xd61f0080 }, /* br x4 ; Jump to the kernel entry point */ - { 0, FIXUP_ARGPTR }, /* arg: .word @DTB Lower 32-bits */ - { 0 }, /* .word @DTB Higher 32-bits */ - { 0, FIXUP_ENTRYPOINT }, /* entry: .word @Kernel Entry Lower 32-bits */ - { 0 }, /* .word @Kernel Entry Higher 32-bits */ + { 0, FIXUP_ARGPTR_LO }, /* arg: .word @DTB Lower 32-bits */ + { 0, FIXUP_ARGPTR_HI}, /* .word @DTB Higher 32-bits */ + { 0, FIXUP_ENTRYPOINT_LO }, /* entry: .word @Kernel Entry Lower 32-bit= s */ + { 0, FIXUP_ENTRYPOINT_HI }, /* .word @Kernel Entry Higher 32-bits */ { 0, FIXUP_TERMINATOR } }; =20 @@ -106,8 +108,8 @@ static const ARMInsnFixup bootloader[] =3D { { 0xe59f2004 }, /* ldr r2, [pc, #4] */ { 0xe59ff004 }, /* ldr pc, [pc, #4] */ { 0, FIXUP_BOARDID }, - { 0, FIXUP_ARGPTR }, - { 0, FIXUP_ENTRYPOINT }, + { 0, FIXUP_ARGPTR_LO }, + { 0, FIXUP_ENTRYPOINT_LO }, { 0, FIXUP_TERMINATOR } }; =20 @@ -174,8 +176,10 @@ static void write_bootloader(const char *name, hwaddr = addr, break; case FIXUP_BOARDID: case FIXUP_BOARD_SETUP: - case FIXUP_ARGPTR: - case FIXUP_ENTRYPOINT: + case FIXUP_ARGPTR_LO: + case FIXUP_ARGPTR_HI: + case FIXUP_ENTRYPOINT_LO: + case FIXUP_ENTRYPOINT_HI: case FIXUP_GIC_CPU_IF: case FIXUP_BOOTREG: case FIXUP_DSB: @@ -1152,9 +1156,13 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_in= fo *info) /* Place the DTB after the initrd in memory with alignment. */ info->dtb_start =3D QEMU_ALIGN_UP(info->initrd_start + initrd_= size, align); - fixupcontext[FIXUP_ARGPTR] =3D info->dtb_start; + fixupcontext[FIXUP_ARGPTR_LO] =3D info->dtb_start; + fixupcontext[FIXUP_ARGPTR_HI] =3D info->dtb_start >> 32; } else { - fixupcontext[FIXUP_ARGPTR] =3D info->loader_start + KERNEL_ARG= S_ADDR; + fixupcontext[FIXUP_ARGPTR_LO] =3D + info->loader_start + KERNEL_ARGS_ADDR; + fixupcontext[FIXUP_ARGPTR_HI] =3D + (info->loader_start + KERNEL_ARGS_ADDR) >> 32; if (info->ram_size >=3D (1ULL << 32)) { error_report("RAM size must be less than 4GB to boot" " Linux kernel using ATAGS (try passing a dev= ice tree" @@ -1162,7 +1170,8 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_inf= o *info) exit(1); } } - fixupcontext[FIXUP_ENTRYPOINT] =3D entry; + fixupcontext[FIXUP_ENTRYPOINT_LO] =3D entry; + fixupcontext[FIXUP_ENTRYPOINT_HI] =3D entry >> 32; =20 write_bootloader("bootloader", info->loader_start, primary_loader, fixupcontext, as); --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713160392334.6094507077464; Thu, 13 Dec 2018 06:59:20 -0800 (PST) Received: from localhost ([::1]:53091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSSJ-0008AQ-Ku for importer@patchew.org; Thu, 13 Dec 2018 09:59:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSO2-0003vD-98 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSO1-0006zK-4c for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:50 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSO0-0006w2-TY for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:49 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSNz-0007Fd-Eo for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:47 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:11 +0000 Message-Id: <20181213145445.17935-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 03/37] musicpal: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in mv88w8618_wlan_class_init(). Cc: jan.kiszka@web.de Cc: peter.maydell@linaro.org Cc: qemu-arm@nongnu.org Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-2-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/arm/musicpal.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 726ae29394e..d22532a11c8 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1147,14 +1147,13 @@ static const MemoryRegionOps mv88w8618_wlan_ops =3D= { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static int mv88w8618_wlan_init(SysBusDevice *dev) +static void mv88w8618_wlan_realize(DeviceState *dev, Error **errp) { MemoryRegion *iomem =3D g_new(MemoryRegion, 1); =20 memory_region_init_io(iomem, OBJECT(dev), &mv88w8618_wlan_ops, NULL, "musicpal-wlan", MP_WLAN_SIZE); - sysbus_init_mmio(dev, iomem); - return 0; + sysbus_init_mmio(SYS_BUS_DEVICE(dev), iomem); } =20 /* GPIO register offsets */ @@ -1720,9 +1719,9 @@ DEFINE_MACHINE("musicpal", musicpal_machine_init) =20 static void mv88w8618_wlan_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc =3D SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - sdc->init =3D mv88w8618_wlan_init; + dc->realize =3D mv88w8618_wlan_realize; } =20 static const TypeInfo mv88w8618_wlan_info =3D { --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713341670160.2573307451123; Thu, 13 Dec 2018 07:02:21 -0800 (PST) Received: from localhost ([::1]:53114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSVI-0002En-AU for importer@patchew.org; Thu, 13 Dec 2018 10:02:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSO3-0003wH-7h for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSO2-00070x-98 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:51 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSO1-0006w2-VW for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:50 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO0-0007Fr-3W for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:48 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:12 +0000 Message-Id: <20181213145445.17935-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 04/37] block/noenand: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in onenand_class_init(). Cc: kwolf@redhat.com Cc: mreitz@redhat.com Cc: qemu-block@nongnu.org Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-3-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/block/onenand.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/block/onenand.c b/hw/block/onenand.c index 2b48609776d..f11118a6876 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -772,9 +772,9 @@ static const MemoryRegionOps onenand_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static int onenand_initfn(SysBusDevice *sbd) +static void onenand_realize(DeviceState *dev, Error **errp) { - DeviceState *dev =3D DEVICE(sbd); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); OneNANDState *s =3D ONE_NAND(dev); uint32_t size =3D 1 << (24 + ((s->id.dev >> 4) & 7)); void *ram; @@ -794,14 +794,14 @@ static int onenand_initfn(SysBusDevice *sbd) 0xff, size + (size >> 5)); } else { if (blk_is_read_only(s->blk)) { - error_report("Can't use a read-only drive"); - return -1; + error_setg(errp, "Can't use a read-only drive"); + return; } blk_set_perm(s->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE, BLK_PERM_ALL, &local_err); if (local_err) { - error_report_err(local_err); - return -1; + error_propagate(errp, local_err); + return; } s->blk_cur =3D s->blk; } @@ -826,7 +826,6 @@ static int onenand_initfn(SysBusDevice *sbd) | ((s->id.dev & 0xff) << 8) | (s->id.ver & 0xff), &vmstate_onenand, s); - return 0; } =20 static Property onenand_properties[] =3D { @@ -841,9 +840,8 @@ static Property onenand_properties[] =3D { static void onenand_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D onenand_initfn; + dc->realize =3D onenand_realize; dc->reset =3D onenand_system_reset; dc->props =3D onenand_properties; } --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713163770751.1962780493773; Thu, 13 Dec 2018 06:59:23 -0800 (PST) Received: from localhost ([::1]:53093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSSQ-0008JC-OR for importer@patchew.org; Thu, 13 Dec 2018 09:59:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSO2-0003vc-QS for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSO1-00070O-SX for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:50 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSO1-0006zA-Iv for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:49 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO0-0007G8-LD for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:48 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:13 +0000 Message-Id: <20181213145445.17935-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 05/37] char/grlib_apbuart: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in grlib_apbuart_class_init(). Cc: chouteau@adacore.com Cc: marcandre.lureau@redhat.com Cc: pbonzini@redhat.com Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-4-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/char/grlib_apbuart.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c index bac11bec58d..e1d258b6112 100644 --- a/hw/char/grlib_apbuart.c +++ b/hw/char/grlib_apbuart.c @@ -239,9 +239,10 @@ static const MemoryRegionOps grlib_apbuart_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static int grlib_apbuart_init(SysBusDevice *dev) +static void grlib_apbuart_realize(DeviceState *dev, Error **errp) { UART *uart =3D GRLIB_APB_UART(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 qemu_chr_fe_set_handlers(&uart->chr, grlib_apbuart_can_receive, @@ -249,14 +250,12 @@ static int grlib_apbuart_init(SysBusDevice *dev) grlib_apbuart_event, NULL, uart, NULL, true); =20 - sysbus_init_irq(dev, &uart->irq); + sysbus_init_irq(sbd, &uart->irq); =20 memory_region_init_io(&uart->iomem, OBJECT(uart), &grlib_apbuart_ops, = uart, "uart", UART_REG_SIZE); =20 - sysbus_init_mmio(dev, &uart->iomem); - - return 0; + sysbus_init_mmio(sbd, &uart->iomem); } =20 static void grlib_apbuart_reset(DeviceState *d) @@ -280,9 +279,8 @@ static Property grlib_apbuart_properties[] =3D { static void grlib_apbuart_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D grlib_apbuart_init; + dc->realize =3D grlib_apbuart_realize; dc->reset =3D grlib_apbuart_reset; dc->props =3D grlib_apbuart_properties; } --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713008813313.8570369568778; Thu, 13 Dec 2018 06:56:48 -0800 (PST) Received: from localhost ([::1]:53074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSPv-0005Jg-PN for importer@patchew.org; Thu, 13 Dec 2018 09:56:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSO4-0003z7-JJ for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSO3-00072y-DW for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:52 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSO3-0006w2-30 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:51 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO1-0007GM-65 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:49 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:14 +0000 Message-Id: <20181213145445.17935-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 06/37] core/empty_slot: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in empty_slot_class_init(). Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-5-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/core/empty_slot.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/core/empty_slot.c b/hw/core/empty_slot.c index c1b9c2b1041..239f78e2a77 100644 --- a/hw/core/empty_slot.c +++ b/hw/core/empty_slot.c @@ -71,21 +71,20 @@ void empty_slot_init(hwaddr addr, uint64_t slot_size) } } =20 -static int empty_slot_init1(SysBusDevice *dev) +static void empty_slot_realize(DeviceState *dev, Error **errp) { EmptySlot *s =3D EMPTY_SLOT(dev); =20 memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s, "empty-slot", s->size); - sysbus_init_mmio(dev, &s->iomem); - return 0; + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); } =20 static void empty_slot_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - k->init =3D empty_slot_init1; + dc->realize =3D empty_slot_realize; } =20 static const TypeInfo empty_slot_info =3D { --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713421916382.58088885603854; Thu, 13 Dec 2018 07:03:41 -0800 (PST) Received: from localhost ([::1]:53116 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSWa-0003WV-FQ for importer@patchew.org; Thu, 13 Dec 2018 10:03:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSO5-0003zs-8T for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSO3-000724-03 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:53 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSO2-0006zA-Ld for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:50 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO1-0007Ge-NC for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:49 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:15 +0000 Message-Id: <20181213145445.17935-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 07/37] display/g364fb: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in g364fb_sysbus_class_init(). Cc: pbonzini@redhat.com Cc: kraxel@redhat.com Cc: f4bug@amsat.org Cc: alistair.francis@wdc.com Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-6-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/display/g364fb.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c index 8ad7e5d8242..3407adf98d2 100644 --- a/hw/display/g364fb.c +++ b/hw/display/g364fb.c @@ -489,18 +489,16 @@ typedef struct { G364State g364; } G364SysBusState; =20 -static int g364fb_sysbus_init(SysBusDevice *sbd) +static void g364fb_sysbus_realize(DeviceState *dev, Error **errp) { - DeviceState *dev =3D DEVICE(sbd); G364SysBusState *sbs =3D G364(dev); G364State *s =3D &sbs->g364; + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 g364fb_init(dev, s); sysbus_init_irq(sbd, &s->irq); sysbus_init_mmio(sbd, &s->mem_ctrl); sysbus_init_mmio(sbd, &s->mem_vram); - - return 0; } =20 static void g364fb_sysbus_reset(DeviceState *d) @@ -518,9 +516,8 @@ static Property g364fb_sysbus_properties[] =3D { static void g364fb_sysbus_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D g364fb_sysbus_init; + dc->realize =3D g364fb_sysbus_realize; set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->desc =3D "G364 framebuffer"; dc->reset =3D g364fb_sysbus_reset; --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713230624308.4000986723039; Thu, 13 Dec 2018 07:00:30 -0800 (PST) Received: from localhost ([::1]:53094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSTV-0000pe-DO for importer@patchew.org; Thu, 13 Dec 2018 10:00:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSO5-0003zb-5B for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSO3-00073L-L0 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:52 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSO3-00071P-C3 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:51 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO2-0007Gu-9J for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:50 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:16 +0000 Message-Id: <20181213145445.17935-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 08/37] dma/puv3_dma: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in puv3_dma_class_init(). Cc: gxt@mprc.pku.edu.cn Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-7-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/dma/puv3_dma.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/dma/puv3_dma.c b/hw/dma/puv3_dma.c index b97a6c1767c..c89eade0292 100644 --- a/hw/dma/puv3_dma.c +++ b/hw/dma/puv3_dma.c @@ -76,7 +76,7 @@ static const MemoryRegionOps puv3_dma_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static int puv3_dma_init(SysBusDevice *dev) +static void puv3_dma_realize(DeviceState *dev, Error **errp) { PUV3DMAState *s =3D PUV3_DMA(dev); int i; @@ -87,16 +87,14 @@ static int puv3_dma_init(SysBusDevice *dev) =20 memory_region_init_io(&s->iomem, OBJECT(s), &puv3_dma_ops, s, "puv3_dm= a", PUV3_REGS_OFFSET); - sysbus_init_mmio(dev, &s->iomem); - - return 0; + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); } =20 static void puv3_dma_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc =3D SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - sdc->init =3D puv3_dma_init; + dc->realize =3D puv3_dma_realize; } =20 static const TypeInfo puv3_dma_info =3D { --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713164653483.90947832543577; Thu, 13 Dec 2018 06:59:24 -0800 (PST) Received: from localhost ([::1]:53092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSSR-0008Ii-GW for importer@patchew.org; Thu, 13 Dec 2018 09:59:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSO5-000407-Fl for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSO4-00074Q-Hl for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:53 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSO4-0006w2-7L for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:52 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO2-0007HC-QL for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:50 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:17 +0000 Message-Id: <20181213145445.17935-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 09/37] gpio/puv3_gpio: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in puv3_gpio_class_init(). Cc: gxt@mprc.pku.edu.cn Cc: peter.maydell@linaro.org Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-8-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/gpio/puv3_gpio.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/hw/gpio/puv3_gpio.c b/hw/gpio/puv3_gpio.c index 445afccf9f5..33241b8564c 100644 --- a/hw/gpio/puv3_gpio.c +++ b/hw/gpio/puv3_gpio.c @@ -99,36 +99,35 @@ static const MemoryRegionOps puv3_gpio_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static int puv3_gpio_init(SysBusDevice *dev) +static void puv3_gpio_realize(DeviceState *dev, Error **errp) { PUV3GPIOState *s =3D PUV3_GPIO(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 s->reg_GPLR =3D 0; s->reg_GPDR =3D 0; =20 /* FIXME: these irqs not handled yet */ - sysbus_init_irq(dev, &s->irq[PUV3_IRQS_GPIOLOW0]); - sysbus_init_irq(dev, &s->irq[PUV3_IRQS_GPIOLOW1]); - sysbus_init_irq(dev, &s->irq[PUV3_IRQS_GPIOLOW2]); - sysbus_init_irq(dev, &s->irq[PUV3_IRQS_GPIOLOW3]); - sysbus_init_irq(dev, &s->irq[PUV3_IRQS_GPIOLOW4]); - sysbus_init_irq(dev, &s->irq[PUV3_IRQS_GPIOLOW5]); - sysbus_init_irq(dev, &s->irq[PUV3_IRQS_GPIOLOW6]); - sysbus_init_irq(dev, &s->irq[PUV3_IRQS_GPIOLOW7]); - sysbus_init_irq(dev, &s->irq[PUV3_IRQS_GPIOHIGH]); + sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW0]); + sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW1]); + sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW2]); + sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW3]); + sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW4]); + sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW5]); + sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW6]); + sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW7]); + sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOHIGH]); =20 memory_region_init_io(&s->iomem, OBJECT(s), &puv3_gpio_ops, s, "puv3_g= pio", PUV3_REGS_OFFSET); - sysbus_init_mmio(dev, &s->iomem); - - return 0; + sysbus_init_mmio(sbd, &s->iomem); } =20 static void puv3_gpio_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc =3D SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - sdc->init =3D puv3_gpio_init; + dc->realize =3D puv3_gpio_realize; } =20 static const TypeInfo puv3_gpio_info =3D { --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713336515809.215410821566; Thu, 13 Dec 2018 07:02:16 -0800 (PST) Received: from localhost ([::1]:53113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSVD-00029N-B5 for importer@patchew.org; Thu, 13 Dec 2018 10:02:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSO5-00040Z-RS for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSO4-00074s-QU for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:53 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSO4-00071P-Ij for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:52 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO3-0007HS-Bd for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:51 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:18 +0000 Message-Id: <20181213145445.17935-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 10/37] milkymist-softusb: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in milkymist_softusb_class_init(). Cc: michael@walle.cc Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-9-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/input/milkymist-softusb.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/input/milkymist-softusb.c b/hw/input/milkymist-softusb.c index ef8f47cd834..8766a17d9e0 100644 --- a/hw/input/milkymist-softusb.c +++ b/hw/input/milkymist-softusb.c @@ -245,32 +245,31 @@ static void milkymist_softusb_reset(DeviceState *d) s->regs[R_CTRL] =3D CTRL_RESET; } =20 -static int milkymist_softusb_init(SysBusDevice *dev) +static void milkymist_softusb_realize(DeviceState *dev, Error **errp) { MilkymistSoftUsbState *s =3D MILKYMIST_SOFTUSB(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 - sysbus_init_irq(dev, &s->irq); + sysbus_init_irq(sbd, &s->irq); =20 memory_region_init_io(&s->regs_region, OBJECT(s), &softusb_mmio_ops, s, "milkymist-softusb", R_MAX * 4); - sysbus_init_mmio(dev, &s->regs_region); + sysbus_init_mmio(sbd, &s->regs_region); =20 /* register pmem and dmem */ memory_region_init_ram_nomigrate(&s->pmem, OBJECT(s), "milkymist-softu= sb.pmem", s->pmem_size, &error_fatal); vmstate_register_ram_global(&s->pmem); s->pmem_ptr =3D memory_region_get_ram_ptr(&s->pmem); - sysbus_init_mmio(dev, &s->pmem); + sysbus_init_mmio(sbd, &s->pmem); memory_region_init_ram_nomigrate(&s->dmem, OBJECT(s), "milkymist-softu= sb.dmem", s->dmem_size, &error_fatal); vmstate_register_ram_global(&s->dmem); s->dmem_ptr =3D memory_region_get_ram_ptr(&s->dmem); - sysbus_init_mmio(dev, &s->dmem); + sysbus_init_mmio(sbd, &s->dmem); =20 hid_init(&s->hid_kbd, HID_KEYBOARD, softusb_kbd_hid_datain); hid_init(&s->hid_mouse, HID_MOUSE, softusb_mouse_hid_datain); - - return 0; } =20 static const VMStateDescription vmstate_milkymist_softusb =3D { @@ -296,9 +295,8 @@ static Property milkymist_softusb_properties[] =3D { static void milkymist_softusb_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D milkymist_softusb_init; + dc->realize =3D milkymist_softusb_realize; dc->reset =3D milkymist_softusb_reset; dc->vmsd =3D &vmstate_milkymist_softusb; dc->props =3D milkymist_softusb_properties; --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713346531878.944821924195; Thu, 13 Dec 2018 07:02:26 -0800 (PST) Received: from localhost ([::1]:53115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSVN-0002KG-CR for importer@patchew.org; Thu, 13 Dec 2018 10:02:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOL-0004G0-Dm for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOF-0007IJ-GK for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:09 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOF-000747-7R for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:03 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO4-0007Hm-12 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:52 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:19 +0000 Message-Id: <20181213145445.17935-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 11/37] input/pl050: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in pl050_class_init(). Cc: peter.maydell@linaro.org Cc: qemu-arm@nongnu.org Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-10-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/input/pl050.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index be9cd57b177..15bffbfcadb 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -139,19 +139,19 @@ static const MemoryRegionOps pl050_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static int pl050_initfn(SysBusDevice *dev) +static void pl050_realize(DeviceState *dev, Error **errp) { PL050State *s =3D PL050(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 memory_region_init_io(&s->iomem, OBJECT(s), &pl050_ops, s, "pl050", 0x= 1000); - sysbus_init_mmio(dev, &s->iomem); - sysbus_init_irq(dev, &s->irq); + sysbus_init_mmio(sbd, &s->iomem); + sysbus_init_irq(sbd, &s->irq); if (s->is_mouse) { s->dev =3D ps2_mouse_init(pl050_update, s); } else { s->dev =3D ps2_kbd_init(pl050_update, s); } - return 0; } =20 static void pl050_keyboard_init(Object *obj) @@ -183,9 +183,8 @@ static const TypeInfo pl050_mouse_info =3D { static void pl050_class_init(ObjectClass *oc, void *data) { DeviceClass *dc =3D DEVICE_CLASS(oc); - SysBusDeviceClass *sdc =3D SYS_BUS_DEVICE_CLASS(oc); =20 - sdc->init =3D pl050_initfn; + dc->realize =3D pl050_realize; dc->vmsd =3D &vmstate_pl050; } =20 --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15447136032731001.1576037133565; Thu, 13 Dec 2018 07:06:43 -0800 (PST) Received: from localhost ([::1]:53136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSZW-0006Iv-3J for importer@patchew.org; Thu, 13 Dec 2018 10:06:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOG-0004B5-G7 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOF-0007Ie-QD for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:04 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOF-00071P-JN for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:03 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO4-0007I4-KE for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:52 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:20 +0000 Message-Id: <20181213145445.17935-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 12/37] intc/puv3_intc: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in puv3_intc_class_init(). Cc: gxt@mprc.pku.edu.cn Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-11-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/intc/puv3_intc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/intc/puv3_intc.c b/hw/intc/puv3_intc.c index ef8488aacc4..69ddc8c19ab 100644 --- a/hw/intc/puv3_intc.c +++ b/hw/intc/puv3_intc.c @@ -101,10 +101,10 @@ static const MemoryRegionOps puv3_intc_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static int puv3_intc_init(SysBusDevice *sbd) +static void puv3_intc_realize(DeviceState *dev, Error **errp) { - DeviceState *dev =3D DEVICE(sbd); PUV3INTCState *s =3D PUV3_INTC(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 qdev_init_gpio_in(dev, puv3_intc_handler, PUV3_IRQS_NR); sysbus_init_irq(sbd, &s->parent_irq); @@ -115,15 +115,12 @@ static int puv3_intc_init(SysBusDevice *sbd) memory_region_init_io(&s->iomem, OBJECT(s), &puv3_intc_ops, s, "puv3_i= ntc", PUV3_REGS_OFFSET); sysbus_init_mmio(sbd, &s->iomem); - - return 0; } =20 static void puv3_intc_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc =3D SYS_BUS_DEVICE_CLASS(klass); - - sdc->init =3D puv3_intc_init; + DeviceClass *dc =3D DEVICE_CLASS(klass); + dc->realize =3D puv3_intc_realize; } =20 static const TypeInfo puv3_intc_info =3D { --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714114561682.7945817445941; Thu, 13 Dec 2018 07:15:14 -0800 (PST) Received: from localhost ([::1]:53185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXShl-00067y-HV for importer@patchew.org; Thu, 13 Dec 2018 10:15:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOH-0004C1-GW for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOG-0007JV-JC for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:05 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOG-0006zA-Bj for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:04 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO5-0007IK-6p for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:53 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:21 +0000 Message-Id: <20181213145445.17935-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 13/37] milkymist-hpdmc: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in milkymist_hpdmc_class_init(). Cc: gxt@mprc.pku.edu.cn Cc: michael@walle.cc Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-12-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/misc/milkymist-hpdmc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/misc/milkymist-hpdmc.c b/hw/misc/milkymist-hpdmc.c index e6140eec6ba..44dc0698ec8 100644 --- a/hw/misc/milkymist-hpdmc.c +++ b/hw/misc/milkymist-hpdmc.c @@ -129,15 +129,13 @@ static void milkymist_hpdmc_reset(DeviceState *d) | IODELAY_PLL2_LOCKED; } =20 -static int milkymist_hpdmc_init(SysBusDevice *dev) +static void milkymist_hpdmc_realize(DeviceState *dev, Error **errp) { MilkymistHpdmcState *s =3D MILKYMIST_HPDMC(dev); =20 memory_region_init_io(&s->regs_region, OBJECT(dev), &hpdmc_mmio_ops, s, "milkymist-hpdmc", R_MAX * 4); - sysbus_init_mmio(dev, &s->regs_region); - - return 0; + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->regs_region); } =20 static const VMStateDescription vmstate_milkymist_hpdmc =3D { @@ -153,9 +151,8 @@ static const VMStateDescription vmstate_milkymist_hpdmc= =3D { static void milkymist_hpdmc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D milkymist_hpdmc_init; + dc->realize =3D milkymist_hpdmc_realize; dc->reset =3D milkymist_hpdmc_reset; dc->vmsd =3D &vmstate_milkymist_hpdmc; } --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714872372694.2276958515404; Thu, 13 Dec 2018 07:27:52 -0800 (PST) Received: from localhost ([::1]:53261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXStz-0008Or-4o for importer@patchew.org; Thu, 13 Dec 2018 10:27:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSPV-0005Qb-Te for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSPV-0000lE-1l for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:21 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSPU-00071P-QK for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:20 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO5-0007IZ-QA for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:53 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:22 +0000 Message-Id: <20181213145445.17935-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 14/37] milkymist-pfpu: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in milkymist_pfpu_class_init(). Cc: michael@walle.cc Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-13-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/misc/milkymist-pfpu.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/misc/milkymist-pfpu.c b/hw/misc/milkymist-pfpu.c index 86f5e383b0f..4a03c7ee637 100644 --- a/hw/misc/milkymist-pfpu.c +++ b/hw/misc/milkymist-pfpu.c @@ -497,17 +497,16 @@ static void milkymist_pfpu_reset(DeviceState *d) } } =20 -static int milkymist_pfpu_init(SysBusDevice *dev) +static void milkymist_pfpu_realize(DeviceState *dev, Error **errp) { MilkymistPFPUState *s =3D MILKYMIST_PFPU(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 - sysbus_init_irq(dev, &s->irq); + sysbus_init_irq(sbd, &s->irq); =20 memory_region_init_io(&s->regs_region, OBJECT(dev), &pfpu_mmio_ops, s, "milkymist-pfpu", MICROCODE_END * 4); - sysbus_init_mmio(dev, &s->regs_region); - - return 0; + sysbus_init_mmio(sbd, &s->regs_region); } =20 static const VMStateDescription vmstate_milkymist_pfpu =3D { @@ -527,9 +526,8 @@ static const VMStateDescription vmstate_milkymist_pfpu = =3D { static void milkymist_pfpu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D milkymist_pfpu_init; + dc->realize =3D milkymist_pfpu_realize; dc->reset =3D milkymist_pfpu_reset; dc->vmsd =3D &vmstate_milkymist_pfpu; } --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15447146603061000.6399014479057; Thu, 13 Dec 2018 07:24:20 -0800 (PST) Received: from localhost ([::1]:53237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSqZ-00059k-6w for importer@patchew.org; Thu, 13 Dec 2018 10:24:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSPU-0005Or-FM for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSPT-0000in-K5 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:20 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSPT-0007J5-9b for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:19 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO6-0007Iq-AW for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:54 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:23 +0000 Message-Id: <20181213145445.17935-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 15/37] puv3_pm.c: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in puv3_pm_class_init(). Cc: gxt@mprc.pku.edu.cn Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-14-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/misc/puv3_pm.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/misc/puv3_pm.c b/hw/misc/puv3_pm.c index 577cebaac78..afe191fbe1f 100644 --- a/hw/misc/puv3_pm.c +++ b/hw/misc/puv3_pm.c @@ -119,7 +119,7 @@ static const MemoryRegionOps puv3_pm_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static int puv3_pm_init(SysBusDevice *dev) +static void puv3_pm_realize(DeviceState *dev, Error **errp) { PUV3PMState *s =3D PUV3_PM(dev); =20 @@ -127,16 +127,14 @@ static int puv3_pm_init(SysBusDevice *dev) =20 memory_region_init_io(&s->iomem, OBJECT(s), &puv3_pm_ops, s, "puv3_pm", PUV3_REGS_OFFSET); - sysbus_init_mmio(dev, &s->iomem); - - return 0; + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); } =20 static void puv3_pm_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc =3D SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - sdc->init =3D puv3_pm_init; + dc->realize =3D puv3_pm_realize; } =20 static const TypeInfo puv3_pm_info =3D { --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714677680249.81719084455858; Thu, 13 Dec 2018 07:24:37 -0800 (PST) Received: from localhost ([::1]:53238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSqn-0005Mx-3u for importer@patchew.org; Thu, 13 Dec 2018 10:24:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSPU-0005P0-J2 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSPT-0000j2-LC for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:20 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSPT-0006zA-Ah for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:19 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO6-0007J4-Qe for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:54 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:24 +0000 Message-Id: <20181213145445.17935-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 16/37] nvram/ds1225y: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in nvram_sysbus_class_init(). Cc: pbonzini@redhat.com Cc: marcandre.lureau@redhat.com Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-15-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/nvram/ds1225y.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/nvram/ds1225y.c b/hw/nvram/ds1225y.c index ad7345f2882..b6ef463db0a 100644 --- a/hw/nvram/ds1225y.c +++ b/hw/nvram/ds1225y.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" #include "trace.h" +#include "qemu/error-report.h" =20 typedef struct { MemoryRegion iomem; @@ -113,7 +114,7 @@ typedef struct { NvRamState nvram; } SysBusNvRamState; =20 -static int nvram_sysbus_initfn(SysBusDevice *dev) +static void nvram_sysbus_realize(DeviceState *dev, Error **errp) { SysBusNvRamState *sys =3D DS1225Y(dev); NvRamState *s =3D &sys->nvram; @@ -123,20 +124,18 @@ static int nvram_sysbus_initfn(SysBusDevice *dev) =20 memory_region_init_io(&s->iomem, OBJECT(s), &nvram_ops, s, "nvram", s->chip_size); - sysbus_init_mmio(dev, &s->iomem); + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); =20 /* Read current file */ file =3D s->filename ? fopen(s->filename, "rb") : NULL; if (file) { /* Read nvram contents */ if (fread(s->contents, s->chip_size, 1, file) !=3D 1) { - printf("nvram_sysbus_initfn: short read\n"); + error_report("nvram_sysbus_realize: short read"); } fclose(file); } nvram_post_load(s, 0); - - return 0; } =20 static Property nvram_sysbus_properties[] =3D { @@ -148,9 +147,8 @@ static Property nvram_sysbus_properties[] =3D { static void nvram_sysbus_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D nvram_sysbus_initfn; + dc->realize =3D nvram_sysbus_realize; dc->vmsd =3D &vmstate_nvram; dc->props =3D nvram_sysbus_properties; } --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714485438973.6416268236184; Thu, 13 Dec 2018 07:21:25 -0800 (PST) Received: from localhost ([::1]:53220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSne-0002eO-Op for importer@patchew.org; Thu, 13 Dec 2018 10:21:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSPS-0005MZ-CR for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSPR-0000eo-FI for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:18 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSPR-000747-6p for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:17 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO7-0007JI-AW for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:55 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:25 +0000 Message-Id: <20181213145445.17935-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 17/37] pci-bridge/dec: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in pci_dec_21154_device_class_init(). Cc: david@gibson.dropbear.id.au Cc: mst@redhat.com Cc: marcel.apfelbaum@gmail.com Cc: qemu-ppc@nongnu.org Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: David Gibson Acked-by: David Gibson Message-id: 20181130093852.20739-16-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/pci-bridge/dec.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c index 84492d5e5f9..8484bfd4345 100644 --- a/hw/pci-bridge/dec.c +++ b/hw/pci-bridge/dec.c @@ -98,9 +98,10 @@ PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn) return pci_bridge_get_sec_bus(br); } =20 -static int pci_dec_21154_device_init(SysBusDevice *dev) +static void pci_dec_21154_device_realize(DeviceState *dev, Error **errp) { PCIHostState *phb; + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 phb =3D PCI_HOST_BRIDGE(dev); =20 @@ -108,9 +109,8 @@ static int pci_dec_21154_device_init(SysBusDevice *dev) dev, "pci-conf-idx", 0x1000); memory_region_init_io(&phb->data_mem, OBJECT(dev), &pci_host_data_le_o= ps, dev, "pci-data-idx", 0x1000); - sysbus_init_mmio(dev, &phb->conf_mem); - sysbus_init_mmio(dev, &phb->data_mem); - return 0; + sysbus_init_mmio(sbd, &phb->conf_mem); + sysbus_init_mmio(sbd, &phb->data_mem); } =20 static void dec_21154_pci_host_realize(PCIDevice *d, Error **errp) @@ -150,9 +150,9 @@ static const TypeInfo dec_21154_pci_host_info =3D { =20 static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc =3D SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - sdc->init =3D pci_dec_21154_device_init; + dc->realize =3D pci_dec_21154_device_realize; } =20 static const TypeInfo pci_dec_21154_device_info =3D { --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544715590728199.34698898986528; Thu, 13 Dec 2018 07:39:50 -0800 (PST) Received: from localhost ([::1]:53350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXT5Z-0002zk-9p for importer@patchew.org; Thu, 13 Dec 2018 10:39:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSPN-0005Hg-2V for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSPJ-0000Uh-II for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:11 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSPJ-00071P-80 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:09 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO7-0007JW-Ql for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:55 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:26 +0000 Message-Id: <20181213145445.17935-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 18/37] timer/etraxfs_timer: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in etraxfs_timer_class_init(). Cc: edgar.iglesias@gmail.com Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Edgar E. Iglesias Message-id: 20181130093852.20739-17-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/timer/etraxfs_timer.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/timer/etraxfs_timer.c b/hw/timer/etraxfs_timer.c index d13bc30b2d6..2280914b1d7 100644 --- a/hw/timer/etraxfs_timer.c +++ b/hw/timer/etraxfs_timer.c @@ -315,9 +315,10 @@ static void etraxfs_timer_reset(void *opaque) qemu_irq_lower(t->irq); } =20 -static int etraxfs_timer_init(SysBusDevice *dev) +static void etraxfs_timer_realize(DeviceState *dev, Error **errp) { ETRAXTimerState *t =3D ETRAX_TIMER(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 t->bh_t0 =3D qemu_bh_new(timer0_hit, t); t->bh_t1 =3D qemu_bh_new(timer1_hit, t); @@ -326,21 +327,20 @@ static int etraxfs_timer_init(SysBusDevice *dev) t->ptimer_t1 =3D ptimer_init(t->bh_t1, PTIMER_POLICY_DEFAULT); t->ptimer_wd =3D ptimer_init(t->bh_wd, PTIMER_POLICY_DEFAULT); =20 - sysbus_init_irq(dev, &t->irq); - sysbus_init_irq(dev, &t->nmi); + sysbus_init_irq(sbd, &t->irq); + sysbus_init_irq(sbd, &t->nmi); =20 memory_region_init_io(&t->mmio, OBJECT(t), &timer_ops, t, "etraxfs-timer", 0x5c); - sysbus_init_mmio(dev, &t->mmio); + sysbus_init_mmio(sbd, &t->mmio); qemu_register_reset(etraxfs_timer_reset, t); - return 0; } =20 static void etraxfs_timer_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc =3D SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - sdc->init =3D etraxfs_timer_init; + dc->realize =3D etraxfs_timer_realize; } =20 static const TypeInfo etraxfs_timer_info =3D { --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714103420517.3825175308275; Thu, 13 Dec 2018 07:15:03 -0800 (PST) Received: from localhost ([::1]:53184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXShZ-0005yb-P4 for importer@patchew.org; Thu, 13 Dec 2018 10:15:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSPJ-0005Ed-Fj for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSPI-0000T1-GS for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:09 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSPI-0007J5-7p for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:08 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO8-0007Jk-Af for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:56 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:27 +0000 Message-Id: <20181213145445.17935-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 19/37] timer/grlib_gptimer: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in grlib_gptimer_class_init(). Cc: chouteau@adacore.com Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-18-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/timer/grlib_gptimer.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/timer/grlib_gptimer.c b/hw/timer/grlib_gptimer.c index 4ed96e970a7..183eddc0737 100644 --- a/hw/timer/grlib_gptimer.c +++ b/hw/timer/grlib_gptimer.c @@ -347,10 +347,11 @@ static void grlib_gptimer_reset(DeviceState *d) } } =20 -static int grlib_gptimer_init(SysBusDevice *dev) +static void grlib_gptimer_realize(DeviceState *dev, Error **errp) { GPTimerUnit *unit =3D GRLIB_GPTIMER(dev); unsigned int i; + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 assert(unit->nr_timers > 0); assert(unit->nr_timers <=3D GPTIMER_MAX_TIMERS); @@ -366,7 +367,7 @@ static int grlib_gptimer_init(SysBusDevice *dev) timer->id =3D i; =20 /* One IRQ line for each timer */ - sysbus_init_irq(dev, &timer->irq); + sysbus_init_irq(sbd, &timer->irq); =20 ptimer_set_freq(timer->ptimer, unit->freq_hz); } @@ -375,8 +376,7 @@ static int grlib_gptimer_init(SysBusDevice *dev) unit, "gptimer", UNIT_REG_SIZE + GPTIMER_REG_SIZE * unit->nr_time= rs); =20 - sysbus_init_mmio(dev, &unit->iomem); - return 0; + sysbus_init_mmio(sbd, &unit->iomem); } =20 static Property grlib_gptimer_properties[] =3D { @@ -389,9 +389,8 @@ static Property grlib_gptimer_properties[] =3D { static void grlib_gptimer_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D grlib_gptimer_init; + dc->realize =3D grlib_gptimer_realize; dc->reset =3D grlib_gptimer_reset; dc->props =3D grlib_gptimer_properties; } --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714296061389.84560321676224; Thu, 13 Dec 2018 07:18:16 -0800 (PST) Received: from localhost ([::1]:53203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSkg-0008NX-UB for importer@patchew.org; Thu, 13 Dec 2018 10:18:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSPJ-0005EW-Bl for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSPI-0000Sq-Ey for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:09 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSPI-0006zA-5y for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:08 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO8-0007Jy-Qm for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:56 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:28 +0000 Message-Id: <20181213145445.17935-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 20/37] timer/puv3_ost: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in puv3_ost_class_init(). Cc: gxt@mprc.pku.edu.cn Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20181130093852.20739-19-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/timer/puv3_ost.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/timer/puv3_ost.c b/hw/timer/puv3_ost.c index 0b3d717e608..3be58c7fdd7 100644 --- a/hw/timer/puv3_ost.c +++ b/hw/timer/puv3_ost.c @@ -113,16 +113,17 @@ static void puv3_ost_tick(void *opaque) } } =20 -static int puv3_ost_init(SysBusDevice *dev) +static void puv3_ost_realize(DeviceState *dev, Error **errp) { PUV3OSTState *s =3D PUV3_OST(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 s->reg_OIER =3D 0; s->reg_OSSR =3D 0; s->reg_OSMR0 =3D 0; s->reg_OSCR =3D 0; =20 - sysbus_init_irq(dev, &s->irq); + sysbus_init_irq(sbd, &s->irq); =20 s->bh =3D qemu_bh_new(puv3_ost_tick, s); s->ptimer =3D ptimer_init(s->bh, PTIMER_POLICY_DEFAULT); @@ -130,16 +131,14 @@ static int puv3_ost_init(SysBusDevice *dev) =20 memory_region_init_io(&s->iomem, OBJECT(s), &puv3_ost_ops, s, "puv3_os= t", PUV3_REGS_OFFSET); - sysbus_init_mmio(dev, &s->iomem); - - return 0; + sysbus_init_mmio(sbd, &s->iomem); } =20 static void puv3_ost_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc =3D SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - sdc->init =3D puv3_ost_init; + dc->realize =3D puv3_ost_realize; } =20 static const TypeInfo puv3_ost_info =3D { --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713900838442.9465283876999; Thu, 13 Dec 2018 07:11:40 -0800 (PST) Received: from localhost ([::1]:53168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSeJ-0002Yu-MB for importer@patchew.org; Thu, 13 Dec 2018 10:11:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSPP-0005Jb-3K for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSPG-0000Pz-60 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:13 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSPF-000747-So for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:06 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO9-0007KC-Am for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:57 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:29 +0000 Message-Id: <20181213145445.17935-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 21/37] usb/tusb6010: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in tusb6010_class_init(). Cc: kraxel@redhat.com Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Message-id: 20181130093852.20739-20-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/usb/tusb6010.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c index a2128024c11..501706e2b29 100644 --- a/hw/usb/tusb6010.c +++ b/hw/usb/tusb6010.c @@ -808,10 +808,10 @@ static void tusb6010_reset(DeviceState *dev) musb_reset(s->musb); } =20 -static int tusb6010_init(SysBusDevice *sbd) +static void tusb6010_realize(DeviceState *dev, Error **errp) { - DeviceState *dev =3D DEVICE(sbd); TUSBState *s =3D TUSB(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 s->otg_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, tusb_otg_tick, s); s->pwr_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, tusb_power_tick, s); @@ -822,15 +822,13 @@ static int tusb6010_init(SysBusDevice *sbd) sysbus_init_irq(sbd, &s->irq); qdev_init_gpio_in(dev, tusb6010_irq, musb_irq_max + 1); s->musb =3D musb_init(dev, 1); - return 0; } =20 static void tusb6010_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D tusb6010_init; + dc->realize =3D tusb6010_realize; dc->reset =3D tusb6010_reset; } =20 --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 154471546672696.44141800833972; Thu, 13 Dec 2018 07:37:46 -0800 (PST) Received: from localhost ([::1]:53334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXT3T-0000gC-GB for importer@patchew.org; Thu, 13 Dec 2018 10:37:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSP9-00055q-Cz for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSP8-00008f-FV for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:59 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSP8-00071P-7R for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:58 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO9-0007KQ-RI for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:57 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:30 +0000 Message-Id: <20181213145445.17935-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 22/37] xen_backend: remove xen_sysdev_init() function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Mao Zhongyi The init function doesn't do anything at all, so we just omit it. Cc: sstabellini@kernel.org Cc: anthony.perard@citrix.com Cc: xen-devel@lists.xenproject.org Cc: peter.maydell@linaro.org Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Acked-by: Anthony PERARD Message-id: 20181130093852.20739-21-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/xen/xen_backend.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index 9a8e8771eca..0bc6b1de60f 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -809,11 +809,6 @@ static const TypeInfo xensysbus_info =3D { } }; =20 -static int xen_sysdev_init(SysBusDevice *dev) -{ - return 0; -} - static Property xen_sysdev_properties[] =3D { {/* end of property list */}, }; @@ -821,9 +816,7 @@ static Property xen_sysdev_properties[] =3D { static void xen_sysdev_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D xen_sysdev_init; dc->props =3D xen_sysdev_properties; dc->bus_type =3D TYPE_XENSYSBUS; } --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713870088645.0775821164272; Thu, 13 Dec 2018 07:11:10 -0800 (PST) Received: from localhost ([::1]:53167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSdm-00025v-14 for importer@patchew.org; Thu, 13 Dec 2018 10:11:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSP7-000541-Jk for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSP6-0008Us-HR for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:57 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSP6-0006zA-8Q for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:56 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOA-0007Ke-B8 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:58 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:31 +0000 Message-Id: <20181213145445.17935-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 23/37] core/sysbus: remove the SysBusDeviceClass::init path X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Mao Zhongyi Currently, all sysbus devices have been converted to realize(), so remove this path. Cc: ehabkost@redhat.com Cc: thuth@redhat.com Cc: pbonzini@redhat.com Cc: armbru@redhat.com Cc: peter.maydell@linaro.org Cc: richard.henderson@linaro.org Cc: alistair.francis@wdc.com Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Message-id: 20181130093852.20739-22-maozhongyi@cmss.chinamobile.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- include/hw/sysbus.h | 3 --- hw/core/sysbus.c | 15 +++++---------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 0b59a3b8d60..1aedcf05c92 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -38,9 +38,6 @@ typedef struct SysBusDevice SysBusDevice; typedef struct SysBusDeviceClass { /*< private >*/ DeviceClass parent_class; - /*< public >*/ - - int (*init)(SysBusDevice *dev); =20 /* * Let the sysbus device format its own non-PIO, non-MMIO unit address. diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 7ac36ad3e70..9f9edbcab96 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -201,18 +201,13 @@ void sysbus_init_ioports(SysBusDevice *dev, uint32_t = ioport, uint32_t size) } } =20 -/* TODO remove once all sysbus devices have been converted to realize */ +/* The purpose of preserving this empty realize function + * is to prevent the parent_realize field of some subclasses + * from being set to NULL to break the normal init/realize + * of some devices. + */ static void sysbus_realize(DeviceState *dev, Error **errp) { - SysBusDevice *sd =3D SYS_BUS_DEVICE(dev); - SysBusDeviceClass *sbc =3D SYS_BUS_DEVICE_GET_CLASS(sd); - - if (!sbc->init) { - return; - } - if (sbc->init(sd) < 0) { - error_setg(errp, "Device initialization failed"); - } } =20 DeviceState *sysbus_create_varargs(const char *name, --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714494200678.0573812051357; Thu, 13 Dec 2018 07:21:34 -0800 (PST) Received: from localhost ([::1]:53222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSnt-0002p9-4e for importer@patchew.org; Thu, 13 Dec 2018 10:21:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSP9-00055U-0s for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSP7-00005m-6m for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:58 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSP6-0007J5-U0 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:57 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOA-0007Ks-R9 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:58 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:32 +0000 Message-Id: <20181213145445.17935-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 24/37] hw/arm: versal: Remove bogus virtio-mmio creation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Remove bogus virtio-mmio creation. This was an accidental left-over an experiment. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Message-id: 20181129163655.20370-2-edgar.iglesias@gmail.com Signed-off-by: Peter Maydell --- hw/arm/xlnx-versal-virt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index 1e31a3f4429..41b8d801c89 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -364,7 +364,6 @@ static void create_virtio_regions(VersalVirt *s) sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic_irq); mr =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0); memory_region_add_subregion(&s->soc.mr_ps, base, mr); - sysbus_create_simple("virtio-mmio", base, pic_irq); } =20 for (i =3D 0; i < NUM_VIRTIO_TRANSPORT; i++) { --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 154471532094461.71073598833084; Thu, 13 Dec 2018 07:35:20 -0800 (PST) Received: from localhost ([::1]:53306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXT1D-00073J-CF for importer@patchew.org; Thu, 13 Dec 2018 10:35:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSP5-000524-Eo for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSP4-0008SP-OF for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:55 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSP4-000747-FB for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:54 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOB-0007L6-Ar for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:59 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:33 +0000 Message-Id: <20181213145445.17935-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 25/37] hw/arm: versal: Reduce number of virtio-mmio instances X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Reduce number of virtio-mmio instances. This is in preparation for correcting the interrupt setup for Versal. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Message-id: 20181129163655.20370-3-edgar.iglesias@gmail.com Signed-off-by: Peter Maydell --- hw/arm/xlnx-versal-virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index 41b8d801c89..2ed6ee9934d 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -342,7 +342,7 @@ static void *versal_virt_get_dtb(const struct arm_boot_= info *binfo, return board->fdt; } =20 -#define NUM_VIRTIO_TRANSPORT 32 +#define NUM_VIRTIO_TRANSPORT 8 static void create_virtio_regions(VersalVirt *s) { int virtio_mmio_size =3D 0x200; --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 154471516555321.40812912947206; Thu, 13 Dec 2018 07:32:45 -0800 (PST) Received: from localhost ([::1]:53294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSyi-0004ni-AE for importer@patchew.org; Thu, 13 Dec 2018 10:32:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSP0-0004vH-4b for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOw-0008HM-AY for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:48 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOu-00071P-Cn for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:44 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOB-0007LK-R0 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:59 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:34 +0000 Message-Id: <20181213145445.17935-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 26/37] hw/arm: versal: Use IRQs 111 - 118 for virtio-mmio X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Use IRQs 111 - 118 for virtio-mmio. The interrupts we're currently using 160+ are not available in the Versal GIC. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Message-id: 20181129163655.20370-4-edgar.iglesias@gmail.com Signed-off-by: Peter Maydell --- include/hw/arm/xlnx-versal.h | 6 +++--- hw/arm/xlnx-versal-virt.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h index 9da621e4b68..76fb9de3918 100644 --- a/include/hw/arm/xlnx-versal.h +++ b/include/hw/arm/xlnx-versal.h @@ -75,9 +75,9 @@ typedef struct Versal { #define VERSAL_GEM1_IRQ_0 58 #define VERSAL_GEM1_WAKE_IRQ_0 59 =20 -/* Architecturally eserved IRQs suitable for virtualization. */ -#define VERSAL_RSVD_HIGH_IRQ_FIRST 160 -#define VERSAL_RSVD_HIGH_IRQ_LAST 255 +/* Architecturally reserved IRQs suitable for virtualization. */ +#define VERSAL_RSVD_IRQ_FIRST 111 +#define VERSAL_RSVD_IRQ_LAST 118 =20 #define MM_TOP_RSVD 0xa0000000U #define MM_TOP_RSVD_SIZE 0x4000000 diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index 2ed6ee9934d..c6feeac532f 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -351,7 +351,7 @@ static void create_virtio_regions(VersalVirt *s) for (i =3D 0; i < NUM_VIRTIO_TRANSPORT; i++) { char *name =3D g_strdup_printf("virtio%d", i);; hwaddr base =3D MM_TOP_RSVD + i * virtio_mmio_size; - int irq =3D VERSAL_RSVD_HIGH_IRQ_FIRST + i; + int irq =3D VERSAL_RSVD_IRQ_FIRST + i; MemoryRegion *mr; DeviceState *dev; qemu_irq pic_irq; @@ -368,7 +368,7 @@ static void create_virtio_regions(VersalVirt *s) =20 for (i =3D 0; i < NUM_VIRTIO_TRANSPORT; i++) { hwaddr base =3D MM_TOP_RSVD + i * virtio_mmio_size; - int irq =3D VERSAL_RSVD_HIGH_IRQ_FIRST + i; + int irq =3D VERSAL_RSVD_IRQ_FIRST + i; char *name =3D g_strdup_printf("/virtio_mmio@%" PRIx64, base); =20 qemu_fdt_add_subnode(s->fdt, name); --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713697703984.2483968112938; Thu, 13 Dec 2018 07:08:17 -0800 (PST) Received: from localhost ([::1]:53147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSb2-0007SR-Ib for importer@patchew.org; Thu, 13 Dec 2018 10:08:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOy-0004tL-6m for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOu-0008FG-Hd for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:46 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOs-0006zA-HN for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:44 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOC-0007LY-At for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:55:00 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:35 +0000 Message-Id: <20181213145445.17935-28-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 27/37] hw/arm: versal: Correct the nr of IRQs to 192 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Correct the nr of IRQs to 192. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Message-id: 20181129163655.20370-5-edgar.iglesias@gmail.com Signed-off-by: Peter Maydell --- include/hw/arm/xlnx-versal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h index 76fb9de3918..ec7c859d08c 100644 --- a/include/hw/arm/xlnx-versal.h +++ b/include/hw/arm/xlnx-versal.h @@ -22,7 +22,7 @@ #define XLNX_VERSAL_NR_ACPUS 2 #define XLNX_VERSAL_NR_UARTS 2 #define XLNX_VERSAL_NR_GEMS 2 -#define XLNX_VERSAL_NR_IRQS 256 +#define XLNX_VERSAL_NR_IRQS 192 =20 typedef struct Versal { /*< private >*/ --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544715007064937.2371858255923; Thu, 13 Dec 2018 07:30:07 -0800 (PST) Received: from localhost ([::1]:53277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSw9-0002oj-CJ for importer@patchew.org; Thu, 13 Dec 2018 10:30:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOy-0004tP-8W for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOu-0008F6-Gx for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:46 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOs-0007J5-Ei for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:42 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOC-0007Lm-Qu for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:55:00 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:36 +0000 Message-Id: <20181213145445.17935-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 28/37] target/arm: Move id_aa64mmfr* to ARMISARegisters X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" At the same time, define the fields for these registers, and use those defines in arm_pamax(). Signed-off-by: Richard Henderson Message-id: 20181203203839.757-2-richard.henderson@linaro.org Reviewed-by: Peter Maydell [PMM: fixed up typo (s/achf/ahcf/) belatedly spotted by RTH] Signed-off-by: Peter Maydell --- target/arm/cpu.h | 26 ++++++++++++++++++++++++-- target/arm/internals.h | 3 ++- target/arm/cpu64.c | 6 +++--- target/arm/helper.c | 4 ++-- target/arm/kvm64.c | 4 ++++ 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 2a73fed9a01..656a96a8f8f 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -818,6 +818,8 @@ struct ARMCPU { uint64_t id_aa64isar1; uint64_t id_aa64pfr0; uint64_t id_aa64pfr1; + uint64_t id_aa64mmfr0; + uint64_t id_aa64mmfr1; } isar; uint32_t midr; uint32_t revidr; @@ -839,8 +841,6 @@ struct ARMCPU { uint64_t id_aa64dfr1; uint64_t id_aa64afr0; uint64_t id_aa64afr1; - uint64_t id_aa64mmfr0; - uint64_t id_aa64mmfr1; uint32_t dbgdidr; uint32_t clidr; uint64_t mp_affinity; /* MP ID without feature bits */ @@ -1557,6 +1557,28 @@ FIELD(ID_AA64PFR0, GIC, 24, 4) FIELD(ID_AA64PFR0, RAS, 28, 4) FIELD(ID_AA64PFR0, SVE, 32, 4) =20 +FIELD(ID_AA64MMFR0, PARANGE, 0, 4) +FIELD(ID_AA64MMFR0, ASIDBITS, 4, 4) +FIELD(ID_AA64MMFR0, BIGEND, 8, 4) +FIELD(ID_AA64MMFR0, SNSMEM, 12, 4) +FIELD(ID_AA64MMFR0, BIGENDEL0, 16, 4) +FIELD(ID_AA64MMFR0, TGRAN16, 20, 4) +FIELD(ID_AA64MMFR0, TGRAN64, 24, 4) +FIELD(ID_AA64MMFR0, TGRAN4, 28, 4) +FIELD(ID_AA64MMFR0, TGRAN16_2, 32, 4) +FIELD(ID_AA64MMFR0, TGRAN64_2, 36, 4) +FIELD(ID_AA64MMFR0, TGRAN4_2, 40, 4) +FIELD(ID_AA64MMFR0, EXS, 44, 4) + +FIELD(ID_AA64MMFR1, HAFDBS, 0, 4) +FIELD(ID_AA64MMFR1, VMIDBITS, 4, 4) +FIELD(ID_AA64MMFR1, VH, 8, 4) +FIELD(ID_AA64MMFR1, HPDS, 12, 4) +FIELD(ID_AA64MMFR1, LO, 16, 4) +FIELD(ID_AA64MMFR1, PAN, 20, 4) +FIELD(ID_AA64MMFR1, SPECSEI, 24, 4) +FIELD(ID_AA64MMFR1, XNX, 28, 4) + QEMU_BUILD_BUG_ON(ARRAY_SIZE(((ARMCPU *)0)->ccsidr) <=3D R_V7M_CSSELR_INDE= X_MASK); =20 /* If adding a feature bit which corresponds to a Linux ELF diff --git a/target/arm/internals.h b/target/arm/internals.h index d208b70a64f..78e026d6e90 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -229,7 +229,8 @@ static inline unsigned int arm_pamax(ARMCPU *cpu) [4] =3D 44, [5] =3D 48, }; - unsigned int parange =3D extract32(cpu->id_aa64mmfr0, 0, 4); + unsigned int parange =3D + FIELD_EX64(cpu->isar.id_aa64mmfr0, ID_AA64MMFR0, PARANGE); =20 /* id_aa64mmfr0 is a read-only register so values outside of the * supported mappings can be considered an implementation error. */ diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 873f059bf22..0babe483ac2 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -141,7 +141,7 @@ static void aarch64_a57_initfn(Object *obj) cpu->pmceid0 =3D 0x00000000; cpu->pmceid1 =3D 0x00000000; cpu->isar.id_aa64isar0 =3D 0x00011120; - cpu->id_aa64mmfr0 =3D 0x00001124; + cpu->isar.id_aa64mmfr0 =3D 0x00001124; cpu->dbgdidr =3D 0x3516d000; cpu->clidr =3D 0x0a200023; cpu->ccsidr[0] =3D 0x701fe00a; /* 32KB L1 dcache */ @@ -195,7 +195,7 @@ static void aarch64_a53_initfn(Object *obj) cpu->isar.id_aa64pfr0 =3D 0x00002222; cpu->id_aa64dfr0 =3D 0x10305106; cpu->isar.id_aa64isar0 =3D 0x00011120; - cpu->id_aa64mmfr0 =3D 0x00001122; /* 40 bit physical addr */ + cpu->isar.id_aa64mmfr0 =3D 0x00001122; /* 40 bit physical addr */ cpu->dbgdidr =3D 0x3516d000; cpu->clidr =3D 0x0a200023; cpu->ccsidr[0] =3D 0x700fe01a; /* 32KB L1 dcache */ @@ -249,7 +249,7 @@ static void aarch64_a72_initfn(Object *obj) cpu->pmceid0 =3D 0x00000000; cpu->pmceid1 =3D 0x00000000; cpu->isar.id_aa64isar0 =3D 0x00011120; - cpu->id_aa64mmfr0 =3D 0x00001124; + cpu->isar.id_aa64mmfr0 =3D 0x00001124; cpu->dbgdidr =3D 0x3516d000; cpu->clidr =3D 0x0a200023; cpu->ccsidr[0] =3D 0x701fe00a; /* 32KB L1 dcache */ diff --git a/target/arm/helper.c b/target/arm/helper.c index 0da1424f72d..04c4a91b04c 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -5207,11 +5207,11 @@ void register_cp_regs_for_features(ARMCPU *cpu) { .name =3D "ID_AA64MMFR0_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 7, .opc2 =3D = 0, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .resetvalue =3D cpu->id_aa64mmfr0 }, + .resetvalue =3D cpu->isar.id_aa64mmfr0 }, { .name =3D "ID_AA64MMFR1_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 7, .opc2 =3D = 1, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .resetvalue =3D cpu->id_aa64mmfr1 }, + .resetvalue =3D cpu->isar.id_aa64mmfr1 }, { .name =3D "ID_AA64MMFR2_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 7, .opc2 =3D = 2, .access =3D PL1_R, .type =3D ARM_CP_CONST, diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 0a502091e76..089af9c5f02 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -538,6 +538,10 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures = *ahcf) ARM64_SYS_REG(3, 0, 0, 6, 0)); err |=3D read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64isar1, ARM64_SYS_REG(3, 0, 0, 6, 1)); + err |=3D read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64mmfr0, + ARM64_SYS_REG(3, 0, 0, 7, 0)); + err |=3D read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64mmfr1, + ARM64_SYS_REG(3, 0, 0, 7, 1)); =20 /* * Note that if AArch32 support is not present in the host, --=20 2.19.2 From nobody Wed Apr 16 22:45:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714306172232.75479714681603; Thu, 13 Dec 2018 07:18:26 -0800 (PST) Received: from localhost ([::1]:53204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSkr-00005D-32 for importer@patchew.org; Thu, 13 Dec 2018 10:18:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOu-0004py-LG for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOs-0008D7-KF for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:44 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOr-000747-Sr for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:42 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOD-0007M0-B1 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:55:01 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:37 +0000 Message-Id: <20181213145445.17935-30-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 29/37] target/arm: Add HCR_EL2 bits up to ARMv8.5 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Post v8.3 bits taken from SysReg_v85_xml-00bet8. Signed-off-by: Richard Henderson Message-id: 20181203203839.757-3-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/cpu.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 656a96a8f8f..79d58978f7c 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1249,7 +1249,7 @@ static inline void xpsr_write(CPUARMState *env, uint3= 2_t val, uint32_t mask) #define HCR_TIDCP (1ULL << 20) #define HCR_TACR (1ULL << 21) #define HCR_TSW (1ULL << 22) -#define HCR_TPC (1ULL << 23) +#define HCR_TPCP (1ULL << 23) #define HCR_TPU (1ULL << 24) #define HCR_TTLB (1ULL << 25) #define HCR_TVM (1ULL << 26) @@ -1261,6 +1261,26 @@ static inline void xpsr_write(CPUARMState *env, uint= 32_t val, uint32_t mask) #define HCR_CD (1ULL << 32) #define HCR_ID (1ULL << 33) #define HCR_E2H (1ULL << 34) +#define HCR_TLOR (1ULL << 35) +#define HCR_TERR (1ULL << 36) +#define HCR_TEA (1ULL << 37) +#define HCR_MIOCNCE (1ULL << 38) +#define HCR_APK (1ULL << 40) +#define HCR_API (1ULL << 41) +#define HCR_NV (1ULL << 42) +#define HCR_NV1 (1ULL << 43) +#define HCR_AT (1ULL << 44) +#define HCR_NV2 (1ULL << 45) +#define HCR_FWB (1ULL << 46) +#define HCR_FIEN (1ULL << 47) +#define HCR_TID4 (1ULL << 49) +#define HCR_TICAB (1ULL << 50) +#define HCR_TOCU (1ULL << 52) +#define HCR_TTLBIS (1ULL << 54) +#define HCR_TTLBOS (1ULL << 55) +#define HCR_ATA (1ULL << 56) +#define HCR_DCT (1ULL << 57) + /* * When we actually implement ARMv8.1-VHE we should add HCR_E2H to * HCR_MASK and then clear it again if the feature bit is not set in --=20 2.19.2 From nobody Wed Apr 16 22:45:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 154471431178916.92294184019829; Thu, 13 Dec 2018 07:18:31 -0800 (PST) Received: from localhost ([::1]:53205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSkw-00009O-Hz for importer@patchew.org; Thu, 13 Dec 2018 10:18:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOW-0004TQ-3s for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOS-0007bB-1i for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:18 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOR-0006zA-NA for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:15 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOE-0007ME-2V for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:55:02 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:38 +0000 Message-Id: <20181213145445.17935-31-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 30/37] target/arm: Add SCR_EL3 bits up to ARMv8.5 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Post v8.4 bits taken from SysReg_v85_xml-00bet8. Signed-off-by: Richard Henderson Message-id: 20181203203839.757-4-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/cpu.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 79d58978f7c..20d97b66def 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1302,6 +1302,16 @@ static inline void xpsr_write(CPUARMState *env, uint= 32_t val, uint32_t mask) #define SCR_ST (1U << 11) #define SCR_TWI (1U << 12) #define SCR_TWE (1U << 13) +#define SCR_TLOR (1U << 14) +#define SCR_TERR (1U << 15) +#define SCR_APK (1U << 16) +#define SCR_API (1U << 17) +#define SCR_EEL2 (1U << 18) +#define SCR_EASE (1U << 19) +#define SCR_NMEA (1U << 20) +#define SCR_FIEN (1U << 21) +#define SCR_ENSCXT (1U << 25) +#define SCR_ATA (1U << 26) #define SCR_AARCH32_MASK (0x3fff & ~(SCR_RW | SCR_ST)) #define SCR_AARCH64_MASK (0x3fff & ~SCR_NET) =20 --=20 2.19.2 From nobody Wed Apr 16 22:45:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714117432180.51790788682626; Thu, 13 Dec 2018 07:15:17 -0800 (PST) Received: from localhost ([::1]:53186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSho-0006B9-CI for importer@patchew.org; Thu, 13 Dec 2018 10:15:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOW-0004TP-3d for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOR-0007au-TH for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:18 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOR-00071P-3o for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:15 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOE-0007MS-Id for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:55:02 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:39 +0000 Message-Id: <20181213145445.17935-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 31/37] target/arm: Fix HCR_EL2.TGE check in arm_phys_excp_target_el X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson The enable for TGE has already occurred within arm_hcr_el2_amo and friends. Moreover, when E2H is also set, the sense is supposed to be reversed, which has also already occurred within the helpers. Signed-off-by: Richard Henderson Message-id: 20181203203839.757-5-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/helper.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 04c4a91b04c..bf020364e1d 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6537,9 +6537,6 @@ uint32_t arm_phys_excp_target_el(CPUState *cs, uint32= _t excp_idx, break; }; =20 - /* If HCR.TGE is set then HCR is treated as being 1 */ - hcr |=3D ((env->cp15.hcr_el2 & HCR_TGE) =3D=3D HCR_TGE); - /* Perform a table-lookup for the target EL given the current state */ target_el =3D target_el_table[is64][scr][rw][hcr][secure][cur_el]; =20 --=20 2.19.2 From nobody Wed Apr 16 22:45:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713948646117.21995300639969; Thu, 13 Dec 2018 07:12:28 -0800 (PST) Received: from localhost ([::1]:53170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSf5-0003FZ-9x for importer@patchew.org; Thu, 13 Dec 2018 10:12:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOU-0004RX-5p for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOR-0007aF-FE for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:16 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOQ-000747-I0 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:14 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOF-0007Mg-31 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:55:03 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:40 +0000 Message-Id: <20181213145445.17935-33-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 32/37] target/arm: Tidy scr_write X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Because EL3 has a fixed execution mode, we can properly decide which of the bits are RES{0,1}. Signed-off-by: Richard Henderson Message-id: 20181203203839.757-8-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/cpu.h | 2 -- target/arm/helper.c | 14 +++++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 20d97b66def..b8dbdb5e014 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1312,8 +1312,6 @@ static inline void xpsr_write(CPUARMState *env, uint3= 2_t val, uint32_t mask) #define SCR_FIEN (1U << 21) #define SCR_ENSCXT (1U << 25) #define SCR_ATA (1U << 26) -#define SCR_AARCH32_MASK (0x3fff & ~(SCR_RW | SCR_ST)) -#define SCR_AARCH64_MASK (0x3fff & ~SCR_NET) =20 /* Return the current FPSCR value. */ uint32_t vfp_get_fpscr(CPUARMState *env); diff --git a/target/arm/helper.c b/target/arm/helper.c index bf020364e1d..1dad277804f 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1279,11 +1279,15 @@ static void vbar_write(CPUARMState *env, const ARMC= PRegInfo *ri, =20 static void scr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t v= alue) { - /* We only mask off bits that are RES0 both for AArch64 and AArch32. - * For bits that vary between AArch32/64, code needs to check the - * current execution mode before directly using the feature bit. - */ - uint32_t valid_mask =3D SCR_AARCH64_MASK | SCR_AARCH32_MASK; + /* Begin with base v8.0 state. */ + uint32_t valid_mask =3D 0x3fff; + + if (arm_el_is_aa64(env, 3)) { + value |=3D SCR_FW | SCR_AW; /* these two bits are RES1. */ + valid_mask &=3D ~SCR_NET; + } else { + valid_mask &=3D ~(SCR_RW | SCR_ST); + } =20 if (!arm_feature(env, ARM_FEATURE_EL2)) { valid_mask &=3D ~SCR_HCE; --=20 2.19.2 From nobody Wed Apr 16 22:45:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714498382437.2603292793816; Thu, 13 Dec 2018 07:21:38 -0800 (PST) Received: from localhost ([::1]:53223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSnw-0002tF-Ut for importer@patchew.org; Thu, 13 Dec 2018 10:21:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOX-0004Ux-K5 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOS-0007bD-1d for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:18 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOR-0007J5-Dl for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:15 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOF-0007Mw-T0 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:55:03 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:41 +0000 Message-Id: <20181213145445.17935-34-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 33/37] target/arm: Implement the ARMv8.1-HPD extension X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Since the TCR_*.HPD bits were RES0 in ARMv8.0, we can simply interpret the bits as if ARMv8.1-HPD is present without checking. We will need a slightly different check for hpd for aarch32. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20181203203839.757-10-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/cpu64.c | 4 ++++ target/arm/helper.c | 27 ++++++++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 0babe483ac2..1a4289c9dda 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -324,6 +324,10 @@ static void aarch64_max_initfn(Object *obj) t =3D FIELD_DP64(t, ID_AA64PFR0, ADVSIMD, 1); cpu->isar.id_aa64pfr0 =3D t; =20 + t =3D cpu->isar.id_aa64mmfr1; + t =3D FIELD_DP64(t, ID_AA64MMFR1, HPDS, 1); /* HPD */ + cpu->isar.id_aa64mmfr1 =3D t; + /* Replicate the same data to the 32-bit id registers. */ u =3D cpu->isar.id_isar5; u =3D FIELD_DP32(u, ID_ISAR5, AES, 2); /* AES + PMULL */ diff --git a/target/arm/helper.c b/target/arm/helper.c index 1dad277804f..57af6b77a1b 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -9636,6 +9636,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, targ= et_ulong address, bool ttbr1_valid =3D true; uint64_t descaddrmask; bool aarch64 =3D arm_el_is_aa64(env, el); + bool hpd =3D false; =20 /* TODO: * This code does not handle the different format TCR for VTCR_EL2. @@ -9750,6 +9751,13 @@ static bool get_phys_addr_lpae(CPUARMState *env, tar= get_ulong address, if (tg =3D=3D 2) { /* 16KB pages */ stride =3D 11; } + if (aarch64) { + if (el > 1) { + hpd =3D extract64(tcr->raw_tcr, 24, 1); + } else { + hpd =3D extract64(tcr->raw_tcr, 41, 1); + } + } } else { /* We should only be here if TTBR1 is valid */ assert(ttbr1_valid); @@ -9765,6 +9773,9 @@ static bool get_phys_addr_lpae(CPUARMState *env, targ= et_ulong address, if (tg =3D=3D 1) { /* 16KB pages */ stride =3D 11; } + if (aarch64) { + hpd =3D extract64(tcr->raw_tcr, 42, 1); + } } =20 /* Here we should have set up all the parameters for the translation: @@ -9858,7 +9869,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, targ= et_ulong address, descaddr =3D descriptor & descaddrmask; =20 if ((descriptor & 2) && (level < 3)) { - /* Table entry. The top five bits are attributes which may + /* Table entry. The top five bits are attributes which may * propagate down through lower levels of the table (and * which are all arranged so that 0 means "no effect", so * we can gather them up by ORing in the bits at each level). @@ -9883,15 +9894,17 @@ static bool get_phys_addr_lpae(CPUARMState *env, ta= rget_ulong address, break; } /* Merge in attributes from table descriptors */ - attrs |=3D extract32(tableattrs, 0, 2) << 11; /* XN, PXN */ - attrs |=3D extract32(tableattrs, 3, 1) << 5; /* APTable[1] =3D> AP= [2] */ + attrs |=3D nstable << 3; /* NS */ + if (hpd) { + /* HPD disables all the table attributes except NSTable. */ + break; + } + attrs |=3D extract32(tableattrs, 0, 2) << 11; /* XN, PXN */ /* The sense of AP[1] vs APTable[0] is reversed, as APTable[0] =3D= =3D 1 * means "force PL1 access only", which means forcing AP[1] to 0. */ - if (extract32(tableattrs, 2, 1)) { - attrs &=3D ~(1 << 4); - } - attrs |=3D nstable << 3; /* NS */ + attrs &=3D ~(extract32(tableattrs, 2, 1) << 4); /* !APT[0] =3D> = AP[1] */ + attrs |=3D extract32(tableattrs, 3, 1) << 5; /* APT[1] =3D> A= P[2] */ break; } /* Here descaddr is the final physical address, and attributes --=20 2.19.2 From nobody Wed Apr 16 22:45:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714859611504.2682605156101; Thu, 13 Dec 2018 07:27:39 -0800 (PST) Received: from localhost ([::1]:53260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSti-00089H-59 for importer@patchew.org; Thu, 13 Dec 2018 10:27:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOi-0004ea-FK for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOg-0007up-Do for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:32 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOg-0006zA-2G for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:30 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOG-0007NE-GR for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:55:04 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:42 +0000 Message-Id: <20181213145445.17935-35-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 34/37] target/arm: Implement the ARMv8.2-AA32HPD extension X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson The bulk of the work here, beyond base HPD, is defining the TTBCR2 register. In addition we must check TTBCR.T2E, which is not present (RES0) for AArch64. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20181203203839.757-11-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/cpu.h | 9 +++++++++ target/arm/cpu.c | 4 ++++ target/arm/helper.c | 37 +++++++++++++++++++++++++++++-------- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index b8dbdb5e014..11ec2cce767 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1548,6 +1548,15 @@ FIELD(ID_ISAR6, FHM, 8, 4) FIELD(ID_ISAR6, SB, 12, 4) FIELD(ID_ISAR6, SPECRES, 16, 4) =20 +FIELD(ID_MMFR4, SPECSEI, 0, 4) +FIELD(ID_MMFR4, AC2, 4, 4) +FIELD(ID_MMFR4, XNX, 8, 4) +FIELD(ID_MMFR4, CNP, 12, 4) +FIELD(ID_MMFR4, HPDS, 16, 4) +FIELD(ID_MMFR4, LSM, 20, 4) +FIELD(ID_MMFR4, CCIDX, 24, 4) +FIELD(ID_MMFR4, EVT, 28, 4) + FIELD(ID_AA64ISAR0, AES, 4, 4) FIELD(ID_AA64ISAR0, SHA1, 8, 4) FIELD(ID_AA64ISAR0, SHA2, 12, 4) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 60411f6bfe0..0b185f8d309 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1932,6 +1932,10 @@ static void arm_max_initfn(Object *obj) t =3D cpu->isar.id_isar6; t =3D FIELD_DP32(t, ID_ISAR6, DP, 1); cpu->isar.id_isar6 =3D t; + + t =3D cpu->id_mmfr4; + t =3D FIELD_DP32(t, ID_MMFR4, HPDS, 1); /* AA32HPD */ + cpu->id_mmfr4 =3D t; } #endif } diff --git a/target/arm/helper.c b/target/arm/helper.c index 57af6b77a1b..037cece1334 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -2728,6 +2728,7 @@ static void vmsa_ttbcr_write(CPUARMState *env, const = ARMCPRegInfo *ri, uint64_t value) { ARMCPU *cpu =3D arm_env_get_cpu(env); + TCR *tcr =3D raw_ptr(env, ri); =20 if (arm_feature(env, ARM_FEATURE_LPAE)) { /* With LPAE the TTBCR could result in a change of ASID @@ -2735,6 +2736,8 @@ static void vmsa_ttbcr_write(CPUARMState *env, const = ARMCPRegInfo *ri, */ tlb_flush(CPU(cpu)); } + /* Preserve the high half of TCR_EL1, set via TTBCR2. */ + value =3D deposit64(tcr->raw_tcr, 0, 32, value); vmsa_ttbcr_raw_write(env, ri, value); } =20 @@ -2837,6 +2840,16 @@ static const ARMCPRegInfo vmsa_cp_reginfo[] =3D { REGINFO_SENTINEL }; =20 +/* Note that unlike TTBCR, writing to TTBCR2 does not require flushing + * qemu tlbs nor adjusting cached masks. + */ +static const ARMCPRegInfo ttbcr2_reginfo =3D { + .name =3D "TTBCR2", .cp =3D 15, .opc1 =3D 0, .crn =3D 2, .crm =3D 0, .= opc2 =3D 3, + .access =3D PL1_RW, .type =3D ARM_CP_ALIAS, + .bank_fieldoffsets =3D { offsetofhigh32(CPUARMState, cp15.tcr_el[3]), + offsetofhigh32(CPUARMState, cp15.tcr_el[1]) }, +}; + static void omap_ticonfig_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -5437,6 +5450,10 @@ void register_cp_regs_for_features(ARMCPU *cpu) } else { define_arm_cp_regs(cpu, vmsa_pmsa_cp_reginfo); define_arm_cp_regs(cpu, vmsa_cp_reginfo); + /* TTCBR2 is introduced with ARMv8.2-A32HPD. */ + if (FIELD_EX32(cpu->id_mmfr4, ID_MMFR4, HPDS) !=3D 0) { + define_one_arm_cp_reg(cpu, &ttbcr2_reginfo); + } } if (arm_feature(env, ARM_FEATURE_THUMB2EE)) { define_arm_cp_regs(cpu, t2ee_cp_reginfo); @@ -9751,12 +9768,14 @@ static bool get_phys_addr_lpae(CPUARMState *env, ta= rget_ulong address, if (tg =3D=3D 2) { /* 16KB pages */ stride =3D 11; } - if (aarch64) { - if (el > 1) { - hpd =3D extract64(tcr->raw_tcr, 24, 1); - } else { - hpd =3D extract64(tcr->raw_tcr, 41, 1); - } + if (aarch64 && el > 1) { + hpd =3D extract64(tcr->raw_tcr, 24, 1); + } else { + hpd =3D extract64(tcr->raw_tcr, 41, 1); + } + if (!aarch64) { + /* For aarch32, hpd0 is not enabled without t2e as well. */ + hpd &=3D extract64(tcr->raw_tcr, 6, 1); } } else { /* We should only be here if TTBR1 is valid */ @@ -9773,8 +9792,10 @@ static bool get_phys_addr_lpae(CPUARMState *env, tar= get_ulong address, if (tg =3D=3D 1) { /* 16KB pages */ stride =3D 11; } - if (aarch64) { - hpd =3D extract64(tcr->raw_tcr, 42, 1); + hpd =3D extract64(tcr->raw_tcr, 42, 1); + if (!aarch64) { + /* For aarch32, hpd1 is not enabled without t2e as well. */ + hpd &=3D extract64(tcr->raw_tcr, 6, 1); } } =20 --=20 2.19.2 From nobody Wed Apr 16 22:45:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713740216602.3375975372253; Thu, 13 Dec 2018 07:09:00 -0800 (PST) Received: from localhost ([::1]:53148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSbb-0007vZ-5Z for importer@patchew.org; Thu, 13 Dec 2018 10:08:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOj-0004fc-Et for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOg-0007u2-3P for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:33 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOf-0007J5-Lb for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:29 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOH-0007NV-2N for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:55:05 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:43 +0000 Message-Id: <20181213145445.17935-36-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 35/37] target/arm: Introduce arm_hcr_el2_eff X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Replace arm_hcr_el2_{fmo,imo,amo} with a more general routine that also takes SCR_EL3.NS (aka arm_is_secure_below_el3) into account, as documented for the plethora of bits in HCR_EL2. Signed-off-by: Richard Henderson Message-id: 20181210150501.7990-2-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/cpu.h | 67 +++++++++------------------------------ hw/intc/arm_gicv3_cpuif.c | 21 ++++++------ target/arm/helper.c | 66 ++++++++++++++++++++++++++++++++------ 3 files changed, 83 insertions(+), 71 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 11ec2cce767..05ac883b6be 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1729,6 +1729,14 @@ static inline bool arm_is_secure(CPUARMState *env) } #endif =20 +/** + * arm_hcr_el2_eff(): Return the effective value of HCR_EL2. + * E.g. when in secure state, fields in HCR_EL2 are suppressed, + * "for all purposes other than a direct read or write access of HCR_EL2." + * Not included here is HCR_RW. + */ +uint64_t arm_hcr_el2_eff(CPUARMState *env); + /* Return true if the specified exception level is running in AArch64 stat= e. */ static inline bool arm_el_is_aa64(CPUARMState *env, int el) { @@ -2414,54 +2422,6 @@ bool write_cpustate_to_list(ARMCPU *cpu); # define TARGET_VIRT_ADDR_SPACE_BITS 32 #endif =20 -/** - * arm_hcr_el2_imo(): Return the effective value of HCR_EL2.IMO. - * Depending on the values of HCR_EL2.E2H and TGE, this may be - * "behaves as 1 for all purposes other than direct read/write" or - * "behaves as 0 for all purposes other than direct read/write" - */ -static inline bool arm_hcr_el2_imo(CPUARMState *env) -{ - switch (env->cp15.hcr_el2 & (HCR_TGE | HCR_E2H)) { - case HCR_TGE: - return true; - case HCR_TGE | HCR_E2H: - return false; - default: - return env->cp15.hcr_el2 & HCR_IMO; - } -} - -/** - * arm_hcr_el2_fmo(): Return the effective value of HCR_EL2.FMO. - */ -static inline bool arm_hcr_el2_fmo(CPUARMState *env) -{ - switch (env->cp15.hcr_el2 & (HCR_TGE | HCR_E2H)) { - case HCR_TGE: - return true; - case HCR_TGE | HCR_E2H: - return false; - default: - return env->cp15.hcr_el2 & HCR_FMO; - } -} - -/** - * arm_hcr_el2_amo(): Return the effective value of HCR_EL2.AMO. - */ -static inline bool arm_hcr_el2_amo(CPUARMState *env) -{ - switch (env->cp15.hcr_el2 & (HCR_TGE | HCR_E2H)) { - case HCR_TGE: - return true; - case HCR_TGE | HCR_E2H: - return false; - default: - return env->cp15.hcr_el2 & HCR_AMO; - } -} - static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx, unsigned int target_el) { @@ -2470,6 +2430,7 @@ static inline bool arm_excp_unmasked(CPUState *cs, un= signed int excp_idx, bool secure =3D arm_is_secure(env); bool pstate_unmasked; int8_t unmasked =3D 0; + uint64_t hcr_el2; =20 /* Don't take exceptions if they target a lower EL. * This check should catch any exceptions that would not be taken but = left @@ -2479,6 +2440,8 @@ static inline bool arm_excp_unmasked(CPUState *cs, un= signed int excp_idx, return false; } =20 + hcr_el2 =3D arm_hcr_el2_eff(env); + switch (excp_idx) { case EXCP_FIQ: pstate_unmasked =3D !(env->daif & PSTATE_F); @@ -2489,13 +2452,13 @@ static inline bool arm_excp_unmasked(CPUState *cs, = unsigned int excp_idx, break; =20 case EXCP_VFIQ: - if (secure || !arm_hcr_el2_fmo(env) || (env->cp15.hcr_el2 & HCR_TG= E)) { + if (secure || !(hcr_el2 & HCR_FMO) || (hcr_el2 & HCR_TGE)) { /* VFIQs are only taken when hypervized and non-secure. */ return false; } return !(env->daif & PSTATE_F); case EXCP_VIRQ: - if (secure || !arm_hcr_el2_imo(env) || (env->cp15.hcr_el2 & HCR_TG= E)) { + if (secure || !(hcr_el2 & HCR_IMO) || (hcr_el2 & HCR_TGE)) { /* VIRQs are only taken when hypervized and non-secure. */ return false; } @@ -2534,7 +2497,7 @@ static inline bool arm_excp_unmasked(CPUState *cs, un= signed int excp_idx, * to the CPSR.F setting otherwise we further assess the s= tate * below. */ - hcr =3D arm_hcr_el2_fmo(env); + hcr =3D hcr_el2 & HCR_FMO; scr =3D (env->cp15.scr_el3 & SCR_FIQ); =20 /* When EL3 is 32-bit, the SCR.FW bit controls whether the @@ -2551,7 +2514,7 @@ static inline bool arm_excp_unmasked(CPUState *cs, un= signed int excp_idx, * when setting the target EL, so it does not have a furth= er * affect here. */ - hcr =3D arm_hcr_el2_imo(env); + hcr =3D hcr_el2 & HCR_IMO; scr =3D false; break; default: diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c index 068a8e8e9b9..cbad6037f19 100644 --- a/hw/intc/arm_gicv3_cpuif.c +++ b/hw/intc/arm_gicv3_cpuif.c @@ -85,8 +85,8 @@ static bool icv_access(CPUARMState *env, int hcr_flags) * * access if NS EL1 and either IMO or FMO =3D=3D 1: * CTLR, DIR, PMR, RPR */ - bool flagmatch =3D ((hcr_flags & HCR_IMO) && arm_hcr_el2_imo(env)) || - ((hcr_flags & HCR_FMO) && arm_hcr_el2_fmo(env)); + uint64_t hcr_el2 =3D arm_hcr_el2_eff(env); + bool flagmatch =3D hcr_el2 & hcr_flags & (HCR_IMO | HCR_FMO); =20 return flagmatch && arm_current_el(env) =3D=3D 1 && !arm_is_secure_below_el3(env); @@ -1552,8 +1552,9 @@ static void icc_dir_write(CPUARMState *env, const ARM= CPRegInfo *ri, /* No need to include !IsSecure in route_*_to_el2 as it's only * tested in cases where we know !IsSecure is true. */ - route_fiq_to_el2 =3D arm_hcr_el2_fmo(env); - route_irq_to_el2 =3D arm_hcr_el2_imo(env); + uint64_t hcr_el2 =3D arm_hcr_el2_eff(env); + route_fiq_to_el2 =3D hcr_el2 & HCR_FMO; + route_irq_to_el2 =3D hcr_el2 & HCR_IMO; =20 switch (arm_current_el(env)) { case 3: @@ -1895,8 +1896,8 @@ static CPAccessResult gicv3_irqfiq_access(CPUARMState= *env, if ((env->cp15.scr_el3 & (SCR_FIQ | SCR_IRQ)) =3D=3D (SCR_FIQ | SCR_IR= Q)) { switch (el) { case 1: - if (arm_is_secure_below_el3(env) || - (arm_hcr_el2_imo(env) =3D=3D 0 && arm_hcr_el2_fmo(env) =3D= =3D 0)) { + /* Note that arm_hcr_el2_eff takes secure state into account. = */ + if ((arm_hcr_el2_eff(env) & (HCR_IMO | HCR_FMO)) =3D=3D 0) { r =3D CP_ACCESS_TRAP_EL3; } break; @@ -1936,8 +1937,8 @@ static CPAccessResult gicv3_dir_access(CPUARMState *e= nv, static CPAccessResult gicv3_sgi_access(CPUARMState *env, const ARMCPRegInfo *ri, bool isread) { - if ((arm_hcr_el2_imo(env) || arm_hcr_el2_fmo(env)) && - arm_current_el(env) =3D=3D 1 && !arm_is_secure_below_el3(env)) { + if (arm_current_el(env) =3D=3D 1 && + (arm_hcr_el2_eff(env) & (HCR_IMO | HCR_FMO)) !=3D 0) { /* Takes priority over a possible EL3 trap */ return CP_ACCESS_TRAP_EL2; } @@ -1961,7 +1962,7 @@ static CPAccessResult gicv3_fiq_access(CPUARMState *e= nv, if (env->cp15.scr_el3 & SCR_FIQ) { switch (el) { case 1: - if (arm_is_secure_below_el3(env) || !arm_hcr_el2_fmo(env)) { + if ((arm_hcr_el2_eff(env) & HCR_FMO) =3D=3D 0) { r =3D CP_ACCESS_TRAP_EL3; } break; @@ -2000,7 +2001,7 @@ static CPAccessResult gicv3_irq_access(CPUARMState *e= nv, if (env->cp15.scr_el3 & SCR_IRQ) { switch (el) { case 1: - if (arm_is_secure_below_el3(env) || !arm_hcr_el2_imo(env)) { + if ((arm_hcr_el2_eff(env) & HCR_IMO) =3D=3D 0) { r =3D CP_ACCESS_TRAP_EL3; } break; diff --git a/target/arm/helper.c b/target/arm/helper.c index 037cece1334..95d59e07fb9 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1331,9 +1331,10 @@ static void csselr_write(CPUARMState *env, const ARM= CPRegInfo *ri, static uint64_t isr_read(CPUARMState *env, const ARMCPRegInfo *ri) { CPUState *cs =3D ENV_GET_CPU(env); + uint64_t hcr_el2 =3D arm_hcr_el2_eff(env); uint64_t ret =3D 0; =20 - if (arm_hcr_el2_imo(env)) { + if (hcr_el2 & HCR_IMO) { if (cs->interrupt_request & CPU_INTERRUPT_VIRQ) { ret |=3D CPSR_I; } @@ -1343,7 +1344,7 @@ static uint64_t isr_read(CPUARMState *env, const ARMC= PRegInfo *ri) } } =20 - if (arm_hcr_el2_fmo(env)) { + if (hcr_el2 & HCR_FMO) { if (cs->interrupt_request & CPU_INTERRUPT_VFIQ) { ret |=3D CPSR_F; } @@ -4008,6 +4009,51 @@ static void hcr_writelow(CPUARMState *env, const ARM= CPRegInfo *ri, hcr_write(env, NULL, value); } =20 +/* + * Return the effective value of HCR_EL2. + * Bits that are not included here: + * RW (read from SCR_EL3.RW as needed) + */ +uint64_t arm_hcr_el2_eff(CPUARMState *env) +{ + uint64_t ret =3D env->cp15.hcr_el2; + + if (arm_is_secure_below_el3(env)) { + /* + * "This register has no effect if EL2 is not enabled in the + * current Security state". This is ARMv8.4-SecEL2 speak for + * !(SCR_EL3.NS=3D=3D1 || SCR_EL3.EEL2=3D=3D1). + * + * Prior to that, the language was "In an implementation that + * includes EL3, when the value of SCR_EL3.NS is 0 the PE behaves + * as if this field is 0 for all purposes other than a direct + * read or write access of HCR_EL2". With lots of enumeration + * on a per-field basis. In current QEMU, this is condition + * is arm_is_secure_below_el3. + * + * Since the v8.4 language applies to the entire register, and + * appears to be backward compatible, use that. + */ + ret =3D 0; + } else if (ret & HCR_TGE) { + /* These bits are up-to-date as of ARMv8.4. */ + if (ret & HCR_E2H) { + ret &=3D ~(HCR_VM | HCR_FMO | HCR_IMO | HCR_AMO | + HCR_BSU_MASK | HCR_DC | HCR_TWI | HCR_TWE | + HCR_TID0 | HCR_TID2 | HCR_TPCP | HCR_TPU | + HCR_TDZ | HCR_CD | HCR_ID | HCR_MIOCNCE); + } else { + ret |=3D HCR_FMO | HCR_IMO | HCR_AMO; + } + ret &=3D ~(HCR_SWIO | HCR_PTW | HCR_VF | HCR_VI | HCR_VSE | + HCR_FB | HCR_TID1 | HCR_TID3 | HCR_TSC | HCR_TACR | + HCR_TSW | HCR_TTLB | HCR_TVM | HCR_HCD | HCR_TRVM | + HCR_TLOR); + } + + return ret; +} + static const ARMCPRegInfo el2_cp_reginfo[] =3D { { .name =3D "HCR_EL2", .state =3D ARM_CP_STATE_AA64, .type =3D ARM_CP_IO, @@ -6526,12 +6572,13 @@ uint32_t arm_phys_excp_target_el(CPUState *cs, uint= 32_t excp_idx, uint32_t cur_el, bool secure) { CPUARMState *env =3D cs->env_ptr; - int rw; - int scr; - int hcr; + bool rw; + bool scr; + bool hcr; int target_el; /* Is the highest EL AArch64? */ - int is64 =3D arm_feature(env, ARM_FEATURE_AARCH64); + bool is64 =3D arm_feature(env, ARM_FEATURE_AARCH64); + uint64_t hcr_el2; =20 if (arm_feature(env, ARM_FEATURE_EL3)) { rw =3D ((env->cp15.scr_el3 & SCR_RW) =3D=3D SCR_RW); @@ -6543,18 +6590,19 @@ uint32_t arm_phys_excp_target_el(CPUState *cs, uint= 32_t excp_idx, rw =3D is64; } =20 + hcr_el2 =3D arm_hcr_el2_eff(env); switch (excp_idx) { case EXCP_IRQ: scr =3D ((env->cp15.scr_el3 & SCR_IRQ) =3D=3D SCR_IRQ); - hcr =3D arm_hcr_el2_imo(env); + hcr =3D hcr_el2 & HCR_IMO; break; case EXCP_FIQ: scr =3D ((env->cp15.scr_el3 & SCR_FIQ) =3D=3D SCR_FIQ); - hcr =3D arm_hcr_el2_fmo(env); + hcr =3D hcr_el2 & HCR_FMO; break; default: scr =3D ((env->cp15.scr_el3 & SCR_EA) =3D=3D SCR_EA); - hcr =3D arm_hcr_el2_amo(env); + hcr =3D hcr_el2 & HCR_AMO; break; }; =20 --=20 2.19.2 From nobody Wed Apr 16 22:45:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544713550502613.4147987080744; Thu, 13 Dec 2018 07:05:50 -0800 (PST) Received: from localhost ([::1]:53131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSYd-0005Z0-L6 for importer@patchew.org; Thu, 13 Dec 2018 10:05:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOi-0004eP-9J for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOg-0007vD-HS for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:32 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOg-00071P-3w for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:30 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOH-0007Nj-IW for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:55:05 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:44 +0000 Message-Id: <20181213145445.17935-37-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 36/37] target/arm: Use arm_hcr_el2_eff more places X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Since arm_hcr_el2_eff includes a check against arm_is_secure_below_el3, we can often remove a nearby check against secure state. In some cases, sort the call to arm_hcr_el2_eff to the end of a short-circuit logical sequence. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20181210150501.7990-3-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.c | 12 +++++------- target/arm/op_helper.c | 14 ++++++-------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 95d59e07fb9..d6f8be9f4e1 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -448,7 +448,7 @@ static CPAccessResult access_tdosa(CPUARMState *env, co= nst ARMCPRegInfo *ri, int el =3D arm_current_el(env); bool mdcr_el2_tdosa =3D (env->cp15.mdcr_el2 & MDCR_TDOSA) || (env->cp15.mdcr_el2 & MDCR_TDE) || - (env->cp15.hcr_el2 & HCR_TGE); + (arm_hcr_el2_eff(env) & HCR_TGE); =20 if (el < 2 && mdcr_el2_tdosa && !arm_is_secure_below_el3(env)) { return CP_ACCESS_TRAP_EL2; @@ -468,7 +468,7 @@ static CPAccessResult access_tdra(CPUARMState *env, con= st ARMCPRegInfo *ri, int el =3D arm_current_el(env); bool mdcr_el2_tdra =3D (env->cp15.mdcr_el2 & MDCR_TDRA) || (env->cp15.mdcr_el2 & MDCR_TDE) || - (env->cp15.hcr_el2 & HCR_TGE); + (arm_hcr_el2_eff(env) & HCR_TGE); =20 if (el < 2 && mdcr_el2_tdra && !arm_is_secure_below_el3(env)) { return CP_ACCESS_TRAP_EL2; @@ -488,7 +488,7 @@ static CPAccessResult access_tda(CPUARMState *env, cons= t ARMCPRegInfo *ri, int el =3D arm_current_el(env); bool mdcr_el2_tda =3D (env->cp15.mdcr_el2 & MDCR_TDA) || (env->cp15.mdcr_el2 & MDCR_TDE) || - (env->cp15.hcr_el2 & HCR_TGE); + (arm_hcr_el2_eff(env) & HCR_TGE); =20 if (el < 2 && mdcr_el2_tda && !arm_is_secure_below_el3(env)) { return CP_ACCESS_TRAP_EL2; @@ -4566,8 +4566,7 @@ int sve_exception_el(CPUARMState *env, int el) if (disabled) { /* route_to_el2 */ return (arm_feature(env, ARM_FEATURE_EL2) - && !arm_is_secure(env) - && (env->cp15.hcr_el2 & HCR_TGE) ? 2 : 1); + && (arm_hcr_el2_eff(env) & HCR_TGE) ? 2 : 1); } =20 /* Check CPACR.FPEN. */ @@ -6216,9 +6215,8 @@ static int bad_mode_switch(CPUARMState *env, int mode= , CPSRWriteType write_type) * and CPS are treated as illegal mode changes. */ if (write_type =3D=3D CPSRWriteByInstr && - (env->cp15.hcr_el2 & HCR_TGE) && (env->uncached_cpsr & CPSR_M) =3D=3D ARM_CPU_MODE_MON && - !arm_is_secure_below_el3(env)) { + (arm_hcr_el2_eff(env) & HCR_TGE)) { return 1; } return 0; diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c index 0d6e89e474a..ef72361a36d 100644 --- a/target/arm/op_helper.c +++ b/target/arm/op_helper.c @@ -33,8 +33,7 @@ void raise_exception(CPUARMState *env, uint32_t excp, { CPUState *cs =3D CPU(arm_env_get_cpu(env)); =20 - if ((env->cp15.hcr_el2 & HCR_TGE) && - target_el =3D=3D 1 && !arm_is_secure(env)) { + if (target_el =3D=3D 1 && (arm_hcr_el2_eff(env) & HCR_TGE)) { /* * Redirect NS EL1 exceptions to NS EL2. These are reported with * their original syndrome register value, with the exception of @@ -428,9 +427,9 @@ static inline int check_wfx_trap(CPUARMState *env, bool= is_wfe) * No need for ARM_FEATURE check as if HCR_EL2 doesn't exist the * bits will be zero indicating no trap. */ - if (cur_el < 2 && !arm_is_secure(env)) { - mask =3D (is_wfe) ? HCR_TWE : HCR_TWI; - if (env->cp15.hcr_el2 & mask) { + if (cur_el < 2) { + mask =3D is_wfe ? HCR_TWE : HCR_TWI; + if (arm_hcr_el2_eff(env) & mask) { return 2; } } @@ -995,7 +994,7 @@ void HELPER(pre_smc)(CPUARMState *env, uint32_t syndrom= e) exception_target_el(env)); } =20 - if (!secure && cur_el =3D=3D 1 && (env->cp15.hcr_el2 & HCR_TSC)) { + if (cur_el =3D=3D 1 && (arm_hcr_el2_eff(env) & HCR_TSC)) { /* In NS EL1, HCR controlled routing to EL2 has priority over SMD. * We also want an EL2 guest to be able to forbid its EL1 from * making PSCI calls into QEMU's "firmware" via HCR.TSC. @@ -1098,8 +1097,7 @@ void HELPER(exception_return)(CPUARMState *env) goto illegal_return; } =20 - if (new_el =3D=3D 1 && (env->cp15.hcr_el2 & HCR_TGE) - && !arm_is_secure_below_el3(env)) { + if (new_el =3D=3D 1 && (arm_hcr_el2_eff(env) & HCR_TGE)) { goto illegal_return; } =20 --=20 2.19.2 From nobody Wed Apr 16 22:45:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544714678281474.46826774420106; Thu, 13 Dec 2018 07:24:38 -0800 (PST) Received: from localhost ([::1]:53239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSqr-0005R5-2Q for importer@patchew.org; Thu, 13 Dec 2018 10:24:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOh-0004dn-FZ for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOf-0007tP-PK for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:31 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOd-000747-Td for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:29 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSOI-0007Nx-2d for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:55:06 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:45 +0000 Message-Id: <20181213145445.17935-38-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 37/37] target/arm: Implement the ARMv8.1-LOR extension X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Provide a trivial implementation with zero limited ordering regions, which causes the LDLAR and STLLR instructions to devolve into the LDAR and STLR instructions from the base ARMv8.0 instruction set. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20181210150501.7990-4-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/cpu.h | 5 +++ target/arm/cpu64.c | 1 + target/arm/helper.c | 75 ++++++++++++++++++++++++++++++++++++++ target/arm/translate-a64.c | 12 ++++++ 4 files changed, 93 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 05ac883b6be..c943f35dd92 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3340,6 +3340,11 @@ static inline bool isar_feature_aa64_sve(const ARMIS= ARegisters *id) return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, SVE) !=3D 0; } =20 +static inline bool isar_feature_aa64_lor(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, LO) !=3D 0; +} + /* * Forward to the above feature tests given an ARMCPU pointer. */ diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 1a4289c9dda..1d57be0c910 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -326,6 +326,7 @@ static void aarch64_max_initfn(Object *obj) =20 t =3D cpu->isar.id_aa64mmfr1; t =3D FIELD_DP64(t, ID_AA64MMFR1, HPDS, 1); /* HPD */ + t =3D FIELD_DP64(t, ID_AA64MMFR1, LO, 1); cpu->isar.id_aa64mmfr1 =3D t; =20 /* Replicate the same data to the 32-bit id registers. */ diff --git a/target/arm/helper.c b/target/arm/helper.c index d6f8be9f4e1..644599b29d6 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1281,6 +1281,7 @@ static void scr_write(CPUARMState *env, const ARMCPRe= gInfo *ri, uint64_t value) { /* Begin with base v8.0 state. */ uint32_t valid_mask =3D 0x3fff; + ARMCPU *cpu =3D arm_env_get_cpu(env); =20 if (arm_el_is_aa64(env, 3)) { value |=3D SCR_FW | SCR_AW; /* these two bits are RES1. */ @@ -1303,6 +1304,9 @@ static void scr_write(CPUARMState *env, const ARMCPRe= gInfo *ri, uint64_t value) valid_mask &=3D ~SCR_SMD; } } + if (cpu_isar_feature(aa64_lor, cpu)) { + valid_mask |=3D SCR_TLOR; + } =20 /* Clear all-context RES0 bits. */ value &=3D valid_mask; @@ -3963,6 +3967,9 @@ static void hcr_write(CPUARMState *env, const ARMCPRe= gInfo *ri, uint64_t value) */ valid_mask &=3D ~HCR_TSC; } + if (cpu_isar_feature(aa64_lor, cpu)) { + valid_mask |=3D HCR_TLOR; + } =20 /* Clear RES0 bits. */ value &=3D valid_mask; @@ -5018,6 +5025,42 @@ static uint64_t id_aa64pfr0_read(CPUARMState *env, c= onst ARMCPRegInfo *ri) return pfr0; } =20 +/* Shared logic between LORID and the rest of the LOR* registers. + * Secure state has already been delt with. + */ +static CPAccessResult access_lor_ns(CPUARMState *env) +{ + int el =3D arm_current_el(env); + + if (el < 2 && (arm_hcr_el2_eff(env) & HCR_TLOR)) { + return CP_ACCESS_TRAP_EL2; + } + if (el < 3 && (env->cp15.scr_el3 & SCR_TLOR)) { + return CP_ACCESS_TRAP_EL3; + } + return CP_ACCESS_OK; +} + +static CPAccessResult access_lorid(CPUARMState *env, const ARMCPRegInfo *r= i, + bool isread) +{ + if (arm_is_secure_below_el3(env)) { + /* Access ok in secure mode. */ + return CP_ACCESS_OK; + } + return access_lor_ns(env); +} + +static CPAccessResult access_lor_other(CPUARMState *env, + const ARMCPRegInfo *ri, bool isread) +{ + if (arm_is_secure_below_el3(env)) { + /* Access denied in secure mode. */ + return CP_ACCESS_TRAP; + } + return access_lor_ns(env); +} + void register_cp_regs_for_features(ARMCPU *cpu) { /* Register all the coprocessor registers based on feature bits */ @@ -5759,6 +5802,38 @@ void register_cp_regs_for_features(ARMCPU *cpu) define_one_arm_cp_reg(cpu, &sctlr); } =20 + if (cpu_isar_feature(aa64_lor, cpu)) { + /* + * A trivial implementation of ARMv8.1-LOR leaves all of these + * registers fixed at 0, which indicates that there are zero + * supported Limited Ordering regions. + */ + static const ARMCPRegInfo lor_reginfo[] =3D { + { .name =3D "LORSA_EL1", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 3, .opc1 =3D 0, .crn =3D 10, .crm =3D 4, .opc2 =3D= 0, + .access =3D PL1_RW, .accessfn =3D access_lor_other, + .type =3D ARM_CP_CONST, .resetvalue =3D 0 }, + { .name =3D "LOREA_EL1", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 3, .opc1 =3D 0, .crn =3D 10, .crm =3D 4, .opc2 =3D= 1, + .access =3D PL1_RW, .accessfn =3D access_lor_other, + .type =3D ARM_CP_CONST, .resetvalue =3D 0 }, + { .name =3D "LORN_EL1", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 3, .opc1 =3D 0, .crn =3D 10, .crm =3D 4, .opc2 =3D= 2, + .access =3D PL1_RW, .accessfn =3D access_lor_other, + .type =3D ARM_CP_CONST, .resetvalue =3D 0 }, + { .name =3D "LORC_EL1", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 3, .opc1 =3D 0, .crn =3D 10, .crm =3D 4, .opc2 =3D= 3, + .access =3D PL1_RW, .accessfn =3D access_lor_other, + .type =3D ARM_CP_CONST, .resetvalue =3D 0 }, + { .name =3D "LORID_EL1", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 3, .opc1 =3D 0, .crn =3D 10, .crm =3D 4, .opc2 =3D= 7, + .access =3D PL1_R, .accessfn =3D access_lorid, + .type =3D ARM_CP_CONST, .resetvalue =3D 0 }, + REGINFO_SENTINEL + }; + define_arm_cp_regs(cpu, lor_reginfo); + } + if (cpu_isar_feature(aa64_sve, cpu)) { define_one_arm_cp_reg(cpu, &zcr_el1_reginfo); if (arm_feature(env, ARM_FEATURE_EL2)) { diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index fd36425f1ae..e1da1e4d6f5 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -2290,6 +2290,12 @@ static void disas_ldst_excl(DisasContext *s, uint32_= t insn) } return; =20 + case 0x8: /* STLLR */ + if (!dc_isar_feature(aa64_lor, s)) { + break; + } + /* StoreLORelease is the same as Store-Release for QEMU. */ + /* fall through */ case 0x9: /* STLR */ /* Generate ISS for non-exclusive accesses including LASR. */ if (rn =3D=3D 31) { @@ -2301,6 +2307,12 @@ static void disas_ldst_excl(DisasContext *s, uint32_= t insn) disas_ldst_compute_iss_sf(size, false, 0), is_lasr); return; =20 + case 0xc: /* LDLAR */ + if (!dc_isar_feature(aa64_lor, s)) { + break; + } + /* LoadLOAcquire is the same as Load-Acquire for QEMU. */ + /* fall through */ case 0xd: /* LDAR */ /* Generate ISS for non-exclusive accesses including LASR. */ if (rn =3D=3D 31) { --=20 2.19.2