From patchwork Fri Feb 12 15:39:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12085541 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=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 4AC88C433E6 for ; Fri, 12 Feb 2021 15:40:46 +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 EB4AD64E70 for ; Fri, 12 Feb 2021 15:40:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB4AD64E70 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.84310.158074 (Exim 4.92) (envelope-from ) id 1lAaYf-0000xK-Ni; Fri, 12 Feb 2021 15:40:37 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 84310.158074; Fri, 12 Feb 2021 15:40:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lAaYf-0000xB-Jr; Fri, 12 Feb 2021 15:40:37 +0000 Received: by outflank-mailman (input) for mailman id 84310; Fri, 12 Feb 2021 15:40:35 +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 1lAaYd-0000ix-O8 for xen-devel@lists.xenproject.org; Fri, 12 Feb 2021 15:40:35 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b6990a41-5224-4e58-86c7-bbec74fd5ff9; Fri, 12 Feb 2021 15:40:16 +0000 (UTC) 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: b6990a41-5224-4e58-86c7-bbec74fd5ff9 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1613144416; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=xRy21DvjvCrpVWjUNEKJmq6KENL31WHuSFgYxPxdZ5Y=; b=BXgLuG64lHW7VUdMo+kj1T03GBulBkrF7agZRDm92wN4Rg9lccD1tOe4 Wmdk5HEfXGdVxayckaXRfzablsU1en8Pp2wdnzbICxIyGCnnyk/aFgBvA O16rPrv8XtATh75ZdMruQXm0jqMPGop1q/cD+bD7n81sV8yBysYoV7WmN 4=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: 1GPl3yxibCxgECKAjeZrzdszMYAG2TEfiCuJFMKA6SDBa3uPSy8e9DGGtSxuqhLr6synXsJZOL dw98UqTfaA1mUFGvgnR5N9EP6+tdudSPFnvx6VHznAbe+sKdRMej/e23fe4zxLg+JhZrA65YOq 8/m0Zgv0qQ5FQATavZE6BIEDEFTEo7YvIblWmNtAWdydiQtbdu1hHYLQ58JqrlersoyvoEQgpF i3B2L8ANF3HB15BjhG6euS/wJOEp3uP2qFIo/wTYL8axOjWuc63b8bRrgUch9gf8n1tn4M1Rjz 7SA= X-SBRS: 5.2 X-MesageID: 38508886 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.81,174,1610427600"; d="scan'208";a="38508886" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH 01/10] tools/xl: Fix exit code for `xl vkbattach` Date: Fri, 12 Feb 2021 15:39:44 +0000 Message-ID: <20210212153953.4582-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210212153953.4582-1-andrew.cooper3@citrix.com> References: <20210212153953.4582-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Various version of gcc, when compiling with -Og, complain: xl_vkb.c: In function 'main_vkbattach': xl_vkb.c:79:12: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] 79 | return rc; | ^~ The dryrun_only path really does leave rc uninitalised. Introduce a done label for success paths to use. Fixes: a15166af7c3 ("xl: add vkb config parser and CLI") Signed-off-by: Andrew Cooper Reviewed-by: Ian Jackson --- CC: Ian Jackson CC: Wei Liu CC: Anthony PERARD --- tools/xl/xl_vkb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/xl/xl_vkb.c b/tools/xl/xl_vkb.c index f6ed9e05ee..728ac9470b 100644 --- a/tools/xl/xl_vkb.c +++ b/tools/xl/xl_vkb.c @@ -64,7 +64,7 @@ int main_vkbattach(int argc, char **argv) char *json = libxl_device_vkb_to_json(ctx, &vkb); printf("vkb: %s\n", json); free(json); - goto out; + goto done; } if (libxl_device_vkb_add(ctx, domid, &vkb, 0)) { @@ -72,6 +72,7 @@ int main_vkbattach(int argc, char **argv) rc = ERROR_FAIL; goto out; } +done: rc = 0; out: From patchwork Fri Feb 12 15:39:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12085545 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=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 08FDFC433E0 for ; Fri, 12 Feb 2021 15:40:58 +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 A936064DFF for ; Fri, 12 Feb 2021 15:40:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A936064DFF Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.84312.158098 (Exim 4.92) (envelope-from ) id 1lAaYp-00017R-9P; Fri, 12 Feb 2021 15:40:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 84312.158098; Fri, 12 Feb 2021 15:40:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lAaYp-00017K-5l; Fri, 12 Feb 2021 15:40:47 +0000 Received: by outflank-mailman (input) for mailman id 84312; Fri, 12 Feb 2021 15:40:45 +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 1lAaYn-0000ix-OS for xen-devel@lists.xenproject.org; Fri, 12 Feb 2021 15:40:45 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6c936ab3-6ef4-4388-881b-171fce2cd81f; Fri, 12 Feb 2021 15:40:17 +0000 (UTC) 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: 6c936ab3-6ef4-4388-881b-171fce2cd81f DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1613144417; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=EN+VlYU9zCh2xnbJq+2hMB7Ag2s+TPKO2KR/6NYIL/0=; b=UnuOktGy7AVOGKmNfwMaiEzuP/pZRZbVQwO6mcGgMIhgKko1+XbBbtYL /Xxn+ZihSSkRtmVZ7yH1HkPDF3Z8QYi2P9c6CyXsV7T6PBRQMqwUlx0xd MhAkeKe/m56zSwcjJSgioXmP0xWEjzeDJVvg0ahiHTp4Oumfg3eGRClaa M=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: bGzisur3WNKmJPki3iBXyYIzRvvHVmcfLmOJo5gzjij9cHnm2JNK6F6XLJ3fRR4y5vWY1FXyjp 48tPVCEb/xI6AzDiTbJDZPJWCPtLFZmfiD2KRP+/cLaBGke428bEuexBDSwzphs6MrNrkCjK5y Wt72sy+xp09jkKjBIiMO6xs5LgK5jqPDQk8VoiZhnZZ6mvvsOzoR1vQsYMKRhetY3RyOIoV5Mi kQb8zdB6iRncX46VdYwn8SuUOb8U7xPWvjcwdZ46YhVN8Q5pJDtCZMHlAqrlXTX6nTLqaWOjGl aLg= X-SBRS: 5.2 X-MesageID: 37085879 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.81,174,1610427600"; d="scan'208";a="37085879" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu Subject: [PATCH 02/10] tools/libxg: Fix uninitialised variable in write_x86_cpu_policy_records() Date: Fri, 12 Feb 2021 15:39:45 +0000 Message-ID: <20210212153953.4582-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210212153953.4582-1-andrew.cooper3@citrix.com> References: <20210212153953.4582-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Various version of gcc, when compiling with -Og, complain: xg_sr_common_x86.c: In function 'write_x86_cpu_policy_records': xg_sr_common_x86.c:92:12: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] 92 | return rc; | ^~ The complaint is legitimate, and can occur with unexpected behaviour of two related hypercalls in combination with a libc which permits zero-length malloc()s. Have an explicit rc = 0 on the success path, and make the MSRs record error handling consistent with the CPUID record before it. Fixes: f6b2b8ec53d ("libxc/save: Write X86_{CPUID,MSR}_DATA records") Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Ian Jackson CC: Wei Liu --- tools/libs/guest/xg_sr_common_x86.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/libs/guest/xg_sr_common_x86.c b/tools/libs/guest/xg_sr_common_x86.c index 6f12483907..3168c5485f 100644 --- a/tools/libs/guest/xg_sr_common_x86.c +++ b/tools/libs/guest/xg_sr_common_x86.c @@ -83,7 +83,13 @@ int write_x86_cpu_policy_records(struct xc_sr_context *ctx) msrs.length = nr_msrs * sizeof(xen_msr_entry_t); if ( msrs.length ) + { rc = write_record(ctx, &msrs); + if ( rc ) + goto out; + } + + rc = 0; out: free(cpuid.data); From patchwork Fri Feb 12 15:39:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12085537 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=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 B4C5FC433E6 for ; Fri, 12 Feb 2021 15:40:42 +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 62F8464E74 for ; Fri, 12 Feb 2021 15:40:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62F8464E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.84306.158025 (Exim 4.92) (envelope-from ) id 1lAaYL-0000j9-HT; Fri, 12 Feb 2021 15:40:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 84306.158025; Fri, 12 Feb 2021 15:40:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lAaYL-0000j2-EQ; Fri, 12 Feb 2021 15:40:17 +0000 Received: by outflank-mailman (input) for mailman id 84306; Fri, 12 Feb 2021 15:40:16 +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 1lAaYJ-0000ix-UV for xen-devel@lists.xenproject.org; Fri, 12 Feb 2021 15:40:16 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0497549c-6442-4ccf-ba19-070ba799dfdc; Fri, 12 Feb 2021 15:40:14 +0000 (UTC) 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: 0497549c-6442-4ccf-ba19-070ba799dfdc DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1613144414; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=9ilKt//pD9WWwJmxzImNAH8JgkNnaX0KcmVT6/nsyOQ=; b=TGuIyEm4uG2FoOiaRkgb+qI7ura6onEHhWcky31AlNrEr+T0yqwoMQj+ i7gGdjG8lUGQhXdCxfTRGI1pzPLMzLTOuGwwhmpgzQHwCx1SSxpjPBDgs lUVC1vKwJ/dwecPMiM+KQPwJxhzpOorOIpDQbmXjgQkwEbElYUPBBkoWY s=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: yZYg3LdXWpas36oecYc8GfAQ44qTZtj34YojGj+i3Y/nUAffyNtu041+sfrB7t0+QzgSQnU4Vx CE6fbK/BHU37/SdXYauPMkSVq4Kuw7kZVQWw66pkpyl63zDqcRMX+75ukBgAJSkBtFuDTsr15f L6DBL/e93xWopf1n88mpx6DOurQDlD37sa1pHwN62lENUtfkIuodDMnYt7WNe4rESdpMxNza9J PvevuBg0Zbcdri/Nx9avtE4h5McP0/HWlr4Jux+x7NdRYdJG9XZlDDMbfSfTYgyfoPr6ekp8ut iTc= X-SBRS: 5.2 X-MesageID: 38508879 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.81,174,1610427600"; d="scan'208";a="38508879" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Stefano Stabellini , Julien Grall Subject: [PATCH 03/10] tools/libxg: Fix uninitialised variable in meminit() Date: Fri, 12 Feb 2021 15:39:46 +0000 Message-ID: <20210212153953.4582-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210212153953.4582-1-andrew.cooper3@citrix.com> References: <20210212153953.4582-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Various version of gcc, when compiling with -Og, complain: xg_dom_arm.c: In function 'meminit': xg_dom_arm.c:420:19: error: 'p2m_size' may be used uninitialized in this function [-Werror=maybe-uninitialized] 420 | dom->p2m_size = p2m_size; | ~~~~~~~~~~~~~~^~~~~~~~~~ Signed-off-by: Andrew Cooper --- CC: Ian Jackson CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall Julien/Stefano: I can't work out how this variable is supposed to work, and the fact that it isn't a straight accumulation across the RAM banks looks suspect. --- tools/libs/guest/xg_dom_arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libs/guest/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c index 94948d2b20..f1b8d06f75 100644 --- a/tools/libs/guest/xg_dom_arm.c +++ b/tools/libs/guest/xg_dom_arm.c @@ -373,7 +373,7 @@ static int meminit(struct xc_dom_image *dom) const uint64_t modsize = dtb_size + ramdisk_size; const uint64_t ram128mb = bankbase[0] + (128<<20); - xen_pfn_t p2m_size; + xen_pfn_t p2m_size = 0; uint64_t bank0end; assert(dom->rambase_pfn << XC_PAGE_SHIFT == bankbase[0]); From patchwork Fri Feb 12 15:39:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12085547 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=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 6FFFAC433E0 for ; Fri, 12 Feb 2021 15:41:00 +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 3190E64DFF for ; Fri, 12 Feb 2021 15:41:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3190E64DFF Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.84313.158110 (Exim 4.92) (envelope-from ) id 1lAaYu-0001DH-OA; Fri, 12 Feb 2021 15:40:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 84313.158110; Fri, 12 Feb 2021 15:40:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lAaYu-0001D6-Ju; Fri, 12 Feb 2021 15:40:52 +0000 Received: by outflank-mailman (input) for mailman id 84313; Fri, 12 Feb 2021 15:40:50 +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 1lAaYs-0000ix-Of for xen-devel@lists.xenproject.org; Fri, 12 Feb 2021 15:40:50 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a1986579-83f5-4a77-bdee-3db06d09e860; Fri, 12 Feb 2021 15:40:18 +0000 (UTC) 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: a1986579-83f5-4a77-bdee-3db06d09e860 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1613144418; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=gxhqNkRAqt4D8bXDbOgXUWNa09LADvFwdwUf17wrXSw=; b=R80rtD6giKjL9kkupOQKKmhZjbkW2sQNjKwX05b5yJXbs9z/+Wh2Oh8Y wBCRzI1kVVIlH+GrxxTQFljGsMG7vdolxK2D/VyDk63Pi2f5hqjzjhX/D BhQI/1/RlqriAzW01Nxx+rlG1MMpaSoKDgbnxk4zUtE/sFQykLjeylwmX c=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: RKCf/rOpegXLOR/rGRr2O17NtjZ96m2jnR3RcZHKCvoQth9eyEg3hr5TXOSDVPvgM0hU3RP9Aa ZVOhfKHBDiTJiOdeiIU6J5DxCSf0wNjoLhH7UBPAxE4pBz20I1moCLLE/ShGQEXpmfs+JaYhox 12z0e8R2UXettahbW/Q5PZParO3n5jo7rd6f5wowS7uXtCZ9xn/G+nqF08eMN5LuhHyNStgQIT Yi08sSeTUiPiUoq9vfqO6JvSBTsNMk9XGB1JbJlu/wUEmezF15cR6TZYRsKS9L+4qlOtAEsiUh usQ= X-SBRS: 5.2 X-MesageID: 37518635 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.81,174,1610427600"; d="scan'208";a="37518635" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH 04/10] tools/libxl: Fix uninitialised variable in libxl__domain_get_device_model_uid() Date: Fri, 12 Feb 2021 15:39:47 +0000 Message-ID: <20210212153953.4582-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210212153953.4582-1-andrew.cooper3@citrix.com> References: <20210212153953.4582-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Various version of gcc, when compiling with -Og, complain: libxl_dm.c: In function 'libxl__domain_get_device_model_uid': libxl_dm.c:256:12: error: 'kill_by_uid' may be used uninitialized in this function [-Werror=maybe-uninitialized] 256 | if (kill_by_uid) | ^ The logic is sufficiently complicated I can't figure out if the complain is legitimate or not. There is exactly one path wanting kill_by_uid set to true, so default it to false and drop the existing workaround for this problem at other optimisation levels. Signed-off-by: Andrew Cooper --- CC: Ian Jackson CC: Wei Liu CC: Anthony PERARD --- tools/libs/light/libxl_dm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c index 291dee9b3f..1ca21e4b81 100644 --- a/tools/libs/light/libxl_dm.c +++ b/tools/libs/light/libxl_dm.c @@ -128,7 +128,7 @@ static int libxl__domain_get_device_model_uid(libxl__gc *gc, int rc; char *user; uid_t intended_uid = -1; - bool kill_by_uid; + bool kill_by_uid = false; /* Only qemu-upstream can run as a different uid */ if (b_info->device_model_version != LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) @@ -176,7 +176,6 @@ static int libxl__domain_get_device_model_uid(libxl__gc *gc, LOGD(DEBUG, guest_domid, "dm_restrict disabled, starting QEMU as root"); user = NULL; /* Should already be null, but just in case */ - kill_by_uid = false; /* Keep older versions of gcc happy */ rc = 0; goto out; } @@ -227,7 +226,6 @@ static int libxl__domain_get_device_model_uid(libxl__gc *gc, LOGD(WARN, guest_domid, "Could not find user %s, falling back to %s", LIBXL_QEMU_USER_RANGE_BASE, LIBXL_QEMU_USER_SHARED); intended_uid = user_base->pw_uid; - kill_by_uid = false; rc = 0; goto out; } From patchwork Fri Feb 12 15:39:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12085533 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=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 A6E3DC433E0 for ; Fri, 12 Feb 2021 15:40:41 +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 54B0C64E70 for ; Fri, 12 Feb 2021 15:40:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54B0C64E70 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.84308.158049 (Exim 4.92) (envelope-from ) id 1lAaYV-0000nE-37; Fri, 12 Feb 2021 15:40:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 84308.158049; Fri, 12 Feb 2021 15:40:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lAaYU-0000n7-Vu; Fri, 12 Feb 2021 15:40:26 +0000 Received: by outflank-mailman (input) for mailman id 84308; Fri, 12 Feb 2021 15:40:25 +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 1lAaYT-0000ix-Nr for xen-devel@lists.xenproject.org; Fri, 12 Feb 2021 15:40:25 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 01228532-2bd6-448b-a830-03df601056c7; Fri, 12 Feb 2021 15:40:16 +0000 (UTC) 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: 01228532-2bd6-448b-a830-03df601056c7 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1613144416; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AkTySBnlGFyVMAxg/gcAuosdJVnwo4RsV9buhZjnQmI=; b=Fto+Pz5B0Aef1KmZxa1alOzmlvDsusbB3sqf88EPWlMLjp7zLCuIso6G mfC/QAYmExw9rfZutIm72t1eKhfvdNwJgJT5F8u7YmVOnvNxW44AIO+c6 GBMeoPHf+A5alb2okvxLmGfAEwIi1hN5BXTS0SzF1oQM79PEvuWbsq+IM 4=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: HownhAwJMB882tcBvJ6G+QOZ8MyF74dHFD5WPKB4/YdYun8zrgjFznZa7eMmo3fa6yqRCEK46f c4CFRvhfwylaL3mc3COpuLJLVUeU7P5OkvJI9wV6troHksPpTN0Pzi1s9/ff44nmfA9bo+25Nf ZsGTKWfrZzgZGcZtPbpTKihFpvu9Y03/bNMaXVxR0YjKj8hzxYAJ3t6h7trMXH8etYxCBhGmYi JsCe0LW4lgIg8TcIcG9FrNXj6eokQGwB1VwTJdDlV0JDuXCk4din0IC+sfucPWf3j80XJbtVVH g08= X-SBRS: 5.2 X-MesageID: 38508885 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.81,174,1610427600"; d="scan'208";a="38508885" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH 05/10] tools/libxl: Fix uninitialised variable in libxl__write_stub_dmargs() Date: Fri, 12 Feb 2021 15:39:48 +0000 Message-ID: <20210212153953.4582-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210212153953.4582-1-andrew.cooper3@citrix.com> References: <20210212153953.4582-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Various version of gcc, when compiling with -Og, complain: libxl_dm.c: In function ‘libxl__write_stub_dmargs’: libxl_dm.c:2166:16: error: ‘dmargs’ may be used uninitialized in this function [-Werror=maybe-uninitialized] rc = libxl__xs_write_checked(gc, t, path, dmargs); ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It can't, but only because of how the is_linux_stubdom checks line up. Signed-off-by: Andrew Cooper Reviewed-by: Ian Jackson --- CC: Ian Jackson CC: Wei Liu CC: Anthony PERARD --- tools/libs/light/libxl_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c index 1ca21e4b81..7bbb8792ea 100644 --- a/tools/libs/light/libxl_dm.c +++ b/tools/libs/light/libxl_dm.c @@ -2099,7 +2099,7 @@ static int libxl__write_stub_dmargs(libxl__gc *gc, { struct xs_permissions roperm[2]; xs_transaction_t t = XBT_NULL; - char *dmargs; + char *dmargs = NULL; int rc; roperm[0].id = 0; From patchwork Fri Feb 12 15:39:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12085539 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=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 2F5BDC433E0 for ; Fri, 12 Feb 2021 15:40:44 +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 D4D8E64E70 for ; Fri, 12 Feb 2021 15:40:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4D8E64E70 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.84307.158038 (Exim 4.92) (envelope-from ) id 1lAaYP-0000kD-R6; Fri, 12 Feb 2021 15:40:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 84307.158038; Fri, 12 Feb 2021 15:40:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lAaYP-0000k6-Ma; Fri, 12 Feb 2021 15:40:21 +0000 Received: by outflank-mailman (input) for mailman id 84307; Fri, 12 Feb 2021 15:40:20 +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 1lAaYO-0000ix-NY for xen-devel@lists.xenproject.org; Fri, 12 Feb 2021 15:40:20 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 03ecbdec-a497-49fe-88a0-a97db26888a2; Fri, 12 Feb 2021 15:40:15 +0000 (UTC) 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: 03ecbdec-a497-49fe-88a0-a97db26888a2 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1613144415; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8n3LNq3HpJRCzFtQilT2o7NpxGGvtcLJdJkdvWcMQnw=; b=UOgfUupnQL5p0yk51e3fisezYp6hlsMNH6UyPVrKApSDfGMmJffenVBO yLtlsPvab9cHXjk/9dayObOQudrs3DofQhA1IZYPWhHkOhsQ68k4/Ng/b L9CkvL9/mnE0xHIMfLZB265/5icY6aSu+4R1mB/SU+0a9Hb8zsNy3xpM2 E=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: Guvd7p8XjY8XoUmY5MoiKRxmWTdrFrJQvYwSBTWTuijsXIsyt20eYDpEYtfH2O5MPWoj0PTZW5 gW+twg/8I+eXOb4i9h+6tmEvxZiVKtnFr7su7KUCv3KWc2HZ9ijINDwmS7ktj4xKd+vHu5iKde 7SttGN2e6fKdhIZ4GNCVU0c2pjUepQS0r3ElBOzU6MexQBetZO8BHtO5ScZgd190YiX2gG8pAt im17uWP0xr7Pmh6vpvmx8DyPXiQ/G5vx8rrkiQvPtyYgOqwRnZ1CHMkXgr+L0m0bunnMLWCv8d qm4= X-SBRS: 5.2 X-MesageID: 38508881 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.81,174,1610427600"; d="scan'208";a="38508881" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Juergen Gross Subject: [PATCH 06/10] stubdom/xenstored: Fix uninitialised variables in lu_read_state() Date: Fri, 12 Feb 2021 15:39:49 +0000 Message-ID: <20210212153953.4582-7-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210212153953.4582-1-andrew.cooper3@citrix.com> References: <20210212153953.4582-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Various version of gcc, when compiling with -Og, complain: xenstored_control.c: In function ‘lu_read_state’: xenstored_control.c:540:11: error: ‘state.size’ is used uninitialized in this function [-Werror=uninitialized] if (state.size == 0) ~~~~~^~~~~ xenstored_control.c:543:6: error: ‘state.buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] pre = state.buf; ~~~~^~~~~~~~~~~ xenstored_control.c:550:23: error: ‘state.buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] (void *)head - state.buf < state.size; ~~~~~^~~~ xenstored_control.c:550:35: error: ‘state.size’ may be used uninitialized in this function [-Werror=maybe-uninitialized] (void *)head - state.buf < state.size; ~~~~~^~~~~ Interestingly, this is only in the stubdom build. I can't identify any relevant differences vs the regular tools build. Signed-off-by: Andrew Cooper Reviewed-by: Juergen Gross Reviewed-by: Ian Jackson --- CC: Ian Jackson CC: Wei Liu CC: Juergen Gross --- tools/xenstore/xenstored_control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c index 1f733e0a04..f10beaf85e 100644 --- a/tools/xenstore/xenstored_control.c +++ b/tools/xenstore/xenstored_control.c @@ -530,7 +530,7 @@ static const char *lu_dump_state(const void *ctx, struct connection *conn) void lu_read_state(void) { - struct lu_dump_state state; + struct lu_dump_state state = {}; struct xs_state_record_header *head; void *ctx = talloc_new(NULL); /* Work context for subfunctions. */ struct xs_state_preamble *pre; From patchwork Fri Feb 12 15:39:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12085535 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=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 61BA6C433DB for ; Fri, 12 Feb 2021 15:40:41 +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 0D23064DFF for ; Fri, 12 Feb 2021 15:40:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D23064DFF Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.84309.158062 (Exim 4.92) (envelope-from ) id 1lAaYa-0000rW-Dn; Fri, 12 Feb 2021 15:40:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 84309.158062; Fri, 12 Feb 2021 15:40:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lAaYa-0000rN-9l; Fri, 12 Feb 2021 15:40:32 +0000 Received: by outflank-mailman (input) for mailman id 84309; Fri, 12 Feb 2021 15:40:30 +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 1lAaYY-0000ix-O2 for xen-devel@lists.xenproject.org; Fri, 12 Feb 2021 15:40:30 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b53a4ed4-952e-4bde-aa3e-303df37baa6d; Fri, 12 Feb 2021 15:40:16 +0000 (UTC) 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: b53a4ed4-952e-4bde-aa3e-303df37baa6d DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1613144416; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=THEW0Vd+o8+5NNZotQAfhag3Lg3d+kZffhIX6B7tke8=; b=M3SFRRzPFVN3UbIedZ6vE/toxx2jRMFqDrxjXKPppSUZM88OIDw+aNeh LsZnCJngO53TjpDiSp3vkD4YOtULBiBvlwJNOPkb2qNdmAhELiQFIwafA oOyEHlDBaq8z4BtL3PB9hi+A9Im3T6U72ameDN/ZCpymNvI3SXFM54Cii M=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: 6Fw2KaezQaX/2xsw/xTG3V/cEq3H06/GILUVL4Y3NEK8P+ifbKijqr9FjN+/AIxZbV19l1Foc0 li4F9FqP2dlWBqgmjJkF7KiuLPTCRnOgXq7WTZ+pqtPBfkQ8gKYMumEST+xKSCHPokhEe2qLsN dQW70Ec2AFsvezMup9xPwZw/THN//JMfLN/oJSP16nuZ1HcYj6CDdmeKim3GYNV5MkCYiDW7M3 Caa+K5RSzxr5qTNo32reNxfMf9L34HCUOAf1KCEef0pxUNhdNY8oGc6dKqiXvIGH7LhpYHRwni fpY= X-SBRS: 5.2 X-MesageID: 37085875 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.81,174,1610427600"; d="scan'208";a="37085875" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Juergen Gross Subject: [PATCH 07/10] tools: Use -Og for debug builds when available Date: Fri, 12 Feb 2021 15:39:50 +0000 Message-ID: <20210212153953.4582-8-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210212153953.4582-1-andrew.cooper3@citrix.com> References: <20210212153953.4582-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 The recommended optimisation level for debugging is -Og, and is what tools such as gdb prefer. In practice, it equates to -01 with a few specific optimisations turned off. abi-dumper in particular wants the libraries it inspects in this form. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Acked-by: Ian Jackson --- CC: Ian Jackson CC: Wei Liu CC: Juergen Gross --- tools/Rules.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index f61da81f4a..2907ed2d39 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -106,8 +106,9 @@ endif CFLAGS_libxenlight += $(CFLAGS_libxenctrl) ifeq ($(debug),y) -# Disable optimizations -CFLAGS += -O0 -fno-omit-frame-pointer +# Use -Og if available, -O0 otherwise +dbg_opt_level := $(call cc-option,$(CC),-Og,-O0) +CFLAGS += $(dbg_opt_level) -fno-omit-frame-pointer # But allow an override to -O0 in case Python enforces -D_FORTIFY_SOURCE=. PY_CFLAGS += $(PY_NOOPT_CFLAGS) else From patchwork Fri Feb 12 15:39:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12085549 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=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 9D108C433E0 for ; Fri, 12 Feb 2021 15:41:09 +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 437D464E74 for ; Fri, 12 Feb 2021 15:41:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 437D464E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.84314.158122 (Exim 4.92) (envelope-from ) id 1lAaYz-0001Id-2a; Fri, 12 Feb 2021 15:40:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 84314.158122; Fri, 12 Feb 2021 15:40:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lAaYy-0001IS-Us; Fri, 12 Feb 2021 15:40:56 +0000 Received: by outflank-mailman (input) for mailman id 84314; Fri, 12 Feb 2021 15:40:55 +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 1lAaYx-0000ix-Oy for xen-devel@lists.xenproject.org; Fri, 12 Feb 2021 15:40:55 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 99fc8af0-a1b5-402c-8def-985e4836a66a; Fri, 12 Feb 2021 15:40:17 +0000 (UTC) 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: 99fc8af0-a1b5-402c-8def-985e4836a66a DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1613144416; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=lsfae/ZYMUTtHloQUljGbO2IeSsesWCyE9jSqEqM860=; b=PJ+jrVw2narBucB2O8lVOiUQP7ECcfL9NAcYtcWXamn3TauhlcsIv7UZ xBmOnqrAGGK6iwhXUdzLQeiCwhNaNcMUHVXb5jqLq6H61oXouOeygKa2X vov6d5KnhjX2he4rUe1OnzdYAnUyLLkjEB4Jemd0OO62Hz16M4ZKCJcFr A=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: yEUYvSEFIim5Jdww6A+wuZKUVYJBIVxGk/i2RPOJroGXupap9BtvLjgddQdvX1G0VHk2n+RkTA OhwPiTmolbklJkbR6p1H0zPWtnYB6lgJ+CfEGD8l1UUVMo4ny20DCUvksAbbDipn5eLBehOXsQ m+CF6O7Jo0ksSqTgC702zvQOuEdb57hY6od5ZkM5wBUBn0qosfdajOcyVRCm1IU3EvzYpFbtuF /dGkkjUraGXyhe2E819M1jGeZyinFk/mebU4g9S/bstypBwq2c8DkA/yLOIgJrvp5PESSaSUYe GX4= X-SBRS: 5.2 X-MesageID: 38508888 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.81,174,1610427600"; d="scan'208";a="38508888" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Juergen Gross Subject: [PATCH 08/10] tools: Check for abi-dumper in ./configure Date: Fri, 12 Feb 2021 15:39:51 +0000 Message-ID: <20210212153953.4582-9-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210212153953.4582-1-andrew.cooper3@citrix.com> References: <20210212153953.4582-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 This will be optional. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Ian Jackson --- CC: Ian Jackson CC: Wei Liu CC: Juergen Gross --- config/Tools.mk.in | 1 + tools/configure | 41 +++++++++++++++++++++++++++++++++++++++++ tools/configure.ac | 1 + 3 files changed, 43 insertions(+) diff --git a/config/Tools.mk.in b/config/Tools.mk.in index 48bd9ab731..d47936686b 100644 --- a/config/Tools.mk.in +++ b/config/Tools.mk.in @@ -19,6 +19,7 @@ BCC := @BCC@ IASL := @IASL@ AWK := @AWK@ FETCHER := @FETCHER@ +ABI_DUMPER := @ABI_DUMPER@ # Extra folder for libs/includes PREPEND_INCLUDES := @PREPEND_INCLUDES@ diff --git a/tools/configure b/tools/configure index e63ca3797d..bb5acf9d43 100755 --- a/tools/configure +++ b/tools/configure @@ -682,6 +682,7 @@ OCAMLOPT OCAMLLIB OCAMLVERSION OCAMLC +ABI_DUMPER INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM @@ -5442,6 +5443,46 @@ $as_echo "no" >&6; } fi +# Extract the first word of "abi-dumper", so it can be a program name with args. +set dummy abi-dumper; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ABI_DUMPER+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ABI_DUMPER in + [\\/]* | ?:[\\/]*) + ac_cv_path_ABI_DUMPER="$ABI_DUMPER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ABI_DUMPER="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ABI_DUMPER=$ac_cv_path_ABI_DUMPER +if test -n "$ABI_DUMPER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ABI_DUMPER" >&5 +$as_echo "$ABI_DUMPER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff --git a/tools/configure.ac b/tools/configure.ac index 6b611deb13..636e7077be 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -310,6 +310,7 @@ AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PATH_PROG([FLEX], [flex]) +AC_PATH_PROG([ABI_DUMPER], [abi-dumper]) AX_PATH_PROG_OR_FAIL([PERL], [perl]) AX_PATH_PROG_OR_FAIL([AWK], [awk]) From patchwork Fri Feb 12 15:39:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12085543 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=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 4CFC5C433E0 for ; Fri, 12 Feb 2021 15:40:50 +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 EA8E264E70 for ; Fri, 12 Feb 2021 15:40:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA8E264E70 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.84311.158086 (Exim 4.92) (envelope-from ) id 1lAaYk-00011y-05; Fri, 12 Feb 2021 15:40:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 84311.158086; Fri, 12 Feb 2021 15:40:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lAaYj-00011o-TF; Fri, 12 Feb 2021 15:40:41 +0000 Received: by outflank-mailman (input) for mailman id 84311; Fri, 12 Feb 2021 15:40:40 +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 1lAaYi-0000ix-OA for xen-devel@lists.xenproject.org; Fri, 12 Feb 2021 15:40:40 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a48c940c-c2a4-4e10-b77d-e5dc69be1924; Fri, 12 Feb 2021 15:40:17 +0000 (UTC) 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: a48c940c-c2a4-4e10-b77d-e5dc69be1924 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1613144417; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=d2FNP0eIgRtKpMK8y8WPj0QMRGu85RJJU+Z7e2YOdHA=; b=Cinlk9HDiCvq3Z9iFMvpRfsXcbNp5c0TJ35xGP08Z7SsPnmIA0O1G9AY 6QaTQxP52OReibXY5EUW++M6dBhQsVq+LBl8TXNs2lX77GS9hhV1E/vbD 3v3tcCVPHXRbpr4ismX9N710M11zAhxgTnmPPdZKRk9f3CbpRLvG6F/pp Y=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: +3kB8HBQiTyA76xd0+qDZKlRG1tgbdPr5WmecmHMH9p0eflak7dFXBsNRNKf0YpyOBw/ab8LZU F/3isO+RAzyYQxC5H/zOoTDy9X8JlkzPpEfXSOdWO3eiyeZFxvwREPxKdYu9R/17l7RregcuU8 DhhRcATOjEHz83jU3MYZ/OibaGmZgsRg5W/a8RwAGFLxTQ7sCXHDbpAtfRrh8XpyT7qK4q4Q0X W+qKAVXl/ZvGfy8bULV4x9F7d9WnUIYpglids200kwapbW9k1x8R+HMf5hI2rQzubnu8MGnKda CPU= X-SBRS: 5.2 X-MesageID: 37518634 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.81,174,1610427600"; d="scan'208";a="37518634" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Juergen Gross Subject: [PATCH 09/10] tools/libs: Add rule to generate headers.lst Date: Fri, 12 Feb 2021 15:39:52 +0000 Message-ID: <20210212153953.4582-10-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210212153953.4582-1-andrew.cooper3@citrix.com> References: <20210212153953.4582-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 abi-dumper needs a list of the public header files for shared objects, and only accepts this in the form of a file. No functional change. Signed-off-by: Andrew Cooper --- CC: Ian Jackson CC: Wei Liu CC: Juergen Gross --- tools/libs/.gitignore | 1 + tools/libs/libs.mk | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tools/libs/.gitignore diff --git a/tools/libs/.gitignore b/tools/libs/.gitignore new file mode 100644 index 0000000000..4a13126144 --- /dev/null +++ b/tools/libs/.gitignore @@ -0,0 +1 @@ +*/headers.lst diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 0b3381755a..ac68996ab2 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -76,6 +76,10 @@ endif headers.chk: $(AUTOINCS) +headers.lst: FORCE + @{ $(foreach h,$(LIBHEADERS),echo $(h);) } > $@.tmp + @$(call move-if-changed,$@.tmp,$@) + libxen$(LIBNAME).map: echo 'VERS_$(MAJOR).$(MINOR) { global: *; };' >$@ @@ -118,9 +122,12 @@ TAGS: clean: rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS) rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(MAJOR) - rm -f headers.chk + rm -f headers.chk headers.lst rm -f $(PKG_CONFIG) rm -f _paths.h .PHONY: distclean distclean: clean + +.PHONY: FORCE +FORCE: From patchwork Fri Feb 12 15:39:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12085595 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=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UPPERCASE_50_75,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 CD51EC433DB for ; Fri, 12 Feb 2021 15:52:43 +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 74BBE64E02 for ; Fri, 12 Feb 2021 15:52:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74BBE64E02 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.84346.158158 (Exim 4.92) (envelope-from ) id 1lAak9-0002u2-PK; Fri, 12 Feb 2021 15:52:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 84346.158158; Fri, 12 Feb 2021 15:52:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lAak9-0002tv-MH; Fri, 12 Feb 2021 15:52:29 +0000 Received: by outflank-mailman (input) for mailman id 84346; Fri, 12 Feb 2021 15:52:28 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lAak8-0002tq-68 for xen-devel@lists.xenproject.org; Fri, 12 Feb 2021 15:52:28 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1085d0ec-aa4b-47ae-a060-fd302c24a649; Fri, 12 Feb 2021 15:52:27 +0000 (UTC) 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: 1085d0ec-aa4b-47ae-a060-fd302c24a649 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1613145147; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=71PBv1yaSXwV1DXb00ABA1ndEflYaw9hZ+l02M+OUzY=; b=EdoI7/2zxyHXmZis2df1wf5fE+VvTRHJc24JzUjSvqhSPaEJT+0pQGOs 2ZelLzjNXflGCeJmgIXwSICBNxYorpt3gIh9FYfnWIJbdJDCrf5HjE8gY +JlSfAjinO1SjEStSgoOQye6YuQ942B0+0S5NsD3nrvB167+LIDC7exqQ Q=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: 1XPwlT/SsWH1wkhbtbN8GhOIc5iKNlVmziz9mOZJaCQVt0oHdU0oxUA29altqRi5xQ5SaMJjUZ wwH3XXgJ/Qv+Z3q12XBW6gWNtIEHgc25AfQAVj6yn0MfxwXGckMgN+HHnWsRCjv3GxAxpirRAd nu6IqyFkDugU2+Y4P5nr8FeQG7KcYV5HinC5pxQt40zFcYLDRMDUUXYe9Ya/A16YikQPF2Fgca cTYCS/joN3bTiBxs904fuGrSV1vMTBc+Jc3T3H66BgX8GPTJgpig+rLzNZd8U7BRajGInPvxLB x4Y= X-SBRS: 5.2 X-MesageID: 37145664 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.81,174,1610427600"; d="scan'208";a="37145664" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Juergen Gross Subject: [PATCH 10/10] tools/libs: Write out an ABI analysis when abi-dumper is available Date: Fri, 12 Feb 2021 15:39:53 +0000 Message-ID: <20210212153953.4582-11-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210212153953.4582-1-andrew.cooper3@citrix.com> References: <20210212153953.4582-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Signed-off-by: Andrew Cooper Reviewed-by: Ian Jackson --- CC: Ian Jackson CC: Wei Liu CC: Juergen Gross --- tools/libs/libs.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index ac68996ab2..2a4ce8a90c 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -49,6 +49,8 @@ PKG_CONFIG_LOCAL := $(PKG_CONFIG_DIR)/$(PKG_CONFIG) LIBHEADER ?= $(LIB_FILE_NAME).h LIBHEADERS = $(foreach h, $(LIBHEADER), $(XEN_INCLUDE)/$(h)) +PKG_ABI := lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)-$(XEN_COMPILE_ARCH)-abi.dump + $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) $(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_INCLUDE) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) @@ -94,6 +96,13 @@ lib$(LIB_FILE_NAME).so.$(MAJOR): lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib$(LIB_FILE_NAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_LDFLAGS) +# If abi-dumper is available, write out the ABI analysis +ifneq ($(ABI_DUMPER),) +libs: $(PKG_ABI) +$(PKG_ABI): lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) headers.lst + abi-dumper $< -o $@ -public-headers headers.lst -lver $(MAJOR).$(MINOR) +endif + .PHONY: install install: build $(INSTALL_DIR) $(DESTDIR)$(libdir)