Skip to contentSkip to conversation

Allow tmem to be disabled via Kconfig

PATCH Superseded Doug Goldstein 3 participants 15 messages Mar 14, 2016 – Mar 16, 2016

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Allow tmem to be disabled via Kconfig

First swag at allowing tmem to be disabled via Kconfig. I've only build tested this first version because I expect a bunch of feedback that will necessitate changes and then v2 will hopefully be worth testing. The first 4 patches can go in regardless of the final patch and are really just cleanups.

Doug Goldstein (5):
tmem: add tmem_disable() function
tmem: drop direct usage of opt_tmem
tmem: make tmem_freeable_pages() check tmem status
tmem: don't assume stdbool.h is included
tmem: allow tmem to be disabled with Kconfig

 xen/arch/x86/hvm/hvm.c             |  4 ++++
 xen/arch/x86/setup.c               |  6 +++---
 xen/arch/x86/x86_64/compat/entry.S |  4 ++++
 xen/arch/x86/x86_64/entry.S        |  4 ++++
 xen/common/Kconfig                 | 11 +++++++++++
 xen/common/Makefile                |  7 ++++---
 xen/common/memory.c                |  2 +-
 xen/common/page_alloc.c            |  8 ++++----
 xen/common/tmem.c                  |  3 +++
 xen/include/xen/tmem.h             | 26 ++++++++++++++++++++++++++
 xen/include/xen/tmem_xen.h         | 17 +++++++++++++++++
 11 files changed, 81 insertions(+), 11 deletions(-)
Signature · 7 lines
2.4.10


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw

PATCH 1/5 tmem: add tmem_disable() function

Instead of manipulating the opt_tmem variable directly utilize a wrapper function.

---
CC: Keir Fraser <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>

---
 xen/arch/x86/setup.c       | 4 ++--
 xen/include/xen/tmem_xen.h | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)
xen/arch/x86/setup.c +2 -2
index 8431f06..5485468 100644
@@ -25,7 +25,7 @@
 #include <xen/dmi.h>
 #include <xen/pfn.h>
 #include <xen/nodemask.h>
-#include <xen/tmem_xen.h> /* for opt_tmem only */
+#include <xen/tmem_xen.h>
 #include <xen/watchdog.h>
 #include <public/version.h>
 #include <compat/platform.h>
@@ -1247,7 +1247,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         {
            printk(XENLOG_WARNING
                   "TMEM physical RAM limit exceeded, disabling TMEM\n");
-           opt_tmem = 0;
+           tmem_disable();
         }
     }
     else
xen/include/xen/tmem_xen.h +5 -0
index c770f3e..f516bbe 100644
@@ -69,6 +69,11 @@ static inline bool_t tmem_enabled(void)
     return opt_tmem;
 }
 
+static inline void tmem_disable(void)
+{
+    opt_tmem = 0;
+}
+
 /*
  * Memory free page list management
  */
Signature · 7 lines
2.4.10


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#3 lore raw

PATCH 2/5 tmem: drop direct usage of opt_tmem

In reply to Doug Goldstein

Don't use the opt_tmem variable to check if tmem is enabled, instead use the tmem_enabled() helper function everywhere.

---
CC: Keir Fraser <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>

---
 xen/arch/x86/setup.c    | 2 +-
 xen/common/memory.c     | 2 +-
 xen/common/page_alloc.c | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)
xen/arch/x86/setup.c +1 -1
index 5485468..7181624 100644
@@ -1243,7 +1243,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
             init_domheap_pages(s, e);
         }
 
-        if ( opt_tmem )
+        if ( tmem_enabled() )
         {
            printk(XENLOG_WARNING
                   "TMEM physical RAM limit exceeded, disabling TMEM\n");
xen/common/memory.c +1 -1
index ef57219..c7fca96 100644
@@ -202,7 +202,7 @@ static void populate_physmap(struct memop_args *a)
 
                 if ( unlikely(!page) )
                 {
-                    if ( !opt_tmem || a->extent_order )
+                    if ( !tmem_enabled() || a->extent_order )
                         gdprintk(XENLOG_INFO,
                                  "Could not allocate order=%u extent: id=%d memflags=%#x (%u of %u)\n",
                                  a->extent_order, d->domain_id, a->memflags,
xen/common/page_alloc.c +4 -4
index 22e8feb..1e6246e 100644
@@ -652,7 +652,7 @@ static void __init setup_low_mem_virq(void)
 static void check_low_mem_virq(void)
 {
     unsigned long avail_pages = total_avail_pages +
-        (opt_tmem ? tmem_freeable_pages() : 0) - outstanding_claims;
+        (tmem_enabled() ? tmem_freeable_pages() : 0) - outstanding_claims;
 
     if ( unlikely(avail_pages <= low_mem_virq_th) )
     {
@@ -738,7 +738,7 @@ static struct page_info *alloc_heap_pages(
      * Others try tmem pools then fail.  This is a workaround until all
      * post-dom0-creation-multi-page allocations can be eliminated.
      */
-    if ( opt_tmem && ((order == 0) || (order >= 9)) &&
+    if ( tmem_enabled() && ((order == 0) || (order >= 9)) &&
          (total_avail_pages <= midsize_alloc_zone_pages) &&
          tmem_freeable_pages() )
         goto try_tmem;
@@ -984,7 +984,7 @@ static void free_heap_pages(
     avail[node][zone] += 1 << order;
     total_avail_pages += 1 << order;
 
-    if ( opt_tmem )
+    if ( tmem_enabled() )
         midsize_alloc_zone_pages = max(
             midsize_alloc_zone_pages, total_avail_pages / MIDSIZE_ALLOC_FRAC);
 
@@ -1755,7 +1755,7 @@ int assign_pages(
     {
         if ( unlikely((d->tot_pages + (1 << order)) > d->max_pages) )
         {
-            if ( !opt_tmem || order != 0 || d->tot_pages != d->max_pages )
+            if ( !tmem_enabled() || order != 0 || d->tot_pages != d->max_pages )
                 gprintk(XENLOG_INFO, "Over-allocation for domain %u: "
                         "%u > %u\n", d->domain_id,
                         d->tot_pages + (1 << order), d->max_pages);
Signature · 7 lines
2.4.10


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#4 lore raw

Re: [PATCH 2/5] tmem: drop direct usage of opt_tmem

xen/common/page_alloc.c static void __init setup_low_mem_virq(void) · line 655

Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 14.03.16 at 21:29, <[email protected]> wrote:
xen/common/page_alloc.c +1 -1
@@ -652,7 +652,7 @@ static void __init setup_low_mem_virq(void)
 static void check_low_mem_virq(void)
 {
     unsigned long avail_pages = total_avail_pages +
-        (opt_tmem ? tmem_freeable_pages() : 0) - outstanding_claims;
+        (tmem_enabled() ? tmem_freeable_pages() : 0) - outstanding_claims;

Would seem more natural to simply have tmem_freeable_pages() return zero when tmem is build-time disabled (the more that for the build to not fail you need a stub for that function anyway).

Jan

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

#5 lore raw

PATCH 3/5 tmem: make tmem_freeable_pages() check tmem status

In reply to Doug Goldstein

Most callers of tmem_freeable_pages() checked to see if tmem was enabled before calling tmem_freeable_pages() but not all of them did. This seemed like an oversight and to avoid similar situations like that, stick the check of tmem into tmem_freeable_pages().

---
CC: Konrad Rzeszutek Wilk <[email protected]>

---
 xen/common/page_alloc.c | 4 ++--
 xen/common/tmem.c       | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
xen/common/page_alloc.c +2 -2
index 1e6246e..98e30e5 100644
@@ -652,7 +652,7 @@ static void __init setup_low_mem_virq(void)
 static void check_low_mem_virq(void)
 {
     unsigned long avail_pages = total_avail_pages +
-        (tmem_enabled() ? tmem_freeable_pages() : 0) - outstanding_claims;
+        tmem_freeable_pages() - outstanding_claims;
 
     if ( unlikely(avail_pages <= low_mem_virq_th) )
     {
@@ -738,7 +738,7 @@ static struct page_info *alloc_heap_pages(
      * Others try tmem pools then fail.  This is a workaround until all
      * post-dom0-creation-multi-page allocations can be eliminated.
      */
-    if ( tmem_enabled() && ((order == 0) || (order >= 9)) &&
+    if ( ((order == 0) || (order >= 9)) &&
          (total_avail_pages <= midsize_alloc_zone_pages) &&
          tmem_freeable_pages() )
         goto try_tmem;
xen/common/tmem.c +3 -0
index 0436e49..16e249a 100644
@@ -2837,6 +2837,9 @@ void *tmem_relinquish_pages(unsigned int order, unsigned int memflags)
 
 unsigned long tmem_freeable_pages(void)
 {
+    if ( !tmem_enabled() )
+        return 0;
+
     return tmem_page_list_pages + _atomic_read(freeable_page_count);
 }
 
Signature · 7 lines
2.4.10


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#6 lore raw

Re: [PATCH 3/5] tmem: make tmem_freeable_pages() check tmem status

Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 14.03.16 at 21:29, <[email protected]> wrote:

Most callers of tmem_freeable_pages() checked to see if tmem was enabled before calling tmem_freeable_pages() but not all of them did. This seemed like an oversight and to avoid similar situations like that, stick the check of tmem into tmem_freeable_pages().

Ah, here we go. I think this should be folded into the previous patch then, and when folded together the result can have my ack.

Jan

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

#7 lore raw

PATCH 4/5 tmem: don't assume stdbool.h is included

In reply to Doug Goldstein

tmem_xen.h assumes that all users will have already included stdbool.h which might not always be true.

---
CC: Konrad Rzeszutek Wilk <[email protected]>

---
 xen/include/xen/tmem_xen.h | 1 +
 1 file changed, 1 insertion(+)
xen/include/xen/tmem_xen.h +1 -0
index f516bbe..b95bde9 100644
@@ -9,6 +9,7 @@
 #ifndef __XEN_TMEM_XEN_H__
 #define __XEN_TMEM_XEN_H__
 
+#include <xen/stdbool.h>
 #include <xen/mm.h> /* heap alloc/free */
 #include <xen/pfn.h>
 #include <xen/xmalloc.h> /* xmalloc/xfree */
Signature · 7 lines
2.4.10


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#8 lore raw

Re: [PATCH 4/5] tmem: don't assume stdbool.h is included

Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 14.03.16 at 21:29, <[email protected]> wrote:

tmem_xen.h assumes that all users will have already included stdbool.h which might not always be true.

Wait, no - stdbool.h is not supposed to be included in code other than such shared with the tool stack. I see ARM has gained some of those (Julien, Stefano?), but adding more is not acceptable. I.e. the adjustment, if any is needed (as I can't right away see how things would build if there really was such a dependency, and indeed neither .tmem.o.d nor .tmem_xen.o.d list any stdbool.h as dependencies), would be to replace uses of bool, true, and false (of which I can't find any in that header) by their canonical hypervisor variants.

Jan

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

#9 lore raw

PATCH 5/5 tmem: allow tmem to be disabled with Kconfig

In reply to Doug Goldstein

Wrap the various tmem functions with the Kconfig generated CONFIG_TMEM option allowing users to build Xen without tmem support.

---
CC: Keir Fraser <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>

---
 xen/arch/x86/hvm/hvm.c             |  4 ++++
 xen/arch/x86/x86_64/compat/entry.S |  4 ++++
 xen/arch/x86/x86_64/entry.S        |  4 ++++
 xen/common/Kconfig                 | 11 +++++++++++
 xen/common/Makefile                |  7 ++++---
 xen/include/xen/tmem.h             | 26 ++++++++++++++++++++++++++
 xen/include/xen/tmem_xen.h         | 11 +++++++++++
 7 files changed, 64 insertions(+), 3 deletions(-)
xen/arch/x86/hvm/hvm.c +4 -0
index 255a1d6..e05a4d9 100644
@@ -5311,6 +5311,10 @@ typedef unsigned long hvm_hypercall_t(
 #define compat_grant_table_op hvm_grant_table_op_compat32
 #define do_arch_1             paging_domctl_continuation
 
+#ifndef CONFIG_TMEM
+#define do_tmem_op do_ni_hypercall
+#endif
+
 static const struct {
     hvm_hypercall_t *native;
     hvm_hypercall_t *compat;
xen/arch/x86/x86_64/compat/entry.S +4 -0
index 927439d..5218f8a 100644
@@ -345,6 +345,10 @@ compat_crash_page_fault:
 #define compat_kexec_op do_ni_hypercall
 #endif
 
+#ifndef CONFIG_TMEM
+#define do_tmem_op do_ni_hypercall
+#endif
+
 #ifndef CONFIG_XENOPROF
 #define compat_xenoprof_op do_ni_hypercall
 #endif
xen/arch/x86/x86_64/entry.S +4 -0
index dd7f114..cab9763 100644
@@ -681,6 +681,10 @@ ENTRY(exception_table)
 #define do_kexec_op do_ni_hypercall
 #endif
 
+#ifndef CONFIG_TMEM
+#define do_tmem_op do_ni_hypercall
+#endif
+
 #ifndef CONFIG_XENOPROF
 #define do_xenoprof_op do_ni_hypercall
 #endif
xen/common/Kconfig +11 -0
index 8fbc46d..24eb60b 100644
@@ -87,6 +87,17 @@ config LATE_HWDOM
 
 	  If unsure, say N.
 
+# Enables transactional memory support
+config TMEM
+	bool "Transaction Memory Support"
+	default y
+	---help---
+	  fill me out
+
+config TMEM_COMPAT
+	bool
+	default y if COMPAT && TMEM
+
 # Adds support for Xenoprof
 config XENOPROF
 	def_bool y
xen/common/Makefile +4 -3
index 82625a5..8a3c87a 100644
@@ -49,8 +49,8 @@ obj-y += sysctl.o
 obj-y += tasklet.o
 obj-y += time.o
 obj-y += timer.o
-obj-y += tmem.o
-obj-y += tmem_xen.o
+obj-$(CONFIG_TMEM) += tmem.o
+obj-$(CONFIG_TMEM) += tmem_xen.o
 obj-y += trace.o
 obj-y += version.o
 obj-y += vm_event.o
@@ -65,7 +65,8 @@ obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4
 obj-$(perfc)       += perfc.o
 obj-$(crash_debug) += gdbstub.o
 
-obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o tmem_xen.o xlat.o)
+obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o xlat.o)
+obj-$(CONFIG_TMEM_COMPAT) += compat/tmem_xen.o
 
 subdir-$(CONFIG_X86) += hvm
 
xen/include/xen/tmem.h +26 -0
index 32a542a..414a14d 100644
@@ -11,9 +11,35 @@
 
 struct xen_sysctl_tmem_op;
 
+#ifdef CONFIG_TMEM
 extern int tmem_control(struct xen_sysctl_tmem_op *op);
 extern void tmem_destroy(void *);
 extern void *tmem_relinquish_pages(unsigned int, unsigned int);
 extern unsigned long tmem_freeable_pages(void);
+#else
+static inline int
+tmem_control(struct xen_sysctl_tmem_op *op)
+{
+    return -ENOSYS;
+}
+
+static inline void
+tmem_destroy(void *p)
+{
+    return;
+}
+
+static inline void *
+tmem_relinquish_pages(unsigned int x, unsigned int y)
+{
+    return NULL;
+}
+
+static inline unsigned long
+tmem_freeable_pages(void)
+{
+    return 0;
+}
+#endif /* CONFIG_TMEM */
 
 #endif /* __XEN_TMEM_H__ */
xen/include/xen/tmem_xen.h +11 -0
index b95bde9..33f75e0 100644
@@ -64,6 +64,7 @@ static inline bool_t tmem_shared_auth(void)
     return opt_tmem_shared_auth;
 }
 
+#ifdef CONFIG_TMEM
 extern bool_t opt_tmem;
 static inline bool_t tmem_enabled(void)
 {
@@ -74,6 +75,16 @@ static inline void tmem_disable(void)
 {
     opt_tmem = 0;
 }
+#else
+static inline bool_t tmem_enabled(void)
+{
+    return false;
+}
+
+static inline void tmem_disable(void)
+{
+}
+#endif /* CONFIG_TMEM */
 
 /*
  * Memory free page list management
Signature · 7 lines
2.4.10


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#10 lore raw

Re: [PATCH 5/5] tmem: allow tmem to be disabled with Kconfig

xen/arch/x86/hvm/hvm.c typedef unsigned long hvm_hypercall_t( · line 5316

Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 14.03.16 at 21:29, <[email protected]> wrote:
xen/arch/x86/hvm/hvm.c +3 -0
@@ -5311,6 +5311,10 @@ typedef unsigned long hvm_hypercall_t(
 #define compat_grant_table_op hvm_grant_table_op_compat32
 #define do_arch_1             paging_domctl_continuation
 
+#ifndef CONFIG_TMEM
+#define do_tmem_op do_ni_hypercall
+#endif

This being repeated in 3 places, wouldn't be better to put this in, say, xen/hypercall.h, next to the function declaration?

xen/common/Kconfig config LATE_HWDOM · line 92

Quoted 9 lines
xen/common/Kconfig +3 -0
@@ -87,6 +87,17 @@ config LATE_HWDOM
 
 	  If unsure, say N.
 
+# Enables transactional memory support
+config TMEM
+	bool "Transaction Memory Support"

I think it should be "Transactional" here too.

xen/common/Kconfig config LATE_HWDOM · line 93

Quoted 1 line
xen/common/Kconfig +1 -0
+	default y

No EXPERT dependency?

xen/common/Kconfig config LATE_HWDOM · line 95

Quoted 2 lines
xen/common/Kconfig +2 -0
+	---help---
+	  fill me out

Indeed.

xen/common/Kconfig config LATE_HWDOM · line 99

Quoted 3 lines
xen/common/Kconfig +3 -0
+config TMEM_COMPAT
+	bool
+	default y if COMPAT && TMEM

I don't see the need for such an extra symbol:

Quoted 14 lines
xen/common/Makefile +2 -2
@@ -49,8 +49,8 @@ obj-y += sysctl.o
 obj-y += tasklet.o
 obj-y += time.o
 obj-y += timer.o
-obj-y += tmem.o
-obj-y += tmem_xen.o
+obj-$(CONFIG_TMEM) += tmem.o
+obj-$(CONFIG_TMEM) += tmem_xen.o
 obj-y += trace.o
 obj-y += version.o
 obj-y += vm_event.o

xen/common/Makefile obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 · line 69

Quoted 6 lines
xen/common/Makefile +2 -1
@@ -65,7 +65,8 @@ obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4
 obj-$(perfc)       += perfc.o
 obj-$(crash_debug) += gdbstub.o
 
-obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o tmem_xen.o xlat.o)
+obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o xlat.o)
+obj-$(CONFIG_TMEM_COMPAT) += compat/tmem_xen.o

tmem-y := tmem.o tmem_xen.o
tmem-$(CONFIG_COMPAT) += compat/tmem_xen.o
obj-$(CONFIG_TMEM) += $(tmem-y)

or some such would have the same effect.

Jan

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

#11 lore raw

Re: [PATCH 5/5] tmem: allow tmem to be disabled with Kconfig

Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 14.03.16 at 21:29, <[email protected]> wrote:
xen/arch/x86/hvm/hvm.c +0 -0
@@ -5311,6 +5311,10 @@ typedef unsigned long hvm_hypercall_t(
 #define compat_grant_table_op hvm_grant_table_op_compat32
 #define do_arch_1             paging_domctl_continuation
 
Quoted 6 lines

xen/arch/x86/hvm/hvm.c typedef unsigned long hvm_hypercall_t( · line 5316

Quoted 3 lines
xen/arch/x86/hvm/hvm.c +3 -0
+#ifndef CONFIG_TMEM
+#define do_tmem_op do_ni_hypercall
+#endif

This being repeated in 3 places, wouldn't be better to put this in, say, xen/hypercall.h, next to the function declaration?

We can do this but I'd like to move the other ones from entry.S into here as well in a follow on then.

Signature · 1 line
Doug Goldstein

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

#12 lore raw

Re: [PATCH 5/5] tmem: allow tmem to be disabled with Kconfig

In reply to Jan Beulich
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 14.03.16 at 21:29, <[email protected]> wrote:
xen/arch/x86/hvm/hvm.c +0 -0
@@ -5311,6 +5311,10 @@ typedef unsigned long hvm_hypercall_t(
 #define compat_grant_table_op hvm_grant_table_op_compat32
 #define do_arch_1             paging_domctl_continuation
 
Quoted 7 lines

xen/arch/x86/hvm/hvm.c typedef unsigned long hvm_hypercall_t( · line 5316

Quoted 3 lines
xen/arch/x86/hvm/hvm.c +3 -0
+#ifndef CONFIG_TMEM
+#define do_tmem_op do_ni_hypercall
+#endif

This being repeated in 3 places, wouldn't be better to put this in, say, xen/hypercall.h, next to the function declaration?

Actually I tried this and it doesn't compile because that header isn't included. Including that header into the relevant files (entry.S) doesn't work either. Got a different suggestion?

Signature · 1 line
Doug Goldstein

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

#13 lore raw

Re: [PATCH 5/5] tmem: allow tmem to be disabled with Kconfig

Quoted 16 lines
Quoted 1 line
Quoted 1 line · On 15.03.16 at 20:04, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 14.03.16 at 21:29, <[email protected]> wrote:
xen/arch/x86/hvm/hvm.c +0 -0
@@ -5311,6 +5311,10 @@ typedef unsigned long hvm_hypercall_t(
 #define compat_grant_table_op hvm_grant_table_op_compat32
 #define do_arch_1             paging_domctl_continuation
 
Quoted 6 lines

xen/arch/x86/hvm/hvm.c typedef unsigned long hvm_hypercall_t( · line 5316

Quoted 3 lines
xen/arch/x86/hvm/hvm.c +3 -0
+#ifndef CONFIG_TMEM
+#define do_tmem_op do_ni_hypercall
+#endif

This being repeated in 3 places, wouldn't be better to put this in, say, xen/hypercall.h, next to the function declaration?

Quoted 3 lines

Actually I tried this and it doesn't compile because that header isn't included. Including that header into the relevant files (entry.S) doesn't work either. Got a different suggestion?

Well, if the header can't be used in assembly files, so be it (for now at least, as mentioned by Andrew on IRC). But this then still calls for the #define to go into the header for the C source(s) sake.

Jan

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

Reviewed-by on the v1 series
#14 lore raw
In reply to Doug Goldstein
Quoted 5 lines · Doug Goldstein

First swag at allowing tmem to be disabled via Kconfig. I've only build tested this first version because I expect a bunch of feedback that will necessitate changes and then v2 will hopefully be worth testing. The first 4 patches can go in regardless of the final patch and are really just cleanups.

Let me first run them through regression bucket before commiting.

Thank you!

Quoted 8 lines

Doug Goldstein (5):
tmem: add tmem_disable() function
tmem: drop direct usage of opt_tmem
tmem: make tmem_freeable_pages() check tmem status
tmem: don't assume stdbool.h is included
tmem: allow tmem to be disabled with Kconfig

Quoted 21 lines
 xen/arch/x86/hvm/hvm.c             |  4 ++++
 xen/arch/x86/setup.c               |  6 +++---
 xen/arch/x86/x86_64/compat/entry.S |  4 ++++
 xen/arch/x86/x86_64/entry.S        |  4 ++++
 xen/common/Kconfig                 | 11 +++++++++++
 xen/common/Makefile                |  7 ++++---
 xen/common/memory.c                |  2 +-
 xen/common/page_alloc.c            |  8 ++++----
 xen/common/tmem.c                  |  3 +++
 xen/include/xen/tmem.h             | 26 ++++++++++++++++++++++++++
 xen/include/xen/tmem_xen.h         | 17 +++++++++++++++++
 11 files changed, 81 insertions(+), 11 deletions(-)
Signature · 7 lines
2.4.10


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

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