WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [IA64] This patch fixes dom0 no VGA conso

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] This patch fixes dom0 no VGA console bug.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Jun 2006 18:40:35 +0000
Delivery-date: Fri, 16 Jun 2006 11:43:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID e32ddb4a90e6c8ca2bc1191ae30a3c018e7444a2
# Parent  3f8523ce8895aaae21ec3af27152a6026f1314ff
[IA64] This patch fixes dom0 no VGA console bug.

After enabling dom0_vp mode, we lost the VGA console. 
The reason is that VGA frame buffer(0xa0000-0xc0000) was set
to conventional memory not IO in dom0's p2m table. 

Low conventional memory ranges are also given MDT entries for
dom0 to allow Linux to properly detect whether VGA is present.

Signed-off-by: Zhang xiantao <xiantao.zhang@xxxxxxxxx>
Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
 xen/arch/ia64/xen/dom_fw.c |   44 +++++++++++++++++++++++++++++++++++++++++---
 xen/arch/ia64/xen/mm.c     |   13 ++++++++++++-
 xen/include/asm-ia64/mm.h  |    2 ++
 3 files changed, 55 insertions(+), 4 deletions(-)

diff -r 3f8523ce8895 -r e32ddb4a90e6 xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c        Sat Jun 03 16:06:23 2006 -0600
+++ b/xen/arch/ia64/xen/dom_fw.c        Mon Jun 05 14:21:37 2006 -0600
@@ -760,6 +760,38 @@ dom_fw_dom0_passthrough(efi_memory_desc_
     return 0;
 }
 
+/*
+ * Create dom0 MDT entries for conventional memory below 1MB.  Without
+ * this Linux will assume VGA is present because 0xA0000 will always
+ * be either a hole in the MDT or an I/O region via the passthrough.
+ */
+static int
+dom_fw_dom0_lowmem(efi_memory_desc_t *md, void *arg__)
+{
+    struct dom0_passthrough_arg* arg = (struct dom0_passthrough_arg*)arg__;
+    u64 end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT);
+
+    BUG_ON(md->type != EFI_CONVENTIONAL_MEMORY);
+
+    if (md->phys_addr >= 1*MB)
+        return 0;
+
+    if (end > 1*MB)
+        end = 1*MB;
+
+    arg->md->type = md->type;
+    arg->md->pad = 0;
+    arg->md->phys_addr = md->phys_addr;
+    arg->md->virt_addr = 0;
+    arg->md->num_pages = (end - md->phys_addr) >> EFI_PAGE_SHIFT;
+    arg->md->attribute = md->attribute;
+    print_md(arg->md);
+
+    (*arg->i)++;
+    arg->md++;
+    return 0;
+}
+
 static int
 efi_mdt_cmp(const void *a, const void *b)
 {
@@ -1051,6 +1083,8 @@ dom_fw_init (struct domain *d, const cha
                                             dom_fw_dom0_passthrough, &arg);
                        efi_memmap_walk_type(EFI_MEMORY_MAPPED_IO_PORT_SPACE,
                                             dom_fw_dom0_passthrough, &arg);
+                       efi_memmap_walk_type(EFI_CONVENTIONAL_MEMORY,
+                                            dom_fw_dom0_lowmem, &arg);
                }
                else MAKE_MD(EFI_RESERVED_TYPE,0,0,0,0);
 
@@ -1164,9 +1198,13 @@ dom_fw_init (struct domain *d, const cha
                                }
                        }
                }
-               // work around for legacy device driver.
-               for (addr = 0; addr < 1 * MB; addr += PAGE_SIZE) {
-                       assign_new_domain0_page(d, addr);
+               // Map low-memory holes & unmapped MMIO for legacy drivers
+               for (addr = 0; addr < 1*MB; addr += PAGE_SIZE) {
+                       if (domain_page_mapped(d, addr))
+                               continue;
+                                       
+                       if (efi_mmio(addr, PAGE_SIZE))
+                               assign_domain_mmio_page(d, addr, PAGE_SIZE);
                }
                d->arch.physmap_built = 1;
        }
diff -r 3f8523ce8895 -r e32ddb4a90e6 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Sat Jun 03 16:06:23 2006 -0600
+++ b/xen/arch/ia64/xen/mm.c    Mon Jun 05 14:21:37 2006 -0600
@@ -579,7 +579,7 @@ assign_domain_same_page(struct domain *d
     }
 }
 
-static int
+int
 efi_mmio(unsigned long physaddr, unsigned long size)
 {
     void *efi_map_start, *efi_map_end;
@@ -968,6 +968,17 @@ domain_page_flush(struct domain* d, unsi
 {
     domain_flush_vtlb_all();
 }
+
+int
+domain_page_mapped(struct domain* d, unsigned long mpaddr)
+{
+    pte_t * pte;
+
+    pte=lookup_noalloc_domain_pte(d, mpaddr);
+    if(!pte_none(*pte))
+       return 1;
+    return 0;
+}
 #endif
 
 /* Flush cache of domain d.  */
diff -r 3f8523ce8895 -r e32ddb4a90e6 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h Sat Jun 03 16:06:23 2006 -0600
+++ b/xen/include/asm-ia64/mm.h Mon Jun 05 14:21:37 2006 -0600
@@ -433,6 +433,8 @@ extern unsigned long lookup_domain_mpa(s
 #ifdef CONFIG_XEN_IA64_DOM0_VP
 extern unsigned long assign_domain_mmio_page(struct domain *d, unsigned long 
mpaddr, unsigned long size);
 extern unsigned long assign_domain_mach_page(struct domain *d, unsigned long 
mpaddr, unsigned long size, unsigned long flags);
+int domain_page_mapped(struct domain *d, unsigned long mpaddr);
+int efi_mmio(unsigned long physaddr, unsigned long size);
 extern unsigned long __lookup_domain_mpa(struct domain *d, unsigned long 
mpaddr);
 extern unsigned long ____lookup_domain_mpa(struct domain *d, unsigned long 
mpaddr);
 extern unsigned long do_dom0vp_op(unsigned long cmd, unsigned long arg0, 
unsigned long arg1, unsigned long arg2, unsigned long arg3);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] This patch fixes dom0 no VGA console bug., Xen patchbot-unstable <=