Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2341401imm; Sat, 28 Jul 2018 15:01:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdqdVcIi1Wn1TIKeUPnbhNfNlnu99qtY2MG7fjKZoBcnzpsfr/ljajvIX7aa1Nh9ry6lC2/ X-Received: by 2002:a17:902:2d24:: with SMTP id o33-v6mr11029450plb.38.1532815260818; Sat, 28 Jul 2018 15:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532815260; cv=none; d=google.com; s=arc-20160816; b=UgreSE2ZBn12VItBCBynnRLRsyEyt3gNWukHR35KH3VhMicYCp/wy35Z76SHdk++tl 1eXF5vf4FqxrqFZRCpfvbuNRQKH6zGmYmKx0NFt4kWazvkA9tCNu1/aW6V2zLoG5/OqY v5B8ndsjxCrlxJGzCNCHgQuHWYH7yBCoikntqA+u7P6zA4RY1lF0ahpUxd6bPo8zvOZv s90/owgQmueUShvP2Bxqx7lp0bQzpXsOTCI+DZh5XkjdUQtrQ3aSOYayXTgddSEbpMSJ rRAO4rVSfKvH8svs0ZXulmKUmDi6VzJbcZtSUj7O+t7alGyBUqSW5jKaz69NSdT4rMv2 kzYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=Rxhkw2/YlwGNwyrKDku0FWiuOpN4mgROg34+QxPrbs8=; b=jQ2UDFJtc2idTqPWTW062ZWsBQLSm8L9qYJ3jG+7ZPKkMDGlkoizcdR7oRzy+OkvxP tE7IvJkYdpbU1Tx2DrOnjG11epYkHLtZPlaC5eh4/LfdQgFeOsat4tI6oUH5NBcQp0dx K/I1o7av+FWbBB2HjVIuGtVHhT4oktMzWge3ZM5ulP0HgeYVFOBtTtLiYUtEjGHn7ZQ8 eNgpWMUW5MxdotA1blGRxlegcNTiIBdMpPjT0/ORRL2sSecDjfVaHLTnaVd1M3ScdRyJ XdZiM8kacs1l2QrD62ELYp3Vv7YWFUNtojHs6Qc7WEYvdC9FDmlTXw60v8jcGLkLi2uh AA1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v32-v6si6721262plb.273.2018.07.28.15.00.46; Sat, 28 Jul 2018 15:01:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731414AbeG1X1t (ORCPT + 99 others); Sat, 28 Jul 2018 19:27:49 -0400 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:48506 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731332AbeG1X1t (ORCPT ); Sat, 28 Jul 2018 19:27:49 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id jXEgfS03Kq9i0jXEgfFIen; Sat, 28 Jul 2018 14:58:50 -0700 x-originating-ip: 107.180.71.197 Received: from kys by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.91) (envelope-from ) id 1fjXEg-0003bj-CJ; Sat, 28 Jul 2018 14:58:50 -0700 From: kys@linuxonhyperv.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, sthemmin@microsoft.com, Michael.H.Kelley@microsoft.com, vkuznets@redhat.com Cc: Sunil Muthuswamy , "K . Y . Srinivasan" Subject: [PATCH 3/4] Drivers: hv: vmbus: Get rid of MSR access from vmbus_drv.c Date: Sat, 28 Jul 2018 21:58:47 +0000 Message-Id: <20180728215848.13814-3-kys@linuxonhyperv.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180728215848.13814-1-kys@linuxonhyperv.com> References: <20180728215630.13712-1-kys@linuxonhyperv.com> <20180728215848.13814-1-kys@linuxonhyperv.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfL7SP7eMaKUZNjKYJS1av4w7hgNlnZjGtZqIGBQA9Q60Fhyn5ipWTRwLFvANSpwri2VMFUydoPg5btRUIo0GvHX5Jkq7h6TQyMIJhsl95LzbnXBeLvgg MoF8+NrRDS9ug93l3AtA5rfGi1flmJFezml+XhJn4RaDLGVgIJKrF4n7EsyF5tBkj2b/9vtDkzPsublWR6sUUR456v9RrjBXkUdheV7pbFdwukN0QNQYI6KT fJnYd/NsYB5/E02H0BS93yduFviSrL82rmExgk3mBji5z2mzIVXiFu4uQXsRUA4Hvme0dklK+jWwCODhEWuX9Tzt6CTTu4HegpZgcB/4mP5j46d9Wr5R59J5 rGOJFT0TVQCn78W63tT0NZ2heA3RCgyjM+9EPmTS+U4GgFedAcMV5eWXTpCwco1DXF9qx1HNtOaX2M32LooVoLwd11GW5SCr0fgLL4Y7qt6oY095058+PGSm X5iuDgS1g6gyjhyfSz+lLjh/tGrxbZLZO8DJ2naJuAKxj6gXJnQ4T6VEGnXkzS7+nYS8BfXjYTvqOJeIiP7hYTGRoFPchNAHcMgeGw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sunil Muthuswamy Get rid of ISA specific code from vmus_drv.c which is common code. Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Signed-off-by: Sunil Muthuswamy Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h | 3 +++ drivers/hv/vmbus_drv.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 156a2e5a97a9..b731c4bf70ed 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -96,6 +96,9 @@ static inline void vmbus_signal_eom(struct hv_message *msg, u32 old_msg_type) #define hv_set_synint_state(int_num, val) \ wrmsrl(HV_X64_MSR_SINT0 + int_num, val) +#define hv_get_crash_ctl(val) \ + rdmsrl(HV_X64_MSR_CRASH_CTL, val) + void hyperv_callback_vector(void); void hyperv_reenlightenment_vector(void); #ifdef CONFIG_TRACING diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 5e946b1be54c..db145e1a7049 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1146,7 +1146,7 @@ static int vmbus_bus_init(void) * Register for panic kmsg callback only if the right * capability is supported by the hypervisor. */ - rdmsrl(HV_X64_MSR_CRASH_CTL, hyperv_crash_ctl); + hv_get_crash_ctl(hyperv_crash_ctl); if (hyperv_crash_ctl & HV_CRASH_CTL_CRASH_NOTIFY_MSG) { hv_panic_page = (void *)get_zeroed_page(GFP_KERNEL); if (hv_panic_page) { -- 2.17.1