From: Nigel Cunningham Subject: LZO irreversible output? Date: Thu, 04 Feb 2010 08:38:45 +1100 Message-ID: <4B69ECE5.5060505@crca.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000507060204030901010107" To: linux-crypto@vger.kernel.org, TuxOnIce Devel List , LKML Return-path: Received: from mail.crca.org.au ([67.207.131.56]:43366 "EHLO crca.org.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932637Ab0BCVgs (ORCPT ); Wed, 3 Feb 2010 16:36:48 -0500 Sender: linux-crypto-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------000507060204030901010107 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi all. (Not sent to LKML yesterday; no reply from linux-crypto yet, so resending). A while back now, I stopped supplying the LZF compression algorithm with TuxOnIce and made LZO the default algorithm. Around the same time, we started getting occasional errors when reading images; decompression failures. I've finally managed to find the time to properly look at this, and have managed to find a data page that LZO compresses, but seems to be unable to decompress back to the original contents. I'm wondering whether this is because I'm doing something wrong, or because there really is some data the LZO (or the kernel implementation) can't do reversible compression on. I've turned the test case and the way TuxOnIce invokes the compression and decompression code into a standalone kernel module (attached). On my 64 bit machine, insmoding the module results in the error path being triggered (skipping the dump of the original page): [52205.333463] Output 716 bytes. Result 0. [52205.333468] Compressed to: 06 f8 8f 09 00 00 ea ff ff 00 a1 00 40 7a 00 ff [52205.333473] Compressed to: ff 27 3c 00 78 01 2b 0c 00 01 30 90 09 00 7c 05 [52205.333478] Compressed to: fc 00 d0 03 3f dd 00 68 dc 06 fc 00 20 07 dd 00 [52205.333483] Compressed to: a0 dc 06 fc 00 20 07 dd 00 d8 dc 06 fc 00 20 07 [52205.333488] Compressed to: de 00 10 91 bc 1b fc 00 20 07 dd 00 48 dc 06 fc [52205.333493] Compressed to: 00 20 07 dd 00 80 dc 06 fc 00 20 07 dd 00 b8 dc [52205.333498] Compressed to: 06 fc 00 20 07 dd 00 f0 dc 06 fc 00 20 07 de 00 [52205.333503] Compressed to: 28 92 bc 22 fc 00 20 07 dd 00 60 dc 06 fc 00 20 [52205.333508] Compressed to: 07 dd 00 98 dc 06 fc 00 20 07 dd 00 d0 dc 06 fc [52205.333512] Compressed to: 00 20 07 de 00 08 93 bc 1b fc 00 20 07 dd 00 40 [52205.333517] Compressed to: dc 06 fc 00 20 07 dd 00 78 dc 06 fc 00 20 07 dd [52205.333522] Compressed to: 00 b0 dc 06 fc 00 20 07 dd 00 e8 dc 06 fc 00 20 [52205.333527] Compressed to: 07 de 00 20 94 bc 22 fc 00 20 07 dd 00 58 dc 06 [52205.333532] Compressed to: fc 00 20 07 dd 00 90 dc 06 fc 00 20 07 dd 00 c8 [52205.333537] Compressed to: dc 06 fc 00 20 07 de 00 00 95 bc 1b 27 1c 00 a0 [52205.333542] Compressed to: 07 3f 3d 13 38 dc 06 fc 00 b9 06 00 3f dd 00 70 [52205.333546] Compressed to: dc 06 fc 00 20 07 dd 00 a8 dc 06 fc 00 20 07 dd [52205.333551] Compressed to: 00 e0 dc 06 fc 00 20 07 de 00 18 96 bc 22 fc 00 [52205.333556] Compressed to: 20 07 dd 00 50 dc 06 fc 00 20 07 dd 00 88 dc 06 [52205.333561] Compressed to: fc 00 20 07 dd 00 c0 dc 06 fc 00 20 07 dd 00 f8 [52205.333566] Compressed to: dc 06 fc 00 20 07 de 00 30 97 bc 22 fc 00 20 07 [52205.333571] Compressed to: dd 00 68 dc 06 fc 00 20 07 dd 00 a0 dc 06 fc 00 [52205.333576] Compressed to: 20 07 dd 00 d8 dc 06 fc 00 20 07 de 00 10 98 bc [52205.333581] Compressed to: 1b fc 00 20 07 dd 00 48 dc 06 fc 00 20 07 dd 00 [52205.333586] Compressed to: 80 dc 06 fc 00 20 07 dd 00 b8 dc 06 fc 00 20 07 [52205.333591] Compressed to: dd 00 f0 dc 06 fc 00 20 07 de 00 28 99 bc 22 fc [52205.333596] Compressed to: 00 20 07 dd 00 60 dc 06 fc 00 20 07 dd 00 98 dc [52205.333601] Compressed to: 06 fc 00 20 07 dd 00 d0 dc 06 fc 00 20 07 de 00 [52205.333606] Compressed to: 08 9a bc 1b fc 00 20 07 dd 00 40 dc 06 fc 00 20 [52205.333611] Compressed to: 07 dd 00 78 dc 06 fc 00 20 07 dd 00 b0 dc 06 fc [52205.333616] Compressed to: 00 20 07 dd 00 e8 dc 06 fc 00 20 07 de 00 20 9b [52205.333621] Compressed to: bc 22 fc 00 20 07 dd 00 58 dc 06 fc 00 20 07 dd [52205.333625] Compressed to: 00 90 dc 06 fc 00 20 07 dd 00 c8 dc 06 fc 00 20 [52205.333630] Compressed to: 07 de 00 00 9c bc 1b 27 1c 00 a0 07 3f 1d 1b 38 [52205.333635] Compressed to: dc 06 fc 00 b8 06 20 02 fc 1b dd 06 70 dc 00 20 [52205.333640] Compressed to: 07 dd 00 a8 dc 05 fc 00 20 07 dd 00 e0 dc 06 fc [52205.333645] Compressed to: 00 20 07 de 00 18 9d bc 22 fc 00 20 07 dd 00 50 [52205.333650] Compressed to: dc 06 fc 00 20 07 dd 00 88 dc 06 fc 00 20 07 dd [52205.333655] Compressed to: 00 c0 dc 06 fc 00 20 07 dd 00 f8 dc 06 fc 00 20 [52205.333660] Compressed to: 07 de 00 30 9e bc 22 fc 00 20 07 dd 00 68 dc 06 [52205.333665] Compressed to: fc 00 20 07 dd 00 a0 dc 06 fc 00 20 07 dd 00 d8 [52205.333670] Compressed to: dc 06 fc 00 20 07 de 00 10 9f bc 1b fc 00 20 07 [52205.333675] Compressed to: dd 00 48 dc 06 fc 00 20 07 dd 00 80 dc 06 fc 00 [52205.333679] Compressed to: 20 07 dd 00 b8 dc 06 fc 00 20 07 dd 00 f0 dc 06 [52205.333684] Compressed to: 05 f0 9f 09 00 00 ea ff ff 11 00 00 [52205.333689] [52205.333691] Restored to 0 bytes, result code -22. Would someone be willing and able to tell me what (if anything) I'm doing wrong, or whether there is something wrong with the algo or its implementation? Thanks! Nigel --------------000507060204030901010107 Content-Type: text/x-diff; name="940-lzo-test.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="940-lzo-test.patch" Kconfig | 6 + Makefile | 2 lzo_test.c | 340 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 348 insertions(+) diff -ruNp 940-lzo-test.patch-old/kernel/power/Kconfig 940-lzo-test.patch-new/kernel/power/Kconfig --- 940-lzo-test.patch-old/kernel/power/Kconfig 2010-02-03 12:58:29.000000000 +1100 +++ 940-lzo-test.patch-new/kernel/power/Kconfig 2010-02-03 12:36:41.000000000 +1100 @@ -461,3 +461,9 @@ config PM_RUNTIME and the bus type drivers of the buses the devices are on are responsible for the actual handling of the autosuspend requests and wake-up events. + +config TOI_LZO_TEST + tristate "Test LZO" + depends on CRYPTO + ---help--- + Test LZO compression. diff -ruNp 940-lzo-test.patch-old/kernel/power/lzo_test.c 940-lzo-test.patch-new/kernel/power/lzo_test.c --- 940-lzo-test.patch-old/kernel/power/lzo_test.c 1970-01-01 10:00:00.000000000 +1000 +++ 940-lzo-test.patch-new/kernel/power/lzo_test.c 2010-02-03 12:57:23.000000000 +1100 @@ -0,0 +1,340 @@ +#include +#include +#include + +/* + * Test LZO compression. + */ + +static char *original = + "\xf8\x8f\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x30\x90\x09\x00\x00\xea\xff\xff\x30\x90\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x68\x90\x09\x00\x00\xea\xff\xff" + "\x68\x90\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xa0\x90\x09\x00\x00\xea\xff\xff\xa0\x90\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xd8\x90\x09\x00\x00\xea\xff\xff" + "\xd8\x90\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x10\x91\x09\x00\x00\xea\xff\xff\x10\x91\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x48\x91\x09\x00\x00\xea\xff\xff" + "\x48\x91\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x80\x91\x09\x00\x00\xea\xff\xff\x80\x91\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xb8\x91\x09\x00\x00\xea\xff\xff" + "\xb8\x91\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xf0\x91\x09\x00\x00\xea\xff\xff\xf0\x91\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x28\x92\x09\x00\x00\xea\xff\xff" + "\x28\x92\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x60\x92\x09\x00\x00\xea\xff\xff\x60\x92\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x98\x92\x09\x00\x00\xea\xff\xff" + "\x98\x92\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xd0\x92\x09\x00\x00\xea\xff\xff\xd0\x92\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x08\x93\x09\x00\x00\xea\xff\xff" + "\x08\x93\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x40\x93\x09\x00\x00\xea\xff\xff\x40\x93\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x78\x93\x09\x00\x00\xea\xff\xff" + "\x78\x93\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xb0\x93\x09\x00\x00\xea\xff\xff\xb0\x93\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xe8\x93\x09\x00\x00\xea\xff\xff" + "\xe8\x93\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x20\x94\x09\x00\x00\xea\xff\xff\x20\x94\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x58\x94\x09\x00\x00\xea\xff\xff" + "\x58\x94\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x90\x94\x09\x00\x00\xea\xff\xff\x90\x94\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xc8\x94\x09\x00\x00\xea\xff\xff" + "\xc8\x94\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x95\x09\x00\x00\xea\xff\xff\x00\x95\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x38\x95\x09\x00\x00\xea\xff\xff" + "\x38\x95\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x70\x95\x09\x00\x00\xea\xff\xff\x70\x95\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xa8\x95\x09\x00\x00\xea\xff\xff" + "\xa8\x95\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xe0\x95\x09\x00\x00\xea\xff\xff\xe0\x95\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x18\x96\x09\x00\x00\xea\xff\xff" + "\x18\x96\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x50\x96\x09\x00\x00\xea\xff\xff\x50\x96\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x88\x96\x09\x00\x00\xea\xff\xff" + "\x88\x96\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xc0\x96\x09\x00\x00\xea\xff\xff\xc0\x96\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x96\x09\x00\x00\xea\xff\xff" + "\xf8\x96\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x30\x97\x09\x00\x00\xea\xff\xff\x30\x97\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x68\x97\x09\x00\x00\xea\xff\xff" + "\x68\x97\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xa0\x97\x09\x00\x00\xea\xff\xff\xa0\x97\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xd8\x97\x09\x00\x00\xea\xff\xff" + "\xd8\x97\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x10\x98\x09\x00\x00\xea\xff\xff\x10\x98\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x48\x98\x09\x00\x00\xea\xff\xff" + "\x48\x98\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x80\x98\x09\x00\x00\xea\xff\xff\x80\x98\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xb8\x98\x09\x00\x00\xea\xff\xff" + "\xb8\x98\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xf0\x98\x09\x00\x00\xea\xff\xff\xf0\x98\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x28\x99\x09\x00\x00\xea\xff\xff" + "\x28\x99\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x60\x99\x09\x00\x00\xea\xff\xff\x60\x99\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x98\x99\x09\x00\x00\xea\xff\xff" + "\x98\x99\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xd0\x99\x09\x00\x00\xea\xff\xff\xd0\x99\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x08\x9a\x09\x00\x00\xea\xff\xff" + "\x08\x9a\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x40\x9a\x09\x00\x00\xea\xff\xff\x40\x9a\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x78\x9a\x09\x00\x00\xea\xff\xff" + "\x78\x9a\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xb0\x9a\x09\x00\x00\xea\xff\xff\xb0\x9a\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xe8\x9a\x09\x00\x00\xea\xff\xff" + "\xe8\x9a\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x20\x9b\x09\x00\x00\xea\xff\xff\x20\x9b\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x58\x9b\x09\x00\x00\xea\xff\xff" + "\x58\x9b\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x90\x9b\x09\x00\x00\xea\xff\xff\x90\x9b\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xc8\x9b\x09\x00\x00\xea\xff\xff" + "\xc8\x9b\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x9c\x09\x00\x00\xea\xff\xff\x00\x9c\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x38\x9c\x09\x00\x00\xea\xff\xff" + "\x38\x9c\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x70\x9c\x09\x00\x00\xea\xff\xff\x70\x9c\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xa8\x9c\x09\x00\x00\xea\xff\xff" + "\xa8\x9c\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xe0\x9c\x09\x00\x00\xea\xff\xff\xe0\x9c\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x18\x9d\x09\x00\x00\xea\xff\xff" + "\x18\x9d\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x50\x9d\x09\x00\x00\xea\xff\xff\x50\x9d\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x88\x9d\x09\x00\x00\xea\xff\xff" + "\x88\x9d\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xc0\x9d\x09\x00\x00\xea\xff\xff\xc0\x9d\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x9d\x09\x00\x00\xea\xff\xff" + "\xf8\x9d\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x30\x9e\x09\x00\x00\xea\xff\xff\x30\x9e\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x68\x9e\x09\x00\x00\xea\xff\xff" + "\x68\x9e\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xa0\x9e\x09\x00\x00\xea\xff\xff\xa0\x9e\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xd8\x9e\x09\x00\x00\xea\xff\xff" + "\xd8\x9e\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x10\x9f\x09\x00\x00\xea\xff\xff\x10\x9f\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x48\x9f\x09\x00\x00\xea\xff\xff" + "\x48\x9f\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x80\x9f\x09\x00\x00\xea\xff\xff\x80\x9f\x09\x00\x00\xea\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\xff\xff\xff\xff" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xb8\x9f\x09\x00\x00\xea\xff\xff" + "\xb8\x9f\x09\x00\x00\xea\xff\xff\x00\x00\x00\x00\x00\x00\x00\x40" + "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xf0\x9f\x09\x00\x00\xea\xff\xff\xf0\x9f\x09\x00\x00\xea\xff\xff"; + +static __init int test(void) +{ + struct crypto_comp *tfm = crypto_alloc_comp("lzo", 0, 0); + char *compressed = NULL, *decompressed = NULL; + int comp_size, decomp_size, comp_result, decomp_result, okay; + + if (IS_ERR(tfm)) { + printk(KERN_INFO "Failed to initialise the lzo " + "compression transform.\n"); + return 1; + } + + compressed = vmalloc_32(2 * PAGE_SIZE); + if (!compressed) + goto out; + + decompressed = (char *) get_zeroed_page(GFP_KERNEL); + if (!decompressed) + goto out; + + comp_result = crypto_comp_compress(tfm, original, PAGE_SIZE, + compressed, &comp_size); + + if (comp_result) { + printk("Compression failed (returned %d).\n", comp_result); + goto out; + } + + decomp_result = crypto_comp_decompress(tfm, compressed, comp_size, + decompressed, &decomp_size); + + okay = (!decomp_result && decomp_size == PAGE_SIZE && + !memcmp(decompressed, original, PAGE_SIZE)); + + if (!okay) { + printk("Compression test failed.\n"); + print_hex_dump(KERN_ERR, "Original page: ", DUMP_PREFIX_NONE, + 16, 1, original, PAGE_SIZE, 0); + printk(KERN_ERR "\nOutput %d bytes. Result %d.", comp_size, + comp_result); + print_hex_dump(KERN_ERR, "Compressed to: ", DUMP_PREFIX_NONE, + 16, 1, compressed, comp_size, 0); + printk(KERN_ERR "\nRestored to %d bytes, result code %d.\n", + decomp_size, decomp_result); + print_hex_dump(KERN_ERR, "Decompressed : ", DUMP_PREFIX_NONE, + 16, 1, decompressed, decomp_size, 0); + } else + printk("Compression test passed.\n"); +out: + crypto_free_comp(tfm); + + if (compressed) + vfree(compressed); + + if (decompressed) + free_page((unsigned long) decompressed); + + return 0; +} + +#ifdef MODULE +static __exit void unload(void) +{ + /* Nothing to do */ +} + +module_init(test); +module_exit(unload); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Nigel Cunningham"); +MODULE_DESCRIPTION("TuxOnIce LZO test module"); +#else +late_initcall(test); +#endif diff -ruNp 940-lzo-test.patch-old/kernel/power/Makefile 940-lzo-test.patch-new/kernel/power/Makefile --- 940-lzo-test.patch-old/kernel/power/Makefile 2010-02-03 12:58:29.000000000 +1100 +++ 940-lzo-test.patch-new/kernel/power/Makefile 2010-02-03 12:35:44.000000000 +1100 @@ -41,3 +41,5 @@ obj-$(CONFIG_HIBERNATION) += swsusp.o hi obj-$(CONFIG_HIBERNATION_NVS) += hibernate_nvs.o obj-$(CONFIG_MAGIC_SYSRQ) += poweroff.o + +obj-$(CONFIG_TOI_LZO_TEST) += lzo_test.o --------------000507060204030901010107--