From patchwork Fri Jun 30 13:16:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 9819579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CB5A2603F2 for ; Fri, 30 Jun 2017 13:19:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9A0F28472 for ; Fri, 30 Jun 2017 13:19:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD9ED2860A; Fri, 30 Jun 2017 13:19:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AAC2928651 for ; Fri, 30 Jun 2017 13:19:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQvna-0000vW-K2; Fri, 30 Jun 2017 13:17:26 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQvnY-0000ub-8n for xen-devel@lists.xen.org; Fri, 30 Jun 2017 13:17:24 +0000 Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id C0/B2-02176-36F46595; Fri, 30 Jun 2017 13:17:23 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrIIsWRWlGSWpSXmKPExsXilM8iqZvsHxZ p8G4zs8WSj4tZHBg9ju7+zRTAGMWamZeUX5HAmrHyyHbGgpecFYtbRRsYezi6GDk5hARWMUps 72SDsLMl/vWuZuli5OJgEVjJKjF99SpmkISEgKfE3u07GSFsZ4lN/06xgRQJCRxilGjb2s8Ek mATCJVo3z6DFcQWEZCWuPb5MiNIEbPASUaJWz9egBUJCzhJ/Jt7E2wdi4CqxPejr8AaeAVyJI 7fX8IGsUFOYt+rBrBtnALFEpeW3GOFOK9I4uSSxUwQ9YISJ2c+YcGthgNosbrE+nlCIGFmAXm J5q2zmScwisxC0j0LoWoWkqoFjMyrGDWKU4vKUot0DU31kooy0zNKchMzc3QNDUz1clOLixPT U3MSk4r1kvNzNzECg58BCHYwNmz3PMQoycGkJMq78lpopBBfUn5KZUZicUZ8UWlOavEhRhkOD iUJXj/fsEghwaLU9NSKtMwcYBzCpCU4eJREePd6AKV5iwsSc4sz0yFSpxh1OY7N+PmNSYglLz 8vVUqc9xfIDAGQoozSPLgRsJRwiVFWSpiXEegoIZ6C1KLczBJU+VeM4hyMSsK8y0Cm8GTmlcB tegV0BBPQEcIzQkCOKElESEk1MNrqKzc6X33SOz+Wof1Vma/CmTN1VzoP5s55sTDq9GSfwPoz Z0t+P+daVGD9QM3Eb9sFl9qt7OfXCj8JWtM0o0mNd5WY2TuRPX4t/26vvZAic5nLbb57WuFb7 XmfdkY1L1u/xX/Fxa2PVI5++m3tssNbI/mas3nVgm0XJedMtHz2pGJe8lHFslglluKMREMt5q LiRABITJ10BAMAAA== X-Env-Sender: marmarek@invisiblethingslab.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1498828642!62008905!1 X-Originating-IP: [66.111.4.25] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTExLjQuMjUgPT4gNDQ5ODE=\n X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 61938 invoked from network); 30 Jun 2017 13:17:22 -0000 Received: from out1-smtp.messagingengine.com (HELO out1-smtp.messagingengine.com) (66.111.4.25) by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 30 Jun 2017 13:17:22 -0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 4446820C6D; Fri, 30 Jun 2017 09:17:22 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Fri, 30 Jun 2017 09:17:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:in-reply-to:message-id:mime-version :references:references:subject:to:x-me-sender:x-me-sender :x-sasl-enc:x-sasl-enc; s=fm1; bh=kPjkRUutJCCIGBLzpyP0vdeJJVB0PG NUxv1mOWVG6OI=; b=AHKqiXMUvojS4Xe26fngWuG0InZHsTswpO7wT14lrrZ9iA Bkifa+0JVhoeP2qd907BOLdDQStHEGtIzRWQma1o4v5HRhsQ1nSiZilIAMAyn+lz jYtNzzttp6n+YohgGaC9N1X3ue6kAa+FrN3kv42MZXUg5Cot0dF97kZG2xw1K12m D5bHujYvvsMyEWHNY1citFtLtARpUfbW3YGWKB07bhHquWpa8/RyY8Uufl1QWl4L Kaw0hKlpVgC1GYjWafn6OaDgU14EV7OYEm7oC2z72mHsBpjE+FodQ/UMzXtRIlxl 9Spxpp5N/fO2Vk7d/G2NBYec6Idm3Ex7J1h4RFVg== X-ME-Sender: X-Sasl-enc: k6zhYF8/uUk4Ye8MTPpjrhM0VaxnAkRNspfv4tRA8acD 1498828641 Received: from devel-3rdparty.localdomain (89-70-103-23.dynamic.chello.pl [89.70.103.23]) by mail.messagingengine.com (Postfix) with ESMTPA id 2B25D7E32F; Fri, 30 Jun 2017 09:17:21 -0400 (EDT) From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xen.org Date: Fri, 30 Jun 2017 15:16:58 +0200 Message-Id: <17093e2b6824fa70e7efc9f827679e78ab132fd0.1498828597.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: References: MIME-Version: 1.0 In-Reply-To: References: Cc: Wei Liu , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Andrew Cooper Subject: [Xen-devel] [PATCH v3 3/4] libxl: make cpuid_flags array static const X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP To have it in .rodata, instead of reconstructing each time on stack. Signed-off-by: Marek Marczykowski-Górecki --- tools/libxl/libxl_cpuid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c index 98c7c54..3726aa4 100644 --- a/tools/libxl/libxl_cpuid.c +++ b/tools/libxl/libxl_cpuid.c @@ -89,7 +89,7 @@ static libxl_cpuid_policy_list cpuid_find_match(libxl_cpuid_policy_list *list, int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str) { #define NA XEN_CPUID_INPUT_UNUSED - struct cpuid_flags cpuid_flags[] = { + static const struct cpuid_flags cpuid_flags[] = { {"maxleaf", 0x00000000, NA, CPUID_REG_EAX, 0, 32}, /* the following two entries are subject to tweaking later in the code */ {"family", 0x00000001, NA, CPUID_REG_EAX, 8, 8}, @@ -243,7 +243,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str) #undef NA char *sep, *val, *endptr; int i; - struct cpuid_flags *flag; + const struct cpuid_flags *flag; struct libxl__cpuid_policy *entry; unsigned long num; char flags[33], *resstr;