Skip to content

Commit

Permalink
Changes representative of linux-3.10.0-862.2.3.el7.tar.xz
Browse files Browse the repository at this point in the history
  • Loading branch information
da-x committed Apr 30, 2018
1 parent 50b9ddc commit 6ccea3e
Show file tree
Hide file tree
Showing 62 changed files with 3,324 additions and 1,365 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EXTRAVERSION =
NAME = Unicycling Gorilla
RHEL_MAJOR = 7
RHEL_MINOR = 5
RHEL_RELEASE = 862
RHEL_RELEASE = 862.2.3

#
# DRM backport version
Expand Down
27 changes: 16 additions & 11 deletions arch/powerpc/include/asm/hvcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,17 +313,15 @@
#define H_SET_MODE_RESOURCE_LE 4

/* H_GET_CPU_CHARACTERISTICS return values */
#define H_GET_CPU_CHAR_CHAR_ORI31_SPEC_BAR PPC_BIT(0)
#define H_GET_CPU_CHAR_CHAR_BCCTR_SERIAL PPC_BIT(1)
#define H_GET_CPU_CHAR_CHAR_ORI30_L1_FLUSH PPC_BIT(2)
#define H_GET_CPU_CHAR_CHAR_MTTRIG2_L1_FLUSH PPC_BIT(3)
#define H_GET_CPU_CHAR_CHAR_L1D_PRIVATE PPC_BIT(4)
#define H_GET_CPU_CHAR_CHAR_BC_HINTS_HONORED PPC_BIT(5)
#define H_GET_CPU_CHAR_CHAR_MTTRID01_THR_CFG PPC_BIT(6)

#define H_GET_CPU_CHAR_BEHAV_FAV_SEC_VS_PERF PPC_BIT(0)
#define H_GET_CPU_CHAR_BEHAV_L1_FLUSH_LOW_PRIV PPC_BIT(1)
#define H_GET_CPU_CHAR_BEHAV_SPEC_BAR_BNDS_CHK PPC_BIT(2)
#define H_CPU_CHAR_SPEC_BAR_ORI31 (1ull << 63) // IBM bit 0
#define H_CPU_CHAR_BCCTRL_SERIALISED (1ull << 62) // IBM bit 1
#define H_CPU_CHAR_L1D_FLUSH_ORI30 (1ull << 61) // IBM bit 2
#define H_CPU_CHAR_L1D_FLUSH_TRIG2 (1ull << 60) // IBM bit 3
#define H_CPU_CHAR_L1D_THREAD_PRIV (1ull << 59) // IBM bit 4

#define H_CPU_BEHAV_FAVOUR_SECURITY (1ull << 63) // IBM bit 0
#define H_CPU_BEHAV_L1D_FLUSH_PR (1ull << 62) // IBM bit 1
#define H_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ull << 61) // IBM bit 2

#ifndef __ASSEMBLY__

Expand Down Expand Up @@ -456,6 +454,13 @@ extern long pSeries_disable_reloc_on_exc(void);

extern long pseries_big_endian_exceptions(void);

#include <asm/types.h>

struct h_cpu_char_result {
u64 character;
u64 behaviour;
};

#else

#define pSeries_enable_reloc_on_exc() do {} while (0)
Expand Down
14 changes: 6 additions & 8 deletions arch/powerpc/include/asm/plpar_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,18 +335,16 @@ static inline long plapr_set_watchpoint0(unsigned long dawr0, unsigned long dawr
return plpar_set_mode(0, 2, dawr0, dawrx0);
}

static inline long plpar_get_cpu_characteristics(unsigned long *character,
unsigned long *behavior)
static inline long plpar_get_cpu_characteristics(struct h_cpu_char_result *p)
{
long rc;
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
long rc;

rc = plpar_hcall(H_GET_CPU_CHARACTERISTICS, retbuf);

if (character)
*character = retbuf[0];
if (behavior)
*behavior = retbuf[1];
if (rc == H_SUCCESS) {
p->character = retbuf[0];
p->behaviour = retbuf[1];
}

return rc;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static void flush_tmregs_to_thread(struct task_struct *tsk)
* in the appropriate thread structures from live.
*/

if (tsk != current)
if ((!cpu_has_feature(CPU_FTR_TM)) || (tsk != current))
return;

if (MSR_TM_SUSPENDED(mfmsr())) {
Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/kvm/powerpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1335,16 +1335,16 @@ static int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
#ifdef CONFIG_PPC_PSERIES
static int pseries_get_cpu_char(struct kvm_ppc_cpu_char *cp)
{
unsigned long character, behaviour;
struct h_cpu_char_result c;
unsigned long rc;

if (!machine_is(pseries))
return -ENOTTY;

rc = plpar_get_cpu_characteristics(&character, &behaviour);
rc = plpar_get_cpu_characteristics(&c);
if (rc == H_SUCCESS) {
cp->character = character;
cp->behaviour = behaviour;
cp->character = c.character;
cp->behaviour = c.behaviour;
cp->character_mask = KVM_PPC_CPU_CHAR_SPEC_BAR_ORI31 |
KVM_PPC_CPU_CHAR_BCCTRL_SERIALISED |
KVM_PPC_CPU_CHAR_L1D_FLUSH_ORI30 |
Expand Down
4 changes: 4 additions & 0 deletions arch/powerpc/platforms/powernv/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ static void pnv_setup_rfi_flush(void)
if (np && of_property_read_bool(np, "disabled"))
enable--;

np = of_get_child_by_name(fw_features, "speculation-policy-favor-security");
if (np && of_property_read_bool(np, "disabled"))
enable = 0;

of_node_put(np);
of_node_put(fw_features);
}
Expand Down
12 changes: 7 additions & 5 deletions arch/powerpc/platforms/pseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,27 +524,29 @@ static void __init find_and_init_phbs(void)

static void pSeries_setup_rfi_flush(void)
{
unsigned long character, behaviour, rc;
struct h_cpu_char_result result;
enum l1d_flush_type types;
bool enable;
long rc;

/* Enable by default */
enable = true;

rc = plpar_get_cpu_characteristics(&character, &behaviour);
rc = plpar_get_cpu_characteristics(&result);
if (rc == H_SUCCESS) {
types = L1D_FLUSH_NONE;

if (character & H_GET_CPU_CHAR_CHAR_MTTRIG2_L1_FLUSH)
if (result.character & H_CPU_CHAR_L1D_FLUSH_TRIG2)
types |= L1D_FLUSH_MTTRIG;
if (character & H_GET_CPU_CHAR_CHAR_ORI30_L1_FLUSH)
if (result.character & H_CPU_CHAR_L1D_FLUSH_ORI30)
types |= L1D_FLUSH_ORI;

/* Use fallback if nothing set in hcall */
if (types == L1D_FLUSH_NONE)
types = L1D_FLUSH_FALLBACK;

if (!(behaviour & H_GET_CPU_CHAR_BEHAV_L1_FLUSH_LOW_PRIV))
if ((!(result.behaviour & H_CPU_BEHAV_L1D_FLUSH_PR)) ||
(!(result.behaviour & H_CPU_BEHAV_FAVOUR_SECURITY)))
enable = false;
} else {
/* Default to fallback if case hcall is not available */
Expand Down
12 changes: 8 additions & 4 deletions arch/x86/crypto/aesni-intel_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ static void aesni_gcm_enc_avx(void *ctx, u8 *out,
u8 *hash_subkey, const u8 *aad, unsigned long aad_len,
u8 *auth_tag, unsigned long auth_tag_len)
{
if (plaintext_len < AVX_GEN2_OPTSIZE) {
struct crypto_aes_ctx *aes_ctx = (struct crypto_aes_ctx*)ctx;
if ((plaintext_len < AVX_GEN2_OPTSIZE) || (aes_ctx->key_length != AES_KEYSIZE_128)){
aesni_gcm_enc(ctx, out, in, plaintext_len, iv, hash_subkey, aad,
aad_len, auth_tag, auth_tag_len);
} else {
Expand All @@ -207,7 +208,8 @@ static void aesni_gcm_dec_avx(void *ctx, u8 *out,
u8 *hash_subkey, const u8 *aad, unsigned long aad_len,
u8 *auth_tag, unsigned long auth_tag_len)
{
if (ciphertext_len < AVX_GEN2_OPTSIZE) {
struct crypto_aes_ctx *aes_ctx = (struct crypto_aes_ctx*)ctx;
if ((ciphertext_len < AVX_GEN2_OPTSIZE) || (aes_ctx->key_length != AES_KEYSIZE_128)) {
aesni_gcm_dec(ctx, out, in, ciphertext_len, iv, hash_subkey, aad,
aad_len, auth_tag, auth_tag_len);
} else {
Expand Down Expand Up @@ -241,7 +243,8 @@ static void aesni_gcm_enc_avx2(void *ctx, u8 *out,
u8 *hash_subkey, const u8 *aad, unsigned long aad_len,
u8 *auth_tag, unsigned long auth_tag_len)
{
if (plaintext_len < AVX_GEN2_OPTSIZE) {
struct crypto_aes_ctx *aes_ctx = (struct crypto_aes_ctx*)ctx;
if ((plaintext_len < AVX_GEN2_OPTSIZE) || (aes_ctx->key_length != AES_KEYSIZE_128)) {
aesni_gcm_enc(ctx, out, in, plaintext_len, iv, hash_subkey, aad,
aad_len, auth_tag, auth_tag_len);
} else if (plaintext_len < AVX_GEN4_OPTSIZE) {
Expand All @@ -260,7 +263,8 @@ static void aesni_gcm_dec_avx2(void *ctx, u8 *out,
u8 *hash_subkey, const u8 *aad, unsigned long aad_len,
u8 *auth_tag, unsigned long auth_tag_len)
{
if (ciphertext_len < AVX_GEN2_OPTSIZE) {
struct crypto_aes_ctx *aes_ctx = (struct crypto_aes_ctx*)ctx;
if ((ciphertext_len < AVX_GEN2_OPTSIZE) || (aes_ctx->key_length != AES_KEYSIZE_128)) {
aesni_gcm_dec(ctx, out, in, ciphertext_len, iv, hash_subkey,
aad, aad_len, auth_tag, auth_tag_len);
} else if (ciphertext_len < AVX_GEN4_OPTSIZE) {
Expand Down
4 changes: 3 additions & 1 deletion arch/x86/include/asm/hw_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ extern unsigned long io_apic_irqs;

extern void init_VISWS_APIC_irqs(void);
extern void setup_IO_APIC(void);
extern void disable_IO_APIC(void);

struct io_apic_irq_attr {
int ioapic;
Expand Down Expand Up @@ -220,10 +219,13 @@ extern void setup_vector_irq(int cpu);
extern void lock_vector_lock(void);
extern void unlock_vector_lock(void);
extern void __setup_vector_irq(int cpu);
extern void restore_boot_irq_mode(void);
extern void clear_IO_APIC(void);
#else
static inline void lock_vector_lock(void) {}
static inline void unlock_vector_lock(void) {}
static inline void __setup_vector_irq(int cpu) {}
static inline void restore_boot_irq_mode(void) { }
#endif

#endif /* !ASSEMBLY_ */
Expand Down
11 changes: 11 additions & 0 deletions arch/x86/include/asm/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ static inline void paravirt_release_pud(unsigned long pfn) {}
*/
extern gfp_t __userpte_alloc_gfp;

#ifdef CONFIG_KAISER
/*
* Instead of one pgd, we aquire two pgds. Being order-1, it is
* both 8k in size and 8k-aligned. That lets us just flip bit 12
* in a pointer to swap between the two 4k halves.
*/
#define PGD_ALLOCATION_ORDER 1
#else
#define PGD_ALLOCATION_ORDER 0
#endif

/*
* Allocate and free page tables.
*/
Expand Down
10 changes: 0 additions & 10 deletions arch/x86/include/asm/pgtable_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,6 @@ static inline void kaiser_unpoison_pgd_atomic(pgd_t *pgd)
static inline pgd_t kaiser_set_shadow_pgd(pgd_t *pgdp, pgd_t pgd)
{
#ifdef CONFIG_KAISER
extern bool in_efi_virtual_mode;

/*
* EFI virtual mode doesn't use 8k PGD, so there is no user
* page tables to set up.
*/
if (unlikely(in_efi_virtual_mode))
goto ret;

if (pgd_userspace_access(pgd)) {
if (pgdp_maps_userspace(pgdp)) {
VM_WARN_ON_ONCE(!is_kaiser_pgd(pgdp));
Expand Down Expand Up @@ -278,7 +269,6 @@ static inline pgd_t kaiser_set_shadow_pgd(pgd_t *pgdp, pgd_t pgd)
VM_WARN_ON_ONCE(system_state == SYSTEM_RUNNING &&
is_kaiser_pgd(pgdp));
}
ret:
#endif
/* return the copy of the PGD we want the kernel to use: */
return pgd;
Expand Down
1 change: 1 addition & 0 deletions arch/x86/include/asm/vmx.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ enum vmcs_field {
#define INTR_TYPE_NMI_INTR (2 << 8) /* NMI */
#define INTR_TYPE_HARD_EXCEPTION (3 << 8) /* processor exception */
#define INTR_TYPE_SOFT_INTR (4 << 8) /* software interrupt */
#define INTR_TYPE_PRIV_SW_EXCEPTION (5 << 8) /* ICE breakpoint - undocumented */
#define INTR_TYPE_SOFT_EXCEPTION (6 << 8) /* software exception */

/* GUEST_INTERRUPTIBILITY_INFO flags. */
Expand Down
12 changes: 2 additions & 10 deletions arch/x86/kernel/apic/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin)
mpc_ioapic_id(apic), pin);
}

static void clear_IO_APIC (void)
void clear_IO_APIC (void)
{
int apic, pin;

Expand Down Expand Up @@ -2034,16 +2034,8 @@ void native_disable_io_apic(void)

}

/*
* Not an __init, needed by the reboot code
*/
void disable_IO_APIC(void)
void restore_boot_irq_mode(void)
{
/*
* Clear the IO-APIC before rebooting:
*/
clear_IO_APIC();

if (!nr_legacy_irqs())
return;

Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/crash.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,10 @@ void native_machine_crash_shutdown(struct pt_regs *regs)
#ifdef CONFIG_X86_IO_APIC
/* Prevent crash_kexec() from deadlocking on ioapic_lock. */
ioapic_zap_locks();
disable_IO_APIC();
clear_IO_APIC();
#endif
lapic_shutdown();
restore_boot_irq_mode();
#ifdef CONFIG_HPET_TIMER
hpet_disable();
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \
.pushsection .kprobes.text, "ax"

paranoidzeroentry_ist debug do_debug DEBUG_STACK
paranoidzeroentry_ist int3 do_int3 DEBUG_STACK
zeroentry int3 do_int3
errorentry stack_segment do_stack_segment
#ifdef CONFIG_XEN
zeroentry xen_debug do_debug
Expand Down
8 changes: 4 additions & 4 deletions arch/x86/kernel/machine_kexec_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ void machine_kexec(struct kimage *image)
/*
* We need to put APICs in legacy mode so that we can
* get timer interrupts in second kernel. kexec/kdump
* paths already have calls to disable_IO_APIC() in
* one form or other. kexec jump path also need
* one.
* paths already have calls to restore_boot_irq_mode()
* in one form or other. kexec jump path also need one.
*/
disable_IO_APIC();
clear_IO_APIC();
restore_boot_irq_mode();
#endif
}

Expand Down
16 changes: 12 additions & 4 deletions arch/x86/kernel/machine_kexec_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@ int machine_kexec_prepare(struct kimage *image)
if (result)
return result;

#ifdef CONFIG_KAISER
/*
* The second page of control_code_page may be corrupted by the
* PTI code, so just clear the page for safety.
*/
clear_page(image->control_code_page + PAGE_SIZE);
#endif

/* update purgatory as needed */
result = arch_update_purgatory(image);
if (result)
Expand Down Expand Up @@ -273,11 +281,11 @@ void machine_kexec(struct kimage *image)
/*
* We need to put APICs in legacy mode so that we can
* get timer interrupts in second kernel. kexec/kdump
* paths already have calls to disable_IO_APIC() in
* one form or other. kexec jump path also need
* one.
* paths already have calls to restore_boot_irq_mode()
* in one form or other. kexec jump path also need one.
*/
disable_IO_APIC();
clear_IO_APIC();
restore_boot_irq_mode();
#endif
}

Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ void native_machine_shutdown(void)
* Even without the erratum, it still makes sense to quiet IO APIC
* before disabling Local APIC.
*/
disable_IO_APIC();
clear_IO_APIC();
#endif

#ifdef CONFIG_SMP
Expand All @@ -685,6 +685,7 @@ void native_machine_shutdown(void)
#endif

lapic_shutdown();
restore_boot_irq_mode();

#ifdef CONFIG_HPET_TIMER
hpet_disable();
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,6 @@ static void remove_siblinginfo(int cpu)
cpumask_clear(cpu_llc_shared_mask(cpu));
cpumask_clear(cpu_sibling_mask(cpu));
cpumask_clear(cpu_core_mask(cpu));
c->phys_proc_id = 0;
c->cpu_core_id = 0;
cpumask_clear_cpu(cpu, cpu_sibling_setup_mask);
recompute_smt_state();
Expand Down
Loading

0 comments on commit 6ccea3e

Please sign in to comment.