Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1110469imm; Fri, 29 Jun 2018 11:32:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfkQ7UCr/kl9ZZS4IRD2//+Zhxvre13TFVglgSrtPg0o76MFeb4BhfnWICcN4AzVVpWvrAp X-Received: by 2002:a62:6303:: with SMTP id x3-v6mr15607472pfb.91.1530297177808; Fri, 29 Jun 2018 11:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530297177; cv=none; d=google.com; s=arc-20160816; b=m6fO6go2N9R+t0MBolUjLjiKJedCJELDyc891I+JNP4nilsWyzDgg+Sc/ZOMUbb7m9 yQMDn7JveT2Kx4Z1KW7IyhKa/newhyZvEQhqHp3UcTAxOXb8l9KgJtC79eHQOVFUQBY4 WxwdoItY9CqYS1Kf8OYkm0vCWzIZPbW5I/dVgGAPbzjpEcl4Aoxr1wtSZqBlLk1eHOjc +YBfxK9rD7TyxDmNNZ5OVTmHdcLvMg3Q8UCltw9ipx+JhvctqqxgKOO6fY/3T9+xn7mk 3j9rKM4fWkhTZIHk9twMFev8CB6botDZHzFsyzU5iXNa5Redo4FJB755nIMR0zuFqe5n bTDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticoutput:user-agent :in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=v1a6CgPLJMcLVai5YeJRUevtU3z0yO7pG7qKOFvsqDA=; b=e6cO2BlFRgkR14ue9XCscbHB81tKJC/VU16oDZXlNdKoN74Bz30xNecXx6HvJJGQgU giHhpzHu2G4aGDr4gQmjt3HkCh53TbhwGWyiyl4RG4GNN0F+/5qBOc+O5hka03jGgh2X 7BHNMzMefbDit60cxNGYiNK0q64icdeRRyder9tXWFcuDyPw3r02r1oV4SKAmnCej9zk rAgre5H2UJLR5HcVKWlAb1JKqkRhoaLw/se3JzWSCa2H7Kgpl8z94xcotfZMy5K9rLiI bV7COplXktlcQraJl8ivEAa4xUJHI2KbZfA7/lH1LJw2wmcyr9PCIg7jFm+hBMQ3RNvb KKnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=Hpfq+gTg; 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 c187-v6si9786532pfc.74.2018.06.29.11.32.43; Fri, 29 Jun 2018 11:32:57 -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=@virtuozzo.com header.s=selector1 header.b=Hpfq+gTg; 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 S936822AbeF2Pz6 (ORCPT + 99 others); Fri, 29 Jun 2018 11:55:58 -0400 Received: from mail-ve1eur01hn0206.outbound.protection.outlook.com ([104.47.1.206]:14123 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936157AbeF2Pzv (ORCPT ); Fri, 29 Jun 2018 11:55:51 -0400 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=v1a6CgPLJMcLVai5YeJRUevtU3z0yO7pG7qKOFvsqDA=; b=Hpfq+gTgwMr7GQBXpn6KOT7vh4m0Rxq2/OWJHRkrXfpI+bpepvV/IzDGpvJJ3ELS5qRrjelYvdaLWz8mQC6nb1Jr+V1ILcdb5Di/ixgGYwyseO8py79Y116cla4miMQ2kVSG+iW287M5alRJHiIBtdAGa59q41p5P5sL/Buf/nU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by HE1PR0801MB1980.eurprd08.prod.outlook.com (2603:10a6:3:4f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.24; Fri, 29 Jun 2018 15:55:37 +0000 Date: Fri, 29 Jun 2018 18:55:32 +0300 From: Roman Kagan To: Vitaly Kuznetsov Cc: kvm@vger.kernel.org, x86@kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Wanpeng Li , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/5] KVM: x86: hyperv: introduce vp_index_to_vcpu_idx mapping Message-ID: <20180629155532.GF15656@rkaganb.sw.ru> Mail-Followup-To: Roman Kagan , Vitaly Kuznetsov , kvm@vger.kernel.org, x86@kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Wanpeng Li , linux-kernel@vger.kernel.org References: <20180628135313.17468-1-vkuznets@redhat.com> <20180628135313.17468-3-vkuznets@redhat.com> <20180629101134.GA15656@rkaganb.sw.ru> <87y3exdh2o.fsf@vitty.brq.redhat.com> <20180629111227.GB15656@rkaganb.sw.ru> <87tvplddrr.fsf@vitty.brq.redhat.com> <20180629125216.GC15656@rkaganb.sw.ru> <87h8lld9hl.fsf@vitty.brq.redhat.com> <20180629143212.GD15656@rkaganb.sw.ru> <878t6xd37f.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878t6xd37f.fsf@vitty.brq.redhat.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: HE1PR05CA0130.eurprd05.prod.outlook.com (2603:10a6:7:28::17) To HE1PR0801MB1980.eurprd08.prod.outlook.com (2603:10a6:3:4f::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9ee3cc16-dbba-48b8-3ee4-08d5ddd8c262 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:HE1PR0801MB1980; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB1980;3:51fESqDyRLSxrcftJxJxTRwRKzS6n+pbLsYugjaY0NO0QkaoEm1J5w2QGsD/don/ETYQDtw3v9PUPYue9qNhlvLbXyUTUFOFwhzlstRiuzRo5QRD1fbEh1mMVTUHfOgMKbhjLkABa4YgLEWMoiy0NTL15SgBGCtZRIYvnCfDVt5/fZMpp1jhk52hCnDvXPUmysNYENW4jzJbPW4fa/a7BJYEMNNuSDfAv4fMzP3qieFZ/RMMgceU2Mv8tO0CC3K4;25:lCOD2dB4ffImWfkum7Iu8Vw0aCw/a7tyBANPyw2YtyANdgpkHGW6Rh3HFby4p5Ua4JiFH5ayNbMWnsOukaLTfzskcPfqFjdiKDWSnIJ27AjGL3AL3nB8zSMl1pu/8gS3ACntYjJCUaZE2kLUja5KXk0/GwfJWgmEH0alfTRHXUgGzB38P4dUfu8KVvTLp1csCzSY2BK/yiiXvrcTOIx6I4IH4+XeOxAKwGNgcwQFQClagU5zYYP5ZfNFrT+VA+ymvSAoVVR5+EoF229k1wXbs1Nb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yZx6MtzICWuo/8daswLK7CO5KhpNo1QNxn+cmOf9KXLlKa48MXBhrMJG7rTXaKoVYXqiYG26HOxgTLQnGva5QwX6bPxTOrQ4dLXDA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:HE1PR0801MB1980;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0801MB1980; X-Forefront-PRVS: 0718908305 X-Forefront-Antispam-Report: SFV:SPM;SFS:(10019020)(346002)(376002)(366004)(136003)(39850400004)(396003)(199004)(189003)(6246003)(6916009)(486006)(11346002)(956004)(6666003)(39060400002)(7736002)(6116002)(476003)(66066001)(3846002)(47776003)(446003)(55016002)(76176011)(7696005)(52116002)(6506007)(386003)(23726003)(33656002)(1076002)(69596002)(229853002)(97736004)(305945005)(105586002)(26005)(106356001)(16586007)(54906003)(16526019)(53936002)(7416002)(58126008)(68736007)(478600001)(8676002)(2906002)(5660300001)(36756003)(53416004)(14444005)(186003)(50466002)(8936002)(81166006)(4326008)(25786009)(81156014)(316002)(9686003)(93886005)(86362001)(30126002);DIR:OUT;SFP:1501;SCL:5;SRVR:HE1PR0801MB1980;H:rkaganb.sw.ru;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HE1PR0801MB1980;23:StydWUCcjUCKFOF5+N0SdW3soay/15UvctfwIeh?= =?us-ascii?Q?4uNUYLdJlQAflQdSdsC8CxYDPAkFUyhfWYWA12qyrikOP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FbIXsI2+mjs6pA5Cn192SFZ2QuF9xoisywEeQLo/LNYWS7hRiiy1kg73eqZDk3ufcPNvBkM3btCUZnkF2ZnViOyseLgZsscMRHGQSSdD1c141jK6YxxfJAipaxpSkbhkwGwg4/O0ALseyX/Woa5ElxpLwZs+WlFPvhklGN6JFC6+Dzxc4oBZc5JFxOTJF4eB/gOv9pXI3dO6ACBlvSUqTS6/JaBnC2JOykB;20:3wIMbIgeO/dhRh5Ft4U4KQ8ThLX9jaq+/Njw9F5ML8GAMlIZI3iIkh0W93BXXH6SSjfMoc65Vh5YUHw2SnPG3JEvjQJAI7EXeZxQVPHHVXtX/NO2eMTOsaivnsxpFvzFKkePD6o6euaGcpsXOEMHmaqwYpyhtRI+ymyeOnXsRTM= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2018 15:55:37.9029 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ee3cc16-dbba-48b8-3ee4-08d5ddd8c262 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1980 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 29, 2018 at 05:25:56PM +0200, Vitaly Kuznetsov wrote: > Roman Kagan writes: > > > On Fri, Jun 29, 2018 at 03:10:14PM +0200, Vitaly Kuznetsov wrote: > >> Roman Kagan writes: > >> > >> > On Fri, Jun 29, 2018 at 01:37:44PM +0200, Vitaly Kuznetsov wrote: > >> >> The problem we're trying to solve here is: with PV TLB flush and IPI we > >> >> need to walk through the supplied list of VP_INDEXes and get VCPU > >> >> ids. Usually they match. But in case they don't [...] > >> > > >> > Why wouldn't they *in practice*? Only if the userspace wanted to be > >> > funny and assigned VP_INDEXes randomly? I'm not sure we need to > >> > optimize for this case. > >> > >> Can someone please remind me why we allow userspace to change it in the > >> first place? > > > > I can ;) > > > > We used not to, and reported KVM's vcpu index as the VP_INDEX. However, > > later we realized that VP_INDEX needed to be persistent across > > migrations and otherwise also known to userspace. Relying on the kernel > > to always initialize its indices in the same order was unacceptable, and > > we came up with no better way of synchronizing VP_INDEX between the > > userspace and the kernel than to let the former to set it explicitly. > > > > However, this is basically a future-proofing feature; in practice, both > > QEMU and KVM initialize their indices in the same order. > > > Thanks! > > But in the theoretical case when these indices start to differ after > migration, users will notice a slowdown which will be hard to explain, > right? That's exactly why I suggested a warning on VP_INDEX != vcpu index in kvm_hv_set_msr. > Does it justify the need for vp_idx_to_vcpu_idx? I'd personally prefer being pointed at a scenario where this becomes relevant first. Roman.