Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2417431imm; Thu, 19 Jul 2018 20:53:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdtjdQzI7LdHv2MSBtgslAo/xgcVFHnw05jfb5djCnaBroqiXjJ9ZRQub19upaEhLkdexXm X-Received: by 2002:a63:f206:: with SMTP id v6-v6mr412543pgh.319.1532058830928; Thu, 19 Jul 2018 20:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532058830; cv=none; d=google.com; s=arc-20160816; b=n0ku6qgiJ/cw+a41YKUvRqVNOzVh05zGr7DPjCqJOAyY7VRDTFfqi1re1kt3lVg+1b LgJ/EwZc6jy4SgUHgcI+aCu9mjM+VGxueY+fXlwvSU6YHr/N2fT3nBSwajqEO6YsJcHZ KOqIyelE/VYZm9xYNrYjOCPBfcAPCaZUFxHB5UO5XzwdO8Eio9ztYwmJQ513MIud2f7B hV0rxgjlKiyhv62klvkl+W8rHNdTWSH+sRwHxmem5qNaMWY+Gpac+KPORkbrW/EQpVV4 e3ZHmNQRB7MmJxDd27ToyRj9mzfUfHBjgiMs666EfBRBB8I/YE2WlFY8UeGVZkmC7Ay1 maFg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=iQJ2v1VcvfRskDsOmblVQ/8125dz0NV4YPdiNwUJl0g=; b=VcVU+4JoSKBhGaag1Sn+Ri4wbmjML8RxTEZGfPv0e4QAPGPvZxFrAhBlcneiQIo1Ud 1Fa9M1bgxQBnA69a4bdWJ1no30O7EZ9kaXVpMCbYOwvp6OectFDPg2iBbiOy3Xb+BRb7 rbKuMFybhY5aiKovx5XxDO1wXm6ef/qwE4YjtJhCJUnHrH7IZG+JkSk7VjAfHmoTNtQG hQc/SUfG33qsBvNofaLzbuu/5Vm2Gaw6/7fTatB842PlgqmCP++bUQSDSIQP1XPz8Ohf 6sTjmbjd+VQQd4TwVq2MhZvmFwsg+VV/WP1WPIb34M26s0WCjC6tQ3rlY8NCI+Hedech Swfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kB65w3QB; 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 1-v6si834649plt.342.2018.07.19.20.53.36; Thu, 19 Jul 2018 20:53:50 -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=kB65w3QB; 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 S1727549AbeGTEjM (ORCPT + 99 others); Fri, 20 Jul 2018 00:39:12 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:38767 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbeGTEjM (ORCPT ); Fri, 20 Jul 2018 00:39:12 -0400 Received: by mail-oi0-f66.google.com with SMTP id v8-v6so18946620oie.5; Thu, 19 Jul 2018 20:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=iQJ2v1VcvfRskDsOmblVQ/8125dz0NV4YPdiNwUJl0g=; b=kB65w3QB+j1vIjCItCJ36YhLjE3U66bt5aj/nLzoDyJfx5sSEy2gAYvjOeov5zbeAJ Wp9PBqPnkD9aFQPafmrs9dlAiPRydrF60TBbJW962tY/sUSaZIfofLZsq5LQdxxAGSSc thWAktI6P8Z5JdSUpZ6XvVPe4THJ+/toIUzySHJRPqWp3SLAPlpzdBABrgdJhXK6b4X8 whni825nQV5xbmfI6KslrZpvT5tFc936IF4Q6dAlfelmGAhSF88c4F2Yig7OadmrK4GZ h49EHeCdbU5bM0DUOTCFFNzPFVQfE1V7xYGsnsR+6m5do5G7u9mE9cnKEJr1gPG/30Cz 6yzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=iQJ2v1VcvfRskDsOmblVQ/8125dz0NV4YPdiNwUJl0g=; b=d28ypP8qsSFZIMnHkhhel+LJMVe5lw1DVsNWSjb1ytM6z2m4kTiRiJop6rBRMB/S2T KqVqBw4oJ16yS01q6BeJqff+W1ZyIegzooDq5oE9sr1RHeY8DQruHuK2Cva4UZaEO6r+ FLKsXfwW9IVdoy9OICFe0sFUGeekV/PbAjyTGiUVuVk/HuqcpBdO0ydp/kcJ81kIwxlh yXNT/4ZlY1Rr8WkLWO4fOMUfBT8w+vHrXuPzin1I9wEWqr0qe3BJHtF1CzPP50JuRxYp 24QijFZ39D6t01+vBUnU4/yYYc5DTjVe2MYPPJoPKw/BrYP/5Z5daNyMEE5FlX157T9w WWAg== X-Gm-Message-State: AOUpUlEdmjk4eKxwsR/vsymbhb+phG9JuP7JgefVqEZ9ZpE5j2A6ILox dOJp9fZtjQEBFZnKrZaQqqZ8/N0ywiIKRmprBeQ= X-Received: by 2002:aca:4ec6:: with SMTP id c189-v6mr432202oib.186.1532058780740; Thu, 19 Jul 2018 20:53:00 -0700 (PDT) MIME-Version: 1.0 References: <1530598891-21370-1-git-send-email-wanpengli@tencent.com> <1530598891-21370-6-git-send-email-wanpengli@tencent.com> <20180719163138.GC11749@flask> In-Reply-To: <20180719163138.GC11749@flask> From: Wanpeng Li Date: Fri, 20 Jul 2018 11:53:05 +0800 Message-ID: Subject: Re: [PATCH v3 5/6] KVM: X86: Add NMI support to PV IPIs To: Radim Krcmar Cc: LKML , kvm , Paolo Bonzini , Vitaly Kuznetsov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Jul 2018 at 00:31, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > > 2018-07-03 14:21+0800, Wanpeng Li: > > From: Wanpeng Li > > > > The NMI delivery mode of ICR is used to deliver an NMI to the processor= , > > and the vector information is ignored. > > > > Cc: Paolo Bonzini > > Cc: Radim Kr=C4=8Dm=C3=A1=C5=99 > > Cc: Vitaly Kuznetsov > > Signed-off-by: Wanpeng Li > > --- > > diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c > > @@ -479,7 +479,16 @@ static int __send_ipi_mask(const struct cpumask *m= ask, int vector) > > } > > } > > > > - ret =3D kvm_hypercall3(KVM_HC_SEND_IPI, ipi_bitmap_low, ipi_bitma= p_high, vector); > > + switch (vector) { > > + default: > > + icr =3D APIC_DM_FIXED | vector; > > + break; > > + case NMI_VECTOR: > > + icr =3D APIC_DM_NMI; > > I think it would be better to say that KVM interprets NMI_VECTOR and > sends the interrupt as APIC_DM_NMI. Yeah, in addition, SDM 10.6.1 also mentioned that: Delivery mode: 100 (NMI) Delivers an NMI interrupt to the target processor or processors. The vector information is ignored. Regards, Wanpeng Li