public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jaswinder Singh Rajput <jaswinder@kernel.org>
To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
	markus.t.metzger@intel.com, tglx@linutronix.de, mingo@elte.hu
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:tracing/hw-branch-tracing] x86, bts: detect size of DS fields
Date: Sat, 11 Apr 2009 11:45:43 +0530	[thread overview]
Message-ID: <1239430543.4418.21.camel@localhost.localdomain> (raw)
In-Reply-To: <tip-bc44fb5f7d3e764ed7698c835a1a0f35aba2eb3d@git.kernel.org>

Hello Markus,

Here are few sparse warnings due to this patch.
If possible, please run sparse before sending the patch.

On Fri, 2009-03-13 at 11:00 +0000, Markus Metzger wrote:
> Commit-ID:  bc44fb5f7d3e764ed7698c835a1a0f35aba2eb3d
> Gitweb:     http://git.kernel.org/tip/bc44fb5f7d3e764ed7698c835a1a0f35aba2eb3d
> Author:     Markus Metzger <markus.t.metzger@intel.com>
> AuthorDate: Fri, 13 Mar 2009 10:42:18 +0100
> Commit:     Ingo Molnar <mingo@elte.hu>
> CommitDate: Fri, 13 Mar 2009 11:57:19 +0100
> 
> x86, bts: detect size of DS fields
> 
> Impact: more robust DS feature enumeration
> 
> Detect the size of the pointer-type fields in the DS area
> configuration via the DTES64 features rather than based on
> the cpuid.
> 
> Rename a variable to denote that size to reflect that it only
> covers the pointer-type fields.
> 
> Add more boot-time diagnostics giving the detected size and
> the sizes of BTS and PEBS records.
> 
> Use the size of the BTS/PEBS record to indicate that the
> respective feature is not available (if the record size is zero).
> 
> Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
> LKML-Reference: <20090313104218.A30096@sedona.ch.intel.com>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> 
> 
> ---
>  arch/x86/kernel/ds.c |   84 ++++++++++++++++++++++++++------------------------
>  1 files changed, 44 insertions(+), 40 deletions(-)
> 
> diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c
> index 87b67e3..6e5ec67 100644
> --- a/arch/x86/kernel/ds.c
> +++ b/arch/x86/kernel/ds.c
> @@ -441,13 +441,13 @@ enum bts_field {
>  
>  static inline unsigned long bts_get(const char *base, enum bts_field field)
>  {
> -	base += (ds_cfg.sizeof_field * field);
> +	base += (ds_cfg.sizeof_ptr_field * field);

arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:514:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:514:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:514:7: error: invalid assignment
arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:514:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:514:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:514:7: error: invalid assignment
arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:514:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:514:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:514:7: error: invalid assignment
arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:514:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:514:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:514:7: error: invalid assignment
arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:514:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:514:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:514:7: error: invalid assignment
arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:514:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:514:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:514:7: error: invalid assignment

>  	return *(unsigned long *)base;
>  }
>  
>  static inline void bts_set(char *base, enum bts_field field, unsigned long val)
>  {
> -	base += (ds_cfg.sizeof_field * field);;
> +	base += (ds_cfg.sizeof_ptr_field * field);;

arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:520:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:520:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:520:7: error: invalid assignment
arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:520:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:520:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:520:7: error: invalid assignment
arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:520:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:520:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:520:7: error: invalid assignment
arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:520:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:520:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:520:7: error: invalid assignment
arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:520:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:520:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:520:7: error: invalid assignment
arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:520:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:520:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:520:7: error: invalid assignment
arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:520:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:520:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:520:7: error: invalid assignment
arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:520:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:520:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:520:7: error: invalid assignment
arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
arch/x86/kernel/ds.c:520:35:    left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_field
arch/x86/kernel/ds.c:520:35:    right side has type bad type enum bts_field field
arch/x86/kernel/ds.c:520:7: error: invalid assignment

This warning is due to some old patch:

c2724775 (Markus Metzger  2008-12-11 13:49:59 +0100  548)       memset(out, 0, sizeof(*out));
c2724775 (Markus Metzger  2008-12-11 13:49:59 +0100  549)       if ((bts_get(at, bts_qual) & ~bts_qual_mask) == bts_escape) {

arch/x86/kernel/ds.c:549:19: warning: incorrect type in argument 2 (invalid types)
arch/x86/kernel/ds.c:549:19:    expected bad type enum bts_field field
arch/x86/kernel/ds.c:549:19:    got int

Thanks,
--
JSR


  reply	other threads:[~2009-04-11  6:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-13  9:42 [patch 1/5] x86, bts: detect size of DS fields Markus Metzger
2009-03-13 11:00 ` [tip:tracing/hw-branch-tracing] " Markus Metzger
2009-04-11  6:15   ` Jaswinder Singh Rajput [this message]
2009-03-13 11:01 ` [tip:tracing/hw-branch-tracing] x86, bts: cleanups Ingo Molnar
2009-03-13 11:03 ` [patch 1/5] x86, bts: detect size of DS fields Ingo Molnar
2009-03-13 11:09   ` Ingo Molnar
2009-03-16 14:34   ` Metzger, Markus T
2009-03-17 10:55     ` Ingo Molnar
2009-03-17 12:26       ` Metzger, Markus T
2009-03-17 12:34         ` Ingo Molnar
2009-03-17 12:57           ` Metzger, Markus T
2009-03-17 14:51             ` Metzger, Markus T
2009-03-17 15:15               ` Ingo Molnar
2009-03-18 18:08             ` Metzger, Markus T
2009-03-13 11:06 ` [tip:tracing/hw-branch-tracing] x86, bts: detect size of DS fields, fix Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1239430543.4418.21.camel@localhost.localdomain \
    --to=jaswinder@kernel.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=markus.t.metzger@intel.com \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox