hyperv-tlfs: Rename some HV_REGISTER_* defines for consistency
Subsystems (5)
PATCH 1/1 hyperv-tlfs: Rename some HV_REGISTER_* defines for consistency
Rename HV_REGISTER_GUEST_OSID to HV_REGISTER_GUEST_OS_ID. This matches the existing HV_X64_MSR_GUEST_OS_ID.
Rename HV_REGISTER_CRASH_* to HV_REGISTER_GUEST_CRASH_*. Including GUEST_ is consistent with other #defines such as HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE. The new names also match the TLFS document more accurately, i.e. HvRegisterGuestCrash*.
--- arch/arm64/hyperv/hv_core.c | 14 +++++++------- arch/arm64/hyperv/mshyperv.c | 2 +- arch/arm64/include/asm/hyperv-tlfs.h | 12 ++++++------ arch/x86/kernel/cpu/mshyperv.c | 2 +- include/asm-generic/hyperv-tlfs.h | 16 ++++++++-------- 5 files changed, 23 insertions(+), 23 deletions(-)
arch/arm64/hyperv/hv_core.c +7 -7
@@ -160,22 +160,22 @@ void hyperv_report_panic(struct pt_regs *regs, long err, bool in_die)return ; panic_reported = true; - guest_id =hv_get_vpreg (HV_REGISTER_GUEST_OSID ); + guest_id =hv_get_vpreg (HV_REGISTER_GUEST_OS_ID );/* * Hyper-V provides the ability to store only 5 values. * Pick the passed in error value, the guest_id, the PC, * and the SP. */ -hv_set_vpreg (HV_REGISTER_CRASH_P0 , err); -hv_set_vpreg (HV_REGISTER_CRASH_P1 , guest_id); -hv_set_vpreg (HV_REGISTER_CRASH_P2 , regs->pc); -hv_set_vpreg (HV_REGISTER_CRASH_P3 , regs->sp); -hv_set_vpreg (HV_REGISTER_CRASH_P4 ,0 ); +hv_set_vpreg (HV_REGISTER_GUEST_CRASH_P0 , err); +hv_set_vpreg (HV_REGISTER_GUEST_CRASH_P1 , guest_id); +hv_set_vpreg (HV_REGISTER_GUEST_CRASH_P2 , regs->pc); +hv_set_vpreg (HV_REGISTER_GUEST_CRASH_P3 , regs->sp); +hv_set_vpreg (HV_REGISTER_GUEST_CRASH_P4 ,0 );/* * Let Hyper-V know there is crash data available */ -hv_set_vpreg (HV_REGISTER_CRASH_CTL ,HV_CRASH_CTL_CRASH_NOTIFY ); +hv_set_vpreg (HV_REGISTER_GUEST_CRASH_CTL ,HV_CRASH_CTL_CRASH_NOTIFY ); }EXPORT_SYMBOL_GPL (hyperv_report_panic);
arch/arm64/hyperv/mshyperv.c +1 -1
@@ -46,7 +46,7 @@ static int __init hyperv_init(void)/* Setup the guest ID */ guest_id =hv_generate_guest_id (LINUX_VERSION_CODE ); -hv_set_vpreg (HV_REGISTER_GUEST_OSID , guest_id); +hv_set_vpreg (HV_REGISTER_GUEST_OS_ID , guest_id);/* Get the features and hints from Hyper-V */ hv_get_vpreg_128 (HV_REGISTER_FEATURES , &result);
arch/arm64/include/asm/hyperv-tlfs.h +6 -6
@@ -37,12 +37,12 @@* - On x86, HV_MSR_ indicates an MSR accessed via rdmsrl/wrmsrl * - On ARM, HV_MSR_ indicates a VP register accessed via hypercall */ -#define HV_MSR_CRASH_P0 (HV_REGISTER_CRASH_P0) -#define HV_MSR_CRASH_P1 (HV_REGISTER_CRASH_P1) -#define HV_MSR_CRASH_P2 (HV_REGISTER_CRASH_P2) -#define HV_MSR_CRASH_P3 (HV_REGISTER_CRASH_P3) -#define HV_MSR_CRASH_P4 (HV_REGISTER_CRASH_P4) -#define HV_MSR_CRASH_CTL (HV_REGISTER_CRASH_CTL) +#define HV_MSR_CRASH_P0 (HV_REGISTER_GUEST_CRASH_P0) +#define HV_MSR_CRASH_P1 (HV_REGISTER_GUEST_CRASH_P1) +#define HV_MSR_CRASH_P2 (HV_REGISTER_GUEST_CRASH_P2) +#define HV_MSR_CRASH_P3 (HV_REGISTER_GUEST_CRASH_P3) +#define HV_MSR_CRASH_P4 (HV_REGISTER_GUEST_CRASH_P4) +#define HV_MSR_CRASH_CTL (HV_REGISTER_GUEST_CRASH_CTL)#define HV_MSR_VP_INDEX (HV_REGISTER_VP_INDEX)#define HV_MSR_TIME_REF_COUNT (HV_REGISTER_TIME_REF_COUNT)
arch/x86/kernel/cpu/mshyperv.c +1 -1
@@ -450,7 +450,7 @@ static void __init ms_hyperv_init_platform(void)/* To be supported: more work is required. */ ms_hyperv.features &= ~HV_MSR_REFERENCE_TSC_AVAILABLE ; -/* HV_REGISTER_CRASH_CTL is unsupported. */ +/* HV_MSR_CRASH_CTL is unsupported. */ ms_hyperv.misc_features &= ~HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE ;/* Don't trust Hyper-V's TLB-flushing hypercalls. */
include/asm-generic/hyperv-tlfs.h +8 -8
@@ -636,14 +636,14 @@ struct hv_retarget_device_interrupt {/* * Synthetic register definitions equivalent to MSRs on x86/x64 */ -#define HV_REGISTER_CRASH_P0 0x00000210 -#define HV_REGISTER_CRASH_P1 0x00000211 -#define HV_REGISTER_CRASH_P2 0x00000212 -#define HV_REGISTER_CRASH_P3 0x00000213 -#define HV_REGISTER_CRASH_P4 0x00000214 -#define HV_REGISTER_CRASH_CTL 0x00000215 - -#define HV_REGISTER_GUEST_OSID 0x00090002 +#define HV_REGISTER_GUEST_CRASH_P0 0x00000210 +#define HV_REGISTER_GUEST_CRASH_P1 0x00000211 +#define HV_REGISTER_GUEST_CRASH_P2 0x00000212 +#define HV_REGISTER_GUEST_CRASH_P3 0x00000213 +#define HV_REGISTER_GUEST_CRASH_P4 0x00000214 +#define HV_REGISTER_GUEST_CRASH_CTL 0x00000215 + +#define HV_REGISTER_GUEST_OS_ID 0x00090002#define HV_REGISTER_VP_INDEX 0x00090003#define HV_REGISTER_TIME_REF_COUNT 0x00090004#define HV_REGISTER_REFERENCE_TSC 0x00090017
Signature · 1 line
2.25.1
Quoted 9 lines · Nuno Das Neves
Rename
HV_REGISTER_GUEST_OSIDtoHV_REGISTER_GUEST_OS_ID. This matches the existingHV_X64_MSR_GUEST_OS_ID.Rename HV_REGISTER_CRASH_* to HV_REGISTER_GUEST_CRASH_*. Including
GUEST_is consistent with other #defines such asHV_FEATURE_GUEST_CRASH_MSR_AVAILABLE. The new names also match the TLFS document more accurately, i.e. HvRegisterGuestCrash*.Signed-off-by Nuno Das Neves <[email protected]>
Applied to hyperv-next. Thanks.