Skip to contentSkip to conversation

xenoprof: drop necessary macro

PATCH Superseded Doug Goldstein 2 participants 3 messages Feb 22, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xenoprof: drop necessary macro

This macro doesn't really provide a benefit. When support is added the implementer can implement this how it needs to be and not conform to the macro.

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

1) I'm not partial to this patch. Feel free to NACK it.
2) The first white space chunk is intentional just as a clean up.

---
 xen/common/xenoprof.c          | 7 +++++--
 xen/include/asm-x86/xenoprof.h | 8 --------
 2 files changed, 5 insertions(+), 10 deletions(-)
xen/common/xenoprof.c +5 -2
index 7a3fc86..53f6d4a 100644
@@ -177,11 +177,14 @@ xenoprof_shared_gmfn_with_guest(
     struct domain *d, unsigned long maddr, unsigned long gmaddr, int npages)
 {
     int i;
-    
+
     for ( i = 0; i < npages; i++, maddr += PAGE_SIZE, gmaddr += PAGE_SIZE )
     {
         BUG_ON(page_get_owner(maddr_to_page(maddr)) != d);
-        xenoprof_shared_gmfn(d, gmaddr, maddr);
+        gdprintk(XENLOG_WARNING,
+                 "xenoprof/x86 with autotranslated mode enabled"
+                 "isn't supported yet\n");
+
     }
 }
 
xen/include/asm-x86/xenoprof.h +0 -8
index dca4223..3a1b001 100644
@@ -62,14 +62,6 @@ static inline int xenoprof_backtrace_supported(void)
 void xenoprof_backtrace(struct vcpu *, const struct cpu_user_regs *,
                         unsigned long depth, int mode);
 
-#define xenoprof_shared_gmfn(d, gmaddr, maddr)                      \
-    do {                                                            \
-        (void)(maddr);                                              \
-        gdprintk(XENLOG_WARNING,                                    \
-                 "xenoprof/x86 with autotranslated mode enabled"    \
-                 "isn't supported yet\n");                          \
-    } while (0)
-
 int passive_domain_do_rdmsr(unsigned int msr, uint64_t *msr_content);
 int passive_domain_do_wrmsr(unsigned int msr, uint64_t msr_content);
 void passive_domain_destroy(struct vcpu *v);
Signature · 1 line
2.4.10
#2 lore raw
In reply to Doug Goldstein
Quoted 4 lines · Doug Goldstein

This macro doesn't really provide a benefit. When support is added the implementer can implement this how it needs to be and not conform to the macro.

Quoted 8 lines

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

1) I'm not partial to this patch. Feel free to NACK it.
2) The first white space chunk is intentional just as a clean up.

Whitespace fixup like this is fine if you make passing reference to it in the commit message "e.g. While editing this area, drop trailing whitespace".

Quoted 12 lines
---
 xen/common/xenoprof.c          | 7 +++++--
 xen/include/asm-x86/xenoprof.h | 8 --------
 2 files changed, 5 insertions(+), 10 deletions(-)
xen/common/xenoprof.c +0 -0
index 7a3fc86..53f6d4a 100644
@@ -177,11 +177,14 @@ xenoprof_shared_gmfn_with_guest(
     struct domain *d, unsigned long maddr, unsigned long gmaddr, int npages)
 {

xen/common/xenoprof.c xenoprof_shared_gmfn_with_guest( · line 186

Quoted 10 lines
xen/common/xenoprof.c +4 -2
     int i;
-    
+
     for ( i = 0; i < npages; i++, maddr += PAGE_SIZE, gmaddr += PAGE_SIZE )
     {
         BUG_ON(page_get_owner(maddr_to_page(maddr)) != d);
-        xenoprof_shared_gmfn(d, gmaddr, maddr);
+        gdprintk(XENLOG_WARNING,
+                 "xenoprof/x86 with autotranslated mode enabled"
+                 "isn't supported yet\n");

Contrary to the usual 80 character rule, we prefer not splitting strings like this, for grepability.

However, I would recommend shortening it to something like "xenoprof unsupported with autotranslated guests".

Also as a bugfix, please put it in an "if ( i == 0 )" conditional, so we don't get npages identical warning messages at once.

~Andrew

Quoted 23 lines
xen/common/xenoprof.c +1 -0
+
     }
 }
 
xen/include/asm-x86/xenoprof.h +0 -8
index dca4223..3a1b001 100644
@@ -62,14 +62,6 @@ static inline int xenoprof_backtrace_supported(void)
 void xenoprof_backtrace(struct vcpu *, const struct cpu_user_regs *,
                         unsigned long depth, int mode);
 
-#define xenoprof_shared_gmfn(d, gmaddr, maddr)                      \
-    do {                                                            \
-        (void)(maddr);                                              \
-        gdprintk(XENLOG_WARNING,                                    \
-                 "xenoprof/x86 with autotranslated mode enabled"    \
-                 "isn't supported yet\n");                          \
-    } while (0)
-
 int passive_domain_do_rdmsr(unsigned int msr, uint64_t *msr_content);
 int passive_domain_do_wrmsr(unsigned int msr, uint64_t msr_content);
 void passive_domain_destroy(struct vcpu *v);