Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp340209imm; Fri, 21 Sep 2018 00:50:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaSjvD+vcX5q+jSIgyI4ke1uymeV/hpfs8uS515ar7zUoXzq/iCnYOi/Lc6QBnMb9CtGwbp X-Received: by 2002:a63:b95e:: with SMTP id v30-v6mr39751587pgo.221.1537516225258; Fri, 21 Sep 2018 00:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537516225; cv=none; d=google.com; s=arc-20160816; b=YZCA2aDY+O0aHi5aQo2mjgGYj+PTpqU0TOACfxA+Nnid1MOJGmFMs4iC/TBVFMf05l CjuCof/3NHRkgAn9tveQlklDdVTLZXPCVAZjMQA2ByzdfLAiBYqtzNIzpQwNa7sOCOKN DjtLCf6ofOJkvUevdWr7U0PjLNDCPtEvWYSrsQ98Ej5Nswk9il0H1xG/PDvt70NHr9r/ UXDkwYQQ2rBxtDUwKUAMynYAUWeA5aFV+1iDVk0m3/kgsU483IDkNWaOwDeAeUT7mO19 MVKuY1WqNCh2fU3iNy5kgvMEfMm7bRwRkOC+bbqV5wYAZYjyDnyE77kmaRl5b33DDuSB qerw== 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=l3s2vY8wV7quUsEXAHbbUSzZ41nfFijuFbbEPFy8bAY=; b=ZzUKhW/OxmXIQdq806AVpFhaZLn8fBnn7fh8DVB5BDA0z5+m/Jr7sn8X1wP5kniAY7 J3k+kUfEiLcfNoz7JcsQ7/0IYMJnW/klKMx1CQjfgd84Ku7s3FZ2gS+UVI8FLi2KB+Z0 8j10UaW4my6FPKVjWBQCRdSQe0xYp/U7p4RH+4Cr0iiepffzxd6pSnr98jcYYOMs9Ggo YZ2nm6n5pfDqHJw5t8Im8IDln4ScHT653NfWi8ScPeqtYn5MzkuLWANZXVzgkpMqP0md QJMqMYg6QGP90uuFKb1Tgib7z4ffD1v9P+VpYqbiFImNPYzvHluqIw4/MLP+bliCT3sS MlPA== 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 m11-v6si26035794pga.618.2018.09.21.00.50.09; Fri, 21 Sep 2018 00:50:25 -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 S2389426AbeIUNhS (ORCPT + 99 others); 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