Skip to contentSkip to conversation

x86: allow LZO compressed bzImage to be used as Dom0 kernel

PATCH New Jan Beulich 1 participant 1 message Jun 15, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: allow LZO compressed bzImage to be used as Dom0 kernel

... since recently Linux added this as another kernel compression method, and we already have LZO compression in the tree (from tmem), so that only glue logic is needed.

xen/common/Makefile +1 -1
@@ -39,7 +39,7 @@ obj-y += radix-tree.o
 obj-y += rbtree.o
 obj-y += lzo.o
 
-obj-$(CONFIG_X86) += decompress.o bunzip2.o unlzma.o
+obj-$(CONFIG_X86) += decompress.o bunzip2.o unlzma.o unlzo.o
 
 obj-$(perfc)       += perfc.o
 obj-$(crash_debug) += gdbstub.o
xen/common/decompress.c +3 -0
@@ -23,5 +23,8 @@ int __init decompress(void *inbuf, unsig
     if ( len >= 2 && !memcmp(inbuf, "\135\000", 2) )
         return unlzma(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
+    if ( len >= 5 && !memcmp(inbuf, "\x89LZO", 5) )
+        return unlzo(inbuf, len, NULL, NULL, outbuf, NULL, error);
+
     return 1;
 }
xen/common/unlzo.c new file +229 -0

229 lines not on this page · raw message

xen/include/xen/decompress.h +1 -1
@@ -31,7 +31,7 @@ typedef int decompress_fn(unsigned char 
  * dependent).
  */
 
-decompress_fn bunzip2, unlzma;
+decompress_fn bunzip2, unlzma, unlzo;
 
 int decompress(void *inbuf, unsigned int len, void *outbuf);
 

... since recently Linux added this as another kernel compression method, and we already have LZO compression in the tree (from tmem), so that only glue logic is needed.

xen/common/Makefile +1 -1
@@ -39,7 +39,7 @@ obj-y += radix-tree.o
 obj-y += rbtree.o
 obj-y += lzo.o
 
-obj-$(CONFIG_X86) += decompress.o bunzip2.o unlzma.o
+obj-$(CONFIG_X86) += decompress.o bunzip2.o unlzma.o unlzo.o
 
 obj-$(perfc)       += perfc.o
 obj-$(crash_debug) += gdbstub.o
xen/common/decompress.c +3 -0
@@ -23,5 +23,8 @@ int __init decompress(void *inbuf, unsig
     if ( len >= 2 && !memcmp(inbuf, "\135\000", 2) )
         return unlzma(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
+    if ( len >= 5 && !memcmp(inbuf, "\x89LZO", 5) )
+        return unlzo(inbuf, len, NULL, NULL, outbuf, NULL, error);
+
     return 1;
 }
xen/common/unlzo.c new file +229 -0

229 lines not on this page · raw message

xen/include/xen/decompress.h +1 -1
@@ -31,7 +31,7 @@ typedef int decompress_fn(unsigned char 
  * dependent).
  */
 
-decompress_fn bunzip2, unlzma;
+decompress_fn bunzip2, unlzma, unlzo;
 
 int decompress(void *inbuf, unsigned int len, void *outbuf);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel