[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 1/6] x86/boot: convert domain construction to use boot info
- To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Fri, 15 Nov 2024 11:33:12 -0500
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=apertussolutions.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ONAGz/W+1qt6C1LrcZqoUGtnIeN0P7yMND5DykLyQmk=; b=q/T5OAVAK+ONFT++RtnUV1X9HpZb+XefzErJtMCu8bE2TqNQxgwpZsuIM1ozfFCLc/+JZ8a9ZJIbrGaDW1mjnVWm49OvoZCQwSPOF24bVtCrPNeRU9uZPz848JicDEfni8i8lKbvdlEOI+c5rck5xVqAa1NIWsyOCYwArFV19J0aJaS3GMLag2/3RDlRB8Z7MM9u9IqX1x9HL6AZ5VgN7JuSP+G3eFqloWhxbe2ugWoxWxs9mzRcf5CWoperLhXlnU2qDuWzOXmDxrqhmJ6/IfRGNn4JcV11bPrpKDf4MVY70R/RqtUqAJ3g8Hs2Mi2tvQfzxACGM/O1BJdGaFa4OQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Pttk8Bb4g1QFYjukO9Mh/elN6GvQr69wxEQJqb1QpSXks5NiEx+mKSGB+X/tsEonQJYnwxUWKNBJpZlxyaRxIPHTBR/XfUsTpvzDYrnjZszGloJx/eufR6dXVHYaMJW6yfqyheS60+afgxjJ0O8hnta2tiF9eCrM+7GxGk7A84SytS7ar+Zbb3S5EAiAIcyEQ15iyafUCxnPU40oNUThg1VJxc59kYAqKoRrneLwgdpTaOaIMusuS00qxnErcThrMYuELdmfArdSdXUil3KsiYmP5eGJYpKbYPjHVUMdNJ6AoldGZf3suSdgoMUCNI5RgnnTCRsmCc5dOh9Mkss9UQ==
- Cc: <christopher.w.clark@xxxxxxxxx>, <stefano.stabellini@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Fri, 15 Nov 2024 16:45:03 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2024-11-15 08:11, Daniel P. Smith wrote:
With all the components used to construct dom0 encapsulated in struct boot_info
and struct boot_module, it is no longer necessary to pass all them as
parameters down the domain construction call chain. Change the parameter list
to pass the struct boot_info instance and the struct domain reference.
Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 3dd913bdb029..d1bdf1b14601 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1300,16 +1301,26 @@ static void __hwdom_init pvh_setup_mmcfg(struct domain
*d)
}
}
-int __init dom0_construct_pvh(struct domain *d, const module_t *image,
- unsigned long image_headroom,
- module_t *initrd,
- const char *cmdline)
+int __init dom0_construct_pvh(struct boot_info *bi, struct domain *d)
{
paddr_t entry, start_info;
+ struct boot_module *image;
+ struct boot_module *initrd = NULL;
+ unsigned int idx;
int rc;
printk(XENLOG_INFO "*** Building a PVH Dom%d ***\n", d->domain_id);
+ idx = first_boot_module_index(bi, BOOTMOD_KERNEL);
+ if ( idx >= bi->nr_modules )
What do you think about introducing a new define:
#define BOOTMOD_NOT_FOUND (MAX_NR_BOOTMODS + 1)
For first_boot_module_index() to return. And then:
if ( idx == BOOTMOD_NOT_FOUND )
?
Otherwise it looks good to me, and Andrew's suggestions are good as well.
Regards,
Jason
+ panic("Missing kernel boot module for %pd construction\n", d);
+
+ image = &bi->mods[idx];
+
+ idx = first_boot_module_index(bi, BOOTMOD_RAMDISK);
+ if ( idx < bi->nr_modules )
+ initrd = &bi->mods[idx];
+
if ( is_hardware_domain(d) )
{
/*
@@ -1347,8 +1358,7 @@ int __init dom0_construct_pvh(struct domain *d, const
module_t *image,
|