Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: X server in dom0: Bad VBT signature



On 31 August 2012 22:45, Pierre Pronchery <khorben%defora.org@localhost> wrote:
>                         Hi,
>
> On Wed, 29 Aug 2012 01:26:02 +0100, Cherry G. Mathew wrote:
>
>>> Pierre Pronchery wrote:
>>> - http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=46634
>>> - 
>>> http://uberwall.org/bin/project/browse/101/UWvbiosdump?file=2FUWvbiosdump.c%2Cv&revision=1.1
>>> - http://mail-index.netbsd.org/port-xen/2012/04/thread1.html -
>>
>> riz@ and I have found the breakage, if you're in a hurry you can try
>> backing out this commit:
>> http://mail-index.netbsd.org/source-changes/2011/11/06/msg028702.html
>
> I just did, and X starts properly - thanks a lot!
>
>> We'll get a proper fix in ASAP.
>
> Again, that's great, looking forward to seeing it in RC2 :)
>
> Cheers,
> --
> khorben
>

Hi,

Wondering if anyone can test the following patch:

Cheers,
-- 
~Cherry

Index: arch/xen/include/xenfunc.h
===================================================================
RCS file: /cvsroot/src/sys/arch/xen/include/xenfunc.h,v
retrieving revision 1.15
diff -u -r1.15 xenfunc.h
--- arch/xen/include/xenfunc.h  23 Oct 2009 02:32:33 -0000      1.15
+++ arch/xen/include/xenfunc.h  2 Sep 2012 07:32:24 -0000
@@ -43,4 +43,17 @@
 #endif

 void xen_set_ldt(vaddr_t, uint32_t);
+
+#if defined(DOM0OPS)
+
+/* This is part of a hack to allow dom0 to access isa i/o "hole"s */
+static __inline bool
+xen_dom0_pa_isa_conflict(paddr_t pa)
+{
+       extern paddr_t pmap_pa_end;
+       return __predict_false(pa < 0x100000 || pa >= pmap_pa_end);
+}
+
+#endif /* DOM0OPS */
+
 #endif /* _XEN_XENFUNC_H_ */
Index: arch/x86/x86/pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/pmap.c,v
retrieving revision 1.178
diff -u -r1.178 pmap.c
--- arch/x86/x86/pmap.c 15 Jun 2012 13:53:40 -0000      1.178
+++ arch/x86/x86/pmap.c 2 Sep 2012 07:32:29 -0000
@@ -985,7 +985,12 @@
        else
                pte = kvtopte(va);
 #ifdef DOM0OPS
-       if (pa < pmap_pa_start || pa >= pmap_pa_end) {
+       if (xen_dom0_pa_isa_conflict(pa)) { /* dom0 wants to access ISA mem,
not ram */
+               /*
+                * This is a hack. The right thing to do would be to
+                * have bus_space_map() et al. manage the p2m/m2p
+                * tables.
+                */
 #ifdef DEBUG
                printf_nolog("%s: pa 0x%" PRIx64 " for va 0x%" PRIx64
                    " outside range\n", __func__, (int64_t)pa, (int64_t)va);
Index: arch/xen/x86/xen_pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/xen/x86/xen_pmap.c,v
retrieving revision 1.22
diff -u -r1.22 xen_pmap.c
--- arch/xen/x86/xen_pmap.c     24 Jun 2012 18:31:53 -0000      1.22
+++ arch/xen/x86/xen_pmap.c     2 Sep 2012 07:32:29 -0000
@@ -153,12 +153,18 @@
 {
         paddr_t ma;

-       if (__predict_false(pa < pmap_pa_start || pmap_pa_end <= pa)) {
-               ma = pa; /* XXX hack */
-       } else {
-               ma = xpmap_ptom(pa);
-       }
-
+#if defined(DOM0OPS)
+       if (xen_dom0_pa_isa_conflict(pa)) {
+               /*
+                * This is a hack. The right thing to do would be to
+                * have bus_space_map() et al. manage the p2m/m2p
+                * tables.
+                */
+               ma = pa;
+       } else
+#endif
+       ma = xpmap_ptom(pa);
+       
        return pmap_enter_ma(pmap, va, ma, pa, prot, flags, DOMID_SELF);
 }


Home | Main Index | Thread Index | Old Index