[PATCH] Documentation: kvm: fix a typo
Fixes: 9824c83f92bc8 ("Documentation: kvm: document CPUID bit for MSR_KVM_POLL_CONTROL") Signed-off-by: Li Qiang --- Documentation/virt/kvm/cpuid.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/virt/kvm/cpuid.rst b/Documentation/virt/kvm/cpuid.rst index a7dff9186bed..9150e9d1c39b 100644 --- a/Documentation/virt/kvm/cpuid.rst +++ b/Documentation/virt/kvm/cpuid.rst @@ -78,7 +78,7 @@ KVM_FEATURE_PV_SEND_IPI 11 guest checks this feature bit before enabling paravirtualized sebd IPIs -KVM_FEATURE_PV_POLL_CONTROL 12 host-side polling on HLT can +KVM_FEATURE_POLL_CONTROL 12 host-side polling on HLT can be disabled by writing to msr 0x4b564d05. -- 2.25.1
[PATCH] Documentation: kvm: fix a typo
Fixes: e287d6de62f74 ("Documentation: kvm: Convert cpuid.txt to .rst") Signed-off-by: Li Qiang --- Documentation/virt/kvm/cpuid.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/virt/kvm/cpuid.rst b/Documentation/virt/kvm/cpuid.rst index a7dff9186bed..ff2b38d3e108 100644 --- a/Documentation/virt/kvm/cpuid.rst +++ b/Documentation/virt/kvm/cpuid.rst @@ -62,7 +62,7 @@ KVM_FEATURE_PV_EOI6 paravirtualized end of interrupt handler can be enabled by writing to msr 0x4b564d04 -KVM_FEATURE_PV_UNHAULT7 guest checks this feature bit +KVM_FEATURE_PV_UNHALT 7 guest checks this feature bit before enabling paravirtualized spinlock support -- 2.25.1
[PATCH] cpuidle-haltpoll: fix error comments in arch_haltpoll_disable
The 'arch_haltpoll_disable' is used to disable guest halt poll. Correct the comments. Fixes: a1c4423b02b21 ("cpuidle-haltpoll: disable host side polling when kvm virtualized") Signed-off-by: Li Qiang --- arch/x86/kernel/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 08320b0b2b27..94ebb31cb4ce 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -954,7 +954,7 @@ void arch_haltpoll_disable(unsigned int cpu) if (!kvm_para_has_feature(KVM_FEATURE_POLL_CONTROL)) return; - /* Enable guest halt poll disables host halt poll */ + /* Disable guest halt poll enables host halt poll */ smp_call_function_single(cpu, kvm_enable_host_haltpoll, NULL, 1); } EXPORT_SYMBOL_GPL(arch_haltpoll_disable); -- 2.25.1
Re: [PATCH] vhost-vdpa: fix memory leak in error path
Any status update? Thanks, Li Qiang Li Qiang 于2020年9月9日周三 下午11:42写道: > > Free the 'page_list' when the 'npages' is zero. > > Signed-off-by: Li Qiang > --- > drivers/vhost/vdpa.c | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index 3fab94f88894..6a9fcaf1831d 100644 > --- a/drivers/vhost/vdpa.c > +++ b/drivers/vhost/vdpa.c > @@ -609,8 +609,10 @@ static int vhost_vdpa_process_iotlb_update(struct > vhost_vdpa *v, > gup_flags |= FOLL_WRITE; > > npages = PAGE_ALIGN(msg->size + (iova & ~PAGE_MASK)) >> PAGE_SHIFT; > - if (!npages) > - return -EINVAL; > + if (!npages) { > + ret = -EINVAL; > + goto free_page; > + } > > mmap_read_lock(dev->mm); > > @@ -666,6 +668,8 @@ static int vhost_vdpa_process_iotlb_update(struct > vhost_vdpa *v, > atomic64_sub(npages, >mm->pinned_vm); > } > mmap_read_unlock(dev->mm); > + > +free_page: > free_page((unsigned long)page_list); > return ret; > } > -- > 2.25.1 >
[PATCH] vhost-vdpa: fix memory leak in error path
Free the 'page_list' when the 'npages' is zero. Signed-off-by: Li Qiang --- drivers/vhost/vdpa.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 3fab94f88894..6a9fcaf1831d 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -609,8 +609,10 @@ static int vhost_vdpa_process_iotlb_update(struct vhost_vdpa *v, gup_flags |= FOLL_WRITE; npages = PAGE_ALIGN(msg->size + (iova & ~PAGE_MASK)) >> PAGE_SHIFT; - if (!npages) - return -EINVAL; + if (!npages) { + ret = -EINVAL; + goto free_page; + } mmap_read_lock(dev->mm); @@ -666,6 +668,8 @@ static int vhost_vdpa_process_iotlb_update(struct vhost_vdpa *v, atomic64_sub(npages, >mm->pinned_vm); } mmap_read_unlock(dev->mm); + +free_page: free_page((unsigned long)page_list); return ret; } -- 2.25.1
[PATCH] vfio: fix potential memory leak in vfio_msi_cap_len
Free the vdev->msi_perm in error path. Signed-off-by: Li Qiang --- drivers/vfio/pci/vfio_pci_config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c index 115a36f6f403..62023b4a373b 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c @@ -1180,8 +1180,10 @@ static int vfio_msi_cap_len(struct vfio_pci_device *vdev, u8 pos) return -ENOMEM; ret = init_pci_cap_msi_perm(vdev->msi_perm, len, flags); - if (ret) + if (ret) { + kfree(vdev->msi_perm); return ret; + } return len; } -- 2.11.0
[PATCH] vfio: fix potential memory leak in vfio_msi_cap_len
Free the vdev->msi_perm in error path. Signed-off-by: Li Qiang --- drivers/vfio/pci/vfio_pci_config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c index 115a36f6f403..62023b4a373b 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c @@ -1180,8 +1180,10 @@ static int vfio_msi_cap_len(struct vfio_pci_device *vdev, u8 pos) return -ENOMEM; ret = init_pci_cap_msi_perm(vdev->msi_perm, len, flags); - if (ret) + if (ret) { + kfree(vdev->msi_perm); return ret; + } return len; } -- 2.11.0
[PATCH] ia64: pgtable.h: fix a comment typo
Signed-off-by: Li Qiang --- arch/ia64/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ia64/include/asm/pgtable.h b/arch/ia64/include/asm/pgtable.h index 165827774bea..2cccfbb23c2d 100644 --- a/arch/ia64/include/asm/pgtable.h +++ b/arch/ia64/include/asm/pgtable.h @@ -336,7 +336,7 @@ static inline void set_pte(pte_t *ptep, pte_t pteval) if (pte_present_exec_user(pteval) && (!pte_present(*ptep) || pte_pfn(*ptep) != pte_pfn(pteval))) - /* load_module() calles flush_icache_range() explicitly*/ + /* load_module() calls flush_icache_range() explicitly*/ __ia64_sync_icache_dcache(pteval); *ptep = pteval; } -- 2.11.0
[PATCH] ia64: pgtable.h: fix a comment typo
Signed-off-by: Li Qiang --- arch/ia64/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ia64/include/asm/pgtable.h b/arch/ia64/include/asm/pgtable.h index 165827774bea..2cccfbb23c2d 100644 --- a/arch/ia64/include/asm/pgtable.h +++ b/arch/ia64/include/asm/pgtable.h @@ -336,7 +336,7 @@ static inline void set_pte(pte_t *ptep, pte_t pteval) if (pte_present_exec_user(pteval) && (!pte_present(*ptep) || pte_pfn(*ptep) != pte_pfn(pteval))) - /* load_module() calles flush_icache_range() explicitly*/ + /* load_module() calls flush_icache_range() explicitly*/ __ia64_sync_icache_dcache(pteval); *ptep = pteval; } -- 2.11.0
[PATCH] fs.h: fix outdated comment about file flags
The __dentry_open function was removed in commit <2a027e7a18738>("fold __dentry_open() into its sole caller"). Signed-off-by: Li Qiang <liq...@gmail.com> --- include/linux/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 760d8da1b6c7..7f07977bdfd7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -94,7 +94,7 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset, /* * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond - * to O_WRONLY and O_RDWR via the strange trick in __dentry_open() + * to O_WRONLY and O_RDWR via the strange trick in do_dentry_open() */ /* file is open for reading */ -- 2.16.3
[PATCH] fs.h: fix outdated comment about file flags
The __dentry_open function was removed in commit <2a027e7a18738>("fold __dentry_open() into its sole caller"). Signed-off-by: Li Qiang --- include/linux/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 760d8da1b6c7..7f07977bdfd7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -94,7 +94,7 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset, /* * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond - * to O_WRONLY and O_RDWR via the strange trick in __dentry_open() + * to O_WRONLY and O_RDWR via the strange trick in do_dentry_open() */ /* file is open for reading */ -- 2.16.3
[PATCH] Documentation: DocBook: kgdb: update CONFIG_STRICT_KERNEL_RWX info
CONFIG_STRICT_KERNEL_RWX is no longer selectable on most architectures. Update this info to the documentation. Signed-off-by: Li Qiang <liqiang...@360.cn> --- Documentation/DocBook/kgdb.tmpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/DocBook/kgdb.tmpl b/Documentation/DocBook/kgdb.tmpl index 856ac20..ef0b67b 100644 --- a/Documentation/DocBook/kgdb.tmpl +++ b/Documentation/DocBook/kgdb.tmpl @@ -121,7 +121,9 @@ If kgdb supports it for the architecture you are using, you can use hardware breakpoints if you desire to run with the CONFIG_STRICT_KERNEL_RWX option turned on, else you need to turn off -this option. +this option. In most architectures, this option is not selectable. +For this situation, it can be turned off by adding a runtime parameter +'rodata=off'. Next you should choose one of more I/O drivers to interconnect -- 2.7.4
[PATCH] Documentation: DocBook: kgdb: update CONFIG_STRICT_KERNEL_RWX info
CONFIG_STRICT_KERNEL_RWX is no longer selectable on most architectures. Update this info to the documentation. Signed-off-by: Li Qiang --- Documentation/DocBook/kgdb.tmpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/DocBook/kgdb.tmpl b/Documentation/DocBook/kgdb.tmpl index 856ac20..ef0b67b 100644 --- a/Documentation/DocBook/kgdb.tmpl +++ b/Documentation/DocBook/kgdb.tmpl @@ -121,7 +121,9 @@ If kgdb supports it for the architecture you are using, you can use hardware breakpoints if you desire to run with the CONFIG_STRICT_KERNEL_RWX option turned on, else you need to turn off -this option. +this option. In most architectures, this option is not selectable. +For this situation, it can be turned off by adding a runtime parameter +'rodata=off'. Next you should choose one of more I/O drivers to interconnect -- 2.7.4