* [PATCH v2 10/13] powerpc/pseries/svm: Disable doorbells in SVM guests
From: Thiago Jung Bauermann @ 2019-07-13 6:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: Anshuman Khandual, Alexey Kardashevskiy, Mike Anderson, Ram Pai,
linux-kernel, Claudio Carvalho, Paul Mackerras,
Sukadev Bhattiprolu, Christoph Hellwig, Thiago Jung Bauermann
In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com>
From: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Normally, the HV emulates some instructions like MSGSNDP, MSGCLRP
from a KVM guest. To emulate the instructions, it must first read
the instruction from the guest's memory and decode its parameters.
However for a secure guest (aka SVM), the page containing the
instruction is in secure memory and the HV cannot access directly.
It would need the Ultravisor (UV) to facilitate accessing the
instruction and parameters but the UV currently does not have
the support for such accesses.
Until the UV has such support, disable doorbells in SVMs. This might
incur a performance hit but that is yet to be quantified.
With this patch applied (needed only in SVMs not needed for HV) we
are able to launch SVM guests with multi-core support. Eg:
qemu -smp sockets=2,cores=2,threads=2.
Fix suggested by Benjamin Herrenschmidt. Thanks to input from
Paul Mackerras, Ram Pai and Michael Anderson.
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
arch/powerpc/platforms/pseries/smp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 3df46123cce3..95a5c24a1544 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -45,6 +45,7 @@
#include <asm/dbell.h>
#include <asm/plpar_wrappers.h>
#include <asm/code-patching.h>
+#include <asm/svm.h>
#include "pseries.h"
#include "offline_states.h"
@@ -225,7 +226,7 @@ static __init void pSeries_smp_probe_xics(void)
{
xics_smp_probe();
- if (cpu_has_feature(CPU_FTR_DBELL))
+ if (cpu_has_feature(CPU_FTR_DBELL) && !is_secure_guest())
smp_ops->cause_ipi = smp_pseries_cause_ipi;
else
smp_ops->cause_ipi = icp_ops->cause_ipi;
^ permalink raw reply related
* [PATCH v2 09/13] powerpc/pseries/svm: Export guest SVM status to user space via sysfs
From: Thiago Jung Bauermann @ 2019-07-13 6:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: Anshuman Khandual, Alexey Kardashevskiy, Mike Anderson, Ram Pai,
linux-kernel, Claudio Carvalho, Ryan Grimm, Paul Mackerras,
Christoph Hellwig, Thiago Jung Bauermann
In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com>
From: Ryan Grimm <grimm@linux.vnet.ibm.com>
User space might want to know it's running in a secure VM. It can't do
a mfmsr because mfmsr is a privileged instruction.
The solution here is to create a cpu attribute:
/sys/devices/system/cpu/svm
which will read 0 or 1 based on the S bit of the guest's CPU 0.
Signed-off-by: Ryan Grimm <grimm@linux.vnet.ibm.com>
Reviewed-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
arch/powerpc/kernel/sysfs.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index e2147d7c9e72..f7100ab77d29 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -19,6 +19,7 @@
#include <asm/smp.h>
#include <asm/pmc.h>
#include <asm/firmware.h>
+#include <asm/svm.h>
#include "cacheinfo.h"
#include "setup.h"
@@ -715,6 +716,32 @@ static struct device_attribute pa6t_attrs[] = {
#endif /* HAS_PPC_PMC_PA6T */
#endif /* HAS_PPC_PMC_CLASSIC */
+#ifdef CONFIG_PPC_SVM
+static void get_svm(void *val)
+{
+ u32 *value = val;
+
+ *value = is_secure_guest();
+}
+
+static ssize_t show_svm(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ u32 val;
+ smp_call_function_single(0, get_svm, &val, 1);
+ return sprintf(buf, "%u\n", val);
+}
+static DEVICE_ATTR(svm, 0444, show_svm, NULL);
+
+static void create_svm_file(void)
+{
+ device_create_file(cpu_subsys.dev_root, &dev_attr_svm);
+}
+#else
+static void create_svm_file(void)
+{
+}
+#endif /* CONFIG_PPC_SVM */
+
static int register_cpu_online(unsigned int cpu)
{
struct cpu *c = &per_cpu(cpu_devices, cpu);
@@ -1058,6 +1085,8 @@ static int __init topology_init(void)
sysfs_create_dscr_default();
#endif /* CONFIG_PPC64 */
+ create_svm_file();
+
return 0;
}
subsys_initcall(topology_init);
^ permalink raw reply related
* [PATCH v2 08/13] powerpc/pseries/svm: Unshare all pages before kexecing a new kernel
From: Thiago Jung Bauermann @ 2019-07-13 6:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: Anshuman Khandual, Alexey Kardashevskiy, Mike Anderson, Ram Pai,
linux-kernel, Claudio Carvalho, Paul Mackerras, Christoph Hellwig,
Thiago Jung Bauermann
In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com>
From: Ram Pai <linuxram@us.ibm.com>
A new kernel deserves a clean slate. Any pages shared with the hypervisor
is unshared before invoking the new kernel. However there are exceptions.
If the new kernel is invoked to dump the current kernel, or if there is a
explicit request to preserve the state of the current kernel, unsharing
of pages is skipped.
NOTE: While testing crashkernel, make sure at least 256M is reserved for
crashkernel. Otherwise SWIOTLB allocation will fail and crash kernel will
fail to boot.
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
arch/powerpc/include/asm/ultravisor-api.h | 1 +
arch/powerpc/include/asm/ultravisor.h | 6 ++++++
arch/powerpc/kernel/machine_kexec_64.c | 8 ++++++++
3 files changed, 15 insertions(+)
diff --git a/arch/powerpc/include/asm/ultravisor-api.h b/arch/powerpc/include/asm/ultravisor-api.h
index c7513bbadf57..ab4f756cb91c 100644
--- a/arch/powerpc/include/asm/ultravisor-api.h
+++ b/arch/powerpc/include/asm/ultravisor-api.h
@@ -29,5 +29,6 @@
#define UV_UNSHARE_PAGE 0xF134
#define UV_PAGE_INVAL 0xF138
#define UV_SVM_TERMINATE 0xF13C
+#define UV_UNSHARE_ALL_PAGES 0xF140
#endif /* _ASM_POWERPC_ULTRAVISOR_API_H */
diff --git a/arch/powerpc/include/asm/ultravisor.h b/arch/powerpc/include/asm/ultravisor.h
index f7418b663a0e..80d4beaf61b8 100644
--- a/arch/powerpc/include/asm/ultravisor.h
+++ b/arch/powerpc/include/asm/ultravisor.h
@@ -106,6 +106,12 @@ static inline int uv_unshare_page(u64 pfn, u64 npages)
return ucall(UV_UNSHARE_PAGE, retbuf, pfn, npages);
}
+static inline int uv_unshare_all_pages(void)
+{
+ unsigned long retbuf[UCALL_BUFSIZE];
+
+ return ucall(UV_UNSHARE_ALL_PAGES, retbuf);
+}
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_POWERPC_ULTRAVISOR_H */
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index 75692c327ba0..b3d87d32e8f7 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -31,6 +31,7 @@
#include <asm/smp.h>
#include <asm/hw_breakpoint.h>
#include <asm/asm-prototypes.h>
+#include <asm/ultravisor.h>
int default_machine_kexec_prepare(struct kimage *image)
{
@@ -329,6 +330,13 @@ void default_machine_kexec(struct kimage *image)
#ifdef CONFIG_PPC_PSERIES
kexec_paca.lppaca_ptr = NULL;
#endif
+
+ if (is_secure_guest() && !(image->preserve_context ||
+ image->type == KEXEC_TYPE_CRASH)) {
+ uv_unshare_all_pages();
+ printk("kexec: Unshared all shared pages.\n");
+ }
+
paca_ptrs[kexec_paca.paca_index] = &kexec_paca;
setup_paca(&kexec_paca);
^ permalink raw reply related
* [PATCH v2 07/13] powerpc/pseries/svm: Use shared memory for Debug Trace Log (DTL)
From: Thiago Jung Bauermann @ 2019-07-13 6:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: Anshuman Khandual, Alexey Kardashevskiy, Mike Anderson, Ram Pai,
linux-kernel, Claudio Carvalho, Paul Mackerras, Christoph Hellwig,
Thiago Jung Bauermann, Anshuman Khandual
In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com>
From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Secure guests need to share the DTL buffers with the hypervisor. To that
end, use a kmem_cache constructor which converts the underlying buddy
allocated SLUB cache pages into shared memory.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
arch/powerpc/include/asm/svm.h | 5 ++++
arch/powerpc/platforms/pseries/Makefile | 1 +
arch/powerpc/platforms/pseries/setup.c | 5 +++-
arch/powerpc/platforms/pseries/svm.c | 40 +++++++++++++++++++++++++
4 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/svm.h b/arch/powerpc/include/asm/svm.h
index fef3740f46a6..f253116c31fc 100644
--- a/arch/powerpc/include/asm/svm.h
+++ b/arch/powerpc/include/asm/svm.h
@@ -15,6 +15,9 @@ static inline bool is_secure_guest(void)
return mfmsr() & MSR_S;
}
+void dtl_cache_ctor(void *addr);
+#define get_dtl_cache_ctor() (is_secure_guest() ? dtl_cache_ctor : NULL)
+
#else /* CONFIG_PPC_SVM */
static inline bool is_secure_guest(void)
@@ -22,5 +25,7 @@ static inline bool is_secure_guest(void)
return false;
}
+#define get_dtl_cache_ctor() NULL
+
#endif /* CONFIG_PPC_SVM */
#endif /* _ASM_POWERPC_SVM_H */
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index ab3d59aeacca..a420ef4c9d8e 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -26,6 +26,7 @@ obj-$(CONFIG_IBMVIO) += vio.o
obj-$(CONFIG_IBMEBUS) += ibmebus.o
obj-$(CONFIG_PAPR_SCM) += papr_scm.o
obj-$(CONFIG_PPC_SPLPAR) += vphn.o
+obj-$(CONFIG_PPC_SVM) += svm.o
ifdef CONFIG_PPC_PSERIES
obj-$(CONFIG_SUSPEND) += suspend.o
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index cb418d2bb1ac..3009b5bd11d2 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -73,6 +73,7 @@
#include <asm/security_features.h>
#include <asm/asm-const.h>
#include <asm/swiotlb.h>
+#include <asm/svm.h>
#include "pseries.h"
#include "../../../../drivers/pci/pci.h"
@@ -301,8 +302,10 @@ static inline int alloc_dispatch_logs(void)
static int alloc_dispatch_log_kmem_cache(void)
{
+ void (*ctor)(void *) = get_dtl_cache_ctor();
+
dtl_cache = kmem_cache_create("dtl", DISPATCH_LOG_BYTES,
- DISPATCH_LOG_BYTES, 0, NULL);
+ DISPATCH_LOG_BYTES, 0, ctor);
if (!dtl_cache) {
pr_warn("Failed to create dispatch trace log buffer cache\n");
pr_warn("Stolen time statistics will be unreliable\n");
diff --git a/arch/powerpc/platforms/pseries/svm.c b/arch/powerpc/platforms/pseries/svm.c
new file mode 100644
index 000000000000..c508196f7c83
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/svm.c
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Secure VM platform
+ *
+ * Copyright 2019 IBM Corporation
+ * Author: Anshuman Khandual <khandual@linux.vnet.ibm.com>
+ */
+
+#include <linux/mm.h>
+#include <asm/ultravisor.h>
+
+/* There's one dispatch log per CPU. */
+#define NR_DTL_PAGE (DISPATCH_LOG_BYTES * CONFIG_NR_CPUS / PAGE_SIZE)
+
+static struct page *dtl_page_store[NR_DTL_PAGE];
+static long dtl_nr_pages;
+
+static bool is_dtl_page_shared(struct page *page)
+{
+ long i;
+
+ for (i = 0; i < dtl_nr_pages; i++)
+ if (dtl_page_store[i] == page)
+ return true;
+
+ return false;
+}
+
+void dtl_cache_ctor(void *addr)
+{
+ unsigned long pfn = PHYS_PFN(__pa(addr));
+ struct page *page = pfn_to_page(pfn);
+
+ if (!is_dtl_page_shared(page)) {
+ dtl_page_store[dtl_nr_pages] = page;
+ dtl_nr_pages++;
+ WARN_ON(dtl_nr_pages >= NR_DTL_PAGE);
+ uv_share_page(pfn, 1);
+ }
+}
^ permalink raw reply related
* [PATCH v2 06/13] powerpc/pseries/svm: Use shared memory for LPPACA structures
From: Thiago Jung Bauermann @ 2019-07-13 6:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: Anshuman Khandual, Alexey Kardashevskiy, Mike Anderson, Ram Pai,
linux-kernel, Claudio Carvalho, Paul Mackerras, Christoph Hellwig,
Thiago Jung Bauermann, Anshuman Khandual
In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com>
From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
LPPACA structures need to be shared with the host. Hence they need to be in
shared memory. Instead of allocating individual chunks of memory for a
given structure from memblock, a contiguous chunk of memory is allocated
and then converted into shared memory. Subsequent allocation requests will
come from the contiguous chunk which will be always shared memory for all
structures.
While we are able to use a kmem_cache constructor for the Debug Trace Log,
LPPACAs are allocated very early in the boot process (before SLUB is
available) so we need to use a simpler scheme here.
Introduce helper is_svm_platform() which uses the S bit of the MSR to tell
whether we're running as a secure guest.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
arch/powerpc/include/asm/svm.h | 26 ++++++++++++++++++++
arch/powerpc/kernel/paca.c | 43 +++++++++++++++++++++++++++++++++-
2 files changed, 68 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/svm.h b/arch/powerpc/include/asm/svm.h
new file mode 100644
index 000000000000..fef3740f46a6
--- /dev/null
+++ b/arch/powerpc/include/asm/svm.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * SVM helper functions
+ *
+ * Copyright 2019 Anshuman Khandual, IBM Corporation.
+ */
+
+#ifndef _ASM_POWERPC_SVM_H
+#define _ASM_POWERPC_SVM_H
+
+#ifdef CONFIG_PPC_SVM
+
+static inline bool is_secure_guest(void)
+{
+ return mfmsr() & MSR_S;
+}
+
+#else /* CONFIG_PPC_SVM */
+
+static inline bool is_secure_guest(void)
+{
+ return false;
+}
+
+#endif /* CONFIG_PPC_SVM */
+#endif /* _ASM_POWERPC_SVM_H */
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index 854105db5cff..a9622f4b45bb 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -18,6 +18,8 @@
#include <asm/sections.h>
#include <asm/pgtable.h>
#include <asm/kexec.h>
+#include <asm/svm.h>
+#include <asm/ultravisor.h>
#include "setup.h"
@@ -58,6 +60,41 @@ static void *__init alloc_paca_data(unsigned long size, unsigned long align,
#define LPPACA_SIZE 0x400
+static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align,
+ unsigned long limit, int cpu)
+{
+ size_t shared_lppaca_total_size = PAGE_ALIGN(nr_cpu_ids * LPPACA_SIZE);
+ static unsigned long shared_lppaca_size;
+ static void *shared_lppaca;
+ void *ptr;
+
+ if (!shared_lppaca) {
+ memblock_set_bottom_up(true);
+
+ shared_lppaca =
+ memblock_alloc_try_nid(shared_lppaca_total_size,
+ PAGE_SIZE, MEMBLOCK_LOW_LIMIT,
+ limit, NUMA_NO_NODE);
+ if (!shared_lppaca)
+ panic("cannot allocate shared data");
+
+ memblock_set_bottom_up(false);
+ uv_share_page(PHYS_PFN(__pa(shared_lppaca)),
+ shared_lppaca_total_size >> PAGE_SHIFT);
+ }
+
+ ptr = shared_lppaca + shared_lppaca_size;
+ shared_lppaca_size += size;
+
+ /*
+ * This is very early in boot, so no harm done if the kernel crashes at
+ * this point.
+ */
+ BUG_ON(shared_lppaca_size >= shared_lppaca_total_size);
+
+ return ptr;
+}
+
/*
* See asm/lppaca.h for more detail.
*
@@ -87,7 +124,11 @@ static struct lppaca * __init new_lppaca(int cpu, unsigned long limit)
if (early_cpu_has_feature(CPU_FTR_HVMODE))
return NULL;
- lp = alloc_paca_data(LPPACA_SIZE, 0x400, limit, cpu);
+ if (is_secure_guest())
+ lp = alloc_shared_lppaca(LPPACA_SIZE, 0x400, limit, cpu);
+ else
+ lp = alloc_paca_data(LPPACA_SIZE, 0x400, limit, cpu);
+
init_lppaca(lp);
return lp;
^ permalink raw reply related
* [PATCH v2 05/13] powerpc/pseries: Add and use LPPACA_SIZE constant
From: Thiago Jung Bauermann @ 2019-07-13 6:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: Alexey Kardashevskiy, Anshuman Khandual, Alexey Kardashevskiy,
Mike Anderson, Ram Pai, linux-kernel, Claudio Carvalho,
Paul Mackerras, Christoph Hellwig, Thiago Jung Bauermann
In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com>
Helps document what the hard-coded number means.
Also take the opportunity to fix an #endif comment.
Suggested-by: Alexey Kardashevskiy <aik@linux.ibm.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
arch/powerpc/kernel/paca.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index 9cc91d03ab62..854105db5cff 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -56,6 +56,8 @@ static void *__init alloc_paca_data(unsigned long size, unsigned long align,
#ifdef CONFIG_PPC_PSERIES
+#define LPPACA_SIZE 0x400
+
/*
* See asm/lppaca.h for more detail.
*
@@ -69,7 +71,7 @@ static inline void init_lppaca(struct lppaca *lppaca)
*lppaca = (struct lppaca) {
.desc = cpu_to_be32(0xd397d781), /* "LpPa" */
- .size = cpu_to_be16(0x400),
+ .size = cpu_to_be16(LPPACA_SIZE),
.fpregs_in_use = 1,
.slb_count = cpu_to_be16(64),
.vmxregs_in_use = 0,
@@ -79,19 +81,18 @@ static inline void init_lppaca(struct lppaca *lppaca)
static struct lppaca * __init new_lppaca(int cpu, unsigned long limit)
{
struct lppaca *lp;
- size_t size = 0x400;
- BUILD_BUG_ON(size < sizeof(struct lppaca));
+ BUILD_BUG_ON(sizeof(struct lppaca) > LPPACA_SIZE);
if (early_cpu_has_feature(CPU_FTR_HVMODE))
return NULL;
- lp = alloc_paca_data(size, 0x400, limit, cpu);
+ lp = alloc_paca_data(LPPACA_SIZE, 0x400, limit, cpu);
init_lppaca(lp);
return lp;
}
-#endif /* CONFIG_PPC_BOOK3S */
+#endif /* CONFIG_PPC_PSERIES */
#ifdef CONFIG_PPC_BOOK3S_64
^ permalink raw reply related
* [PATCH v2 04/13] powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE
From: Thiago Jung Bauermann @ 2019-07-13 6:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: Anshuman Khandual, Alexey Kardashevskiy, Mike Anderson, Ram Pai,
linux-kernel, Claudio Carvalho, Paul Mackerras, Christoph Hellwig,
Thiago Jung Bauermann
In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com>
From: Ram Pai <linuxram@us.ibm.com>
These functions are used when the guest wants to grant the hypervisor
access to certain pages.
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
arch/powerpc/include/asm/ultravisor-api.h | 2 ++
arch/powerpc/include/asm/ultravisor.h | 15 +++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/arch/powerpc/include/asm/ultravisor-api.h b/arch/powerpc/include/asm/ultravisor-api.h
index fe9a0d8d7673..c7513bbadf57 100644
--- a/arch/powerpc/include/asm/ultravisor-api.h
+++ b/arch/powerpc/include/asm/ultravisor-api.h
@@ -25,6 +25,8 @@
#define UV_UNREGISTER_MEM_SLOT 0xF124
#define UV_PAGE_IN 0xF128
#define UV_PAGE_OUT 0xF12C
+#define UV_SHARE_PAGE 0xF130
+#define UV_UNSHARE_PAGE 0xF134
#define UV_PAGE_INVAL 0xF138
#define UV_SVM_TERMINATE 0xF13C
diff --git a/arch/powerpc/include/asm/ultravisor.h b/arch/powerpc/include/asm/ultravisor.h
index f5dc5af739b8..f7418b663a0e 100644
--- a/arch/powerpc/include/asm/ultravisor.h
+++ b/arch/powerpc/include/asm/ultravisor.h
@@ -91,6 +91,21 @@ static inline int uv_svm_terminate(u64 lpid)
return ucall(UV_SVM_TERMINATE, retbuf, lpid);
}
+
+static inline int uv_share_page(u64 pfn, u64 npages)
+{
+ unsigned long retbuf[UCALL_BUFSIZE];
+
+ return ucall(UV_SHARE_PAGE, retbuf, pfn, npages);
+}
+
+static inline int uv_unshare_page(u64 pfn, u64 npages)
+{
+ unsigned long retbuf[UCALL_BUFSIZE];
+
+ return ucall(UV_UNSHARE_PAGE, retbuf, pfn, npages);
+}
+
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_POWERPC_ULTRAVISOR_H */
^ permalink raw reply related
* [PATCH v2 03/13] powerpc/prom_init: Add the ESM call to prom_init
From: Thiago Jung Bauermann @ 2019-07-13 6:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: Anshuman Khandual, Alexey Kardashevskiy, Mike Anderson, Ram Pai,
linux-kernel, Claudio Carvalho, Paul Mackerras, Christoph Hellwig,
Thiago Jung Bauermann
In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com>
From: Ram Pai <linuxram@us.ibm.com>
Make the Enter-Secure-Mode (ESM) ultravisor call to switch the VM to secure
mode. Add "svm=" command line option to turn on switching to secure mode.
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
[ andmike: Generate an RTAS os-term hcall when the ESM ucall fails. ]
Signed-off-by: Michael Anderson <andmike@linux.ibm.com>
[ bauerman: Cleaned up the code a bit. ]
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
.../admin-guide/kernel-parameters.txt | 5 +
arch/powerpc/include/asm/ultravisor-api.h | 1 +
arch/powerpc/kernel/prom_init.c | 99 +++++++++++++++++++
3 files changed, 105 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 7b15abf7db21..c611891b5992 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4585,6 +4585,11 @@
/sys/power/pm_test). Only available when CONFIG_PM_DEBUG
is set. Default value is 5.
+ svm= [PPC]
+ Format: { on | off | y | n | 1 | 0 }
+ This parameter controls use of the Protected
+ Execution Facility on pSeries.
+
swapaccount=[0|1]
[KNL] Enable accounting of swap in memory resource
controller if no parameter or 1 is given or disable
diff --git a/arch/powerpc/include/asm/ultravisor-api.h b/arch/powerpc/include/asm/ultravisor-api.h
index c8180427fa01..fe9a0d8d7673 100644
--- a/arch/powerpc/include/asm/ultravisor-api.h
+++ b/arch/powerpc/include/asm/ultravisor-api.h
@@ -19,6 +19,7 @@
/* opcodes */
#define UV_WRITE_PATE 0xF104
+#define UV_ESM 0xF110
#define UV_RETURN 0xF11C
#define UV_REGISTER_MEM_SLOT 0xF120
#define UV_UNREGISTER_MEM_SLOT 0xF124
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index a3fb90bb5a39..6389a992451b 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -44,6 +44,7 @@
#include <asm/sections.h>
#include <asm/machdep.h>
#include <asm/asm-prototypes.h>
+#include <asm/ultravisor-api.h>
#include <linux/linux_logo.h>
@@ -175,6 +176,10 @@ static bool __prombss prom_radix_disable;
static bool __prombss prom_xive_disable;
#endif
+#ifdef CONFIG_PPC_SVM
+static bool __prombss prom_svm_enable;
+#endif
+
struct platform_support {
bool hash_mmu;
bool radix_mmu;
@@ -816,6 +821,17 @@ static void __init early_cmdline_parse(void)
prom_debug("XIVE disabled from cmdline\n");
}
#endif /* CONFIG_PPC_PSERIES */
+
+#ifdef CONFIG_PPC_SVM
+ opt = prom_strstr(prom_cmd_line, "svm=");
+ if (opt) {
+ bool val;
+
+ opt += sizeof("svm=") - 1;
+ if (!prom_strtobool(opt, &val))
+ prom_svm_enable = val;
+ }
+#endif /* CONFIG_PPC_SVM */
}
#ifdef CONFIG_PPC_PSERIES
@@ -1716,6 +1732,43 @@ static void __init prom_close_stdin(void)
}
}
+#ifdef CONFIG_PPC_SVM
+static int prom_rtas_hcall(uint64_t args)
+{
+ register uint64_t arg1 asm("r3") = H_RTAS;
+ register uint64_t arg2 asm("r4") = args;
+
+ asm volatile("sc 1\n" : "=r" (arg1) :
+ "r" (arg1),
+ "r" (arg2) :);
+ return arg1;
+}
+
+static struct rtas_args __prombss os_term_args;
+
+static void __init prom_rtas_os_term(char *str)
+{
+ phandle rtas_node;
+ __be32 val;
+ u32 token;
+
+ prom_debug("%s: start...\n", __func__);
+ rtas_node = call_prom("finddevice", 1, 1, ADDR("/rtas"));
+ prom_debug("rtas_node: %x\n", rtas_node);
+ if (!PHANDLE_VALID(rtas_node))
+ return;
+
+ val = 0;
+ prom_getprop(rtas_node, "ibm,os-term", &val, sizeof(val));
+ token = be32_to_cpu(val);
+ prom_debug("ibm,os-term: %x\n", token);
+ if (token == 0)
+ prom_panic("Could not get token for ibm,os-term\n");
+ os_term_args.token = cpu_to_be32(token);
+ prom_rtas_hcall((uint64_t)&os_term_args);
+}
+#endif /* CONFIG_PPC_SVM */
+
/*
* Allocate room for and instantiate RTAS
*/
@@ -3172,6 +3225,49 @@ static void unreloc_toc(void)
#endif
#endif
+#ifdef CONFIG_PPC_SVM
+/*
+ * Perform the Enter Secure Mode ultracall.
+ */
+static int enter_secure_mode(unsigned long kbase, unsigned long fdt)
+{
+ register uint64_t func asm("r3") = UV_ESM;
+ register uint64_t arg1 asm("r4") = (uint64_t)kbase;
+ register uint64_t arg2 asm("r5") = (uint64_t)fdt;
+
+ asm volatile("sc 2\n"
+ : "=r"(func)
+ : "0"(func), "r"(arg1), "r"(arg2)
+ :);
+
+ return (int)func;
+}
+
+/*
+ * Call the Ultravisor to transfer us to secure memory if we have an ESM blob.
+ */
+static void setup_secure_guest(unsigned long kbase, unsigned long fdt)
+{
+ int ret;
+
+ if (!prom_svm_enable)
+ return;
+
+ /* Switch to secure mode. */
+ prom_printf("Switching to secure mode.\n");
+
+ ret = enter_secure_mode(kbase, fdt);
+ if (ret != U_SUCCESS) {
+ prom_printf("Returned %d from switching to secure mode.\n", ret);
+ prom_rtas_os_term("Switch to secure mode failed.\n");
+ }
+}
+#else
+static void setup_secure_guest(unsigned long kbase, unsigned long fdt)
+{
+}
+#endif /* CONFIG_PPC_SVM */
+
/*
* We enter here early on, when the Open Firmware prom is still
* handling exceptions and the MMU hash table for us.
@@ -3370,6 +3466,9 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
unreloc_toc();
#endif
+ /* Move to secure memory if we're supposed to be secure guests. */
+ setup_secure_guest(kbase, hdr);
+
__start(hdr, kbase, 0, 0, 0, 0, 0);
return 0;
^ permalink raw reply related
* [RFC PATCH v2 02/13] powerpc: Add support for adding an ESM blob to the zImage wrapper
From: Thiago Jung Bauermann @ 2019-07-13 6:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: Anshuman Khandual, Alexey Kardashevskiy, Mike Anderson, Ram Pai,
linux-kernel, Claudio Carvalho, Paul Mackerras, Christoph Hellwig,
Thiago Jung Bauermann
In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com>
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
For secure VMs, the signing tool will create a ticket called the "ESM blob"
for the Enter Secure Mode ultravisor call with the signatures of the kernel
and initrd among other things.
This adds support to the wrapper script for adding that blob via the "-e"
option to the zImage.pseries.
It also adds code to the zImage wrapper itself to retrieve and if necessary
relocate the blob, and pass its address to Linux via the device-tree, to be
later consumed by prom_init.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[ bauerman: Minor adjustments to some comments. ]
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
arch/powerpc/boot/main.c | 41 ++++++++++++++++++++++++++++++++++
arch/powerpc/boot/ops.h | 2 ++
arch/powerpc/boot/wrapper | 24 +++++++++++++++++---
arch/powerpc/boot/zImage.lds.S | 8 +++++++
4 files changed, 72 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 78aaf4ffd7ab..ca612efd3e81 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -150,6 +150,46 @@ static struct addr_range prep_initrd(struct addr_range vmlinux, void *chosen,
return (struct addr_range){(void *)initrd_addr, initrd_size};
}
+#ifdef __powerpc64__
+static void prep_esm_blob(struct addr_range vmlinux, void *chosen)
+{
+ unsigned long esm_blob_addr, esm_blob_size;
+
+ /* Do we have an ESM (Enter Secure Mode) blob? */
+ if (_esm_blob_end <= _esm_blob_start)
+ return;
+
+ printf("Attached ESM blob at 0x%p-0x%p\n\r",
+ _esm_blob_start, _esm_blob_end);
+ esm_blob_addr = (unsigned long)_esm_blob_start;
+ esm_blob_size = _esm_blob_end - _esm_blob_start;
+
+ /*
+ * If the ESM blob is too low it will be clobbered when the
+ * kernel relocates to its final location. In this case,
+ * allocate a safer place and move it.
+ */
+ if (esm_blob_addr < vmlinux.size) {
+ void *old_addr = (void *)esm_blob_addr;
+
+ printf("Allocating 0x%lx bytes for esm_blob ...\n\r",
+ esm_blob_size);
+ esm_blob_addr = (unsigned long)malloc(esm_blob_size);
+ if (!esm_blob_addr)
+ fatal("Can't allocate memory for ESM blob !\n\r");
+ printf("Relocating ESM blob 0x%lx <- 0x%p (0x%lx bytes)\n\r",
+ esm_blob_addr, old_addr, esm_blob_size);
+ memmove((void *)esm_blob_addr, old_addr, esm_blob_size);
+ }
+
+ /* Tell the kernel ESM blob address via device tree. */
+ setprop_val(chosen, "linux,esm-blob-start", (u32)(esm_blob_addr));
+ setprop_val(chosen, "linux,esm-blob-end", (u32)(esm_blob_addr + esm_blob_size));
+}
+#else
+static inline void prep_esm_blob(struct addr_range vmlinux, void *chosen) { }
+#endif
+
/* A buffer that may be edited by tools operating on a zImage binary so as to
* edit the command line passed to vmlinux (by setting /chosen/bootargs).
* The buffer is put in it's own section so that tools may locate it easier.
@@ -218,6 +258,7 @@ void start(void)
vmlinux = prep_kernel();
initrd = prep_initrd(vmlinux, chosen,
loader_info.initrd_addr, loader_info.initrd_size);
+ prep_esm_blob(vmlinux, chosen);
prep_cmdline(chosen);
printf("Finalizing device tree...");
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index cd043726ed88..e0606766480f 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -251,6 +251,8 @@ extern char _initrd_start[];
extern char _initrd_end[];
extern char _dtb_start[];
extern char _dtb_end[];
+extern char _esm_blob_start[];
+extern char _esm_blob_end[];
static inline __attribute__((const))
int __ilog2_u32(u32 n)
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 4ed18d63d892..ddb62b5b5b7a 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -14,6 +14,7 @@
# -i initrd specify initrd file
# -d devtree specify device-tree blob
# -s tree.dts specify device-tree source file (needs dtc installed)
+# -e esm_blob specify ESM blob for secure images
# -c cache $kernel.strip.gz (use if present & newer, else make)
# -C prefix specify command prefix for cross-building tools
# (strip, objcopy, ld)
@@ -38,6 +39,7 @@ platform=of
initrd=
dtb=
dts=
+esm_blob=
cacheit=
binary=
compression=.gz
@@ -61,9 +63,9 @@ tmpdir=.
usage() {
echo 'Usage: wrapper [-o output] [-p platform] [-i initrd]' >&2
- echo ' [-d devtree] [-s tree.dts] [-c] [-C cross-prefix]' >&2
- echo ' [-D datadir] [-W workingdir] [-Z (gz|xz|none)]' >&2
- echo ' [--no-compression] [vmlinux]' >&2
+ echo ' [-d devtree] [-s tree.dts] [-e esm_blob]' >&2
+ echo ' [-c] [-C cross-prefix] [-D datadir] [-W workingdir]' >&2
+ echo ' [-Z (gz|xz|none)] [--no-compression] [vmlinux]' >&2
exit 1
}
@@ -106,6 +108,11 @@ while [ "$#" -gt 0 ]; do
[ "$#" -gt 0 ] || usage
dtb="$1"
;;
+ -e)
+ shift
+ [ "$#" -gt 0 ] || usage
+ esm_blob="$1"
+ ;;
-s)
shift
[ "$#" -gt 0 ] || usage
@@ -219,9 +226,16 @@ objflags=-S
tmp=$tmpdir/zImage.$$.o
ksection=.kernel:vmlinux.strip
isection=.kernel:initrd
+esection=.kernel:esm_blob
link_address='0x400000'
make_space=y
+
+if [ -n "$esm_blob" -a "$platform" != "pseries" ]; then
+ echo "ESM blob not support on non-pseries platforms" >&2
+ exit 1
+fi
+
case "$platform" in
of)
platformo="$object/of.o $object/epapr.o"
@@ -478,6 +492,10 @@ if [ -n "$dtb" ]; then
fi
fi
+if [ -n "$esm_blob" ]; then
+ addsec $tmp "$esm_blob" $esection
+fi
+
if [ "$platform" != "miboot" ]; then
if [ -n "$link_address" ] ; then
text_start="-Ttext $link_address"
diff --git a/arch/powerpc/boot/zImage.lds.S b/arch/powerpc/boot/zImage.lds.S
index 4ac1e36edfe7..a21f3a76e06f 100644
--- a/arch/powerpc/boot/zImage.lds.S
+++ b/arch/powerpc/boot/zImage.lds.S
@@ -68,6 +68,14 @@ SECTIONS
_initrd_end = .;
}
+ . = ALIGN(4096);
+ .kernel:esm_blob :
+ {
+ _esm_blob_start = .;
+ *(.kernel:esm_blob)
+ _esm_blob_end = .;
+ }
+
#ifdef CONFIG_PPC64_BOOT_WRAPPER
. = ALIGN(256);
.got :
^ permalink raw reply related
* [PATCH v2 01/13] powerpc/pseries: Introduce option to build secure virtual machines
From: Thiago Jung Bauermann @ 2019-07-13 6:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: Anshuman Khandual, Alexey Kardashevskiy, Mike Anderson, Ram Pai,
linux-kernel, Claudio Carvalho, Paul Mackerras, Christoph Hellwig,
Thiago Jung Bauermann
In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com>
Introduce CONFIG_PPC_SVM to control support for secure guests and include
Ultravisor-related helpers when it is selected
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
arch/powerpc/include/asm/ultravisor.h | 2 +-
arch/powerpc/kernel/Makefile | 4 +++-
arch/powerpc/platforms/pseries/Kconfig | 11 +++++++++++
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/ultravisor.h b/arch/powerpc/include/asm/ultravisor.h
index a5e4516c8ddb..f5dc5af739b8 100644
--- a/arch/powerpc/include/asm/ultravisor.h
+++ b/arch/powerpc/include/asm/ultravisor.h
@@ -28,7 +28,7 @@ extern int early_init_dt_scan_ultravisor(unsigned long node, const char *uname,
* This call supports up to 6 arguments and 4 return arguments. Use
* UCALL_BUFSIZE to size the return argument buffer.
*/
-#if defined(CONFIG_PPC_POWERNV)
+#if defined(CONFIG_PPC_POWERNV) || defined(CONFIG_PPC_SVM)
long ucall(unsigned long opcode, unsigned long *retbuf, ...);
#else
static long ucall(unsigned long opcode, unsigned long *retbuf, ...)
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 929f79d3e6a9..ea671f03eba2 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -155,7 +155,9 @@ endif
obj-$(CONFIG_EPAPR_PARAVIRT) += epapr_paravirt.o epapr_hcalls.o
obj-$(CONFIG_KVM_GUEST) += kvm.o kvm_emul.o
-obj-$(CONFIG_PPC_POWERNV) += ultravisor.o ucall.o
+ifneq ($(CONFIG_PPC_POWERNV)$(CONFIG_PPC_SVM),)
+obj-y += ultravisor.o ucall.o
+endif
# Disable GCOV, KCOV & sanitizers in odd or sensitive code
GCOV_PROFILE_prom_init.o := n
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index f7b484f55553..d09deb05bb66 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -145,3 +145,14 @@ config PAPR_SCM
tristate "Support for the PAPR Storage Class Memory interface"
help
Enable access to hypervisor provided storage class memory.
+
+config PPC_SVM
+ bool "Secure virtual machine (SVM) support for POWER"
+ depends on PPC_PSERIES
+ help
+ There are certain POWER platforms which support secure guests using
+ the Protected Execution Facility, with the help of an Ultravisor
+ executing below the hypervisor layer. This enables support for
+ those guests.
+
+ If unsure, say "N".
^ permalink raw reply related
* [PATCH v2 00/13] Secure Virtual Machine Enablement
From: Thiago Jung Bauermann @ 2019-07-13 6:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: Anshuman Khandual, Alexey Kardashevskiy, Mike Anderson, Ram Pai,
linux-kernel, Claudio Carvalho, Paul Mackerras, Christoph Hellwig,
Thiago Jung Bauermann
Hello,
The main change in this version was to rebase on top of <asm/mem_encrypt.h>
cleanup series I just posted:
https://lore.kernel.org/linuxppc-dev/20190713044554.28719-1-bauerman@linux.ibm.com/
In addition to the patches above, this patch series applies on top of v4 of
Claudio Carvalho's "kvmppc: Paravirtualize KVM to support ultravisor"
series:
https://lore.kernel.org/linuxppc-dev/20190628200825.31049-1-cclaudio@linux.ibm.com/
I only actually need the following two patches from his series:
[PATCH v4 1/8] KVM: PPC: Ultravisor: Introduce the MSR_S bit
[PATCH v4 3/8] KVM: PPC: Ultravisor: Add generic ultravisor call handler
Everything is available in branch ultravisor-secure-vm at this repo:
https://github.com/bauermann/linux.git
Original cover letter below, and changelog at the bottom:
This series enables Secure Virtual Machines (SVMs) on powerpc. SVMs use the
Protected Execution Facility (PEF) and request to be migrated to secure
memory during prom_init() so by default all of their memory is inaccessible
to the hypervisor. There is an Ultravisor call that the VM can use to
request certain pages to be made accessible to (or shared with) the
hypervisor.
The objective of these patches is to have the guest perform this request
for buffers that need to be accessed by the hypervisor such as the LPPACAs,
the SWIOTLB memory and the Debug Trace Log.
Patch 2 ("powerpc: Add support for adding an ESM blob to the zImage
wrapper") is posted as RFC because we are still finalizing the details on
how the ESM blob will be passed along with the kernel. All other patches are
(hopefully) in upstreamable shape and don't depend on this patch.
Unfortunately this series still doesn't enable the use of virtio devices in
the secure guest. This support depends on a discussion that is currently
ongoing with the virtio community:
https://lore.kernel.org/linuxppc-dev/87womn8inf.fsf@morokweng.localdomain/
I was able to test it using Claudio's patches in the host kernel, booting
normally using an initramfs for the root filesystem.
This is the command used to start up the guest with QEMU 4.0:
qemu-system-ppc64 \
-nodefaults \
-cpu host \
-machine pseries,accel=kvm,kvm-type=HV,cap-htm=off,cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken \
-display none \
-serial mon:stdio \
-smp 1 \
-m 4G \
-kernel /root/bauermann/vmlinux \
-initrd /root/bauermann/fs_small.cpio \
-append 'debug'
Changelog
Since v1:
- Patch "powerpc/pseries: Introduce option to build secure virtual machines"
- Dropped redundant "default n" from CONFIG_PPC_SVM. Suggested by Christoph
Hellwig.
- Patch "powerpc: Add support for adding an ESM blob to the zImage wrapper"
- Renamed prom_rtas_os_term_hcall() to prom_rtas_hcall(). Suggested by Alexey
Kardashevskiy.
- In prom_rtas_hcall(), changed prom_printf() calls to prom_debug(), and
use H_RTAS constant instead of raw value.
- Changed enter_secure_mode() to new ABI passing ucall number in r3.
Also changed it to accept kbase argument instead of ESM blob address.
- Changed setup_secure_guest() to only make the ESM ultracall if svm=1 was
passed on the kernel command line.
- Patch "powerpc/pseries/svm: Unshare all pages before kexecing a new kernel"
- New patch from Ram Pai.
- Patch "powerpc/pseries/svm: Force SWIOTLB for secure guests"
- No need to define sme_me_mask, sme_active() and sev_active() anymore.
- Add definitions for mem_encrypt_active() and force_dma_unencrypted().
- Select ARCH_HAS_FORCE_DMA_UNENCRYPTED in CONFIG_PPC_SVM.
Since the RFC from August:
- Patch "powerpc/pseries: Introduce option to build secure virtual machines"
- New patch.
- Patch "powerpc: Add support for adding an ESM blob to the zImage wrapper"
- Patch from Benjamin Herrenschmidt, first posted here:
https://lore.kernel.org/linuxppc-dev/20180531043417.25073-1-benh@kernel.crashing.org/
- Made minor adjustments to some comments. Code is unchanged.
- Patch "powerpc/prom_init: Add the ESM call to prom_init"
- New patch from Ram Pai and Michael Anderson.
- Patch "powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE"
- New patch from Ram Pai.
- Patch "powerpc/pseries: Add and use LPPACA_SIZE constant"
- Moved LPPACA_SIZE macro inside the CONFIG_PPC_PSERIES #ifdef.
- Put sizeof() operand left of comparison operator in BUILD_BUG_ON()
macro to appease a checkpatch warning.
- Patch "powerpc/pseries/svm: Use shared memory for LPPACA structures"
- Moved definition of is_secure_guest() helper to this patch.
- Changed shared_lppaca and shared_lppaca_size from globals to static
variables inside alloc_shared_lppaca().
- Changed shared_lppaca to hold virtual address instead of physical
address.
- Patch "powerpc/pseries/svm: Use shared memory for Debug Trace Log (DTL)"
- Add get_dtl_cache_ctor() macro. Suggested by Ram Pai.
- Patch "powerpc/pseries/svm: Export guest SVM status to user space via sysfs"
- New patch from Ryan Grimm.
- Patch "powerpc/pseries/svm: Disable doorbells in SVM guests"
- New patch from Sukadev Bhattiprolu.
- Patch "powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests"
- New patch.
- Patch "powerpc/pseries/svm: Force SWIOTLB for secure guests"
- New patch with code that was previously in other patches.
- Patch "powerpc/configs: Enable secure guest support in pseries and ppc64 defconfigs"
- New patch from Ryan Grimm.
- Patch "powerpc/pseries/svm: Detect Secure Virtual Machine (SVM) platform"
- Dropped this patch by moving its code to other patches.
- Patch "powerpc/svm: Select CONFIG_DMA_DIRECT_OPS and CONFIG_SWIOTLB"
- No need to select CONFIG_DMA_DIRECT_OPS anymore. The CONFIG_SWIOTLB
change was moved to another patch and this patch was dropped.
- Patch "powerpc/pseries/svm: Add memory conversion (shared/secure) helper functions"
- Dropped patch since the helper functions were unnecessary wrappers
around uv_share_page() and uv_unshare_page().
- Patch "powerpc/svm: Convert SWIOTLB buffers to shared memory"
- Squashed into patch "powerpc/pseries/svm: Force SWIOTLB for secure
guests"
- Patch "powerpc/svm: Don't release SWIOTLB buffers on secure guests"
- Squashed into patch "powerpc/pseries/svm: Force SWIOTLB for secure
guests"
- Patch "powerpc/svm: Use SWIOTLB DMA API for all virtio devices"
- Dropped patch. Enablement of virtio will use a difference approach.
- Patch "powerpc/svm: Force the use of bounce buffers"
- Squashed into patch "powerpc/pseries/svm: Force SWIOTLB for secure
guests"
- Added comment explaining why it's necessary.to force use of SWIOTLB.
Suggested by Christoph Hellwig.
- Patch "powerpc/svm: Increase SWIOTLB buffer size"
- Dropped patch.
Anshuman Khandual (3):
powerpc/pseries/svm: Use shared memory for LPPACA structures
powerpc/pseries/svm: Use shared memory for Debug Trace Log (DTL)
powerpc/pseries/svm: Force SWIOTLB for secure guests
Benjamin Herrenschmidt (1):
powerpc: Add support for adding an ESM blob to the zImage wrapper
Ram Pai (3):
powerpc/prom_init: Add the ESM call to prom_init
powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE
powerpc/pseries/svm: Unshare all pages before kexecing a new kernel
Ryan Grimm (2):
powerpc/pseries/svm: Export guest SVM status to user space via sysfs
powerpc/configs: Enable secure guest support in pseries and ppc64
defconfigs
Sukadev Bhattiprolu (1):
powerpc/pseries/svm: Disable doorbells in SVM guests
Thiago Jung Bauermann (3):
powerpc/pseries: Introduce option to build secure virtual machines
powerpc/pseries: Add and use LPPACA_SIZE constant
powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests
.../admin-guide/kernel-parameters.txt | 5 +
arch/powerpc/boot/main.c | 41 ++++++++
arch/powerpc/boot/ops.h | 2 +
arch/powerpc/boot/wrapper | 24 ++++-
arch/powerpc/boot/zImage.lds.S | 8 ++
arch/powerpc/configs/ppc64_defconfig | 1 +
arch/powerpc/configs/pseries_defconfig | 1 +
arch/powerpc/include/asm/mem_encrypt.h | 26 +++++
arch/powerpc/include/asm/svm.h | 31 ++++++
arch/powerpc/include/asm/ultravisor-api.h | 4 +
arch/powerpc/include/asm/ultravisor.h | 23 ++++-
arch/powerpc/kernel/Makefile | 4 +-
arch/powerpc/kernel/machine_kexec_64.c | 8 ++
arch/powerpc/kernel/paca.c | 52 +++++++++-
arch/powerpc/kernel/prom_init.c | 99 +++++++++++++++++++
arch/powerpc/kernel/sysfs.c | 29 ++++++
arch/powerpc/platforms/pseries/Kconfig | 14 +++
arch/powerpc/platforms/pseries/Makefile | 1 +
arch/powerpc/platforms/pseries/iommu.c | 6 +-
arch/powerpc/platforms/pseries/setup.c | 5 +-
arch/powerpc/platforms/pseries/smp.c | 3 +-
arch/powerpc/platforms/pseries/svm.c | 85 ++++++++++++++++
22 files changed, 459 insertions(+), 13 deletions(-)
create mode 100644 arch/powerpc/include/asm/mem_encrypt.h
create mode 100644 arch/powerpc/include/asm/svm.h
create mode 100644 arch/powerpc/platforms/pseries/svm.c
^ permalink raw reply
* Re: [PATCH 0/3] Remove x86-specific code from generic headers
From: Thiago Jung Bauermann @ 2019-07-13 5:08 UTC (permalink / raw)
To: x86
Cc: linux-s390, Konrad Rzeszutek Wilk, Robin Murphy, Mike Anderson,
Ram Pai, linux-kernel, Alexey Dobriyan, Halil Pasic, iommu,
Ingo Molnar, Borislav Petkov, Thomas Lendacky, H. Peter Anvin,
linux-fsdevel, Thomas Gleixner, linuxppc-dev, Christoph Hellwig,
Marek Szyprowski
In-Reply-To: <20190713044554.28719-1-bauerman@linux.ibm.com>
I forgot to mark this series as v2 when generating the patches.
Sorry for the confusion.
--
Thiago Jung Bauermann
IBM Linux Technology Center
^ permalink raw reply
* [PATCH 2/3] DMA mapping: Move SME handling to x86-specific files
From: Thiago Jung Bauermann @ 2019-07-13 4:45 UTC (permalink / raw)
To: x86
Cc: linux-s390, Konrad Rzeszutek Wilk, Robin Murphy, Mike Anderson,
Ram Pai, linux-kernel, Alexey Dobriyan, Halil Pasic, iommu,
Ingo Molnar, Borislav Petkov, Thomas Lendacky, H. Peter Anvin,
linux-fsdevel, Thomas Gleixner, linuxppc-dev, Christoph Hellwig,
Thiago Jung Bauermann, Marek Szyprowski
In-Reply-To: <20190713044554.28719-1-bauerman@linux.ibm.com>
Secure Memory Encryption is an x86-specific feature, so it shouldn't appear
in generic kernel code.
In DMA mapping code, Christoph Hellwig mentioned that "There is no reason
why we should have a special debug printk just for one specific reason why
there is a requirement for a large DMA mask.", so we just remove
dma_check_mask().
In SWIOTLB code, there's no need to mention which memory encryption feature
is active, so just use a more generic warning. Besides, other architectures
will have different names for similar technology.
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
arch/s390/include/asm/mem_encrypt.h | 4 +---
arch/x86/include/asm/mem_encrypt.h | 10 ++++++++++
include/linux/mem_encrypt.h | 14 +-------------
kernel/dma/mapping.c | 8 --------
kernel/dma/swiotlb.c | 3 +--
5 files changed, 13 insertions(+), 26 deletions(-)
diff --git a/arch/s390/include/asm/mem_encrypt.h b/arch/s390/include/asm/mem_encrypt.h
index 3eb018508190..ff813a56bc30 100644
--- a/arch/s390/include/asm/mem_encrypt.h
+++ b/arch/s390/include/asm/mem_encrypt.h
@@ -4,9 +4,7 @@
#ifndef __ASSEMBLY__
-#define sme_me_mask 0ULL
-
-static inline bool sme_active(void) { return false; }
+static inline bool mem_encrypt_active(void) { return false; }
extern bool sev_active(void);
int set_memory_encrypted(unsigned long addr, int numpages);
diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h
index 0c196c47d621..848ce43b9040 100644
--- a/arch/x86/include/asm/mem_encrypt.h
+++ b/arch/x86/include/asm/mem_encrypt.h
@@ -92,6 +92,16 @@ early_set_memory_encrypted(unsigned long vaddr, unsigned long size) { return 0;
extern char __start_bss_decrypted[], __end_bss_decrypted[], __start_bss_decrypted_unused[];
+static inline bool mem_encrypt_active(void)
+{
+ return sme_me_mask;
+}
+
+static inline u64 sme_get_me_mask(void)
+{
+ return sme_me_mask;
+}
+
#endif /* __ASSEMBLY__ */
#endif /* __X86_MEM_ENCRYPT_H__ */
diff --git a/include/linux/mem_encrypt.h b/include/linux/mem_encrypt.h
index 470bd53a89df..0c5b0ff9eb29 100644
--- a/include/linux/mem_encrypt.h
+++ b/include/linux/mem_encrypt.h
@@ -18,23 +18,11 @@
#else /* !CONFIG_ARCH_HAS_MEM_ENCRYPT */
-#define sme_me_mask 0ULL
-
-static inline bool sme_active(void) { return false; }
+static inline bool mem_encrypt_active(void) { return false; }
static inline bool sev_active(void) { return false; }
#endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
-static inline bool mem_encrypt_active(void)
-{
- return sme_me_mask;
-}
-
-static inline u64 sme_get_me_mask(void)
-{
- return sme_me_mask;
-}
-
#ifdef CONFIG_AMD_MEM_ENCRYPT
/*
* The __sme_set() and __sme_clr() macros are useful for adding or removing
diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
index f7afdadb6770..b53fc7ec4914 100644
--- a/kernel/dma/mapping.c
+++ b/kernel/dma/mapping.c
@@ -291,12 +291,6 @@ void dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
}
EXPORT_SYMBOL(dma_free_attrs);
-static inline void dma_check_mask(struct device *dev, u64 mask)
-{
- if (sme_active() && (mask < (((u64)sme_get_me_mask() << 1) - 1)))
- dev_warn(dev, "SME is active, device will require DMA bounce buffers\n");
-}
-
int dma_supported(struct device *dev, u64 mask)
{
const struct dma_map_ops *ops = get_dma_ops(dev);
@@ -321,7 +315,6 @@ int dma_set_mask(struct device *dev, u64 mask)
return -EIO;
arch_dma_set_mask(dev, mask);
- dma_check_mask(dev, mask);
*dev->dma_mask = mask;
return 0;
}
@@ -333,7 +326,6 @@ int dma_set_coherent_mask(struct device *dev, u64 mask)
if (!dma_supported(dev, mask))
return -EIO;
- dma_check_mask(dev, mask);
dev->coherent_dma_mask = mask;
return 0;
}
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 62fa5a82a065..e52401f94e91 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -459,8 +459,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
panic("Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer");
if (mem_encrypt_active())
- pr_warn_once("%s is active and system is using DMA bounce buffers\n",
- sme_active() ? "SME" : "SEV");
+ pr_warn_once("Memory encryption is active and system is using DMA bounce buffers\n");
mask = dma_get_seg_boundary(hwdev);
^ permalink raw reply related
* [PATCH 3/3] fs/core/vmcore: Move sev_active() reference to x86 arch code
From: Thiago Jung Bauermann @ 2019-07-13 4:45 UTC (permalink / raw)
To: x86
Cc: linux-s390, Konrad Rzeszutek Wilk, Robin Murphy, Mike Anderson,
Ram Pai, linux-kernel, Alexey Dobriyan, Halil Pasic, iommu,
Ingo Molnar, Borislav Petkov, Thomas Lendacky, H. Peter Anvin,
linux-fsdevel, Thomas Gleixner, linuxppc-dev, Christoph Hellwig,
Thiago Jung Bauermann, Marek Szyprowski
In-Reply-To: <20190713044554.28719-1-bauerman@linux.ibm.com>
Secure Encrypted Virtualization is an x86-specific feature, so it shouldn't
appear in generic kernel code because it forces non-x86 architectures to
define the sev_active() function, which doesn't make a lot of sense.
To solve this problem, add an x86 elfcorehdr_read() function to override
the generic weak implementation. To do that, it's necessary to make
read_from_oldmem() public so that it can be used outside of vmcore.c.
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
arch/x86/kernel/crash_dump_64.c | 5 +++++
fs/proc/vmcore.c | 8 ++++----
include/linux/crash_dump.h | 14 ++++++++++++++
include/linux/mem_encrypt.h | 1 -
4 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/crash_dump_64.c b/arch/x86/kernel/crash_dump_64.c
index 22369dd5de3b..045e82e8945b 100644
--- a/arch/x86/kernel/crash_dump_64.c
+++ b/arch/x86/kernel/crash_dump_64.c
@@ -70,3 +70,8 @@ ssize_t copy_oldmem_page_encrypted(unsigned long pfn, char *buf, size_t csize,
{
return __copy_oldmem_page(pfn, buf, csize, offset, userbuf, true);
}
+
+ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos)
+{
+ return read_from_oldmem(buf, count, ppos, 0, sev_active());
+}
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 57957c91c6df..ca1f20bedd8c 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -100,9 +100,9 @@ static int pfn_is_ram(unsigned long pfn)
}
/* Reads a page from the oldmem device from given offset. */
-static ssize_t read_from_oldmem(char *buf, size_t count,
- u64 *ppos, int userbuf,
- bool encrypted)
+ssize_t read_from_oldmem(char *buf, size_t count,
+ u64 *ppos, int userbuf,
+ bool encrypted)
{
unsigned long pfn, offset;
size_t nr_bytes;
@@ -166,7 +166,7 @@ void __weak elfcorehdr_free(unsigned long long addr)
*/
ssize_t __weak elfcorehdr_read(char *buf, size_t count, u64 *ppos)
{
- return read_from_oldmem(buf, count, ppos, 0, sev_active());
+ return read_from_oldmem(buf, count, ppos, 0, false);
}
/*
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index f774c5eb9e3c..4664fc1871de 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -115,4 +115,18 @@ static inline int vmcore_add_device_dump(struct vmcoredd_data *data)
return -EOPNOTSUPP;
}
#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */
+
+#ifdef CONFIG_PROC_VMCORE
+ssize_t read_from_oldmem(char *buf, size_t count,
+ u64 *ppos, int userbuf,
+ bool encrypted);
+#else
+static inline ssize_t read_from_oldmem(char *buf, size_t count,
+ u64 *ppos, int userbuf,
+ bool encrypted)
+{
+ return -EOPNOTSUPP;
+}
+#endif /* CONFIG_PROC_VMCORE */
+
#endif /* LINUX_CRASHDUMP_H */
diff --git a/include/linux/mem_encrypt.h b/include/linux/mem_encrypt.h
index 0c5b0ff9eb29..5c4a18a91f89 100644
--- a/include/linux/mem_encrypt.h
+++ b/include/linux/mem_encrypt.h
@@ -19,7 +19,6 @@
#else /* !CONFIG_ARCH_HAS_MEM_ENCRYPT */
static inline bool mem_encrypt_active(void) { return false; }
-static inline bool sev_active(void) { return false; }
#endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
^ permalink raw reply related
* [PATCH 1/3] x86, s390: Move ARCH_HAS_MEM_ENCRYPT definition to arch/Kconfig
From: Thiago Jung Bauermann @ 2019-07-13 4:45 UTC (permalink / raw)
To: x86
Cc: linux-s390, Konrad Rzeszutek Wilk, Robin Murphy, Mike Anderson,
Ram Pai, linux-kernel, Alexey Dobriyan, Halil Pasic, iommu,
Ingo Molnar, Borislav Petkov, Thomas Lendacky, H. Peter Anvin,
linux-fsdevel, Thomas Gleixner, linuxppc-dev, Christoph Hellwig,
Thiago Jung Bauermann, Marek Szyprowski
In-Reply-To: <20190713044554.28719-1-bauerman@linux.ibm.com>
powerpc is also going to use this feature, so put it in a generic location.
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/Kconfig | 3 +++
arch/s390/Kconfig | 3 ---
arch/x86/Kconfig | 4 +---
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index c47b328eada0..4ef3499d4480 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -927,6 +927,9 @@ config LOCK_EVENT_COUNTS
the chance of application behavior change because of timing
differences. The counts are reported via debugfs.
+config ARCH_HAS_MEM_ENCRYPT
+ bool
+
source "kernel/gcov/Kconfig"
source "scripts/gcc-plugins/Kconfig"
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 5d8570ed6cab..f820e631bf89 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -1,7 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-config ARCH_HAS_MEM_ENCRYPT
- def_bool y
-
config MMU
def_bool y
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c9f331bb538b..5d3295f2df94 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -68,6 +68,7 @@ config X86
select ARCH_HAS_FORTIFY_SOURCE
select ARCH_HAS_GCOV_PROFILE_ALL
select ARCH_HAS_KCOV if X86_64
+ select ARCH_HAS_MEM_ENCRYPT
select ARCH_HAS_MEMBARRIER_SYNC_CORE
select ARCH_HAS_PMEM_API if X86_64
select ARCH_HAS_PTE_SPECIAL
@@ -1520,9 +1521,6 @@ config X86_CPA_STATISTICS
helps to determine the effectiveness of preserving large and huge
page mappings when mapping protections are changed.
-config ARCH_HAS_MEM_ENCRYPT
- def_bool y
-
config AMD_MEM_ENCRYPT
bool "AMD Secure Memory Encryption (SME) support"
depends on X86_64 && CPU_SUP_AMD
^ permalink raw reply related
* [PATCH 0/3] Remove x86-specific code from generic headers
From: Thiago Jung Bauermann @ 2019-07-13 4:45 UTC (permalink / raw)
To: x86
Cc: linux-s390, Konrad Rzeszutek Wilk, Robin Murphy, Mike Anderson,
Ram Pai, linux-kernel, Alexey Dobriyan, Halil Pasic, iommu,
Ingo Molnar, Borislav Petkov, Thomas Lendacky, H. Peter Anvin,
linux-fsdevel, Thomas Gleixner, linuxppc-dev, Christoph Hellwig,
Thiago Jung Bauermann, Marek Szyprowski
Hello,
This version mostly changes patch 2/3, removing dma_check_mask() from
kernel/dma/mapping.c as suggested by Christoph Hellwig, and also adapting
s390's <asm/mem_encrypt.h>. There's also a small change in patch 1/3 as
mentioned in the changelog below.
Patch 3/3 may or may not need to change s390 code depending on how Tom
Lendacky's patch is fixed to avoid breaking that architecture, so I haven't
made any changes for now.
These patches are applied on top of today's master which at the time was at
commit 9787aed57dd3 ("coresight: Make the coresight_device_fwnode_match
declaration's fwnode parameter const"), plus a cherry-pick of commit
e67a5ed1f86f ("dma-direct: Force unencrypted DMA under SME for certain DMA
masks"), which is in dma-mapping/for-next and comes from this patch:
https://lore.kernel.org/linux-iommu/10b83d9ff31bca88e94da2ff34e30619eb396078.1562785123.git.thomas.lendacky@amd.com/
I don't have a way to test SME, SEV, nor s390's PEF so the patches have only
been build tested.
Original cover letter below:
Both powerpc¹ and s390² are adding <asm/mem_encrypt.h> headers. Currently,
they have to supply definitions for functions and macros which only have a
meaning on x86: sme_me_mask, sme_active() and sev_active().
Christoph Hellwig made a suggestion to "clean up the Kconfig and generic
headers bits for memory encryption so that we don't need all this
boilerplate code", and this is what this patch does.
After this patch set, this is powerpc's <asm/mem_encrypt.h>:
#ifndef _ASM_POWERPC_MEM_ENCRYPT_H
#define _ASM_POWERPC_MEM_ENCRYPT_H
#include <asm/svm.h>
static inline bool mem_encrypt_active(void)
{
return is_secure_guest();
}
static inline bool force_dma_unencrypted(struct device *dev)
{
return is_secure_guest();
}
int set_memory_encrypted(unsigned long addr, int numpages);
int set_memory_decrypted(unsigned long addr, int numpages);
#endif /* _ASM_POWERPC_MEM_ENCRYPT_H */
Changelog
Since v1:
- Patch "x86,s390: Move ARCH_HAS_MEM_ENCRYPT definition to arch/Kconfig"
- Remove definition of ARCH_HAS_MEM_ENCRYPT from s390/Kconfig as well.
- Reworded patch title and message a little bit.
- Patch "DMA mapping: Move SME handling to x86-specific files"
- Adapt s390's <asm/mem_encrypt.h> as well.
- Remove dma_check_mask() from kernel/dma/mapping.c. Suggested by
Christoph Hellwig.
--
¹ https://lore.kernel.org/linuxppc-dev/20190521044912.1375-12-bauerman@linux.ibm.com/
² https://lore.kernel.org/kvm/20190612111236.99538-2-pasic@linux.ibm.com/
Thiago Jung Bauermann (3):
x86,s390: Move ARCH_HAS_MEM_ENCRYPT definition to arch/Kconfig
DMA mapping: Move SME handling to x86-specific files
fs/core/vmcore: Move sev_active() reference to x86 arch code
arch/Kconfig | 3 +++
arch/s390/Kconfig | 3 ---
arch/s390/include/asm/mem_encrypt.h | 4 +---
arch/x86/Kconfig | 4 +---
arch/x86/include/asm/mem_encrypt.h | 10 ++++++++++
arch/x86/kernel/crash_dump_64.c | 5 +++++
fs/proc/vmcore.c | 8 ++++----
include/linux/crash_dump.h | 14 ++++++++++++++
include/linux/mem_encrypt.h | 15 +--------------
kernel/dma/mapping.c | 8 --------
kernel/dma/swiotlb.c | 3 +--
11 files changed, 40 insertions(+), 37 deletions(-)
^ permalink raw reply
* [GIT PULL] Please pull powerpc/linux.git powerpc-5.3-1 tag
From: Michael Ellerman @ 2019-07-13 4:28 UTC (permalink / raw)
To: Linus Torvalds
Cc: geert+renesas, aik, schwab, stewart, gromero, yamada.masahiro,
oohall, blackgod016574, hch, mikey, nishadkamdar, aneesh.kumar,
yuehaibing, krzk, anju, rostedt, sjitindarsingh, alastair,
naveen.n.rao, nathanl, ravi.bangoria, ajd, geliangtang, groug,
efremov, zhangshaokun, cai, npiggin, dja, atrajeev, chunkeey,
malat, gregkh, linuxppc-dev, linux-kernel, andrew.donnellan,
fbarrat, sathnaga, info
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Linus,
Please pull powerpc updates for 5.3.
A bit of a small batch for us, just due to me not getting the time to review
things. Only one conflict that I'm aware of, in our pgtable.h, resolution is
simply to take both sides.
cheers
The following changes since commit cd6c84d8f0cdc911df435bb075ba22ce3c605b07:
Linux 5.2-rc2 (2019-05-26 16:49:19 -0700)
are available in the git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-5.3-1
for you to fetch changes up to f5a9e488d62360c91c5770bd55a0b40e419a71ce:
powerpc/powernv/idle: Fix restore of SPRN_LDBAR for POWER9 stop state. (2019-07-12 22:25:26 +1000)
- ------------------------------------------------------------------
powerpc updates for 5.3
Notable changes:
- Removal of the NPU DMA code, used by the out-of-tree Nvidia driver, as well
as some other functions only used by drivers that haven't (yet?) made it
upstream.
- A fix for a bug in our handling of hardware watchpoints (eg. perf record -e
mem: ...) which could lead to register corruption and kernel crashes.
- Enable HAVE_ARCH_HUGE_VMAP, which allows us to use large pages for vmalloc
when using the Radix MMU.
- A large but incremental rewrite of our exception handling code to use gas
macros rather than multiple levels of nested CPP macros.
And the usual small fixes, cleanups and improvements.
Thanks to:
Alastair D'Silva, Alexey Kardashevskiy, Andreas Schwab, Aneesh Kumar K.V, Anju
T Sudhakar, Anton Blanchard, Arnd Bergmann, Athira Rajeev, Cédric Le Goater,
Christian Lamparter, Christophe Leroy, Christophe Lombard, Christoph Hellwig,
Daniel Axtens, Denis Efremov, Enrico Weigelt, Frederic Barrat, Gautham R.
Shenoy, Geert Uytterhoeven, Geliang Tang, Gen Zhang, Greg Kroah-Hartman, Greg
Kurz, Gustavo Romero, Krzysztof Kozlowski, Madhavan Srinivasan, Masahiro
Yamada, Mathieu Malaterre, Michael Neuling, Nathan Lynch, Naveen N. Rao,
Nicholas Piggin, Nishad Kamdar, Oliver O'Halloran, Qian Cai, Ravi Bangoria,
Sachin Sant, Sam Bobroff, Satheesh Rajendran, Segher Boessenkool, Shaokun
Zhang, Shawn Anastasio, Stewart Smith, Suraj Jitindar Singh, Thiago Jung
Bauermann, YueHaibing.
- ------------------------------------------------------------------
Alastair D'Silva (1):
ocxl: Update for AFU descriptor template version 1.1
Alexey Kardashevskiy (5):
powerpc/pci/of: Fix OF flags parsing for 64bit BARs
powerpc/pseries/dma: Allow SWIOTLB
powerpc/pseries/dma: Enable SWIOTLB
powerpc/pci/of: Parse unassigned resources
powerpc/powernv: Fix stale iommu table base after VFIO
Andreas Schwab (1):
powerpc/mm/32s: fix condition that is always true
Aneesh Kumar K.V (16):
powerpc/mm: Remove unused variable declaration
powerpc/mm/hash/4k: Don't use 64K page size for vmemmap with 4K pagesize
powerpc/mm/radix: Use the right page size for vmemmap mapping
powerpc/mm/drconf: Use NUMA_NO_NODE on failures instead of node 0
powerpc/mm: Fix node look up with numa=off boot
powerpc/mm: Consolidate numa_enable check and min_common_depth check
powerpc/mm/nvdimm: Add an informative message if we fail to allocate altmap block
powerpc/pseries/scm: Mark the region volatile if cache flush not required
powerpc/nvdimm: Add support for multibyte read/write for metadata
powerpc/pseries/scm: Use a specific endian format for storing uuid from the device tree
powerpc/book3s: Use config independent helpers for page table walk
powerpc/mm: pmd_devmap implies pmd_large().
powerpc/mm: Remove radix dependency on HugeTLB page
powerpc/mm: Handle page table allocation failures
powerpc/mm/hugetlb: Fix kernel crash if we fail to allocate page table caches
powerpc/mm/hugetlb: Don't enable HugeTLB if we don't have a page table cache
Anju T Sudhakar (1):
powerpc/perf: Use cpumask_last() to determine the designated cpu for nest/core units.
Anton Blanchard (1):
powerpc/configs: Disable latencytop
Athira Rajeev (1):
powerpc/powernv/idle: Fix restore of SPRN_LDBAR for POWER9 stop state.
Christian Lamparter (1):
powerpc/4xx/uic: clear pending interrupt after irq type/pol change
Christoph Hellwig (5):
powerpc/powernv: remove the unused pnv_pci_set_p2p function
powerpc/powernv: remove the unused tunneling exports
powerpc/powernv: remove unused NPU DMA code
powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions
powerpc: remove device_to_mask()
Christophe Leroy (25):
powerpc/lib: fix redundant inclusion of quad.o
powerpc/lib: only build ldstfp.o when CONFIG_PPC_FPU is set
powerpc/64: mark start_here_multiplatform as __ref
powerpc/32s: fix suspend/resume when IBATs 4-7 are used
powerpc/ftrace: Enable C Version of recordmcount
powerpc: slightly improve cache helpers
powerpc/64: flush_inval_dcache_range() becomes flush_dcache_range()
powerpc/32: define helpers to get L1 cache sizes.
powerpc/64: reuse PPC32 static inline flush_dcache_range()
powerpc/8xx: move CPM1 related files from sysdev/ to platforms/8xx
powerpc/8xx: drop verify_patch()
powerpc/8xx: compact microcode arrays
powerpc/8xx: refactor writing of CPM microcode arrays
powerpc/8xx: Refactor microcode write
powerpc/8xx: refactor printing of microcode patch name.
powerpc/8xx: refactor programming of microcode CPM params.
powerpc/8xx: replace #ifdefs by IS_ENABLED() in microcode.c
powerpc/8xx: Use IO accessors in microcode programming.
powerpc/8xx: Add microcode patch to move SMC parameter RAM.
powerpc/boot: don't force gzipped uImage
powerpc/boot: Add lzma support for uImage
powerpc/boot: Add lzo support for uImage
powerpc: Move PPC_HA() PPC_HI() and PPC_LO() to ppc-opcode.h
powerpc/module32: Use symbolic instructions names.
powerpc/module64: Use symbolic instructions names.
Daniel Axtens (1):
powerpc/pseries/hvconsole: Fix stack overread via udbg
Denis Efremov (1):
selftests/powerpc: ppc_asm.h: typo in the header guard
Enrico Weigelt, metux IT consult (1):
powerpc/Kconfig: Clean up formatting
Frederic Barrat (1):
powerpc/powernv: Show checkstop reason for NPU2 HMIs
Geert Uytterhoeven (2):
powerpc/ps3: Use [] to denote a flexible array member
selftests/powerpc: Add missing newline at end of file
Geliang Tang (2):
powerpc/perf/24x7: use rb_entry
powerpc/cell: set no_llseek in spufs_cntl_fops
Gen Zhang (1):
powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property()
Greg Kroah-Hartman (1):
cxl: no need to check return value of debugfs_create functions
Greg Kurz (2):
powerpc/powernv/npu: Fix reference leak
powerpc/pseries: Fix xive=off command line
Gustavo Romero (1):
selftests/powerpc: Fix earlyclobber in tm-vmxcopy
Krzysztof Kozlowski (1):
powerpc/configs: Remove useless UEVENT_HELPER_PATH
Masahiro Yamada (4):
ocxl: do not use C++ style comments in uapi header
powerpc/mm: mark more tlb functions as __always_inline
powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h
powerpc/boot: pass CONFIG options in a simpler and more robust way
Mathieu Malaterre (2):
powerpc: Remove variable ‘path’ since not used
powerpc: silence a -Wcast-function-type warning in dawr_write_file_bool
Michael Ellerman (5):
Merge tag 'powerpc-5.2-6' into fixes
Merge branch 'fixes' into next
powerpc/64s/exception: Remove unused SOFTEN_VALUE_0x980
powerpc/module64: Fix comment in R_PPC64_ENTRY handling
powerpc/irq: Don't WARN continuously in arch_local_irq_restore()
Michael Neuling (3):
powerpc: Document xive=off option
powerpc: Fix compile issue with force DAWR
KVM: PPC: Book3S HV: Fix CR0 setting in TM emulation
Nathan Lynch (6):
powerpc/pseries: Fix oops in hotplug memory notifier
powerpc/cacheinfo: add cacheinfo_teardown, cacheinfo_rebuild
powerpc/pseries/mobility: prevent cpu hotplug during DT update
powerpc/pseries/mobility: rebuild cacheinfo hierarchy post-migration
powerpc/pseries: avoid blocking in irq when queuing hotplug events
powerpc/rtas: retry when cpu offline races with suspend/migration
Naveen N. Rao (11):
recordmcount: Fix spurious mcount entries on powerpc
powerpc/xmon: Fix disabling tracing while in xmon
powerpc/pseries: Use macros for referring to the DTL enable mask
powerpc/pseries: Do not save the previous DTL mask value
powerpc/pseries: Factor out DTL buffer allocation and registration routines
powerpc/pseries: Introduce rwlock to gatekeep DTLB usage
powerpc/pseries: Generalize hcall_vphn()
powerpc/pseries: Move mm/book3s64/vphn.c under platforms/pseries/
powerpc/pseries: Provide vcpu dispatch statistics
powerpc/pseries: Protect against hogging the cpu while setting up the stats
powerpc/pseries: Add documentation for vcpudispatch_stats
Nicholas Piggin (49):
powerpc/64: __ioremap_at clean up in the error case
powerpc/64s/radix: ioremap use ioremap_page_range
powerpc/64s/radix: Enable HAVE_ARCH_HUGE_VMAP
powerpc/64s/exception: fix line wrap and semicolon inconsistencies in macros
powerpc/64s/exception: remove H concatenation for EXC_HV variants
powerpc/64s/exception: consolidate EXCEPTION_PROLOG_2 with _NORI variant
powerpc/64s/exception: move and tidy EXCEPTION_PROLOG_2 variants
powerpc/64s/exception: fix sreset KVM test code
powerpc/64s/exception: remove the "extra" macro parameter
powerpc/64s/exception: consolidate maskable and non-maskable prologs
powerpc/64s/exception: merge KVM handler and skip variants
powerpc/64s/exception: KVM handler can set the HSRR trap bit
powerpc/64s/exception: Make EXCEPTION_PROLOG_0 a gas macro for consistency with others
powerpc/64s/exception: Move EXCEPTION_COMMON handler and return branches into callers
powerpc/64s/exception: Move EXCEPTION_COMMON additions into callers
powerpc/64s/exception: unwind exception-64s.h macros
powerpc/64s/exception: improve 0x500 handler code
powerpc/64s/exception: move EXCEPTION_PROLOG_2* to a more logical place
powerpc/64s/exception: remove STD_EXCEPTION_COMMON variants
powerpc/64s/exception: move KVM related code together
powerpc/64s/exception: move exception-64s.h code to exception-64s.S where it is used
powerpc/64s/exception: move head-64.h code to exception-64s.S where it is used
powerpc/64s/exception: remove __BRANCH_TO_KVM
powerpc/64s/exception: remove unused BRANCH_TO_COMMON
powerpc/64s/exception: use a gas macro for system call handler code
powerpc/64s/exception: fix indenting irregularities
powerpc/64s/exception: generate regs clear instructions using .rept
powerpc/64s/exception: remove pointless EXCEPTION_PROLOG macro indirection
powerpc/64s/exception: move paca save area offsets into exception-64s.S
powerpc/64s/exception: clean up system call entry
powerpc/64s/exception: avoid SPR RAW scoreboard stall in real mode entry
powerpc/64s/exception: mtmsrd L=1 cleanup
powerpc/64s/exception: windup use r9 consistently to restore SPRs
powerpc/64s/exception: move machine check windup in_mce handling
powerpc/64s/exception: simplify hmi windup code
powerpc/64s/exception: shuffle windup code around
powerpc/64s/exception: use common macro for windup
powerpc/64s/exception: add dar and dsisr options to exception macro
powerpc/64s/exception: machine check use standard macros to save dar/dsisr
powerpc/64s/exception: denorm handler use standard scratch save macro
powerpc/64s/exception: move SET_SCRATCH0 into EXCEPTION_PROLOG_0
powerpc/tm: update comment about interrupt re-entrancy
powerpc/64s/exception: remove bad stack branch
powerpc/64s/exception: optimise system_reset for idle, clean up non-idle case
powerpc/64s/exception: sreset move trampoline ahead of common code
powerpc/64s/exception: hmi remove special case macro
powerpc/64s/exception: simplify hmi control flow
powerpc/64s: Rename PPC_INVALIDATE_ERAT to PPC_ISA_3_0_INVALIDATE_ERAT
powerpc/64s/radix: keep kernel ERAT over local process/guest invalidates
Nishad Kamdar (1):
powerpc: Use the correct style for SPDX License Identifier
Oliver O'Halloran (1):
powerpc/eeh: Handle hugepages in ioremap space
Qian Cai (2):
powerpc/eeh_cache: fix a W=1 kernel-doc warning
powerpc/cacheflush: fix variable set but not used
Ravi Bangoria (1):
powerpc/watchpoint: Restore NV GPRs while returning from exception
Satheesh Rajendran (1):
powerpc: Enable CONFIG_IPV6 in ppc64_defconfig
Shaokun Zhang (1):
powerpc/64s: Fix misleading SPR and timebase information
Stewart Smith (2):
powerpc/powernv: Update firmware archaeology around OPAL_HANDLE_HMI
powerpc/powernv-eeh: Consisely desribe what this file does
Suraj Jitindar Singh (3):
KVM: PPC: Book3S HV: Signed extend decrementer value if not using large decrementer
KVM: PPC: Book3S HV: Clear pending decrementer exceptions on nested guest entry
powerpc: Add barrier_nospec to raw_copy_in_user()
YueHaibing (2):
powerpc/mm: Make some symbols static that can be
ocxl: Make ocxl_remove() static
Documentation/admin-guide/kernel-parameters.txt | 11 +-
Documentation/powerpc/vcpudispatch_stats.txt | 68 +
arch/powerpc/Kconfig | 48 +-
arch/powerpc/boot/.gitignore | 2 -
arch/powerpc/boot/Makefile | 16 +-
arch/powerpc/boot/serial.c | 1 -
arch/powerpc/boot/wrapper | 19 +-
arch/powerpc/boot/xz_config.h | 20 +
arch/powerpc/configs/40x/acadia_defconfig | 1 -
arch/powerpc/configs/40x/ep405_defconfig | 1 -
arch/powerpc/configs/40x/kilauea_defconfig | 1 -
arch/powerpc/configs/40x/klondike_defconfig | 1 -
arch/powerpc/configs/40x/makalu_defconfig | 1 -
arch/powerpc/configs/40x/obs600_defconfig | 1 -
arch/powerpc/configs/40x/virtex_defconfig | 1 -
arch/powerpc/configs/40x/walnut_defconfig | 1 -
arch/powerpc/configs/44x/akebono_defconfig | 1 -
arch/powerpc/configs/44x/arches_defconfig | 1 -
arch/powerpc/configs/44x/bamboo_defconfig | 1 -
arch/powerpc/configs/44x/bluestone_defconfig | 1 -
arch/powerpc/configs/44x/canyonlands_defconfig | 1 -
arch/powerpc/configs/44x/currituck_defconfig | 1 -
arch/powerpc/configs/44x/ebony_defconfig | 1 -
arch/powerpc/configs/44x/eiger_defconfig | 1 -
arch/powerpc/configs/44x/fsp2_defconfig | 1 -
arch/powerpc/configs/44x/icon_defconfig | 1 -
arch/powerpc/configs/44x/iss476-smp_defconfig | 1 -
arch/powerpc/configs/44x/katmai_defconfig | 1 -
arch/powerpc/configs/44x/rainier_defconfig | 1 -
arch/powerpc/configs/44x/redwood_defconfig | 1 -
arch/powerpc/configs/44x/sam440ep_defconfig | 1 -
arch/powerpc/configs/44x/sequoia_defconfig | 1 -
arch/powerpc/configs/44x/taishan_defconfig | 1 -
arch/powerpc/configs/44x/virtex5_defconfig | 1 -
arch/powerpc/configs/44x/warp_defconfig | 1 -
arch/powerpc/configs/52xx/cm5200_defconfig | 1 -
arch/powerpc/configs/52xx/lite5200b_defconfig | 1 -
arch/powerpc/configs/52xx/motionpro_defconfig | 1 -
arch/powerpc/configs/52xx/pcm030_defconfig | 1 -
arch/powerpc/configs/52xx/tqm5200_defconfig | 1 -
arch/powerpc/configs/83xx/asp8347_defconfig | 1 -
arch/powerpc/configs/83xx/mpc8313_rdb_defconfig | 1 -
arch/powerpc/configs/83xx/mpc8315_rdb_defconfig | 1 -
arch/powerpc/configs/83xx/mpc832x_mds_defconfig | 1 -
arch/powerpc/configs/83xx/mpc832x_rdb_defconfig | 1 -
arch/powerpc/configs/83xx/mpc834x_itx_defconfig | 1 -
arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig | 1 -
arch/powerpc/configs/83xx/mpc834x_mds_defconfig | 1 -
arch/powerpc/configs/83xx/mpc836x_mds_defconfig | 1 -
arch/powerpc/configs/83xx/mpc836x_rdk_defconfig | 1 -
arch/powerpc/configs/83xx/mpc837x_mds_defconfig | 1 -
arch/powerpc/configs/83xx/mpc837x_rdb_defconfig | 1 -
arch/powerpc/configs/85xx/ge_imp3a_defconfig | 1 -
arch/powerpc/configs/85xx/ksi8560_defconfig | 1 -
arch/powerpc/configs/85xx/mpc8540_ads_defconfig | 1 -
arch/powerpc/configs/85xx/mpc8560_ads_defconfig | 1 -
arch/powerpc/configs/85xx/mpc85xx_cds_defconfig | 1 -
arch/powerpc/configs/85xx/sbc8548_defconfig | 1 -
arch/powerpc/configs/85xx/stx_gp3_defconfig | 1 -
arch/powerpc/configs/85xx/tqm8548_defconfig | 1 -
arch/powerpc/configs/85xx/xes_mpc85xx_defconfig | 1 -
arch/powerpc/configs/adder875_defconfig | 1 -
arch/powerpc/configs/amigaone_defconfig | 1 -
arch/powerpc/configs/cell_defconfig | 1 -
arch/powerpc/configs/chrp32_defconfig | 1 -
arch/powerpc/configs/ep8248e_defconfig | 1 -
arch/powerpc/configs/ep88xc_defconfig | 1 -
arch/powerpc/configs/fsl-emb-nonhw.config | 1 -
arch/powerpc/configs/g5_defconfig | 2 -
arch/powerpc/configs/gamecube_defconfig | 2 -
arch/powerpc/configs/holly_defconfig | 1 -
arch/powerpc/configs/linkstation_defconfig | 1 -
arch/powerpc/configs/maple_defconfig | 2 -
arch/powerpc/configs/mgcoge_defconfig | 1 -
arch/powerpc/configs/mpc512x_defconfig | 1 -
arch/powerpc/configs/mpc5200_defconfig | 1 -
arch/powerpc/configs/mpc7448_hpc2_defconfig | 1 -
arch/powerpc/configs/mpc8272_ads_defconfig | 1 -
arch/powerpc/configs/mpc83xx_defconfig | 1 -
arch/powerpc/configs/mpc885_ads_defconfig | 1 -
arch/powerpc/configs/mvme5100_defconfig | 1 -
arch/powerpc/configs/pasemi_defconfig | 1 -
arch/powerpc/configs/pmac32_defconfig | 2 -
arch/powerpc/configs/powernv_defconfig | 2 -
arch/powerpc/configs/ppc40x_defconfig | 1 -
arch/powerpc/configs/ppc44x_defconfig | 1 -
arch/powerpc/configs/ppc64_defconfig | 4 +-
arch/powerpc/configs/ppc64e_defconfig | 2 -
arch/powerpc/configs/ppc6xx_defconfig | 2 -
arch/powerpc/configs/pq2fads_defconfig | 1 -
arch/powerpc/configs/ps3_defconfig | 1 -
arch/powerpc/configs/pseries_defconfig | 2 -
arch/powerpc/configs/skiroot_defconfig | 1 -
arch/powerpc/configs/storcenter_defconfig | 1 -
arch/powerpc/configs/tqm8xx_defconfig | 1 -
arch/powerpc/configs/wii_defconfig | 2 -
arch/powerpc/include/asm/book3s/64/mmu.h | 2 -
arch/powerpc/include/asm/book3s/64/pgtable.h | 30 +-
arch/powerpc/include/asm/book3s/64/radix.h | 3 +
arch/powerpc/include/asm/cache.h | 34 +-
arch/powerpc/include/asm/cacheflush.h | 46 +-
arch/powerpc/include/asm/exception-64s.h | 609 +--------
arch/powerpc/include/asm/head-64.h | 204 +--
arch/powerpc/include/asm/hw_breakpoint.h | 21 +-
arch/powerpc/include/asm/iommu.h | 8 -
arch/powerpc/include/asm/lppaca.h | 40 +
arch/powerpc/include/asm/opal-api.h | 1 +
arch/powerpc/include/asm/opal.h | 2 -
arch/powerpc/include/asm/paca.h | 2 +
arch/powerpc/include/asm/pgtable.h | 24 +
arch/powerpc/include/asm/pnv-ocxl.h | 2 +-
arch/powerpc/include/asm/pnv-pci.h | 6 -
arch/powerpc/include/asm/powernv.h | 22 -
arch/powerpc/include/asm/ppc-opcode.h | 20 +-
arch/powerpc/include/asm/ps3stor.h | 2 +-
arch/powerpc/include/asm/pte-walk.h | 28 +-
arch/powerpc/include/asm/topology.h | 6 +
arch/powerpc/include/asm/uaccess.h | 1 +
arch/powerpc/include/asm/vas.h | 10 -
arch/powerpc/kernel/Makefile | 1 +
arch/powerpc/kernel/asm-offsets.c | 2 +
arch/powerpc/kernel/cacheinfo.c | 21 +
arch/powerpc/kernel/cacheinfo.h | 4 +
arch/powerpc/kernel/dawr.c | 101 ++
arch/powerpc/kernel/dma-iommu.c | 40 +-
arch/powerpc/kernel/eeh.c | 15 +-
arch/powerpc/kernel/eeh_cache.c | 3 +
arch/powerpc/kernel/exceptions-64s.S | 1437 ++++++++++++++------
arch/powerpc/kernel/head_64.S | 2 +
arch/powerpc/kernel/hw_breakpoint.c | 56 -
arch/powerpc/kernel/irq.c | 6 +-
arch/powerpc/kernel/mce_power.c | 3 +-
arch/powerpc/kernel/misc_64.S | 52 -
arch/powerpc/kernel/module_32.c | 24 +-
arch/powerpc/kernel/module_64.c | 62 +-
arch/powerpc/kernel/pci_of_scan.c | 14 +-
arch/powerpc/kernel/process.c | 28 -
arch/powerpc/kernel/prom_init.c | 29 +-
arch/powerpc/kernel/rtas.c | 7 +-
arch/powerpc/kernel/swsusp_32.S | 73 +-
arch/powerpc/kernel/tm.S | 4 +-
arch/powerpc/kernel/trace/ftrace.c | 4 -
arch/powerpc/kvm/Kconfig | 7 +-
arch/powerpc/kvm/book3s_64_mmu_radix.c | 12 +-
arch/powerpc/kvm/book3s_hv.c | 13 +-
arch/powerpc/kvm/book3s_hv_builtin.c | 6 +-
arch/powerpc/kvm/book3s_hv_tm.c | 6 +-
arch/powerpc/lib/Makefile | 3 +-
arch/powerpc/lib/ldstfp.S | 4 -
arch/powerpc/lib/pmem.c | 8 +-
arch/powerpc/mm/book3s64/Makefile | 1 -
arch/powerpc/mm/book3s64/hash_native.c | 6 +-
arch/powerpc/mm/book3s64/hash_utils.c | 6 +-
arch/powerpc/mm/book3s64/mmu_context.c | 1 -
arch/powerpc/mm/book3s64/pgtable.c | 23 +-
arch/powerpc/mm/book3s64/radix_pgtable.c | 149 +-
arch/powerpc/mm/book3s64/radix_tlb.c | 40 +-
arch/powerpc/mm/book3s64/vphn.h | 16 -
arch/powerpc/mm/hugetlbpage.c | 25 +-
arch/powerpc/mm/init_64.c | 5 +-
arch/powerpc/mm/mem.c | 4 +-
arch/powerpc/mm/numa.c | 61 +-
arch/powerpc/mm/pgtable.c | 16 +-
arch/powerpc/mm/pgtable_32.c | 2 +-
arch/powerpc/mm/pgtable_64.c | 39 +-
arch/powerpc/mm/ptdump/ptdump.c | 6 +-
arch/powerpc/perf/hv-24x7.c | 2 +-
arch/powerpc/perf/imc-pmu.c | 14 +-
arch/powerpc/platforms/40x/Kconfig | 7 +-
arch/powerpc/platforms/44x/Kconfig | 10 +-
arch/powerpc/platforms/4xx/uic.c | 1 +
arch/powerpc/platforms/85xx/Kconfig | 8 +-
arch/powerpc/platforms/86xx/Kconfig | 6 +-
arch/powerpc/platforms/8xx/Kconfig | 7 +
arch/powerpc/platforms/8xx/Makefile | 2 +
arch/powerpc/{sysdev => platforms/8xx}/cpm1.c | 24 +-
arch/powerpc/platforms/8xx/micropatch.c | 378 +++++
arch/powerpc/platforms/Kconfig.cputype | 2 +-
arch/powerpc/platforms/cell/spufs/file.c | 2 +-
arch/powerpc/platforms/maple/Kconfig | 2 +-
arch/powerpc/platforms/powermac/sleep.S | 68 +-
arch/powerpc/platforms/powernv/eeh-powernv.c | 4 +-
arch/powerpc/platforms/powernv/idle.c | 8 +-
arch/powerpc/platforms/powernv/npu-dma.c | 571 +-------
arch/powerpc/platforms/powernv/opal-call.c | 1 -
arch/powerpc/platforms/powernv/opal-hmi.c | 40 +
arch/powerpc/platforms/powernv/opal.c | 23 +-
arch/powerpc/platforms/powernv/pci-ioda.c | 14 +-
arch/powerpc/platforms/powernv/pci.c | 145 --
arch/powerpc/platforms/powernv/pci.h | 6 -
arch/powerpc/platforms/powernv/vas-window.c | 19 -
arch/powerpc/platforms/powernv/vas.h | 20 -
arch/powerpc/platforms/pseries/Kconfig | 19 +-
arch/powerpc/platforms/pseries/Makefile | 1 +
arch/powerpc/platforms/pseries/dlpar.c | 12 +-
arch/powerpc/platforms/pseries/dtl.c | 23 +-
arch/powerpc/platforms/pseries/hotplug-memory.c | 3 +
arch/powerpc/platforms/pseries/hvconsole.c | 2 +-
arch/powerpc/platforms/pseries/lpar.c | 603 +++++++-
arch/powerpc/platforms/pseries/mobility.c | 19 +
arch/powerpc/platforms/pseries/papr_scm.c | 123 +-
arch/powerpc/platforms/pseries/setup.c | 39 +-
arch/powerpc/platforms/pseries/vio.c | 4 +-
.../{mm/book3s64 => platforms/pseries}/vphn.c | 20 +-
arch/powerpc/sysdev/Makefile | 2 -
arch/powerpc/sysdev/dart_iommu.c | 2 +-
arch/powerpc/sysdev/micropatch.c | 749 ----------
arch/powerpc/sysdev/xics/Kconfig | 13 +-
arch/powerpc/sysdev/xive/spapr.c | 52 +-
arch/powerpc/xmon/xmon.c | 14 +-
drivers/macintosh/smu.c | 4 +-
drivers/misc/ocxl/config.c | 181 ++-
drivers/misc/ocxl/pci.c | 2 +-
drivers/tty/hvc/hvc_vio.c | 16 +-
include/misc/ocxl.h | 5 +-
include/uapi/misc/ocxl.h | 14 +-
scripts/recordmcount.h | 3 +-
tools/testing/selftests/powerpc/mm/.gitignore | 2 +-
.../selftests/powerpc/stringloops/asm/ppc_asm.h | 2 +-
tools/testing/selftests/powerpc/tm/tm-vmxcopy.c | 2 +-
tools/testing/selftests/powerpc/vphn/Makefile | 2 +-
tools/testing/selftests/powerpc/vphn/asm/lppaca.h | 1 +
tools/testing/selftests/powerpc/vphn/vphn.c | 2 +-
tools/testing/selftests/powerpc/vphn/vphn.h | 1 -
224 files changed, 3638 insertions(+), 3538 deletions(-)
create mode 100644 Documentation/powerpc/vcpudispatch_stats.txt
create mode 100644 arch/powerpc/kernel/dawr.c
delete mode 100644 arch/powerpc/mm/book3s64/vphn.h
rename arch/powerpc/{sysdev => platforms/8xx}/cpm1.c (97%)
create mode 100644 arch/powerpc/platforms/8xx/micropatch.c
rename arch/powerpc/{mm/book3s64 => platforms/pseries}/vphn.c (80%)
delete mode 100644 arch/powerpc/sysdev/micropatch.c
create mode 120000 tools/testing/selftests/powerpc/vphn/asm/lppaca.h
delete mode 120000 tools/testing/selftests/powerpc/vphn/vphn.h
-----BEGIN PGP SIGNATURE-----
iQIcBAEBAgAGBQJdKV2kAAoJEFHr6jzI4aWAP20QALg3fgST74OyQlYvHsTGEF7l
g8HHDqTqWTbp/et8rBXvdloqEzhNQtuxvI3zU57Tk3IFus0t9ZgiRR2o1OmtzVFj
m7SE3NMl7ZilQQjAUQzzcXQqi6nBgyabZKXAp3XTYfIL84/2Lx/suHeKVgmUOM13
L3smL581NQCuqCUUJhZo2p8rS3Sy/t6YNbh+abMrG9cyK2mLOWQy48ndlxsF9YVv
GEYQ5ehRO57aIiiOWAMxAiPUJvzq+um0q/lWu+WC7wd0zXbZnxASLKiJc+C7QkLm
e+0xQWvzpSQs/qgcvAFlnyDPXCDAi3GpAIMN6DCK46IsoTTW0Zlsjs9BvMNKa95x
N2FXmGr4vm2xmhuT9rkRQp5KfqKbNpmCyCQc7PqA+rvTO3D3LaHXSr+ECICYQdOV
xNnybbY0DYFO5h+7Vr9qsS/vo0zNW1j0Q0lIiPhRPGqoSUrxUoJf52VfsARYJcaz
BsEZkPSNQpo27m205Cs6I9Qx5rbYTKyVqGuVPh1VQmy6IPfMzkLtlgvI1yIJw91a
qs2NYuMvS6VmTjHnu4ILkfyAsAPWnXJpPTGuoNhOBl62WjMG/RsJkzEv/FDidf1e
SHJbpM/MxxXWGKUClEFNjff1Oy8wU8CYFZm8Rwx4ZN/WSVRy4wGU1iqvl99rPxqi
ZhIuXGxiiyWSWJ6H10s7
=6P25
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: [PATCH 1/3] KVM: PPC: Book3S HV: Always save guest pmu for guest capable of nesting
From: Michael Ellerman @ 2019-07-13 3:47 UTC (permalink / raw)
To: Suraj Jitindar Singh, linuxppc-dev; +Cc: sjitindarsingh, kvm-ppc
In-Reply-To: <20190703012022.15644-1-sjitindarsingh@gmail.com>
Suraj Jitindar Singh <sjitindarsingh@gmail.com> writes:
> The performance monitoring unit (PMU) registers are saved on guest exit
> when the guest has set the pmcregs_in_use flag in its lppaca, if it
> exists, or unconditionally if it doesn't. If a nested guest is being
> run then the hypervisor doesn't, and in most cases can't, know if the
> pmu registers are in use since it doesn't know the location of the lppaca
> for the nested guest, although it may have one for its immediate guest.
> This results in the values of these registers being lost across nested
> guest entry and exit in the case where the nested guest was making use
> of the performance monitoring facility while it's nested guest hypervisor
> wasn't.
>
> Further more the hypervisor could interrupt a guest hypervisor between
> when it has loaded up the pmu registers and it calling H_ENTER_NESTED or
> between returning from the nested guest to the guest hypervisor and the
> guest hypervisor reading the pmu registers, in kvmhv_p9_guest_entry().
> This means that it isn't sufficient to just save the pmu registers when
> entering or exiting a nested guest, but that it is necessary to always
> save the pmu registers whenever a guest is capable of running nested guests
> to ensure the register values aren't lost in the context switch.
>
> Ensure the pmu register values are preserved by always saving their
> value into the vcpu struct when a guest is capable of running nested
> guests.
>
> This should have minimal performance impact however any impact can be
> avoided by booting a guest with "-machine pseries,cap-nested-hv=false"
> on the qemu commandline.
>
> Fixes: 95a6432ce903 "KVM: PPC: Book3S HV: Streamlined guest entry/exit path on P9 for radix guests"
I'm not clear why this and the next commit are marked as fixing the
above commit. Wasn't it broken prior to that commit as well?
cheers
> Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
> ---
> arch/powerpc/kvm/book3s_hv.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
> index ec1804f822af..b682a429f3ef 100644
> --- a/arch/powerpc/kvm/book3s_hv.c
> +++ b/arch/powerpc/kvm/book3s_hv.c
> @@ -3654,6 +3654,8 @@ int kvmhv_p9_guest_entry(struct kvm_vcpu *vcpu, u64 time_limit,
> vcpu->arch.vpa.dirty = 1;
> save_pmu = lp->pmcregs_in_use;
> }
> + /* Must save pmu if this guest is capable of running nested guests */
> + save_pmu |= nesting_enabled(vcpu->kvm);
>
> kvmhv_save_guest_pmu(vcpu, save_pmu);
>
> --
> 2.13.6
^ permalink raw reply
* [PATCH] powerpc: remove meaningless KBUILD_ARFLAGS addition
From: Masahiro Yamada @ 2019-07-13 3:21 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev
Cc: Stephen Rothwell, linux-kernel, Nicholas Piggin, Masahiro Yamada,
Paul Mackerras
The KBUILD_ARFLAGS addition in arch/powerpc/Makefile has never worked
in a useful way because it is always overridden by the following code
in the top Makefile:
# use the deterministic mode of AR if available
KBUILD_ARFLAGS := $(call ar-option,D)
The code in the top Makefile was added in 2011, by commit 40df759e2b9e
("kbuild: Fix build with binutils <= 2.19").
The KBUILD_ARFLAGS addition for ppc has always been dead code from the
beginning.
Nobody has reported a problem since 43c9127d94d6 ("powerpc: Add option
to use thin archives"), so this code was unneeded.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/powerpc/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index c345b79414a9..46ed198a3aa3 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -112,7 +112,6 @@ ifeq ($(HAS_BIARCH),y)
KBUILD_CFLAGS += -m$(BITS)
KBUILD_AFLAGS += -m$(BITS) -Wl,-a$(BITS)
KBUILD_LDFLAGS += -m elf$(BITS)$(LDEMULATION)
-KBUILD_ARFLAGS += --target=elf$(BITS)-$(GNUTARGET)
endif
cflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard=tls
--
2.17.1
^ permalink raw reply related
* Re: [PATCH v9 05/10] namei: O_BENEATH-style path resolution flags
From: Al Viro @ 2019-07-13 2:41 UTC (permalink / raw)
To: Aleksa Sarai
Cc: linux-ia64, linux-sh, Alexei Starovoitov, linux-kernel,
David Howells, linux-kselftest, sparclinux, Shuah Khan,
linux-arch, linux-s390, Tycho Andersen, Aleksa Sarai,
linux-arm-kernel, linux-mips, linux-xtensa, Kees Cook,
Arnd Bergmann, Jann Horn, linuxppc-dev, linux-m68k,
Andy Lutomirski, Shuah Khan, David Drysdale, Christian Brauner,
J. Bruce Fields, linux-parisc, linux-api, Chanho Min, Jeff Layton,
Oleg Nesterov, Eric Biederman, linux-alpha, linux-fsdevel,
Andrew Morton, Linus Torvalds, containers
In-Reply-To: <20190712150026.GO17978@ZenIV.linux.org.uk>
On Fri, Jul 12, 2019 at 04:00:26PM +0100, Al Viro wrote:
> On Fri, Jul 12, 2019 at 02:25:53PM +0100, Al Viro wrote:
>
> > if (flags & LOOKUP_BENEATH) {
> > nd->root = nd->path;
> > if (!(flags & LOOKUP_RCU))
> > path_get(&nd->root);
> > else
> > nd->root_seq = nd->seq;
>
> BTW, this assignment is needed for LOOKUP_RCU case. Without it
> you are pretty much guaranteed that lazy pathwalk will fail,
> when it comes to complete_walk().
>
> Speaking of which, what would happen if LOOKUP_ROOT/LOOKUP_BENEATH
> combination would someday get passed?
I don't understand what's going on with ->r_seq in there - your
call of path_is_under() is after having (re-)sampled rename_lock,
but if that was the only .. in there, who's going to recheck
the value? For that matter, what's to guarantee that the thing
won't get moved just as you are returning from handle_dots()?
IOW, what does LOOKUP_IN_ROOT guarantee for caller (openat2())?
^ permalink raw reply
* Re: [RFC PATCH kernel] powerpc/xive: Drop deregistered irqs
From: Benjamin Herrenschmidt @ 2019-07-12 23:47 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev
Cc: Greg Kurz, Nicholas Piggin, Paul Mackerras, Cédric Le Goater,
Alistair Popple, David Gibson
In-Reply-To: <3a34190f-560e-0b42-af38-0e39cef0beea@ozlabs.ru>
On Fri, 2019-07-12 at 19:37 +1000, Alexey Kardashevskiy wrote:
>
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/irq.c#n614
>
> If so, then in order to do EOI, I'll need the desc which is gone, or
> I am missing the point?
All you need is drop the local CPU priority.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 2/3] DMA mapping: Move SME handling to x86-specific files
From: Thiago Jung Bauermann @ 2019-07-12 23:42 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-s390, Mike Anderson, Konrad Rzeszutek Wilk, Robin Murphy,
x86, Ram Pai, linux-kernel, Halil Pasic, iommu, Ingo Molnar,
Borislav Petkov, Lendacky, Thomas, H. Peter Anvin, linux-fsdevel,
Thomas Gleixner, linuxppc-dev, Alexey Dobriyan, Marek Szyprowski
In-Reply-To: <20190712071328.GA22889@lst.de>
[ Cc'ing Tom Lendacky which I forgot to do earlier. Sorry about that. ]
Hello Christoph,
Christoph Hellwig <hch@lst.de> writes:
> Honestly I think this code should go away without any replacement.
> There is no reason why we should have a special debug printk just
> for one specific reason why there is a requirement for a large DMA
> mask.
Makes sense. I'll submit a v2 which just removes this code.
--
Thiago Jung Bauermann
IBM Linux Technology Center
^ permalink raw reply
* Re: [PATCH 1/3] x86/Kconfig: Move ARCH_HAS_MEM_ENCRYPT to arch/Kconfig
From: Thiago Jung Bauermann @ 2019-07-12 23:35 UTC (permalink / raw)
To: Thomas Gleixner
Cc: linux-s390, Mike Anderson, Konrad Rzeszutek Wilk, Robin Murphy,
x86, Ram Pai, linux-kernel, Alexey Dobriyan, Halil Pasic, iommu,
Ingo Molnar, Borislav Petkov, H. Peter Anvin, linux-fsdevel,
linuxppc-dev, Christoph Hellwig, Marek Szyprowski
In-Reply-To: <alpine.DEB.2.21.1907121804230.1788@nanos.tec.linutronix.de>
Hello Thomas,
Thanks for quickly reviewing the patches.
Thomas Gleixner <tglx@linutronix.de> writes:
> On Fri, 12 Jul 2019, Thiago Jung Bauermann wrote:
>
>> powerpc and s390 are going to use this feature as well, so put it in a
>> generic location.
>>
>> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
>
> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Thanks!
--
Thiago Jung Bauermann
IBM Linux Technology Center
^ permalink raw reply
* Re: [PATCH 3/3] fs/core/vmcore: Move sev_active() reference to x86 arch code
From: Thiago Jung Bauermann @ 2019-07-12 21:55 UTC (permalink / raw)
To: Halil Pasic
Cc: linux-s390, Mike Anderson, Konrad Rzeszutek Wilk, Robin Murphy,
x86, Ram Pai, linux-kernel, Alexey Dobriyan, iommu, Ingo Molnar,
Borislav Petkov, Lendacky, Thomas, H. Peter Anvin, linux-fsdevel,
Thomas Gleixner, linuxppc-dev, Christoph Hellwig,
Marek Szyprowski
In-Reply-To: <20190712150912.3097215e.pasic@linux.ibm.com>
[ Cc'ing Tom Lendacky which I forgot to do earlier. Sorry about that. ]
Hello Halil,
Thanks for the quick review.
Halil Pasic <pasic@linux.ibm.com> writes:
> On Fri, 12 Jul 2019 02:36:31 -0300
> Thiago Jung Bauermann <bauerman@linux.ibm.com> wrote:
>
>> Secure Encrypted Virtualization is an x86-specific feature, so it shouldn't
>> appear in generic kernel code because it forces non-x86 architectures to
>> define the sev_active() function, which doesn't make a lot of sense.
>
> sev_active() might be just bad (too specific) name for a general
> concept. s390 code defines it drives the right behavior in
> kernel/dma/direct.c (which uses it).
I thought about that but couldn't put my finger on a general concept.
Is it "guest with memory inaccessible to the host"?
Since your proposed definiton for force_dma_unencrypted() is simply to
make it equivalent to sev_active(), I thought it was more
straightforward to make each arch define force_dma_unencrypted()
directly.
Also, does sev_active() drive the right behavior for s390 in
elfcorehdr_read() as well?
>> To solve this problem, add an x86 elfcorehdr_read() function to override
>> the generic weak implementation. To do that, it's necessary to make
>> read_from_oldmem() public so that it can be used outside of vmcore.c.
>>
>> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
>> ---
>> arch/x86/kernel/crash_dump_64.c | 5 +++++
>> fs/proc/vmcore.c | 8 ++++----
>> include/linux/crash_dump.h | 14 ++++++++++++++
>> include/linux/mem_encrypt.h | 1 -
>> 4 files changed, 23 insertions(+), 5 deletions(-)
>
> Does not seem to apply to today's or yesterdays master.
It assumes the presence of the two patches I mentioned in the cover
letter. Only one of them is in master.
I hadn't realized the s390 virtio patches were on their way to upstream.
I was keeping an eye on the email thread but didn't see they were picked
up in the s390 pull request. I'll add a new patch to this series making
the corresponding changes to s390's <asm/mem_encrypt.h> as well.
--
Thiago Jung Bauermann
IBM Linux Technology Center
^ permalink raw reply
* Re: [PATCH v4 1/8] KVM: PPC: Ultravisor: Introduce the MSR_S bit
From: Claudio Carvalho @ 2019-07-12 21:07 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev
Cc: Madhavan Srinivasan, Michael Anderson, Ram Pai, kvm-ppc,
Bharata B Rao, Ryan Grimm, Sukadev Bhattiprolu, Thiago Bauermann,
Anshuman Khandual
In-Reply-To: <1562892336.boqkwvamhq.astroid@bobo.none>
On 7/11/19 9:57 PM, Nicholas Piggin wrote:
> Claudio Carvalho's on June 29, 2019 6:08 am:
>> From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
>>
>> The ultravisor processor mode is introduced in POWER platforms that
>> supports the Protected Execution Facility (PEF). Ultravisor is higher
>> privileged than hypervisor mode.
>>
>> In PEF enabled platforms, the MSR_S bit is used to indicate if the
>> thread is in secure state. With the MSR_S bit, the privilege state of
>> the thread is now determined by MSR_S, MSR_HV and MSR_PR, as follows:
>>
>> S HV PR
>> -----------------------
>> 0 x 1 problem
>> 1 0 1 problem
>> x x 0 privileged
>> x 1 0 hypervisor
>> 1 1 0 ultravisor
>> 1 1 1 reserved
> What does this table mean? I thought 'x' meant either
Yes, it means either. The table was arranged that way to say that:
- hypervisor state is also a privileged state,
- ultravisor state is also a hypervisor state.
> , but in that
> case there are several states that can apply to the same
> combination of bits.
>
> Would it be clearer to rearrange the table so the columns are the HV
> and PR bits we know and love, plus the effect of S=1 on each of them?
>
> HV PR S=0 S=1
> ---------------------------------------------
> 0 0 privileged privileged (secure guest kernel)
> 0 1 problem problem (secure guest userspace)
> 1 0 hypervisor ultravisor
> 1 1 problem reserved
>
> Is that accurate?
Yes, it is. I also like this format. I will consider it.
>
>
>> The hypervisor doesn't (and can't) run with the MSR_S bit set, but a
>> secure guest and the ultravisor firmware do.
>>
>> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
>> Signed-off-by: Ram Pai <linuxram@us.ibm.com>
>> [ Update the commit message ]
>> Signed-off-by: Claudio Carvalho <cclaudio@linux.ibm.com>
>> ---
>> arch/powerpc/include/asm/reg.h | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
>> index 10caa145f98b..39b4c0a519f5 100644
>> --- a/arch/powerpc/include/asm/reg.h
>> +++ b/arch/powerpc/include/asm/reg.h
>> @@ -38,6 +38,7 @@
>> #define MSR_TM_LG 32 /* Trans Mem Available */
>> #define MSR_VEC_LG 25 /* Enable AltiVec */
>> #define MSR_VSX_LG 23 /* Enable VSX */
>> +#define MSR_S_LG 22 /* Secure VM bit */
>> #define MSR_POW_LG 18 /* Enable Power Management */
>> #define MSR_WE_LG 18 /* Wait State Enable */
>> #define MSR_TGPR_LG 17 /* TLB Update registers in use */
>> @@ -71,11 +72,13 @@
>> #define MSR_SF __MASK(MSR_SF_LG) /* Enable 64 bit mode */
>> #define MSR_ISF __MASK(MSR_ISF_LG) /* Interrupt 64b mode valid on 630 */
>> #define MSR_HV __MASK(MSR_HV_LG) /* Hypervisor state */
>> +#define MSR_S __MASK(MSR_S_LG) /* Secure state */
> This is a real nitpick, but why two different comments for the bit
> number and the mask?
Fixed for the next version. Both comments will be /* Secure state */
Thanks
Claudio
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox