aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/reg.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2013-09-20 00:52:38 -0400
committerAlexander Graf <agraf@suse.de>2013-10-17 08:45:01 -0400
commita0144e2a6b0b4a137a32f0102354782547bf0935 (patch)
treeafc87f1baa02328aaf7a66209ad1d96aef4e533c /arch/powerpc/include/asm/reg.h
parent8b75cbbe647603f2b3c17ead35ee3cefa88397e7 (diff)
KVM: PPC: Book3S HV: Store LPCR value for each virtual core
This adds the ability to have a separate LPCR (Logical Partitioning Control Register) value relating to a guest for each virtual core, rather than only having a single value for the whole VM. This corresponds to what real POWER hardware does, where there is a LPCR per CPU thread but most of the fields are required to have the same value on all active threads in a core. The per-virtual-core LPCR can be read and written using the GET/SET_ONE_REG interface. Userspace can can only modify the following fields of the LPCR value: DPFD Default prefetch depth ILE Interrupt little-endian TC Translation control (secondary HPT hash group search disable) We still maintain a per-VM default LPCR value in kvm->arch.lpcr, which contains bits relating to memory management, i.e. the Virtualized Partition Memory (VPM) bits and the bits relating to guest real mode. When this default value is updated, the update needs to be propagated to the per-vcore values, so we add a kvmppc_update_lpcr() helper to do that. Signed-off-by: Paul Mackerras <paulus@samba.org> [agraf: fix whitespace] Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/include/asm/reg.h')
-rw-r--r--arch/powerpc/include/asm/reg.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index fd4db15e6f2a..4bec4df3fb98 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -284,6 +284,7 @@
284#define LPCR_ISL (1ul << (63-2)) 284#define LPCR_ISL (1ul << (63-2))
285#define LPCR_VC_SH (63-2) 285#define LPCR_VC_SH (63-2)
286#define LPCR_DPFD_SH (63-11) 286#define LPCR_DPFD_SH (63-11)
287#define LPCR_DPFD (7ul << LPCR_DPFD_SH)
287#define LPCR_VRMASD (0x1ful << (63-16)) 288#define LPCR_VRMASD (0x1ful << (63-16))
288#define LPCR_VRMA_L (1ul << (63-12)) 289#define LPCR_VRMA_L (1ul << (63-12))
289#define LPCR_VRMA_LP0 (1ul << (63-15)) 290#define LPCR_VRMA_LP0 (1ul << (63-15))
@@ -300,6 +301,7 @@
300#define LPCR_PECE2 0x00001000 /* machine check etc can cause exit */ 301#define LPCR_PECE2 0x00001000 /* machine check etc can cause exit */
301#define LPCR_MER 0x00000800 /* Mediated External Exception */ 302#define LPCR_MER 0x00000800 /* Mediated External Exception */
302#define LPCR_MER_SH 11 303#define LPCR_MER_SH 11
304#define LPCR_TC 0x00000200 /* Translation control */
303#define LPCR_LPES 0x0000000c 305#define LPCR_LPES 0x0000000c
304#define LPCR_LPES0 0x00000008 /* LPAR Env selector 0 */ 306#define LPCR_LPES0 0x00000008 /* LPAR Env selector 0 */
305#define LPCR_LPES1 0x00000004 /* LPAR Env selector 1 */ 307#define LPCR_LPES1 0x00000004 /* LPAR Env selector 1 */
@@ -421,6 +423,7 @@
421#define HID4_RMLS2_SH (63 - 2) /* Real mode limit bottom 2 bits */ 423#define HID4_RMLS2_SH (63 - 2) /* Real mode limit bottom 2 bits */
422#define HID4_LPID5_SH (63 - 6) /* partition ID bottom 4 bits */ 424#define HID4_LPID5_SH (63 - 6) /* partition ID bottom 4 bits */
423#define HID4_RMOR_SH (63 - 22) /* real mode offset (16 bits) */ 425#define HID4_RMOR_SH (63 - 22) /* real mode offset (16 bits) */
426#define HID4_RMOR (0xFFFFul << HID4_RMOR_SH)
424#define HID4_LPES1 (1 << (63-57)) /* LPAR env. sel. bit 1 */ 427#define HID4_LPES1 (1 << (63-57)) /* LPAR env. sel. bit 1 */
425#define HID4_RMLS0_SH (63 - 58) /* Real mode limit top bit */ 428#define HID4_RMLS0_SH (63 - 58) /* Real mode limit top bit */
426#define HID4_LPID1_SH 0 /* partition ID top 2 bits */ 429#define HID4_LPID1_SH 0 /* partition ID top 2 bits */