Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp790612imm; Mon, 2 Jul 2018 23:23:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdr+6xWACbUi1VsqWoiihncHLGH3hXQpK+vn20z1pq4voXtSl6fEU22iQrwB4OhsGGFzEnO X-Received: by 2002:a62:cc4d:: with SMTP id a74-v6mr26831382pfg.200.1530599022668; Mon, 02 Jul 2018 23:23:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530599022; cv=none; d=google.com; s=arc-20160816; b=iyuIkEv8L7etaIgIuDtc/6PW7etNp3leRZOyG/sx/8Xq1RahNbfkzthlU4MH4XMK1z aw6p7lR6WZGO4RePE8Vqel7BIVza1Sh95aastoTbVk+SqBBDPnANj4IpmpnKjuGSXnB8 SuF28X4jpy5fbsNSvEWtj0ZYQPm+D+4ZBDkR35BTFUzMx07MJ/TYeMp2PyN4cMOFoeyP jJBUADAoT6+7GpiVnqNL5wC99orFtnsUwbIen3TS72azSFcN/FQ/Pbekw3dGnSHlgdAO /FBH+08bO4orFqNQKUQ3QnsFAedNhMnqIBtvtYvXHf+NPQVvEN63DBYzlGAhenlYn39K TxJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=HVOb+vFJlwfEy9YaU1RuD0B68qKfBVjS/jc+VgEZqW0=; b=xSTlUMZxahYKprl8rJtIEnoEeIvsX8ROk0aDnnvIzLLWQtuMqvkv3dr8KWznZvTq/x mixUIapbGBt1XA/PeLgPY5IMpG4uZZlwhK7GMaUWcTLZRf33/xJdTrf5NB7srLb9k/vA UKIF0VHKLoCLwOobSxiiJ64KlcrV44RNX4SyBslnozsVeX7Tp0tmBENzvzWR3yy6CJ4F X1o8PCCDsBvv5uSijob6L3kjXi94AJCfdhuc6mok+SJH/q8tXpYYMP8kXPa8yh9fQcST 6yTHUfzQK9scVjhlGSHT2gMmoXIsMhEu5HmWHlV4EEvvnUcDhiwRmm7eA3pSnngnq3Wm YsFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PKWRrL0D; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a140-v6si421282pfd.35.2018.07.02.23.23.28; Mon, 02 Jul 2018 23:23:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PKWRrL0D; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933370AbeGCGVv (ORCPT + 99 others); Tue, 3 Jul 2018 02:21:51 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:42633 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932767AbeGCGVs (ORCPT ); Tue, 3 Jul 2018 02:21:48 -0400 Received: by mail-pf0-f194.google.com with SMTP id v9-v6so486403pff.9; Mon, 02 Jul 2018 23:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HVOb+vFJlwfEy9YaU1RuD0B68qKfBVjS/jc+VgEZqW0=; b=PKWRrL0DcBRZZKToQLn/A/ZchISxXwjMT/yB8kjCrUthzbBI9tcmDhtJ+lanz/ntZs uXAnqvJ5sxXlOITSrrIFQpUxRb4xTRmuuVVXGAGaw1dvtag5Bq1M+mXdFJCHAiQmPek2 IVWMIoFkvliQo8y09TpY0cYbpiXl4SlJofWGwQ7JUa1YPJe5gymhctt/mnAj9XCs7tHH G4XoRBkQh9Rk+PA807TouGwbFaNCb+I4bNOiHE9rxmoEeTEXQbQWjoWm8wn/APLE+vcS HXRIoshmaoSxwoRzk0rw4ciwJFFHzZlCDSmzX4w2+SNKiJRmjacPMS5ske5UFeHHjrXx wgaw== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HVOb+vFJlwfEy9YaU1RuD0B68qKfBVjS/jc+VgEZqW0=; b=cQkAGFJpsKiokVwxRPXNn3H0LFrIyo/DFnDK35n62UO91j6FSYjZbfr/9FXJYbHQkD WtIo+1yd8+GLgMjOpZmVzTNYm/uhDX4ydz9fzUIiOyhvSqPH7T7ICg8ZguuCOiYwUrwk q8o4jr1QnumOIupnlRYLRcYJ8objR+t+obQ3MmPcxV8W1x8z3a5C+M1MAONVEnZVCJ6B 5UKlhkrHmRojAiU3rMUtenrmNafb1RzY/Cn56njHxtKbXFVxtySjcArk9Bk7SA2N+It+ Bw+qi8M1b2KKyVRug9wPkP0O0irrIiCrfjstuOSPNwgS90HzvgZfTXn8PSSmxa9cw1Ll 0y5w== X-Gm-Message-State: APt69E3+IIxKrIsW+P/AdUgcQi/ZAz6cnve+0HEeE5+Gg8Z7DdtXXcQC 4yP34DMoAGd8SGp/BMEVZ+VitA== X-Received: by 2002:a63:8c5:: with SMTP id 188-v6mr23989672pgi.97.1530598907850; Mon, 02 Jul 2018 23:21:47 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.123]) by smtp.googlemail.com with ESMTPSA id v89-v6sm1766427pfd.64.2018.07.02.23.21.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Jul 2018 23:21:47 -0700 (PDT) From: Wanpeng Li X-Google-Original-From: Wanpeng Li To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Vitaly Kuznetsov Subject: [PATCH v3 6/6] KVM: X86: Expose PV_SEND_IPI CPUID feature bit to guest Date: Tue, 3 Jul 2018 14:21:31 +0800 Message-Id: <1530598891-21370-7-git-send-email-wanpengli@tencent.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530598891-21370-1-git-send-email-wanpengli@tencent.com> References: <1530598891-21370-1-git-send-email-wanpengli@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wanpeng Li Expose PV_SEND_IPI feature bit to guest, the guest can check this feature bit before using paravirtualized send IPIs. Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Vitaly Kuznetsov Signed-off-by: Wanpeng Li --- Documentation/virtual/kvm/cpuid.txt | 4 ++++ arch/x86/kvm/cpuid.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/virtual/kvm/cpuid.txt b/Documentation/virtual/kvm/cpuid.txt index ab022dc..97ca194 100644 --- a/Documentation/virtual/kvm/cpuid.txt +++ b/Documentation/virtual/kvm/cpuid.txt @@ -62,6 +62,10 @@ KVM_FEATURE_ASYNC_PF_VMEXIT || 10 || paravirtualized async PF VM exit || || can be enabled by setting bit 2 || || when writing to msr 0x4b564d02 ------------------------------------------------------------------------------ +KVM_FEATURE_PV_SEND_IPI || 11 || guest checks this feature bit + || || before using paravirtualized + || || send IPIs. +------------------------------------------------------------------------------ KVM_FEATURE_CLOCKSOURCE_STABLE_BIT || 24 || host will warn if no guest-side || || per-cpu warps are expected in || || kvmclock. diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 7e042e3..7bcfa61 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -621,7 +621,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT) | (1 << KVM_FEATURE_PV_UNHALT) | (1 << KVM_FEATURE_PV_TLB_FLUSH) | - (1 << KVM_FEATURE_ASYNC_PF_VMEXIT); + (1 << KVM_FEATURE_ASYNC_PF_VMEXIT) | + (1 << KVM_FEATURE_PV_SEND_IPI); if (sched_info_on()) entry->eax |= (1 << KVM_FEATURE_STEAL_TIME); -- 2.7.4