diff mbox

[3/9] kvm: add hyper-v crash msrs values

Message ID 1435664007-4965-4-git-send-email-den@openvz.org
State New
Headers show

Commit Message

Denis V. Lunev June 30, 2015, 11:33 a.m. UTC
From: Andrey Smetanin <asmetanin@virtuozzo.com>

Added Hyper-V crash msrs values - HV_X64_MSR_CRASH*.

Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Gleb Natapov <gleb@kernel.org>
---
 arch/x86/include/uapi/asm/hyperv.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Peter Hornyack July 1, 2015, 12:14 a.m. UTC | #1
On Tue, Jun 30, 2015 at 4:33 AM, Denis V. Lunev <den@openvz.org> wrote:
> From: Andrey Smetanin <asmetanin@virtuozzo.com>
>
> Added Hyper-V crash msrs values - HV_X64_MSR_CRASH*.
>
> Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> CC: Gleb Natapov <gleb@kernel.org>
Reviewed-by: Peter Hornyack <peterhornyack@google.com>

> ---
>  arch/x86/include/uapi/asm/hyperv.h | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h
> index ce6068d..3ed7a5c 100644
> --- a/arch/x86/include/uapi/asm/hyperv.h
> +++ b/arch/x86/include/uapi/asm/hyperv.h
> @@ -199,6 +199,21 @@
>  #define HV_X64_MSR_STIMER3_CONFIG              0x400000B6
>  #define HV_X64_MSR_STIMER3_COUNT               0x400000B7
>
> +/* Hyper-V guest crash notification MSR's */
> +#define HV_X64_MSR_CRASH_P0                    0x40000100
> +#define HV_X64_MSR_CRASH_P1                    0x40000101
> +#define HV_X64_MSR_CRASH_P2                    0x40000102
> +#define HV_X64_MSR_CRASH_P3                    0x40000103
> +#define HV_X64_MSR_CRASH_P4                    0x40000104
> +#define HV_X64_MSR_CRASH_CTL                   0x40000105
> +#define HV_X64_MSR_CRASH_CTL_NOTIFY            (1ULL << 63)
> +#define HV_X64_MSR_CRASH_CTL_CONTENTS  \

This is unused and can be deleted, right?

> +               (HV_X64_MSR_CRASH_CTL_NOTIFY)
> +
> +#define HV_X64_MSR_CRASH_PARAMS                \
> +               (1 + (HV_X64_MSR_CRASH_P4 - HV_X64_MSR_CRASH_P0))
> +
> +
>  #define HV_X64_MSR_HYPERCALL_ENABLE            0x00000001
>  #define HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_SHIFT        12
>  #define HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_MASK \
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paolo Bonzini July 1, 2015, 3 p.m. UTC | #2
On 30/06/2015 13:33, Denis V. Lunev wrote:
> +#define HV_X64_MSR_CRASH_CTL_NOTIFY		(1ULL << 63)
> +#define HV_X64_MSR_CRASH_CTL_CONTENTS	\
> +		(HV_X64_MSR_CRASH_CTL_NOTIFY)

Why is HV_X64_MSR_CRASH_CTL_CONTENTS needed?  Can I just remove it?

Paolo
Denis V. Lunev July 1, 2015, 3:53 p.m. UTC | #3
On 01/07/15 18:00, Paolo Bonzini wrote:
>
> On 30/06/2015 13:33, Denis V. Lunev wrote:
>> +#define HV_X64_MSR_CRASH_CTL_NOTIFY		(1ULL << 63)
>> +#define HV_X64_MSR_CRASH_CTL_CONTENTS	\
>> +		(HV_X64_MSR_CRASH_CTL_NOTIFY)
> Why is HV_X64_MSR_CRASH_CTL_CONTENTS needed?  Can I just remove it?
>
> Paolo
this was a direct request from Peter Hornyack <peterhornyack@google.com>

"I suggest here:

#define HV_X64_MSR_CRASH_CTL_CONTENTS  \
         (HV_CRASH_CTL_CRASH_NOTIFY)

To allow for more crash actions to be added in the future."

Den
Peter Hornyack July 1, 2015, 4:06 p.m. UTC | #4
If userspace is controlling the crash capabilities then
HV_X64_MSR_CRASH_CTL_CONTENTS is not needed.

On Wed, Jul 1, 2015 at 8:53 AM, Denis V. Lunev <den@openvz.org> wrote:
> On 01/07/15 18:00, Paolo Bonzini wrote:
>>
>>
>> On 30/06/2015 13:33, Denis V. Lunev wrote:
>>>
>>> +#define HV_X64_MSR_CRASH_CTL_NOTIFY            (1ULL << 63)
>>> +#define HV_X64_MSR_CRASH_CTL_CONTENTS  \
>>> +               (HV_X64_MSR_CRASH_CTL_NOTIFY)
>>
>> Why is HV_X64_MSR_CRASH_CTL_CONTENTS needed?  Can I just remove it?
>>
>> Paolo
>
> this was a direct request from Peter Hornyack <peterhornyack@google.com>
>
> "I suggest here:
>
> #define HV_X64_MSR_CRASH_CTL_CONTENTS  \
>         (HV_CRASH_CTL_CRASH_NOTIFY)
>
> To allow for more crash actions to be added in the future."
>
> Den
Paolo Bonzini July 1, 2015, 4:48 p.m. UTC | #5
On 01/07/2015 18:06, Peter Hornyack wrote:
> If userspace is controlling the crash capabilities then
> HV_X64_MSR_CRASH_CTL_CONTENTS is not needed.

Actually you still need to: userspace cannot write anything but 0 or
(1ULL << 63).  However, the name makes less sense, so I'm in favor of
removing the value.

Paolo
diff mbox

Patch

diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h
index ce6068d..3ed7a5c 100644
--- a/arch/x86/include/uapi/asm/hyperv.h
+++ b/arch/x86/include/uapi/asm/hyperv.h
@@ -199,6 +199,21 @@ 
 #define HV_X64_MSR_STIMER3_CONFIG		0x400000B6
 #define HV_X64_MSR_STIMER3_COUNT		0x400000B7
 
+/* Hyper-V guest crash notification MSR's */
+#define HV_X64_MSR_CRASH_P0			0x40000100
+#define HV_X64_MSR_CRASH_P1			0x40000101
+#define HV_X64_MSR_CRASH_P2			0x40000102
+#define HV_X64_MSR_CRASH_P3			0x40000103
+#define HV_X64_MSR_CRASH_P4			0x40000104
+#define HV_X64_MSR_CRASH_CTL			0x40000105
+#define HV_X64_MSR_CRASH_CTL_NOTIFY		(1ULL << 63)
+#define HV_X64_MSR_CRASH_CTL_CONTENTS	\
+		(HV_X64_MSR_CRASH_CTL_NOTIFY)
+
+#define HV_X64_MSR_CRASH_PARAMS		\
+		(1 + (HV_X64_MSR_CRASH_P4 - HV_X64_MSR_CRASH_P0))
+
+
 #define HV_X64_MSR_HYPERCALL_ENABLE		0x00000001
 #define HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_SHIFT	12
 #define HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_MASK	\