Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6236132imm; Wed, 27 Jun 2018 04:39:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJUWTiuci1hWToHZ6f4L691hDd3DXFsi5x6vnLnqFSPHsmh7dmo0XuUzEwnGTE6z2cf7IWi X-Received: by 2002:a65:4841:: with SMTP id i1-v6mr4742633pgs.75.1530099558305; Wed, 27 Jun 2018 04:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530099558; cv=none; d=google.com; s=arc-20160816; b=jBOaD3YcuS7XFTJb8ZnUFZYbs+ROx1UUM9K5omveLWSnNsz/65GLZN5IrgwRl+D/4k l9y/EWytHCXtP0/KqiSJkwvo44N1O1QmUi+fFzYTQpjVA+J/YNKv2cclnqNZJJJasBb3 DscsEIx/+Ipzl4YLjjVz2v3eVAKY15h7mn2EQ1mpMIDLeJOOe5lsFKoNGSjAqXhAPA1Z s1pg34g6a63xF/BcG2XRqyb8QWAvfnWnf8EgmXp/07+DeuA9hgll2mmzSlcFzyylk/C2 BxMs+JTeUFhGDRZNapVvgJyRUSrzil8LTg46N5UM2zoVEIyO2cFAcvaDAZ03CZ+QtkZx ybFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from :arc-authentication-results; bh=mDZJUPVxjoEaHHfBvx8vhy/kgJbr5p67yP3mUUXUZW8=; b=HVtqkkiFrNxkIF7BwPdJUxe5d9toLqgtjJj+acfkVjpk4zjiCF4ilYX9cnnt+mlWkj PAzGT/Vzf3LB2EqhoTCAfjjJ7OPclgjo7hYLvbqk5ETV+XZvhbuK3ylRv4KfdC1ihpzX A/5ChlYQQLMp0QIv3qbqEx4sFD7lgvVsOPbYyQkD0wU9oEpoG9zy7rs0J1ssQREk+NIw dUC7ri4nLOTEleEyk1jr4iAOj62T1ZONOuc24sfjaI5uYlaZ8ta4OZi0zESGA6l1ySDf UZqYW+fOs3hmAgOhG93wlRYsP6acCrsQSm04PzkafAWGBvYX8xgwGsOwC8cS/BEYYwhg Oidw== 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 c12-v6si3234716pga.608.2018.06.27.04.39.03; Wed, 27 Jun 2018 04:39:18 -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 S1752423AbeF0JZX (ORCPT + 99 others); Wed, 27 Jun 2018 05:25:23 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60858 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751314AbeF0JZV (ORCPT ); Wed, 27 Jun 2018 05:25:21 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F92F401EF06; Wed, 27 Jun 2018 09:25:21 +0000 (UTC) Received: from vitty.brq.redhat.com.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 500362156880; Wed, 27 Jun 2018 09:25:19 +0000 (UTC) From: Vitaly Kuznetsov To: Wanpeng Li Cc: "the arch\/x86 maintainers" , devel@linuxdriverproject.org, LKML , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Tianyu.Lan@microsoft.com, "Michael Kelley \(EOSG\)" Subject: Re: [PATCH 0/4] x86/hyper-v: optimize PV IPIs References: <20180622170625.30688-1-vkuznets@redhat.com> Date: Wed, 27 Jun 2018 11:25:18 +0200 In-Reply-To: (Wanpeng Li's message of "Wed, 27 Jun 2018 08:49:08 +0800") Message-ID: <877emkh98h.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 27 Jun 2018 09:25:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 27 Jun 2018 09:25:21 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'vkuznets@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wanpeng Li writes: > Hi Vitaly, (fix my reply mess this time) > On Sat, 23 Jun 2018 at 01:09, Vitaly Kuznetsov wrote: >> >> When reviewing my "x86/hyper-v: use cheaper HVCALL_FLUSH_VIRTUAL_ADDRESS_ >> {LIST,SPACE} hypercalls when possible" patch Michael suggested to apply the >> same idea to PV IPIs. Here we go! >> >> Despite what Hyper-V TLFS says about HVCALL_SEND_IPI hypercall, it can >> actually be 'fast' (passing parameters through registers). Use that too. >> >> This series can collide with my "KVM: x86: hyperv: PV IPI support for >> Windows guests" series as I rename ipi_arg_non_ex/ipi_arg_ex structures >> there. Depending on which one gets in first we may need to do tiny >> adjustments. > > As hyperv PV TLB flush has already been merged, is there any other > obvious multicast IPIs scenarios? qemu supports interrupt remapping > since two years ago, I think windows guest can switch to cluster mode > after entering x2APIC, so sending IPI per cluster. When we manifest ourselves as Hyper-V Windows 'forgets' about x2apic mode: Hyper-V has a concept of 'Synthetic interrupt controller' - an xapic extension which we also support in KVM. I don't really know any obvious scenarios for mass IPIs in Windows besides TLB flush but I'm worried they may exist. Without PV IPIs any such attempt will likely lead to a crash. In general, I do care more about completeness and correctness of our Hyper-V emulation at this point: Windows is only being tested on 'real' Hyper-Vs so when we emulate a subset of enlightenments we're on our own when something is not working. It is also very helpfult for Linux-on-Hyper-V depelopment as we can see how Windows-on-Hyper-v behaves :-) > In addition, you > can also post the benchmark result for this PV IPI optimization, > although it also fixes the bug which you mentioned above. I'd love to get to know how to trigger mass IPIs in Windows so a benchmark can be performed... > I can post one variant for Linux guest PV IPI if it also makes > sense. :) With x2apic support I'm actually not sure. Maybe configurations with a very large number of vCPUs and IPIs going to > 256 vCPUs can benefit from a 'single hypercall' solution. -- Vitaly