[PATCH] ACPI: small formatting fixes

2016-11-20 Thread Nick Desaulniers
A quick cleanup that passes scripts/checkpatch.pl -f . Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- arch/x86/kernel/acpi/cstate.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kerne

Re: [PATCH] ACPI: small formatting fixes

2016-12-12 Thread Nick Desaulniers
> Please... don't encourage people more, we have enough cleanup patches > as is. I recognize that this patch is relatively inconsequential, but it is my first patch to the Linux kernel, and is teaching me how to wrangle my email client and about the development work flow. I plan to write a blog

Re: [PATCH v3] ACPI: small formatting fixes

2016-12-12 Thread Nick Desaulniers
>From https://lkml.org/lkml/2016/12/12/610: >> Anyway with that fixed, >> Acked-by: Pavel Machek > That's not an ack. Oh, sorry, should I resubmit v4 with the Ack removed from the commit message? ~Nick

[PATCH v3] ACPI: small formatting fixes

2016-12-12 Thread Nick Desaulniers
A quick cleanup with scripts/checkpatch.pl -f . Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> Acked-by: Pavel Machek <pa...@ucw.cz> --- arch/x86/kernel/acpi/cstate.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/acpi/cst

[PATCH] ACPI: small formatting fixes

2016-12-11 Thread Nick Desaulniers
A quick cleanup that passes scripts/checkpatch.pl -f . Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- arch/x86/kernel/acpi/cstate.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kerne

Re: [PATCH] ACPI: small formatting fixes

2016-12-12 Thread Nick Desaulniers
>From 47d3bcb76ef89ddbe74c8d8aacee1c0c6203a766 Mon Sep 17 00:00:00 2001 From: Nick Desaulniers <nick.desaulni...@gmail.com> Date: Mon, 12 Dec 2016 09:50:23 -0800 Subject: [PATCH v2] ACPI: small formatting fixes A quick cleanup that passes scripts/checkpatch.pl -f . Signed-off

Re: [PATCH] ACPI: small formatting fixes

2016-12-22 Thread Nick Desaulniers
On Tue, Dec 13, 2016 at 08:00:01PM +0100, Pavel Machek wrote: > Actually.. the ACPI cleanup is fine. You did well :-). > Pavel Cool, so (forgive the naive question) what happens next? Maybe I'm too used to the immediate

[PATCH] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-07-31 Thread Nick Desaulniers
the comparison first add parentheses around left hand side expression to silence this warning There's not necessarily a bug here, but it's cleaner to use the form: if (x != 0) rather than: if (!x == 0) Signed-off-by: Nick Desaulniers <ndesaulni...@google.com> --- Also, it's even cleaner

Re: [PATCH 2/2] arm64: Define PAGE_OFFSET using GENMASK_ULL

2017-08-02 Thread Nick Desaulniers
~ ^ ~ > > Use GENMASK_ULL() instead of shifting explicitly, the macro takes care > of avoiding the overflow. > > Reported-by: Nick Desaulniers <ndesaulni...@google.com> > Signed-off-by: Matthias Kaehlcke <m...@chromium.org> > --- > arch/arm64/in

Re: [PATCH 2/2] arm64: Define PAGE_OFFSET using GENMASK_ULL

2017-08-02 Thread Nick Desaulniers
hmm, seems including the definition of GENMASK_ULL causes tons of issues see definition of UL() macro defines _AC token pastes UL on literal when not assembly so looks like GENMASK_ULL is not ready to be used from assembly On Wed, Aug 2, 2017 at 4:13 PM, Nick Desaulniers <ndesaulni...@google.

[PATCH v2] arm64: avoid overflow in VA_START and PAGE_OFFSET

2017-08-03 Thread Nick Desaulniers
pastes UL suffixes when not included in assembly sources). Suggested-by: Ard Biesheuvel <ard.biesheu...@linaro.org> Suggested-by: Yury Norov <yno...@caviumnetworks.com> Suggested-by: Matthias Kaehlcke <m...@chromium.org> Signed-off-by: Nick Desaulniers <ndesaulni...@google.c

Re: [PATCH] arm64: avoid overflow in VA_START and PAGE_OFFSET

2017-08-03 Thread Nick Desaulniers
int, which on arm64 is LP64 making it 32b, where most configs set VA_BITS to larger than 32b. Shifting by more than the width is undefined behavior. And without it, I get compile errors. I'll send v2 with your suggestion, thanks. -- Thanks, ~Nick Desaulniers

[PATCH] arm64: avoid overflow in VA_START and PAGE_OFFSET

2017-08-03 Thread Nick Desaulniers
pastes UL suffixes when not included in assembly sources). Suggested-by: Yury Norov <yno...@caviumnetworks.com> Suggested-by: Matthias Kaehlcke <m...@chromium.org> Signed-off-by: Nick Desaulniers <ndesaulni...@google.com> --- arch/arm64/include/asm/memory.h | 5 +++-- 1 file

[PATCH] scsi: sg: Prevent potential double frees in sg driver

2017-08-03 Thread Nick Desaulniers
ed-off-by: Robb Glasser <rglas...@google.com> Signed-off-by: Nick Desaulniers <ndesaulni...@google.com> --- drivers/scsi/sg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 4fe606b000b4..40fe71f4c863 100644 --- a/drivers/scsi/sg.c +++ b

Re: [PATCH] scsi: sg: Prevent potential double frees in sg driver

2017-08-03 Thread Nick Desaulniers
merged by maintainers. I'll note to use option #1 next time, unless you suggest I send a v2? I can do so if this patch has a v2+. -- Thanks, ~Nick Desaulniers

[PATCH v2] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-08-11 Thread Nick Desaulniers
instance. Signed-off-by: Nick Desaulniers <ndesaulni...@google.com> --- Changes in v2: * Reorder if/else blocks to return early. * Also handle this for set_h245_addr(), not just set_h225_addr(). * Add return code check for the Gnomemeeting case. net/ipv4/netfilter/nf_nat_h323.

Re: [PATCH v2] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-08-14 Thread Nick Desaulniers
Minor nit for the commit message that can get fixed up when being merged: On Fri, Aug 11, 2017 at 11:16 AM, Nick Desaulniers <ndesaulni...@google.com> wrote: > if (x) > return > ... > > rather than: > > if (!x == 0) should remove the `!`, ex: if (x == 0)

Re: [PATCH v4] Input: mousedev - fix implicit conversion warning

2017-07-12 Thread Nick Desaulniers
Hi Dmitry, did you get a chance to merge the sugguested revision, yet?

Re: [PATCH] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-08-08 Thread Nick Desaulniers
bumping for review On Mon, Jul 31, 2017 at 11:39 AM, Nick Desaulniers <ndesaulni...@google.com> wrote: > Clang produces the following warning: > > net/ipv4/netfilter/nf_nat_h323.c:553:6: error: > logical not is only applied to the left hand side of this comparison >

Re: [PATCH] mm/vmscan: fix unsequenced modification and access warning

2017-05-10 Thread Nick Desaulniers
> You can add Something that's not clear to me when advised to add, should I be uploading a v3 with your acked by? I think I got that wrong the last time I asked (which was my first patch to Linux). > But I still do not understand which part of the code is undefined and > why. It's not

[Patch v4] x86/build: don't add -maccumulate-outgoing-args w/o compiler support

2017-05-08 Thread Nick Desaulniers
Clang does not support this machine dependent option. Older versions of GCC (pre 3.0) may not support this option, added in 2000, but it's unlikely they can still compile the kernel. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- arch/x86/Makefile | 3 ++- 1 file chan

[Patch v3] mm/vmscan: fix unsequenced modification and access warning

2017-05-10 Thread Nick Desaulniers
the initialization code violates the specification (6.7.8 par 19 (ISO/IEC 9899) looks like it disagrees) the code is quite confusing and worth cleaning up anyway. Fix this by reusing sc.gfp_mask rather than the updated input gfp_mask parameter. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.

[PATCH] x86/PCI: fix duplicate 'const' declaration specifier

2017-05-09 Thread Nick Desaulniers
the loop variable is marked const twice. While this particular call site does not modify the loop variable, trying to do so would already result in a compile time failure, so we can remove the current const. Other call sites do not mark the loop variable const. Signed-off-by: Nick Desaulniers

[PATCH] drm/mm: fix duplicate 'const' declaration specifier

2017-05-09 Thread Nick Desaulniers
the loop variable is marked const twice. While this particular call site does not modify the loop variable, trying to do so would already result in a compile time failure, so we can remove the current const. Other call sites do not mark the loop variable const. Signed-off-by: Nick Desaulniers

Re: [PATCH] drm/mm: fix duplicate 'const' declaration specifier

2017-05-09 Thread Nick Desaulniers
ah seems like there's more of these: drivers/gpu/drm/drm_mm.c:922 surprised compiling drivers/gpu/drm/drm_mm.o did not catch this the first time...

Re: [PATCH] x86/PCI: fix duplicate 'const' declaration specifier

2017-05-09 Thread Nick Desaulniers
Please disregard this patch. I think I may have found a bug in Clang, or at least an incompatibility with GCC 7.1. Clang bug: https://bugs.llvm.org/show_bug.cgi?id=32985

Re: [PATCH] drm/mm: fix duplicate 'const' declaration specifier

2017-05-09 Thread Nick Desaulniers
Please disregard this patch. I think I may have found a bug in Clang, or at least an incompatibility with GCC 7.1. Clang bug: https://bugs.llvm.org/show_bug.cgi?id=32985

[PATCH] mm/vmscan: fix unsequenced modification and access warning

2017-05-10 Thread Nick Desaulniers
Clang flags this file with the -Wunsequenced error that GCC does not have. unsequenced modification and access to 'gfp_mask' It seems that gfp_mask is both read and written without a sequence point in between, which is undefined behavior. Signed-off-by: Nick Desaulniers <nick.desau

[Patch v2] mm/vmscan: fix unsequenced modification and access warning

2017-05-10 Thread Nick Desaulniers
Clang flags this file with the -Wunsequenced error that GCC does not have. unsequenced modification and access to 'gfp_mask' It seems that gfp_mask is both read and written without a sequence point in between, which is undefined behavior. Signed-off-by: Nick Desaulniers <nick.desau

Re: [PATCH v4] Input: mousedev - fix implicit conversion warning

2017-06-22 Thread Nick Desaulniers
Hi Dmitry, did you have more feedback for this patch?

[PATCH] KVM: x86: remove ignored type attribute

2017-06-22 Thread Nick Desaulniers
The macro insn_fetch marks the 'type' argument as having a specified alignment. Type attributes can only be applied to structs, unions, or enums, but insn_fetch is only ever invoked with integral types, so Clang produces 19 -Wignored-attributes warnings for this source file. Signed-off-by: Nick

Re: [PATCH v4] Input: mousedev - fix implicit conversion warning

2017-06-26 Thread Nick Desaulniers
On Sun, Jun 25, 2017 at 11:06:09AM -0700, Dmitry Torokhov wrote: > Hi Nick, > > Since the time the code was written we got nice helpers to clamp the > values. Does the following work for you or it still leaves clang > unhappy? LGTM, no more warnings with Clang.

Re: [PATCH] KVM: x86: dynamically allocate large struct in em_fxrstor

2017-05-24 Thread Nick Desaulniers
On Wed, May 24, 2017 at 04:19:57PM +0200, Radim Krčmář wrote: > 2017-05-23 23:24-0700, Nick Desaulniers: > > + fx_state = kmalloc(sizeof(*fx_state), GFP_KERNEL); > > + fx_state = kmalloc(sizeof(*fx_state), GFP_KERNEL); > > fx_state must be 16 byte aligned and x86 ARCH_

[PATCH v3] Input: mousedev - fix implicit conversion warning

2017-05-26 Thread Nick Desaulniers
~ As far as I can tell, from http://www.computer-engineering.org/ps2mouse/ Under "Command Set" > "0xE9 (Status Request)" the value 200 is a valid sample rate. Using unsigned char, rather than signed char, for client->ps2 silences this warning. Signed-off-by: Nick Desa

[PATCH v2] Input: mousedev - fix implicit conversion warning

2017-05-26 Thread Nick Desaulniers
~ As far as I can tell, from http://www.computer-engineering.org/ps2mouse/ Under "Command Set" > "0xE9 (Status Request)" the value 200 is a valid sample rate. Using unsigned char, rather than signed char, for client->ps2 silences this warning. Signed-off-by: Nick Desa

[PATCH] drm/i915: mark wait_for_engine() __maybe_unused

2017-05-20 Thread Nick Desaulniers
] static int wait_for_engine(struct intel_engine_cs *engine, int timeout_ms) ^ Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- Additionally, it only has one call site. Should I mark it inline, too, while I'm at it? drivers/gpu/drm/i915/i915_gem.c | 3 ++-

[PATCH] drm/i915/gvt: remove redundant -Wall

2017-05-21 Thread Nick Desaulniers
. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- I verified that -Wall was redundant by compiling with V=1: make V=1 -j4 drivers/gpu/drm/i915/i915_gem_request.o drivers/gpu/drm/i915/gvt/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i9

[PATCH] sysfs: remove signedness from sysfs_get_dirent

2017-05-21 Thread Nick Desaulniers
) ^ Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- Alternatively, maybe KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign) should be added elsewhere like arch/x86/boot/compressed/Makefile include/linux/sysfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH v3] Input: mousedev - fix implicit conversion warning

2017-05-29 Thread Nick Desaulniers
On Fri, May 26, 2017 at 10:07:46AM -0700, Dmitry Torokhov wrote: > If you look at the code of this fucntion we really use ps2_data as > signed in calculations, and this change would break that. While making > ps2_data u8 might be beneficial we'd need to rework mousedev_packet() to > use signed

[PATCH v2] KVM: x86: avoid large stack allocations in em_fxrstor

2017-05-29 Thread Nick Desaulniers
x86_emulate_ctxt *ctxt) ^ with CONFIG_FRAME_WARN set to 1024. This patch does the fixup in em_fxstor now, avoiding one additional struct fxregs_state, and now fxstor_fixup can be removed as it has no other call sites. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- New

Re: [PATCH] drm/i915/gvt: remove redundant -Wall

2017-05-29 Thread Nick Desaulniers
ping for review

Re: [PATCH v2] KVM: x86: avoid large stack allocations in em_fxrstor

2017-05-29 Thread Nick Desaulniers
On Tue, May 30, 2017 at 04:14:50AM +0800, kbuild test robot wrote: >arch/x86/kvm/emulate.c: In function 'em_fxrstor': > >> arch/x86/kvm/emulate.c:4015:5: warning: 'size' may be used uninitialized > >> in this function [-Wmaybe-uninitialized] > rc = segmented_read_std(ctxt,

[PATCH v3] KVM: x86: avoid large stack allocations in em_fxrstor

2017-05-29 Thread Nick Desaulniers
x86_emulate_ctxt *ctxt) ^ with CONFIG_FRAME_WARN set to 1024. This patch does the fixup in em_fxstor now, avoiding one additional struct fxregs_state, and now fxstor_fixup can be removed as it has no other call sites. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- New

[PATCH] Input: mousedev - fix implicit conversion warning

2017-05-25 Thread Nick Desaulniers
~ As far as I can tell, from http://www.computer-engineering.org/ps2mouse/ Under "Command Set" > "0xE9 (Status Request)" the value 200 is a valid sample rate. An explicit cast silences this warning. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- dri

Re: [PATCH] mm/zsmalloc: fix -Wunneeded-internal-declaration warning

2017-05-25 Thread Nick Desaulniers
On Wed, May 24, 2017 at 05:16:18PM +0900, Sergey Senozhatsky wrote: > On (05/23/17 22:38), Nick Desaulniers wrote: > > Fixes the following warning, found with Clang: > well, no objections from my side. MM seems to be getting more and > more `__maybe_unused' annotations because of

Re: [Patch v2] mm/vmscan: fix unsequenced modification and access warning

2017-05-25 Thread Nick Desaulniers
On Tue, May 16, 2017 at 10:27:46AM +0200, Michal Hocko wrote: > I guess it is worth reporting this to clang bugzilla. Could you take > care of that Nick? >From https://bugs.llvm.org//show_bug.cgi?id=33065#c5 it seems that this is indeed a sequence bug in the previous version of this code and not

Re: [PATCH] KVM: x86: dynamically allocate large struct in em_fxrstor

2017-05-25 Thread Nick Desaulniers
On Thu, May 25, 2017 at 04:07:08PM +0200, Paolo Bonzini wrote: > I think we should do the fixup backwards. > > That is: > > - first do get_fpu > > - if the fixup is necessary, i.e. ctxt->mode < X86EMUL_MODE_PROT64, do > fxsave into > > - then do segmented_read_std with the correct size, which

[PATCH] mm/zsmalloc: fix -Wunneeded-internal-declaration warning

2017-05-23 Thread Nick Desaulniers
'is_first_page' is not needed and will not be emitted [-Wunneeded-internal-declaration] static int is_first_page(struct page *page) ^ Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- mm/zsmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --gi

[PATCH] KVM: x86: dynamically allocate large struct in em_fxrstor

2017-05-24 Thread Nick Desaulniers
Fixes the warning: arch/x86/kvm/emulate.c:4018:12: warning: stack frame size of 1080 bytes in function 'em_fxrstor' [-Wframe-larger-than=] static int em_fxrstor(struct x86_emulate_ctxt *ctxt) ^ Found with CONFIG_FRAME_WARN set to 1024. Signed-off-by: Nick Desaulniers

Re: [Patch v2] mm/vmscan: fix unsequenced modification and access warning

2017-05-16 Thread Nick Desaulniers
> I guess it is worth reporting this to clang bugzilla. Could you take > care of that Nick? Done: https://bugs.llvm.org//show_bug.cgi?id=33065

[PATCH v4] KVM: x86: avoid large stack allocations in em_fxrstor

2017-05-29 Thread Nick Desaulniers
x86_emulate_ctxt *ctxt) ^ with CONFIG_FRAME_WARN set to 1024. This patch does the fixup in em_fxstor now, avoiding one additional struct fxregs_state, and now fxstor_fixup can be removed as it has no other call sites. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- New

Re: [PATCH v3] KVM: x86: avoid large stack allocations in em_fxrstor

2017-05-29 Thread Nick Desaulniers
On Mon, May 29, 2017 at 01:39:08PM -0700, Nick Desaulniers wrote: > + if (ctxt->mode < X86EMUL_MODE_PROT64) { > + rc = asm_safe("fxsave %[fx]", , [fx] "+m"(fx_state)); > + if (rc != X86EMUL_CONTINUE

[PATCH v4] Input: mousedev - fix implicit conversion warning

2017-05-29 Thread Nick Desaulniers
reused logic into a helper function. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- What's new in v4: * replace mousedev_limit_delta() with update_clamped() that also updates the ps2_data and delta values. The use of the temporary val should avoid integral conversion and pro

[PATCH v5] KVM: x86: avoid large stack allocations in em_fxrstor

2017-05-30 Thread Nick Desaulniers
em_fxstor and em_fxsave. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- New in V5: * Updated commit message. * moved offset calculation from em_fxstor and em_fxsave into new helper, xmm_offset. * Always call put_fpu after a get_fpu. * remove temporary size from em_fxsave.

Re: [PATCH v5] KVM: x86: avoid large stack allocations in em_fxrstor

2017-06-01 Thread Nick Desaulniers
On Thu, Jun 01, 2017 at 09:36:18AM +0200, Paolo Bonzini wrote: > On 01/06/2017 03:05, Nick Desaulniers wrote: > > On Wed, May 31, 2017 at 07:01:29AM -0400, Paolo Bonzini wrote: > >>> + size = offsetof(struct fxregs_state, xmm_space[16]); > >> This still

[PATCH v6] KVM: x86: avoid large stack allocations in em_fxrstor

2017-06-01 Thread Nick Desaulniers
em_fxstor and em_fxsave. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- New in V6: * use correct adjustment for offset. New in V5: * Updated commit message. * moved offset calculation from em_fxstor and em_fxsave into new helper, xmm_offset. * Always call put_fpu after a g

Re: [PATCH v5] KVM: x86: avoid large stack allocations in em_fxrstor

2017-05-31 Thread Nick Desaulniers
On Wed, May 31, 2017 at 07:01:29AM -0400, Paolo Bonzini wrote: > > + size = offsetof(struct fxregs_state, xmm_space[16]); > This still has the same issue (it should be multiplied by 4). I'm still misunderstanding the math here. Why multiplied by four, in this case? 8 * 16 / 4 is used

Re: [PATCH v6] KVM: x86: avoid large stack allocations in em_fxrstor

2017-06-09 Thread Nick Desaulniers
ping for review

[PATCH] x86/build: don't add -maccumulate-outgoing-args w/o compiler support

2017-05-04 Thread Nick Desaulniers
Otherwise other compilers, like Clang, are prevented from compiling the kernel. This flag was introduced in 3f135e57a4f76d24ae8d8a490314331f0ced40c5. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- arch/x86/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[Patch v3] x86/build: don't add -maccumulate-outgoing-args w/o compiler support

2017-05-05 Thread Nick Desaulniers
Clang does not support this machine dependent option. Older versions of GCC (pre 3.0) may not support this option, added in 2000, but it's unlikely they can still compile the kernel. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- arch/x86/Makefile | 2 +- 1 file chan

[Patch v2] x86/build: require only gcc use -maccumulate-outgoing-args

2017-05-04 Thread Nick Desaulniers
Other compilers, like clang, treat unknown compiler flags as errors. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- arch/x86/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 4430dd489620..12757a

Re: [PATCH v4] Input: mousedev - fix implicit conversion warning

2017-06-06 Thread Nick Desaulniers
ping for re-review

[PATCH v2] KVM: x86: remove ignored type attribute

2017-06-27 Thread Nick Desaulniers
The macro insn_fetch marks the 'type' argument as having a specified alignment. Type attributes can only be applied to structs, unions, or enums, but insn_fetch is only ever invoked with integral types, so Clang produces 19 -Wignored-attributes warnings for this source file. Signed-off-by: Nick

Re: [PATCH v2] KVM: x86: remove ignored type attribute

2017-06-27 Thread Nick Desaulniers
gah, forgot to amend the trailing tab change in. Do you mind just fixing it up when you merge or shall I send v3?

Re: [PATCH] KVM: VMX: check match table

2017-10-03 Thread Nick Desaulniers
On Tue, Oct 03, 2017 at 11:42:18AM +0200, Paolo Bonzini wrote: > On 01/10/2017 01:22, Nick Desaulniers wrote: > > I don't follow (but I also don't know what any of these three letter > > acryonyms acronyms stand for), does svm depend on vmx or vice-versa? > Neither, one is Inte

Re: [PATCH] KVM: VMX: check match table

2017-10-03 Thread Nick Desaulniers
- avi I think an extra `did not` made it in to that last email...sorry! On Tue, Oct 3, 2017 at 7:54 PM, Nick Desaulniers <nick.desaulni...@gmail.com> wrote: > On Tue, Oct 03, 2017 at 11:42:18AM +0200, Paolo Bonzini wrote: >> On 01/10/2017 01:22, Nick Desaulniers wrote: >> &g

[PATCH] cgroup: reorder flexible array members of struct cgroup_root

2017-10-17 Thread Nick Desaulniers
cgroup, struct cgroup's member ancestor_ids is a flexible member. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- Alternatively, we could: * Not use flexible array members. The flexible array members and allocation strategy, added in commit b11cfb5807e30 mentions the hot pa

Re: [PATCH] cgroup: reorder flexible array members of struct cgroup_root

2017-10-17 Thread Nick Desaulniers
On Mon, Oct 16, 2017 at 11:40 PM, Nick Desaulniers <nick.desaulni...@gmail.com> wrote: > On Mon, Oct 16, 2017 at 11:33:21PM -0700, Nick Desaulniers wrote: >> When compiling arch/x86/boot/compressed/eboot.c with HOSTCC=clang, the > > Actually, not sure this is because HOSTCC w

Re: [PATCH] cgroup: reorder flexible array members of struct cgroup_root

2017-10-17 Thread Nick Desaulniers
On Mon, Oct 16, 2017 at 11:33:21PM -0700, Nick Desaulniers wrote: > When compiling arch/x86/boot/compressed/eboot.c with HOSTCC=clang, the Actually, not sure this is because HOSTCC was specifically clang, I think that could be reworded to `When compiling ... with Clang, the ...`.

unneeded internal declaration

2017-09-25 Thread Nick Desaulniers
today I noticed I was getting the warning: arch/x86/kvm/vmx.c:64:32: warning: variable 'vmx_cpu_id' is not needed and will not be emitted [-Wunneeded-internal-declaration] seems like this was added in commit: e9bda3b3d0ce7 "KVM: VMX: Auto-load on CPUs with VMX" seems like other call sites of

Re: unneeded internal declaration

2017-09-25 Thread Nick Desaulniers
<j...@joshtriplett.org> wrote: > On Mon, Sep 25, 2017 at 08:07:41PM -0700, Nick Desaulniers wrote: >> today I noticed I was getting the warning: >> >> arch/x86/kvm/vmx.c:64:32: warning: variable 'vmx_cpu_id' is not needed >> and will not be emitted [-Wunneeded-inter

Re: [PATCH] kbuild: clang: remove crufty HOSTCFLAGS

2017-09-30 Thread Nick Desaulniers
On Thu, Sep 28, 2017 at 07:52:35PM +0900, Masahiro Yamada wrote: > 2017-09-26 11:28 GMT+09:00 Nick Desaulniers <nick.desaulni...@gmail.com>: > > HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ > > + $(call hostcc-option,-fno-delet

Re: [PATCH] KVM: VMX: check match table

2017-09-30 Thread Nick Desaulniers
On Wed, Sep 27, 2017 at 02:36:03PM +0200, Paolo Bonzini wrote: > On 26/09/2017 19:12, Josh Triplett wrote: > > Does this make any other checks redundant and removable? > > It would make sense to place it in cpu_has_kvm_support instead cpu_has_kvm_support() or cpu_has_vmx()? >, and the same in

Re: [PATCH] tpm: fix duplicate inline declaration specifier

2017-09-29 Thread Nick Desaulniers
Thanks! This fixes a warning I was seeing with Clang: drivers/char/tpm/tpm.h:560:15: warning: duplicate 'inline' declaration specifier [-Wduplicate-decl-specifier] On Fri, Sep 29, 2017 at 10:17 AM, Jarkko Sakkinen wrote: > On Tue, Sep 26, 2017 at 01:58:57PM

[PATCH] kbuild: clang: remove crufty HOSTCFLAGS

2017-09-25 Thread Nick Desaulniers
dd -Werror to HOSTCFLAGS and compile with clang just fine. Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- * It may also be worthwhile keep the old flags, and simply wrap everything in hostcc-option. Makefile | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --

Re: [PATCH] drm/i915: Mark wait_for_engine() as maybe_unused

2017-09-25 Thread Nick Desaulniers
Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com>

[PATCH] KVM: VMX: check match table

2017-09-25 Thread Nick Desaulniers
argument to MODULE_DEVICE_TABLE() is x86cpu. The documentation for x86_match_cpu() seems to agree. Suggested-by: Josh Triplett <j...@joshtriplett.org> Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- arch/x86/kernel/cpu/match.c | 2 +- arch/x86/kvm/vmx.c | 7

Re: [PATCH v2] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-08-24 Thread Nick Desaulniers
bumping for review (resending, had gmail set to html mode) On Mon, Aug 14, 2017 at 10:36 AM, Nick Desaulniers <ndesaulni...@google.com> wrote: > Minor nit for the commit message that can get fixed up when being merged: > > On Fri, Aug 11, 2017 at 11:16 AM, Nick Desaulnie

Re: module: Remove const attribute from alias for MODULE_DEVICE_TABLE

2017-08-28 Thread Nick Desaulniers
fdef MODULE >>> /* Creates an alias so file2alias.c can find device table. */ >>> #define MODULE_DEVICE_TABLE(type, name) >>> \ >>> -extern const typeof(name) __mod_##type##__##name##_device_table >>> \ >>> +extern typeof(name) __mod_##type##__##name##_device_table\ >>>__attribute__ ((unused, alias(__stringify(name >>> #else /* !MODULE */ >>> #define MODULE_DEVICE_TABLE(type, name) > > Perhaps the reverse is the better solution? Leave "const" in > MODULE_DEVICE_TABLE and remove the redundant usage. This means new > cases of missing the const will never happen (which was the intent > originally of putting const into the MODULE_DEVICE_TABLE macro, I > assume). > > -Kees > > -- > Kees Cook > Pixel Security -- Thanks, ~Nick Desaulniers

[PATCH v2] kbuild: clang: remove crufty HOSTCFLAGS

2017-10-07 Thread Nick Desaulniers
;yamada.masah...@socionext.com> Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- Makefile | 5 - 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index cf007a31d575..5853d9492590 100644 --- a/Makefile +++ b/Makefile @@ -306,11 +306,6 @@ HOSTCXXFLAGS :=

Re: [PATCH v2] kbuild: clang: remove crufty HOSTCFLAGS

2017-10-07 Thread Nick Desaulniers
Sorry, I forgot to note the changes in v2: * Dont add back -fno-delete-null-pointer-checks wrapped in hostcc-option, just remove all flags. * Update wording of commit message.

[PATCH v3] kbuild: Set KBUILD_CFLAGS before incl. arch Makefile

2017-11-15 Thread Nick Desaulniers
ecture. Reviewed-by: Matthias Kaehlcke <m...@chromium.org> Signed-off-by: Chris Fries <cfr...@google.com> Signed-off-by: Nick Desaulniers <ndesaulni...@google.com> Suggested-by: Masahiro Yamada <yamada.masah...@socionext.com> Tested-by: Matthias Kaehlcke <m...@chromium.

Re: [PATCH] arm64: fix missing 'const' qualifiers

2017-11-27 Thread Nick Desaulniers
s one line that's over 80 chars, and that there's M$ DOS style line endings (but that may just be my client gmail, or yours (exchange?)). If you fix up that long line, then: Reviewed-by: Nick Desaulniers <ndesaulni...@google.com>

Re: [PATCH v3] kbuild: Set KBUILD_CFLAGS before incl. arch Makefile

2017-11-28 Thread Nick Desaulniers
Hi Masahiro, Thanks for merging Chris' patch, and sorry for taking so long to respond. On Wed, Nov 22, 2017 at 8:24 PM, Masahiro Yamada wrote: > Linus suggests to move compiler flag testing to Kconfig. Do you have an LKML link for context? On Wed, Nov 15, 2017

[PATCH v2] drm/i915: Avoid enum conversion warning

2017-11-26 Thread Nick Desaulniers
; ~~ ^~~~ Suggested-by: Daniel Vetter <dan...@ffwll.ch> Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- drivers/gpu/drm/i915/intel_ddi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915

[PATCH] drm/i915: Avoid enum conversion warning

2017-11-22 Thread Nick Desaulniers
; ~~ ^~~~ Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com> --- drivers/gpu/drm/i915/intel_ddi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 933c18fd4258..f9de45316901

enum conversion warnings

2017-11-22 Thread Nick Desaulniers
pulling down tot, I'm seeing: CC [M] drivers/gpu/drm/i915/intel_ddi.o drivers/gpu/drm/i915/intel_ddi.c:1481:30: error: implicit conversion from enumeration type 'enum port' to different enumeration type 'enum intel_dpll_id' [-Werror,-Wenum-conversion] enum intel_dpll_id pll_id = port;

constant conversion warning in umip

2017-11-22 Thread Nick Desaulniers
Pulling down ToT, I'm seeing the following warning when building with clang: CC arch/x86/lib/insn.o arch/x86/lib/insn-eval.c:780:10: error: implicit conversion from 'int' to 'char' changes value from 132 to -124 [-Werror,-Wconstant-conversion] return INSN_CODE_SEG_PARAMS(4,

Re: [PATCH 1/3] kbuild: add clang-version.sh

2017-11-29 Thread Nick Desaulniers
if $with_patchlevel using "x" is odd, but this is what scripts/gcc-version.sh does and this patch does work as expected. Tested-by: Nick Desaulniers <ndesaulni...@google.com>

Re: [PATCH 2/3] kbuild: add cc-if-name-version and compiler-specific variants

2017-11-29 Thread Nick Desaulniers
We could use something like this to warn people trying to build the kernel with clang-3.8 for instance.

Re: [PATCH 3/3] arm64: use -mno-implicit-float instead of -mgeneral-regs-only

2017-11-29 Thread Nick Desaulniers
On Wed, Nov 29, 2017 at 8:22 AM, Sami Tolvanen wrote: > On Wed, Nov 29, 2017 at 12:15:14PM +, Ard Biesheuvel wrote: >> Do we still need these patches now that the AES code has been fixed? > > With your AES patch that Herbert just applied, this patch is no longer >

Re: [PATCH 5/7] arm64: keep .altinstructions and .altinstr_replacement

2017-11-30 Thread Nick Desaulniers
On Wed, Nov 29, 2017 at 5:58 PM, Nicholas Piggin wrote: > (Comparing `readelf -S` before/after is a way to spot bugs.) Do you have a script that can be used to diff 2 `readelf -S`, look for missing references, and report an error? Might be easier to rerun that every so often

Re: [PATCH 1/7] kbuild: add ld-name macro and support for GNU gold

2017-11-29 Thread Nick Desaulniers
On Wed, Nov 29, 2017 at 3:44 PM, Sami Tolvanen wrote: > GNU gold may require different flags than GNU ld. Add a macro for > detecting the linker and conditionally add gold specific flags from > LDFLAGS_GOLD. Right, but you're still only ever using one linker per build,

Re: [PATCH 5/7] arm64: keep .altinstructions and .altinstr_replacement

2017-11-29 Thread Nick Desaulniers
On Wed, Nov 29, 2017 at 3:44 PM, Sami Tolvanen wrote: > Make sure the linker doesn't remove .altinstructions or > .altinstr_replacement when CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is > enabled. This sounds like a bug in the original implementation of

Re: [PATCH 6/7] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold

2017-11-29 Thread Nick Desaulniers
On Wed, Nov 29, 2017 at 3:44 PM, Sami Tolvanen wrote: > @@ -26,10 +26,19 @@ ifeq ($(CONFIG_ARM64_ERRATUM_843419),y) >ifeq ($(call ld-option, --fix-cortex-a53-843419),) > $(warning ld does not support --fix-cortex-a53-843419; kernel may be > susceptible to erratum) >

Re: [PATCH v2 6/7] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold

2017-11-30 Thread Nick Desaulniers
Reviewed-by: Nick Desaulniers <ndesaulni...@google.com>

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-12-04 Thread Nick Desaulniers
On Thu, Nov 16, 2017 at 2:54 PM, Alex Matveev wrote: > On Fri, 17 Nov 2017 00:29:20 +0300 > Yury Norov wrote: > >> On Thu, Nov 16, 2017 at 01:55:31PM +, Robin Murphy wrote: >> > Given that this whole mrs_s infrastructure is a workaround for older

[PATCH] [media] dvb-frontends: remove self assignments

2017-12-18 Thread Nick Desaulniers
at Clang warns about. These instances aren't errors. Signed-off-by: Nick Desaulniers <ndesaulni...@google.com> --- drivers/media/dvb-frontends/drxd_hard.c| 3 --- drivers/media/dvb-frontends/tda18271c2dd.c | 1 - 2 files changed, 4 deletions(-) diff --git a/drivers/media/dvb-frontends/drxd_h

[PATCH] [media] dvb-frontends: remove extraneous parens

2017-12-18 Thread Nick Desaulniers
Fixes 2 warnings from Clang about extra parentheses in a conditional, that might have been meant as assignment. Signed-off-by: Nick Desaulniers <ndesaulni...@google.com> --- drivers/media/dvb-frontends/drx39xyj/drxj.c | 2 +- drivers/media/dvb-frontends/drxk_hard.c | 2 +- 2 files chan

Re: [PATCH v2 18/18] arm64: select ARCH_SUPPORTS_LTO_CLANG

2017-11-16 Thread Nick Desaulniers
On Thu, Nov 16, 2017 at 8:59 AM, Peter Zijlstra <pet...@infradead.org> wrote: > On Thu, Nov 16, 2017 at 08:50:41AM -0800, Nick Desaulniers wrote: >> On Thu, Nov 16, 2017 at 8:30 AM, Peter Zijlstra <pet...@infradead.org> wrote: >> >> > Ideally we'd get the tool

  1   2   3   4   5   6   7   8   9   10   >