Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp562028imu; Tue, 27 Nov 2018 03:00:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/V0AqbKU+OXeCUFVsJl/EqWVfRHRmf0VAH/URYU43ZkDI5ooWJXE0C2lIkI9p6adQhAlIP7 X-Received: by 2002:a17:902:a70b:: with SMTP id w11mr31580774plq.84.1543316454520; Tue, 27 Nov 2018 03:00:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543316454; cv=none; d=google.com; s=arc-20160816; b=EVqndKS7j7AqgfauKQrc2F4OFVx0p7EPUk2vJzBpTE5K/Wlyzz39/u+2kUq28m/vH3 ziTTdC7AXJPpPXR1w6FQ+1GshVjrfPgLWB6sn0a7Tg5QVfbOlQFIPPsUM4t0iHBWHslP jaM7InH3N7fyP7I+ThJNxI6aEWAOft9VopzQmPSkFzaBs4ye3d6MqAhUZ4+WVhvX1pUo yoaFdFo9GzhEJkSjH2iWITmaA674sBAwrsNVd1PB7Aa/9gRAdqiGAvvI5lcv58CsikTn NwMAApyUY2fli0UeUb7MgEyBmY204uKiLuCUqW1pswKEqMQFkcy8sxyytwpq1v3AgJxU /tOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticoutput:mail-followup-to:user-agent :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=mKPFqddIgEXG1ifwbnTg+NJzKSoV5Pyp4+lCjoF8k5I=; b=y/Hu08Tgy8YE+I8r8vYbam48hwGOC6mFKSQw8t45kvoBl4bCxCfFCj+Zn8m+pSJOhF vjWRTD/JgmVMTVCBM0UkZRqL2TjGRg2SJ+b97n3QzHtRQAAIk3bvBOprs2pWUlrh4szA UkSK2TOB4FvHJ7yaCbqDnoJT2SvIN5a8qLHQ7wL4Lshu5oEkLwM+UTmA1BZV+fz3RUYH GPbHjByW/5DYfCKv5AIxYD1VRgRyFvkVfUMwF2VHbC8hIdTDq7MkxzEimLtZ8Bt1R5v3 xXoqMhIul7U90WDhdCt2qseHSr6fBE57M8qB2F9eRN9hyRbzWf6QThUVrBMWFINGrJtZ cedQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=O26g7cyG; 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=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8si3561473plr.343.2018.11.27.03.00.38; Tue, 27 Nov 2018 03:00:54 -0800 (PST) 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=@virtuozzo.com header.s=selector1 header.b=O26g7cyG; 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=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729324AbeK0TSg (ORCPT + 99 others); Tue, 27 Nov 2018 14:18:36 -0500 Received: from mail-db3eur04hn0212.outbound.protection.outlook.com ([104.47.12.212]:7241 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727574AbeK0TSg (ORCPT ); Tue, 27 Nov 2018 14:18:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mKPFqddIgEXG1ifwbnTg+NJzKSoV5Pyp4+lCjoF8k5I=; b=O26g7cyGQahPElcLA8K+KuxaJ8vA26/OuQOS8aqJN/Vjd27XSIf5WvU6QjXVUZIJK9rEuJWlkzyAg9aIf0HuN7llSnRM2CIlTQ4Y/IVOO4lloN/dlQsz2aQkErwF10zTEzUIfJCxRVkEBzZ2yx/U+fwgjEt4paiQlIT+HsnpgPA= Received: from VI1PR08MB3599.eurprd08.prod.outlook.com (20.177.61.74) by VI1PR08MB1086.eurprd08.prod.outlook.com (10.166.45.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.19; Tue, 27 Nov 2018 08:21:21 +0000 Received: from VI1PR08MB3599.eurprd08.prod.outlook.com ([fe80::5d2c:980a:d77e:34e2]) by VI1PR08MB3599.eurprd08.prod.outlook.com ([fe80::5d2c:980a:d77e:34e2%3]) with mapi id 15.20.1361.019; Tue, 27 Nov 2018 08:21:21 +0000 From: Roman Kagan To: Vitaly Kuznetsov CC: "kvm@vger.kernel.org" , Paolo Bonzini , =?iso-8859-2?Q?Radim_Kr=E8m=E1=F8?= , "linux-kernel@vger.kernel.org" , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "x86@kernel.org" , "Michael Kelley (EOSG)" Subject: Re: [PATCH v2 3/4] x86/kvm/hyper-v: direct mode for synthetic timers Thread-Topic: [PATCH v2 3/4] x86/kvm/hyper-v: direct mode for synthetic timers Thread-Index: AQHUhZ9mV1oam64KnkyNE5PKjfame6VjSReA Date: Tue, 27 Nov 2018 08:21:20 +0000 Message-ID: <20181127082116.GA16047@rkaganb.sw.ru> References: <20181126154732.23025-1-vkuznets@redhat.com> <20181126154732.23025-4-vkuznets@redhat.com> In-Reply-To: <20181126154732.23025-4-vkuznets@redhat.com> Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mutt/1.10.1 (2018-07-13) mail-followup-to: =?iso-8859-2?Q?Roman_Kagan_,=09Vitaly_Kuznetsov_,_kvm@vger.kernel.org,=09Paolo_Bonzini_,=09Radim_Kr=E8m=E1=F8_,=09linux-kernel@vger.kernel.org,=09"K._Y._Srinivasan?= =?iso-8859-2?Q?"_,=09Haiyang_Zhang_,=09Stephen_Hemminger_,_x86@k?= =?iso-8859-2?Q?ernel.org,=09"Michael_Kelley_(EOSG)"_?= x-originating-ip: [185.231.240.5] x-clientproxiedby: HE1PR05CA0185.eurprd05.prod.outlook.com (2603:10a6:3:f8::33) To VI1PR08MB3599.eurprd08.prod.outlook.com (2603:10a6:803:85::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR08MB1086;7:NGSDNTZ3fBOA9bTn3Vt+fHDzbaZfhNfWIwF5UAXybEtzh8RXUO0wcEmhVb803wkfxa5RvCBfNfMpLmzS10XZ+MMPDXnpvNkLPVShoIzrmNjTdmCp//S9fqmXClCPbpBGXuNkZH62WRUWpeFvwmuZCQ==;20:2+yRUpOTlLipIIiyA5bZSip/MRu8Dt9HrQnvrgJh1Jlx3xWRnGRXJJfdhKCnQzac33j2CgDNp5bB6ZlRI/4U5hCjHBI+MqxT/CDXYk9f8UmVUGtJK0lUWnV+PD8R6F5f6ES4/sa4McE6xvg6EPxOwLMmkScaSC903S9AJw7dhLs= x-ms-office365-filtering-correlation-id: 8551ab19-0e68-457a-5233-08d654414fa2 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:VI1PR08MB1086; x-ms-traffictypediagnostic: VI1PR08MB1086:|VI1PR08MB1086: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231443)(944501410)(52105112)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:VI1PR08MB1086;BCL:0;PCL:0;RULEID:;SRVR:VI1PR08MB1086; x-forefront-prvs: 086943A159 x-forefront-antispam-report: SFV:SPM;SFS:(10019020)(39850400004)(396003)(136003)(376002)(366004)(346002)(189003)(199004)(53936002)(6512007)(5660300001)(86362001)(68736007)(6436002)(229853002)(6486002)(305945005)(4326008)(7416002)(6246003)(58126008)(9686003)(7736002)(14454004)(66066001)(316002)(6116002)(3846002)(1076002)(54906003)(2906002)(6916009)(478600001)(8676002)(81166006)(71190400001)(476003)(446003)(106356001)(11346002)(105586002)(33656002)(8936002)(81156014)(26005)(25786009)(52116002)(486006)(186003)(36756003)(97736004)(71200400001)(386003)(102836004)(6506007)(33896004)(14444005)(99286004)(256004)(76176011)(30126002);DIR:OUT;SFP:1501;SCL:5;SRVR:VI1PR08MB1086;H:VI1PR08MB3599.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: HDKWJUodlP5ppEnIX45J5gjNt2qHr0aWoacyPE5t7Ywbv7OVcvaU2Ma7jefdWa9F4y8fu8ddMqYNu9fALDUcntzU0g2pKa25r95csqNuqkiPMm6UZZIXrSwRDEctD4G3X2jAtSM5RHm6m07DN6lrvIdYCpRSraBpJD9C3wSNW15FQbhuUweQTAKpy5UBdgiZfaAEdc3iMNrj8RG8eHNfuqkfVUtmDf48G2eWvGkJH0BXyQnaXacJLF/uJkq/7isAAsFi3/kntGGDLMUKMuDP+pR0C3Bas62BWujn89oenv6f451wq4nUds8ZM3J8x0ZqhSIfXUywb96CernOh9caJ/ptfcUC4p4zQaYWk0K4ZMakQ1zHRVFPU10KpJeZ+WqvdZv/E4CM207sU6qNeXnrtgQXOlNHmZWkF8uUmqR1OGdrqSh5JiloRC48n08e4nzNvS8u2Vl8ISndXBJCBPhWMZ2ZxUfxmoVs0yr3zc4uBKElEUR7884nKawksbw8oQMacMYiYAYXifCwl9bmhpl/N+o93pX+oGtI3NhqM3MvPCg= spamdiagnosticoutput: 1:22 Content-Type: text/plain; charset="iso-8859-2" Content-ID: <0F710EE9AE91B9439A4B78DF2EA37207@eurprd08.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8551ab19-0e68-457a-5233-08d654414fa2 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Nov 2018 08:21:20.9812 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB1086 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 26, 2018 at 04:47:31PM +0100, Vitaly Kuznetsov wrote: > Turns out Hyper-V on KVM (as of 2016) will only use synthetic timers > if direct mode is available. With direct mode we notify the guest by > asserting APIC irq instead of sending a SynIC message. >=20 > The implementation uses existing vec_bitmap for letting lapic code > know that we're interested in the particular IRQ's EOI request. We assume > that the same APIC irq won't be used by the guest for both direct mode > stimer and as sint source (especially with AutoEOI semantics). It is > unclear how things should be handled if that's not true. >=20 > Direct mode is also somewhat less expensive; in my testing > stimer_send_msg() takes not less than 1500 cpu cycles and > stimer_notify_direct() can usually be done in 300-400. WS2016 without > Hyper-V, however, always sticks to non-direct version. >=20 > Signed-off-by: Vitaly Kuznetsov > --- > - Changes since v1: avoid open-coding stimer_mark_pending() in > kvm_hv_synic_send_eoi() [Paolo Bonzini] > --- > arch/x86/kvm/hyperv.c | 67 +++++++++++++++++++++++++++++++++++----- > arch/x86/kvm/trace.h | 10 +++--- > arch/x86/kvm/x86.c | 1 + > include/uapi/linux/kvm.h | 1 + > 4 files changed, 67 insertions(+), 12 deletions(-) Reviewed-by: Roman Kagan