From nobody@FreeBSD.org  Tue Sep 15 23:16:25 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 842BA106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Sep 2009 23:16:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 72F8B8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Sep 2009 23:16:25 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FNGP0P045157
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Sep 2009 23:16:25 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n8FNGOZO045156;
	Tue, 15 Sep 2009 23:16:24 GMT
	(envelope-from nobody)
Message-Id: <200909152316.n8FNGOZO045156@www.freebsd.org>
Date: Tue, 15 Sep 2009 23:16:24 GMT
From: Kevin Day <kevin@your.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pmap_invalidate_cache_range panic on boot in 8.0-BETA4 in XenServer VM
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         138863
>Category:       kern
>Synopsis:       [xen] [panic] pmap_invalidate_cache_range panic on boot in 8.0-BETA4 in XenServer VM
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kib
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 15 23:20:03 UTC 2009
>Closed-Date:    Mon Mar 15 17:31:58 UTC 2010
>Last-Modified:  Mon Mar 15 17:31:58 UTC 2010
>Originator:     Kevin Day
>Release:        8.0-BETA4
>Organization:
Your.Org, Inc.
>Environment:
8.0-BETA4 dvd boot disk
>Description:
FreeBSD 7.x and early snapshots of 8.0 worked fine in XenServer VM instances. Trying 8.0-BETA4 gives me: (hand typed)


real memory  = 536870912 (512 MB)
avail memory = 482701312 (460 MB)
kernel trap 9 with interrupts disabled

Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer      = 0x20:0xfffffff805b2e3
stack pointer                = 0x20:0xffffffff81402bb0
code segment              = base 0x0, limit 0xfffff, type 0x1b
                                       = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags          = resume, IOPL = 0
current process            = 0 ()
[thread pid 0 tid 0 ]
Stopped at      pmap_invalidate_cache_range+0x43:       clflushl      (%rdi)
db> bt
Tracing pid 0 tid 0 td 0xffffffff80c1bba0
pmap_invalidate_cache_range() at pmap_invalidate_cache_range+0x43
pmap_change_attr_locked() at pmap_change_attr_locked+0x368
pmap_change_attr() at pmap_change_addr+0x43
pmap_mapdev_attr() at pmap_mapdev_attr+0x112
lapic_init() at lapic_init+0x29
madt_setup_local() at madt_setup_local+0x26
apic_setup_local() at apic_setup_local+0x13
mi_startup() at mi_startup+0x59
btext() at btext+0x2c


Booting with ACPI disabled gets me further into the boot, but dies similarly in pmap_invalidate_cache_range when nexus_activate_resource() tries to map an address in.


>How-To-Repeat:
Boot FreeBSD 8.0-BETA4 DVD in a XenServer instance
>Fix:
n/a

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-xen 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Sep 16 01:06:34 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138863 
Responsible-Changed-From-To: freebsd-xen->kib 
Responsible-Changed-By: kib 
Responsible-Changed-When: Wed Sep 16 13:00:49 UTC 2009 
Responsible-Changed-Why:  
I assume you use GENERIC i386 with full system virtualization (or whatever 
it is called in XEN). 

I am interested in the backtrace for !acpi case too. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138863 

From: Kevin Day <kevin@your.org>
To: kib@freebsd.org
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/138863: [xen] [panic] pmap_invalidate_cache_range panic on boot in 8.0-BETA4 in XenServer VM
Date: Wed, 16 Sep 2009 10:04:26 -0500

 This is amd64 8.0-BETA4 GENERIC, running in a XenServer 5.5 fully  
 virtualized VM.
 
 Since I don't want to make any mistakes, here are screenshots of the  
 lengthy backtrace !acpi:
 
 http://dl.getdropbox.com/u/230717/temp/xen1.png
 http://dl.getdropbox.com/u/230717/temp/xen2.png
 http://dl.getdropbox.com/u/230717/temp/xen3.png
 http://dl.getdropbox.com/u/230717/temp/xen4.png
 http://dl.getdropbox.com/u/230717/temp/xen5.png
 
 Also note the recent change to these very lines of  
 pmap_invalidate_cache_range (http://lists.freebsd.org/pipermail/svn-src-stable-8/2009-September/000173.html 
 )  Was this before or after BETA4 was built?
 
State-Changed-From-To: open->feedback 
State-Changed-By: kib 
State-Changed-When: Mon Mar 15 11:28:57 UTC 2010 
State-Changed-Why:  
There were several workarounds committed to both HEAD and recent stable/8 
for the CLFLUSH issues. 

Does it still happens to you. If yes, did you tried change the settings 
of hw.clflush_disable loader tunable ? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138863 

From: Kevin <kevin@your.org>
To: bug-followup@FreeBSD.org
Cc: kib@freebsd.org
Subject: Re: kern/138863: [xen] [panic] pmap_invalidate_cache_range panic on boot in 8.0-BETA4 in XenServer VM
Date: Mon, 15 Mar 2010 11:34:56 -0500

 Setting this flag lets me get further in the boot, but 8.0 still isn't =
 bootable on 23xx series Opterons. I no longer have XenServer installed =
 on any of these boxes, so I'm unable to do any further testing though.
 
 -- Kevin
 
State-Changed-From-To: feedback->closed 
State-Changed-By: kib 
State-Changed-When: Mon Mar 15 17:30:52 UTC 2010 
State-Changed-Why:  
The issue reported was worked around in HEAD, 8 and 7. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138863 
>Unformatted:
