[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH 2/2] xen/mm: Introduce PG_state_uninitialised
- To: Jan Beulich <jbeulich@xxxxxxxx>, David Woodhouse <dwmw2@xxxxxxxxxxxxx>
- From: Julien Grall <julien@xxxxxxx>
- Date: Thu, 20 Feb 2020 13:27:05 +0000
- Cc: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "wl@xxxxxxx" <wl@xxxxxxx>, "konrad.wilk@xxxxxxxxxx" <konrad.wilk@xxxxxxxxxx>, "george.dunlap@xxxxxxxxxxxxx" <george.dunlap@xxxxxxxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "ian.jackson@xxxxxxxxxxxxx" <ian.jackson@xxxxxxxxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "jeff.kubascik@xxxxxxxxxxxxxxx" <jeff.kubascik@xxxxxxxxxxxxxxx>, "Xia, Hongyan" <hongyxia@xxxxxxxxxx>, "stewart.hildebrand@xxxxxxxxxxxxxxx" <stewart.hildebrand@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 20 Feb 2020 13:27:15 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi,
On 20/02/2020 11:59, Jan Beulich wrote:
On 07.02.2020 19:04, David Woodhouse wrote:
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -488,7 +488,8 @@ void share_xen_page_with_guest(struct page_info *page,
struct domain *d,
page_set_owner(page, d);
smp_wmb(); /* install valid domain ptr before updating refcnt. */
- ASSERT((page->count_info & ~PGC_xen_heap) == 0);
+ ASSERT((page->count_info & ~PGC_xen_heap) == PGC_state_inuse ||
+ (page->count_info & ~PGC_xen_heap) == PGC_state_uninitialised);
Can uninitialized pages really make it here?
IIRC, arch_init_memory() will share the first 1MB of the RAM but they
were never given to the page allocator.
01,10 +2316,11 @@ int assign_pages(
for ( i = 0; i < (1 << order); i++ )
{
ASSERT(page_get_owner(&pg[i]) == NULL);
- ASSERT(!pg[i].count_info);
+ ASSERT(pg[i].count_info == PGC_state_inuse ||
+ pg[i].count_info == PGC_state_uninitialised);
Same question here: Can uninitialized pages make it here?
Yes, in dom0_construct_pv() when the initrd is assigned to the guest.
If
so, wouldn't it be better to correct this, rather than having
the more permissive assertion?
We would need to rework init_heap_pages() (or create a new function) so
the allocator initialize the state but it is marked as "reserved/used"
rather than "freed".
Most likely we will need a similar function for liveupdate. This is
because the pages belonging to guests should be untouched.
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|