]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge branch 'x86/cpufeature' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
authorRadim Krčmář <rkrcmar@redhat.com>
Wed, 16 Nov 2016 21:07:36 +0000 (22:07 +0100)
committerRadim Krčmář <rkrcmar@redhat.com>
Wed, 16 Nov 2016 21:07:36 +0000 (22:07 +0100)
Topic branch for AVX512_4VNNIW and AVX512_4FMAPS support in KVM.

1  2 
virt/kvm/kvm_main.c

diff --combined virt/kvm/kvm_main.c
index b44edd85011a5655bb66ed7591a5d0d49567e5bc,5c360347a1e9fc2091f5abf0bbb6a3432e13add9..fbf04c0c898cd7dd6aa436119aa09805253915aa
@@@ -595,7 -595,7 +595,7 @@@ static int kvm_create_vm_debugfs(struc
                stat_data->kvm = kvm;
                stat_data->offset = p->offset;
                kvm->debugfs_stat_data[p - debugfs_entries] = stat_data;
 -              if (!debugfs_create_file(p->name, 0444,
 +              if (!debugfs_create_file(p->name, 0644,
                                         kvm->debugfs_dentry,
                                         stat_data,
                                         stat_fops_per_vm[p->kind]))
@@@ -1346,21 -1346,19 +1346,19 @@@ unsigned long kvm_vcpu_gfn_to_hva_prot(
  static int get_user_page_nowait(unsigned long start, int write,
                struct page **page)
  {
-       int flags = FOLL_TOUCH | FOLL_NOWAIT | FOLL_HWPOISON | FOLL_GET;
+       int flags = FOLL_NOWAIT | FOLL_HWPOISON;
  
        if (write)
                flags |= FOLL_WRITE;
  
-       return __get_user_pages(current, current->mm, start, 1, flags, page,
-                       NULL, NULL);
+       return get_user_pages(start, 1, flags, page, NULL);
  }
  
  static inline int check_user_page_hwpoison(unsigned long addr)
  {
-       int rc, flags = FOLL_TOUCH | FOLL_HWPOISON | FOLL_WRITE;
+       int rc, flags = FOLL_HWPOISON | FOLL_WRITE;
  
-       rc = __get_user_pages(current, current->mm, addr, 1,
-                             flags, NULL, NULL, NULL);
+       rc = get_user_pages(addr, 1, flags, NULL, NULL);
        return rc == -EHWPOISON;
  }
  
@@@ -3663,23 -3661,11 +3661,23 @@@ static int vm_stat_get_per_vm(void *dat
        return 0;
  }
  
 +static int vm_stat_clear_per_vm(void *data, u64 val)
 +{
 +      struct kvm_stat_data *stat_data = (struct kvm_stat_data *)data;
 +
 +      if (val)
 +              return -EINVAL;
 +
 +      *(ulong *)((void *)stat_data->kvm + stat_data->offset) = 0;
 +
 +      return 0;
 +}
 +
  static int vm_stat_get_per_vm_open(struct inode *inode, struct file *file)
  {
        __simple_attr_check_format("%llu\n", 0ull);
        return kvm_debugfs_open(inode, file, vm_stat_get_per_vm,
 -                              NULL, "%llu\n");
 +                              vm_stat_clear_per_vm, "%llu\n");
  }
  
  static const struct file_operations vm_stat_get_per_vm_fops = {
@@@ -3705,26 -3691,11 +3703,26 @@@ static int vcpu_stat_get_per_vm(void *d
        return 0;
  }
  
 +static int vcpu_stat_clear_per_vm(void *data, u64 val)
 +{
 +      int i;
 +      struct kvm_stat_data *stat_data = (struct kvm_stat_data *)data;
 +      struct kvm_vcpu *vcpu;
 +
 +      if (val)
 +              return -EINVAL;
 +
 +      kvm_for_each_vcpu(i, vcpu, stat_data->kvm)
 +              *(u64 *)((void *)vcpu + stat_data->offset) = 0;
 +
 +      return 0;
 +}
 +
  static int vcpu_stat_get_per_vm_open(struct inode *inode, struct file *file)
  {
        __simple_attr_check_format("%llu\n", 0ull);
        return kvm_debugfs_open(inode, file, vcpu_stat_get_per_vm,
 -                               NULL, "%llu\n");
 +                               vcpu_stat_clear_per_vm, "%llu\n");
  }
  
  static const struct file_operations vcpu_stat_get_per_vm_fops = {
@@@ -3759,26 -3730,7 +3757,26 @@@ static int vm_stat_get(void *_offset, u
        return 0;
  }
  
 -DEFINE_SIMPLE_ATTRIBUTE(vm_stat_fops, vm_stat_get, NULL, "%llu\n");
 +static int vm_stat_clear(void *_offset, u64 val)
 +{
 +      unsigned offset = (long)_offset;
 +      struct kvm *kvm;
 +      struct kvm_stat_data stat_tmp = {.offset = offset};
 +
 +      if (val)
 +              return -EINVAL;
 +
 +      spin_lock(&kvm_lock);
 +      list_for_each_entry(kvm, &vm_list, vm_list) {
 +              stat_tmp.kvm = kvm;
 +              vm_stat_clear_per_vm((void *)&stat_tmp, 0);
 +      }
 +      spin_unlock(&kvm_lock);
 +
 +      return 0;
 +}
 +
 +DEFINE_SIMPLE_ATTRIBUTE(vm_stat_fops, vm_stat_get, vm_stat_clear, "%llu\n");
  
  static int vcpu_stat_get(void *_offset, u64 *val)
  {
        return 0;
  }
  
 -DEFINE_SIMPLE_ATTRIBUTE(vcpu_stat_fops, vcpu_stat_get, NULL, "%llu\n");
 +static int vcpu_stat_clear(void *_offset, u64 val)
 +{
 +      unsigned offset = (long)_offset;
 +      struct kvm *kvm;
 +      struct kvm_stat_data stat_tmp = {.offset = offset};
 +
 +      if (val)
 +              return -EINVAL;
 +
 +      spin_lock(&kvm_lock);
 +      list_for_each_entry(kvm, &vm_list, vm_list) {
 +              stat_tmp.kvm = kvm;
 +              vcpu_stat_clear_per_vm((void *)&stat_tmp, 0);
 +      }
 +      spin_unlock(&kvm_lock);
 +
 +      return 0;
 +}
 +
 +DEFINE_SIMPLE_ATTRIBUTE(vcpu_stat_fops, vcpu_stat_get, vcpu_stat_clear,
 +                      "%llu\n");
  
  static const struct file_operations *stat_fops[] = {
        [KVM_STAT_VCPU] = &vcpu_stat_fops,
@@@ -3836,7 -3768,7 +3834,7 @@@ static int kvm_init_debug(void
  
        kvm_debugfs_num_entries = 0;
        for (p = debugfs_entries; p->name; ++p, kvm_debugfs_num_entries++) {
 -              if (!debugfs_create_file(p->name, 0444, kvm_debugfs_dir,
 +              if (!debugfs_create_file(p->name, 0644, kvm_debugfs_dir,
                                         (void *)(long)p->offset,
                                         stat_fops[p->kind]))
                        goto out_dir;