Actually Mark, we use a very different design in these areas. Xen (to my
naïve understanding) uses a cooperative model for VM state changes. They
actually run code in the guest as part of saving a VM, migrating a VM, etc.
Hyper-V uses a model where VM transitions can happen on any instruction
boundary and there’s no interaction with code in the guest.
Consequently, you can’t expect a guest to do anything regarding ballooning
or anything else that would run code in the guest.
As for James’s specific problem, we let the guest touch those pages as part
of crashdump and/or hibernation and we just show it a fake page that’s
mapped into every “missing” page that’s been ballooned. The contents don’t
matter, really.
Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group
This post implies no warranties and confers no rights.
“Mark Roddy” wrote in message news:xxxxx@ntdev…
The balloon driver has to take memory away ‘for a while’ and then give
it back, so marking it as bad would be,well, bad.
I’m guessing remove is going to have a problem if the memory is in use.
MSFT has probably implemented a balloon driver for their hypervisor,
so they may also have solved the hibernate problem.
Mark Roddy
On Fri, Jan 21, 2011 at 8:07 AM, Cay Bremer wrote:
> Have you already tried MmRemovePhysicalMemory (declared in ntddk.h) or
> MmMarkPhysicalMemoryAsBad (same parameters as MmRemovePhysicalMemory)?
>
>
> On Fri, 21 Jan 2011 13:28:48 +0100, James Harper
> wrote:
>>
>> Part of the initialization my driver does is to gift some pages of
>> memory back to xen to balance the books (it had to takes some pages from
>> xen for something else). This leaves some memory ‘holes’, and it turns
>> out that hibernation copies these pages to the buffers it passes to my
>> dump/hiber storpot driver. It appears that touching these pages causes
>> the VM to blow up.
>>
>> I will approach this problem from both directions - it is in fact more a
>> bug in Xen than Windows - but is there a way to tell Windows that pages
>> of memory I have allocated are never to be touched, not even by the
>> hiber or dump driver? (the dump driver doesn’t actually double buffer
>> the pages it seems so it never touches them, just hands me the physical
>> address).
>>
>> So I’m looking for something that does one of the following:
>> . Tells windows that the physical page isn’t important for hibernation
>> (and crash dump if possible)
>> . Tells windows that the physical page doesn’t exist anymore
>> . Tells windows that the physical page is bad or something
>> With the net result being that hiber and dump never touch the page…
>>
>> Thanks
>>
>> James
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars
> visit:http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>