From: Michael Neuling <mikey@neuling.org>
To: mpe@ellerman.id.au, benh@kernel.crashing.org
Cc: imunsie@au.ibm.com, linuxppc-dev@ozlabs.org, mikey@neuling.org,
Daniel Axtens <dja@axtens.net>,
"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>,
"Manoj N. Kumar" <manoj@linux.vnet.ibm.com>,
brking@linux.vnet.ibm.com
Subject: [PATCH v2 01/21] powerpc/copro: Fix faulting kernel segments
Date: Tue, 26 May 2015 10:19:58 +1000 [thread overview]
Message-ID: <1432599618-26844-2-git-send-email-mikey@neuling.org> (raw)
In-Reply-To: <1432599618-26844-1-git-send-email-mikey@neuling.org>
This fixes calculating the key bits (KP and KS) in the SLB VSID for kernel
mappings.
I'm not CCing this to stable as there are no uses of this currently.
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
arch/powerpc/mm/copro_fault.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/mm/copro_fault.c b/arch/powerpc/mm/copro_fault.c
index f031a47..7a71d7f 100644
--- a/arch/powerpc/mm/copro_fault.c
+++ b/arch/powerpc/mm/copro_fault.c
@@ -100,7 +100,7 @@ EXPORT_SYMBOL_GPL(copro_handle_mm_fault);
int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
{
- u64 vsid;
+ u64 vsid, vsidkey;
int psize, ssize;
switch (REGION_ID(ea)) {
@@ -109,6 +109,7 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
psize = get_slice_psize(mm, ea);
ssize = user_segment_size(ea);
vsid = get_vsid(mm->context.id, ea, ssize);
+ vsidkey = SLB_VSID_USER;
break;
case VMALLOC_REGION_ID:
pr_devel("%s: 0x%llx -- VMALLOC_REGION_ID\n", __func__, ea);
@@ -118,19 +119,21 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
psize = mmu_io_psize;
ssize = mmu_kernel_ssize;
vsid = get_kernel_vsid(ea, mmu_kernel_ssize);
+ vsidkey = SLB_VSID_KERNEL;
break;
case KERNEL_REGION_ID:
pr_devel("%s: 0x%llx -- KERNEL_REGION_ID\n", __func__, ea);
psize = mmu_linear_psize;
ssize = mmu_kernel_ssize;
vsid = get_kernel_vsid(ea, mmu_kernel_ssize);
+ vsidkey = SLB_VSID_KERNEL;
break;
default:
pr_debug("%s: invalid region access at %016llx\n", __func__, ea);
return 1;
}
- vsid = (vsid << slb_vsid_shift(ssize)) | SLB_VSID_USER;
+ vsid = (vsid << slb_vsid_shift(ssize)) | vsidkey;
vsid |= mmu_psize_defs[psize].sllp |
((ssize == MMU_SEGSIZE_1T) ? SLB_VSID_B_1T : 0);
--
2.1.0
next prev parent reply other threads:[~2015-05-26 0:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-26 0:19 [PATCH v2 00/21] cxl: Add AFU virtual PHB and in kernel API Michael Neuling
2015-05-26 0:19 ` Michael Neuling [this message]
2015-05-26 0:19 ` [PATCH v2 02/21] powerpc/pci: Export symbols for CXL Michael Neuling
2015-05-26 0:20 ` [PATCH v2 03/21] powerpc/pci: Add release_device() hook to phb ops Michael Neuling
2015-05-26 0:20 ` [PATCH v2 04/21] powerpc: Add cxl context to device archdata Michael Neuling
2015-05-26 0:20 ` [PATCH v2 05/21] powerpc/pci: Add shutdown hook to pci_controller_ops Michael Neuling
2015-05-26 0:20 ` [PATCH v2 06/21] cxl: Document external user of existing API Michael Neuling
2015-05-26 0:20 ` [PATCH v2 07/21] cxl: Add shutdown hook Michael Neuling
2015-05-26 0:20 ` [PATCH v2 08/21] cxl: Re-order card init to check the VSEC earlier Michael Neuling
2015-05-26 0:20 ` [PATCH v2 09/21] cxl: Dump debug info on the AFU configuration record Michael Neuling
2015-05-26 0:20 ` [PATCH v2 10/21] cxl: Add cookie parameter to afu_release_irqs() Michael Neuling
2015-05-26 0:20 ` [PATCH v2 11/21] cxl: Rework detach context functions Michael Neuling
2015-05-26 0:20 ` [PATCH v2 12/21] cxl: cxl_afu_reset() -> __cxl_afu_reset() Michael Neuling
2015-05-26 0:20 ` [PATCH v2 13/21] cxl: Export some symbols Michael Neuling
2015-05-26 0:20 ` [PATCH v2 14/21] cxl: Only check pid for userspace contexts Michael Neuling
2015-05-26 0:20 ` [PATCH v2 15/21] cxl: Split afu_register_irqs() function Michael Neuling
2015-05-26 0:20 ` [PATCH v2 16/21] cxl: Configure PSL for kernel contexts and merge code Michael Neuling
2015-05-26 0:20 ` [PATCH v2 17/21] cxl: Rework context lifetimes Michael Neuling
2015-05-26 0:20 ` [PATCH v2 18/21] cxl: Cleanup Makefile Michael Neuling
2015-05-26 0:20 ` [PATCH v2 19/21] cxl: Move include file cxl.h -> cxl-base.h Michael Neuling
2015-05-26 0:20 ` [PATCH v2 20/21] cxl: Export file ops for use by API Michael Neuling
2015-05-26 0:20 ` [PATCH v2 21/21] cxl: Add AFU virtual PHB and kernel API Michael Neuling
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=1432599618-26844-2-git-send-email-mikey@neuling.org \
--to=mikey@neuling.org \
--cc=benh@kernel.crashing.org \
--cc=brking@linux.vnet.ibm.com \
--cc=dja@axtens.net \
--cc=imunsie@au.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=manoj@linux.vnet.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=mrochs@linux.vnet.ibm.com \
/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).