Dodany przez: grep -i kvm grsecurity-3.1-4.4.6-201603171922.patch, 20:07 18-03-2016

Nowy Pobierz
  1. grep -i kvm grsecurity-3.1-4.4.6-201603171922.patch
  2. diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
  3. --- a/arch/arm/kvm/arm.c
  4. +++ b/arch/arm/kvm/arm.c
  5.  static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_arm_running_vcpu);
  6. -static atomic64_t kvm_vmid_gen = ATOMIC64_INIT(1);
  7. +static atomic64_unchecked_t kvm_vmid_gen = ATOMIC64_INIT(1);
  8.  static u8 kvm_next_vmid;
  9.  static DEFINE_SPINLOCK(kvm_vmid_lock);
  10.  static bool need_new_vmid_gen(struct kvm *kvm)
  11. -       return unlikely(kvm->arch.vmid_gen != atomic64_read(&kvm_vmid_gen));
  12. +       return unlikely(kvm->arch.vmid_gen != atomic64_read_unchecked(&kvm_vmid_gen));
  13. @@ -413,7 +413,7 @@ static void update_vttbr(struct kvm *kvm)
  14.         if (unlikely(kvm_next_vmid == 0)) {
  15. -               atomic64_inc(&kvm_vmid_gen);
  16. +               atomic64_inc_unchecked(&kvm_vmid_gen);
  17.                 kvm_next_vmid = 1;
  18. @@ -430,7 +430,7 @@ static void update_vttbr(struct kvm *kvm)
  19.                 kvm_call_hyp(__kvm_flush_vm_context);
  20. -       kvm->arch.vmid_gen = atomic64_read(&kvm_vmid_gen);
  21. +       kvm->arch.vmid_gen = atomic64_read_unchecked(&kvm_vmid_gen);
  22.         kvm->arch.vmid = kvm_next_vmid;
  23.         kvm_next_vmid++;
  24.  #ifdef CONFIG_KVM_GUEST
  25.  #ifdef CONFIG_HAVE_KVM
  26. diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
  27. --- a/arch/x86/kernel/kvm.c
  28. +++ b/arch/x86/kernel/kvm.c
  29. @@ -553,7 +553,7 @@ static uint32_t __init kvm_detect(void)
  30.         return kvm_cpuid_base();
  31. -const struct hypervisor_x86 x86_hyper_kvm __refconst = {
  32. +const struct hypervisor_x86 x86_hyper_kvm = {
  33.         .name                   = "KVM",
  34.         .detect                 = kvm_detect,
  35.         .x2apic_available       = kvm_para_available,
  36. diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
  37. --- a/arch/x86/kernel/kvmclock.c
  38. +++ b/arch/x86/kernel/kvmclock.c
  39. -static int kvmclock = 1;
  40. +static int kvmclock __read_only = 1;
  41.  static int msr_kvm_system_time = MSR_KVM_SYSTEM_TIME;
  42.  static int msr_kvm_wall_clock = MSR_KVM_WALL_CLOCK;
  43.  static cycle_t kvm_sched_clock_offset;
  44. @@ -42,7 +42,7 @@ static int parse_no_kvmclock(char *arg)
  45.  early_param("no-kvmclock", parse_no_kvmclock);
  46. @@ -156,7 +156,7 @@ bool kvm_check_and_clear_guest_paused(void)
  47. +       if (!kvmclock)
  48. @@ -183,7 +183,7 @@ int kvm_register_clock(char *txt)
  49. +       if (!kvmclock)
  50. @@ -243,7 +243,6 @@ static void kvm_shutdown(void)
  51.  void __init kvmclock_init(void)
  52. @@ -261,15 +260,8 @@ void __init kvmclock_init(void)
  53.         printk(KERN_INFO "kvm-clock: Using msrs %x and %x",
  54.                 msr_kvm_system_time, msr_kvm_wall_clock);
  55.         if (kvm_register_clock("primary cpu clock")) {
  56. +               kvmclock = 0;
  57. @@ -310,7 +302,7 @@ int __init kvm_setup_vsyscall_timeinfo(void)
  58. +       if (!kvmclock)
  59. diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
  60. --- a/arch/x86/kvm/cpuid.c
  61. +++ b/arch/x86/kvm/cpuid.c
  62. @@ -206,15 +206,20 @@ int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
  63.                               struct kvm_cpuid2 *cpuid,
  64.                               struct kvm_cpuid_entry2 __user *entries)
  65.         if (cpuid->nent > KVM_MAX_CPUID_ENTRIES)
  66. -                          cpuid->nent * sizeof(struct kvm_cpuid_entry2)))
  67. +       if (!access_ok(VERIFY_READ, entries, cpuid->nent * sizeof(struct kvm_cpuid_entry2)))
  68. +               struct kvm_cpuid_entry2 cpuid_entry;
  69.         kvm_apic_set_version(vcpu);
  70.         kvm_x86_ops->cpuid_update(vcpu);
  71. @@ -227,15 +232,19 @@ int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
  72.                               struct kvm_cpuid2 *cpuid,
  73.                               struct kvm_cpuid_entry2 __user *entries)
  74. -                        vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2)))
  75. +       if (!access_ok(VERIFY_WRITE, entries, vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2)))
  76. +               struct kvm_cpuid_entry2 cpuid_entry = vcpu->arch.cpuid_entries[i];
  77. diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
  78. --- a/arch/x86/kvm/emulate.c
  79. +++ b/arch/x86/kvm/emulate.c
  80. diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
  81. --- a/arch/x86/kvm/i8259.c
  82. +++ b/arch/x86/kvm/i8259.c
  83.  static void pic_irq_request(struct kvm *kvm, int level);
  84. +static void pic_lock(struct kvm_pic *s) __acquires(&s->lock);
  85.  static void pic_lock(struct kvm_pic *s)
  86. +static void pic_unlock(struct kvm_pic *s) __releases(&s->lock);
  87.  static void pic_unlock(struct kvm_pic *s)
  88.         struct kvm_vcpu *vcpu, *found = NULL;
  89. @@ -72,6 +72,7 @@ static void pic_unlock(struct kvm_pic *s)
  90. +static void pic_clear_isr(struct kvm_kpic_state *s, int irq) __must_hold(s->pics_state);
  91.  static void pic_clear_isr(struct kvm_kpic_state *s, int irq)
  92. @@ -219,6 +220,7 @@ void kvm_pic_clear_all(struct kvm_pic *s, int irq_source_id)
  93. +static inline void pic_intack(struct kvm_kpic_state *s, int irq) __must_hold(s);
  94.  static inline void pic_intack(struct kvm_kpic_state *s, int irq)
  95. @@ -273,6 +275,7 @@ int kvm_pic_read_irq(struct kvm *kvm)
  96. +void kvm_pic_reset(struct kvm_kpic_state *s) __must_hold(s);
  97.  void kvm_pic_reset(struct kvm_kpic_state *s)
  98. @@ -307,6 +310,7 @@ void kvm_pic_reset(struct kvm_kpic_state *s)
  99.         struct kvm_kpic_state *s = opaque;
  100. +static u32 pic_poll_read(struct kvm_kpic_state *s, u32 addr1) __must_hold(s);
  101.  static u32 pic_poll_read(struct kvm_kpic_state *s, u32 addr1)
  102. @@ -422,6 +427,7 @@ static u32 pic_poll_read(struct kvm_kpic_state *s, u32 addr1)
  103.         struct kvm_kpic_state *s = opaque;
  104. diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
  105. --- a/arch/x86/kvm/ioapic.c
  106. +++ b/arch/x86/kvm/ioapic.c
  107. @@ -405,6 +405,8 @@ static void kvm_ioapic_eoi_inject_work(struct work_struct *work)
  108.  static void __kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu,
  109. +                       struct kvm_ioapic *ioapic, int vector, int trigger_mode) __must_hold(&ioapic->lock);
  110. +static void __kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu,
  111.                         struct kvm_ioapic *ioapic, int vector, int trigger_mode)
  112. diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
  113. --- a/arch/x86/kvm/lapic.c
  114. +++ b/arch/x86/kvm/lapic.c
  115. diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
  116. --- a/arch/x86/kvm/paging_tmpl.h
  117. +++ b/arch/x86/kvm/paging_tmpl.h
  118.                 if (unlikely(kvm_is_error_hva(host_addr)))
  119. diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
  120. --- a/arch/x86/kvm/svm.c
  121. +++ b/arch/x86/kvm/svm.c
  122. @@ -3490,7 +3490,11 @@ static void reload_tss(struct kvm_vcpu *vcpu)
  123. @@ -3885,6 +3889,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
  124. @@ -4260,7 +4268,7 @@ static void svm_sched_in(struct kvm_vcpu *vcpu, int cpu)
  125. -static struct kvm_x86_ops svm_x86_ops = {
  126. +static struct kvm_x86_ops svm_x86_ops __read_only = {
  127.         .cpu_has_kvm_support = has_svm,
  128. diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
  129. --- a/arch/x86/kvm/vmx.c
  130. +++ b/arch/x86/kvm/vmx.c
  131. @@ -2078,6 +2082,10 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
  132.                 vmcs_writel(HOST_TR_BASE, kvm_read_tr_base()); /* 22.2.4 */
  133. -static u64 guest_read_tsc(struct kvm_vcpu *vcpu)
  134. +static u64 __intentional_overflow(-1) guest_read_tsc(struct kvm_vcpu *vcpu)
  135.                 kvm_x86_ops->set_apic_access_page_addr = NULL;
  136.                 kvm_x86_ops->update_cr8_intercept = NULL;
  137.                 kvm_disable_largepages();
  138.                 kvm_tsc_scaling_ratio_frac_bits = 48;
  139.                 kvm_x86_ops->update_cr8_intercept = NULL;
  140.                 kvm_x86_ops->deliver_posted_interrupt = NULL;
  141.                 kvm_x86_ops->sync_pir_to_irr = vmx_sync_pir_to_irr_dummy;
  142.                 kvm_x86_ops->slot_enable_log_dirty = NULL;
  143.                 kvm_x86_ops->slot_disable_log_dirty = NULL;
  144.                 kvm_x86_ops->flush_log_dirty = NULL;
  145.                 kvm_x86_ops->enable_log_dirty_pt_masked = NULL;
  146.         kvm_set_posted_intr_wakeup_handler(wakeup_handler);
  147. @@ -8601,6 +8622,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
  148. @@ -8653,6 +8680,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
  149. @@ -8666,7 +8698,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
  150. @@ -8675,8 +8707,18 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
  151. -static struct kvm_x86_ops vmx_x86_ops = {
  152. +static struct kvm_x86_ops vmx_x86_ops __read_only = {
  153.         .cpu_has_kvm_support = cpu_has_kvm_support,
  154. diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
  155. --- a/arch/x86/kvm/x86.c
  156. +++ b/arch/x86/kvm/x86.c
  157. @@ -1937,8 +1937,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
  158.         struct kvm *kvm = vcpu->kvm;
  159. -       u8 *blob_addr = lm ? (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_64
  160. -               : (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_32;
  161. +       u8 __user *blob_addr = lm ? (u8 __user *)(long)kvm->arch.xen_hvm_config.blob_addr_64
  162. +               : (u8 __user *)(long)kvm->arch.xen_hvm_config.blob_addr_32;
  163.         u8 blob_size = lm ? kvm->arch.xen_hvm_config.blob_size_64
  164.                 : kvm->arch.xen_hvm_config.blob_size_32;
  165. @@ -2636,6 +2636,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
  166. @@ -3028,7 +3030,7 @@ static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu,
  167.  static void fill_xsave(u8 *dest, struct kvm_vcpu *vcpu)
  168. @@ -3064,7 +3066,7 @@ static void fill_xsave(u8 *dest, struct kvm_vcpu *vcpu)
  169.  static void load_xsave(struct kvm_vcpu *vcpu, u8 *src)
  170. @@ -3108,7 +3110,7 @@ static void kvm_vcpu_ioctl_x86_get_xsave(struct kvm_vcpu *vcpu,
  171. @@ -3133,7 +3135,7 @@ static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu,
  172. @@ -6363,6 +6365,7 @@ void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm,
  173. +static int vcpu_enter_guest(struct kvm_vcpu *vcpu) __must_hold(&vcpu->kvm->srcu);
  174.  static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
  175. +static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu) __must_hold(&kvm->srcu);
  176.  static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu)
  177.         if (!kvm_arch_vcpu_runnable(vcpu) &&
  178. @@ -7158,7 +7162,7 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
  179.  int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
  180. @@ -7175,7 +7179,7 @@ int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
  181.  int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
  182. @@ -7191,9 +7195,9 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
  183.  static void fx_init(struct kvm_vcpu *vcpu)
  184. @@ -7217,7 +7221,7 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
  185.         kvm_put_guest_xcr0(vcpu);
  186.         trace_kvm_fpu(1);
  187. @@ -7520,6 +7524,8 @@ bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu)
  188.  struct static_key kvm_no_apic_vcpu __read_mostly;
  189.  int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
  190. @@ -7536,11 +7542,14 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
  191.                 vcpu->arch.mp_state = KVM_MP_STATE_UNINITIALIZED;
  192.         kvm_set_tsc_khz(vcpu, max_tsc_khz);
  193.         kvm_mmu_destroy(vcpu);
  194. @@ -7613,6 +7625,8 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
  195.                 static_key_slow_dec(&kvm_no_apic_vcpu);
  196.  void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu)
  197. +config GRKERNSEC_CONFIG_VIRT_KVM
  198. +       bool "KVM"
  199. +         Choose this option if this kernel is running as a KVM guest or host.
  200. +       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))
  201. +disable_so_addr_kvm_shadow_walk_iterator_3297 addr kvm_shadow_walk_iterator 0 3297 NULL
  202. +disable_so_last_tsc_khz_kvm_arch_3596 last_tsc_khz kvm_arch 0 3596 NULL
  203. +disable_so_r12_kvm_regs_3771 r12 kvm_regs 0 3771 NULL
  204. +disable_so_linear_address_kvm_translation_4366 linear_address kvm_translation 0 4366 NULL
  205. +disable_so_kvm_apic_match_physical_addr_fndecl_4632 kvm_apic_match_physical_addr fndecl 2 4632 NULL
  206. +disable_so_r10_kvm_regs_5730 r10 kvm_regs 0 5730 NULL
  207. +disable_so_nent_kvm_cpuid2_5883 nent kvm_cpuid2 0 5883 NULL
  208. +disable_so_kvm_lapic_set_vapic_addr_fndecl_6040 kvm_lapic_set_vapic_addr fndecl 2 6040 NULL
  209. +disable_so_set_tss_addr_kvm_x86_ops_6529 set_tss_addr kvm_x86_ops 2 6529 NULL
  210. +disable_so_kvm_clock_read_fndecl_6779 kvm_clock_read fndecl 0 6779 NULL
  211. +disable_so_adjust_tsc_offset_kvm_x86_ops_10575 adjust_tsc_offset kvm_x86_ops 2 10575 NULL
  212. +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
  213. +disable_so_time_blocked_kvm_spinlock_stats_11970 time_blocked kvm_spinlock_stats 0 11970 NULL
  214. +disable_so_base_address_kvm_ioapic_14007 base_address kvm_ioapic 0 14007 NULL
  215. +disable_so_ept_identity_map_addr_kvm_arch_14060 ept_identity_map_addr kvm_arch 0 14060 NULL
  216. +disable_so_last_host_tsc_kvm_vcpu_arch_14836 last_host_tsc kvm_vcpu_arch 0 14836 NULL
  217. +disable_so_rcx_kvm_regs_15192 rcx kvm_regs 0 15192 NULL
  218. +disable_so_shadow_addr_kvm_shadow_walk_iterator_15604 shadow_addr kvm_shadow_walk_iterator 0 15604 NULL
  219. +disable_so_nmsrs_kvm_msr_list_16175 nmsrs kvm_msr_list 0 16175 NULL
  220. +disable_so_time_kvm_vcpu_arch_16718 time kvm_vcpu_arch 0 16718 NULL
  221. +disable_so_master_cycle_now_kvm_arch_17072 master_cycle_now kvm_arch 0 17072 NULL
  222. +disable_so_this_tsc_write_kvm_vcpu_arch_17221 this_tsc_write kvm_vcpu_arch 0 17221 NULL
  223. +disable_so_read_tsc_offset_kvm_x86_ops_18374 read_tsc_offset kvm_x86_ops 0 18374 NULL
  224. +disable_so_physical_address_kvm_translation_18550 physical_address kvm_translation 0 18550 NULL
  225. +disable_so_kvm_mtrr_set_msr_fndecl_18553 kvm_mtrr_set_msr fndecl 3 18553 NULL
  226. +disable_so_mask_kvm_mtrr_range_20079 mask kvm_mtrr_range 0 20079 NULL
  227. +disable_so_kvm_set_shared_msr_fndecl_20144 kvm_set_shared_msr fndecl 2 20144 &disable_so_nsec_timecounter_20144
  228. +disable_so_addr_kvm_async_pf_20788 addr kvm_async_pf 0 20788 &disable_so_s5m8767_set_voltage_time_sel_fndecl_20788
  229. +disable_so_rsp_kvm_regs_22061 rsp kvm_regs 0 22061 NULL
  230. +disable_so_r11_kvm_regs_22488 r11 kvm_regs 0 22488 NULL
  231. +disable_so_userspace_addr_kvm_memory_slot_22749 userspace_addr kvm_memory_slot 0 22749 NULL
  232. +disable_so_rbx_kvm_regs_22975 rbx kvm_regs 0 22975 NULL
  233. +disable_so_expired_tscdeadline_kvm_timer_23113 expired_tscdeadline kvm_timer 0 23113 NULL nohasharray
  234. +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
  235. +disable_so_set_tsc_khz_kvm_x86_ops_23439 set_tsc_khz kvm_x86_ops 2 23439 NULL
  236. +disable_so_kvm_send_hwpoison_signal_fndecl_23581 kvm_send_hwpoison_signal fndecl 1 23581 NULL
  237. +disable_so_tss_addr_kvm_arch_23642 tss_addr kvm_arch 0 23642 NULL
  238. +disable_so_kvm_get_lapic_tscdeadline_msr_fndecl_25821 kvm_get_lapic_tscdeadline_msr fndecl 0 25821 NULL
  239. +disable_so_kvm_inject_realmode_interrupt_fndecl_26018 kvm_inject_realmode_interrupt fndecl 2 26018 NULL
  240. +disable_so_base_address_kvm_lapic_26767 base_address kvm_lapic 0 26767 NULL
  241. +disable_so_kvm_apic_match_logical_addr_fndecl_27077 kvm_apic_match_logical_addr fndecl 2 27077 NULL
  242. +disable_so_compute_tsc_offset_kvm_x86_ops_28149 compute_tsc_offset kvm_x86_ops 0-2 28149 NULL
  243. +disable_so_cur_tsc_write_kvm_arch_28444 cur_tsc_write kvm_arch 0 28444 NULL
  244. +disable_so_kvm_hv_vapic_msr_write_fndecl_28670 kvm_hv_vapic_msr_write fndecl 3 28670 NULL
  245. +disable_so_rip_kvm_regs_28841 rip kvm_regs 0 28841 &disable_so_wl1273_fm_set_tx_freq_fndecl_28841
  246. +disable_so_rdi_kvm_regs_29022 rdi kvm_regs 0 29022 NULL
  247. +disable_so_kvm_max_guest_tsc_khz_vardecl_29276 kvm_max_guest_tsc_khz vardecl 0 29276 NULL
  248. +disable_so_kvm_apic_has_interrupt_fndecl_29462 kvm_apic_has_interrupt fndecl 0 29462 NULL
  249. +disable_so_hv_tsc_page_kvm_arch_30336 hv_tsc_page kvm_arch 0 30336 NULL
  250. +disable_so_r13_kvm_regs_30505 r13 kvm_regs 0 30505 &disable_so_i2c_smbus_read_word_data_fndecl_30505
  251. +disable_so_cur_tsc_offset_kvm_arch_31338 cur_tsc_offset kvm_arch 0 31338 &disable_so_ufs_bitmap_search_fndecl_31338
  252. +disable_so_last_tsc_write_kvm_arch_32069 last_tsc_write kvm_arch 0 32069 NULL
  253. +disable_so_nent_kvm_cpuid_32413 nent kvm_cpuid 0 32413 NULL
  254. +disable_so_kvm_get_apic_interrupt_fndecl_32843 kvm_get_apic_interrupt fndecl 0 32843 NULL
  255. +disable_so_kvmclock_offset_kvm_arch_33369 kvmclock_offset kvm_arch 0 33369 &disable_so_token_time_sfb_sched_data_33369
  256. +disable_so_rdx_kvm_regs_34602 rdx kvm_regs 0 34602 &disable_so_eee_timer_vardecl_sxgbe_main_c_34602
  257. +disable_so_rsi_kvm_regs_34605 rsi kvm_regs 0 34605 NULL
  258. +disable_so_phys_addr_kvm_coalesced_mmio_34828 phys_addr kvm_coalesced_mmio 0 34828 NULL
  259. +disable_so_kvm_set_irq_fndecl_35352 kvm_set_irq fndecl 3-2 35352 NULL
  260. +disable_so_host_kvm_shared_msr_values_35560 host kvm_shared_msr_values 0 35560 NULL
  261. +disable_so_kvm_vm_ioctl_set_tss_addr_fndecl_35702 kvm_vm_ioctl_set_tss_addr fndecl 2 35702 NULL
  262. +disable_so_read_l1_tsc_kvm_x86_ops_37977 read_l1_tsc kvm_x86_ops 0-2 37977 NULL
  263. +disable_so_curr_kvm_shared_msr_values_38468 curr kvm_shared_msr_values 0 38468 NULL
  264. +disable_so_kvm_x2apic_msr_write_fndecl_38601 kvm_x2apic_msr_write fndecl 3 38601 NULL
  265. +disable_so_last_guest_tsc_kvm_vcpu_arch_39290 last_guest_tsc kvm_vcpu_arch 0 39290 NULL
  266. +disable_so_kvm_mtrr_get_guest_memory_type_fndecl_41633 kvm_mtrr_get_guest_memory_type fndecl 2-0 41633 NULL
  267. +disable_so_kvm_clock_get_cycles_fndecl_41992 kvm_clock_get_cycles fndecl 0 41992 NULL
  268. +disable_so_addr_kvm_io_range_43786 addr kvm_io_range 0 43786 NULL
  269. +disable_so_tsc_offset_adjustment_kvm_vcpu_arch_45263 tsc_offset_adjustment kvm_vcpu_arch 0 45263 NULL
  270. +disable_so_r8_kvm_regs_45295 r8 kvm_regs 0 45295 NULL
  271. +disable_so_base_kvm_mtrr_range_45607 base kvm_mtrr_range 0 45607 &disable_so_laddr_c2wr_ae_active_connect_results_45607
  272. +disable_so_kvm_set_lapic_tscdeadline_msr_fndecl_47952 kvm_set_lapic_tscdeadline_msr fndecl 2 47952 NULL
  273. +disable_so_kvm_set_tsc_khz_fndecl_48520 kvm_set_tsc_khz fndecl 2 48520 NULL
  274. +disable_so_deliver_posted_interrupt_kvm_x86_ops_50698 deliver_posted_interrupt kvm_x86_ops 2 50698 NULL
  275. +disable_so_clock_kvm_clock_data_51363 clock kvm_clock_data 0 51363 NULL
  276. +disable_so_addr_kvm_coalesced_mmio_zone_51392 addr kvm_coalesced_mmio_zone 0 51392 NULL
  277. +disable_so_r14_kvm_regs_51526 r14 kvm_regs 0 51526 NULL
  278. +disable_so_guest_phys_addr_kvm_userspace_memory_region_51947 guest_phys_addr kvm_userspace_memory_region 0 51947 NULL
  279. +disable_so_vapic_addr_kvm_lapic_53599 vapic_addr kvm_lapic 0 53599 NULL
  280. +disable_so_last_retry_addr_kvm_vcpu_arch_54492 last_retry_addr kvm_vcpu_arch 0 54492 NULL
  281. +disable_so_kvm_get_tsc_khz_fndecl_55570 kvm_get_tsc_khz fndecl 0 55570 NULL
  282. +disable_so_write_tsc_offset_kvm_x86_ops_55825 write_tsc_offset kvm_x86_ops 2 55825 NULL
  283. +disable_so_kvm_get_time_scale_fndecl_56201 kvm_get_time_scale fndecl 1 56201 NULL
  284. +disable_so_deftype_kvm_mtrr_56712 deftype kvm_mtrr 0 56712 NULL
  285. +disable_so_tscdeadline_kvm_timer_57719 tscdeadline kvm_timer 0 57719 &disable_so_y_runtime_sc_57719
  286. +disable_so_vapic_addr_kvm_vapic_addr_57958 vapic_addr kvm_vapic_addr 0 57958 NULL
  287. +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
  288. +disable_so_kvm_mtrr_valid_fndecl_58049 kvm_mtrr_valid fndecl 3 58049 NULL
  289. +disable_so_rbp_kvm_regs_58553 rbp kvm_regs 0 58553 NULL
  290. +disable_so_kvm_mtrr_check_gfn_range_consistency_fndecl_59759 kvm_mtrr_check_gfn_range_consistency fndecl 3-2 59759 NULL
  291. +disable_so_r15_kvm_regs_60757 r15 kvm_regs 0 60757 NULL
  292. +disable_so_cpuid_nent_kvm_vcpu_arch_61798 cpuid_nent kvm_vcpu_arch 0 61798 NULL
  293. +disable_so_r9_kvm_regs_62259 r9 kvm_regs 0 62259 NULL
  294. +disable_so_nmsrs_kvm_msrs_62744 nmsrs kvm_msrs 0 62744 NULL
  295. +disable_so_wall_clock_kvm_arch_63252 wall_clock kvm_arch 0 63252 NULL nohasharray
  296. +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
  297. +disable_so_kvm_write_wall_clock_fndecl_64267 kvm_write_wall_clock fndecl 2 64267 NULL
  298. +disable_so_virtual_tsc_khz_kvm_vcpu_arch_64728 virtual_tsc_khz kvm_vcpu_arch 0 64728 &disable_so_sec_pps_ktime_64728
  299. +disable_so_rax_kvm_regs_65218 rax kvm_regs 0 65218 NULL
  300. +enable_so_nr_kvm_queued_interrupt_34927 nr kvm_queued_interrupt 0 34927 NULL
  301. +enable_so_kvm_read_guest_fndecl_107 kvm_read_guest fndecl 2-4 107 NULL
  302. +enable_so_get_tdp_level_kvm_x86_ops_1250 get_tdp_level kvm_x86_ops 0 1250 NULL nohasharray
  303. +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
  304. +enable_so___aa_kvmalloc_fndecl_1547 __aa_kvmalloc fndecl 1 1547 NULL
  305. +enable_so_kvm_mmu_gva_to_gpa_write_fndecl_1840 kvm_mmu_gva_to_gpa_write fndecl 0 1840 NULL
  306. +enable_so_kvm_vcpu_read_guest_page_fndecl_4083 kvm_vcpu_read_guest_page fndecl 2-5 4083 NULL nohasharray
  307. +enable_so___set_extent_bit_fndecl_4083 __set_extent_bit fndecl 0-3-2 4083 &enable_so_kvm_vcpu_read_guest_page_fndecl_4083
  308. +enable_so_kvm_vcpu_gfn_to_pfn_atomic_fndecl_5062 kvm_vcpu_gfn_to_pfn_atomic fndecl 2 5062 NULL
  309. +enable_so_get_cr3_kvm_mmu_5347 get_cr3 kvm_mmu 0 5347 NULL
  310. +enable_so_kvm_read_guest_page_fndecl_7049 kvm_read_guest_page fndecl 2-5 7049 NULL
  311. +enable_so_kvm_mmu_page_fault_fndecl_9470 kvm_mmu_page_fault fndecl 2 9470 NULL
  312. +enable_so_kvm_mmu_get_page_fndecl_11527 kvm_mmu_get_page fndecl 2 11527 NULL
  313. +enable_so_kvm_read_guest_virt_system_fndecl_11922 kvm_read_guest_virt_system fndecl 4-2 11922 NULL
  314. +enable_so_kvm_read_guest_phys_system_fndecl_13445 kvm_read_guest_phys_system fndecl 2-4 13445 NULL
  315. +enable_so_gfn_kvm_mmu_page_14326 gfn kvm_mmu_page 0 14326 NULL
  316. +enable_so_kvm_pv_enable_async_pf_fndecl_15662 kvm_pv_enable_async_pf fndecl 2 15662 NULL
  317. +enable_so_kvm_read_guest_virt_helper_fndecl_15863 kvm_read_guest_virt_helper fndecl 3-1 15863 NULL
  318. +enable_so_get_pdptr_kvm_mmu_17247 get_pdptr kvm_mmu 0 17247 NULL
  319. +enable_so_dev_count_kvm_io_bus_17340 dev_count kvm_io_bus 0 17340 NULL
  320. +enable_so_ceph_kvmalloc_fndecl_18026 ceph_kvmalloc fndecl 1 18026 &enable_so_rawv6_recvmsg_fndecl_18026
  321. +enable_so_kvm_hv_set_msr_pw_fndecl_18553 kvm_hv_set_msr_pw fndecl 3 18553 NULL nohasharray
  322. +enable_so_inodes_squashfs_sb_info_18553 inodes squashfs_sb_info 0 18553 &enable_so_kvm_hv_set_msr_pw_fndecl_18553 nohasharray
  323. +enable_so_kvm_pin_pages_fndecl_18922 kvm_pin_pages fndecl 2 18922 NULL
  324. +enable_so_gsi_kvm_assigned_msix_entry_19082 gsi kvm_assigned_msix_entry 0 19082 NULL
  325. +enable_so_translate_gpa_kvm_mmu_20350 translate_gpa kvm_mmu 0 20350 NULL nohasharray
  326. +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
  327. +enable_so_kvm_handle_bad_page_fndecl_20668 kvm_handle_bad_page fndecl 2 20668 NULL
  328. +enable_so_kvm_clear_guest_page_fndecl_21527 kvm_clear_guest_page fndecl 2-4 21527 NULL
  329. +enable_so_kvm_hv_set_msr_fndecl_21951 kvm_hv_set_msr fndecl 3 21951 NULL
  330. +enable_so_kvm_gfn_to_hva_cache_init_fndecl_22367 kvm_gfn_to_hva_cache_init fndecl 3 22367 NULL
  331. +enable_so_nr_kvm_irq_routing_23794 nr kvm_irq_routing 0 23794 NULL
  332. +enable_so_root_level_kvm_mmu_24604 root_level kvm_mmu 0 24604 NULL
  333. +enable_so_ext4_kvmalloc_fndecl_25823 ext4_kvmalloc fndecl 1 25823 NULL
  334. +enable_so_kvm_vcpu_gfn_to_hva_prot_fndecl_25911 kvm_vcpu_gfn_to_hva_prot fndecl 2 25911 NULL
  335. +enable_so_kvm_hv_set_msr_common_fndecl_25940 kvm_hv_set_msr_common fndecl 3 25940 NULL nohasharray
  336. +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
  337. +enable_so_npages_kvm_memory_slot_26541 npages kvm_memory_slot 0 26541 NULL
  338. +enable_so_kvm_read_nested_guest_page_fndecl_26890 kvm_read_nested_guest_page fndecl 5 26890 &enable_so_head_floppy_struct_26890
  339. +enable_so_kvm_vcpu_gfn_to_hva_fndecl_26957 kvm_vcpu_gfn_to_hva fndecl 2 26957 NULL
  340. +enable_so_kvm_lapic_enable_pv_eoi_fndecl_28370 kvm_lapic_enable_pv_eoi fndecl 2 28370 NULL
  341. +enable_so_memory_size_kvm_userspace_memory_region_29047 memory_size kvm_userspace_memory_region 0 29047 NULL
  342. +enable_so_kvm_write_guest_cached_fndecl_30321 kvm_write_guest_cached fndecl 4 30321 NULL
  343. +enable_so_kvm_read_guest_atomic_fndecl_30494 kvm_read_guest_atomic fndecl 2-4 30494 NULL
  344. +enable_so_shadow_root_level_kvm_mmu_30842 shadow_root_level kvm_mmu 0 30842 NULL
  345. +enable_so_kvm_mmu_page_set_gfn_fndecl_32050 kvm_mmu_page_set_gfn fndecl 2 32050 NULL
  346. +enable_so_kvm_vcpu_read_guest_fndecl_33552 kvm_vcpu_read_guest fndecl 2-4 33552 NULL
  347. +enable_so___kvm_write_guest_page_fndecl_34021 __kvm_write_guest_page fndecl 2-5 34021 NULL
  348. +enable_so_kvm_write_guest_virt_system_fndecl_34715 kvm_write_guest_virt_system fndecl 4-2 34715 NULL
  349. +enable_so_kvm_vcpu_read_guest_atomic_fndecl_36372 kvm_vcpu_read_guest_atomic fndecl 2-4 36372 NULL
  350. +enable_so_gva_to_gpa_kvm_mmu_37200 gva_to_gpa kvm_mmu 0 37200 NULL
  351. +enable_so_kvm_kvzalloc_fndecl_37773 kvm_kvzalloc fndecl 1 37773 NULL
  352. +enable_so_kvm_fetch_guest_virt_fndecl_37942 kvm_fetch_guest_virt fndecl 2-4 37942 NULL
  353. +enable_so_level_kvm_shadow_walk_iterator_38631 level kvm_shadow_walk_iterator 0 38631 NULL
  354. +enable_so_kvm_init_fndecl_42057 kvm_init fndecl 2-3 42057 NULL nohasharray
  355. +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
  356. +enable_so_kvm_write_guest_page_fndecl_42320 kvm_write_guest_page fndecl 2-5 42320 NULL nohasharray
  357. +enable_so_pg_test_nfs_pageio_ops_42320 pg_test nfs_pageio_ops 0 42320 &enable_so_kvm_write_guest_page_fndecl_42320 nohasharray
  358. +enable_so_kvm_vcpu_gfn_to_pfn_fndecl_43158 kvm_vcpu_gfn_to_pfn fndecl 2 43158 NULL
  359. +enable_so_gsi_kvm_irq_routing_entry_43676 gsi kvm_irq_routing_entry 0 43676 NULL
  360. +enable_so_smbase_kvm_vcpu_arch_45895 smbase kvm_vcpu_arch 0 45895 NULL nohasharray
  361. +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
  362. +enable_so_base_gfn_kvm_memory_slot_48716 base_gfn kvm_memory_slot 0 48716 NULL
  363. +enable_so_kvm_read_guest_cached_fndecl_51169 kvm_read_guest_cached fndecl 4 51169 &enable_so_max_sge_rd_ib_device_attr_51169
  364. +enable_so_kvm_clear_guest_fndecl_51207 kvm_clear_guest fndecl 2-3 51207 NULL
  365. +enable_so_kvm_write_guest_fndecl_52005 kvm_write_guest fndecl 2-4 52005 NULL
  366. +enable_so_kvm_arch_setup_async_pf_fndecl_52034 kvm_arch_setup_async_pf fndecl 3 52034 NULL
  367. +enable_so_kvm_vcpu_write_guest_page_fndecl_53070 kvm_vcpu_write_guest_page fndecl 2-5 53070 NULL
  368. +enable_so_kvm_read_guest_page_mmu_fndecl_53240 kvm_read_guest_page_mmu fndecl 6 53240 NULL
  369. +enable_so_kvm_vcpu_gfn_to_page_fndecl_55725 kvm_vcpu_gfn_to_page fndecl 2 55725 NULL
  370. +enable_so_entry_nr_kvm_assigned_msix_nr_57282 entry_nr kvm_assigned_msix_nr 0 57282 NULL
  371. +enable_so_kvm_arch_create_memslot_fndecl_58391 kvm_arch_create_memslot fndecl 3 58391 NULL
  372. +enable_so___kvm_read_guest_atomic_fndecl_59011 __kvm_read_guest_atomic fndecl 2-5 59011 NULL
  373. +enable_so_kvm_vcpu_write_guest_fndecl_60323 kvm_vcpu_write_guest fndecl 2-4 60323 NULL
  374. +enable_so_kvm_mmu_page_get_gfn_fndecl_60709 kvm_mmu_page_get_gfn fndecl 0-2 60709 NULL
  375. +enable_so_f2fs_kvmalloc_fndecl_61650 f2fs_kvmalloc fndecl 1 61650 NULL
  376. +enable_so___kvm_read_guest_page_fndecl_62291 __kvm_read_guest_page fndecl 2-5 62291 NULL
  377. +enable_so_kvm_host_page_size_fndecl_62535 kvm_host_page_size fndecl 0-2 62535 NULL
  378. +enable_so_kvm_read_guest_virt_fndecl_63179 kvm_read_guest_virt fndecl 4-2 63179 &enable_so_send_repeat_remove_fndecl_63179 nohasharray
  379. +enable_so_scsi_command_size_fndecl_63179 scsi_command_size fndecl 0 63179 &enable_so_kvm_read_guest_virt_fndecl_63179
  380. diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
  381. --- a/virt/kvm/kvm_main.c
  382. +++ b/virt/kvm/kvm_main.c
  383.  static int kvm_usage_count;
  384.  struct kmem_cache *kvm_vcpu_cache;
  385.  EXPORT_SYMBOL_GPL(kvm_vcpu_cache);
  386. -static __read_mostly struct preempt_ops kvm_preempt_ops;
  387. +static void kvm_sched_in(struct preempt_notifier *pn, int cpu);
  388. +static void kvm_sched_out(struct preempt_notifier *pn, struct task_struct *next);
  389. +static struct preempt_ops kvm_preempt_ops = {
  390. +       .sched_in = kvm_sched_in,
  391. +       .sched_out = kvm_sched_out,
  392.  struct dentry *kvm_debugfs_dir;
  393.  EXPORT_SYMBOL_GPL(kvm_debugfs_dir);
  394. @@ -842,7 +847,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
  395.         if ((id < KVM_USER_MEM_SLOTS) &&
  396. @@ -1897,9 +1902,17 @@ EXPORT_SYMBOL_GPL(kvm_read_guest_cached);
  397.  int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len)
  398. -       return kvm_write_guest_page(kvm, gfn, zero_page, offset, len);
  399. +       addr = gfn_to_hva(kvm, gfn);
  400. +       if (kvm_is_error_hva(addr))
  401. +       mark_page_dirty(kvm, gfn);
  402.  EXPORT_SYMBOL_GPL(kvm_clear_guest_page);
  403. @@ -2236,7 +2249,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp)
  404. -static struct file_operations kvm_vcpu_fops = {
  405. +static file_operations_no_const kvm_vcpu_fops __read_only = {
  406.         .release        = kvm_vcpu_release,
  407.         .unlocked_ioctl = kvm_vcpu_ioctl,
  408.  #ifdef CONFIG_KVM_COMPAT
  409. -static struct file_operations kvm_vm_fops = {
  410. +static file_operations_no_const kvm_vm_fops __read_only = {
  411.         .release        = kvm_vm_release,
  412.         .unlocked_ioctl = kvm_vm_ioctl,
  413.  #ifdef CONFIG_KVM_COMPAT
  414. -static struct file_operations kvm_chardev_ops = {
  415. +static file_operations_no_const kvm_chardev_ops __read_only = {
  416.         .unlocked_ioctl = kvm_dev_ioctl,
  417.         .compat_ioctl   = kvm_dev_ioctl,
  418.                 pr_info("kvm: enabling virtualization on CPU%d failed\n", cpu);
  419.         kvm_usage_count++;
  420.         if (kvm_usage_count == 1) {
  421. @@ -3571,7 +3584,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
  422.                 vcpu_align = __alignof__(struct kvm_vcpu);
  423.         kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, vcpu_align,
  424.         if (!kvm_vcpu_cache) {
  425. @@ -3581,9 +3594,11 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
  426.         kvm_chardev_ops.owner = module;
  427.         kvm_vm_fops.owner = module;
  428.         kvm_vcpu_fops.owner = module;
  429.         r = misc_register(&kvm_dev);
  430. @@ -3593,9 +3608,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
  431.         register_syscore_ops(&kvm_syscore_ops);
  432. -       kvm_preempt_ops.sched_in = kvm_sched_in;
  433. -       kvm_preempt_ops.sched_out = kvm_sched_out;
  434.         r = kvm_init_debug();
  435.                 pr_err("kvm: create debugfs files failed\n");
  436.  

Źródło:

Ostatnie wpisy

Linki

Funkcje