Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4AFCC433DF for ; Mon, 15 Jun 2020 14:55:15 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE37520644 for ; Mon, 15 Jun 2020 14:55:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE37520644 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jkqVm-0004H3-T8; Mon, 15 Jun 2020 14:54:58 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jkqVl-0004Gy-UK for xen-devel@lists.xenproject.org; Mon, 15 Jun 2020 14:54:57 +0000 X-Inumbo-ID: 2dac61e8-af18-11ea-8496-bc764e2007e4 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2dac61e8-af18-11ea-8496-bc764e2007e4; Mon, 15 Jun 2020 14:54:57 +0000 (UTC) Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: l1fclsBTfHR/StnfDRWourWOGq9MJluDdFLK5ZduVpRg7b4MLYtKtIbu/g5QDP+xu9+hNt4Rr6 cyEok8Wd9Moc6JPaQdLr3ljNXjfP4NLsL27lK16esa5kQ/8Z9KWSkk3JovQhgos+VPQS9TYNaA R45788FpvlmFoGYu3tK5GEuNRAR/7o2YjrMy8emW9r65LoAH3C92OU2hFyRbXPgh/ni0LxGNQq 8r0uFee8UX/h0pzw8T/ghhTZgYlkz98G/kfYTLmBGadLlUGxTP9z4pyc978LyNktf22rp+VlYc 4/U= X-SBRS: 2.7 X-MesageID: 20083622 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,514,1583211600"; d="scan'208";a="20083622" From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-ID: <24295.35771.662354.527867@mariner.uk.xensource.com> Date: Mon, 15 Jun 2020 15:54:51 +0100 To: Andrew Cooper Subject: Re: [PATCH 3/9] tools/libx[cl]: Move processing loop down into xc_cpuid_set() In-Reply-To: <20200615141532.1927-4-andrew.cooper3@citrix.com> References: <20200615141532.1927-1-andrew.cooper3@citrix.com> <20200615141532.1927-4-andrew.cooper3@citrix.com> X-Mailer: VM 8.2.0b under 24.5.1 (i686-pc-linux-gnu) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Xen-devel , Paul Durrant , Jan Beulich , Wei Liu , Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Andrew Cooper writes ("[PATCH 3/9] tools/libx[cl]: Move processing loop down into xc_cpuid_set()"): > Currently, libxl__cpuid_legacy() passes each element of the policy list to > xc_cpuid_set() individually. This is wasteful both in terms of the number of > hypercalls made, and the quantity of repeated merging/auditing work performed > by Xen. > > Move the loop processing down into xc_cpuid_set(), which allows us to do one > set of hypercalls, rather than one per list entry. > > In xc_cpuid_set(), obtain the full host, guest max and current policies to > begin with, and loop over the xend array, processing one leaf at a time. > Replace the linear search with a binary search, seeing as the serialised > leaves are sorted. > > No change in behaviour from the guests point of view. This is not my area of expertise. Ideally at this stage of the release I would like an ack from a 2nd hypervisor maintainer. The processing code in libxc looks OK to me. Ian.