From patchwork Wed Jun 21 20:09:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 9802825 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 654C660329 for ; Wed, 21 Jun 2017 20:09:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54DE024603 for ; Wed, 21 Jun 2017 20:09:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4892228569; Wed, 21 Jun 2017 20:09:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70CC028515 for ; Wed, 21 Jun 2017 20:09:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751130AbdFUUJV (ORCPT ); Wed, 21 Jun 2017 16:09:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46898 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751961AbdFUUJU (ORCPT ); Wed, 21 Jun 2017 16:09:20 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A58877CE11; Wed, 21 Jun 2017 20:09:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A58877CE11 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=rkrcmar@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A58877CE11 Received: from potion (unknown [10.43.2.65]) by smtp.corp.redhat.com (Postfix) with SMTP id 88286619D3; Wed, 21 Jun 2017 20:09:16 +0000 (UTC) Received: by potion (sSMTP sendmail emulation); Wed, 21 Jun 2017 22:09:15 +0200 Date: Wed, 21 Jun 2017 22:09:15 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Roman Kagan Cc: kvm@vger.kernel.org, Paolo Bonzini , Evgeny Yakovlev , "Denis V . Lunev" , Eduardo Habkost , Igor Mammedov Subject: Re: [PATCH v2 1/2] x86:kvm:hyperv: add KVM_CAP_HYPERV_SYNIC2 Message-ID: <20170621200915.GD27032@potion> References: <20170616173740.23272-1-rkagan@virtuozzo.com> <20170616173740.23272-2-rkagan@virtuozzo.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170616173740.23272-2-rkagan@virtuozzo.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 21 Jun 2017 20:09:20 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 2017-06-16 20:37+0300, Roman Kagan: > There is a flaw in the Hyper-V SynIC implementation in KVM: when message > page or event flags page is enabled by setting the corresponding msr, > KVM zeroes it out. This is problematic because on migration the > corresponding MSRs are loaded on the destination, so the content of > those pages is lost. > > This went unnoticed so far because the only user of those pages was > in-KVM hyperv synic timers, which could continue working despite that > zeroing. > > Newer QEMU uses those pages for Hyper-V VMBus implementation, and > zeroing them breaks the migration. > > Besides, in newer QEMU the content of those pages is fully managed by > QEMU, so zeroing them is undesirable even when writing the MSRs from the > guest side. > > To support this new scheme, introduce a new capability, > KVM_CAP_HYPERV_SYNIC2, which, when enabled, makes sure that the synic > pages aren't zeroed out in KVM. > > Signed-off-by: Roman Kagan > --- I have changed the subject tags to more common "kvm: x86: hyperv:" and added minimal documentation: Please let me know if you'd like to improve it. diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 4029943887a3..3f4b1d5f0dce 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -4157,3 +4157,10 @@ Currently the following bits are defined for the device_irq_level bitmap: Future versions of kvm may implement additional events. These will get indicated by returning a higher number from KVM_CHECK_EXTENSION and will be listed above. + +8.10 KVM_CAP_HYPERV_SYNIC2 + +Architectures: x86 + +The only difference from KVM_CAP_HYPERV_SYNIC is that KVM does not clear SynIC +pages when the guest enables them.