Re: [PATCH] Quick trial on tracing host inputs

Dan Carpenter <[email protected]> Tue, 8 Mar 2022 15:38:32 +0300
Newsgroups org.kernel.vger.smatch
Message-ID <20220308123832.GJ3315@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