From nobody Fri Nov 29 17:52:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1632481574; cv=none; d=zohomail.com; s=zohoarc; b=nuduxe1Aq1BuB6fUXuJ0JPw6z35IlrUScodVpNRgX6HcKgPBeWcyq5oLNBwwtMFrNwGvuykBepELi/ygpXX0yY8rkZw4AqWVOKz4oG3QeL984TrrSRUA1zH4JwduqN25W5HFxEiaf9Z8aWbEiV9nXKnd4TrRcB4FAUYakUndb7g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632481574; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=8j9lWYD29WyQDqIXZSoMRBlT+S/QhNuXi6dm/Go0gpI=; b=Go+9TBlT/9lZ/Pc5GgBhw+iTqblLnWFBCG+4Gm26MKYNmNOvKX3qb8wusFd0FRJzJs/0Dm+yBEVZ3xq2YPIJrp6LlsU4GtqXivEarfoS9vmmBfV00nzTPIJ6Gwix7UJWdbTEkZkekBvm9PSM/dMeaFjdJ0ZcpO8t1qbFnQeP5kg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1632481574084965.0733710537894; Fri, 24 Sep 2021 04:06:14 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.195311.347957 (Exim 4.92) (envelope-from ) id 1mTj1Y-0001vZ-5y; Fri, 24 Sep 2021 11:05:48 +0000 Received: by outflank-mailman (output) from mailman id 195311.347957; Fri, 24 Sep 2021 11:05:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTj1Y-0001vS-2q; Fri, 24 Sep 2021 11:05:48 +0000 Received: by outflank-mailman (input) for mailman id 195311; Fri, 24 Sep 2021 11:05:47 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTj1W-0001vM-U3 for xen-devel@lists.xenproject.org; Fri, 24 Sep 2021 11:05:46 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5d6c40f0-1d27-11ec-bac0-12813bfff9fa; Fri, 24 Sep 2021 11:05:45 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5d6c40f0-1d27-11ec-bac0-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1632481545; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=S/lyUAQUW4OkBE8yiINlYYf99gt7ImS4tR3CM7RQMgM=; b=TCXJuL5sgBJ/wwJjTOfwve0XnEykZpLlRrr6I0+Ym42Gfq7yGETXJZkY aSVh5v+Epuz6OGP46JKi7QYesUUFMmRV3cyDtrPbuJX8vo2toM3JzxErE jgVLbu/cvEob0ftC4AGX4UF5VLKNpO2rF2R79/6mpnnOVzU30E/k5GI9d Q=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: EIXpkoCH/Ri/lzEy6/7Z4GlyUaSrEh6IkhLDlVqAkqCtlMuKYkrvnz8TpOaKn44nggwoNDxZH7 aWKsGqsK68LUNslZDPakfT2+J+Q79/GnuCHjTk/uGpVyeUQ9/1anXrOV+xg8jMyobF6WCMZCje zPLWlQUXGnjsS4yp9+YfzeFsMFHMMg+ZzFxjj+LwOjhKIk0nKHlLgnqP4xcBp2daRoeFyenGQb 6K/sqmsN6PL0cTMbH2z6tF97bG086HoRe9ls4mGwCS544NMkGpJYxYXKOrD6kJ9mFiHL4Rj6mk gqE25Q1QwX3PwQcTgn8qyiMJ X-SBRS: 5.1 X-MesageID: 53524765 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:0iXL/6s+e2T67fBZ92HNR3WTg+fnVJlZMUV32f8akzHdYApBsoF/q tZmKW7SOKmNYjP8ftB+aIq/oBsAvJXTzoM2GgRprH9gRSwU+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZQP0VOZigHtIQMsadUsxKbVIiGHpJZS5LwbZj29Y524ThWmthh PupyyHhEA79s9JLGjp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFonoR5fMeaFGH/bSe gr25OrRElU1XfsaIojNfr7TKiXmS1NJVOSEoiI+t6OK2nCuqsGuu0qS2TV1hUp/0l20c95NJ NplsqS+WDwGOKvwwe09WF58SAdhFo1k5+qSSZS/mZT7I0zudnLtx7NlDV0sPJ1e8eFyaY1M3 aVGcnZXNEnF3r/ohuLgIgVvrp1LwM3DH44Bu3cm9i3UA/8gRo7rSKTW/95Imjw3g6iiGN6DP JdDNWUxMXwsZTVMJEVIUbkHxtvroXKmKBBH+FSyp404tj27IAtZ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23:lji7Kq8kmCLZ7ACUje9uk+DWI+orL9Y04lQ7vn2YSXRuE/Bw8P re+8jztCWE8Qr5N0tQ+uxoVJPufZq+z+8Q3WByB8bBYOCOggLBR+sOgbcKqweQfREWndQ86U 4PScZD4aXLfD1Hsfo= X-IronPort-AV: E=Sophos;i="5.85,319,1624334400"; d="scan'208";a="53524765" From: Kevin Stefanov To: Xen-devel CC: Kevin Stefanov , Andrew Cooper , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH] tools/libxl: Remove page_size and page_shift from struct libxl_acpi_ctxt Date: Fri, 24 Sep 2021 12:05:00 +0100 Message-ID: <20210924110500.25412-1-kevin.stefanov@citrix.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1632481574953100001 Content-Type: text/plain; charset="utf-8" As a result of recent work, two members of struct libxl_acpi_ctxt were left with only one user. Thus, it becomes illogical for them to be members of the struct at all. Drop the two struct members and instead let the only function using them have them as local variables. Signed-off-by: Kevin Stefanov Acked-by: Ian Jackson Reviewed-by: Jan Beulich --- CC: Andrew Cooper CC: Ian Jackson CC: Wei Liu CC: Anthony PERARD --- tools/libs/light/libxl_x86_acpi.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/tools/libs/light/libxl_x86_acpi.c b/tools/libs/light/libxl_x86= _acpi.c index 57a6b63790..68902e7809 100644 --- a/tools/libs/light/libxl_x86_acpi.c +++ b/tools/libs/light/libxl_x86_acpi.c @@ -25,9 +25,6 @@ struct libxl_acpi_ctxt { struct acpi_ctxt c; =20 - unsigned int page_size; - unsigned int page_shift; - /* Memory allocator */ unsigned long guest_start; unsigned long guest_curr; @@ -159,12 +156,13 @@ int libxl__dom_load_acpi(libxl__gc *gc, struct acpi_config config =3D {0}; struct libxl_acpi_ctxt libxl_ctxt; int rc =3D 0, acpi_pages_num; + unsigned int page_size, page_shift; =20 if (b_info->type !=3D LIBXL_DOMAIN_TYPE_PVH) goto out; =20 - libxl_ctxt.page_size =3D XC_DOM_PAGE_SIZE(dom); - libxl_ctxt.page_shift =3D XC_DOM_PAGE_SHIFT(dom); + page_size =3D XC_DOM_PAGE_SIZE(dom); + page_shift =3D XC_DOM_PAGE_SHIFT(dom); =20 libxl_ctxt.c.mem_ops.alloc =3D mem_alloc; libxl_ctxt.c.mem_ops.v2p =3D virt_to_phys; @@ -176,20 +174,19 @@ int libxl__dom_load_acpi(libxl__gc *gc, goto out; } =20 - config.rsdp =3D (unsigned long)libxl__malloc(gc, libxl_ctxt.page_size); - config.infop =3D (unsigned long)libxl__malloc(gc, libxl_ctxt.page_size= ); + config.rsdp =3D (unsigned long)libxl__malloc(gc, page_size); + config.infop =3D (unsigned long)libxl__malloc(gc, page_size); /* Pages to hold ACPI tables */ - libxl_ctxt.buf =3D libxl__malloc(gc, NUM_ACPI_PAGES * - libxl_ctxt.page_size); + libxl_ctxt.buf =3D libxl__malloc(gc, NUM_ACPI_PAGES * page_size); =20 /* * Set up allocator memory. * Start next to acpi_info page to avoid fracturing e820. */ libxl_ctxt.guest_start =3D libxl_ctxt.guest_curr =3D libxl_ctxt.guest_= end =3D - ACPI_INFO_PHYSICAL_ADDRESS + libxl_ctxt.page_size; + ACPI_INFO_PHYSICAL_ADDRESS + page_size; =20 - libxl_ctxt.guest_end +=3D NUM_ACPI_PAGES * libxl_ctxt.page_size; + libxl_ctxt.guest_end +=3D NUM_ACPI_PAGES * page_size; =20 /* Build the tables. */ rc =3D acpi_build_tables(&libxl_ctxt.c, &config); @@ -199,8 +196,8 @@ int libxl__dom_load_acpi(libxl__gc *gc, } =20 /* Calculate how many pages are needed for the tables. */ - acpi_pages_num =3D (ALIGN(libxl_ctxt.guest_curr, libxl_ctxt.page_size)= - - libxl_ctxt.guest_start) >> libxl_ctxt.page_shift; + acpi_pages_num =3D (ALIGN(libxl_ctxt.guest_curr, page_size) - + libxl_ctxt.guest_start) >> page_shift; =20 dom->acpi_modules[0].data =3D (void *)config.rsdp; dom->acpi_modules[0].length =3D 64; @@ -212,7 +209,7 @@ int libxl__dom_load_acpi(libxl__gc *gc, if (strcmp(xc_dom_guest_os(dom), "linux") || xc_dom_feature_get(dom, XENFEAT_linux_rsdp_unrestricted)) dom->acpi_modules[0].guest_addr_out =3D ACPI_INFO_PHYSICAL_ADDRESS= + - (1 + acpi_pages_num) * libxl_ctxt.page_size; + (1 + acpi_pages_num) * page_size; else dom->acpi_modules[0].guest_addr_out =3D 0x100000 - 64; =20 @@ -221,9 +218,9 @@ int libxl__dom_load_acpi(libxl__gc *gc, dom->acpi_modules[1].guest_addr_out =3D ACPI_INFO_PHYSICAL_ADDRESS; =20 dom->acpi_modules[2].data =3D libxl_ctxt.buf; - dom->acpi_modules[2].length =3D acpi_pages_num << libxl_ctxt.page_shi= ft; + dom->acpi_modules[2].length =3D acpi_pages_num << page_shift; dom->acpi_modules[2].guest_addr_out =3D ACPI_INFO_PHYSICAL_ADDRESS + - libxl_ctxt.page_size; + page_size; =20 out: return rc; --=20 2.25.1