HvMapStatsPage function

The HvMapStatsPage function maps the specified statistics page into the caller's guest physical address (GPA) space.

Syntax


HV_STATUS  HvMapStatsPage(
  _In_  HV_STATS_OBJECT_TYPE StatsType,
  _In_  HV_STATS_OBJECT_IDENTITY ObjectIdentity,
  _In_  HV_GPA_PAGE_NUMBER TargetGpaPage
);

Parameters

StatsType [in]

An HV_STATS_OBJECT_TYPE value that specifies the statistics object type.

ObjectIdentity [in]

An HV_STATS_OBJECT_IDENTITY union that specifies the statistics object's identity. The members of this union depend on the statistics object type that the StatsType parameter specifies. Reserved members in this union must be set to zero.

TargetGpaPage [in]

An HV_GPA_PAGE_NUMBER value that specifies the location within the caller's GPA space where the statistics page should appear. HV_GPA_PAGE_NUMBER is defined as an unsigned 64-bit (UINT64) value.

Return value

HvMapStatsPage returns one of the following values. In addition to these values, HvMapStatsPage can also return one of the values that are specified in Common Hypercall Status Codes.

Return codeDescription
HV_STATUS_SUCCESS

HvMapStatsPage successfully mapped the specified statistics page into the caller's GPA space.

HV_STATUS_ACCESS_DENIED

One of the following conditions exists:

  • For global statistics types, the caller is not the root partition.

  • For local statistics types, the caller is not the parent of the specified partition.

  • The caller's partition privilege flag AccessStats is cleared.

HV_STATUS_INVALID_PARTITION_ID

The specified partition identifier is invalid (which is used only for partition and virtual processor (VP) statistics).

HV_STATUS_INVALID_VP_INDEX

The specified VP index does not reference a virtual processor within the specified partition (which is used only for VP statistics).

HV_STATUS_OPERATION_DENIED

The statistics page has already been mapped within the caller's GPA space. It must be unmapped before it is mapped again.

HV_STATUS_INVALID_PARAMETER

One of the following conditions exists:

  • The specified logical processor index is invalid (which is used only for logical processor statistics).

  • Reserved fields within the ObjectIdentity parameter are not set to zero.

HV_STATUS_INSUFFICIENT_MEMORY

The number of pages in the memory pool of the caller is insufficient to perform the operation.

HV_STATUS_INVALID_PARTITION_STATE

The specified partition is not in the active state.

 

Remarks

Statistics pages for global statistics can be mapped only into the GPA space of the root partition.

If the specified GPA page is beyond the bounds of the partition's valid GPA space, HvMapStatsPage might return HV_STATUS_SUCCESS (that is, indicate success). However, the statistics page will not be accessible. In addition, the partition must have the AccessStats privilege.

HvMapStatsPage has the following restrictions:

  • The caller must possess the AccessStats privilege.

  • For global statistics types, the caller must be the root partition.

  • For local statistics types, the caller must be the parent of the partition that is specified by PartitionId.

  • The partition that is specified by PartitionId must be in the active state.

Native Interface

HvMapStatsPage

Call Code = 0x006C

Input Parameters

0

StatsType (4 bytes) Padding (4 bytes)

8

ObjectIdentity (16 bytes)

16

24

TargetGpaPage (8 bytes)

 

Requirements

Version

HvMapStatsPage is available in version 1.0 and later versions of the hypervisor.

Header

Hvgdk.h (include Hvgdk.h)

IRQL

Any level

See also

HV_STATS_OBJECT_IDENTITY
HV_STATS_OBJECT_TYPE

 

 

Send comments about this topic to Microsoft

Build date: 11/16/2013

Show:
© 2014 Microsoft. All rights reserved.