[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 42/44] x86/boot: convert construct_dom0 to struct boot_domain


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 8 Oct 2024 15:47:36 -0400
  • 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=gKNXg5cDvMCtoT7GI50eLriDbSWKWgWhYorrdT8xM0I=; b=XSZIg/05xMcly9YSpjJCTYr7N3G7j2div2V2kbht6KE1ayP94n6jI39fmPlD8POU3ZyAXA0U8dhKpBcENOGFS0o+DizHHPn8k+NllgctL3ntsCdOAzSGdIXCEGcLVah8FMmu6JJY1KhEZmytENwWM9pfHc/2UXRbscOWAjcxcCSy/yFY25aW8xQJQ6OsacCCQBJm1zWhmM6j+0i0plZuI/QnHLhtlXHqB7BPOM9rlxDWB66vCwiiPT9BDzQULki0oWv364x0YV6BlYL4K6LWGU36lbiFMn1Z79cx46pSgzvQwZyV1qdgu6K8tirwnayKJGjSMe8HabNAY38gM2zC/g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BwgMq6836jC5sY35zEPLXf+cKaVvKfaOv+lRh4MvajZ27osWW8YR8NYgPeSNOikpA1zxtQ6P7Q/VPELqF4lV6YH+/6XP5LBgckQrHf3HuOcsjzGEtcRxYqxtbkJY5yOT/0pwBVQx1vsvg8nXT5EE0jpbY0C9R/mB/7RWHhgodca/L/2YVkYrucLwb6Qgtstk00PDyK6fBbo40Ef7XQ+W++pOfcjFy4XArysESdedOK9Fj50qjvlAMlsDos2nnGjH+1wVK/GyYmSCdOVj33D1xmAqKOGOhbrUPe2A5WNWZci7q/yI74hBPSoyMr0s2QKO94bk1MTRofSIZWSCPlJQ/w==
  • 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: Tue, 08 Oct 2024 20:48:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2024-10-06 17:49, Daniel P. Smith wrote:
A struct boot_domain now encapsulates the domain reference, kernel, ramdisk,
and command line for the domain being constructed. As a result of this
encapsulation, construct_dom0 can now take a single struct boot_domain instead
of these four parameters.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
  xen/arch/x86/dom0_build.c        | 19 +++++++++----------
  xen/arch/x86/include/asm/setup.h |  4 +---
  xen/arch/x86/setup.c             |  2 +-
  3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 71b2e3afc1a1..e552f2e9abef 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -597,22 +597,21 @@ int __init dom0_setup_permissions(struct domain *d)
      return rc;
  }
-int __init construct_dom0(struct domain *d, const struct boot_module *image,
-                          struct boot_module *initrd, const char *cmdline)
+int __init construct_dom0(struct boot_domain *bd)
  {
      int rc;

I think a local variable would be better:

    struct domain *d = bd->d;

The patch is smaller, and using just d is common in the hypervisor.

Regards,
Jason

/* Sanity! */
-    BUG_ON(!pv_shim && d->domain_id != 0);
-    BUG_ON(d->vcpu[0] == NULL);
-    BUG_ON(d->vcpu[0]->is_initialised);
+    BUG_ON(!pv_shim && bd->d->domain_id != 0);
+    BUG_ON(bd->d->vcpu[0] == NULL);
+    BUG_ON(bd->d->vcpu[0]->is_initialised);
process_pending_softirqs(); - if ( is_hvm_domain(d) )
-        rc = dom0_construct_pvh(d, image, initrd, cmdline);
-    else if ( is_pv_domain(d) )
-        rc = dom0_construct_pv(d, image, initrd, cmdline);
+    if ( is_hvm_domain(bd->d) )
+        rc = dom0_construct_pvh(bd->d, bd->kernel, bd->ramdisk, bd->cmdline);
+    else if ( is_pv_domain(bd->d) )
+        rc = dom0_construct_pv(bd->d, bd->kernel, bd->ramdisk, bd->cmdline);
      else
          panic("Cannot construct Dom0. No guest interface available\n");



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.