lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 12 Aug 2019 23:32:35 +0900
From:   Akira Yokosawa <akiyks@...il.com>
To:     "Paul E. McKenney" <paulmck@...ux.ibm.com>
Cc:     linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
        Ingo Molnar <mingo@...nel.org>,
        Alan Stern <stern@...land.harvard.edu>,
        Andrea Parri <parri.andrea@...il.com>,
        Will Deacon <will@...nel.org>,
        Boqun Feng <boqun.feng@...il.com>,
        Nicholas Piggin <npiggin@...il.com>,
        David Howells <dhowells@...hat.com>,
        Jade Alglave <j.alglave@....ac.uk>,
        Luc Maranget <luc.maranget@...ia.fr>,
        Peter Zijlstra <peterz@...radead.org>,
        Daniel Lustig <dlustig@...dia.com>,
        Akira Yokosawa <akiyks@...il.com>
Subject: Re: [PATCH RFC memory-model 27/31] tools/memory-model: Add data-race
 capabilities to judgelitmus.sh

Hi Paul,
(CC: using Andrea's gmail address, adding Daniel)

Sorry for slow response, but please find inline comments below.

On Thu, 1 Aug 2019 15:20:52 -0700, Paul E. McKenney wrote:
> This commit adds functionality to judgelitmus.sh to allow it to handle
> both the "DATARACE" markers in the "Result:" comments in litmus tests
> and the "Flag data-race" markers in LKMM output.  For C-language tests,
> if either marker is present, the other must also be as well, at least for
> litmus tests having a "Result:" comment.  If the LKMM output indicates
> a data race, then failures of the Always/Sometimes/Never portion of the
> "Result:" prediction are forgiven.

I'd like to see the reason _why_ they can be forgiven. Also, updating
the header comment of judgelitimus.sh to mention these expansions would
be of much help.

My guess is any data-race would moot the Always/Sometimes/Never
prediction.

This reminds me that update of LKMM documentation regarding plain
accesses (data races) is yet to come.

        Thanks, Akira

> 
> Signed-off-by: Paul E. McKenney <paulmck@...ux.ibm.com>
> ---
>  tools/memory-model/scripts/judgelitmus.sh | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/memory-model/scripts/judgelitmus.sh b/tools/memory-model/scripts/judgelitmus.sh
> index ca9a19829d79..eaa2cc7d3b36 100755
> --- a/tools/memory-model/scripts/judgelitmus.sh
> +++ b/tools/memory-model/scripts/judgelitmus.sh
> @@ -47,9 +47,27 @@ else
>  	echo ' --- ' error: \"$LKMM_DESTDIR/$litmusout is not a readable file
>  	exit 255
>  fi
> +if grep -q '^Flag data-race$' "$LKMM_DESTDIR/$litmusout"
> +then
> +	datarace_modeled=1
> +fi
>  if grep -q '^ \* Result: ' $litmus
>  then
>  	outcome=`grep -m 1 '^ \* Result: ' $litmus | awk '{ print $3 }'`
> +	if grep -m1 '^ \* Result: .* DATARACE' $litmus
> +	then
> +		datarace_predicted=1
> +	fi
> +	if test -n "$datarace_predicted" -a -z "$datarace_modeled" -a -z "$LKMM_HW_MAP_FILE"
> +	then
> +		echo '!!! Predicted data race not modeled' $litmus
> +		exit 252
> +	elif test -z "$datarace_predicted" -a -n "$datarace_modeled"
> +	then
> +		# Note that hardware models currently don't model data races
> +		echo '!!! Unexpected data race modeled' $litmus
> +		exit 253
> +	fi
>  elif test -n "$LKMM_HW_MAP_FILE" && grep -q '^Observation' $LKMM_DESTDIR/$lkmmout > /dev/null 2>&1
>  then
>  	outcome=`grep -m 1 '^Observation ' $LKMM_DESTDIR/$lkmmout | awk '{ print $3 }'`
> @@ -114,7 +132,7 @@ elif grep '^Observation' $LKMM_DESTDIR/$litmusout | grep -q $outcome || test "$o
>  then
>  	ret=0
>  else
> -	if test -n "$LKMM_HW_MAP_FILE" -a "$outcome" = Sometimes
> +	if test \( -n "$LKMM_HW_MAP_FILE" -a "$outcome" = Sometimes \) -o -n "$datarace_modeled"
>  	then
>  		flag="--- Forgiven"
>  		ret=0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ