powerpc/pseries: Use macros for referring to the DTL enable mask
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Wed, 3 Jul 2019 17:03:54 +0000 (22:33 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 4 Jul 2019 12:20:47 +0000 (22:20 +1000)
Introduce macros to encode the DTL enable mask fields and use those
instead of hardcoding numbers.

Acked-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/lppaca.h
arch/powerpc/platforms/pseries/dtl.c
arch/powerpc/platforms/pseries/lpar.c
arch/powerpc/platforms/pseries/setup.c

index 7c23ce8a5a4c4fd405577e54a3b537fb14852ed7..2c7e31187726f46f3f888117bb94a330e773cd20 100644 (file)
@@ -154,6 +154,17 @@ struct dtl_entry {
 #define DISPATCH_LOG_BYTES     4096    /* bytes per cpu */
 #define N_DISPATCH_LOG         (DISPATCH_LOG_BYTES / sizeof(struct dtl_entry))
 
+/*
+ * Dispatch trace log event enable mask:
+ *   0x1: voluntary virtual processor waits
+ *   0x2: time-slice preempts
+ *   0x4: virtual partition memory page faults
+ */
+#define DTL_LOG_CEDE           0x1
+#define DTL_LOG_PREEMPT                0x2
+#define DTL_LOG_FAULT          0x4
+#define DTL_LOG_ALL            (DTL_LOG_CEDE | DTL_LOG_PREEMPT | DTL_LOG_FAULT)
+
 extern struct kmem_cache *dtl_cache;
 
 /*
index ef6595153642e3af4b5f52b300cbb3dd7d6b6d1f..051ea2de1e1a0e12d7bb53c264f74262a009dd70 100644 (file)
@@ -40,13 +40,7 @@ struct dtl {
 };
 static DEFINE_PER_CPU(struct dtl, cpu_dtl);
 
-/*
- * Dispatch trace log event mask:
- * 0x7: 0x1: voluntary virtual processor waits
- *      0x2: time-slice preempts
- *      0x4: virtual partition memory page faults
- */
-static u8 dtl_event_mask = 0x7;
+static u8 dtl_event_mask = DTL_LOG_ALL;
 
 
 /*
index 1034ef1fe2b454bc9199cdff229712474068712b..23f2ac6793b7a453cd101a4ad357b2558c59a865 100644 (file)
@@ -126,7 +126,7 @@ void vpa_init(int cpu)
                        pr_err("WARNING: DTL registration of cpu %d (hw %d) "
                               "failed with %ld\n", smp_processor_id(),
                               hwcpu, ret);
-               lppaca_of(cpu).dtl_enable_mask = 2;
+               lppaca_of(cpu).dtl_enable_mask = DTL_LOG_PREEMPT;
        }
 }
 
index 30d72b587ac59828e3b6ebbe7556c107fceca010..e2cb29e96fa425f1e13436bc3cc7b90c0b64439b 100644 (file)
@@ -318,7 +318,7 @@ static int alloc_dispatch_logs(void)
                pr_err("WARNING: DTL registration of cpu %d (hw %d) failed "
                       "with %d\n", smp_processor_id(),
                       hard_smp_processor_id(), ret);
-       get_paca()->lppaca_ptr->dtl_enable_mask = 2;
+       get_paca()->lppaca_ptr->dtl_enable_mask = DTL_LOG_PREEMPT;
 
        return 0;
 }