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-devel

[Xen-devel] Confused about start of day setup

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Confused about start of day setup
From: Goswin von Brederlow <brederlo@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 23 Sep 2007 07:29:04 +0200
Delivery-date: Mon, 24 Sep 2007 09:41:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)
Hi,

I hope I'm right here. If not then please point me in the right
direction.

My problem in short:
I have problems using (pinning, mmu_update) physical pages from
0x900000 to 0xB1000 usualy.

I'm writing my own little amd64 64bit toy kernel (based on Mini-OS as
starting point) for xen and I run into problems with the way the start
of day sets up the physical pages.

My kernel is mapped at 0 (due to Mini-OS being there):
  _text                  : 0x0
  _etext                 : 0xcaef
  _edata                 : 0xe8c4
  __bss_start            : 0x10000
  _end                   : 0x21590

  nr_pages               : 3072
  start_info             : 0x27000
  pt_base                : 0x2a000
  nr_pt_frames           : 5
  machine_to_phys_mapping: 0xffff800000000000
  phys_to_machine_mapping: 0x21000

The Mini-OS source says that free pages follow pt_base + nr_pt_frames
+ 3 (store, console, something pages). So far so good. So I reserve
myself 42 pages for initial data structures and remove the rest from
the initial page tables. After some initializing I move over the
unmapped pages, pin them as PIN_L1_TABLE and UNPIN_TABLE before adding
the machine addresses to my list of free pages.

Now here is an example output of this loop:

ERROR: -22 pinning failed: addr = 90000 [212000], op = 0, mfn = 212
ERROR: -22 pinning failed: addr = 91000 [0], op = 0, mfn = 0
ERROR: -22 pinning failed: addr = 92000 [b3d5000], op = 0, mfn = b3d5
ERROR: -22 pinning failed: addr = 93000 [2000], op = 0, mfn = 2
ERROR: -22 pinning failed: addr = 96000 [2000], op = 0, mfn = 2
ERROR: -22 pinning failed: addr = 97000 [1000000], op = 0, mfn = 1000
ERROR: -22 pinning failed: addr = 98000 [0], op = 0, mfn = 0
ERROR: -22 pinning failed: addr = 99000 [1000], op = 0, mfn = 1
ERROR: -22 pinning failed: addr = 9a000 [0], op = 0, mfn = 0
ERROR: -22 pinning failed: addr = 9b000 [1cb58000], op = 0, mfn = 1cb58
ERROR: -22 pinning failed: addr = 9c000 [707b000], op = 0, mfn = 707b
ERROR: -22 pinning failed: addr = 9d000 [0], op = 0, mfn = 0
ERROR: -22 pinning failed: addr = 9e000 [7753000], op = 0, mfn = 7753
ERROR: -22 pinning failed: addr = a0000 [0], op = 0, mfn = 0
ERROR: -22 pinning failed: addr = a1000 [1cf10000], op = 0, mfn = 1cf10
ERROR: -22 pinning failed: addr = a2000 [1000], op = 0, mfn = 1
ERROR: -22 pinning failed: addr = a3000 [0], op = 0, mfn = 0
ERROR: -22 pinning failed: addr = a4000 [ffffffff000], op = 0, mfn = ffffffff
ERROR: -22 pinning failed: addr = a5000 [0], op = 0, mfn = 0
ERROR: -22 pinning failed: addr = a6000 [781d000], op = 0, mfn = 781d
ERROR: -22 pinning failed: addr = a7000 [1cb58000], op = 0, mfn = 1cb58
ERROR: -22 pinning failed: addr = ac000 [0], op = 0, mfn = 0
ERROR: -22 pinning failed: addr = ad000 [0], op = 0, mfn = 0
ERROR: -22 pinning failed: addr = ae000 [0], op = 0, mfn = 0
ERROR: -22 pinning failed: addr = af000 [0], op = 0, mfn = 0
ERROR: -22 pinning failed: addr = b0000 [1000000], op = 0, mfn = 1000
ERROR: -22 pinning failed: addr = b1000 [21000000], op = 0, mfn = 21000

       <return of mmuext_op>     <phys> [mach]    <contents of mmuext_op_t>

where I loop over <phys> and [mach] is from the phys_to_machine_mapping.

The number of errors varies between runs but repeats for consecutive
runs and is (all but once I've seen) one continuious chunk. It appears
to be also limited to the first 512 physical pages and centered around
0xA0000.

I looked at my code and can't find anything wrong. The pages that
don't fail the initial pin/unpin test I can use fine as PageTables or
as normal data pages later on.


Is there something supposed to be mapped at that address range that I
should stay out of? Or am I seeing some bug in xen that causes a
corrupted phys to machine mapping?

MfG
        Goswin

Hardware info:
# xm info
host                   : book
release                : 2.6.20.9-xen-1
version                : #1 SMP Fri Apr 27 10:45:05 CEST 2007
machine                : x86_64
nr_cpus                : 2
nr_nodes               : 1
sockets_per_node       : 1
cores_per_socket       : 2
threads_per_core       : 1
cpu_mhz                : 1995
hw_caps                : 
178bfbff:ebd3fbff:00000000:00000010:00002001:00000000:0000001f
total_memory           : 1919
free_memory            : 1024
xen_major              : 3
xen_minor              : 0
xen_extra              : .4-1
xen_caps               : xen-3.0-x86_64 hvm-3.0-x86_32 hvm-3.0-x86_32p 
hvm-3.0-x86_64
xen_pagesize           : 4096
platform_params        : virt_start=0xffff800000000000
xen_changeset          : unavailable
cc_compiler            : gcc version 4.1.2 20061115 (prerelease) (Debian 
4.1.1-21)
cc_compile_by          : mrvn
cc_compile_domain      : book.localnet
cc_compile_date        : Sat Sep 22 01:27:47 CEST 2007
xend_config_format     : 3

Domain Config:
#----------------------------------------------------------------------------
# Kernel image file.
kernel = "kernel.gz"

# Initial memory allocation (in megabytes) for the new domain.
# Should be at least 12 MB
memory = 12

# A name for your domain. All domains must have different names.
name = "Moose"

on_crash = 'destroy'

vfb = [ 'type=sdl' ]

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