Where to get Hvgdk.h (hypercall functions)? RRS feed

  • Question

  • Hello,

    I'm trying to learn about Hyper-V's capabilities from a developer's standpoint. I've been trying to create a simple program that uses Hyper-V's hypercalls to see the state of registers in a guest VM. However, after installing WDK 7.10, 8.0 and 8.1, I have not been able to include the required header for hypercalls (according to documentation found in msdn).

    Anyone has any idea of what I have to install/enable to have access to Hyper-V's hypercall library?

    Development environment:
    Windows 2008 R2
    Visual Studio 2013 Professional RC
    WDK 8.1
    Guest VMs: Windows XP, Windows 7, Ubuntu

    Any help is appreciated,


    Thursday, October 17, 2013 2:03 PM

All replies

  • The supported part of the Hyper-V hypercall interface is that which runs in the guest OS.  If, for instance, you'd like to make memory management more efficient, or you'd like to make spinlock acquisition code be more fair when virtualized, you should consult the Top Level Functional Specification.  (That's currently the first hit when you execute this search.  MSDN links aren't durable, so a search is more useful. )

    The catch, of course, is that when you're writing code for non-Windows OSes, no MSDN-supplied header or library is appropriate.  You'd have to roll your own.

    As for the host-side hypercalls, there's not much you can usefully do with them.  You don't get the canonical state of the virtual processor by talking to the hypervisor, you get it by pausing the virtual processor and getting from the VM's worker process (which owns that state and may modify it.)  And there are no published interfaces to that workler process.  Furthermore, nothing you do by interacting with the hypervisor is synchronized with VM state changes like save, restore, migrate, backup, etc.

    Think of the hypervisor as a layer that enforces information that is cached within it, not the source of the information itself.

    - Jake Oshins

    Software Architect working on Hyper-V


    Thursday, October 17, 2013 5:58 PM
  • Thanks for the reply Jake.

    Not quite the answer I was looking for, allow me to be more specific.

    I'm interested in the Host side hypercalls. How can I configure Visual Studio to compile programs that allow me to use hypercalls from a host?

    For example, if I want to install an Intercept on a target child partition (HvInstallIntercept), what libraries/headers do I need to reference in my code/linker to be able to use that function from a host partition?

    I'm not quite sure if what you said in your post means it is not possible to use hypercalls from a host or not.

    Thursday, October 17, 2013 9:20 PM