Commit 36353d86 authored by Juerg Haefliger's avatar Juerg Haefliger Committed by Stefan Bader

Revert "UBUNTU: SAUCE: rfi-flush: Refactor the macros so the nops are defined once"

This reverts commit d275a2d6.

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1756121

The functionality of this commit will be provided by the following
upstream patch series:
  * powerpc/64s: Allow control of RFI flush via debugfs
  * powerpc/64s: Wire up cpu_show_meltdown()
  * powerpc/powernv: Check device-tree for RFI flush settings
  * powerpc/pseries: Query hypervisor for RFI flush settings
  * powerpc/64s: Support disabling RFI flush with no_rfi_flush and nopti
  * powerpc/64s: Add support for RFI flush of L1-D cache
  * powerpc/64s: Convert slb_miss_common to use RFI_TO_USER/KERNEL
  * powerpc/64: Convert the syscall exit path to use RFI_TO_USER/KERNEL
  * powerpc/64: Convert fast_exception_return to use RFI_TO_USER/KERNEL
  * powerpc/64s: Simple RFI macro conversions
  * powerpc/64: Add macros for annotating the destination of rfid/hrfid
  * powerpc/pseries: Add H_GET_CPU_CHARACTERISTICS flags & wrapper
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent aff95668
...@@ -53,10 +53,16 @@ ...@@ -53,10 +53,16 @@
#define EX_CTR 96 #define EX_CTR 96
/* /*
* The nop instructions allow us to insert one or more instructions to flush the * The nop instruction allows a secure memory protection instruction to be
* L1-D cache when return to userspace or a guest. * inserted with the rfi flush fixup.
*/ */
#define RFI_FLUSH_SLOT \ #define PREPARE_RFI_TO_USER \
RFI_FLUSH_FIXUP_SECTION; \
nop; \
nop; \
nop
#define PREPARE_RFI_TO_GUEST \
RFI_FLUSH_FIXUP_SECTION; \ RFI_FLUSH_FIXUP_SECTION; \
nop; \ nop; \
nop; \ nop; \
...@@ -80,17 +86,17 @@ ...@@ -80,17 +86,17 @@
#define RFI_TO_USER \ #define RFI_TO_USER \
CHECK_TARGET_MSR_PR(SPRN_SRR1, 1); \ CHECK_TARGET_MSR_PR(SPRN_SRR1, 1); \
RFI_FLUSH_SLOT; \ PREPARE_RFI_TO_USER; \
rfid; \ rfid; \
b rfi_flush_fallback b rfi_flush_fallback
#define RFI_TO_USER_OR_KERNEL \ #define RFI_TO_USER_OR_KERNEL \
RFI_FLUSH_SLOT; \ PREPARE_RFI_TO_USER; \
rfid; \ rfid; \
b rfi_flush_fallback b rfi_flush_fallback
#define RFI_TO_GUEST \ #define RFI_TO_GUEST \
RFI_FLUSH_SLOT; \ PREPARE_RFI_TO_GUEST; \
rfid; \ rfid; \
b rfi_flush_fallback b rfi_flush_fallback
...@@ -100,22 +106,25 @@ ...@@ -100,22 +106,25 @@
#define HRFI_TO_USER \ #define HRFI_TO_USER \
CHECK_TARGET_MSR_PR(SPRN_HSRR1, 1); \ CHECK_TARGET_MSR_PR(SPRN_HSRR1, 1); \
RFI_FLUSH_SLOT; \ PREPARE_RFI_TO_USER; \
hrfid; \ hrfid; \
b hrfi_flush_fallback b hrfi_flush_fallback
#define HRFI_TO_USER_OR_KERNEL \ #define HRFI_TO_USER_OR_KERNEL \
RFI_FLUSH_SLOT; \ PREPARE_RFI_TO_USER; \
hrfid; \ hrfid; \
b hrfi_flush_fallback b hrfi_flush_fallback
#define HRFI_TO_GUEST \ #define HRFI_TO_GUEST \
RFI_FLUSH_SLOT; \ PREPARE_RFI_TO_GUEST; \
hrfid; \ hrfid; \
b hrfi_flush_fallback b hrfi_flush_fallback
#define HRFI_TO_UNKNOWN \ #define HRFI_TO_UNKNOWN \
RFI_FLUSH_SLOT; \ RFI_FLUSH_FIXUP_SECTION; \
nop; \
nop; \
nop; \
hrfid; \ hrfid; \
b hrfi_flush_fallback b hrfi_flush_fallback
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment