Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Feb 2017 16:47:11 +0000
From:      "marcel (Marcel Moolenaar)" <phabric-noreply@FreeBSD.org>
To:        freebsd-virtualization@freebsd.org
Subject:   [Differential] D9686: fix UEFI VM's bootup on Hyper-V (i.e. Hyper-V Generation-2 VM)
Message-ID:  <d3ebe882c607364356c15e69e2c39fc0@localhost.localdomain>
In-Reply-To: <differential-rev-PHID-DREV-uh6r5mtg6hczhprjdyvk-req@FreeBSD.org>
References:  <differential-rev-PHID-DREV-uh6r5mtg6hczhprjdyvk-req@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

marcel added a comment.


  Going for the workaround I see! :-)

INLINE COMMENTS

> copy.c:56
> +	int i, ndesc;
> +	unsigned long aviable_pages;
> +

It's spelled "available" instead of "aviable" :-)

> copy.c:79-84
> +		if (KERNEL_PHYSICAL_BASE < start ||
> +		    KERNEL_PHYSICAL_BASE >= end)
> +			continue;
> +
> +		if (p->Type != EfiConventionalMemory)
> +			continue;

Please also handle existing allocations. If those allocations represent free/usable memory after boot services has exited, then they are for all practical purposes "conventional memory".

Also: please make sure that KERNEL_PHYSICAL_BASE is covered by usable memory to begin with.

As such, we may have multiple memory descriptors that overlap with [2MB..2MB+nr_pages*PAGE_SIZE]. As long as they are free to use after boot services has exited, we're ok. We can only reduce the staging size if [2MB..2MB+delta] is usable when [2MB+delta..2MB+nr_pages*PAGE_SIZE] isn't.
We can reduce the staging area to delta/PAGE_SIZE. But if 2MB isn't usable, we cannot reduce (or put differently we have to reduce to 0).

REVISION DETAIL
  https://reviews.freebsd.org/D9686

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: decui_microsoft.com, imp, jhb, will, kib, delphij, emaste, sepherosa_gmail.com, honzhan_microsoft.com, howard0su_gmail.com, marcel
Cc: freebsd-virtualization-list


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d3ebe882c607364356c15e69e2c39fc0>