Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751553AbcCRQL5 (ORCPT ); Fri, 18 Mar 2016 12:11:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39749 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751328AbcCRQLz (ORCPT ); Fri, 18 Mar 2016 12:11:55 -0400 Date: Fri, 18 Mar 2016 17:11:50 +0100 From: Radim Krcmar To: Vitaly Kuznetsov Cc: devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Alex Ng , Cathy Avery Subject: Re: [PATCH] Drivers: hv: vmbus: handle various crash scenarios Message-ID: <20160318161150.GB1800@potion.brq.redhat.com> References: <1458304404-8347-1-git-send-email-vkuznets@redhat.com> <20160318152037.GK20310@potion.brq.redhat.com> <87d1qr3hq6.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87d1qr3hq6.fsf@vitty.brq.redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1425 Lines: 54 2016-03-18 16:53+0100, Vitaly Kuznetsov: > Radim Krcmar 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; >>> >>> vmbus_signal_eom(msg); >> >> 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 eoi() if z == sth break >> 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ář Thanks. >>> + 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.