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

[Xen-devel] Confused about start of day setup



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.