linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@ozlabs.org>
To: linuxppc-dev@ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org
Subject: [PATCH 05/18] powerpc/64: More definitions for POWER9
Date: Thu, 12 Jan 2017 20:07:13 +1100	[thread overview]
Message-ID: <1484212046-29591-6-git-send-email-paulus@ozlabs.org> (raw)
In-Reply-To: <1484212046-29591-1-git-send-email-paulus@ozlabs.org>

This adds definitions for bits in the DSISR register which are used
by POWER9 for various translation-related exception conditions, and
for some more bits in the partition table entry that will be needed
by KVM.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
---
 arch/powerpc/include/asm/book3s/64/mmu.h | 12 +++++++++++-
 arch/powerpc/include/asm/reg.h           |  4 ++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h b/arch/powerpc/include/asm/book3s/64/mmu.h
index e8cbdc0..d827825 100644
--- a/arch/powerpc/include/asm/book3s/64/mmu.h
+++ b/arch/powerpc/include/asm/book3s/64/mmu.h
@@ -44,10 +44,20 @@ struct patb_entry {
 };
 extern struct patb_entry *partition_tb;
 
+/* Bits in patb0 field */
 #define PATB_HR		(1UL << 63)
-#define PATB_GR		(1UL << 63)
 #define RPDB_MASK	0x0ffffffffffff00fUL
 #define RPDB_SHIFT	(1UL << 8)
+#define RTS1_SHIFT	61		/* top 2 bits of radix tree size */
+#define RTS1_MASK	(3UL << RTS1_SHIFT)
+#define RTS2_SHIFT	5		/* bottom 3 bits of radix tree size */
+#define RTS2_MASK	(7UL << RTS2_SHIFT)
+#define RPDS_MASK	0x1f		/* root page dir. size field */
+
+/* Bits in patb1 field */
+#define PATB_GR		(1UL << 63)	/* guest uses radix; must match HR */
+#define PRTS_MASK	0x1f		/* process table size field */
+
 /*
  * Limit process table to PAGE_SIZE table. This
  * also limit the max pid we can support.
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 0d4531a..aa44a83 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -274,10 +274,14 @@
 #define SPRN_DSISR	0x012	/* Data Storage Interrupt Status Register */
 #define   DSISR_NOHPTE		0x40000000	/* no translation found */
 #define   DSISR_PROTFAULT	0x08000000	/* protection fault */
+#define   DSISR_BADACCESS	0x04000000	/* bad access to CI or G */
 #define   DSISR_ISSTORE		0x02000000	/* access was a store */
 #define   DSISR_DABRMATCH	0x00400000	/* hit data breakpoint */
 #define   DSISR_NOSEGMENT	0x00200000	/* SLB miss */
 #define   DSISR_KEYFAULT	0x00200000	/* Key fault */
+#define   DSISR_UNSUPP_MMU	0x00080000	/* Unsupported MMU config */
+#define   DSISR_SET_RC		0x00040000	/* Failed setting of R/C bits */
+#define   DSISR_PGDIRFAULT      0x00020000      /* Fault on page directory */
 #define SPRN_TBRL	0x10C	/* Time Base Read Lower Register (user, R/O) */
 #define SPRN_TBRU	0x10D	/* Time Base Read Upper Register (user, R/O) */
 #define SPRN_CIR	0x11B	/* Chip Information Register (hyper, R/0) */
-- 
2.7.4

  parent reply	other threads:[~2017-01-12  9:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12  9:07 [PATCH 00/18] Support for radix guest and host on POWER9 Paul Mackerras
2017-01-12  9:07 ` [PATCH 01/18] powerpc/64: Don't try to use radix MMU under a hypervisor Paul Mackerras
2017-01-12 16:48   ` Balbir Singh
2017-01-12  9:07 ` [PATCH 02/18] powerpc/64: Fixes for the ibm, client-architecture-support options Paul Mackerras
2017-01-12  9:07 ` [PATCH 03/18] powerpc/64: Always enable radix support for 64-bit Book 3S kernels Paul Mackerras
2017-01-12  9:07 ` [PATCH 04/18] powerpc/64: Enable use of radix MMU under hypervisor on POWER9 Paul Mackerras
2017-01-22  2:17   ` kbuild test robot
2017-01-12  9:07 ` Paul Mackerras [this message]
2017-01-12  9:07 ` [PATCH 06/18] powerpc/64: Export pgtable_cache and pgtable_cache_add for KVM Paul Mackerras
2017-01-12  9:07 ` [PATCH 07/18] powerpc/64: Make type of partition table flush depend on partition type Paul Mackerras
2017-01-12  9:07 ` [PATCH 08/18] KVM: PPC: Book3S HV: Don't try to signal cpu -1 Paul Mackerras
2017-01-12  9:07 ` [PATCH 09/18] KVM: PPC: Book3S HV: Add userspace interfaces for POWER9 MMU Paul Mackerras
2017-01-12  9:07 ` [PATCH 10/18] KVM: PPC: Book3S HV: Set process table for HPT guests on POWER9 Paul Mackerras
2017-01-23  2:39   ` Suraj Jitindar Singh
2017-01-23  4:37     ` Paul Mackerras
2017-01-12  9:07 ` [PATCH 11/18] KVM: PPC: Book3S HV: Add basic infrastructure for radix guests Paul Mackerras
2017-01-12  9:07 ` [PATCH 12/18] KVM: PPC: Book3S HV: Modify guest entry/exit paths to handle " Paul Mackerras
2017-01-12  9:07 ` [PATCH 13/18] KVM: PPC: Book3S HV: Page table construction and page faults for " Paul Mackerras
2017-01-23  3:17   ` Suraj Jitindar Singh
2017-01-23  4:38     ` Paul Mackerras
2017-01-12  9:07 ` [PATCH 14/18] KVM: PPC: Book3S HV: MMU notifier callbacks " Paul Mackerras
2017-01-23  3:21   ` Suraj Jitindar Singh
2017-01-12  9:07 ` [PATCH 15/18] KVM: PPC: Book3S HV: Implement dirty page logging " Paul Mackerras
2017-01-12  9:07 ` [PATCH 16/18] KVM: PPC: Book3S HV: Make HPT-specific hypercalls return error in radix mode Paul Mackerras
2017-01-12  9:07 ` [PATCH 17/18] KVM: PPC: Book3S HV: Enable radix guest support Paul Mackerras
2017-01-23  3:31   ` Suraj Jitindar Singh
2017-01-12  9:07 ` [PATCH 18/18] KVM: PPC: Book3S HV: Use ASDR for HPT guests on POWER9 Paul Mackerras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484212046-29591-6-git-send-email-paulus@ozlabs.org \
    --to=paulus@ozlabs.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).