Skip to content

Commit

Permalink
Changes representative of linux-4.18.0-305.7.1.el8_4.tar.xz
Browse files Browse the repository at this point in the history
  • Loading branch information
da-x committed Jun 14, 2021
1 parent 78b5e53 commit df12eda
Show file tree
Hide file tree
Showing 47 changed files with 969 additions and 727 deletions.
5 changes: 3 additions & 2 deletions .gitlab-ci-private.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ variables:
title: ${CI_COMMIT_TITLE}
kernel_type: internal
make_target: rpm
builder_image: quay.io/cki/builder-rhel8
build_kabi_whitelist: 'true'
builder_image: quay.io/cki/builder-rhel8.4
build_kabi_stablelist: 'true'
tree_yaml_name: rhel
publish_elsewhere: 'true'
disttag_override: '.el8_4'
skip_results: 'true'

realtime_check:
variables:
Expand Down
5 changes: 3 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ variables:
title: ${CI_COMMIT_TITLE}
kernel_type: internal
make_target: rpm
builder_image: quay.io/cki/builder-rhel8
build_kabi_whitelist: 'true'
builder_image: quay.io/cki/builder-rhel8.4
build_kabi_stablelist: 'true'
tree_yaml_name: rhel
publish_elsewhere: 'true'
disttag_override: '.el8_4'
Expand All @@ -31,6 +31,7 @@ realtime_check:
architectures: 'x86_64'
package_name: kernel-rt
skip_test: 'true'
skip_results: 'true'
trigger:
project: redhat/red-hat-ci-tools/kernel/cki-internal-pipelines/cki-internal-contributors
branch: rhel8
Expand Down
2 changes: 1 addition & 1 deletion Makefile.rhelver
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RHEL_MINOR = 4
#
# Use this spot to avoid future merge conflicts.
# Do not trim this comment.
RHEL_RELEASE = 305.3.1
RHEL_RELEASE = 305.7.1

#
# Early y+1 numbering
Expand Down
10 changes: 2 additions & 8 deletions arch/x86/include/asm/kvm_para.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#include <linux/interrupt.h>
#include <uapi/asm/kvm_para.h>

extern void kvmclock_init(void);

#ifdef CONFIG_KVM_GUEST
bool kvm_check_and_clear_guest_paused(void);
#else
Expand Down Expand Up @@ -86,13 +84,14 @@ static inline long kvm_hypercall4(unsigned int nr, unsigned long p1,
}

#ifdef CONFIG_KVM_GUEST
void kvmclock_init(void);
void kvmclock_disable(void);
bool kvm_para_available(void);
unsigned int kvm_arch_para_features(void);
unsigned int kvm_arch_para_hints(void);
void kvm_async_pf_task_wait_schedule(u32 token);
void kvm_async_pf_task_wake(u32 token);
u32 kvm_read_and_reset_apf_flags(void);
void kvm_disable_steal_time(void);
bool __kvm_handle_async_pf(struct pt_regs *regs, u32 token);

DECLARE_STATIC_KEY_FALSE(kvm_async_pf_enabled);
Expand Down Expand Up @@ -143,11 +142,6 @@ static inline u32 kvm_read_and_reset_apf_flags(void)
return 0;
}

static inline void kvm_disable_steal_time(void)
{
return;
}

static inline bool kvm_handle_async_pf(struct pt_regs *regs, u32 token)
{
return false;
Expand Down
132 changes: 85 additions & 47 deletions arch/x86/kernel/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <linux/kprobes.h>
#include <linux/nmi.h>
#include <linux/swait.h>
#include <linux/syscore_ops.h>
#include <asm/timer.h>
#include <asm/cpu.h>
#include <asm/traps.h>
Expand All @@ -49,6 +50,7 @@
#include <asm/tlb.h>
#include <asm/cpuidle_haltpoll.h>
#include <asm/ptrace.h>
#include <asm/reboot.h>
#include <asm/svm.h>

DEFINE_STATIC_KEY_FALSE(kvm_async_pf_enabled);
Expand Down Expand Up @@ -354,7 +356,7 @@ static void kvm_guest_cpu_init(void)

wrmsrl(MSR_KVM_ASYNC_PF_EN, pa);
__this_cpu_write(apf_reason.enabled, 1);
pr_info("KVM setup async PF for cpu %d\n", smp_processor_id());
pr_info("setup async PF for cpu %d\n", smp_processor_id());
}

if (kvm_para_has_feature(KVM_FEATURE_PV_EOI)) {
Expand All @@ -380,34 +382,17 @@ static void kvm_pv_disable_apf(void)
wrmsrl(MSR_KVM_ASYNC_PF_EN, 0);
__this_cpu_write(apf_reason.enabled, 0);

pr_info("Unregister pv shared memory for cpu %d\n", smp_processor_id());
pr_info("disable async PF for cpu %d\n", smp_processor_id());
}

static void kvm_pv_guest_cpu_reboot(void *unused)
static void kvm_disable_steal_time(void)
{
/*
* We disable PV EOI before we load a new kernel by kexec,
* since MSR_KVM_PV_EOI_EN stores a pointer into old kernel's memory.
* New kernel can re-enable when it boots.
*/
if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
wrmsrl(MSR_KVM_PV_EOI_EN, 0);
kvm_pv_disable_apf();
kvm_disable_steal_time();
}
if (!has_steal_clock)
return;

static int kvm_pv_reboot_notify(struct notifier_block *nb,
unsigned long code, void *unused)
{
if (code == SYS_RESTART)
on_each_cpu(kvm_pv_guest_cpu_reboot, NULL, 1);
return NOTIFY_DONE;
wrmsr(MSR_KVM_STEAL_TIME, 0, 0);
}

static struct notifier_block kvm_pv_reboot_nb = {
.notifier_call = kvm_pv_reboot_notify,
};

static u64 kvm_steal_clock(int cpu)
{
u64 steal;
Expand All @@ -425,14 +410,6 @@ static u64 kvm_steal_clock(int cpu)
return steal;
}

void kvm_disable_steal_time(void)
{
if (!has_steal_clock)
return;

wrmsr(MSR_KVM_STEAL_TIME, 0, 0);
}

static inline void __set_percpu_decrypted(void *ptr, unsigned long size)
{
early_set_memory_decrypted((unsigned long) ptr, size);
Expand Down Expand Up @@ -469,6 +446,27 @@ static bool pv_tlb_flush_supported(void)

static DEFINE_PER_CPU(cpumask_var_t, __pv_cpu_mask);

static void kvm_guest_cpu_offline(bool shutdown)
{
kvm_disable_steal_time();
if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
wrmsrl(MSR_KVM_PV_EOI_EN, 0);
kvm_pv_disable_apf();
if (!shutdown)
apf_task_wake_all();
kvmclock_disable();
}

static int kvm_cpu_online(unsigned int cpu)
{
unsigned long flags;

local_irq_save(flags);
kvm_guest_cpu_init();
local_irq_restore(flags);
return 0;
}

#ifdef CONFIG_SMP

static bool pv_ipi_supported(void)
Expand Down Expand Up @@ -596,31 +594,34 @@ static void __init kvm_smp_prepare_boot_cpu(void)
kvm_spinlock_init();
}

static void kvm_guest_cpu_offline(void)
static int kvm_cpu_down_prepare(unsigned int cpu)
{
kvm_disable_steal_time();
if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
wrmsrl(MSR_KVM_PV_EOI_EN, 0);
kvm_pv_disable_apf();
apf_task_wake_all();
unsigned long flags;

local_irq_save(flags);
kvm_guest_cpu_offline(false);
local_irq_restore(flags);
return 0;
}

static int kvm_cpu_online(unsigned int cpu)
#endif

static int kvm_suspend(void)
{
local_irq_disable();
kvm_guest_cpu_init();
local_irq_enable();
kvm_guest_cpu_offline(false);

return 0;
}

static int kvm_cpu_down_prepare(unsigned int cpu)
static void kvm_resume(void)
{
local_irq_disable();
kvm_guest_cpu_offline();
local_irq_enable();
return 0;
kvm_cpu_online(raw_smp_processor_id());
}
#endif

static struct syscore_ops kvm_syscore_ops = {
.suspend = kvm_suspend,
.resume = kvm_resume,
};

static void kvm_flush_tlb_others(const struct cpumask *cpumask,
const struct flush_tlb_info *info)
Expand Down Expand Up @@ -648,6 +649,37 @@ static void kvm_flush_tlb_others(const struct cpumask *cpumask,
native_flush_tlb_others(flushmask, info);
}

static void kvm_pv_guest_cpu_reboot(void *unused)
{
kvm_guest_cpu_offline(true);
}

static int kvm_pv_reboot_notify(struct notifier_block *nb,
unsigned long code, void *unused)
{
if (code == SYS_RESTART)
on_each_cpu(kvm_pv_guest_cpu_reboot, NULL, 1);
return NOTIFY_DONE;
}

static struct notifier_block kvm_pv_reboot_nb = {
.notifier_call = kvm_pv_reboot_notify,
};

/*
* After a PV feature is registered, the host will keep writing to the
* registered memory location. If the guest happens to shutdown, this memory
* won't be valid. In cases like kexec, in which you install a new kernel, this
* means a random memory location will be kept being written.
*/
#ifdef CONFIG_KEXEC_CORE
static void kvm_crash_shutdown(struct pt_regs *regs)
{
kvm_guest_cpu_offline(true);
native_machine_crash_shutdown(regs);
}
#endif

static void __init kvm_guest_init(void)
{
int i;
Expand Down Expand Up @@ -690,6 +722,12 @@ static void __init kvm_guest_init(void)
kvm_guest_cpu_init();
#endif

#ifdef CONFIG_KEXEC_CORE
machine_ops.crash_shutdown = kvm_crash_shutdown;
#endif

register_syscore_ops(&kvm_syscore_ops);

/*
* Hard lockup detection is enabled by default. Disable it, as guests
* can get false positives too easily, for example if the host is
Expand Down
26 changes: 1 addition & 25 deletions arch/x86/kernel/kvmclock.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <asm/hypervisor.h>
#include <asm/mem_encrypt.h>
#include <asm/x86_init.h>
#include <asm/reboot.h>
#include <asm/kvmclock.h>

static int kvmclock __initdata = 1;
Expand Down Expand Up @@ -203,28 +202,9 @@ static void kvm_setup_secondary_clock(void)
}
#endif

/*
* After the clock is registered, the host will keep writing to the
* registered memory location. If the guest happens to shutdown, this memory
* won't be valid. In cases like kexec, in which you install a new kernel, this
* means a random memory location will be kept being written. So before any
* kind of shutdown from our side, we unregister the clock by writing anything
* that does not have the 'enable' bit set in the msr
*/
#ifdef CONFIG_KEXEC_CORE
static void kvm_crash_shutdown(struct pt_regs *regs)
{
native_write_msr(msr_kvm_system_time, 0, 0);
kvm_disable_steal_time();
native_machine_crash_shutdown(regs);
}
#endif

static void kvm_shutdown(void)
void kvmclock_disable(void)
{
native_write_msr(msr_kvm_system_time, 0, 0);
kvm_disable_steal_time();
native_machine_shutdown();
}

static void __init kvmclock_init_mem(void)
Expand Down Expand Up @@ -352,10 +332,6 @@ void __init kvmclock_init(void)
#endif
x86_platform.save_sched_clock_state = kvm_save_sched_clock_state;
x86_platform.restore_sched_clock_state = kvm_restore_sched_clock_state;
machine_ops.shutdown = kvm_shutdown;
#ifdef CONFIG_KEXEC_CORE
machine_ops.crash_shutdown = kvm_crash_shutdown;
#endif
kvm_get_preset_lpj();

/*
Expand Down
1 change: 1 addition & 0 deletions certs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# Generated files
#
x509_certificate_list
x509_revocation_list
17 changes: 17 additions & 0 deletions certs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,21 @@ config SYSTEM_BLACKLIST_HASH_LIST
wrapper to incorporate the list into the kernel. Each <hash> should
be a string of hex digits.

config SYSTEM_REVOCATION_LIST
bool "Provide system-wide ring of revocation certificates"
depends on SYSTEM_BLACKLIST_KEYRING
depends on PKCS7_MESSAGE_PARSER=y
help
If set, this allows revocation certificates to be stored in the
blacklist keyring and implements a hook whereby a PKCS#7 message can
be checked to see if it matches such a certificate.

config SYSTEM_REVOCATION_KEYS
string "X.509 certificates to be preloaded into the system blacklist keyring"
depends on SYSTEM_REVOCATION_LIST
help
If set, this option should be the filename of a PEM-formatted file
containing X.509 certificates to be included in the default blacklist
keyring.

endmenu
Loading

0 comments on commit df12eda

Please sign in to comment.