Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3651031imm; Mon, 25 Jun 2018 02:12:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJKZGFd7sDBV4S606UXcoB832BNdGulPQVM6ZdkwX/UaVxEfdz04mew8i+11Vjry0ho2I9/ X-Received: by 2002:a17:902:8645:: with SMTP id y5-v6mr11550213plt.334.1529917942210; Mon, 25 Jun 2018 02:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529917942; cv=none; d=google.com; s=arc-20160816; b=0WhvnbHS5MaFvMKlYlKTCqrkJcbSa4q/8fGGmxWUdeFkttwzvTNwYoWzOoh8KdBX1L 8IaBVTMmMRhHgS6JJiVo6PjZgETHwD+SNfnBdmjxO2xiOBjnz58pbHXotyN9nJ/7Ldp7 Eesi3+sCDV5CW6HR0vBy/v5MV28lYcXKXIJ/cOaqW/uf3tZeTR6wlJ+QFw4q7DweGhuI U98XBBYmglupZRY4Ou0AxD1QrzrpS5JIwTEBIzV6E2EGKNaoGXJl5jzR/gnGRCbnBM78 le/IYp77VU6epIt3CE3RuGHxgxseXqgLKC9LH3AqVaIB0oCIME35Af0UYkuoplTGJlXB HPKQ== 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:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:arc-authentication-results; bh=7PzTi1r811agvR1pT1sWdvRiBCGq0A5NEI4gNMRuPcc=; b=HZWzTB9N/hQgfmtMXbrcGn1r/ls2cutemPXexWo/UN8taP7cJ02mSyvYm7suDJnCEP 3xGJxSmii0YABwbw8+Jbl4TVBaQNBzyw8kvJKhGzt1D0KmEmQoftue58yIDmLCCk0oAX Sk/tCmrYU9/szzp+1ZeeaK9V6azXXfibfQXAOWoML556JilN0nK9LLotc/pHNQsi6uiR EZ3Ua1pwPFEPGHNn78QFTK/Gw7QQUeowP1mJc+h5KL3vBXZuy8wzYgsA4Wjl2c6GupHw SgY7+i1UIwR90/HGM6cc3k7eFCUOtG5WvzJLBTAfB3h0Do63ug5DIXhfk+ChBQtCKuft E2Vg== 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 d23-v6si4502006pfj.311.2018.06.25.02.12.07; Mon, 25 Jun 2018 02:12:22 -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 S1754836AbeFYJKe (ORCPT + 99 others); Mon, 25 Jun 2018 05:10:34 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35830 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754449AbeFYJKd (ORCPT ); Mon, 25 Jun 2018 05:10:33 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 77EBC4040076; Mon, 25 Jun 2018 09:10:32 +0000 (UTC) Received: from vitty.brq.redhat.com.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A536A2026D5B; Mon, 25 Jun 2018 09:10:30 +0000 (UTC) From: Vitaly Kuznetsov To: Radim =?utf-8?B?S3LEjW3DocWZ?= Cc: kvm@vger.kernel.org, Paolo Bonzini , Roman Kagan , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley \(EOSG\)" , Mohammed Gamal , Cathy Avery , linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] KVM: x86: hyperv: implement PV IPI send hypercalls References: <20180622145616.5851-1-vkuznets@redhat.com> <20180622145616.5851-4-vkuznets@redhat.com> <20180622191333.GC2377@flask> Date: Mon, 25 Jun 2018 11:10:29 +0200 In-Reply-To: <20180622191333.GC2377@flask> ("Radim \=\?utf-8\?B\?S3LEjW3DocWZ\?\= \=\?utf-8\?B\?Iidz\?\= message of "Fri, 22 Jun 2018 21:13:33 +0200") Message-ID: <87r2kvgrju.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; charset=utf-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 25 Jun 2018 09:10:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 25 Jun 2018 09:10:32 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.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 Radim Krčmář writes: > 2018-06-22 16:56+0200, Vitaly Kuznetsov: >> + >> + /* We fail only when APIC is disabled */ >> + if (!kvm_apic_set_irq(vcpu, &irq, NULL)) >> + return HV_STATUS_INVALID_HYPERCALL_INPUT; > > Does Windows use this even for 1 VCPU IPI? > It seems that it does. > I'm thinking we could apply the same optimization we do for LAPIC -- RCU > protected array that maps vp_index to vcpu. Sure, both this and PV TLB flush will benefit. > > Thanks. > >> + } >> + >> +ret_success: >> + return HV_STATUS_SUCCESS; >> +} >> + >> bool kvm_hv_hypercall_enabled(struct kvm *kvm) >> { >> return READ_ONCE(kvm->arch.hyperv.hv_hypercall) & HV_X64_MSR_HYPERCALL_ENABLE; >> @@ -1526,6 +1628,20 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) >> } >> ret = kvm_hv_flush_tlb(vcpu, ingpa, rep_cnt, true); >> break; >> + case HVCALL_SEND_IPI: >> + if (unlikely(rep)) { >> + ret = HV_STATUS_INVALID_HYPERCALL_INPUT; >> + break; >> + } >> + ret = kvm_hv_send_ipi(vcpu, ingpa, outgpa, false, fast); >> + break; >> + case HVCALL_SEND_IPI_EX: >> + if (unlikely(fast || rep)) { > > Now I'm getting worried that the ex can be fast as well and we'll be > reading the banks from XMM registers. :) Maybe but currently we don't announce 'parameters through XMM registers' support in KVM (and neither do we support these for Linux-on-Hyper-V as we don't usually use FPU in kernel). -- Vitaly