VirtualBox

Changeset 71087 in vbox for trunk/include/iprt/nt


Ignore:
Timestamp:
Feb 21, 2018 4:35:23 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
120951
Message:

VMM/NEM/win: Get registers via hypercalls. bugref:9044

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/nt/hyperv.h

    r71075 r71087  
    2828#define ___iprt_nt_hyperv_h
    2929
    30 #include <iprt/types.h>
    31 #include <iprt/assertcompile.h>
     30#ifndef IN_IDA_PRO
     31# include <iprt/types.h>
     32# include <iprt/assertcompile.h>
     33#else
     34# define RT_FLEXIBLE_ARRAY
     35# define AssertCompile(expr)
     36# define AssertCompileSize(type, size)
     37# define AssertCompileMemberOffset(type, member, off)
     38#endif
    3239
    3340
     
    4451/** System(/parent) physical page number. */
    4552typedef uint64_t HV_SPA_PAGE_NUMBER;
    46 
    47 
    48 
    49 /** Hypercall IDs.   */
     53/** Hyper-V unsigned 128-bit integer type.   */
     54typedef struct { uint64_t Low64, High64; } HV_UINT128;
     55
     56
     57/**
     58 * Hypercall IDs.
     59 */
    5060typedef enum
    5161{
     
    160170    HvCallStartVirtualProcessor = 0x99,
    161171    HvCallGetVpIndexFromApicId,
    162     /* 0x9b.. are reserved/undocumented. */
     172    /* 0x9b..0xae are reserved/undocumented.
     173       0xad: New version of HvCallGetVpRegisters? Perhaps on logical CPU or smth. */
    163174    HvCallFlushGuestPhysicalAddressSpace = 0xaf,
    164175    HvCallFlushGuestPhysicalAddressList,
     
    197208AssertCompile(HvCallCount == 0xda);
    198209
     210/** Makes the first parameter to a hypercall (rcx).  */
     211#define HV_MAKE_CALL_INFO(a_enmCallCode, a_cReps) ( (uint64_t)(a_enmCallCode) | ((uint64_t)(a_cReps) << 32) )
     212/** Makes the return value (success) for a rep hypercall. */
     213#define HV_MAKE_CALL_REP_RET(a_cReps)    ((uint64_t)(a_cReps) << 32)
    199214
    200215/** Hypercall status code. */
     
    468483
    469484
     485/**
     486 * Register names used by HvCallGetVpRegisters and HvCallSetVpRegisters.
     487 */
     488typedef enum _HV_REGISTER_NAME
     489{
     490    HvRegisterExplicitSuspend = 0x00000000,
     491    HvRegisterInterceptSuspend,
     492
     493    HvRegisterHypervisorVersion = 0x00000100,           /**< @since v5 */
     494
     495    HvRegisterPrivilegesAndFeaturesInfo = 0x00000200,   /**< @since v5 */
     496    HvRegisterFeaturesInfo,                             /**< @since v5 */
     497    HvRegisterImplementationLimitsInfo,                 /**< @since v5 */
     498    HvRegisterHardwareFeaturesInfo,                     /**< @since v5 */
     499
     500    HvRegisterGuestCrashP0 = 0x00000210,                /**< @since v5 */
     501    HvRegisterGuestCrashP1,                             /**< @since v5 */
     502    HvRegisterGuestCrashP2,                             /**< @since v5 */
     503    HvRegisterGuestCrashP3,                             /**< @since v5 */
     504    HvRegisterGuestCrashP4,                             /**< @since v5 */
     505    HvRegisterGuestCrashCtl,                            /**< @since v5 */
     506
     507    HvRegisterPowerStateConfigC1 = 0x00000220,          /**< @since v5 */
     508    HvRegisterPowerStateTriggerC1,                      /**< @since v5 */
     509    HvRegisterPowerStateConfigC2,                       /**< @since v5 */
     510    HvRegisterPowerStateTriggerC2,                      /**< @since v5 */
     511    HvRegisterPowerStateConfigC3,                       /**< @since v5 */
     512    HvRegisterPowerStateTriggerC3,                      /**< @since v5 */
     513
     514    HvRegisterSystemReset = 0x00000230,                 /**< @since v5 */
     515
     516    HvRegisterProcessorClockFrequency = 0x00000240,     /**< @since v5 */
     517    HvRegisterInterruptClockFrequency,                  /**< @since v5 */
     518
     519    HvRegisterGuestIdle = 0x00000250,                   /**< @since v5 */
     520
     521    HvRegisterDebugDeviceOptions = 0x00000260,          /**< @since v5 */
     522
     523    HvRegisterPendingInterruption = 0x00010002,
     524    HvRegisterInterruptState,
     525    HvRegisterPendingEvent0,                            /**< @since v5 */
     526    HvRegisterPendingEvent1,                            /**< @since v5 */
     527
     528    HvX64RegisterRax = 0x00020000,
     529    HvX64RegisterRcx,
     530    HvX64RegisterRdx,
     531    HvX64RegisterRbx,
     532    HvX64RegisterRsp,
     533    HvX64RegisterRbp,
     534    HvX64RegisterRsi,
     535    HvX64RegisterRdi,
     536    HvX64RegisterR8,
     537    HvX64RegisterR9,
     538    HvX64RegisterR10,
     539    HvX64RegisterR11,
     540    HvX64RegisterR12,
     541    HvX64RegisterR13,
     542    HvX64RegisterR14,
     543    HvX64RegisterR15,
     544    HvX64RegisterRip,
     545    HvX64RegisterRflags,
     546
     547    HvX64RegisterXmm0 = 0x00030000,
     548    HvX64RegisterXmm1,
     549    HvX64RegisterXmm2,
     550    HvX64RegisterXmm3,
     551    HvX64RegisterXmm4,
     552    HvX64RegisterXmm5,
     553    HvX64RegisterXmm6,
     554    HvX64RegisterXmm7,
     555    HvX64RegisterXmm8,
     556    HvX64RegisterXmm9,
     557    HvX64RegisterXmm10,
     558    HvX64RegisterXmm11,
     559    HvX64RegisterXmm12,
     560    HvX64RegisterXmm13,
     561    HvX64RegisterXmm14,
     562    HvX64RegisterXmm15,
     563    HvX64RegisterFpMmx0,
     564    HvX64RegisterFpMmx1,
     565    HvX64RegisterFpMmx2,
     566    HvX64RegisterFpMmx3,
     567    HvX64RegisterFpMmx4,
     568    HvX64RegisterFpMmx5,
     569    HvX64RegisterFpMmx6,
     570    HvX64RegisterFpMmx7,
     571    HvX64RegisterFpControlStatus,
     572    HvX64RegisterXmmControlStatus,
     573
     574    HvX64RegisterCr0 = 0x00040000,
     575    HvX64RegisterCr2,
     576    HvX64RegisterCr3,
     577    HvX64RegisterCr4,
     578    HvX64RegisterCr8,
     579    HvX64RegisterXfem,
     580
     581    HvX64RegisterIntermediateCr0 = 0x00041000,          /**< @since v5 */
     582    HvX64RegisterIntermediateCr4 = 0x00041003,          /**< @since v5 */
     583    HvX64RegisterIntermediateCr8,                       /**< @since v5 */
     584
     585    HvX64RegisterDr0 = 0x00050000,
     586    HvX64RegisterDr1,
     587    HvX64RegisterDr2,
     588    HvX64RegisterDr3,
     589    HvX64RegisterDr6,
     590    HvX64RegisterDr7,
     591
     592    HvX64RegisterEs = 0x00060000,
     593    HvX64RegisterCs,
     594    HvX64RegisterSs,
     595    HvX64RegisterDs,
     596    HvX64RegisterFs,
     597    HvX64RegisterGs,
     598    HvX64RegisterLdtr,
     599    HvX64RegisterTr,
     600
     601    HvX64RegisterIdtr = 0x00070000,
     602    HvX64RegisterGdtr,
     603
     604    HvX64RegisterTsc = 0x00080000,
     605    HvX64RegisterEfer,
     606    HvX64RegisterKernelGsBase,
     607    HvX64RegisterApicBase,
     608    HvX64RegisterPat,
     609    HvX64RegisterSysenterCs,
     610    HvX64RegisterSysenterEip,
     611    HvX64RegisterSysenterEsp,
     612    HvX64RegisterStar,
     613    HvX64RegisterLstar,
     614    HvX64RegisterCstar,
     615    HvX64RegisterSfmask,
     616    HvX64RegisterInitialApicId,
     617
     618    HvX64RegisterMtrrCap,
     619    HvX64RegisterMtrrDefType,
     620
     621    HvX64RegisterMtrrPhysBase0 = 0x00080010,
     622    HvX64RegisterMtrrPhysBase1,
     623    HvX64RegisterMtrrPhysBase2,
     624    HvX64RegisterMtrrPhysBase3,
     625    HvX64RegisterMtrrPhysBase4,
     626    HvX64RegisterMtrrPhysBase5,
     627    HvX64RegisterMtrrPhysBase6,
     628    HvX64RegisterMtrrPhysBase7,
     629    HvX64RegisterMtrrPhysBase8,                     /**< @since v4 */
     630    HvX64RegisterMtrrPhysBase9,                     /**< @since v4 */
     631    HvX64RegisterMtrrPhysBaseA,                     /**< @since v4 */
     632    HvX64RegisterMtrrPhysBaseB,                     /**< @since v4 */
     633    HvX64RegisterMtrrPhysBaseC,                     /**< @since v4 */
     634    HvX64RegisterMtrrPhysBaseD,                     /**< @since v4 */
     635    HvX64RegisterMtrrPhysBaseE,                     /**< @since v4 */
     636    HvX64RegisterMtrrPhysBaseF,                     /**< @since v4 */
     637
     638    HvX64RegisterMtrrPhysMask0 = 0x00080040,
     639    HvX64RegisterMtrrPhysMask1,
     640    HvX64RegisterMtrrPhysMask2,
     641    HvX64RegisterMtrrPhysMask3,
     642    HvX64RegisterMtrrPhysMask4,
     643    HvX64RegisterMtrrPhysMask5,
     644    HvX64RegisterMtrrPhysMask6,
     645    HvX64RegisterMtrrPhysMask7,
     646    HvX64RegisterMtrrPhysMask8,                     /**< @since v4 */
     647    HvX64RegisterMtrrPhysMask9,                     /**< @since v4 */
     648    HvX64RegisterMtrrPhysMaskA,                     /**< @since v4 */
     649    HvX64RegisterMtrrPhysMaskB,                     /**< @since v4 */
     650    HvX64RegisterMtrrPhysMaskC,                     /**< @since v4 */
     651    HvX64RegisterMtrrPhysMaskD,                     /**< @since v4 */
     652    HvX64RegisterMtrrPhysMaskE,                     /**< @since v4 */
     653    HvX64RegisterMtrrPhysMaskF,                     /**< @since v4 */
     654
     655    HvX64RegisterMtrrFix64k00000 = 0x00080070,
     656    HvX64RegisterMtrrFix16k80000,
     657    HvX64RegisterMtrrFix16kA0000,
     658    HvX64RegisterMtrrFix4kC0000,
     659    HvX64RegisterMtrrFix4kC8000,
     660    HvX64RegisterMtrrFix4kD0000,
     661    HvX64RegisterMtrrFix4kD8000,
     662    HvX64RegisterMtrrFix4kE0000,
     663    HvX64RegisterMtrrFix4kE8000,
     664    HvX64RegisterMtrrFix4kF0000,
     665    HvX64RegisterMtrrFix4kF8000,
     666
     667    HvX64RegisterIa32MiscEnable = 0x000800a0,       /**< @since v5 */
     668    HvX64RegisterIa32FeatureControl,                /**< @since v5 */
     669
     670    HvX64RegisterVpRuntime = 0x00090000,
     671    HvX64RegisterHypercall,
     672    HvRegisterGuestOsId,
     673    HvRegisterVpIndex,
     674    HvRegisterTimeRefCount,
     675
     676    HvRegisterCpuManagementVersion = 0x00090007,    /**< @since v5 */
     677
     678    HvX64RegisterEoi = 0x00090010,
     679    HvX64RegisterIcr,
     680    HvX64RegisterTpr,
     681    HvRegisterVpAssistPage,
     682
     683    HvRegisterStatsPartitionRetail = 0x00090020,
     684    HvRegisterStatsPartitionInternal,
     685    HvRegisterStatsVpRetail,
     686    HvRegisterStatsVpInternal,
     687
     688    HvRegisterSint0 = 0x000a0000,
     689    HvRegisterSint1,
     690    HvRegisterSint2,
     691    HvRegisterSint3,
     692    HvRegisterSint4,
     693    HvRegisterSint5,
     694    HvRegisterSint6,
     695    HvRegisterSint7,
     696    HvRegisterSint8,
     697    HvRegisterSint9,
     698    HvRegisterSint10,
     699    HvRegisterSint11,
     700    HvRegisterSint12,
     701    HvRegisterSint13,
     702    HvRegisterSint14,
     703    HvRegisterSint15,
     704    HvRegisterScontrol,
     705    HvRegisterSversion,
     706    HvRegisterSifp,
     707    HvRegisterSipp,
     708    HvRegisterEom,
     709    HvRegisterSirbp,                                /**< @since v4 */
     710
     711    HvRegisterStimer0Config = 0x000b0000,
     712    HvRegisterStimer0Count,
     713    HvRegisterStimer1Config,
     714    HvRegisterStimer1Count,
     715    HvRegisterStimer2Config,
     716    HvRegisterStimer2Count,
     717    HvRegisterStimer3Config,
     718    HvRegisterStimer3Count,
     719
     720    HvX64RegisterYmm0Low = 0x000c0000,
     721    HvX64RegisterYmm1Low,
     722    HvX64RegisterYmm2Low,
     723    HvX64RegisterYmm3Low,
     724    HvX64RegisterYmm4Low,
     725    HvX64RegisterYmm5Low,
     726    HvX64RegisterYmm6Low,
     727    HvX64RegisterYmm7Low,
     728    HvX64RegisterYmm8Low,
     729    HvX64RegisterYmm9Low,
     730    HvX64RegisterYmm10Low,
     731    HvX64RegisterYmm11Low,
     732    HvX64RegisterYmm12Low,
     733    HvX64RegisterYmm13Low,
     734    HvX64RegisterYmm14Low,
     735    HvX64RegisterYmm15Low,
     736    HvX64RegisterYmm0High,
     737    HvX64RegisterYmm1High,
     738    HvX64RegisterYmm2High,
     739    HvX64RegisterYmm3High,
     740    HvX64RegisterYmm4High,
     741    HvX64RegisterYmm5High,
     742    HvX64RegisterYmm6High,
     743    HvX64RegisterYmm7High,
     744    HvX64RegisterYmm8High,
     745    HvX64RegisterYmm9High,
     746    HvX64RegisterYmm10High,
     747    HvX64RegisterYmm11High,
     748    HvX64RegisterYmm12High,
     749    HvX64RegisterYmm13High,
     750    HvX64RegisterYmm14High,
     751    HvX64RegisterYmm15High,
     752
     753    HvRegisterVsmVpVtlControl = 0x000d0000,
     754
     755    HvRegisterVsmCodePageOffsets = 0x000d0002,
     756    HvRegisterVsmVpStatus,
     757    HvRegisterVsmPartitionStatus,
     758    HvRegisterVsmVina,
     759    HvRegisterVsmCapabilities,
     760    HvRegisterVsmPartitionConfig,
     761
     762    HvRegisterVsmVpSecureConfigVtl0 = 0x000d0010,   /**< @since v5 */
     763    HvRegisterVsmVpSecureConfigVtl1,                /**< @since v5 */
     764    HvRegisterVsmVpSecureConfigVtl2,                /**< @since v5 */
     765    HvRegisterVsmVpSecureConfigVtl3,                /**< @since v5 */
     766    HvRegisterVsmVpSecureConfigVtl4,                /**< @since v5 */
     767    HvRegisterVsmVpSecureConfigVtl5,                /**< @since v5 */
     768    HvRegisterVsmVpSecureConfigVtl6,                /**< @since v5 */
     769    HvRegisterVsmVpSecureConfigVtl7,                /**< @since v5 */
     770    HvRegisterVsmVpSecureConfigVtl8,                /**< @since v5 */
     771    HvRegisterVsmVpSecureConfigVtl9,                /**< @since v5 */
     772    HvRegisterVsmVpSecureConfigVtl10,               /**< @since v5 */
     773    HvRegisterVsmVpSecureConfigVtl11,               /**< @since v5 */
     774    HvRegisterVsmVpSecureConfigVtl12,               /**< @since v5 */
     775    HvRegisterVsmVpSecureConfigVtl13,               /**< @since v5 */
     776    HvRegisterVsmVpSecureConfigVtl14                /**< @since v5 */
     777
     778} HV_REGISTER_NAME;
     779AssertCompile(HvRegisterInterceptSuspend == 0x00000001);
     780AssertCompile(HvRegisterPendingEvent1 == 0x00010005);
     781AssertCompile(HvX64RegisterRflags == 0x00020011);
     782AssertCompile(HvX64RegisterXmmControlStatus == 0x00030019);
     783AssertCompile(HvX64RegisterXfem == 0x00040005);
     784AssertCompile(HvX64RegisterIntermediateCr0 == 0x00041000);
     785AssertCompile(HvX64RegisterIntermediateCr4 == 0x00041003);
     786AssertCompile(HvX64RegisterDr7 == 0x00050005);
     787AssertCompile(HvX64RegisterTr == 0x00060007);
     788AssertCompile(HvX64RegisterGdtr == 0x00070001);
     789AssertCompile(HvX64RegisterInitialApicId == 0x0008000c);
     790AssertCompile(HvX64RegisterMtrrDefType == 0x0008000e);
     791AssertCompile(HvX64RegisterMtrrPhysBaseF == 0x0008001f);
     792AssertCompile(HvX64RegisterMtrrPhysMaskF == 0x0008004f);
     793AssertCompile(HvX64RegisterMtrrFix4kF8000 == 0x0008007a);
     794AssertCompile(HvRegisterTimeRefCount == 0x00090004);
     795AssertCompile(HvRegisterCpuManagementVersion == 0x00090007);
     796AssertCompile(HvRegisterVpAssistPage == 0x00090013);
     797AssertCompile(HvRegisterStatsVpInternal == 0x00090023);
     798AssertCompile(HvRegisterSirbp == 0x000a0015);
     799AssertCompile(HvRegisterStimer3Count == 0x000b0007);
     800AssertCompile(HvX64RegisterYmm15High == 0x000c001f);
     801AssertCompile(HvRegisterVsmVpSecureConfigVtl14 == 0x000d001e);
     802AssertCompileSize(HV_REGISTER_NAME, 4);
     803
     804
     805/** Value format for HvRegisterExplicitSuspend. */
     806typedef union
     807{
     808    uint64_t            AsUINT64;
     809    struct
     810    {
     811        uint64_t        Suspended : 1;
     812        uint64_t        Reserved  : 63;
     813    };
     814} HV_EXPLICIT_SUSPEND_REGISTER;
     815/** Pointer to a value of HvRegisterExplicitSuspend. */
     816typedef HV_EXPLICIT_SUSPEND_REGISTER *PHV_EXPLICIT_SUSPEND_REGISTER;
     817
     818/** Value format for HvRegisterInterceptSuspend. */
     819typedef union
     820{
     821    uint64_t            AsUINT64;
     822    struct
     823    {
     824        uint64_t        Suspended : 1;
     825        uint64_t        TlbLocked : 1;
     826        uint64_t        Reserved  : 62;
     827    };
     828} HV_INTERCEPT_SUSPEND_REGISTER;
     829/** Pointer to a value of HvRegisterInterceptSuspend. */
     830typedef HV_INTERCEPT_SUSPEND_REGISTER *PHV_INTERCEPT_SUSPEND_REGISTER;
     831
     832/** Value format for HvRegisterInterruptState.
     833 * @sa WHV_X64_INTERRUPT_STATE_REGISTER */
     834typedef union
     835{
     836    uint64_t            AsUINT64;
     837    struct
     838    {
     839        uint64_t        InterruptShadow : 1;
     840        uint64_t        NmiMasked       : 1;
     841        uint64_t        Reserved        : 62;
     842    };
     843} HV_X64_INTERRUPT_STATE_REGISTER;
     844/** Pointer to a value of HvRegisterInterruptState. */
     845typedef HV_X64_INTERRUPT_STATE_REGISTER *PHV_X64_INTERRUPT_STATE_REGISTER;
     846
     847/** Pending exception type for HvRegisterPendingInterruption.
     848 * @sa WHV_X64_PENDING_INTERRUPTION_TYPE */
     849typedef enum
     850{
     851    HvX64PendingInterrupt = 0,
     852    /* what is/was 1? */
     853    HvX64PendingNmi = 2,
     854    HvX64PendingException
     855    /* any more? */
     856} HV_X64_PENDING_INTERRUPTION_TYPE;
     857
     858/** Value format for HvRegisterPendingInterruption.
     859 * @sa WHV_X64_PENDING_INTERRUPTION_REGISTER  */
     860typedef union
     861{
     862    uint64_t            AsUINT64;
     863    struct
     864    {
     865        uint32_t        InterruptionPending : 1;
     866        uint32_t        InterruptionType    : 3;    /**< HV_X64_PENDING_INTERRUPTION_TYPE */
     867        uint32_t        DeliverErrorCode    : 1;
     868        uint32_t        InstructionLength   : 4;    /**< @since v5? Wasn't in 7600 WDK */
     869        uint32_t        NestedEvent         : 1;    /**< @since v5? Wasn't in 7600 WDK */
     870        uint32_t        Reserved            : 6;
     871        uint32_t        InterruptionVector  : 16;
     872        uint32_t        ErrorCode;
     873    };
     874} HV_X64_PENDING_INTERRUPTION_REGISTER;
     875/** Pointer to a value of HvRegisterPendingInterruption. */
     876typedef HV_X64_PENDING_INTERRUPTION_REGISTER *PHV_X64_PENDING_INTERRUPTION_REGISTER;
     877
     878/** Value format for HvRegisterPendingEvent0/1.
     879 * @sa WHV_X64_DELIVERABILITY_NOTIFICATIONS_REGISTER  */
     880typedef union
     881{
     882    uint64_t            AsUINT64;
     883    struct
     884    {
     885        uint64_t        NmiNotification         : 1;
     886        uint64_t        InterruptNotification   : 1;
     887        uint64_t        InterruptPriority       : 4;
     888        uint64_t        Reserved                : 58;
     889    };
     890} HV_X64_DELIVERABILITY_NOTIFICATIONS_REGISTER;
     891/** Pointer to a value of HvRegisterPendingEvent0/1. */
     892typedef HV_X64_DELIVERABILITY_NOTIFICATIONS_REGISTER *PHV_X64_DELIVERABILITY_NOTIFICATIONS_REGISTER;
     893
     894
     895/** Value format for HvX64RegisterEs..Tr.
     896 * @sa WHV_X64_SEGMENT_REGISTER  */
     897typedef struct _HV_X64_SEGMENT_REGISTER
     898{
     899    uint64_t            Base;
     900    uint32_t            Limit;
     901    uint16_t            Selector;
     902    union
     903    {
     904        struct
     905        {
     906            uint16_t    SegmentType              : 4;
     907            uint16_t    NonSystemSegment         : 1;
     908            uint16_t    DescriptorPrivilegeLevel : 2;
     909            uint16_t    Present                  : 1;
     910            uint16_t    Reserved                 : 4;
     911            uint16_t    Available                : 1;
     912            uint16_t    Long                     : 1;
     913            uint16_t    Default                  : 1;
     914            uint16_t    Granularity              : 1;
     915        };
     916        uint16_t        Attributes;
     917    };
     918} HV_X64_SEGMENT_REGISTER;
     919/** Pointer to a value of HvX64RegisterEs..Tr. */
     920typedef HV_X64_SEGMENT_REGISTER *PHV_X64_SEGMENT_REGISTER;
     921
     922/** Value format for HvX64RegisterIdtr/Gdtr.
     923 * @sa WHV_X64_TABLE_REGISTER */
     924typedef struct
     925{
     926    uint16_t            Pad[3];
     927    uint16_t            Limit;
     928    uint64_t            Base;
     929} HV_X64_TABLE_REGISTER;
     930/** Pointer to a value of HvX64RegisterIdtr/Gdtrr. */
     931typedef HV_X64_TABLE_REGISTER *PHV_X64_TABLE_REGISTER;
     932
     933/** Value format for HvX64RegisterFpMmx0..7 in floating pointer mode.
     934 * @sa WHV_X64_FP_REGISTER, RTFLOAT80U2 */
     935typedef union
     936{
     937    HV_UINT128          AsUINT128;
     938    struct
     939    {
     940        uint64_t        Mantissa;
     941        uint64_t        BiasedExponent  : 15;
     942        uint64_t        Sign            : 1;
     943        uint64_t        Reserved        : 48;
     944    };
     945} HV_X64_FP_REGISTER;
     946/** Pointer to a value of HvX64RegisterFpMmx0..7 in floating point mode. */
     947typedef HV_X64_FP_REGISTER *PHV_X64_FP_REGISTER;
     948
     949/** Value union for HvX64RegisterFpMmx0..7. */
     950typedef union
     951{
     952    HV_UINT128          AsUINT128;
     953    HV_X64_FP_REGISTER  Fp;
     954    uint64_t            Mmx;
     955} HV_X64_FP_MMX_REGISTER;
     956/** Pointer to a value of HvX64RegisterFpMmx0..7. */
     957typedef HV_X64_FP_MMX_REGISTER *PHV_X64_FP_MMX_REGISTER;
     958
     959/** Value format for HvX64RegisterFpControlStatus.
     960 * @sa WHV_X64_FP_CONTROL_STATUS_REGISTER  */
     961typedef union
     962{
     963    HV_UINT128              AsUINT128;
     964    struct
     965    {
     966        uint16_t            FpControl;
     967        uint16_t            FpStatus;
     968        uint8_t             FpTag;
     969        uint8_t             IgnNe    : 1;
     970        uint8_t             Reserved : 7;
     971        uint16_t            LastFpOp;
     972        union
     973        {
     974            uint64_t        LastFpRip;
     975            struct
     976            {
     977                uint32_t    LastFpEip;
     978                uint16_t    LastFpCs;
     979            };
     980        };
     981    };
     982} HV_X64_FP_CONTROL_STATUS_REGISTER;
     983/** Pointer to a value of HvX64RegisterFpControlStatus. */
     984typedef HV_X64_FP_CONTROL_STATUS_REGISTER *PHV_X64_FP_CONTROL_STATUS_REGISTER;
     985
     986/** Value format for HvX64RegisterXmmControlStatus.
     987 * @sa WHV_X64_XMM_CONTROL_STATUS_REGISTER  */
     988typedef union
     989{
     990    HV_UINT128 AsUINT128;
     991    struct
     992    {
     993        union
     994        {
     995            uint64_t        LastFpRdp;
     996            struct
     997            {
     998                uint32_t    LastFpDp;
     999                uint16_t    LastFpDs;
     1000            };
     1001        };
     1002        uint32_t            XmmStatusControl;
     1003        uint32_t            XmmStatusControlMask;
     1004    };
     1005} HV_X64_XMM_CONTROL_STATUS_REGISTER;
     1006/** Pointer to a value of HvX64RegisterXmmControlStatus. */
     1007typedef HV_X64_XMM_CONTROL_STATUS_REGISTER *PHV_X64_XMM_CONTROL_STATUS_REGISTER;
     1008
     1009/** Register value union.
     1010 * @sa WHV_REGISTER_VALUE  */
     1011typedef union
     1012{
     1013    HV_UINT128                                      Reg128;
     1014    uint64_t                                        Reg64;
     1015    uint32_t                                        Reg32;
     1016    uint16_t                                        Reg16;
     1017    uint8_t                                         Reg8;
     1018    HV_EXPLICIT_SUSPEND_REGISTER                    ExplicitSuspend;
     1019    HV_INTERCEPT_SUSPEND_REGISTER                   InterceptSuspend;
     1020    HV_X64_INTERRUPT_STATE_REGISTER                 InterruptState;
     1021    HV_X64_PENDING_INTERRUPTION_REGISTER            PendingInterruption;
     1022    HV_X64_DELIVERABILITY_NOTIFICATIONS_REGISTER    DeliverabilityNotifications;
     1023    HV_X64_TABLE_REGISTER                           Table;
     1024    HV_X64_SEGMENT_REGISTER                         Segment;
     1025    HV_X64_FP_REGISTER                              Fp;
     1026    HV_X64_FP_CONTROL_STATUS_REGISTER               FpControlStatus;
     1027    HV_X64_XMM_CONTROL_STATUS_REGISTER              XmmControlStatus;
     1028} HV_REGISTER_VALUE;
     1029AssertCompileSize(HV_REGISTER_VALUE, 16);
     1030/** Pointer to a Hyper-V register value union. */
     1031typedef HV_REGISTER_VALUE *PHV_REGISTER_VALUE;
     1032/** Pointer to a const Hyper-V register value union. */
     1033typedef HV_REGISTER_VALUE const *PCHV_REGISTER_VALUE;
     1034
     1035
     1036/** Input for HvCallGetVpRegister. */
     1037typedef struct
     1038{
     1039    HV_PARTITION_ID     PartitionId;
     1040    HV_VP_INDEX         VpIndex;
     1041    /** Was this introduced after v2? Dunno what it it really is. */
     1042    uint32_t            fFlags;
     1043    /* The repeating part: */
     1044    HV_REGISTER_NAME    Names[RT_FLEXIBLE_ARRAY];
     1045} HV_INPUT_GET_VP_REGISTERS;
     1046AssertCompileMemberOffset(HV_INPUT_GET_VP_REGISTERS, Names, 16);
     1047/** Pointer to input for HvCallGetVpRegister. */
     1048typedef HV_INPUT_GET_VP_REGISTERS *PHV_INPUT_GET_VP_REGISTERS;
     1049/* Output for HvCallGetVpRegister is an array of HV_REGISTER_VALUE parallel to HV_INPUT_GET_VP_REGISTERS::Names. */
     1050
     1051
     1052/** Register and value pair for HvCallSetVpRegister. */
     1053typedef struct
     1054{
     1055    HV_REGISTER_NAME    Name;
     1056    uint32_t            Pad0;
     1057    uint64_t            Pad1;
     1058    HV_REGISTER_VALUE   Value;
     1059} HV_REGISTER_ASSOC;
     1060AssertCompileSize(HV_REGISTER_ASSOC, 32);
     1061AssertCompileMemberOffset(HV_REGISTER_ASSOC, Value, 16);
     1062/** Pointer to a register and value pair for HvCallSetVpRegister. */
     1063typedef HV_REGISTER_ASSOC *PHV_REGISTER_ASSOC;
     1064/** Helper for clearing the alignment padding members. */
     1065#define HV_REGISTER_ASSOC_ZERO_PADDING(a_pRegAssoc) do { (a_pRegAssoc)->Pad0 = 0; (a_pRegAssoc)->Pad1 = 0; } while (0)
     1066/** Helper for clearing the alignment padding members and the high 64-bit
     1067 * part of the value. */
     1068#define HV_REGISTER_ASSOC_ZERO_PADDING_AND_HI64(a_pRegAssoc) \
     1069    do { (a_pRegAssoc)->Pad0 = 0; (a_pRegAssoc)->Pad1 = 0; (a_pRegAssoc)->Value.Reg128.High64 = 0; } while (0)
     1070
     1071/** Input for HvCallSetVpRegister. */
     1072typedef struct
     1073{
     1074    HV_PARTITION_ID     PartitionId;
     1075    HV_VP_INDEX         VpIndex;
     1076    uint32_t            RsvdZ;
     1077    /* The repeating part: */
     1078    HV_REGISTER_ASSOC   Elements[RT_FLEXIBLE_ARRAY];
     1079} HV_INPUT_SET_VP_REGISTERS;
     1080AssertCompileMemberOffset(HV_INPUT_SET_VP_REGISTERS, Elements, 16);
     1081/** Pointer to input for HvCallSetVpRegister. */
     1082typedef HV_INPUT_SET_VP_REGISTERS *PHV_INPUT_SET_VP_REGISTERS;
     1083
     1084
    4701085#endif
    4711086
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette