Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp461520imm; Thu, 13 Sep 2018 02:40:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZzO9zeXj8w/at0eCNsTi3XpBE/6yRowLl00BorVZGn+GNYqs8DWkAG8x0eFKdJTVHzMtw0 X-Received: by 2002:a63:6054:: with SMTP id u81-v6mr6358719pgb.433.1536831651695; Thu, 13 Sep 2018 02:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536831651; cv=none; d=google.com; s=arc-20160816; b=Iyy82xqIXBxzpv7GzYNfi0ydw84/6NaGFaXLhJjVZ42QIIsqTsz6N5O7tVXH0ejlvl yKNga7y7IpXVS2759cDFan1gAUWYZiKSyTksOyo7Zuc76o0xoD8wnaMbAPZQql7lUWc0 Njqb7UC6kXw5TlCopPcFLeq4Bkzpa/V2kLSiBx++su8Xl5yY3/2M06/ePoxGFCB5gRda eGV/m0rmyv6V5Bne346nw2kvqWBy1tlxtC1TJqnYceZtCXGxHdLWu5HL09K9KrzUzjBY fVpWHOH1zTDNs7+JUPKvrCjAYrjEvHE0pe4g7m9G07d95DBx3dIT177QBFXAHO1DcDoF Z8qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=zF6o9FynM6chVJSOo9ijVYnDF3dx6v+V8/y4PJy18HQ=; b=Tqc3So99o7R1KRY84JD+9pq65XdJevS42vXUF+i3d93X6o66woq9QQMQxZprUkBYQn 7faxlKh0XcAnD/bQ0EacxeEcj19Hq8rtP2bt38KOvPXRm2WD6A4jQnUBet7+FliHsypQ WkqVyvhH2VDpHi+/KanoXk3LissG5P481nJl6vbSEh1sutMCXmYB/MhsmcuoltDaC0yo Hq8xVtJiAanmcsEkfhle4uvBDHF0hN2yPjA/8AtkiDyNLLIqFy+CDMJsWqyqEUlMPw/A xVZCNCVbKTvYOiV7Rw3L0HZaSd1cRN7Uye1malvOzS+aFKySyzkuifViMIVjj6ZSMnl+ CI8g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13-v6si3986458pgh.255.2018.09.13.02.40.36; Thu, 13 Sep 2018 02:40:51 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727734AbeIMOqg (ORCPT + 99 others); Thu, 13 Sep 2018 10:46:36 -0400 Received: from mga01.intel.com ([192.55.52.88]:49361 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbeIMOqg (ORCPT ); Thu, 13 Sep 2018 10:46:36 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2018 02:37:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,368,1531810800"; d="scan'208";a="90093124" Received: from svm-s2600wft.bj.intel.com ([10.240.193.45]) by orsmga001.jf.intel.com with ESMTP; 13 Sep 2018 02:37:44 -0700 From: Yi Sun To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, chao.p.peng@intel.com, chao.gao@intel.com, isaku.yamahata@intel.com, michael.h.kelly@microsoft.com, tianyu.lan@microsoft.com, Yi Sun , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Jonathan Corbet Subject: [PATCH v1 0/3] Enable PV qspinlock for Hyper-V Date: Thu, 13 Sep 2018 17:13:22 +0800 Message-Id: <1536830005-37260-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 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. Beside that, make HVCALL_NOTIFY_LONG_SPIN_WAIT hypervall to notify the hypervisor that the calling virtual processor is attempting to acquire a resource that is potentially held by another virtual processor within the same partition. This scheduling hint improves the scalability of partitions with more than one virtual processor. 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 Yi Sun (3): X86/Hyper-V: Add Guest IDLE MSR support locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V hv: add description for hv_nopvspin Documentation/admin-guide/kernel-parameters.txt | 5 ++ arch/x86/hyperv/Makefile | 2 +- arch/x86/hyperv/hv_spinlock.c | 99 +++++++++++++++++++++++++ arch/x86/include/asm/hyperv-tlfs.h | 5 ++ arch/x86/include/asm/mshyperv.h | 3 + arch/x86/kernel/smpboot.c | 2 + 6 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 arch/x86/hyperv/hv_spinlock.c -- 1.9.1