[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/12] x86/boot: move headroom to boot modules
 
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
 
- From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
 
- Date: Wed, 6 Nov 2024 19:50:02 -0500
 
- Arc-authentication-results: i=1; mx.zohomail.com;	dkim=pass  header.i=apertussolutions.com;	spf=pass  smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx;	dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
 
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 	t=1730940606; h=Content-Type: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=CQrUaKQJZyNt/jguIR6wgwku9uegLetjZW2K8LXHTv0=; 	b=a3fMIGEG/nC8CYczgfTw25exx7jlrJnVGDf1gEXwwtRLdG34blfcX54EqKfSi52tQ83tYQdyIOoqFTUx8UF/PTXjzZxUEE/FB9QQWB0MlqJE6/zdoYUqUCGCmMCIOa+R3NwEQ6MBSJaAWjITiMO4XmiIGMNoqGAKyaSoU1bccbw=
 
- Arc-seal: i=1; a=rsa-sha256; t=1730940606; cv=none; 	d=zohomail.com; s=zohoarc; 	b=lWEn4jlLKkuZ/TKwGETmssq13fMmItqS6JfquUGI40ZtCD/Bf0Y0cVqfECIjqI7SKI6pMtDtrv1pX9ILP3Nc63jeLTb4kVu10FZXOZTpaKpDggqPwfNl+7xrVy7v2Y4CaC866LJo9e6rN40cUMQLlSF9Klp7e189R9rKz2qkMhI=
 
- Cc: jason.andryuk@xxxxxxx, christopher.w.clark@xxxxxxxxx, stefano.stabellini@xxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
 
- Delivery-date: Thu, 07 Nov 2024 00:50:18 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
On 11/6/24 18:00, Andrew Cooper wrote:
 
On 02/11/2024 5:25 pm, Daniel P. Smith wrote:
 
diff --git a/xen/arch/x86/include/asm/bootinfo.h 
b/xen/arch/x86/include/asm/bootinfo.h
index b1549d8c8f93..e337baa905f0 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -30,6 +30,28 @@ struct boot_module {
  
      enum bootmod_type type;
  
+    /*
+     * A boot module may need decompressing by Xen.  Headroom is an estimate of
+     * the additional space required to decompress the module.
+     *
+     * Headroom is accounted for at the start of the module.  Decompressing is
+     * done in-place with input=start, output=start-headroom, expecting the
+     * pointers to become equal (give or take some rounding) when decompression
+     * is complete.
+     *
+     * Memory layout at boot:
+     *
+     *               start ----+
+     *                         v
+     *   |<-----headroom------>|<------size------->|
+     *                         +-------------------+
+     *                         | Compressed Module |
+     *   +---------------------+-------------------+
+     *   |           Decompressed Module           |
+     *   +-----------------------------------------+
+     */
+    unsigned long headroom;
+
      /*
       * Module State Flags:
       *   relocated: indicates module has been relocated in memory.
 
By the end of the series, this ends very poorly laid out.
It works a whole lot better when putting the bitfields between type and
headroom.
 
 
Ack.
 
Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
 
 
Thanks.
v/r,
dps
 
 
    
     |