Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp611857imm; Fri, 29 Jun 2018 03:32:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJq5ebhVsvN1OqhXhQzRDeOscCjes7JAnm/95RLW/h/gp0wn7i+qKQlnfiwQiMvRPUtwCr7 X-Received: by 2002:a63:2d45:: with SMTP id t66-v6mr11884233pgt.381.1530268366815; Fri, 29 Jun 2018 03:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530268366; cv=none; d=google.com; s=arc-20160816; b=Os4DljKUxaLcSsBHq+F6UX/kEv1tcKwq/Rb0Vfl1rpmpBqemAkXZltoARXqWnACV4Q y0smrHPPhFA1XzAFU4kSXp/qFBn5bQiGkbPmrkliTbRmIgavHMFGrDxf2As+gp6vGk1D cTGL2v/q1BBD/zYDSbtf+kWtRTIUMlcnT5nZtktBE9uLE6R7thI6iBk3IRiJbJED/e+C iTljn2riVLOR4uq/nmyDp1Zem1Mi6H66CSHnGZeDUXEkwNZmVY8aGdnl5el1ahglEThM 89GZG02Xjp87gtfkMcuSiapcVKRY6gy+aKHy6G8xgTnR7fg1FVNCfKkJqvMLrQglRfwM 1TRg== 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=icP1pTjPajoWCQ2q2/g2YEYEyZA0iWshDXXhuIpYeqU=; b=ubDRF+tlNNoDItIMKHivchQzwrSLkb944rSaTl6Usa/wZbVmOEwjwJcxkfdbGXw9xl ruVNE6QFx7htgZcDmCgUp5b3WtyjkHaA0fNjC8stBlUti0HO8nPdRm3riI/runGC081y vAxuav8kqDoHXjE9vtQcq3FfQ/4kqoXWyaNYZ/sk5/b4zLbx4Zq3NgBs5U58sHtF3Qoi 0bErCGaxJ5mBJaeoVfgjXsStrMnt6UPrXAvSxq1/MFjgbjRvViLtAjpafMBaw/5I8OYA hY+MXx3ogrDmpfaWfRccur3ChOouJ2Pj4sOYy7w8yWO1IYOA59OpboBf6HeUF2l/7hbg bp0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=iCAHUqff; 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 67-v6si7933831pgb.107.2018.06.29.03.32.31; Fri, 29 Jun 2018 03:32:46 -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=iCAHUqff; 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 S935155AbeF2KLz (ORCPT + 99 others); Fri, 29 Jun 2018 06:11:55 -0400 Received: from mail-he1eur02hn0242.outbound.protection.outlook.com ([104.47.5.242]:37728 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932266AbeF2KLw (ORCPT ); Fri, 29 Jun 2018 06:11:52 -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=icP1pTjPajoWCQ2q2/g2YEYEyZA0iWshDXXhuIpYeqU=; b=iCAHUqffejt7Ck9Wl6VShJ2besAgiyTw3pep9PN3H6xMt6D7rHEySTN0T/S4cfFQxI9ropLExZMvRUUZ60H9CawDJMVZTxnGtL1r7XFMMGk50H7au8cB0y3Og30Ju4CBLQ1BJaWcylAwKWEUVhod9wPda5Ay/GWxDVPWeBo3deE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by VI1PR0801MB1981.eurprd08.prod.outlook.com (2603:10a6:800:8a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.20; Fri, 29 Jun 2018 10:11:41 +0000 Date: Fri, 29 Jun 2018 13:11:36 +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: <20180629101134.GA15656@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180628135313.17468-3-vkuznets@redhat.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: HE1PR06CA0161.eurprd06.prod.outlook.com (2603:10a6:7:16::48) To VI1PR0801MB1981.eurprd08.prod.outlook.com (2603:10a6:800:8a::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2f4c1e00-7896-48fd-8524-08d5dda8b640 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB1981; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1981;3:L7ejv+EgTLB92WSvGm8/My+Xs/h2yL9Gr64m94YXfPhOWsmdmbT/kT6GSsdG2sl85ttF737cZsAYu7fn77RkyOKtVY27ESISNp6qDLK9CNM6i0Cjm/BNXVPBrld5VVsd/rBbanrGvBWWgOErUBiXurvDvzz5kCtampGaOJUYonXXFHV8Z7Iyw+J6yrbDKAEC+XQLqFZyjbEBXLp/3q3dCp0xGt2thfbQan08NDwmhZp4m+Tm9PvCMUW2V4+bWmQu;25:GPTQDnnT2qpkQUZX7HN+7Pdqu9D5nIfKTvuiGAWgkWrV/8Ve2tOh3AdqCcrQwNNb7l16B+qpTrTi73DQrBUXEQio7NvC5J4bbQcXIC0RhJWJydFm8+JIh3QX1UZnGyjIPw5YdGE52n6Uyr/jMbZoOV+X/c69wK6zZB/ifKiY3LYmIxvmunHJPFKLuYuIjDg9i3OaToXZFnHHqA95BQtd2CMxnbgavrkRcAIVHlD+w/bM7tYZDnDRNCp3W6fder+/UXLMRhfug3AHJDNPjN6/qidamYSha7bIq9/vDcUx5fBQ6iJtYKTK4JO0pA8EUCtfjVEz1/Gwdn9UZUZe1tiIWQ==;31:DVBuqXAqmt8uQhUSbtitiNwAPeQptKrZxNgKW1iaRKOj8sfzQ8+p3aHW89N1E6+eG3TGBHpjzL0Qs1xdC77VyVwx1H+uvmdUbQZTyqcIeGBzwCjwRsdtTs7yVAMy5xsnAyRLmXycOrgo80fz+6FFenTqdoJ5nJCFGZR06uAf3JBvjTJkUxZFZJ/+KXG37XJiZf73g37lCneKPhOh5tQz0WGFEdi8lVHzVYgQ16ywBUY= X-MS-TrafficTypeDiagnostic: VI1PR0801MB1981:|VI1PR0801MB1981: X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1981;20:tUtupfh9yc74q80YrAEY0AOxYaX/r7U+3W0YP3d4c++YhZVSdatlZbKGXluTCkL7v67PSqO2MuXLtykYcwGNitDZbuaMhNIVoHowYkroDogAxZY4aw0NuiblNtvWoFqNGgflt6bx/gFPa2SRORaESPFlOSFayIS0gfpW7dQ1+mQVO04UIWmlS51HO158ewgx9nnX0BFNLuM+WIJbbkfHUYgtFZrvDPEOu/NKjuhIbvkdRs3YgkC7I4i4QAOTvJ9OAu1ZzT6odLtbHsRElsyUfb/ZGkrcTZjIpgKr+Dk76B0M/1GvsAUK3kDu24By3FHtqedjL9zo+sR6weHZRsaJmtp+XQlJ7gswOufbdwwkvOu1PF8fshOPbewp1HqCNE85liTYWFnweVqmSpTzcHwwSbrxobKTFMgm0cXpbULJ72ta2Lk2wM3HQQGbdJxFdet0ZjyAHI4IDMdDhmzHYPdy9pvolXxIdpygs6KyTCCLZ+NGmUy6yL5fQGIo7ANVfDxT;4:22ScVClX8ieXaMxQG2xAQFJx5D8f/ddW5T4gxXCUEZcJ/qy8jDU2ZNoLGNh31FnUOWASp5e23s0iAZ0l9x0Zxdcv+ksYCzH3eDfshfCAUB4m2MeytGkCwEGBpQOaB5NF70na5iscG6wRqO+sfY6Lu19KvB7QpL87r1U2bG3/zISx8J5WWoppgavvPkcN6b7vZs49RPti8xYTxiox8B1Wf/WK/QwAJYYnWryV84IdncEb5BKJ/NxOeIqilVC3ijtJZ0aiYjrwDwnOnnq3DWlL1Q== 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)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:VI1PR0801MB1981;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB1981; X-Forefront-PRVS: 0718908305 X-Forefront-Antispam-Report: SFV:SPM;SFS:(10019020)(376002)(39850400004)(346002)(396003)(366004)(136003)(189003)(199004)(486006)(7416002)(81166006)(186003)(8676002)(386003)(16526019)(81156014)(8936002)(36756003)(9686003)(52116002)(6666003)(7696005)(68736007)(26005)(6506007)(6916009)(5660300001)(76176011)(6116002)(23726003)(3846002)(229853002)(1076002)(4326008)(55016002)(47776003)(69596002)(66066001)(39060400002)(106356001)(105586002)(53416004)(478600001)(6246003)(305945005)(16586007)(316002)(86362001)(476003)(54906003)(7736002)(58126008)(11346002)(33656002)(25786009)(956004)(14444005)(446003)(53936002)(97736004)(2906002)(50466002)(30126002);DIR:OUT;SFP:1501;SCL:5;SRVR:VI1PR0801MB1981;H:rkaganb.sw.ru;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-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR0801MB1981;23:KHMcrdKyCdo+Fr5DI8sA2oSFI58Z7qUSfFrMo5T?= =?us-ascii?Q?oOJnqSnyTayCBc1pyIW5jNJEAYqM7stnzJfTjw/7vDM177rwhxnKxjrIiHDc?= =?us-ascii?Q?tVeTK94DXD7zrwIocVtnL6y9vTXVOXiq80jqxLn41as4hhVDBA/wD/ymgk5j?= =?us-ascii?Q?40UEdgdtu98U/LNmF8IAj2N6KWqPO1Z2559x39n1mywSvGH33yAXf3VpfMTg?= =?us-ascii?Q?9aJouaWBaVBYdZupy324jDui9VcOtf1jsIuHkrjCIUKL1Yq+TawDW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g4gzZZih5YhIOrv;20:8y5ZF1NAP2SPbdyZ/DwREtQye09lMaE3ns8Og7uAdwJKSWLZgquBKPZu/ehMK9/bm3Zkzn/oOxNHeB9dgo02QKS19QLT9pvSb3VGJtZeVdSRCazjlQPrP9xTxmMHd7Zv6aqgBWPoF6qh5eeVhvKLV8GkhKGrLK63n0wXV33v604= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2018 10:11:41.0957 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f4c1e00-7896-48fd-8524-08d5dda8b640 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1981 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 28, 2018 at 03:53:10PM +0200, Vitaly Kuznetsov wrote: > While it is easy to get VP index from vCPU index the reverse task is hard. > Basically, to solve it we have to walk all vCPUs checking if their VP index > matches. For hypercalls like HvFlushVirtualAddress{List,Space}* and the > upcoming HvSendSyntheticClusterIpi* where a single CPU may be specified in > the whole set this is obviously sub-optimal. > > As VP index can be set to anything <= U32_MAX by userspace using plain > [0..MAX_VP_INDEX] array is not a viable option. Use condensed sorted > array with logarithmic search complexity instead. Use RCU to make read > access as fast as possible and maintain atomicity of updates. Quoting TLFS 5.0C section 7.8.1: > Virtual processors are identified by using an index (VP index). The > maximum number of virtual processors per partition supported by the > current implementation of the hypervisor can be obtained through CPUID > leaf 0x40000005. A virtual processor index must be less than the > maximum number of virtual processors per partition. so this is a dense index, and VP_INDEX >= KVM_MAX_VCPUS is invalid. I think we're better off enforcing this in kvm_hv_set_msr and keep the translation simple. If the algorithm in get_vcpu_by_vpidx is not good enough (and yes it can be made to return NULL early on vpidx >= KVM_MAX_VCPUS instead of taking the slow path) then a simple index array of KVM_MAX_VCPUS entries should certainly do. Roman.