From patchwork Mon Jan 22 13:41:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13525492 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BE750C4725D for ; Mon, 22 Jan 2024 13:41:35 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.669895.1042383 (Exim 4.92) (envelope-from ) id 1rRuYC-0005Ze-Gj; Mon, 22 Jan 2024 13:41:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 669895.1042383; Mon, 22 Jan 2024 13:41:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rRuYC-0005ZX-DI; Mon, 22 Jan 2024 13:41:20 +0000 Received: by outflank-mailman (input) for mailman id 669895; Mon, 22 Jan 2024 13:41:19 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rRuYB-0005Y4-7j for xen-devel@lists.xenproject.org; Mon, 22 Jan 2024 13:41:19 +0000 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [2a00:1450:4864:20::22b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id eb5eab41-b92b-11ee-98f2-6d05b1d4d9a1; Mon, 22 Jan 2024 14:41:17 +0100 (CET) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2cca8eb0509so35336151fa.3 for ; Mon, 22 Jan 2024 05:41:17 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id bm7-20020a056e02330700b003627e7b69c8sm603276ilb.76.2024.01.22.05.41.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jan 2024 05:41:17 -0800 (PST) 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: eb5eab41-b92b-11ee-98f2-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1705930877; x=1706535677; darn=lists.xenproject.org; h=content-transfer-encoding:autocrypt:content-language:cc:to:subject :from:user-agent:mime-version:date:message-id:from:to:cc:subject :date:message-id:reply-to; bh=gQiTUoB8bG3hbenFnAZCwyFKHLeA13w6e6iDnvkSNlE=; b=KyFRthheAO0xbqlwC6UXO9NicuV6ENjI1ilZEwAoO2GqA0uikSHk9iJLGd9cKXw0lA ezrz9qXEM0qF1jVGogwO88RxY9bE2zCF6uoTNGwymlMuuzuOMl9GZRub92lcT2rC/PoE 9acWjn76wqFCRnM/v1EhuqUbPFF+PoZmgbVksRrjLlTeXQhtm1sAaj005FGzJLPq4X/G XfdRSr7gM+vPwBzcTDF1NeH12jaEIK8FGousqCblCRPxBCWVsUE19YQSx2lTjR9oDwIK AdxPVUW8z0+jjGoc6k+8GWdVP8oet8XalwDTtN8mp8kHxkl1r+GqZO2y+AwyTsH3gm94 XegQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705930877; x=1706535677; h=content-transfer-encoding:autocrypt:content-language:cc:to:subject :from:user-agent:mime-version:date:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=gQiTUoB8bG3hbenFnAZCwyFKHLeA13w6e6iDnvkSNlE=; b=XZTt/rl2/uGDiujSynKaxAlhjRC3lu2RzPwn6xjndWxBbPwozxw7aabnfiOenwsJ6E hTu9xMyBvCJUsw4xbbNEqR0gsQ8deoq4flZ/G+GS/NOysntnlrN9R0I1II8LteVqs/q9 n6u6/N17tbhU6LQI9K44ukU60Duh+zt0zrey+2Rb146MbTeeqOyj4Vzfio4bViolyjYg Ggmfanb/wD4/qJefvQDxTIF2NFf/iiMXJFM9pBtGDdg5xoT7H4eA7kVQcj7XIcphohPr rZRz5jUL+ANAobbUjrCHyDR1pP3u+7rVKj6gS77jj5B6rMPv3cZHM+kHHfsYkW+v9pbx TitQ== X-Gm-Message-State: AOJu0YyJokoKO1tGhr+PLQp6u2uAz4lGJuKpb/VDd3dUZK0h5wEuWLjR yJN/lG56srocw4M//45BGGfAQCkjcFxryaz7J9/gglRjqGANPPacQ+ANu68mOvzgSbhTx9vLfCs = X-Google-Smtp-Source: AGHT+IF2OFhBV/MCaRblskpSFb5QCSm+rYtJLQDdV72NpQx7Egq5O1/8RO6hr3vPLu/7JJQUaHfBsg== X-Received: by 2002:a2e:7a1a:0:b0:2cc:6d87:9a91 with SMTP id v26-20020a2e7a1a000000b002cc6d879a91mr1606703ljc.72.1705930877499; Mon, 22 Jan 2024 05:41:17 -0800 (PST) Message-ID: <7edea456-81ba-4e83-9441-0e82333ce168@suse.com> Date: Mon, 22 Jan 2024 14:41:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Jan Beulich Subject: [PATCH v2] x86: Dom0 "broken ELF" reporting adjustments To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZ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5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL elf_load_binary() isn't the primary source of brokenness being indicated. Therefore make the respective PVH log message there conditional (much like PV has it), and add another instance when elf_xen_parse() failed (again matching behavior in the PV case). Make the PV side match the (new) use of %pd here. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- v2: Use %pd and bring PV in line with that as well. --- a/xen/arch/x86/hvm/dom0_build.c +++ b/xen/arch/x86/hvm/dom0_build.c @@ -570,6 +570,8 @@ static int __init pvh_load_kernel(struct if ( (rc = elf_xen_parse(&elf, &parms, true)) != 0 ) { printk("Unable to parse kernel for ELFNOTES\n"); + if ( elf_check_broken(&elf) ) + printk("%pd kernel: broken ELF: %s\n", d, elf_check_broken(&elf)); return rc; } @@ -588,7 +590,8 @@ static int __init pvh_load_kernel(struct if ( rc < 0 ) { printk("Failed to load kernel: %d\n", rc); - printk("Xen dom0 kernel broken ELF: %s\n", elf_check_broken(&elf)); + if ( elf_check_broken(&elf) ) + printk("%pd kernel: broken ELF: %s\n", d, elf_check_broken(&elf)); return rc; } --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -1041,8 +1041,7 @@ int __init dom0_construct_pv(struct doma out: if ( elf_check_broken(&elf) ) - printk(XENLOG_WARNING "Dom0 kernel broken ELF: %s\n", - elf_check_broken(&elf)); + printk("%pd kernel: broken ELF: %s\n", d, elf_check_broken(&elf)); return rc; }