Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5266613imm; Sun, 22 Jul 2018 17:53:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpckrAs2B6ZLATmpz9eCZ+Gsq7mAc7HIt1JKLoZNZmS8qifK7C0Kf/ekWDVqaeJmv/HFloZZ X-Received: by 2002:a63:e001:: with SMTP id e1-v6mr10192078pgh.380.1532307204004; Sun, 22 Jul 2018 17:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532307203; cv=none; d=google.com; s=arc-20160816; b=pmIYlEd422+vv2Ge8MaxbjKnPbCN5iZ1nZSQlmRgOiSNg473Rz8aos1Q5OVPKHI8rf 27HJ7fEGUPlwDZRLYVT1wYonCyyLc34gwYCGC/ODEJmeDrPS0VoHNLYqzqSo/i0UxIva pB5DDq+xtK8aMEf06K02Mj8O3bMpjqm2eKIEYnj6fkm5BKSGNIRjkitYhfmmHxKtnQc3 anaB6pXRPRbsZFtS5JaoKOxPw8awKiturz/A+AhLPoMVsQcsj0+GdxfL+9LEE0qYvXQU 51Blqr3kkyY0SBIPWndHIzyrma7pMYYJwMBxvdfovv7yKkKKudUMco7YxCaorN0liNyd enwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=+IEp2zZGb+mWhpJPcuHg8TKoSs6lcgIlzZDyxL3c618=; b=AxdxeD31NLxYgi8iyAmqerwRTuo6l1Ho0WGC4NNA7lXZDq35KvoKuDuG6+gcaFxy2y 9CqUB4UGnRqY0o5xCsS4uoCG2jT3Rp2tRp4mGOeyoPhSOw16G8e9Ax/Drz0fxetrcrPu Z6b56KtETyxax9TCFJhAszj40JauVgvj3n15VbOmG79TBuPN9EzK+bkpoy0xLe+xdhqN 3ky4WlRxKDvraiW6VrDDqLEOB4A7ppPD0oo9Bs4LitjioeQ+asixjsQqEa2WygNGY9fe KzEvGrjxQ/o+oyaFuH0p47fhzIa5eQoP23uhuuJhG1ppH5kG/Kjq+t6yUZDzf9kHfNxq wQoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L5BxOsky; 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 k187-v6si7142879pga.539.2018.07.22.17.53.09; Sun, 22 Jul 2018 17:53:23 -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=L5BxOsky; 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 S1731175AbeGWBu6 (ORCPT + 99 others); Sun, 22 Jul 2018 21:50:58 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:44186 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730758AbeGWBu6 (ORCPT ); Sun, 22 Jul 2018 21:50:58 -0400 Received: by mail-oi0-f65.google.com with SMTP id s198-v6so30352376oih.11; Sun, 22 Jul 2018 17:52:21 -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; bh=+IEp2zZGb+mWhpJPcuHg8TKoSs6lcgIlzZDyxL3c618=; b=L5BxOskyCJrb0YRF8QiPHGd/IWIJ8ZBbGcUF8Ua3fWIidd33/tC2wQYsKC3/Q0gQKf pQYXAw6psa3F3GGXiOFLGXwsRHFLPMNSH3G18mgOYw8s+CIjiDcLAW23ybG+q4InUV+S mh4eWmc6dgguev+gNGXEy2IKOULyvnn/q1gk3M+mgFk6A3c6ZbxD9FtAKdYvQT8/T5e0 dHU6RKwFF9Ak4Wsca5gHasrGloK+IN0IKBODy6LSuCNNcBH69BM246K2Q0D612GuNw7s 2Vo36ryat6TtFJoVNZsIdEOJ63JXjTCsszkVY0Rl4xik5REwgkl6QwFNLUNhOlCpZt3d DJeA== 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; bh=+IEp2zZGb+mWhpJPcuHg8TKoSs6lcgIlzZDyxL3c618=; b=V0aomO/P2T7GosIgvBNNC+S7x49XtQvez3AdsI3+lvBX/mJHyJF2p7ZT+GSEzEjwt9 yDe0+KeoQl5azLI6mj0euq6EJLRKb0gPyk4NxXhQuGZd88uKQIKdzJImys6iTt9OW5pn zFYLhS/8wksL5zBssh62s36PTQGwr58FlUx4AfgVznOfLDZRBhWs/Y+ol6e6ZnltoBHt DBipMS0sxFOCxPHbZI17GJSSTtZuiCXX/JP1R/tuNe+TGG7s9gv3V6Jg/UyuzFs9yzqZ gUyTA6Ykk7WxaZrdHfAH5Ir3ebMkZdYqjf458Su3GOagzOQCdFzrpzVL19FW06MJAxQt qx9w== X-Gm-Message-State: AOUpUlHUVB7EGIbvP4pSwhbfyMtKWrkdRVMp9wjeG9IAnXbQb7yQWXiU N3N41NdVL5+Yj03vCjdImWhcImMCpZTW7Axtc0o= X-Received: by 2002:aca:cc46:: with SMTP id c67-v6mr7278201oig.197.1532307140827; Sun, 22 Jul 2018 17:52:20 -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> <825c953c-ec48-84cf-f1ca-bdee5d327427@redhat.com> <20180720132656.GB8330@flask> In-Reply-To: <20180720132656.GB8330@flask> From: Wanpeng Li Date: Mon, 23 Jul 2018 08:52:12 +0800 Message-ID: Subject: Re: [PATCH v3 5/6] KVM: X86: Add NMI support to PV IPIs To: Radim Krcmar Cc: Paolo Bonzini , LKML , kvm , Vitaly Kuznetsov Content-Type: text/plain; charset="UTF-8" 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 21:27, Radim Krcmar wrote: > > 2018-07-20 10:04+0200, Paolo Bonzini: > > On 20/07/2018 05:53, Wanpeng Li wrote: > > >>> - 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. > > > > It's not KVM, this is arch/x86/kernel/kvm.c so the guest side. > > Yes, I was preparing to drop the delivery mode bits as they are not > needed for NMI_VECTOR: real APIC can't send nor receive vectors 0-15, so > we could just say that NMI_VECTOR is sendable through this interface and > is delivered as APIC_DM_NMI. > > I didn't realize that this allows the other delivery modes. They are > not useful [1], but we don't really have a better use for the three > bits. The only other option so far is extending the cluster index to > increase addressability ... I'm starting to reconsider as addressing > another few millions VCPUs would probably be even more useless. > > Wanpeng, sorry for the confusion, feel free to use any version. > Document the hypercall layout, though, No problem, you and Paolo always help me a lot, thanks for that! :) Regards, Wanpeng Li > > thanks. > > --- > 1: I think that OSes will use unicast INIT+SIPI as it's easier to call > it after preparing structures for the new CPU; SMI is pointless; > LowestPriority shouldn't be supported; and Reserved (APIC_DM_REMRD) > is reused for KVM unhalt, where unicast is most likely.