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=-2.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 D2FC7ECE562 for ; Fri, 21 Sep 2018 07:49:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 97DB421522 for ; Fri, 21 Sep 2018 07:49:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97DB421522 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389434AbeIUNhS (ORCPT ); Fri, 21 Sep 2018 09:37:18 -0400 Received: from mga03.intel.com ([134.134.136.65]:46880 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389264AbeIUNhS (ORCPT ); Fri, 21 Sep 2018 09:37:18 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2018 00:49:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,284,1534834800"; d="scan'208";a="90711506" Received: from svm-s2600wft.bj.intel.com ([10.240.193.45]) by fmsmga004.fm.intel.com with ESMTP; 21 Sep 2018 00:49:27 -0700 From: Yi Sun To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, tglx@linutronix.de, chao.p.peng@intel.com, chao.gao@intel.com, isaku.yamahata@intel.com, michael.h.kelley@microsoft.com, tianyu.lan@microsoft.com, Yi Sun , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Jonathan Corbet Subject: [PATCH v2 0/2] Enable PV qspinlock for Hyper-V Date: Fri, 21 Sep 2018 15:25:10 +0800 Message-Id: <1537514712-62434-1-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v1->v2: - compile hv_spinlock.c only when CONFIG_PARAVIRT_SPINLOCKS enabled - merge v1 patch 2/3 to single patch - remove part of the boilerplate in hv_spinlock.c - declare hv_pvspin as __initdata - remove spin_wait_info and hv_notify_long_spin_wait because SpinWaitInfo is a standalone feature. - add comments for reading HV_X64_MSR_GUEST_IDLE - replace pr_warn to pr_info - use pr_fmt instead of the 'hv:' prefix - register callback function for smp_ops.smp_prepare_boot_cpu to initialize hyper-v spinlock This patch adds the necessary Hyper-V specific code to allow PV qspinlock work on Hyper-V. In wait callback function, read HV_X64_MSR_GUEST_IDLE MSR to trigger the guest's transition to the idle power state which can be exited by an IPI even if IF flag is disabled. In kick callback function, just send platform IPI to make waiting vcpu exit idle state. In vcpu_is_preempted callback function, return false directly because Hyper-V does not provide such interface so far. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Jonathan Corbet Cc: Thomas Gleixner Yi Sun (2): X86/Hyper-V: Add Guest IDLE MSR support locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V Documentation/admin-guide/kernel-parameters.txt | 5 ++ arch/x86/hyperv/Makefile | 4 ++ arch/x86/hyperv/hv_spinlock.c | 81 +++++++++++++++++++++++++ arch/x86/include/asm/hyperv-tlfs.h | 5 ++ arch/x86/include/asm/mshyperv.h | 3 + arch/x86/kernel/cpu/mshyperv.c | 12 ++++ 6 files changed, 110 insertions(+) create mode 100644 arch/x86/hyperv/hv_spinlock.c -- 1.9.1