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

Re: [PATCH] x86/PV: assert page state in mark_pv_pt_pages_rdonly()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 17 Aug 2021 13:46:40 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4+pxUy5NSZ2UENkdCEJ8Jr68HilbO6ZIu6YVZV0r71w=; b=RLSgIn5D/qwC4bFHMmkVVz5cAjQmBu+ZUh2ys/0psUKcR8FEByvUszae4FxFdMME+O5PZyq1GZsqedTffZg1+l/QGcoVMx9qP90IXzZc0fJ02UvdZvEDgS1tqouPcQBgy+In5j04AODz7cGKGjlBUb2hvMXWqZAhx/cMGz68q8aRiRPRQtK9Vi9pEWwfhqGdz8sz2Nj191DHSqoDUTT2y3aGulYgoMtvUrp8hDMs625qNqIm7dsWpFRUNrJja/C+0/De0OqX9AVBkW7+LKMBxZ4qnqCAkvYE6N6oVtX+ehpKygf8JfAwLNrfJ2Q0l7idpWjtDh2D6Yspy4kPEHmuNw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OfsPS7IfBwRWzmcRF+/khoEBSiewx6hKEfkhfxb9ZDJRLyBdJ/n7LG+IRrEn2SDGgagErhSa02Oa/+//n3jacG4qcAtsU3uk+Mt4KA67HQ1pMX5AJto05fndMFwoopeJt9O6APuNplmiqiYi5aRz3M6jJw0oPmNQwEvw/uH0S3uvrQCd2/4rPL1md6vu6uD/4YfBRZXfJ9e8F27Kik443yWGOySIgJ4NTitXc9FrtFMct200mjTdVo7ciWAl6IBF8nOd4OQXt6QbdqlLEdOY1btltHE8iDPwcNFhRRXlRFaRQoPwMxXkRUmB0fKOOKm+S8cOmbbJSP24P1/SH5cocA==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 17 Aug 2021 11:46:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17.08.2021 12:30, Andrew Cooper wrote:
> On 17/08/2021 09:54, Jan Beulich wrote:
>> On 16.08.2021 21:25, Andrew Cooper wrote:
>>> On 16/08/2021 16:29, Jan Beulich wrote:
>>>> and an apparently wrong comment stating
>>>> that not only v_end but also v_start would be superpage aligned
>>> Which comment?  The only one I see about 4M has nothing to do with
>>> superpages.
>> The one immediately ahead of the related variable declarations:
>>
>>     /*
>>      * This fully describes the memory layout of the initial domain. All
>>      * *_start address are page-aligned, except v_start (and v_end) which are
>>      * superpage-aligned.
>>      */
>>
>> I see nothing forcing v_start to be superpage-aligned, while I
>> do suspect that the "calculation" of the number of page tables
>> will be wrong when it isn't.
> 
> This is an XTF test booting as dom0
> 
> (d2) (XEN) *** Building a PV Dom0 ***
> (d2) (XEN) ELF: phdr: paddr=0x100000 memsz=0x12000
> (d2) (XEN) ELF: memory: 0x100000 -> 0x112000
> (d2) (XEN) ELF: note: GUEST_OS = "XTF"
> (d2) (XEN) ELF: note: GUEST_VERSION = "0"
> (d2) (XEN) ELF: note: LOADER = "generic"
> (d2) (XEN) ELF: note: HYPERCALL_PAGE = 0x106000
> (d2) (XEN) ELF: note: XEN_VERSION = "xen-3.0"
> (d2) (XEN) ELF: note: FEATURES = "!writable_page_tables|pae_pgdir_above_4gb"
> (d2) (XEN) ELF: note: PAE_MODE = "yes"
> (d2) (XEN) ELF: using notes from SHT_NOTE section
> (d2) (XEN) ELF: VIRT_BASE unset, using 0
> (d2) (XEN) ELF_PADDR_OFFSET unset, using 0
> (d2) (XEN) ELF: addresses:
> (d2) (XEN)     virt_base        = 0x0
> (d2) (XEN)     elf_paddr_offset = 0x0
> (d2) (XEN)     virt_offset      = 0x0
> (d2) (XEN)     virt_kstart      = 0x100000
> (d2) (XEN)     virt_kend        = 0x112000
> (d2) (XEN)     virt_entry       = 0x100000
> (d2) (XEN)     p2m_base         = 0xffffffffffffffff
> (d2) (XEN)  Xen  kernel: 64-bit, lsb, compat32
> (d2) (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x100000 -> 0x112000
> (d2) (XEN) PHYSICAL MEMORY ARRANGEMENT:
> (d2) (XEN)  Dom0 alloc.:   000000003e800000->000000003ec00000 (240731
> pages to be allocated)
> (d2) (XEN) VIRTUAL MEMORY ARRANGEMENT:
> (d2) (XEN)  Loaded kernel: 0000000000100000->0000000000112000
> (d2) (XEN)  Init. ramdisk: 0000000000112000->0000000000112000
> (d2) (XEN)  Phys-Mach map: 0000000000112000->00000000002ea2d8
> (d2) (XEN)  Start info:    00000000002eb000->00000000002eb4b8
> (d2) (XEN)  Xenstore ring: 0000000000000000->0000000000000000
> (d2) (XEN)  Console ring:  0000000000000000->0000000000000000
> (d2) (XEN)  Page tables:   00000000002ec000->00000000002f1000
> (d2) (XEN)  Boot stack:    00000000002f1000->00000000002f2000
> (d2) (XEN)  TOTAL:         0000000000000000->0000000000400000
> (d2) (XEN)  ENTRY ADDRESS: 0000000000100000
> 
> It would appear that v_start comes directly and unmodified from the
> VIRT_BASE ELF note.
> 
> Other observations:  The ramdisk start/end aren't zero despite one being
> absent, and the M2P and start info ends aren't aligned.

I've already dealt with this ramdisk aspect in the v2 patch altering
the printing. For *_end there's nothing wrong to be misaligned (as
per the comment in question) - only v_end has a statement.

Jan




 


Rackspace

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