From patchwork Thu Aug 4 13:06:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 1035322 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p74D6jpx029318 for ; Thu, 4 Aug 2011 13:08:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753635Ab1HDNG5 (ORCPT ); Thu, 4 Aug 2011 09:06:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3542 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753639Ab1HDNGm (ORCPT ); Thu, 4 Aug 2011 09:06:42 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p74D6el3022487 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Aug 2011 09:06:40 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p74D6d4R012288; Thu, 4 Aug 2011 09:06:40 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id CFDF0250B43; Thu, 4 Aug 2011 16:06:37 +0300 (IDT) From: Avi Kivity To: Anthony Liguori , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , kvm@vger.kernel.org Subject: [PATCH v3 10/39] Integrate I/O memory regions into qemu Date: Thu, 4 Aug 2011 16:06:06 +0300 Message-Id: <1312463195-13605-11-git-send-email-avi@redhat.com> In-Reply-To: <1312463195-13605-1-git-send-email-avi@redhat.com> References: <1312463195-13605-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 04 Aug 2011 13:08:18 +0000 (UTC) get_system_io() returns the root I/O memory region. Reviewed-by: Richard Henderson Signed-off-by: Avi Kivity --- exec-memory.h | 2 ++ exec.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/exec-memory.h b/exec-memory.h index c439aba..999fd69 100644 --- a/exec-memory.h +++ b/exec-memory.h @@ -28,6 +28,8 @@ */ MemoryRegion *get_system_memory(void); +MemoryRegion *get_system_io(void); + /* Set the root memory region. This region is the system memory map. */ void set_system_memory_map(MemoryRegion *mr); diff --git a/exec.c b/exec.c index 751fd89..c93c980 100644 --- a/exec.c +++ b/exec.c @@ -113,6 +113,7 @@ static int in_migration; RAMList ram_list = { .blocks = QLIST_HEAD_INITIALIZER(ram_list) }; static MemoryRegion *system_memory; +static MemoryRegion *system_io; #endif @@ -3820,6 +3821,10 @@ static void memory_map_init(void) system_memory = qemu_malloc(sizeof(*system_memory)); memory_region_init(system_memory, "system", INT64_MAX); set_system_memory_map(system_memory); + + system_io = qemu_malloc(sizeof(*system_io)); + memory_region_init(system_io, "io", 65536); + set_system_io_map(system_io); } MemoryRegion *get_system_memory(void) @@ -3827,6 +3832,11 @@ MemoryRegion *get_system_memory(void) return system_memory; } +MemoryRegion *get_system_io(void) +{ + return system_io; +} + #endif /* !defined(CONFIG_USER_ONLY) */ /* physical memory access (slow version, mainly for debug) */