Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1053216imm; Fri, 29 Jun 2018 10:33:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIEydK7LJ42+mYYH7vUTgCRvsMb6CFaNMnF0a4QsWBqWPv7yx5VthxOGCeVsOScDyquVqVe X-Received: by 2002:a17:902:a610:: with SMTP id u16-v6mr15714046plq.195.1530293581009; Fri, 29 Jun 2018 10:33:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530293580; cv=none; d=google.com; s=arc-20160816; b=pWgiWowPuTdXzT2n0MMEHvAFG4fPr7Bc0WtYtAv3+JqyAzrcJVfFUUzDZJbZg03mhT HSudsCNOpB50X2qJD7X+ZNu4ut4HDLzeZV6dObY9ukN8CFDNz6T9NQA9W8TEt0vqWxS9 9SrEMoHTEuU+rVMlnxqFOEfFf0i259FVnBKEMo1GH+dzPTGpeKPykXXntoEUGRYQDw4G aE0n0m2UsBnXacp3zOzBpimHAMfAWDE7463NYYSniQgl6m6F9cH3B+jk/9il3G3V6/Gr c3K1F1JInoZT+5MqQdJ9/BUvElT6gSC6yGg75Tujuc1hqDUjdaCsGNJaTuOcFBw84++D Tyng== 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=W8Gwbj5Vs8NwuhXQ1gqKdGOhrdcmcH6fHNF4tfR9dVI=; b=FgnDWJ5RJKq2Eb1CMdqnFnlJS2slaSPeE/V5XMZa6AxlvU8TYD/B0xPJjUK0/2vFK8 i3xCChAw0gUxXrdT6XLbNQDBd8UbUqAnWHF+x2LB5imgZZR86R5pdRBAVvYCEVSlAjtr /nvHWocjAn9PoSswan5LeqEwfLX59tok0OBtzxrxdYBf6ubLYrQ3uB4l6A+gk+mtgDVf AtFHcxv1fz+5wjcEqFTOyndIiGjnuIngpMGwLxmMq2/WUgZYyisc8y+o36RmoNF1yQGU gjv7NyqZ/vJorpLMb7qEjY+yP6Rg7Zc8y/RtXh3K/DHHXQM00kok3c9Ye2OM+2EQmkoJ TFUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=XCdPoGC7; 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 89-v6si9867024ple.488.2018.06.29.10.32.46; Fri, 29 Jun 2018 10:33:00 -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=XCdPoGC7; 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 S936937AbeF2Q06 (ORCPT + 99 others); Fri, 29 Jun 2018 12:26:58 -0400 Received: from mail-he1eur01hn0205.outbound.protection.outlook.com ([104.47.0.205]:60870 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933545AbeF2Q04 (ORCPT ); Fri, 29 Jun 2018 12:26:56 -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=W8Gwbj5Vs8NwuhXQ1gqKdGOhrdcmcH6fHNF4tfR9dVI=; b=XCdPoGC7qGfJS1PrZMAK83RjTcEkOjYVu0BpgaqaNdptRgehTv2TPdy3rdldtVzzUUVoTPj8iT9c0pyDRRqE/BtiA8X9bX2lf7Wo6c4x2t+LS5Hy6qim66qiLSJ5tWQ3jLjxCX5kRul6bYbO9YGKgqIHhArBRhPEZN8wy81AUyI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by DB6PR0801MB1973.eurprd08.prod.outlook.com (2603:10a6:4:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.23; Fri, 29 Jun 2018 16:26:40 +0000 Date: Fri, 29 Jun 2018 19:26: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 v3 3/5] KVM: x86: hyperv: use get_vcpu_by_vpidx() in kvm_hv_flush_tlb() Message-ID: <20180629162636.GG15656@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: <20180629141455.19525-1-vkuznets@redhat.com> <20180629141455.19525-4-vkuznets@redhat.com> <20180629150104.GE15656@rkaganb.sw.ru> <87a7rdd3ec.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a7rdd3ec.fsf@vitty.brq.redhat.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1PR0202CA0005.eurprd02.prod.outlook.com (2603:10a6:803:14::18) To DB6PR0801MB1973.eurprd08.prod.outlook.com (2603:10a6:4:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3fad3b74-db9d-40f8-6307-08d5dddd1933 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:DB6PR0801MB1973; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0801MB1973;3:GpOaBnSTLpbFusPwu0hK/pBroD5sQejTI7VCuhLroVdGp8P4XzNjuup8CitqzDzQzkrRJhXX9IbsVko+s5M8Fjp/GY7gyNr6i5sDIM+ggSdSHTGpgFlXkNVqr9FKktPcdzep9vV3SwonI9zxSmOU5Tf7W2vGQPc37YR26F/Ss/33FZ6RHCMLBGTMiegITjtvjRCJMh+ja58aQAnSYfzBv49dL2gcFr9bDOTYo2hTigmcQo+knwKzYr0LlRUeL+D0;25:CDZhWvEp/2xAp1jTpqXl+c0cnR3/nesykMyzEwV+KIaq59RDOgdtQv/lVvIDPwtFzJtJRBu4uHL+4dYxOSGSHlZCVBJG+hHe319MBuEzkwO5sE3kLBk3CRphgcesVwBLM9XGyKMvGmY8nPfEC52vFJb2X3giseX94/TGl5nyrvsWwegsnLz7VQA3ULYR02wsPEJW9sFz46d2j7YrpJva7N7v60zdQu6if+EwwUoa13PPRzulDJRfiyim14uD/HkUdPYBcSKRloEfVtUrq4m1thHRebYYYXa6H0XGof+FYIn0t5kXPulPCmvSWrTdPF8D6XWYRRIOPIXRORIMemqJyA==;31:GZa2abv0gsolI7jokDlkeyAaINH1fhfaFWkeycA65JgiilKZnG5u1APBcdhC60dLmYKXfwPUckpI/oMVvT3eTZL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-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:DB6PR0801MB1973;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0801MB1973; X-Forefront-PRVS: 0718908305 X-Forefront-Antispam-Report: SFV:SPM;SFS:(10019020)(136003)(39850400004)(346002)(376002)(366004)(396003)(199004)(189003)(23726003)(52116002)(47776003)(476003)(8676002)(36756003)(7416002)(3846002)(81156014)(81166006)(486006)(6246003)(14444005)(4326008)(1076002)(39060400002)(97736004)(478600001)(68736007)(25786009)(11346002)(53936002)(86362001)(6116002)(66066001)(7696005)(6506007)(6916009)(6666003)(186003)(105586002)(69596002)(54906003)(386003)(106356001)(446003)(229853002)(956004)(7736002)(33656002)(26005)(5660300001)(55016002)(50466002)(76176011)(16526019)(8936002)(305945005)(9686003)(93886005)(316002)(53416004)(58126008)(2906002)(16586007)(30126002);DIR:OUT;SFP:1501;SCL:5;SRVR:DB6PR0801MB1973;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;DB6PR0801MB1973;23:Ys69M3zRZ7W0EtuVh91kMN/j19b5Zhzcc/hN8yS?= =?us-ascii?Q?SbwrM6b0p7kr9Aj8PaBSI9AxAarhqBZwQT//rNu5H+bM6mN1i8GT5iwC1ZyE?= =?us-ascii?Q?l8JpbZZpeddrwEKsdN45juOiaHvNNcRHYcOdZUka2kLw4+AMrmIIAjYQqpkR?= =?us-ascii?Q?wcuQZJ/AGk1RbSaXYYX3Os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KQGs3Wd+wl19EUi2F8fF5g08TE5HR/uS2IhGJx0RT/6BTC6JybJFE6Ah+f80F0jGL/2Ebwswtl9QJujXFcd/l2PinQtCCodt9nqfcd7+fvUveKREKIunfo8f7e9j8xMQ4oPnY3vE0jKfE;20:6NxhSQ5FB7c2TPyIv7TETbUMOguxjP/XQ0+SWAbu17wi/uGmj3kM5cjB2sHowZRVA+LyJnqKKT38XhA3rtVk3TNIm1BVNBanM70jrBtyfptRBa/cPK6BK6ZI3+mWRPqEkly07lu2KViHKiwa/IEi4uKXX14odExezYwUAIQnyds= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2018 16:26:40.7869 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3fad3b74-db9d-40f8-6307-08d5dddd1933 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1973 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:21:47PM +0200, Vitaly Kuznetsov wrote: > Roman Kagan writes: > > > On Fri, Jun 29, 2018 at 04:14:53PM +0200, Vitaly Kuznetsov wrote: > >> VP_INDEX almost always matches VCPU id and get_vcpu_by_vpidx() is fast, > >> use it instead of traversing full vCPU list every time. > >> > >> To support the change switch kvm_make_vcpus_request_mask() to checking > >> vcpu_id instead of vcpu index, > > > > I'm afraid you can't do this: vcpu_id (== apic id) can be sparse, i.e. > > it's not very well suited for bitmaps and can exceed the max number of > > vcpus. > > True. The bitmap should be of KVM_MAX_VCPU_ID size, not > KVM_MAX_VCPUS. > > Unfortunately there's no convenient way to get VCPU idx from VCPU > id, kvm_vcpu_get_idx() just walks the whole list :-( I see two possible > options: > 1) Add vcpu_idx fields to struct kvm_vcpu > 2) Keep the change expecting masks of KVM_MAX_VCPU_ID in > kvm_make_vcpus_request_mask(). KVM_MAX_VCPU_ID is currently 1023 so our > bitmaps will be 16 longs long. Not sure if it's too much. 3) rework get_vcpu_by_vpidx into get_vcpu_idx_by_vpidx followed by get_cpu, and use the former for your purposes 4) duplicate get_vcpu_by_vpidx logic in get_vcpu_idx_by_vpidx Roman. P.S. I'm starting to wonder how safe this get_vcpu_* thing is WRT vcpu removal, but that's a different story anyway.