From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= Subject: Re: start of day, special pages Date: Wed, 30 Oct 2013 14:11:51 +0100 Message-ID: <52710597.1020506@gmail.com> References: <5270FC5E.2080401@gmail.com> <20131030130335.GA24078@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5353459837455865815==" Return-path: In-Reply-To: <20131030130335.GA24078@phenom.dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============5353459837455865815== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2EKSRWRPLSGCOKIFMHIIV" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2EKSRWRPLSGCOKIFMHIIV Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 30.10.2013 14:03, Konrad Rzeszutek Wilk wrote: > On Wed, Oct 30, 2013 at 01:32:30PM +0100, Vladimir '=CF=86-coder/phcode= r' Serbinenko wrote: >> Hello, all. I'm writing pvgrub2 ( for those interested >> http://git.savannah.gnu.org/cgit/grub.git/log/?h=3Dphcoder/newports/xe= n ) >> Now I'm able to load pvgrub2 from pvgrub2. Now I'm trying to load >> NetBSD. Apparently NetBSD assumes that console interface is mapping in= >> start-of-day layout and I paid special care not to map any special pag= es >> in start-of-day. Which special pages have to be mapped and where? >> Accoring to xen.h: >> * 1. The domain is started within contiguous virtual-memory region. >> * 2. The contiguous region ends on an aligned 4MB boundary. >> * 3. This the order of bootstrap elements in the initial virtual reg= ion: >> * a. relocated kernel image >> * b. initial ram disk [mod_start, mod_len] >> * c. list of allocated page frames [mfn_list, nr_pages] >> * (unless relocated due to XEN_ELFNOTE_INIT_P2M) >> * d. start_info_t structure [register ESI (x86)] >=20 > That structure has the information: >=20 >=20 > #ifdef XEN_HAVE_PV_GUEST_ENTRY > struct start_info { > /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME. = */ > char magic[32]; /* "xen--". = */ > unsigned long nr_pages; /* Total pages allocated to this domain= =2E */ > unsigned long shared_info; /* MACHINE address of shared info struc= t. */ > uint32_t flags; /* SIF_xxx flags. = */ > xen_pfn_t store_mfn; /* MACHINE page number of shared page. = */ > uint32_t store_evtchn; /* Event channel for store communicatio= n. */ > union { > struct { > xen_pfn_t mfn; /* MACHINE page number of console page.= */ <=3D=3D=3D=3D > uint32_t evtchn; /* Event channel for console page. = */ > } domU; > struct { > uint32_t info_off; /* Offset of console_info struct. = */ > uint32_t info_size; /* Size of console_info struct from sta= rt.*/ > } dom0; > } console; > /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME). = */ > unsigned long pt_base; /* VIRTUAL address of page directory. = */ > unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames. = */ > unsigned long mfn_list; /* VIRTUAL address of page-frame list. = */ > unsigned long mod_start; /* VIRTUAL address of pre-loaded module= */ > /* (PFN of pre-loaded module if = */ > /* SIF_MOD_START_PFN set in flags). = */ > unsigned long mod_len; /* Size (bytes) of pre-loaded module. = */ > #define MAX_GUEST_CMDLINE 1024 > int8_t cmd_line[MAX_GUEST_CMDLINE]; > /* The pfn range here covers both page table and p->m table frames.= */ > unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M table. = */ > unsigned long nr_p2m_frames;/* # of pfns forming initial P->M table= =2E */ > }; >=20 > You need to consult console.domU.mfn. >=20 Yes, I understand that but it's not my question. My question is where I should map it to when handing off control to another kernel. >=20 >> * e. bootstrap page tables [pt_base and CR3 (x86)] >> * f. bootstrap stack [register ESP (x86)] >> * 4. Bootstrap elements are packed together, but each is 4kB-aligned= =2E >> * 5. The initial ram disk may be omitted. >> * 6. The list of page frames forms a contiguous 'pseudo-physical' me= mory >> * layout for the domain. In particular, the bootstrap virtual-mem= ory >> * region is a 1:1 mapping to the first section of the >> pseudo-physical map. >> * 7. All bootstrap elements are mapped read-writable for the guest O= S. The >> * only exception is the bootstrap page table, which is mapped >> read-only. >> * 8. There is guaranteed to be at least 512kB padding after the fina= l >> * bootstrap element. If necessary, the bootstrap virtual region i= s >> * extended by an extra 4MB to ensure this. >> >> I see no mention of mapped console interface at all. >> >=20 >=20 >=20 >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xen.org >> http://lists.xen.org/xen-devel >=20 >=20 ------enig2EKSRWRPLSGCOKIFMHIIV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlJxBZgACgkQNak7dOguQgmIlwEAiFnsU2X7uOopdUbA/1Sb+91X z3/X1liEIJE+mLeApRgA/1ubD7Buvo7hg5lVVvTFy0xiPEnIWv8UpEXstLiQ4bpC =sxkN -----END PGP SIGNATURE----- ------enig2EKSRWRPLSGCOKIFMHIIV-- --===============5353459837455865815== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============5353459837455865815==--