Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1895563imm; Thu, 19 Jul 2018 09:32:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpceHCr6x73PRSM5H9DMXPprsSF3M1OaYRfNPVqxYxHFo1X4y6oYb9s/3Hf475tUZq5NkA2G X-Received: by 2002:a17:902:8d98:: with SMTP id v24-v6mr10817660plo.250.1532017955491; Thu, 19 Jul 2018 09:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532017955; cv=none; d=google.com; s=arc-20160816; b=m0a5qShFxdotKfc14ru20MG7/xNgEUglH5uh223kdSTr4X2BoZGCKWIiLxeka02pYq I94MGP7uJF6CKgio7Gg8uZzuY8EnEVCaVz+sLIIYFJ52UePGPV7kmpMPtG5qNJNPDh/W GP8TLtHTzHcSltC7Xh2d9wxmM5lt7mEbSsGGiTkhrm17o7tZkdnHAW2RjD1/Y8T3gbaZ 7yNVk7o8fLOlpJ4aLZCgUKAAXe9TKA1V67nAQZlL51LMmjBrTPjKPI3KIeDEmEjCSZUq uP3YdxIMqVtIn0jntlC9L+D+bj/CjVsSKFbpFBvlV2Tv6HxjgcOkBeJS82woW6y72pGa F3yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=p3tsuuBMYKBXy7jah0NfSBYw+T6vc2PiKG9Av2o/o6c=; b=VhHlQynGdj/n3efzXKfiORYXJ625yvtPwZqQICKXZ/R/kWH9CrK+UQ8J71eJ88hoo0 u3XDdgh04P+dDcpfAxKA1P0R1DyjYq8zXpIn6gjEhy1iLL0ZQCJIHxyxssY80s7gGJkh I+ud5IyJVJDiIliBRWzr29fW0+mDTxq+2fochhabGAWyfQvPyAx5Y+rPyFiylYKI96E9 fX8/TrGO9jdUJqsCW6jOXnglim7frY3eSCrGZOq/kV7NoKQNUoaiAXG+EBO2reogYirS 1qeJfYBeHrkE1Qm4wARRZDG+r1YH1bTf9VBi7NrmazABvWDT9bYvEKzoO5+8PGuXZKey gB4A== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 78-v6si6145113pfn.205.2018.07.19.09.32.19; Thu, 19 Jul 2018 09:32:35 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731862AbeGSRPj (ORCPT + 99 others); Thu, 19 Jul 2018 13:15:39 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52766 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731661AbeGSRPi (ORCPT ); Thu, 19 Jul 2018 13:15:38 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0811840252ED; Thu, 19 Jul 2018 16:31:42 +0000 (UTC) Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id 156FC111DCE5; Thu, 19 Jul 2018 16:31:39 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Thu, 19 Jul 2018 18:31:39 +0200 Date: Thu, 19 Jul 2018 18:31:39 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Wanpeng Li Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Vitaly Kuznetsov Subject: Re: [PATCH v3 5/6] KVM: X86: Add NMI support to PV IPIs Message-ID: <20180719163138.GC11749@flask> References: <1530598891-21370-1-git-send-email-wanpengli@tencent.com> <1530598891-21370-6-git-send-email-wanpengli@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1530598891-21370-6-git-send-email-wanpengli@tencent.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 19 Jul 2018 16:31:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 19 Jul 2018 16:31:42 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'rkrcmar@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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čmář > 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 *mask, int vector) > } > } > > - ret = kvm_hypercall3(KVM_HC_SEND_IPI, ipi_bitmap_low, ipi_bitmap_high, vector); > + switch (vector) { > + default: > + icr = APIC_DM_FIXED | vector; > + break; > + case NMI_VECTOR: > + icr = APIC_DM_NMI; I think it would be better to say that KVM interprets NMI_VECTOR and sends the interrupt as APIC_DM_NMI. > + break; > + } > + > + ret = kvm_hypercall3(KVM_HC_SEND_IPI, ipi_bitmap_low, ipi_bitmap_high, icr); >