Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2415282imm; Thu, 19 Jul 2018 20:50:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeyFwvvvDtD4QDfJh28qJeDFNOQgs4lm6XbkQy2Dvg4XXba/R7PL7MNP5x+Ghh0GJzktr91 X-Received: by 2002:a17:902:6a89:: with SMTP id n9-v6mr437392plk.302.1532058621488; Thu, 19 Jul 2018 20:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532058621; cv=none; d=google.com; s=arc-20160816; b=fIQpQ20d7RlhZi0f7vjt39+DfEJXpFpCrZVNNawOjWmmSyuZv9k5bRSexk5/decprt XBXp8pQ8w9QtD1+kAL9CzfgNCYI82zI8+jZmKiWmvuFE9aC5X74SahIurht/ChdVWCRq pDE+BrBuwTnBjc/bemtQkbzUqvYYa/DA88r+PVMtthHYPoqmwD2pBlIjX74OZqPdpB0K zFd4P4eckNgXfW4xmmy2xejQKNzqfPN5UW/LNgFfloN5Vp0LjXu9qaVuasvYF66Hgxap Ejv5yR6rawQyrd1n0+BMIaf5opJawACrnDcx2oqUdva8/vlNtSFyVm5REQubT9yeaSZt 6ZiA== 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=j/gKdgI/c9YH0m40UfMcjMjMmlUpCU1lBJT57UOSQx0=; b=Sfs+APo7sfwtn+azz3fCnVtG7Vd3HO0iX7urG/tyQ06GIO0MTZyx8/Gw90ihadqsmG Rzwb548s7Z4XDlCBUc7fk3yJjwaHYl0mIyxmEY3rMle1cpg4aPe/GC3vAeGYr5n0H+Nz P0YEoRzMuUZ9N6aIDXpbOxDZS6vDWdAEbZm9BpcgFXVrplPGGbKEGFJS+p5lUJ4LR7RW r+F7sizhxg4x6OYzX80PwZwlTjI/YLskQO9kMlklhteZxja2Par6PdZTfuPLxoBwtUI6 NYtCX4x0zv9J5ob3r8bWpjGVew65WdTjDK8NQzZFo3lXNiURojJOrx6LVaLeefedmkSh g+WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jzClNLo1; 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 m193-v6si871545pfc.312.2018.07.19.20.50.05; Thu, 19 Jul 2018 20:50:21 -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=jzClNLo1; 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 S1726908AbeGTEfm (ORCPT + 99 others); Fri, 20 Jul 2018 00:35:42 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:42135 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726278AbeGTEfm (ORCPT ); Fri, 20 Jul 2018 00:35:42 -0400 Received: by mail-oi0-f66.google.com with SMTP id n84-v6so18911074oib.9; Thu, 19 Jul 2018 20:49:32 -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=j/gKdgI/c9YH0m40UfMcjMjMmlUpCU1lBJT57UOSQx0=; b=jzClNLo1yJTzUCL/d67zVmaJQMztrrMeucYE5vkYPcPvtVdj7tp6OxJSpvEEEgr1oq 2CpBXWkw4gttnByFPFSRZ86r+lJp5f5eoyM7Kq/ysneFe0Yfyxcb0EFBaYWiLKLnytYG XuEXNTPYeFaD0EDUYG6l9lMmIrrDtu2QFBdvyrcSQBBPFyYyxJxQuFPd24NzuWKkL59c nuAUaiQ0Csi0G3HL/gLPXhrg0bZQJvHfvbqAbo8LvpIw9jKxynE2UjUNjjaJl10QUTib kDH6tpam3DNxw7AqCfwDCZMYGalXE156eB/eSDKIpamA6DnL0LTtf24SZWzuIj0QmilS sQ/Q== 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=j/gKdgI/c9YH0m40UfMcjMjMmlUpCU1lBJT57UOSQx0=; b=VxsXcfIHODIf0KCMpFdLOcsnQ8xi77ZKgrXEcWTh0flhTHEEEQv/inBHo98j23CtHc 8qLT7iDzVtTE+OQEW7IZL9CaXGM8jWIP5w/K4N48to+Az/T0ziT8HdDRRTteu+0zWVHg tUVp/xqzCwS1jX78hOCA4WBYrQXdSFjLaHXE7r9wbOBBNB3+Z/xjvSgEsVogHmYfNH1M dRIt6nLbfmmTWifCT1k0CgY772hTI3SmGUFvsl0DiXBtkCaJEKeTgEAJcIIiikTxj+N9 HqdEz78eSqG/leBGuh0GxlUCbW82jQlMaDR6R/ASlLHZmhVgCPn4Or1735ZGv7RTA5gY MCAw== X-Gm-Message-State: AOUpUlHN96vyidoNc9WTNHg2v3ZNyBoSvnS9XNxJrDxIz7aa90DSSIIr mCTlGUgdvjLZKYurDjmrijHUsYTNBp4MKDMy69c= X-Received: by 2002:aca:cc46:: with SMTP id c67-v6mr411728oig.197.1532058572024; Thu, 19 Jul 2018 20:49:32 -0700 (PDT) MIME-Version: 1.0 References: <1530598891-21370-1-git-send-email-wanpengli@tencent.com> <1530598891-21370-5-git-send-email-wanpengli@tencent.com> In-Reply-To: From: Wanpeng Li Date: Fri, 20 Jul 2018 11:49:36 +0800 Message-ID: Subject: Re: [PATCH v3 4/6] KVM: X86: Implement PV IPIs send hypercall To: Paolo Bonzini Cc: LKML , kvm , Radim Krcmar , 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 00:47, Paolo Bonzini wrote: > > On 03/07/2018 08:21, Wanpeng Li wrote: > > + > > + rcu_read_lock(); > > + map = rcu_dereference(kvm->arch.apic_map); > > + > > + for_each_set_bit(i, &ipi_bitmap_low, BITS_PER_LONG) { > > + vcpu = map->phys_map[i]->vcpu; > > + if (!kvm_apic_set_irq(vcpu, &irq, NULL)) > > + return 1; > > + } > > + > > + for_each_set_bit(i, &ipi_bitmap_high, BITS_PER_LONG) { > > + vcpu = map->phys_map[i + BITS_PER_LONG]->vcpu; > > + if (!kvm_apic_set_irq(vcpu, &irq, NULL)) > > + return 1; > > + } > > + > > This should be the guest's BITS_PER_LONG, not the host's (i.e. you need > to pass op_64_bit from kvm_emulate_hypercall). Will do in next version. Regards, Wanpeng Li