- grep -i kvm grsecurity-3.1-4.4.6-201603171922.patch
- diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
- --- a/arch/arm/kvm/arm.c
- +++ b/arch/arm/kvm/arm.c
- static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_arm_running_vcpu);
- -static atomic64_t kvm_vmid_gen = ATOMIC64_INIT(1);
- +static atomic64_unchecked_t kvm_vmid_gen = ATOMIC64_INIT(1);
- static u8 kvm_next_vmid;
- static DEFINE_SPINLOCK(kvm_vmid_lock);
- static bool need_new_vmid_gen(struct kvm *kvm)
- - return unlikely(kvm->arch.vmid_gen != atomic64_read(&kvm_vmid_gen));
- + return unlikely(kvm->arch.vmid_gen != atomic64_read_unchecked(&kvm_vmid_gen));
- @@ -413,7 +413,7 @@ static void update_vttbr(struct kvm *kvm)
- if (unlikely(kvm_next_vmid == 0)) {
- - atomic64_inc(&kvm_vmid_gen);
- + atomic64_inc_unchecked(&kvm_vmid_gen);
- kvm_next_vmid = 1;
- @@ -430,7 +430,7 @@ static void update_vttbr(struct kvm *kvm)
- kvm_call_hyp(__kvm_flush_vm_context);
- - kvm->arch.vmid_gen = atomic64_read(&kvm_vmid_gen);
- + kvm->arch.vmid_gen = atomic64_read_unchecked(&kvm_vmid_gen);
- kvm->arch.vmid = kvm_next_vmid;
- kvm_next_vmid++;
- #ifdef CONFIG_KVM_GUEST
- #ifdef CONFIG_HAVE_KVM
- diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
- --- a/arch/x86/kernel/kvm.c
- +++ b/arch/x86/kernel/kvm.c
- @@ -553,7 +553,7 @@ static uint32_t __init kvm_detect(void)
- return kvm_cpuid_base();
- -const struct hypervisor_x86 x86_hyper_kvm __refconst = {
- +const struct hypervisor_x86 x86_hyper_kvm = {
- .name = "KVM",
- .detect = kvm_detect,
- .x2apic_available = kvm_para_available,
- diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
- --- a/arch/x86/kernel/kvmclock.c
- +++ b/arch/x86/kernel/kvmclock.c
- -static int kvmclock = 1;
- +static int kvmclock __read_only = 1;
- static int msr_kvm_system_time = MSR_KVM_SYSTEM_TIME;
- static int msr_kvm_wall_clock = MSR_KVM_WALL_CLOCK;
- static cycle_t kvm_sched_clock_offset;
- @@ -42,7 +42,7 @@ static int parse_no_kvmclock(char *arg)
- early_param("no-kvmclock", parse_no_kvmclock);
- @@ -156,7 +156,7 @@ bool kvm_check_and_clear_guest_paused(void)
- + if (!kvmclock)
- @@ -183,7 +183,7 @@ int kvm_register_clock(char *txt)
- + if (!kvmclock)
- @@ -243,7 +243,6 @@ static void kvm_shutdown(void)
- void __init kvmclock_init(void)
- @@ -261,15 +260,8 @@ void __init kvmclock_init(void)
- printk(KERN_INFO "kvm-clock: Using msrs %x and %x",
- msr_kvm_system_time, msr_kvm_wall_clock);
- if (kvm_register_clock("primary cpu clock")) {
- + kvmclock = 0;
- @@ -310,7 +302,7 @@ int __init kvm_setup_vsyscall_timeinfo(void)
- + if (!kvmclock)
- diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
- --- a/arch/x86/kvm/cpuid.c
- +++ b/arch/x86/kvm/cpuid.c
- @@ -206,15 +206,20 @@ int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
- struct kvm_cpuid2 *cpuid,
- struct kvm_cpuid_entry2 __user *entries)
- if (cpuid->nent > KVM_MAX_CPUID_ENTRIES)
- - cpuid->nent * sizeof(struct kvm_cpuid_entry2)))
- + if (!access_ok(VERIFY_READ, entries, cpuid->nent * sizeof(struct kvm_cpuid_entry2)))
- + struct kvm_cpuid_entry2 cpuid_entry;
- kvm_apic_set_version(vcpu);
- kvm_x86_ops->cpuid_update(vcpu);
- @@ -227,15 +232,19 @@ int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
- struct kvm_cpuid2 *cpuid,
- struct kvm_cpuid_entry2 __user *entries)
- - vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2)))
- + if (!access_ok(VERIFY_WRITE, entries, vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2)))
- + struct kvm_cpuid_entry2 cpuid_entry = vcpu->arch.cpuid_entries[i];
- diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
- --- a/arch/x86/kvm/emulate.c
- +++ b/arch/x86/kvm/emulate.c
- diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
- --- a/arch/x86/kvm/i8259.c
- +++ b/arch/x86/kvm/i8259.c
- static void pic_irq_request(struct kvm *kvm, int level);
- +static void pic_lock(struct kvm_pic *s) __acquires(&s->lock);
- static void pic_lock(struct kvm_pic *s)
- +static void pic_unlock(struct kvm_pic *s) __releases(&s->lock);
- static void pic_unlock(struct kvm_pic *s)
- struct kvm_vcpu *vcpu, *found = NULL;
- @@ -72,6 +72,7 @@ static void pic_unlock(struct kvm_pic *s)
- +static void pic_clear_isr(struct kvm_kpic_state *s, int irq) __must_hold(s->pics_state);
- static void pic_clear_isr(struct kvm_kpic_state *s, int irq)
- @@ -219,6 +220,7 @@ void kvm_pic_clear_all(struct kvm_pic *s, int irq_source_id)
- +static inline void pic_intack(struct kvm_kpic_state *s, int irq) __must_hold(s);
- static inline void pic_intack(struct kvm_kpic_state *s, int irq)
- @@ -273,6 +275,7 @@ int kvm_pic_read_irq(struct kvm *kvm)
- +void kvm_pic_reset(struct kvm_kpic_state *s) __must_hold(s);
- void kvm_pic_reset(struct kvm_kpic_state *s)
- @@ -307,6 +310,7 @@ void kvm_pic_reset(struct kvm_kpic_state *s)
- struct kvm_kpic_state *s = opaque;
- +static u32 pic_poll_read(struct kvm_kpic_state *s, u32 addr1) __must_hold(s);
- static u32 pic_poll_read(struct kvm_kpic_state *s, u32 addr1)
- @@ -422,6 +427,7 @@ static u32 pic_poll_read(struct kvm_kpic_state *s, u32 addr1)
- struct kvm_kpic_state *s = opaque;
- diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
- --- a/arch/x86/kvm/ioapic.c
- +++ b/arch/x86/kvm/ioapic.c
- @@ -405,6 +405,8 @@ static void kvm_ioapic_eoi_inject_work(struct work_struct *work)
- static void __kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu,
- + struct kvm_ioapic *ioapic, int vector, int trigger_mode) __must_hold(&ioapic->lock);
- +static void __kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu,
- struct kvm_ioapic *ioapic, int vector, int trigger_mode)
- diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
- --- a/arch/x86/kvm/lapic.c
- +++ b/arch/x86/kvm/lapic.c
- diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
- --- a/arch/x86/kvm/paging_tmpl.h
- +++ b/arch/x86/kvm/paging_tmpl.h
- if (unlikely(kvm_is_error_hva(host_addr)))
- diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
- --- a/arch/x86/kvm/svm.c
- +++ b/arch/x86/kvm/svm.c
- @@ -3490,7 +3490,11 @@ static void reload_tss(struct kvm_vcpu *vcpu)
- @@ -3885,6 +3889,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
- @@ -4260,7 +4268,7 @@ static void svm_sched_in(struct kvm_vcpu *vcpu, int cpu)
- -static struct kvm_x86_ops svm_x86_ops = {
- +static struct kvm_x86_ops svm_x86_ops __read_only = {
- .cpu_has_kvm_support = has_svm,
- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
- --- a/arch/x86/kvm/vmx.c
- +++ b/arch/x86/kvm/vmx.c
- @@ -2078,6 +2082,10 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
- vmcs_writel(HOST_TR_BASE, kvm_read_tr_base()); /* 22.2.4 */
- -static u64 guest_read_tsc(struct kvm_vcpu *vcpu)
- +static u64 __intentional_overflow(-1) guest_read_tsc(struct kvm_vcpu *vcpu)
- kvm_x86_ops->set_apic_access_page_addr = NULL;
- kvm_x86_ops->update_cr8_intercept = NULL;
- kvm_disable_largepages();
- kvm_tsc_scaling_ratio_frac_bits = 48;
- kvm_x86_ops->update_cr8_intercept = NULL;
- kvm_x86_ops->deliver_posted_interrupt = NULL;
- kvm_x86_ops->sync_pir_to_irr = vmx_sync_pir_to_irr_dummy;
- kvm_x86_ops->slot_enable_log_dirty = NULL;
- kvm_x86_ops->slot_disable_log_dirty = NULL;
- kvm_x86_ops->flush_log_dirty = NULL;
- kvm_x86_ops->enable_log_dirty_pt_masked = NULL;
- kvm_set_posted_intr_wakeup_handler(wakeup_handler);
- @@ -8601,6 +8622,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
- @@ -8653,6 +8680,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
- @@ -8666,7 +8698,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
- @@ -8675,8 +8707,18 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
- -static struct kvm_x86_ops vmx_x86_ops = {
- +static struct kvm_x86_ops vmx_x86_ops __read_only = {
- .cpu_has_kvm_support = cpu_has_kvm_support,
- diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
- --- a/arch/x86/kvm/x86.c
- +++ b/arch/x86/kvm/x86.c
- @@ -1937,8 +1937,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
- struct kvm *kvm = vcpu->kvm;
- - u8 *blob_addr = lm ? (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_64
- - : (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_32;
- + u8 __user *blob_addr = lm ? (u8 __user *)(long)kvm->arch.xen_hvm_config.blob_addr_64
- + : (u8 __user *)(long)kvm->arch.xen_hvm_config.blob_addr_32;
- u8 blob_size = lm ? kvm->arch.xen_hvm_config.blob_size_64
- : kvm->arch.xen_hvm_config.blob_size_32;
- @@ -2636,6 +2636,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
- @@ -3028,7 +3030,7 @@ static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu,
- static void fill_xsave(u8 *dest, struct kvm_vcpu *vcpu)
- @@ -3064,7 +3066,7 @@ static void fill_xsave(u8 *dest, struct kvm_vcpu *vcpu)
- static void load_xsave(struct kvm_vcpu *vcpu, u8 *src)
- @@ -3108,7 +3110,7 @@ static void kvm_vcpu_ioctl_x86_get_xsave(struct kvm_vcpu *vcpu,
- @@ -3133,7 +3135,7 @@ static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu,
- @@ -6363,6 +6365,7 @@ void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm,
- +static int vcpu_enter_guest(struct kvm_vcpu *vcpu) __must_hold(&vcpu->kvm->srcu);
- static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
- +static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu) __must_hold(&kvm->srcu);
- static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu)
- if (!kvm_arch_vcpu_runnable(vcpu) &&
- @@ -7158,7 +7162,7 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
- int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
- @@ -7175,7 +7179,7 @@ int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
- int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
- @@ -7191,9 +7195,9 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
- static void fx_init(struct kvm_vcpu *vcpu)
- @@ -7217,7 +7221,7 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
- kvm_put_guest_xcr0(vcpu);
- trace_kvm_fpu(1);
- @@ -7520,6 +7524,8 @@ bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu)
- struct static_key kvm_no_apic_vcpu __read_mostly;
- int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
- @@ -7536,11 +7542,14 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
- vcpu->arch.mp_state = KVM_MP_STATE_UNINITIALIZED;
- kvm_set_tsc_khz(vcpu, max_tsc_khz);
- kvm_mmu_destroy(vcpu);
- @@ -7613,6 +7625,8 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
- static_key_slow_dec(&kvm_no_apic_vcpu);
- void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu)
- +config GRKERNSEC_CONFIG_VIRT_KVM
- + bool "KVM"
- + Choose this option if this kernel is running as a KVM guest or host.
- + default y if GRKERNSEC_CONFIG_AUTO && (!X86 || GRKERNSEC_CONFIG_VIRT_NONE || (GRKERNSEC_CONFIG_VIRT_EPT && GRKERNSEC_CONFIG_VIRT_GUEST) || (GRKERNSEC_CONFIG_VIRT_EPT && GRKERNSEC_CONFIG_VIRT_KVM))
- +disable_so_addr_kvm_shadow_walk_iterator_3297 addr kvm_shadow_walk_iterator 0 3297 NULL
- +disable_so_last_tsc_khz_kvm_arch_3596 last_tsc_khz kvm_arch 0 3596 NULL
- +disable_so_r12_kvm_regs_3771 r12 kvm_regs 0 3771 NULL
- +disable_so_linear_address_kvm_translation_4366 linear_address kvm_translation 0 4366 NULL
- +disable_so_kvm_apic_match_physical_addr_fndecl_4632 kvm_apic_match_physical_addr fndecl 2 4632 NULL
- +disable_so_r10_kvm_regs_5730 r10 kvm_regs 0 5730 NULL
- +disable_so_nent_kvm_cpuid2_5883 nent kvm_cpuid2 0 5883 NULL
- +disable_so_kvm_lapic_set_vapic_addr_fndecl_6040 kvm_lapic_set_vapic_addr fndecl 2 6040 NULL
- +disable_so_set_tss_addr_kvm_x86_ops_6529 set_tss_addr kvm_x86_ops 2 6529 NULL
- +disable_so_kvm_clock_read_fndecl_6779 kvm_clock_read fndecl 0 6779 NULL
- +disable_so_adjust_tsc_offset_kvm_x86_ops_10575 adjust_tsc_offset kvm_x86_ops 2 10575 NULL
- +disable_so_ia32_tsc_adjust_msr_kvm_vcpu_arch_10939 ia32_tsc_adjust_msr kvm_vcpu_arch 0 10939 &disable_so_i_iw_freq_10939
- +disable_so_time_blocked_kvm_spinlock_stats_11970 time_blocked kvm_spinlock_stats 0 11970 NULL
- +disable_so_base_address_kvm_ioapic_14007 base_address kvm_ioapic 0 14007 NULL
- +disable_so_ept_identity_map_addr_kvm_arch_14060 ept_identity_map_addr kvm_arch 0 14060 NULL
- +disable_so_last_host_tsc_kvm_vcpu_arch_14836 last_host_tsc kvm_vcpu_arch 0 14836 NULL
- +disable_so_rcx_kvm_regs_15192 rcx kvm_regs 0 15192 NULL
- +disable_so_shadow_addr_kvm_shadow_walk_iterator_15604 shadow_addr kvm_shadow_walk_iterator 0 15604 NULL
- +disable_so_nmsrs_kvm_msr_list_16175 nmsrs kvm_msr_list 0 16175 NULL
- +disable_so_time_kvm_vcpu_arch_16718 time kvm_vcpu_arch 0 16718 NULL
- +disable_so_master_cycle_now_kvm_arch_17072 master_cycle_now kvm_arch 0 17072 NULL
- +disable_so_this_tsc_write_kvm_vcpu_arch_17221 this_tsc_write kvm_vcpu_arch 0 17221 NULL
- +disable_so_read_tsc_offset_kvm_x86_ops_18374 read_tsc_offset kvm_x86_ops 0 18374 NULL
- +disable_so_physical_address_kvm_translation_18550 physical_address kvm_translation 0 18550 NULL
- +disable_so_kvm_mtrr_set_msr_fndecl_18553 kvm_mtrr_set_msr fndecl 3 18553 NULL
- +disable_so_mask_kvm_mtrr_range_20079 mask kvm_mtrr_range 0 20079 NULL
- +disable_so_kvm_set_shared_msr_fndecl_20144 kvm_set_shared_msr fndecl 2 20144 &disable_so_nsec_timecounter_20144
- +disable_so_addr_kvm_async_pf_20788 addr kvm_async_pf 0 20788 &disable_so_s5m8767_set_voltage_time_sel_fndecl_20788
- +disable_so_rsp_kvm_regs_22061 rsp kvm_regs 0 22061 NULL
- +disable_so_r11_kvm_regs_22488 r11 kvm_regs 0 22488 NULL
- +disable_so_userspace_addr_kvm_memory_slot_22749 userspace_addr kvm_memory_slot 0 22749 NULL
- +disable_so_rbx_kvm_regs_22975 rbx kvm_regs 0 22975 NULL
- +disable_so_expired_tscdeadline_kvm_timer_23113 expired_tscdeadline kvm_timer 0 23113 NULL nohasharray
- +disable_so_dtoh_mb_data_addr_brcmf_pcie_shared_info_23113 dtoh_mb_data_addr brcmf_pcie_shared_info 0 23113 &disable_so_expired_tscdeadline_kvm_timer_23113
- +disable_so_set_tsc_khz_kvm_x86_ops_23439 set_tsc_khz kvm_x86_ops 2 23439 NULL
- +disable_so_kvm_send_hwpoison_signal_fndecl_23581 kvm_send_hwpoison_signal fndecl 1 23581 NULL
- +disable_so_tss_addr_kvm_arch_23642 tss_addr kvm_arch 0 23642 NULL
- +disable_so_kvm_get_lapic_tscdeadline_msr_fndecl_25821 kvm_get_lapic_tscdeadline_msr fndecl 0 25821 NULL
- +disable_so_kvm_inject_realmode_interrupt_fndecl_26018 kvm_inject_realmode_interrupt fndecl 2 26018 NULL
- +disable_so_base_address_kvm_lapic_26767 base_address kvm_lapic 0 26767 NULL
- +disable_so_kvm_apic_match_logical_addr_fndecl_27077 kvm_apic_match_logical_addr fndecl 2 27077 NULL
- +disable_so_compute_tsc_offset_kvm_x86_ops_28149 compute_tsc_offset kvm_x86_ops 0-2 28149 NULL
- +disable_so_cur_tsc_write_kvm_arch_28444 cur_tsc_write kvm_arch 0 28444 NULL
- +disable_so_kvm_hv_vapic_msr_write_fndecl_28670 kvm_hv_vapic_msr_write fndecl 3 28670 NULL
- +disable_so_rip_kvm_regs_28841 rip kvm_regs 0 28841 &disable_so_wl1273_fm_set_tx_freq_fndecl_28841
- +disable_so_rdi_kvm_regs_29022 rdi kvm_regs 0 29022 NULL
- +disable_so_kvm_max_guest_tsc_khz_vardecl_29276 kvm_max_guest_tsc_khz vardecl 0 29276 NULL
- +disable_so_kvm_apic_has_interrupt_fndecl_29462 kvm_apic_has_interrupt fndecl 0 29462 NULL
- +disable_so_hv_tsc_page_kvm_arch_30336 hv_tsc_page kvm_arch 0 30336 NULL
- +disable_so_r13_kvm_regs_30505 r13 kvm_regs 0 30505 &disable_so_i2c_smbus_read_word_data_fndecl_30505
- +disable_so_cur_tsc_offset_kvm_arch_31338 cur_tsc_offset kvm_arch 0 31338 &disable_so_ufs_bitmap_search_fndecl_31338
- +disable_so_last_tsc_write_kvm_arch_32069 last_tsc_write kvm_arch 0 32069 NULL
- +disable_so_nent_kvm_cpuid_32413 nent kvm_cpuid 0 32413 NULL
- +disable_so_kvm_get_apic_interrupt_fndecl_32843 kvm_get_apic_interrupt fndecl 0 32843 NULL
- +disable_so_kvmclock_offset_kvm_arch_33369 kvmclock_offset kvm_arch 0 33369 &disable_so_token_time_sfb_sched_data_33369
- +disable_so_rdx_kvm_regs_34602 rdx kvm_regs 0 34602 &disable_so_eee_timer_vardecl_sxgbe_main_c_34602
- +disable_so_rsi_kvm_regs_34605 rsi kvm_regs 0 34605 NULL
- +disable_so_phys_addr_kvm_coalesced_mmio_34828 phys_addr kvm_coalesced_mmio 0 34828 NULL
- +disable_so_kvm_set_irq_fndecl_35352 kvm_set_irq fndecl 3-2 35352 NULL
- +disable_so_host_kvm_shared_msr_values_35560 host kvm_shared_msr_values 0 35560 NULL
- +disable_so_kvm_vm_ioctl_set_tss_addr_fndecl_35702 kvm_vm_ioctl_set_tss_addr fndecl 2 35702 NULL
- +disable_so_read_l1_tsc_kvm_x86_ops_37977 read_l1_tsc kvm_x86_ops 0-2 37977 NULL
- +disable_so_curr_kvm_shared_msr_values_38468 curr kvm_shared_msr_values 0 38468 NULL
- +disable_so_kvm_x2apic_msr_write_fndecl_38601 kvm_x2apic_msr_write fndecl 3 38601 NULL
- +disable_so_last_guest_tsc_kvm_vcpu_arch_39290 last_guest_tsc kvm_vcpu_arch 0 39290 NULL
- +disable_so_kvm_mtrr_get_guest_memory_type_fndecl_41633 kvm_mtrr_get_guest_memory_type fndecl 2-0 41633 NULL
- +disable_so_kvm_clock_get_cycles_fndecl_41992 kvm_clock_get_cycles fndecl 0 41992 NULL
- +disable_so_addr_kvm_io_range_43786 addr kvm_io_range 0 43786 NULL
- +disable_so_tsc_offset_adjustment_kvm_vcpu_arch_45263 tsc_offset_adjustment kvm_vcpu_arch 0 45263 NULL
- +disable_so_r8_kvm_regs_45295 r8 kvm_regs 0 45295 NULL
- +disable_so_base_kvm_mtrr_range_45607 base kvm_mtrr_range 0 45607 &disable_so_laddr_c2wr_ae_active_connect_results_45607
- +disable_so_kvm_set_lapic_tscdeadline_msr_fndecl_47952 kvm_set_lapic_tscdeadline_msr fndecl 2 47952 NULL
- +disable_so_kvm_set_tsc_khz_fndecl_48520 kvm_set_tsc_khz fndecl 2 48520 NULL
- +disable_so_deliver_posted_interrupt_kvm_x86_ops_50698 deliver_posted_interrupt kvm_x86_ops 2 50698 NULL
- +disable_so_clock_kvm_clock_data_51363 clock kvm_clock_data 0 51363 NULL
- +disable_so_addr_kvm_coalesced_mmio_zone_51392 addr kvm_coalesced_mmio_zone 0 51392 NULL
- +disable_so_r14_kvm_regs_51526 r14 kvm_regs 0 51526 NULL
- +disable_so_guest_phys_addr_kvm_userspace_memory_region_51947 guest_phys_addr kvm_userspace_memory_region 0 51947 NULL
- +disable_so_vapic_addr_kvm_lapic_53599 vapic_addr kvm_lapic 0 53599 NULL
- +disable_so_last_retry_addr_kvm_vcpu_arch_54492 last_retry_addr kvm_vcpu_arch 0 54492 NULL
- +disable_so_kvm_get_tsc_khz_fndecl_55570 kvm_get_tsc_khz fndecl 0 55570 NULL
- +disable_so_write_tsc_offset_kvm_x86_ops_55825 write_tsc_offset kvm_x86_ops 2 55825 NULL
- +disable_so_kvm_get_time_scale_fndecl_56201 kvm_get_time_scale fndecl 1 56201 NULL
- +disable_so_deftype_kvm_mtrr_56712 deftype kvm_mtrr 0 56712 NULL
- +disable_so_tscdeadline_kvm_timer_57719 tscdeadline kvm_timer 0 57719 &disable_so_y_runtime_sc_57719
- +disable_so_vapic_addr_kvm_vapic_addr_57958 vapic_addr kvm_vapic_addr 0 57958 NULL
- +disable_so_ia32_misc_enable_msr_kvm_vcpu_arch_58022 ia32_misc_enable_msr kvm_vcpu_arch 0 58022 &disable_so_fc_gidpn_build_fndecl_58022
- +disable_so_kvm_mtrr_valid_fndecl_58049 kvm_mtrr_valid fndecl 3 58049 NULL
- +disable_so_rbp_kvm_regs_58553 rbp kvm_regs 0 58553 NULL
- +disable_so_kvm_mtrr_check_gfn_range_consistency_fndecl_59759 kvm_mtrr_check_gfn_range_consistency fndecl 3-2 59759 NULL
- +disable_so_r15_kvm_regs_60757 r15 kvm_regs 0 60757 NULL
- +disable_so_cpuid_nent_kvm_vcpu_arch_61798 cpuid_nent kvm_vcpu_arch 0 61798 NULL
- +disable_so_r9_kvm_regs_62259 r9 kvm_regs 0 62259 NULL
- +disable_so_nmsrs_kvm_msrs_62744 nmsrs kvm_msrs 0 62744 NULL
- +disable_so_wall_clock_kvm_arch_63252 wall_clock kvm_arch 0 63252 NULL nohasharray
- +disable_so_system_clock_counter_kfd_ioctl_get_clock_counters_args_63252 system_clock_counter kfd_ioctl_get_clock_counters_args 0 63252 &disable_so_wall_clock_kvm_arch_63252
- +disable_so_kvm_write_wall_clock_fndecl_64267 kvm_write_wall_clock fndecl 2 64267 NULL
- +disable_so_virtual_tsc_khz_kvm_vcpu_arch_64728 virtual_tsc_khz kvm_vcpu_arch 0 64728 &disable_so_sec_pps_ktime_64728
- +disable_so_rax_kvm_regs_65218 rax kvm_regs 0 65218 NULL
- +enable_so_nr_kvm_queued_interrupt_34927 nr kvm_queued_interrupt 0 34927 NULL
- +enable_so_kvm_read_guest_fndecl_107 kvm_read_guest fndecl 2-4 107 NULL
- +enable_so_get_tdp_level_kvm_x86_ops_1250 get_tdp_level kvm_x86_ops 0 1250 NULL nohasharray
- +enable_so_cifs_local_to_utf16_bytes_fndecl_1250 cifs_local_to_utf16_bytes fndecl 0 1250 &enable_so_get_tdp_level_kvm_x86_ops_1250
- +enable_so___aa_kvmalloc_fndecl_1547 __aa_kvmalloc fndecl 1 1547 NULL
- +enable_so_kvm_mmu_gva_to_gpa_write_fndecl_1840 kvm_mmu_gva_to_gpa_write fndecl 0 1840 NULL
- +enable_so_kvm_vcpu_read_guest_page_fndecl_4083 kvm_vcpu_read_guest_page fndecl 2-5 4083 NULL nohasharray
- +enable_so___set_extent_bit_fndecl_4083 __set_extent_bit fndecl 0-3-2 4083 &enable_so_kvm_vcpu_read_guest_page_fndecl_4083
- +enable_so_kvm_vcpu_gfn_to_pfn_atomic_fndecl_5062 kvm_vcpu_gfn_to_pfn_atomic fndecl 2 5062 NULL
- +enable_so_get_cr3_kvm_mmu_5347 get_cr3 kvm_mmu 0 5347 NULL
- +enable_so_kvm_read_guest_page_fndecl_7049 kvm_read_guest_page fndecl 2-5 7049 NULL
- +enable_so_kvm_mmu_page_fault_fndecl_9470 kvm_mmu_page_fault fndecl 2 9470 NULL
- +enable_so_kvm_mmu_get_page_fndecl_11527 kvm_mmu_get_page fndecl 2 11527 NULL
- +enable_so_kvm_read_guest_virt_system_fndecl_11922 kvm_read_guest_virt_system fndecl 4-2 11922 NULL
- +enable_so_kvm_read_guest_phys_system_fndecl_13445 kvm_read_guest_phys_system fndecl 2-4 13445 NULL
- +enable_so_gfn_kvm_mmu_page_14326 gfn kvm_mmu_page 0 14326 NULL
- +enable_so_kvm_pv_enable_async_pf_fndecl_15662 kvm_pv_enable_async_pf fndecl 2 15662 NULL
- +enable_so_kvm_read_guest_virt_helper_fndecl_15863 kvm_read_guest_virt_helper fndecl 3-1 15863 NULL
- +enable_so_get_pdptr_kvm_mmu_17247 get_pdptr kvm_mmu 0 17247 NULL
- +enable_so_dev_count_kvm_io_bus_17340 dev_count kvm_io_bus 0 17340 NULL
- +enable_so_ceph_kvmalloc_fndecl_18026 ceph_kvmalloc fndecl 1 18026 &enable_so_rawv6_recvmsg_fndecl_18026
- +enable_so_kvm_hv_set_msr_pw_fndecl_18553 kvm_hv_set_msr_pw fndecl 3 18553 NULL nohasharray
- +enable_so_inodes_squashfs_sb_info_18553 inodes squashfs_sb_info 0 18553 &enable_so_kvm_hv_set_msr_pw_fndecl_18553 nohasharray
- +enable_so_kvm_pin_pages_fndecl_18922 kvm_pin_pages fndecl 2 18922 NULL
- +enable_so_gsi_kvm_assigned_msix_entry_19082 gsi kvm_assigned_msix_entry 0 19082 NULL
- +enable_so_translate_gpa_kvm_mmu_20350 translate_gpa kvm_mmu 0 20350 NULL nohasharray
- +enable_so_sq_wqe_count_mlx5_ib_create_qp_20350 sq_wqe_count mlx5_ib_create_qp 0 20350 &enable_so_translate_gpa_kvm_mmu_20350
- +enable_so_kvm_handle_bad_page_fndecl_20668 kvm_handle_bad_page fndecl 2 20668 NULL
- +enable_so_kvm_clear_guest_page_fndecl_21527 kvm_clear_guest_page fndecl 2-4 21527 NULL
- +enable_so_kvm_hv_set_msr_fndecl_21951 kvm_hv_set_msr fndecl 3 21951 NULL
- +enable_so_kvm_gfn_to_hva_cache_init_fndecl_22367 kvm_gfn_to_hva_cache_init fndecl 3 22367 NULL
- +enable_so_nr_kvm_irq_routing_23794 nr kvm_irq_routing 0 23794 NULL
- +enable_so_root_level_kvm_mmu_24604 root_level kvm_mmu 0 24604 NULL
- +enable_so_ext4_kvmalloc_fndecl_25823 ext4_kvmalloc fndecl 1 25823 NULL
- +enable_so_kvm_vcpu_gfn_to_hva_prot_fndecl_25911 kvm_vcpu_gfn_to_hva_prot fndecl 2 25911 NULL
- +enable_so_kvm_hv_set_msr_common_fndecl_25940 kvm_hv_set_msr_common fndecl 3 25940 NULL nohasharray
- +enable_so_n_piobufs_efx_ef10_nic_data_25940 n_piobufs efx_ef10_nic_data 0 25940 &enable_so_kvm_hv_set_msr_common_fndecl_25940
- +enable_so_npages_kvm_memory_slot_26541 npages kvm_memory_slot 0 26541 NULL
- +enable_so_kvm_read_nested_guest_page_fndecl_26890 kvm_read_nested_guest_page fndecl 5 26890 &enable_so_head_floppy_struct_26890
- +enable_so_kvm_vcpu_gfn_to_hva_fndecl_26957 kvm_vcpu_gfn_to_hva fndecl 2 26957 NULL
- +enable_so_kvm_lapic_enable_pv_eoi_fndecl_28370 kvm_lapic_enable_pv_eoi fndecl 2 28370 NULL
- +enable_so_memory_size_kvm_userspace_memory_region_29047 memory_size kvm_userspace_memory_region 0 29047 NULL
- +enable_so_kvm_write_guest_cached_fndecl_30321 kvm_write_guest_cached fndecl 4 30321 NULL
- +enable_so_kvm_read_guest_atomic_fndecl_30494 kvm_read_guest_atomic fndecl 2-4 30494 NULL
- +enable_so_shadow_root_level_kvm_mmu_30842 shadow_root_level kvm_mmu 0 30842 NULL
- +enable_so_kvm_mmu_page_set_gfn_fndecl_32050 kvm_mmu_page_set_gfn fndecl 2 32050 NULL
- +enable_so_kvm_vcpu_read_guest_fndecl_33552 kvm_vcpu_read_guest fndecl 2-4 33552 NULL
- +enable_so___kvm_write_guest_page_fndecl_34021 __kvm_write_guest_page fndecl 2-5 34021 NULL
- +enable_so_kvm_write_guest_virt_system_fndecl_34715 kvm_write_guest_virt_system fndecl 4-2 34715 NULL
- +enable_so_kvm_vcpu_read_guest_atomic_fndecl_36372 kvm_vcpu_read_guest_atomic fndecl 2-4 36372 NULL
- +enable_so_gva_to_gpa_kvm_mmu_37200 gva_to_gpa kvm_mmu 0 37200 NULL
- +enable_so_kvm_kvzalloc_fndecl_37773 kvm_kvzalloc fndecl 1 37773 NULL
- +enable_so_kvm_fetch_guest_virt_fndecl_37942 kvm_fetch_guest_virt fndecl 2-4 37942 NULL
- +enable_so_level_kvm_shadow_walk_iterator_38631 level kvm_shadow_walk_iterator 0 38631 NULL
- +enable_so_kvm_init_fndecl_42057 kvm_init fndecl 2-3 42057 NULL nohasharray
- +enable_so_fm_tx_get_tune_cap_val_fndecl_42057 fm_tx_get_tune_cap_val fndecl 0 42057 &enable_so_kvm_init_fndecl_42057
- +enable_so_kvm_write_guest_page_fndecl_42320 kvm_write_guest_page fndecl 2-5 42320 NULL nohasharray
- +enable_so_pg_test_nfs_pageio_ops_42320 pg_test nfs_pageio_ops 0 42320 &enable_so_kvm_write_guest_page_fndecl_42320 nohasharray
- +enable_so_kvm_vcpu_gfn_to_pfn_fndecl_43158 kvm_vcpu_gfn_to_pfn fndecl 2 43158 NULL
- +enable_so_gsi_kvm_irq_routing_entry_43676 gsi kvm_irq_routing_entry 0 43676 NULL
- +enable_so_smbase_kvm_vcpu_arch_45895 smbase kvm_vcpu_arch 0 45895 NULL nohasharray
- +enable_so_lldd_write_gpio_sas_domain_function_template_45895 lldd_write_gpio sas_domain_function_template 0 45895 &enable_so_smbase_kvm_vcpu_arch_45895
- +enable_so_base_gfn_kvm_memory_slot_48716 base_gfn kvm_memory_slot 0 48716 NULL
- +enable_so_kvm_read_guest_cached_fndecl_51169 kvm_read_guest_cached fndecl 4 51169 &enable_so_max_sge_rd_ib_device_attr_51169
- +enable_so_kvm_clear_guest_fndecl_51207 kvm_clear_guest fndecl 2-3 51207 NULL
- +enable_so_kvm_write_guest_fndecl_52005 kvm_write_guest fndecl 2-4 52005 NULL
- +enable_so_kvm_arch_setup_async_pf_fndecl_52034 kvm_arch_setup_async_pf fndecl 3 52034 NULL
- +enable_so_kvm_vcpu_write_guest_page_fndecl_53070 kvm_vcpu_write_guest_page fndecl 2-5 53070 NULL
- +enable_so_kvm_read_guest_page_mmu_fndecl_53240 kvm_read_guest_page_mmu fndecl 6 53240 NULL
- +enable_so_kvm_vcpu_gfn_to_page_fndecl_55725 kvm_vcpu_gfn_to_page fndecl 2 55725 NULL
- +enable_so_entry_nr_kvm_assigned_msix_nr_57282 entry_nr kvm_assigned_msix_nr 0 57282 NULL
- +enable_so_kvm_arch_create_memslot_fndecl_58391 kvm_arch_create_memslot fndecl 3 58391 NULL
- +enable_so___kvm_read_guest_atomic_fndecl_59011 __kvm_read_guest_atomic fndecl 2-5 59011 NULL
- +enable_so_kvm_vcpu_write_guest_fndecl_60323 kvm_vcpu_write_guest fndecl 2-4 60323 NULL
- +enable_so_kvm_mmu_page_get_gfn_fndecl_60709 kvm_mmu_page_get_gfn fndecl 0-2 60709 NULL
- +enable_so_f2fs_kvmalloc_fndecl_61650 f2fs_kvmalloc fndecl 1 61650 NULL
- +enable_so___kvm_read_guest_page_fndecl_62291 __kvm_read_guest_page fndecl 2-5 62291 NULL
- +enable_so_kvm_host_page_size_fndecl_62535 kvm_host_page_size fndecl 0-2 62535 NULL
- +enable_so_kvm_read_guest_virt_fndecl_63179 kvm_read_guest_virt fndecl 4-2 63179 &enable_so_send_repeat_remove_fndecl_63179 nohasharray
- +enable_so_scsi_command_size_fndecl_63179 scsi_command_size fndecl 0 63179 &enable_so_kvm_read_guest_virt_fndecl_63179
- diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
- --- a/virt/kvm/kvm_main.c
- +++ b/virt/kvm/kvm_main.c
- static int kvm_usage_count;
- struct kmem_cache *kvm_vcpu_cache;
- EXPORT_SYMBOL_GPL(kvm_vcpu_cache);
- -static __read_mostly struct preempt_ops kvm_preempt_ops;
- +static void kvm_sched_in(struct preempt_notifier *pn, int cpu);
- +static void kvm_sched_out(struct preempt_notifier *pn, struct task_struct *next);
- +static struct preempt_ops kvm_preempt_ops = {
- + .sched_in = kvm_sched_in,
- + .sched_out = kvm_sched_out,
- struct dentry *kvm_debugfs_dir;
- EXPORT_SYMBOL_GPL(kvm_debugfs_dir);
- @@ -842,7 +847,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
- if ((id < KVM_USER_MEM_SLOTS) &&
- @@ -1897,9 +1902,17 @@ EXPORT_SYMBOL_GPL(kvm_read_guest_cached);
- int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len)
- - return kvm_write_guest_page(kvm, gfn, zero_page, offset, len);
- + addr = gfn_to_hva(kvm, gfn);
- + if (kvm_is_error_hva(addr))
- + mark_page_dirty(kvm, gfn);
- EXPORT_SYMBOL_GPL(kvm_clear_guest_page);
- @@ -2236,7 +2249,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp)
- -static struct file_operations kvm_vcpu_fops = {
- +static file_operations_no_const kvm_vcpu_fops __read_only = {
- .release = kvm_vcpu_release,
- .unlocked_ioctl = kvm_vcpu_ioctl,
- #ifdef CONFIG_KVM_COMPAT
- -static struct file_operations kvm_vm_fops = {
- +static file_operations_no_const kvm_vm_fops __read_only = {
- .release = kvm_vm_release,
- .unlocked_ioctl = kvm_vm_ioctl,
- #ifdef CONFIG_KVM_COMPAT
- -static struct file_operations kvm_chardev_ops = {
- +static file_operations_no_const kvm_chardev_ops __read_only = {
- .unlocked_ioctl = kvm_dev_ioctl,
- .compat_ioctl = kvm_dev_ioctl,
- pr_info("kvm: enabling virtualization on CPU%d failed\n", cpu);
- kvm_usage_count++;
- if (kvm_usage_count == 1) {
- @@ -3571,7 +3584,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
- vcpu_align = __alignof__(struct kvm_vcpu);
- kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, vcpu_align,
- if (!kvm_vcpu_cache) {
- @@ -3581,9 +3594,11 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
- kvm_chardev_ops.owner = module;
- kvm_vm_fops.owner = module;
- kvm_vcpu_fops.owner = module;
- r = misc_register(&kvm_dev);
- @@ -3593,9 +3608,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
- register_syscore_ops(&kvm_syscore_ops);
- - kvm_preempt_ops.sched_in = kvm_sched_in;
- - kvm_preempt_ops.sched_out = kvm_sched_out;
- r = kvm_init_debug();
- pr_err("kvm: create debugfs files failed\n");