[RFC PATCH v0 1/5] powerpc: Define Expropriation interrupt bit to VPA byte offset 0xB9
Bharata B Rao
bharata at linux.ibm.com
Thu Aug 5 17:24:35 AEST 2021
VPA byte offset 0xB9 was named as donate_dedicated_cpu as that
was the only used bit. The Expropriation/Subvention support defines
a bit in byte offset 0xB9. Define this bit and rename the field
in VPA to a generic name.
Signed-off-by: Bharata B Rao <bharata at linux.ibm.com>
---
arch/powerpc/include/asm/lppaca.h | 8 +++++++-
drivers/cpuidle/cpuidle-pseries.c | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/include/asm/lppaca.h b/arch/powerpc/include/asm/lppaca.h
index c390ec377bae..57e432766f3e 100644
--- a/arch/powerpc/include/asm/lppaca.h
+++ b/arch/powerpc/include/asm/lppaca.h
@@ -80,7 +80,7 @@ struct lppaca {
u8 ebb_regs_in_use;
u8 reserved7[6];
u8 dtl_enable_mask; /* Dispatch Trace Log mask */
- u8 donate_dedicated_cpu; /* Donate dedicated CPU cycles */
+ u8 byte_b9; /* Donate dedicated CPU cycles & Expropriation int */
u8 fpregs_in_use;
u8 pmcregs_in_use;
u8 reserved8[28];
@@ -116,6 +116,12 @@ struct lppaca {
#define lppaca_of(cpu) (*paca_ptrs[cpu]->lppaca_ptr)
+/*
+ * Flags for Byte offset 0xB9
+ */
+#define LPPACA_DONATE_DED_CPU_CYCLES 0x1
+#define LPPACA_EXP_INT_ENABLED 0x2
+
/*
* We are using a non architected field to determine if a partition is
* shared or dedicated. This currently works on both KVM and PHYP, but
diff --git a/drivers/cpuidle/cpuidle-pseries.c b/drivers/cpuidle/cpuidle-pseries.c
index a2b5c6f60cf0..b9d0f41c3f19 100644
--- a/drivers/cpuidle/cpuidle-pseries.c
+++ b/drivers/cpuidle/cpuidle-pseries.c
@@ -221,7 +221,7 @@ static int dedicated_cede_loop(struct cpuidle_device *dev,
u8 old_latency_hint;
pseries_idle_prolog();
- get_lppaca()->donate_dedicated_cpu = 1;
+ get_lppaca()->byte_b9 |= LPPACA_DONATE_DED_CPU_CYCLES;
old_latency_hint = get_lppaca()->cede_latency_hint;
get_lppaca()->cede_latency_hint = cede_latency_hint[index];
@@ -229,7 +229,7 @@ static int dedicated_cede_loop(struct cpuidle_device *dev,
check_and_cede_processor();
local_irq_disable();
- get_lppaca()->donate_dedicated_cpu = 0;
+ get_lppaca()->byte_b9 &= ~LPPACA_DONATE_DED_CPU_CYCLES;
get_lppaca()->cede_latency_hint = old_latency_hint;
pseries_idle_epilog();
--
2.31.1
More information about the Linuxppc-dev
mailing list