]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
tmem: default to off
authorJan Beulich <jbeulich@suse.com>
Fri, 11 Jan 2019 11:30:29 +0000 (12:30 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 11 Jan 2019 11:30:29 +0000 (12:30 +0100)
As a short term alternative to deleting the code, default its building
to off (overridable in EXPERT mode only). Additionally make sure other
related baggage (LZO code) won't be carried when the option is off (with
TMEM scheduled to be deleted anyway, I didn't want to introduce a
separate Kconfig option to control the LZO compression code, and hence
CONFIG_TMEM is used directly there). Similarly I couldn't be bothered to
add actual content to the command line option doc for the two affected
options.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
docs/misc/xen-command-line.pandoc
xen/common/Kconfig
xen/common/Makefile
xen/common/lzo.c

index 99c283cb10af1f56f4cb0ef3f233bb104e9dbcae..d39bcee928456d12246143ea2ec9ddc53db5fe1e 100644 (file)
@@ -1969,9 +1969,15 @@ pages) must also be specified via the tbuf_size parameter.
 ### tmem
 > `= <boolean>`
 
+This option (and its underlying code) is going to go away in a future
+Xen version.
+
 ### tmem_compress
 > `= <boolean>`
 
+This option (and its underlying code) is going to go away in a future
+Xen version.
+
 ### tsc (x86)
 > `= unstable | skewed | stable:socket`
 
index 37f850551a43690b7a79a70cb7deab184ae88897..a79cd404416b7d621863c825c23918d69fd525b5 100644 (file)
@@ -78,17 +78,19 @@ config KEXEC
          If unsure, say Y.
 
 config TMEM
-       def_bool y
-       prompt "Transcendent Memory Support" if EXPERT = "y"
+       bool "Transcendent Memory Support (deprecated)" if EXPERT = "y"
        ---help---
          Transcendent memory allows PV-aware guests to collaborate on memory
          usage. Guests can 'swap' their memory to the hypervisor or have an
          collective pool of memory shared across guests. The end result is
          less memory usage by guests allowing higher guest density.
 
-         You also have to enable it on the Xen commandline by using tmem=1
+         You also have to enable it on the Xen commandline by using tmem=1.
 
-         If unsure, say Y.
+         WARNING: This option (and its underlying code) is going to go away
+         in a future Xen version.
+
+         If unsure, say N.
 
 config XENOPROF
        def_bool y
index ffdfb7448d9cdbb9de3794a22c1bdb4521ef7c99..56fc201b6b4e007a5a9e4db7aa3343ba46619149 100644 (file)
@@ -21,7 +21,7 @@ obj-$(CONFIG_KEXEC) += kimage.o
 obj-y += lib.o
 obj-$(CONFIG_NEEDS_LIST_SORT) += list_sort.o
 obj-$(CONFIG_LIVEPATCH) += livepatch.o livepatch_elf.o
-obj-y += lzo.o
+obj-$(CONFIG_TMEM) += lzo.o
 obj-$(CONFIG_MEM_ACCESS) += mem_access.o
 obj-y += memory.o
 obj-y += monitor.o
@@ -66,8 +66,9 @@ obj-bin-y += warning.init.o
 obj-$(CONFIG_XENOPROF) += xenoprof.o
 obj-y += xmalloc_tlsf.o
 
-obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o)
-
+lzo-y := lzo
+lzo-$(CONFIG_TMEM) :=
+obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma $(lzo-y) unlzo unlz4 earlycpio,$(n).init.o)
 
 obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o xlat.o)
 
index 74831cb2683627144595d41c4f1f5e875dd5727a..0a1167107560dc13fa57b33f6bf100831448c4cc 100644 (file)
 #define get_unaligned_le16(_p) (*(u16 *)(_p))
 #define get_unaligned_le32(_p) (*(u32 *)(_p))
 
+#ifdef CONFIG_TMEM
+
 static noinline size_t
 lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
                     unsigned char *out, size_t *out_len,
@@ -362,6 +364,11 @@ int lzo1x_1_compress(const unsigned char *in, size_t in_len,
     return LZO_E_OK;
 }
 
+# define INIT
+#else /* CONFIG_TMEM */
+# include "decompress.h"
+#endif /* CONFIG_TMEM */
+
 /*
  *  LZO1X Decompressor from LZO
  *
@@ -391,8 +398,8 @@ int lzo1x_1_compress(const unsigned char *in, size_t in_len,
  */
 #define MAX_255_COUNT      ((((size_t)~0) / 255) - 2)
 
-int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
-                          unsigned char *out, size_t *out_len)
+int INIT lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
+                               unsigned char *out, size_t *out_len)
 {
     unsigned char *op;
     const unsigned char *ip;