linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc: Add HFSCR SPR definitions
  2013-03-06  2:15 [PATCH 0/2] powerpc: HFSCR enablement " Michael Neuling
@ 2013-03-06  2:15 ` Michael Neuling
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Neuling @ 2013-03-06  2:15 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Michael Neuling, linuxppc-dev

Add SPR number and bit definitions for the HFSCR (Hypervisor Facility Status
and Control Register).

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/include/asm/reg.h |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index c9c67fc..4ae2d44 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -268,6 +268,12 @@
 #define SPRN_FSCR	0x099	/* Facility Status & Control Register */
 #define   FSCR_TAR	(1 << (63-55)) /* Enable Target Address Register */
 #define   FSCR_DSCR	(1 << (63-61)) /* Enable Data Stream Control Register */
+#define SPRN_HFSCR	0xbe	/* HV=1 Facility Status & Control Register */
+#define   HFSCR_TAR	(1 << (63-55)) /* Enable Target Address Register */
+#define   HFSCR_TM	(1 << (63-58)) /* Enable Transactional Memory */
+#define   HFSCR_DSCR	(1 << (63-61)) /* Enable Data Stream Control Register */
+#define   HFSCR_VECVSX	(1 << (63-62)) /* Enable VMX/VSX  */
+#define   HFSCR_FP	(1 << (63-63)) /* Enable Floating Point */
 #define SPRN_TAR	0x32f	/* Target Address Register */
 #define SPRN_LPCR	0x13E	/* LPAR Control Register */
 #define   LPCR_VPM0	(1ul << (63-0))
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 0/2] powerpc: HFSCR enablement for POWER8
@ 2013-03-06  3:35 Michael Neuling
  2013-03-06  3:35 ` [PATCH 1/2] powerpc: Add HFSCR SPR definitions Michael Neuling
  2013-03-06  3:35 ` [PATCH 2/2] powerpc: Setup in HFSCR for POWER8 Michael Neuling
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Neuling @ 2013-03-06  3:35 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Michael Neuling, linuxppc-dev

Benh, 

This small series adds support for the HFSCR (Hypervisor Facility Status &
Control Register) in POWER8.  It just sets the bits we know about at this
stage.  This is useful only when MSR HV=1.

The HFSCR is the same as the FSCR except it's for hypervisors.  It controls the
available of various facilities in OS and userspace levels.  It also indicates
the cause of a hypervisor facility unavailable interrupt (although we are not
using this here).

v2:
  Make description of the HFSCR more verbose as suggested by benh.

Mikey

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] powerpc: Add HFSCR SPR definitions
  2013-03-06  3:35 [PATCH 0/2] powerpc: HFSCR enablement for POWER8 Michael Neuling
@ 2013-03-06  3:35 ` Michael Neuling
  2013-03-06  3:35 ` [PATCH 2/2] powerpc: Setup in HFSCR for POWER8 Michael Neuling
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Neuling @ 2013-03-06  3:35 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Michael Neuling, linuxppc-dev

Add SPR number and bit definitions for the HFSCR (Hypervisor Facility Status
and Control Register).

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/include/asm/reg.h |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index c9c67fc..4ae2d44 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -268,6 +268,12 @@
 #define SPRN_FSCR	0x099	/* Facility Status & Control Register */
 #define   FSCR_TAR	(1 << (63-55)) /* Enable Target Address Register */
 #define   FSCR_DSCR	(1 << (63-61)) /* Enable Data Stream Control Register */
+#define SPRN_HFSCR	0xbe	/* HV=1 Facility Status & Control Register */
+#define   HFSCR_TAR	(1 << (63-55)) /* Enable Target Address Register */
+#define   HFSCR_TM	(1 << (63-58)) /* Enable Transactional Memory */
+#define   HFSCR_DSCR	(1 << (63-61)) /* Enable Data Stream Control Register */
+#define   HFSCR_VECVSX	(1 << (63-62)) /* Enable VMX/VSX  */
+#define   HFSCR_FP	(1 << (63-63)) /* Enable Floating Point */
 #define SPRN_TAR	0x32f	/* Target Address Register */
 #define SPRN_LPCR	0x13E	/* LPAR Control Register */
 #define   LPCR_VPM0	(1ul << (63-0))
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] powerpc: Setup in HFSCR for POWER8
  2013-03-06  3:35 [PATCH 0/2] powerpc: HFSCR enablement for POWER8 Michael Neuling
  2013-03-06  3:35 ` [PATCH 1/2] powerpc: Add HFSCR SPR definitions Michael Neuling
@ 2013-03-06  3:35 ` Michael Neuling
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Neuling @ 2013-03-06  3:35 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Michael Neuling, linuxppc-dev

Setup the HFSCR (Hypervisor Facility Status and Control Register) for POWER8
when running HV=1.  The HFSCR is the same as the FSCR except it's for
hypervisors.  It controls the available of various facilities in OS and
userspace levels.  It also indicates the cause of a hypervisor facility
unavailable interrupt (although we are not using this here).

This patch sets the facilities Linux knows about incase the firmware doesn't.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/kernel/cpu_setup_power.S |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/kernel/cpu_setup_power.S b/arch/powerpc/kernel/cpu_setup_power.S
index ea847ab..2e6ad11 100644
--- a/arch/powerpc/kernel/cpu_setup_power.S
+++ b/arch/powerpc/kernel/cpu_setup_power.S
@@ -57,6 +57,7 @@ _GLOBAL(__setup_cpu_power8)
 	mfspr	r3,SPRN_LPCR
 	oris	r3, r3, LPCR_AIL_3@h
 	bl	__init_LPCR
+	bl	__init_HFSCR
 	bl	__init_TLB
 	mtlr	r11
 	blr
@@ -72,6 +73,7 @@ _GLOBAL(__restore_cpu_power8)
 	mfspr   r3,SPRN_LPCR
 	oris	r3, r3, LPCR_AIL_3@h
 	bl	__init_LPCR
+	bl	__init_HFSCR
 	bl	__init_TLB
 	mtlr	r11
 	blr
@@ -120,6 +122,12 @@ __init_FSCR:
 	mtspr	SPRN_FSCR,r3
 	blr
 
+__init_HFSCR:
+	mfspr	r3,SPRN_HFSCR
+	ori	r3,r3,HFSCR_TAR|HFSCR_TM|HFSCR_DSCR|HFSCR_VECVSX|HFSCR_FP
+	mtspr	SPRN_HFSCR,r3
+	blr
+
 __init_TLB:
 	/* Clear the TLB */
 	li	r6,128
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-06  3:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-06  3:35 [PATCH 0/2] powerpc: HFSCR enablement for POWER8 Michael Neuling
2013-03-06  3:35 ` [PATCH 1/2] powerpc: Add HFSCR SPR definitions Michael Neuling
2013-03-06  3:35 ` [PATCH 2/2] powerpc: Setup in HFSCR for POWER8 Michael Neuling
  -- strict thread matches above, loose matches on Subject: below --
2013-03-06  2:15 [PATCH 0/2] powerpc: HFSCR enablement " Michael Neuling
2013-03-06  2:15 ` [PATCH 1/2] powerpc: Add HFSCR SPR definitions Michael Neuling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).