From nobody Wed Dec 4 19:34:57 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 header.i=dpsmith@apertussolutions.com; 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; arc=pass (i=1 dmarc=pass fromdomain=apertussolutions.com) ARC-Seal: i=2; a=rsa-sha256; t=1729472255; cv=pass; d=zohomail.com; s=zohoarc; b=HyihRPF2fOQEDWTRDOfX0Shv0/Agg5sYuyM2nbmAWgQ+VIpe6PdHYDm+yEX2+1UEc9Zs+X3sVvkbbkYt4OO/iKuR0P/MPTtitFomjPRx/zI6ddu2FGpRueV4i244bn1Tv6b418FROS0biiSCqW+HpdlT8PXfwCXYJTGR6lH1ph0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729472255; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8l/A5uTX2SajRrK9csx9oFSHA7WUVR/YgCRfUTZ06cw=; b=fpWaJ5ZMoqDNiUjS6Os1iOLlW0t70qVCBnQL95YzToZG4riERDgDXpvyvmN6yCLh34NFjr1cX7Iqxu2fdmBZ2R22KzSDHa5fT+Z8Pjat6zwfCU0Lrojpvbil9N/QRgojez5jkXnIYBjxiDmRHhn7YpR02sBWegnVv7i8+fRQVfA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dpsmith@apertussolutions.com; 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; arc=pass (i=1 dmarc=pass fromdomain=apertussolutions.com) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1729472255933768.9601092124749; Sun, 20 Oct 2024 17:57:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.823025.1237066 (Exim 4.92) (envelope-from ) id 1t2gjR-00077K-Kh; Mon, 21 Oct 2024 00:57:13 +0000 Received: by outflank-mailman (output) from mailman id 823025.1237066; Mon, 21 Oct 2024 00:57:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t2gjR-00076r-G8; Mon, 21 Oct 2024 00:57:13 +0000 Received: by outflank-mailman (input) for mailman id 823025; Mon, 21 Oct 2024 00:57:12 +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 1t2gcF-0001i1-1E for xen-devel@lists.xenproject.org; Mon, 21 Oct 2024 00:49:47 +0000 Received: from sender3-of-o58.zoho.com (sender3-of-o58.zoho.com [136.143.184.58]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5d3c98f9-8f46-11ef-a0be-8be0dac302b0; Mon, 21 Oct 2024 02:49:46 +0200 (CEST) Received: by mx.zohomail.com with SMTPS id 1729471614074580.9912900787891; Sun, 20 Oct 2024 17:46:54 -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: 5d3c98f9-8f46-11ef-a0be-8be0dac302b0 ARC-Seal: i=1; a=rsa-sha256; t=1729471616; cv=none; d=zohomail.com; s=zohoarc; b=Rh1pfFOh/ZaLbVfmXmkN8JvQ1BP/bKVNJPhIe+6B6jfb2wMticdqY1bNxcoaABWgCK+3xujsR72yzXeo5tOM31oGk9962xxdSnkgvNG7ye3p0jlQELzRdXXnvU236Bk25EIw9ZFVQWoq+fgspjPDauSbvvJ/vR1OLeoEMmtjA9w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729471616; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=8l/A5uTX2SajRrK9csx9oFSHA7WUVR/YgCRfUTZ06cw=; b=l2bMvlqYqkBzD7ur+Bwz+73Kqdz/Bbn7GZhuOTfNlDkV+ruazlWjeml58PCeRH0GSmq0AJ28j/geGbeZ0ppa6aTmJ8Ek1szaQL4X6S/5KXvKO1JTpUCTYQ1U6SYbH3Ay+h3eG9lK/Z3uYeLbQNgUu+5XjQAW0Hm4OQ0hiB30BT8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@apertussolutions.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1729471616; s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=8l/A5uTX2SajRrK9csx9oFSHA7WUVR/YgCRfUTZ06cw=; b=By/WpDgqmji2sfwMOYkHAH2S/rjv1GqBVDprm5hLT69o0VmYCmm0fPy/Bt1aNwJu 69ViJFj+c5kuZUA7beejUnL9BpLhIRub+Enh5Mp+7mIEPUjvUgrgqYye476NSHgNUnO AhH9ZUT9fpZBb3aepolJ9mqExTJBcTEZsGztZZqg= From: "Daniel P. Smith" To: xen-devel@lists.xenproject.org Cc: "Daniel P. Smith" , jason.andryuk@amd.com, christopher.w.clark@gmail.com, stefano.stabellini@amd.com, Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v7 26/38] x86/boot: convert pvh_load_kernel to struct boot_module Date: Sun, 20 Oct 2024 20:46:01 -0400 Message-Id: <20241021004613.18793-27-dpsmith@apertussolutions.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241021004613.18793-1-dpsmith@apertussolutions.com> References: <20241021004613.18793-1-dpsmith@apertussolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-ZohoMail-DKIM: pass (identity dpsmith@apertussolutions.com) X-ZM-MESSAGEID: 1729472257619116600 Content-Type: text/plain; charset="utf-8" This changes both the kernel and ramdisk parameters over to struct boot_mod= ule. Signed-off-by: Daniel P. Smith Reviewed-by: Jason Andryuk --- xen/arch/x86/hvm/dom0_build.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c index 0fe63f040936..211f4e3e772e 100644 --- a/xen/arch/x86/hvm/dom0_build.c +++ b/xen/arch/x86/hvm/dom0_build.c @@ -642,15 +642,14 @@ static bool __init check_and_adjust_load_address( return true; } =20 -static int __init pvh_load_kernel(struct domain *d, const module_t *image, - unsigned long image_headroom, - module_t *initrd, void *image_base, - const char *cmdline, paddr_t *entry, - paddr_t *start_info_addr) +static int __init pvh_load_kernel( + struct domain *d, const struct boot_module *image, + struct boot_module *initrd, void *image_base, + const char *cmdline, paddr_t *entry, paddr_t *start_info_addr) { - void *image_start =3D image_base + image_headroom; - unsigned long image_len =3D image->mod_end; - unsigned long initrd_len =3D initrd ? initrd->mod_end : 0; + void *image_start =3D image_base + image->headroom; + unsigned long image_len =3D image->size; + unsigned long initrd_len =3D initrd ? initrd->size : 0; struct elf_binary elf; struct elf_dom_parms parms; paddr_t last_addr; @@ -725,7 +724,7 @@ static int __init pvh_load_kernel(struct domain *d, con= st module_t *image, =20 if ( initrd !=3D NULL ) { - rc =3D hvm_copy_to_guest_phys(last_addr, mfn_to_virt(initrd->mod_s= tart), + rc =3D hvm_copy_to_guest_phys(last_addr, maddr_to_virt(initrd->sta= rt), initrd_len, v); if ( rc ) { @@ -736,9 +735,9 @@ static int __init pvh_load_kernel(struct domain *d, con= st module_t *image, mod.paddr =3D last_addr; mod.size =3D initrd_len; last_addr +=3D ROUNDUP(initrd_len, elf_64bit(&elf) ? 8 : 4); - if ( initrd->string ) + if ( initrd->cmdline ) { - char *str =3D __va(initrd->string); + char *str =3D __va((unsigned long)initrd->cmdline); size_t len =3D strlen(str) + 1; =20 rc =3D hvm_copy_to_guest_phys(last_addr, str, len, v); @@ -1346,8 +1345,8 @@ int __init dom0_construct_pvh(struct domain *d, const= struct boot_module *image, return rc; } =20 - rc =3D pvh_load_kernel(d, image->mod, image->headroom, initrd->mod, - bootstrap_map_bm(image), cmdline, &entry, &start_= info); + rc =3D pvh_load_kernel(d, image, initrd, bootstrap_map_bm(image), cmdl= ine, + &entry, &start_info); if ( rc ) { printk("Failed to load Dom0 kernel\n"); --=20 2.30.2