From nobody Sat Nov 8 03:26:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549488828466532.0212686249428; Wed, 6 Feb 2019 13:33:48 -0800 (PST) Received: from localhost ([127.0.0.1]:58849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grUpC-0003li-Be for importer@patchew.org; Wed, 06 Feb 2019 16:33:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grUmy-0002oD-W3 for qemu-devel@nongnu.org; Wed, 06 Feb 2019 16:31:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grUmw-00049L-Vz for qemu-devel@nongnu.org; Wed, 06 Feb 2019 16:31:24 -0500 Received: from chuckie.co.uk ([82.165.15.123]:41958 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grUmt-00040z-5w for qemu-devel@nongnu.org; Wed, 06 Feb 2019 16:31:20 -0500 Received: from host86-138-240-60.range86-138.btcentralplus.com ([86.138.240.60] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1grUmi-00035H-5k; Wed, 06 Feb 2019 21:31:09 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Wed, 6 Feb 2019 21:30:40 +0000 Message-Id: <20190206213042.12537-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190206213042.12537-1-mark.cave-ayland@ilande.co.uk> References: <20190206213042.12537-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.138.240.60 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PULL 1/3] hw/sparc64: Create VGA device only if it has really been requested 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth The sun4u/sun4v machine currently always creates a VGA device, even if the user started QEMU with "-nodefaults" or "-vga none". That's likely not what the users expect in this case, so add a check whether the VGA adapter has really been requested. Signed-off-by: Thomas Huth Signed-off-by: Mark Cave-Ayland --- hw/sparc64/sun4u.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index f76b19e4e9..37ecc14c6d 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -596,7 +596,15 @@ static void sun4uv_init(MemoryRegion *address_space_me= m, qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 4, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_SER_IRQ)); =20 - pci_dev =3D pci_create_simple(pci_busA, PCI_DEVFN(2, 0), "VGA"); + switch (vga_interface_type) { + case VGA_STD: + pci_create_simple(pci_busA, PCI_DEVFN(2, 0), "VGA"); + break; + case VGA_NONE: + break; + default: + abort(); /* Should not happen - types are checked in vl.c alread= y */ + } =20 memset(&macaddr, 0, sizeof(MACAddr)); onboard_nic =3D false; --=20 2.11.0 From nobody Sat Nov 8 03:26:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549488804463117.74903935320685; Wed, 6 Feb 2019 13:33:24 -0800 (PST) Received: from localhost ([127.0.0.1]:58845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grUoo-0003a6-E4 for importer@patchew.org; Wed, 06 Feb 2019 16:33:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grUmq-0002ja-GO for qemu-devel@nongnu.org; Wed, 06 Feb 2019 16:31:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grUmo-00046R-HP for qemu-devel@nongnu.org; Wed, 06 Feb 2019 16:31:16 -0500 Received: from chuckie.co.uk ([82.165.15.123]:41962 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grUmm-00041F-Ha for qemu-devel@nongnu.org; Wed, 06 Feb 2019 16:31:12 -0500 Received: from host86-138-240-60.range86-138.btcentralplus.com ([86.138.240.60] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1grUmj-00035H-Jl; Wed, 06 Feb 2019 21:31:10 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Wed, 6 Feb 2019 21:30:41 +0000 Message-Id: <20190206213042.12537-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190206213042.12537-1-mark.cave-ayland@ilande.co.uk> References: <20190206213042.12537-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.138.240.60 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PULL 2/3] sun4u: add power_mem_read routine 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit Define skeleton 'power_mem_read' routine. Avoid NULL dereference. Reported-by: Fakhri Zulkifli Signed-off-by: Prasad J Pandit Signed-off-by: Mark Cave-Ayland --- hw/sparc64/sun4u.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 37ecc14c6d..518d695de3 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -214,6 +214,11 @@ typedef struct PowerDevice { } PowerDevice; =20 /* Power */ +static uint64_t power_mem_read(void *opaque, hwaddr addr, unsigned size) +{ + return 0; +} + static void power_mem_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { @@ -224,6 +229,7 @@ static void power_mem_write(void *opaque, hwaddr addr, } =20 static const MemoryRegionOps power_mem_ops =3D { + .read =3D power_mem_read, .write =3D power_mem_write, .endianness =3D DEVICE_NATIVE_ENDIAN, .valid =3D { --=20 2.11.0 From nobody Sat Nov 8 03:26:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 15494889684051014.938917088328; Wed, 6 Feb 2019 13:36:08 -0800 (PST) Received: from localhost ([127.0.0.1]:58902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grUrS-0005k3-BS for importer@patchew.org; Wed, 06 Feb 2019 16:36:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grUmw-0002mo-VO for qemu-devel@nongnu.org; Wed, 06 Feb 2019 16:31:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grUms-00047x-F8 for qemu-devel@nongnu.org; Wed, 06 Feb 2019 16:31:20 -0500 Received: from chuckie.co.uk ([82.165.15.123]:41960 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grUmq-00041D-H7 for qemu-devel@nongnu.org; Wed, 06 Feb 2019 16:31:17 -0500 Received: from host86-138-240-60.range86-138.btcentralplus.com ([86.138.240.60] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1grUmk-00035H-Ux; Wed, 06 Feb 2019 21:31:12 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Wed, 6 Feb 2019 21:30:42 +0000 Message-Id: <20190206213042.12537-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190206213042.12537-1-mark.cave-ayland@ilande.co.uk> References: <20190206213042.12537-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.138.240.60 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PULL 3/3] sun4m: pass initrd size to OpenBIOS via fw_cfg interface 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is to enable OpenBIOS to claim the initrd memory as in-use before atte= mpting to boot the kernel. Signed-off-by: Mark Cave-Ayland --- hw/sparc/sun4m.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 709ee37e08..1c9217315e 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -224,11 +224,12 @@ static uint64_t translate_kernel_address(void *opaque= , uint64_t addr) =20 static unsigned long sun4m_load_kernel(const char *kernel_filename, const char *initrd_filename, - ram_addr_t RAM_size) + ram_addr_t RAM_size, + uint32_t *initrd_size) { int linux_boot; unsigned int i; - long initrd_size, kernel_size; + long kernel_size; uint8_t *ptr; =20 linux_boot =3D (kernel_filename !=3D NULL); @@ -258,23 +259,23 @@ static unsigned long sun4m_load_kernel(const char *ke= rnel_filename, } =20 /* load initrd */ - initrd_size =3D 0; + *initrd_size =3D 0; if (initrd_filename) { - initrd_size =3D load_image_targphys(initrd_filename, - INITRD_LOAD_ADDR, - RAM_size - INITRD_LOAD_ADDR); - if (initrd_size < 0) { + *initrd_size =3D load_image_targphys(initrd_filename, + INITRD_LOAD_ADDR, + RAM_size - INITRD_LOAD_ADDR= ); + if ((int)*initrd_size < 0) { error_report("could not load initial ram disk '%s'", initrd_filename); exit(1); } } - if (initrd_size > 0) { + if (*initrd_size > 0) { for (i =3D 0; i < 64 * TARGET_PAGE_SIZE; i +=3D TARGET_PAGE_SI= ZE) { ptr =3D rom_ptr(KERNEL_LOAD_ADDR + i, 24); if (ptr && ldl_p(ptr) =3D=3D 0x48647253) { /* HdrS */ stl_p(ptr + 16, INITRD_LOAD_ADDR); - stl_p(ptr + 20, initrd_size); + stl_p(ptr + 20, *initrd_size); break; } } @@ -844,6 +845,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, qemu_irq *cpu_irqs[MAX_CPUS], slavio_irq[32], slavio_cpu_irq[MAX_CPUS]; qemu_irq fdc_tc; unsigned long kernel_size; + uint32_t initrd_size; DriveInfo *fd[MAX_FD]; FWCfgState *fw_cfg; unsigned int num_vsimms; @@ -1022,9 +1024,10 @@ static void sun4m_hw_init(const struct sun4m_hwdef *= hwdef, empty_slot_init(hwdef->bpp_base, 0x20); } =20 + initrd_size =3D 0; kernel_size =3D sun4m_load_kernel(machine->kernel_filename, machine->initrd_filename, - machine->ram_size); + machine->ram_size, &initrd_size); =20 nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, machine->kernel_cmd= line, machine->boot_order, machine->ram_size, kernel_size, @@ -1067,7 +1070,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *h= wdef, fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, 0); } fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_ADDR, INITRD_LOAD_ADDR); - fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, 0); // not used + fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size); fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, machine->boot_order[0]); qemu_register_boot_set(fw_cfg_boot_set, fw_cfg); } --=20 2.11.0