Re: [PATCH] Drivers: hv: vmbus: handle various crash scenarios
From: Radim Krcmar
Date: Fri Mar 18 2016 - 12:12:01 EST
2016-03-18 16:53+0100, Vitaly Kuznetsov:
> Radim Krcmar <rkrcmar@xxxxxxxxxx> writes:
>> 2016-03-18 13:33+0100, Vitaly Kuznetsov:
>>> @@ -530,9 +542,17 @@ static void vmbus_wait_for_unload(void)
>> (I'm not a huge fan of the unloaded variable; what about remembering the
>> header/msgtype here ...
>>> unloaded = true;
>> and checking its value here?)
> Sure, but we'll have to use a variable for that ... why would it be
> better than 'unloaded'?
It's easier to understand IMO,
x = mem | x = mem
if *x == sth | z = *x
u = true |
eoi() | eoi()
if u | if z == sth
break | break
And you can replace msg with the new variable,
z = *mem
if z == sth
>> Can't this be NULL?
> It can't, we allocate it from hv_synic_alloc() (and we don't support cpu
> onlining/offlining on WS2012R2+).
Reviewed-by: Radim KrÄmÃÅ <rkrcmar@xxxxxxxxxx>
>>> + msg = (struct hv_message *)page_addr + VMBUS_MESSAGE_SINT;
>>> + msg->header.message_type = HVMSG_NONE;
>> (And, this block belongs to a separate function. ;])
> I thought about moving it to hv_crash_handler() but then I decided to
> leave it here as the need for this fixup is rather an artifact of how we
> recieve the message. But I'm flexible here)
Ok, clearing all VCPUs made me think that it would be generally useful.