From nobody Thu Oct 30 23:19:49 2025 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=cloud.com ARC-Seal: i=1; a=rsa-sha256; t=1752840698; cv=none; d=zohomail.com; s=zohoarc; b=FadhgndmgJPK8XSaCEuyU/IP57GPLWo4Tx7V4Op3zO0fhEBA0bgDGUgTG1viwwuaVXjq+I5fs7IBabLbM5ZmZMDXOHQE0/F4gx1hgOETq+dVkUzeIHt0U0otlc3WLF6ktNSer3I8LtqbOg+CyN304U9DY66vQVnmOLd47o6PAKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752840698; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=su1dCWXQqLQxV366md38J6qCHVR0RJFqfdadrIiCgaA=; b=arisf6ZuVIcDGutlOfiCCCtmSRzC0PdQG4Lx+VdjLvTkOEEuulFIXl2QYxGWZ/YeQ9YyDxYw0V/Nc7PUrzOlSaURE3cV7JMm0sP2+8D/MRyKn5up+j5lmtKNBZ+Zn6URyf4mgZQNBoFQTfQ264Ih7MBOa9LxqQd/n4iLqQO3pVI= 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 175284069819746.712358346979954; Fri, 18 Jul 2025 05:11:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1048620.1418815 (Exim 4.92) (envelope-from ) id 1ucjvp-0004S6-1a; Fri, 18 Jul 2025 12:11:17 +0000 Received: by outflank-mailman (output) from mailman id 1048620.1418815; Fri, 18 Jul 2025 12:11: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 1ucjvo-0004Rz-V5; Fri, 18 Jul 2025 12:11:16 +0000 Received: by outflank-mailman (input) for mailman id 1048620; Fri, 18 Jul 2025 12:11:16 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ucjvn-0004Rq-UT for xen-devel@lists.xenproject.org; Fri, 18 Jul 2025 12:11:15 +0000 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [2a00:1450:4864:20::331]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4c636212-63d0-11f0-b894-0df219b8e170; Fri, 18 Jul 2025 14:11:13 +0200 (CEST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-45600581226so21059875e9.1 for ; Fri, 18 Jul 2025 05:11:13 -0700 (PDT) Received: from localhost.localdomain (146.225.6.51.dyn.plus.net. [51.6.225.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4562e7f2d4fsm79456135e9.4.2025.07.18.05.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jul 2025 05:11:12 -0700 (PDT) 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: 4c636212-63d0-11f0-b894-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1752840673; x=1753445473; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=su1dCWXQqLQxV366md38J6qCHVR0RJFqfdadrIiCgaA=; b=QbdUo8YvUzyOLScdu46ufPFywTjq2F2JoKnS2Vh1jHaavt4X9frC0OI+7+HyOsjOBq s4fEkNzxsAGFbKYC70NxpaGphqvk9JC65wxmmy916R2Xz/Hkt4qV08Gd0KMoxPACz25V BD7nD9/iIoJMBBpmnFuortTf26Zfv/p/LX/k4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752840673; x=1753445473; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=su1dCWXQqLQxV366md38J6qCHVR0RJFqfdadrIiCgaA=; b=QPsBzDwjCiQtkPYKEHqwJqZscY8LXr7Ui5BhvytWPq2qdXS2rqeLpJeDigSXlwvV5q vucQ2TxAHE7BmaBfaw57Pqoyh65i/W2qxe1mFZ5Zn9g2uJQPEpu326H9kJkKu26WXUNl FyBhd/Z++/d2cIK0e5M1+CI7U0/F0x1dq09eCjvsRh+4MnlLcxGF6V+2odI7Og9jLUQE zwPmyvr8iVphW+BlXow09IBQEgHJp/xXfCtCh57bh4MPnT2TYD0nPTgC/mKuhMyQ0AOw CiTUM0ayQc2mHnh6JvF8igGGkMfgfTU1l4WLfg3EBZswfxSISJZcdphe2Rgav2NQ6xvf 4UhQ== X-Gm-Message-State: AOJu0Yx5G9HxTSbxdTuz/4Hl2xFebe1TXsaAplIcmSJSFWGv9rBKoiit Kl6MFFpL2K1fVDnm1l+iWka4DVF0hEaFLmLyarwFg7yQft5MnxOaTX1rBSgCK5gTRKrILE4+Jy+ ffAgA X-Gm-Gg: ASbGncvvrG2Bt8MbYidXvSdZBQaQQrz3KO2oooYdeu1cpb3izHogNxeq0PNw9oe178C aob4eg22u9BEVl6daA1XvPq4UXXDLtns5ZZ7fYj8jtK/o69+e0bFgSpGP4D9h5YMENoMvceBgVn rY3hbih//3FNKm5pULWQ/MGsX/ggt2qvxIRlR22edpg8jnXP0cuu1x0noMwHKo8kRFp/t4T6Xdq etsl5KJof/DTegL+z8OghN/ppRTZFHDnvw1K8WNlrZZy619zDlazPxyvU9vLw+iAPR4V4/am5e8 lZTSkM3m6a/PLi7LdYTYJEQ/pknLDfDdz3Sy9rNAyEJY3Gw+luq76U90UYCCun+LR5fw3BhA6iz C8mSTjfYqwMr3cXxlvj4VPhZ/heXZPxogvlVkDW+8rB05sWX+ckO+NbKkSQT7PNPaAw== X-Google-Smtp-Source: AGHT+IF2aAvVZ7rs5KvllYUScGozgM6qI9hT+1d1EIfajHghi/onj1T+MnrZdbFahUD2CY/pF1tD8Q== X-Received: by 2002:a05:600c:3b86:b0:456:fd4:5322 with SMTP id 5b1f17b1804b1-4562e04538bmr107328895e9.11.1752840672675; Fri, 18 Jul 2025 05:11:12 -0700 (PDT) From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , "Daniel P. Smith" Subject: [PATCH v2] xen/efi: Remove PrintMessage function Date: Fri, 18 Jul 2025 13:11:03 +0100 Message-ID: <20250718121106.34915-1-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @cloud.com) X-ZM-MESSAGEID: 1752840699462116600 Content-Type: text/plain; charset="utf-8" The function is similar to PrintStr with an implicit newline added to the string. In Xen this is not a common pattern and this is used in EFI ARM code only making it not much coherent with X86 code so use PrintStr directly to make the code more coherent. Signed-off-by: Frediano Ziglio Reviewed-by: Michal Orzel --- Changes since v1: - reuse PrintStr instead of reusing PrintMessage. --- xen/arch/arm/efi/efi-boot.h | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h index 7dd2528a17..e469245e5b 100644 --- a/xen/arch/arm/efi/efi-boot.h +++ b/xen/arch/arm/efi/efi-boot.h @@ -48,7 +48,6 @@ void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_s= ize); void __flush_dcache_area(const void *vaddr, unsigned long size); =20 static int get_module_file_index(const char *name, unsigned int name_len); -static void PrintMessage(const CHAR16 *s); =20 #define DEVICE_TREE_GUID \ {0xb1b621d5U, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0= xe0}} @@ -490,7 +489,7 @@ static void __init efi_arch_handle_cmdline(CHAR16 *cmdl= ine_options, =20 if ( cfgfile_options ) { - PrintMessage(L"Using bootargs from Xen configuration file."); + PrintStr(L"Using bootargs from Xen configuration file.\r\n"); prop_len +=3D snprintf(buf + prop_len, EFI_PAGE_SIZE - prop_len, " %s", cfgfile_op= tions); if ( prop_len >=3D EFI_PAGE_SIZE ) @@ -503,7 +502,7 @@ static void __init efi_arch_handle_cmdline(CHAR16 *cmdl= ine_options, "xen,xen-bootargs", NUL= L); if ( dt_bootargs_prop ) { - PrintMessage(L"Using bootargs from device tree."); + PrintStr(L"Using bootargs from device tree.\r\n"); prop_len +=3D snprintf(buf + prop_len, EFI_PAGE_SIZE - prop_le= n, " %s", dt_bootargs_prop); if ( prop_len >=3D EFI_PAGE_SIZE ) @@ -634,12 +633,6 @@ static int __init get_module_file_index(const char *na= me, return ret; } =20 -static void __init PrintMessage(const CHAR16 *s) -{ - PrintStr(s); - PrintStr(newline); -} - /* * This function allocates a binary and keeps track of its name, it return= s the * index of the file in the modules array or a negative number on error. @@ -661,7 +654,7 @@ static int __init allocate_module_file(const EFI_LOADED= _IMAGE *loaded_image, */ if ( !modules_available ) { - PrintMessage(L"No space left for modules"); + PrintStr(L"No space left for modules\r\n"); return ERROR_ALLOC_MODULE_NO_SPACE; } =20 @@ -674,7 +667,7 @@ static int __init allocate_module_file(const EFI_LOADED= _IMAGE *loaded_image, if ( efi_bs->AllocatePool(EfiLoaderData, (name_len + 1) * sizeof(char), (void**)&file_info->name) !=3D EFI_SUCCESS ) { - PrintMessage(L"Error allocating memory for module binary name"); + PrintStr(L"Error allocating memory for module binary name\r\n"); return ERROR_ALLOC_MODULE_NAME; } =20 @@ -754,14 +747,14 @@ static int __init handle_module_node(const EFI_LOADED= _IMAGE *loaded_image, /* Rename the module to be module@{address} */ if ( fdt_set_name(fdt_efi, module_node_offset, mod_string) < 0 ) { - PrintMessage(L"Unable to modify module node name."); + PrintStr(L"Unable to modify module node name.\r\n"); return ERROR_RENAME_MODULE_NAME; } =20 if ( fdt_set_reg(fdt_efi, module_node_offset, reg_addr_cells, reg_size= _cells, file->addr, file->size) < 0 ) { - PrintMessage(L"Unable to set module reg property."); + PrintStr(L"Unable to set module reg property.\r\n"); return ERROR_SET_REG_PROPERTY; } =20 @@ -777,7 +770,7 @@ static int __init handle_module_node(const EFI_LOADED_I= MAGE *loaded_image, */ if ( kernel.addr ) { - PrintMessage(L"Dom0 kernel already found in cfg file."); + PrintStr(L"Dom0 kernel already found in cfg file.\r\n"); return ERROR_DOM0_ALREADY_FOUND; } kernel.need_to_free =3D false; /* Freed using the module array= */ @@ -788,14 +781,14 @@ static int __init handle_module_node(const EFI_LOADED= _IMAGE *loaded_image, (fdt_node_check_compatible(fdt_efi, module_node_offset, "multiboot,ramdisk") =3D=3D 0= ) ) { - PrintMessage(L"Dom0 ramdisk already found in cfg file."); + PrintStr(L"Dom0 ramdisk already found in cfg file.\r\n"); return ERROR_DOM0_RAMDISK_FOUND; } else if ( xsm.addr && (fdt_node_check_compatible(fdt_efi, module_node_offset, "xen,xsm-policy") =3D=3D 0) ) { - PrintMessage(L"XSM policy already found in cfg file."); + PrintStr(L"XSM policy already found in cfg file.\r\n"); return ERROR_XSM_ALREADY_FOUND; } } @@ -821,7 +814,7 @@ static int __init handle_dom0less_domain_node(const EFI= _LOADED_IMAGE *loaded_ima prop =3D fdt_get_property(fdt_efi, domain_node, "#address-cells", &len= ); if ( !prop ) { - PrintMessage(L"#address-cells not found in domain node."); + PrintStr(L"#address-cells not found in domain node.\r\n"); return ERROR_MISSING_DT_PROPERTY; } =20 @@ -830,7 +823,7 @@ static int __init handle_dom0less_domain_node(const EFI= _LOADED_IMAGE *loaded_ima prop =3D fdt_get_property(fdt_efi, domain_node, "#size-cells", &len); if ( !prop ) { - PrintMessage(L"#size-cells not found in domain node."); + PrintStr(L"#size-cells not found in domain node.\r\n"); return ERROR_MISSING_DT_PROPERTY; } =20 @@ -868,7 +861,7 @@ static int __init efi_check_dt_boot(const EFI_LOADED_IM= AGE *loaded_image) chosen =3D setup_chosen_node(fdt_efi, &addr_len, &size_len); if ( chosen < 0 ) { - PrintMessage(L"Unable to setup chosen node"); + PrintStr(L"Unable to setup chosen node\r\n"); return ERROR_DT_CHOSEN_NODE; } =20 --=20 2.43.0