From patchwork Sun Jul 14 22:16:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 258910 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 258EC2C00F8 for ; Mon, 15 Jul 2013 08:17:20 +1000 (EST) Received: from localhost ([::1]:42934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyUbV-0002nk-Vb for incoming@patchwork.ozlabs.org; Sun, 14 Jul 2013 18:17:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyUav-0002hE-9t for qemu-devel@nongnu.org; Sun, 14 Jul 2013 18:16:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyUar-000594-Go for qemu-devel@nongnu.org; Sun, 14 Jul 2013 18:16:41 -0400 Received: from mail-pb0-x22f.google.com ([2607:f8b0:400e:c01::22f]:64108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyUar-00058w-AB for qemu-devel@nongnu.org; Sun, 14 Jul 2013 18:16:37 -0400 Received: by mail-pb0-f47.google.com with SMTP id rr13so10628211pbb.6 for ; Sun, 14 Jul 2013 15:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=Ktu9ozTNskkQRNguKiCvad6PLsB9iTV029POf6eOR8Y=; b=zAU7yOLZdIdYbdC7fOwB1ps83D4AQUmm9h/9zwrEwVNGsao2FKP5ac85ud36OOJmJF EmeB2ABsSCMEd8TaE5BHTMpyiqKl0V2mA9Q0p36Jb+l3jDEpZcbhoX0q7c6sDeu8ZZRC A3W/NtxFftDyZPXck1IfSX+JiarB4lg9fMU6iVuzEqHrdIF72x8mZ7pcvoS26j23V5/s OOoiLqgDS2qktHRN3KRDvl5vu7UOmY4ypU+9B9Q+fmrrIDDTgvMBMRjyC7AwPi87SzTM upDSe6j4CltkE6ceSJ0HR3/HZH+8StTJz4NmWvIJRexFHl2FFvxybBQiidHwyNf/huxv sk/Q== X-Received: by 10.69.13.132 with SMTP id ey4mr41393612pbd.52.1373840196624; Sun, 14 Jul 2013 15:16:36 -0700 (PDT) Received: from pebble.com ([216.239.55.194]) by mx.google.com with ESMTPSA id dg3sm57216706pbc.24.2013.07.14.15.16.35 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 14 Jul 2013 15:16:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 14 Jul 2013 15:16:08 -0700 Message-Id: <1373840171-25556-3-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1373840171-25556-1-git-send-email-rth@twiddle.net> References: <1373840171-25556-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::22f Cc: aliguori@us.ibm.com, Richard Henderson Subject: [Qemu-devel] [PULL 2/5] hw/alpha: Don't machine check on missing pci i/o X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Not really correct, but we don't implement all of the random devices that the kernel looks for. This is good enough to keep us booting. Signed-off-by: Richard Henderson --- hw/alpha/alpha_sys.h | 1 + hw/alpha/pci.c | 26 ++++++++++++++++++++++++++ hw/alpha/typhoon.c | 3 ++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h index 0987851..e11025b 100644 --- a/hw/alpha/alpha_sys.h +++ b/hw/alpha/alpha_sys.h @@ -14,6 +14,7 @@ PCIBus *typhoon_init(ram_addr_t, ISABus **, qemu_irq *, AlphaCPU *[4], pci_map_irq_fn); /* alpha_pci.c. */ +extern const MemoryRegionOps alpha_pci_ignore_ops; extern const MemoryRegionOps alpha_pci_conf1_ops; extern const MemoryRegionOps alpha_pci_iack_ops; diff --git a/hw/alpha/pci.c b/hw/alpha/pci.c index 25637e0..d839dd5 100644 --- a/hw/alpha/pci.c +++ b/hw/alpha/pci.c @@ -12,6 +12,32 @@ #include "sysemu/sysemu.h" +/* Fallback for unassigned PCI I/O operations. Avoids MCHK. */ + +static uint64_t ignore_read(void *opaque, hwaddr addr, unsigned size) +{ + return 0; +} + +static void ignore_write(void *opaque, hwaddr addr, uint64_t v, unsigned size) +{ +} + +const MemoryRegionOps alpha_pci_ignore_ops = { + .read = ignore_read, + .write = ignore_write, + .endianness = DEVICE_LITTLE_ENDIAN, + .valid = { + .min_access_size = 1, + .max_access_size = 8, + }, + .impl = { + .min_access_size = 1, + .max_access_size = 8, + }, +}; + + /* PCI config space reads/writes, to byte-word addressable memory. */ static uint64_t bw_conf1_read(void *opaque, hwaddr addr, unsigned size) diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index 9dac9df..69e2255 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -764,7 +764,8 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, &s->pchip.reg_mem); /* Pchip0 PCI I/O, 0x801.FC00.0000, 32MB. */ - memory_region_init(&s->pchip.reg_io, OBJECT(s), "pci0-io", 32*MB); + memory_region_init_io(&s->pchip.reg_io, OBJECT(s), &alpha_pci_ignore_ops, + NULL, "pci0-io", 32*MB); memory_region_add_subregion(addr_space, 0x801fc000000ULL, &s->pchip.reg_io);