Re: [PATCH] vhost: replace % with & on data path

2015-11-30 Thread Joe Perches
On Mon, 2015-11-30 at 10:34 +0200, Michael S. Tsirkin wrote: > We know vring num is a power of 2, so use & > to mask the high bits. [] > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c [] > @@ -1366,10 +1366,12 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, > /* Only get avai

Re: [patch] vfio: make an array larger

2015-11-04 Thread Joe Perches
On Wed, 2015-11-04 at 16:26 +0300, Dan Carpenter wrote: > Smatch complains about a possible out of bounds error: > > drivers/vfio/pci/vfio_pci_config.c:1241 vfio_cap_init() > error: buffer overflow 'pci_cap_length' 20 <= 20 > > Fix this by making the array larger. > > Signed-off-by:

Re: [PATCH V2 1/3] kvm: use kmalloc() instead of kzalloc() during iodev register/unregister

2015-08-25 Thread Joe Perches
On Wed, 2015-08-26 at 13:39 +0800, Jason Wang wrote: > > On 08/25/2015 11:29 PM, Joe Perches wrote: > > On Tue, 2015-08-25 at 15:47 +0800, Jason Wang wrote: > >> > All fields of kvm_io_range were initialized or copied explicitly > >> > afterwards. So switc

Re: [PATCH V2 1/3] kvm: use kmalloc() instead of kzalloc() during iodev register/unregister

2015-08-25 Thread Joe Perches
On Tue, 2015-08-25 at 15:47 +0800, Jason Wang wrote: > All fields of kvm_io_range were initialized or copied explicitly > afterwards. So switch to use kmalloc(). Is there any compiler added alignment padding in either structure? If so, those padding areas would now be uninitialized and may leak k

Re: [PATCH 06/25] powerpc: Use bool function return values of true/false not 1/0

2015-03-30 Thread Joe Perches
On Tue, 2015-03-31 at 12:49 +1100, Benjamin Herrenschmidt wrote: > On Mon, 2015-03-30 at 16:46 -0700, Joe Perches wrote: > > Use the normal return values for bool functions > > Acked-by: Benjamin Herrenschmidt > > Should we merge it or will you ? Hey Ben. I don't

Re: [PATCH 00/25] treewide: Use bool function return values of true/false not 1/0

2015-03-30 Thread Joe Perches
On Mon, 2015-03-30 at 17:07 -0700, Casey Schaufler wrote: > On 3/30/2015 4:45 PM, Joe Perches wrote: > > Joe Perches (25): > > arm: Use bool function return values of true/false not 1/0 [etc...] > Why, and why these in particular? bool functions are probably better ret

[PATCH 11/25] x86: Use bool function return values of true/false not 1/0

2015-03-30 Thread Joe Perches
Use the normal return values for bool functions Signed-off-by: Joe Perches --- arch/x86/include/asm/archrandom.h | 2 +- arch/x86/include/asm/dma-mapping.h | 2 +- arch/x86/include/asm/kvm_para.h| 2 +- arch/x86/kvm/cpuid.h | 2 +- arch/x86/kvm/vmx.c | 72

[PATCH 00/25] treewide: Use bool function return values of true/false not 1/0

2015-03-30 Thread Joe Perches
Joe Perches (25): arm: Use bool function return values of true/false not 1/0 arm64: Use bool function return values of true/false not 1/0 hexagon: Use bool function return values of true/false not 1/0 ia64: Use bool function return values of true/false not 1/0 mips: Use bool function

[PATCH 06/25] powerpc: Use bool function return values of true/false not 1/0

2015-03-30 Thread Joe Perches
Use the normal return values for bool functions Signed-off-by: Joe Perches --- arch/powerpc/include/asm/dcr-native.h| 2 +- arch/powerpc/include/asm/dma-mapping.h | 4 ++-- arch/powerpc/include/asm/kvm_book3s_64.h | 4 ++-- arch/powerpc/sysdev/dcr.c| 2 +- 4 files changed

[PATCH 01/25] arm: Use bool function return values of true/false not 1/0

2015-03-30 Thread Joe Perches
Use the normal return values for bool functions Signed-off-by: Joe Perches --- arch/arm/include/asm/dma-mapping.h | 8 arch/arm/include/asm/kvm_emulate.h | 2 +- arch/arm/mach-omap2/powerdomain.c | 14 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a

Re: [PATCH 1/8] KVM: x86: return bool from kvm_apic_match*()

2015-01-29 Thread Joe Perches
On Thu, 2015-01-29 at 22:48 +0100, Radim Krčmář wrote: > And don't export the internal ones while at it. [] > -int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda) > +static bool kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda) > { > int result = 0; > u32 logica

Re: [PATCH] vhost-scsi: Depend on NET for memcpy_fromiovec

2013-05-15 Thread Joe Perches
On Thu, 2013-05-16 at 13:04 +0930, Rusty Russell wrote: > Asias He writes: > > On Wed, May 15, 2013 at 02:47:53PM +0930, Rusty Russell wrote: [] > > Other users are using memcpy_fromiovec and friends outside net. It seems > > a good idea to put it in a util library. e.g. crypto/algif_skcipher.c >

Re: [PATCH next] kvm: Use pr_

2012-06-27 Thread Joe Perches
On Wed, 2012-06-27 at 21:44 -0300, Marcelo Tosatti wrote: > The advantage is the added prefix? All messages are automatically prefixed. For instance: > > - printk(KERN_WARNING "Fail to find correlated MSI-X entry!\n"); > > + pr_warn("Fail to find correlated MSI-X entry!\n");

[PATCH next] kvm: Use pr_

2012-06-13 Thread Joe Perches
Use a more current logging style. Convert printks to pr_. Add pr_fmt. All logging messages are now prefixed with "kvm: ", "kvm_intel: " or "kvm_amd: " Coalesce formats, align arguments. Add a few missing newlines. Signed-off-by: Joe Perches --- arch/x86/kvm/cpu

Re: [PATCH 8/8] arch/x86: use printk_ratelimited instead of printk_ratelimit

2011-06-06 Thread Joe Perches
On Tue, 2011-06-07 at 12:41 +0930, Rusty Russell wrote: > On Mon, 6 Jun 2011 10:11:53 +0200, richard -rw- weinberger > wrote: > > printk_ratelimited() needs DEFINE_RATELIMIT_STATE() which is defined > > in ratelimit.h. > Yech. I'm assuming that making printk.h include ratelimit.h makes a > nasty

[PATCH 0/4] printk: cleanups of direct includes

2011-05-25 Thread Joe Perches
printk.h is a subfile of kernel.h, do not allow it to be included directly. Joe Perches (4): treewide: Remove direct includes of printk.h staging: Remove direct includes of printk.h printk: Don't allow direct inclusion treewide: Remove asmlinkage from printk arch/arm/k

[PATCH 4/4] treewide: Remove asmlinkage from printk

2011-05-25 Thread Joe Perches
Remove the now unnecessary asmlinkage attribute from the various printk prototypes and uses. Signed-off-by: Joe Perches --- arch/arm/kernel/early_printk.c |2 +- arch/ia64/kvm/vmm.c|2 +- arch/x86/kernel/early_printk.c |2 +- include/linux/printk.h |6

[PATCH] KVM: SVM: Make dump_vmcb static, reduce text

2011-04-24 Thread Joe Perches
arch/x86/kvm/svm.o.old Signed-off-by: Joe Perches --- arch/x86/kvm/svm.c | 176 1 files changed, 94 insertions(+), 82 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index a6bf2ad..1b9f67e 100644 --- a/arch/x86/kvm/svm.c

Re: [PATCH 49/49] virt/kvm/kvm_main.c: Use vzalloc

2010-11-04 Thread Joe Perches
On Fri, 2010-11-05 at 13:25 +0900, Takuya Yoshikawa wrote: > (2010/11/05 12:08), Joe Perches wrote: > > Signed-off-by: Joe Perches > > --- > > virt/kvm/kvm_main.c | 13 +++-- > > 1 files changed, 3 insertions(+), 10 deletions(-) > > > > diff

[PATCH 03/49] arch/powerpc: Use vzalloc

2010-11-04 Thread Joe Perches
Signed-off-by: Joe Perches --- arch/powerpc/kvm/book3s.c |6 ++ arch/powerpc/platforms/cell/spufs/lscsa_alloc.c |3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index e316847..4275463

[PATCH 05/49] arch/x86: Use vzalloc

2010-11-04 Thread Joe Perches
Signed-off-by: Joe Perches --- arch/x86/kernel/microcode_amd.c |3 +-- arch/x86/kvm/x86.c |3 +-- arch/x86/mm/pageattr-test.c |3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c

[PATCH 49/49] virt/kvm/kvm_main.c: Use vzalloc

2010-11-04 Thread Joe Perches
Signed-off-by: Joe Perches --- virt/kvm/kvm_main.c | 13 +++-- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 5225052..c2a08e6e 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -604,13 +604,10 @@ int

[PATCH next 04/16] arch/x86: Use static const char * const where possible

2010-09-13 Thread Joe Perches
Signed-off-by: Joe Perches --- arch/x86/kernel/smpboot.c |2 +- arch/x86/kvm/mmu.c|2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 63a1a55..b745b30 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch

[PATCH next 00/16] treewide: Use static const char * const where possible

2010-09-13 Thread Joe Perches
Convert the uses that should be const of char *foo[] = {"bar", "baz"}; to const char * const foo[] = {"bar", "baz"}; or static const char * const foo[] = {"bar", "baz"}; Joe Perches (16): arch/alpha: Use stat

[PATCH 05/11] arch/powerpc: Remove pr_ uses of KERN_

2010-09-11 Thread Joe Perches
Signed-off-by: Joe Perches --- arch/powerpc/kvm/emulate.c |4 ++-- arch/powerpc/sysdev/pmi.c |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c index 4568ec3..b83ba58 100644 --- a/arch/powerpc/kvm/emulate.c +++ b

[PATCH 03/36] arch/powerpc: Remove unnecessary casts of private_data

2010-07-12 Thread Joe Perches
Signed-off-by: Joe Perches --- arch/powerpc/kvm/timing.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kvm/timing.c b/arch/powerpc/kvm/timing.c index 7037855..46fa04f 100644 --- a/arch/powerpc/kvm/timing.c +++ b/arch/powerpc/kvm/timing.c @@ -182,7 +182,7

[PATCH 02/21] arch/powerpc: Remove unnecessary kmalloc casts

2010-05-31 Thread Joe Perches
Signed-off-by: Joe Perches --- arch/powerpc/kernel/nvram_64.c |3 +-- arch/powerpc/kvm/book3s.c |4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 9cf197f..99c6dab 100644 --- a/arch/powerpc

[PATCH 01/10] arch/ia64: Fix continuation line formats

2010-02-01 Thread Joe Perches
String constants that are continued on subsequent lines with \ are not good. Signed-off-by: Joe Perches --- arch/ia64/kvm/mmio.c |4 ++-- arch/ia64/kvm/vcpu.c |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/ia64/kvm/mmio.c b/arch/ia64/kvm/mmio.c index

[PATCH] MAINTAINERS: Remove file pattern from KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V

2009-12-08 Thread Joe Perches
Commit 6c8166a77c98f473eb91e96a61c3cf78ac617278 folded this file away. Signed-off-by: Joe Perches diff --git a/MAINTAINERS b/MAINTAINERS index ea781c1..fda3eec 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3109,7 +3109,6 @@ L:kvm@vger.kernel.org W: http://kvm.qumranet.com S

[PATCH 00/21] pr_dbg, pr_fmt

2009-10-04 Thread Joe Perches
to, kernel, and a few drivers. It also converts printk(KERN_ to pr_ in a few files that already had some pr_ uses. The conversion also generally used long length format strings in the place of multiple short strings to ease any grep/search. Joe Perches (21): include/linux/ dynamic_debug.

[PATCH 11/21] i8254.c: Add pr_fmt(fmt)

2009-10-04 Thread Joe Perches
Add pr_fmt(fmt) "pit: " fmt Strip pit: prefixes from pr_debug Signed-off-by: Joe Perches --- arch/x86/kvm/i8254.c | 12 +++- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 82ad523..fa83a15 100644 --- a/ar

[PATCH 07/62] arch/s390/kvm/interrupt.c: Remove unnecessary semicolons

2009-06-28 Thread Joe Perches
Signed-off-by: Joe Perches --- arch/s390/kvm/interrupt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index f04f530..dc94adb 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c @@ -484,7 +484,7

[PATCH 02/62] arch/ia64: Remove unnecessary semicolons

2009-06-28 Thread Joe Perches
Signed-off-by: Joe Perches --- arch/ia64/kernel/esi.c |2 +- arch/ia64/kvm/process.c |6 +++--- arch/ia64/kvm/vcpu.c|2 +- arch/ia64/kvm/vtlb.c|4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/ia64/kernel/esi.c b/arch/ia64/kernel/esi.c index