Bug 380202

Summary: Assertion failure for cache line size (vg_assert(cls == 64)) on aarch64
Product: [Developer tools] valgrind Reporter: Siddhesh Poyarekar <siddhesh>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.13 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Remove assertion that dcache line size is 64 bytes on aarch64

Description Siddhesh Poyarekar 2017-05-25 19:35:51 UTC
Created attachment 105713 [details]
Remove assertion that dcache line size is 64 bytes on aarch64

We are seeing an assertion failure on an as yet unreleased aarch64 CPU because the dcache line size on the processor is 128 bytes.  The assertion in coregrind/m_libcproc.c that cache line size is always 64 bytes for aarch64 is not valid and should be dropped.  Attached patch does this.
Comment 1 Julian Seward 2017-05-30 13:15:27 UTC
I don't want to remove the assertion entirely.  Can you try with 
instead

  vg_assert(cls == 64 || cls == 128)

and see if that works?  With that in place, can you at least run the
instruction set tests

   perl tests/vg_regtest none/tests/arm64     and
   perl tests/vg_regtest none/tests/arm

without failing?
Comment 2 Siddhesh Poyarekar 2017-05-30 17:17:04 UTC
(In reply to Julian Seward from comment #1)
> I don't want to remove the assertion entirely.  Can you try with 
> instead
> 
>   vg_assert(cls == 64 || cls == 128)

That should work, but the trouble is that you'll have to keep patching the assert every time there is a different cache configuration.  I don't think the overhead is worth it, but it's your call in the end :)

> and see if that works?  With that in place, can you at least run the
> instruction set tests
> 
>    perl tests/vg_regtest none/tests/arm64     and
>    perl tests/vg_regtest none/tests/arm
> 
> without failing?

OK, I'll do this and get back to you.
Comment 3 Julian Seward 2017-06-06 08:40:55 UTC
(In reply to Siddhesh Poyarekar from comment #2)

Siddesh, we are trying to finalise the 3.13 release, which is very
close.  If it is easy and low risk, I would like to take this change,
so that Valgrind works on the new core you mention.  But I need
you to verify that it is OK first.  Can you do that?

Also, can you tell us what core this is for, now?
Comment 4 Siddhesh Poyarekar 2017-06-06 08:51:14 UTC
(In reply to Julian Seward from comment #3)
> Siddesh, we are trying to finalise the 3.13 release, which is very
> close.  If it is easy and low risk, I would like to take this change,
> so that Valgrind works on the new core you mention.  But I need
> you to verify that it is OK first.  Can you do that?

The fix works OK, thank you!
Comment 5 Julian Seward 2017-06-09 13:14:20 UTC
Fixed, r16438 (trunk).