smatch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Elena Reshetova <elena.reshetova@intel.com>
Cc: smatch@vger.kernel.org
Subject: Re: [PATCH] Quick trial on tracing host inputs
Date: Tue, 8 Mar 2022 15:38:32 +0300	[thread overview]
Message-ID: <20220308123832.GJ3315@kadam> (raw)
In-Reply-To: <20220308113416.GG3315@kadam>

On Tue, Mar 08, 2022 at 02:34:16PM +0300, Dan Carpenter wrote:
> void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx,
>            unsigned int *ecx, unsigned int *edx);
> 
> unsigned int a, b, c, d e;
> unsigned int test(void)
> {
> 	cpuid(0, &a, &b, &c, &d);
> 	__smatch_states("host");
> 	return a;
> }
> 
> unsigned int test2(void)
> {
> 	unsigned int x = test();
> 	__smatch_states("host");
> }

I had to hack it a bit to get it to compile but my test seems to work.
"x" is correctl marked as host data correctly in test2().

regards,
dan carpenter

      parent reply	other threads:[~2022-03-08 12:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08  8:56 [PATCH] Quick trial on tracing host inputs Elena Reshetova
2022-03-08 11:34 ` Dan Carpenter
2022-03-08 11:37   ` Dan Carpenter
2022-03-08 12:38   ` Dan Carpenter [this message]

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=20220308123832.GJ3315@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=elena.reshetova@intel.com \
    --cc=smatch@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).