linux_dsm_epyc7002/arch/powerpc/include/asm
Ram Pai 273b493689 powerpc: Swizzle around 4K PTE bits to free up bit 5 and bit 6
We need PTE bits 3 ,4, 5, 6 and 57 to support protection-keys,
because these are the bits we want to consolidate on across all
configuration to support protection keys.

Bit 3,4,5 and 6 are currently used on 4K-pte kernels. But bit 9
and 10 are available. Hence we use the two available bits and
free up bit 5 and 6. We will still not be able to free up bit 3
and 4. In the absence of any other free bits, we will have to
stay satisfied with what we have :-(. This means we will not
be able to support 32 protection keys, but only 8. The bit
numbers are big-endian as defined in the ISA3.0

This patch does the following change to 4K PTE.

H_PAGE_F_SECOND (S) which occupied bit 4 moves to bit 7.
H_PAGE_F_GIX (G,I,X) which occupied bit 5, 6 and 7 also moves
to bit 8,9, 10 respectively.
H_PAGE_HASHPTE (H) which occupied bit 8 moves to bit 4.

Before the patch, the 4k PTE format was as follows

 0 1 2 3 4  5  6  7  8 9 10....................57.....63
 : : : : :  :  :  :  : : :                      :     :
 v v v v v  v  v  v  v v v                      v     v
,-,-,-,-,--,--,--,--,-,-,-,-,-,------------------,-,-,-,
|x|x|x|B|S |G |I |X |H| | |x|x|................| |x|x|x|
'_'_'_'_'__'__'__'__'_'_'_'_'_'________________'_'_'_'_'

After the patch, the 4k PTE format is as follows

 0 1 2 3 4  5  6  7  8 9 10....................57.....63
 : : : : :  :  :  :  : : :                      :     :
 v v v v v  v  v  v  v v v                      v     v
,-,-,-,-,--,--,--,--,-,-,-,-,-,------------------,-,-,-,
|x|x|x|B|H |  |  |S |G|I|X|x|x|................| |.|.|.|
'_'_'_'_'__'__'__'__'_'_'_'_'_'________________'_'_'_'_'

The patch has no code changes; just swizzles around bits.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-12-20 18:57:24 +11:00
..
book3s powerpc: Swizzle around 4K PTE bits to free up bit 5 and bit 6 2017-12-20 18:57:24 +11:00
nohash powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
8xx_immap.h
accounting.h
agp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
archrandom.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
asm-compat.h powerpc/asm: Convert .llong directives to .8byte 2017-08-31 14:26:47 +10:00
asm-offsets.h
asm-prototypes.h
async_tx.h
atomic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
backlight.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
barrier.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bitops.h powerpc: Remove __ilog2()s and use generic ones 2017-06-02 19:23:56 +10:00
bootx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
btext.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bugs.h
cache.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cacheflush.h
cell-pmu.h
cell-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
checksum.h
cmpxchg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
code-patching.h powerpc/modules: Don't try to restore r2 after a sibling call 2017-12-11 13:03:29 +11:00
compat.h fcntl: don't cap l_start and l_end values for F_GETLK64 in compat syscall 2017-11-15 08:08:36 -05:00
context_tracking.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
copro.h
cpm1.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpm2.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpm.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpu_has_feature.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpufeature.h
cpuidle.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cputable.h powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
cputhreads.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cputime.h
current.h
dbdma.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dbell.h powerpc/64s: msgclr when handling doorbell exceptions from system reset 2017-06-19 19:46:27 +10:00
dcr-generic.h
dcr-mmio.h
dcr-native.h
dcr-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dcr.h
debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
debugfs.h
delay.h powerpc: use spin loop primitives in some functions 2017-07-02 20:40:24 +10:00
device.h
disassemble.h
dma-mapping.h A couple of dma-mapping updates: 2017-11-14 16:54:12 -08:00
dma.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dt_cpu_ftrs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
edac.h
eeh_event.h
eeh.h powerpc/eeh: Stop using do_gettimeofday() 2017-11-06 17:40:00 +11:00
ehv_pic.h
elf.h powerpc: move ELF_ET_DYN_BASE to 4GB / 4MB 2017-07-10 16:32:36 -07:00
emergency-restart.h
emulated_ops.h powerpc/64s: Add workaround for P9 vector CI load issue 2017-09-27 08:23:22 +10:00
epapr_hcalls.h powerpc: Always initialize input array when calling epapr_hypercall() 2017-10-06 20:50:58 +11:00
exception-64e.h
exception-64s.h powerpc/mce: Hookup derror (load/store) UE errors 2017-10-16 23:12:01 +11:00
exec.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
extable.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fadump.h powerpc/powernv: Use kernel crash path for machine checks 2017-08-31 14:26:04 +10:00
fb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
feature-fixups.h powerpc/asm: Convert .llong directives to .8byte 2017-08-31 14:26:47 +10:00
firmware.h
fixmap.h powerpc/mm: Simplify __set_fixmap() 2017-08-15 22:55:58 +10:00
floppy.h floppy: consolidate the dummy fd_cacheflush definition 2017-10-19 16:37:08 +02:00
fs_pd.h powerpc/8xx: Getting rid of remaining use of CONFIG_8xx 2017-08-10 23:32:12 +10:00
fsl_85xx_cache_sram.h
fsl_gtm.h
fsl_hcalls.h
fsl_lbc.h
fsl_pamu_stash.h
fsl_pm.h
ftrace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
futex.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
grackle.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hardirq.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
head-64.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
heathrow.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
highmem.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hmi.h
hugetlb.h powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
hvcall.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hvconsole.h
hvcserver.h
hvsi.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hw_breakpoint.h
hw_irq.h powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
hydra.h
i8259.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ibmebus.h
icswx.h crypto/nx: Add P9 NX specific error codes for 842 engine 2017-09-01 16:42:50 +10:00
ide.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ima.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
imc-pmu.h powerpc/perf: Fix IMC_MAX_PMU macro 2017-11-22 23:04:23 +11:00
immap_cpm2.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
io_event_irq.h
io-defs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
io-workarounds.h
io.h
iommu.h powerpc: implement ->mapping_error 2017-06-28 06:54:33 -07:00
ipic.h
irq_work.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq.h
irqflags.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
isa-bridge.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
jump_label.h
Kbuild powerpc: allow compiling with GENERIC_MSI_IRQ_DOMAIN 2017-07-24 21:19:32 +10:00
kdebug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kdump.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kexec.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
keylargo.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kgdb.h
kmap_types.h
kprobes.h powerpc/kprobes: Clean up jprobe detection in livepatch handler 2017-10-04 23:42:17 +11:00
kvm_asm.h
kvm_book3s_32.h
kvm_book3s_64.h KVM: PPC: Book3S HV: Unify dirty page map between HPT and radix 2017-11-01 15:36:21 +11:00
kvm_book3s_asm.h KVM: PPC: Book3S HV: Run HPT guests on POWER9 radix hosts 2017-11-01 15:36:41 +11:00
kvm_book3s.h KVM: PPC: Book3S HV: Unify dirty page map between HPT and radix 2017-11-01 15:36:21 +11:00
kvm_booke_hv_asm.h
kvm_booke.h
kvm_fpu.h
kvm_host.h KVM: PPC: Book3S HV: Allow for running POWER9 host in single-threaded mode 2017-11-01 15:36:35 +11:00
kvm_para.h
kvm_ppc.h KVM: PPC: Book3S HV: Fix migration and HPT resizing of HPT guests on radix hosts 2017-11-23 14:17:54 +11:00
libata-portmap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
linkage.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
livepatch.h
local.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lppaca.h
lv1call.h
machdep.h powerpc/pci: Separate SR-IOV Calls 2017-12-11 13:03:35 +11:00
macio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mc146818rtc.h
mce.h powerpc/mce: Hookup derror (load/store) UE errors 2017-10-16 23:12:01 +11:00
mediabay.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm-arch-hooks.h
mman.h
mmu_context.h powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
mmu-8xx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mmu-40x.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mmu-44x.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mmu-book3e.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mmu.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mmzone.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
module.h
mpc5xxx.h
mpc6xx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mpc52xx_psc.h
mpc52xx.h
mpc85xx.h
mpc5121.h
mpc8260.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mpic_msgr.h
mpic_timer.h
mpic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
msi_bitmap.h
nmi.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nvram.h
ohare.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
opal-api.h powerpc/powernv: Enable TM without suspend if possible 2017-10-21 09:33:05 +11:00
opal.h powerpc/opal: Add opal_async_wait_response_interruptible() to opal-async 2017-11-06 20:39:28 +11:00
oprofile_impl.h
paca.h powerpc/64s: mm_context.addr_limit is only used on hash 2017-11-13 23:35:43 +11:00
page_32.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
page_64.h powerpc/64s: Replace CONFIG_PPC_STD_MMU_64 with CONFIG_PPC_BOOK3S_64 2017-11-06 16:48:14 +11:00
page.h powerpc/mm: Fix virt_addr_valid() etc. on 64-bit hash 2017-05-19 13:04:35 +10:00
parport.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pasemi_dma.h
pci-bridge.h powerpc/pci: Separate SR-IOV Calls 2017-12-11 13:03:35 +11:00
pci.h PCI: Remove redundant pci_dev, pci_bus, resource declarations 2017-11-07 18:38:48 -06:00
percpu.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf_event_fsl_emb.h
perf_event_server.h
perf_event.h
pgalloc.h kmemcheck: stop using GFP_NOTRACK and SLAB_NOTRACK 2017-11-15 18:21:04 -08:00
pgtable-be-types.h powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
pgtable-types.h powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
pgtable.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
plpar_wrappers.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pmac_feature.h
pmac_low_i2c.h
pmac_pfunc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pmc.h
pmi.h
pnv-pci.h powerpc/powernv: Enable PCI peer-to-peer 2017-08-08 11:27:30 +10:00
powernv.h powerpc/powernv: Enable TM without suspend if possible 2017-10-21 09:33:05 +11:00
ppc4xx_ocm.h
ppc4xx.h
ppc_asm.h powerpc/book3s: Add an HV variant of FIXUP_ENDIAN that is recoverable 2017-11-06 16:48:08 +11:00
ppc-opcode.h powerpc: Handle most loads and stores in instruction emulation code 2017-09-01 16:39:48 +10:00
ppc-pci.h
probes.h
processor.h powerpc: Define set_thread_uses_vas() 2017-11-12 09:03:09 +11:00
prom.h powerpc/xive: add XIVE Exploitation Mode to CAS 2017-09-02 21:02:38 +10:00
ps3.h
ps3av.h
ps3gpu.h
ps3stor.h
pte-common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pte-walk.h powerpc/mm: Rename find_linux_pte_or_hugepte() 2017-08-17 23:13:46 +10:00
ptrace.h
reg_8xx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
reg_a2.h
reg_booke.h powerpc: Remove old unused icswx based coprocessor support 2017-08-03 16:06:52 +10:00
reg_fsl_emb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
reg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rheap.h
rio.h
rtas.h
runlatch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
scom.h
seccomp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sections.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
serial.h
setjmp.h
setup.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sfp-machine.h
shmparam.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
signal.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
smp.h powerpc/smp: Add cpu_l2_cache_map 2017-08-31 14:26:56 +10:00
smu.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sparsemem.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spinlock_types.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spinlock.h locking/arch: Remove dummy arch_{read,spin,write}_lock_flags() implementations 2017-10-10 11:50:19 +02:00
spu_csa.h
spu_info.h
spu_priv1.h
spu.h
sstep.h powerpc: Emulate load/store floating point as integer word instructions 2017-09-01 16:42:44 +10:00
string.h powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
swab.h
swiotlb.h
switch_to.h powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
synch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
syscall.h
syscalls.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
systbl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tce.h
termios.h
thread_info.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
time.h
timex.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tlb.h powerpc/mm: Optimize detection of thread local mm's 2017-08-23 22:28:38 +10:00
tlbflush.h powerpc/64s: Replace CONFIG_PPC_STD_MMU_64 with CONFIG_PPC_BOOK3S_64 2017-11-06 16:48:14 +11:00
tm.h powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
topology.h powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
trace_clock.h
trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tsi108_irq.h
tsi108_pci.h
tsi108.h
types.h
uaccess.h powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
udbg.h
uic.h
unaligned.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
uninorth.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
unistd.h
uprobes.h
user.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vas.h powerpc/vas: Define vas_win_id() 2017-11-12 09:03:10 +11:00
vdso_datapage.h
vdso.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vga.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vio.h
word-at-a-time.h
xics.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xilinx_intc.h
xilinx_pci.h
xive-regs.h
xive.h powerpc/xive: introduce H_INT_ESB hcall 2017-09-02 21:02:37 +10:00
xmon.h
xor.h