From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33740C4332D for ; Thu, 19 Mar 2020 08:04:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0979820658 for ; Thu, 19 Mar 2020 08:04:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QYk3LCaY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726151AbgCSIEE (ORCPT ); Thu, 19 Mar 2020 04:04:04 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:60047 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726796AbgCSIEE (ORCPT ); Thu, 19 Mar 2020 04:04:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584605043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lEl0pLZ4r8+wodwkJbIhx3HKM8VKZet5zd3tcPqDYD8=; b=QYk3LCaYz9azsXw7kRkMsc8kmjnnNOtRsglvWehSZgyKcE4qukmXGDK6h9qMHbuxz+SEud Y7CFT4PhvXXT2QaBG6oblpnPTJ6P72H2YpOm3X2a/hh0xqqJYH0Xa6EcNMdZz4mfbLEtEu XsW8vRUB5cdjsiTp9md9ak7EiUSxkGI= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-435-oHzY-zSLP4SjqiwewEHa4g-1; Thu, 19 Mar 2020 04:04:02 -0400 X-MC-Unique: oHzY-zSLP4SjqiwewEHa4g-1 Received: by mail-wm1-f72.google.com with SMTP id i24so389460wml.1 for ; Thu, 19 Mar 2020 01:04:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=lEl0pLZ4r8+wodwkJbIhx3HKM8VKZet5zd3tcPqDYD8=; b=MhmHcxpbtVFZRam9eVadcpml77pZkQuRqRUyGurk6olKocHLl/myrFlbAe2j+0j8O5 1bnFUGCIbxkLQBESLn3ZHTIAbf05NXCGCaQitBAJHqU7E5+La/jqeV2XI2cFJUfLfoEF PvXHtnXRWC/LKwi8w9x/Qw6wkk7mDdIW+g5zoFzXHMWs2uxmTi0B1sqBUnCIYyEuv8ct 2BZkUxVEozM28FtxveTpg8B9chNZFFKjYEAl8YtDGUuXEOVMfY9YAN+FyZbL3AtCThMC kpM2trVuajpQFZ+gLsvBoEpw9mcMlbj/yQ0Z5aKu4hnNDN+SpgV7ik/LNkvJirWwzTxE pszA== X-Gm-Message-State: ANhLgQ04oKNcXxKT43jhXOEsiJ8/zLKY5BIhnN0RyIX5sehiprJddwNZ BEHXHtAd3Q+bnZwpQySgC8Gflok70BJnsL9hT7ANd3xSF1NaLodPPbuUqe12Zc+2l8hTnda6N/3 JbbJCYCR3gmwKUXRbqWlm+1f1 X-Received: by 2002:a1c:f213:: with SMTP id s19mr2143434wmc.116.1584605040910; Thu, 19 Mar 2020 01:04:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vspjTqd899Yf1k8PJgtS8xeSIL+IQ2/QCXdXuJ0YaFvyxcyC7BgMkEzKsgBlQ9bG+1311wMJw== X-Received: by 2002:a1c:f213:: with SMTP id s19mr2143400wmc.116.1584605040676; Thu, 19 Mar 2020 01:04:00 -0700 (PDT) Received: from vitty.brq.redhat.com (g-server-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id s15sm2462514wrr.45.2020.03.19.01.03.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 01:04:00 -0700 (PDT) From: Vitaly Kuznetsov To: Michael Kelley , "ltykernel\@gmail.com" Cc: Tianyu Lan , "linux-hyperv\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , "tglx\@linutronix.de" , "mingo\@redhat.com" , "bp\@alien8.de" , "hpa\@zytor.com" , "x86\@kernel.org" Subject: RE: [PATCH 0/4] x86/Hyper-V: Unload vmbus channel in hv panic callback In-Reply-To: References: <20200317132523.1508-1-Tianyu.Lan@microsoft.com> <20200317132523.1508-2-Tianyu.Lan@microsoft.com> <871rpp3ba8.fsf@vitty.brq.redhat.com> Date: Thu, 19 Mar 2020 09:03:57 +0100 Message-ID: <87mu8c22ky.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michael Kelley writes: >> > --- a/drivers/hv/vmbus_drv.c >> > +++ b/drivers/hv/vmbus_drv.c >> > @@ -53,9 +53,12 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned >> long val, >> > { >> > struct pt_regs *regs; >> > >> > - regs = current_pt_regs(); >> > + vmbus_initiate_unload(true); >> > >> > - hyperv_report_panic(regs, val); >> > + if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { >> >> With Michael's effors to make code in drivers/hv arch agnostic, I think >> we need a better, arch-neutral way. > > Vitaly -- could you elaborate on what part is not arch-neutral? I don't see > a problem. ms_hyperv and the misc_features field exist for both the x86 > and ARM64 code branches. It turns out the particular bit for > GUEST_CRASH_MSR_AVAILABLE is different on the two architectures, but > the compiler will do the right thing. > Ah, apologies, missed the fact that we also call it 'HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE' - I have to admit I was confused by the 'MSR' part. We can probably rename this to something like HV_FEATURE_GUEST_CRASH_REGS_AVAILABLE - but not as part of the series. -- Vitaly