Re: [PATCH] tools/memory-model: Document herd7 (internal) representation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 27, 2024 at 03:40:13PM +0200, Jonas Oberhauser wrote:
> 
> 
> Am 5/27/2024 um 3:28 PM schrieb Andrea Parri:
> > > > +    |                smp_store_mb | W[once] ->po F[mb]                        |
> > > 
> > > I expect this one to be hard-coded in herd7 source code, but I cannot find
> > > it. Can you give me a pointer?
> > 
> > smp_store_mb() is currently mapped to { __store{once}(X,V); __fence{mb}; } in
> > the .def file, so it's semantically equivalent to "WRITE_ONCE(); smp_mb();".
> 
> By the way, I experimented a little with these kind of mappings to see if we
> can just explicitly encode the mapping there. E.g., I had an idea to use
>     { __fence{mb-successful-rmw}; __cmpxchg{once}...;
> __fence{mb-successful-rmw}; }
> 
> for defining (almost) the current mapping of cmpxchg explicitly.
> 
> But none of the changes I made were accepted by herd7.
> 
> Do you know how the syntax works?
> 

This may not be trivial. Note that cmpxchg() is an expression (it has a
value), so in .def, we want to define it as an expression. However, the
C-like multiple-statement expression is not supported by herd parser, in
other words we want:

	{
		__fence{mb-successful-rmw};
		int tmp = __cmpxchg{once}(...);
		__fence{mb-successful-rmw};
		tmp;
	}

but herd parser doesn't support this as a valid expression.

Regards,
Boqun

>     jonas
> 




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux