Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1175698imm; Fri, 29 Jun 2018 12:47:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcLy1YWK4aTSY8sygI7UL0Iz7o1MdtDa1JEldIuMeEqwNr/wWFDAzTCF8BonaQqmNja5bIh X-Received: by 2002:a62:8d5:: with SMTP id 82-v6mr15947546pfi.154.1530301666687; Fri, 29 Jun 2018 12:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530301666; cv=none; d=google.com; s=arc-20160816; b=Tv1cJ+NxDpbQ6kBPTK0C6ai6zbvHDCOfTsuiHWMpfFzSpAUL7waut0eaNiU3lVnSnk OOGYSJU5fGZlELAGp8QPySeIXcslSO321x1FdD9XE7Dwp7QdXrYz5IrOuVmHgRbp1JoS OH7ZXnCZqLMk4nAsNHNQGdwGrylrOpp825yLfV78FzAjuH8eeEJoW6Elf4Zvrp9341ZB wAxfhtHoL9BbtEmDRypUYNH7mBsjaSru70UEIYF7JvxJKW4Ido3ZY/nxAhbFlx1G+k1X ca9HWjwPOZaxou9+pMQq727UcySPlgriULEWxl6gzsxXXY6nOVZcOez9mj81fwJ4iVJF wkMw== 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=C3r2LTBrtL8L7ZFZHxlsuCLxaIuW+EGneUfCnysr1G0=; b=Gco3miCut88HJ8GnX9npJDq3t/lE5mTETZtSCGNGftKWcG6sr6AoSbwDVwKPMLQZF1 86HLh2cCh1+SpS1yjkje7ldNsuNa2TXn1hV98FRGodchVARbN9AiiQ8AahBGid7FdTIv lNvGPgqy7z0rIl6avYFL0jk+4k8rOw6o0fR0/K19Stjj00iCwaGqtgGjOTmjAqkE0V8s GUzXRvsufV+Zn/dahMaKHGCqeoK9xWz9rPj6v9QihPE5CnkYbmojb/ffiVgA8+EowYT8 8bb6qpbHhPcC7ay+RxxDaS/lV9oXsCnGlAvrULCQrTGQbzHzUccwLVP5XlKVrhtlxDkM Mh5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=Mvw8KkGp; 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 k6-v6si9880263pla.78.2018.06.29.12.47.16; Fri, 29 Jun 2018 12:47: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=Mvw8KkGp; 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 S937082AbeF2Qx2 (ORCPT + 99 others); Fri, 29 Jun 2018 12:53:28 -0400 Received: from mail-db5eur03hn0222.outbound.protection.outlook.com ([104.47.10.222]:7011 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932296AbeF2Qx0 (ORCPT ); Fri, 29 Jun 2018 12:53:26 -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=C3r2LTBrtL8L7ZFZHxlsuCLxaIuW+EGneUfCnysr1G0=; b=Mvw8KkGpxVeP3eCDGMSkTcCAmvArAJV0KlZjsvFCC/jdOLXdAW8WnxFrgY4GPjU2fk8rdanzeiZU8vm+UpkbE6PNVBEpj5BaQdH/N9lLxFHP+VGU/eJjbNn/6BbxoDgc7TFQ50ANc8j1lrCq2FTSs3Xmxqk1kGc82YJYdSRq+SY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by DB6PR0801MB1975.eurprd08.prod.outlook.com (2603:10a6:4:75::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.22; Fri, 29 Jun 2018 16:53:12 +0000 Date: Fri, 29 Jun 2018 19:53:03 +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: <20180629165303.GA16672@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> <20180629162636.GG15656@rkaganb.sw.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180629162636.GG15656@rkaganb.sw.ru> User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: HE1PR09CA0059.eurprd09.prod.outlook.com (2603:10a6:7:3c::27) To DB6PR0801MB1975.eurprd08.prod.outlook.com (2603:10a6:4:75::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: baf5b5f3-e71c-4600-237e-08d5dde0ce27 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:DB6PR0801MB1975; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0801MB1975;3:yqHB3WfZG//8XrolLGUEPIpMpISNQX11cqd1Flk2eQ1sSMseyLEAflVDxnrorIEyIHepR8F6O34XArCHMngDDoR1ynIILVSVur+4OUfoIRG6A3JPZFHbmKAy+TtwoJPQdQA8Oljn8rCPSITqjqw++7qUdXie+3K3v4Je50qYd7iY3vc+YSh9k4b+v953L7UG6WSMWh4d5io9G1xKNYMWKUYOy+NhgvlI6PPoMNK2TIrwPHDX2msMr0J5BN5dnfeW;25:2Z1au8itJbAQDt7il/nH3b9FYTgSOTe+luus74C2Gi9ETI1kSN5f5WByMoMsm/KMZKKDIdLuCRQ5hq54FavLCuwCOxE9rMXYoO69gvjiHcW+uznj2/hZBJCOHSylQ1CMCECjEofYqJ/YbIGgCy4d5Rch+xVLBO70DYuVShn4wOsx7R+1Wy2OId/eSzRRZvhD8pZggtyN0Sf7MmYXbEfUJ2NQlvT5GLrqAYU4wiyW7NBj/jNvO2Hndbk+EFFUhQJngFJ3V/ZGJhmvqG6DpTiPHIwOcotlqC/7FJiRb2gqvSuKFWTLj17qQtafIkKqEUlBLtel2ZMP//gxGKowhv2A6Q==;31:UAld7esNtygRsmNAy42MqquNN2BYK79IQWu0WWu5AFFnV/nEB28ASPVCcsIPXJ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-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:DB6PR0801MB1975;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0801MB1975; X-Forefront-PRVS: 0718908305 X-Forefront-Antispam-Report: SFV:SPM;SFS:(10019020)(376002)(346002)(136003)(396003)(39850400004)(366004)(189003)(199004)(8936002)(97736004)(53936002)(106356001)(8676002)(476003)(305945005)(66066001)(86362001)(7696005)(11346002)(5660300001)(6666003)(53416004)(105586002)(52116002)(7736002)(16586007)(14444005)(4326008)(81166006)(956004)(7416002)(39060400002)(446003)(81156014)(55016002)(47776003)(486006)(2906002)(26005)(68736007)(186003)(33656002)(9686003)(69596002)(76176011)(16526019)(54906003)(1076002)(25786009)(58126008)(3846002)(6116002)(6916009)(23726003)(6246003)(229853002)(478600001)(316002)(50466002)(386003)(6506007)(93886005)(36756003)(30126002);DIR:OUT;SFP:1501;SCL:5;SRVR:DB6PR0801MB1975;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;DB6PR0801MB1975;23:ubPBT5PoL++LCnUQAqcU1W5vXKkHdBt+mq7akHB?= =?us-ascii?Q?gvwnR71oh6cLkRjutzhGJn1GwkkTb09eAwlm5x88T67AI6MnsEKbbI4Agccw?= =?us-ascii?Q?U5zScta05iATKL48twKmHItwEeokyAInfO4JQCyjVrbUG7caeBPQ85JD1Bj9?= =?us-ascii?Q?5piKKKZxD4RHLAbClqueW5qGY8R4TeY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62nmF0s+3KxJtw2xf5XXVi+p5ALvrDSDKMcpH2Coosya1vttA7W6VUxFsWDWJLEskAZbfcCuN6HxoElfdPKfhf8d8VUXiOZIqoFf1yClCHb/Yq82/kH2KYbJV4lKs/cfpbafaNuUfGv2ozmbo;20:fRm7Q1+cyWOC3a/gDWgCHE2hSy+63CyDjPcQvX9cn8xdRhRMUDIdHmmXxIWKGQ6lo3ExDJFkYihjUqrxZtVw76V1WpQAhsZ5G7XIbr9AiLRGAqDOXZ4TBlr6mJ2FRCsNijp4CzxPfgX8LwzoC5AcwC6zr55ikts6Kazb4jAivxc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2018 16:53:12.9345 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: baf5b5f3-e71c-4600-237e-08d5dde0ce27 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1975 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 07:26:36PM +0300, Roman Kagan wrote: > 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 s/get_cpu/kvm_get_vcpu/ of course > 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.