This is an archive of the discontinued LLVM Phabricator instance.

[dfsan] Support Linux loongarch64
ClosedPublic

Authored by Ami-zhang on Dec 27 2022, 3:53 AM.

Details

Summary

Make minor changes to enable DFSAN and its tests on
loongarch64. And port Linux loongarch64 memory mappings
from msan.

Diff Detail

Event Timeline

tangyouling created this revision.Dec 27 2022, 3:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 27 2022, 3:53 AM
tangyouling requested review of this revision.Dec 27 2022, 3:53 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 27 2022, 3:53 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Who will use DFSan on loongarch64?

Who will maintain DFSan on loongarch64?

Is there a loongarch64 buildbot?

Who will use DFSan on loongarch64?

Who will maintain DFSan on loongarch64?

Is there a loongarch64 buildbot?

Hi @browneee, I'm the co-author of this patch. Thanks for your comments.

Who will use DFSan on loongarch64?

Currently nobody uses it as loongarch is a pretty new arch which is expected to graduate from experimental before llvm 16 release. (But I think there may be potential users of DFSan in future.) The motivation of this change is to make loongarch64 support as more compiler-rt components as possible. We notice that DFSan is a work in progress, currently under development for x86_64 Linux. So maybe we can defer the change until DFSan development is finished and there is a use case on loongarch64?

Who will maintain DFSan on loongarch64?

Loongson (https://www.loongson.cn/EN) can maintain it.

Is there a loongarch64 buildbot?

Yes, there is one: https://lab.llvm.org/staging/#/builders/236.

We notice that DFSan is a work in progress, currently under development for x86_64 Linux. So maybe we can defer the change until DFSan development is finished and there is a use case on loongarch64?

This sounds like a reasonable option.

DFSan development is now fairly mature. We don't support other platforms due to lack of demand (all the users I'm aware of are x86_64).

As a side note: I am pleased to see that the patch required to add this support is as small as I'd expect (even if we add the pieces in D140689 not shown here atm).

MaskRay added a comment.EditedDec 28 2022, 1:18 PM

We notice that DFSan is a work in progress, currently under development for x86_64 Linux. So maybe we can defer the change until DFSan development is finished and there is a use case on loongarch64?

This sounds like a reasonable option.

DFSan development is now fairly mature. We don't support other platforms due to lack of demand (all the users I'm aware of are x86_64).

As a side note: I am pleased to see that the patch required to add this support is as small as I'd expect (even if we add the pieces in D140689 not shown here atm).

@browneee Instead of marking most tests as REQUIRES: x86_64-target-arch, it'd be better to use an opt-out model (UNSUPPORTED: ... or XFAIL: ...)? The majority of tests should be architecture-agnostic.

MaskRay requested changes to this revision.May 30 2023, 7:30 AM

This should be rebased after D140744 removed // REQUIRES: x86_64-target-arch

This revision now requires changes to proceed.May 30 2023, 7:30 AM

The patch will continue to be updated by @Ami-zhang

Ami-zhang commandeered this revision.Jun 29 2023, 8:08 PM
Ami-zhang added a reviewer: tangyouling.
Ami-zhang updated this revision to Diff 536091.Jun 29 2023, 8:10 PM
Ami-zhang retitled this revision from [compiler-rt][dfsan] Enable loongarch64 and add test support to [dfsan] Support Linux loongarch64.
Ami-zhang edited the summary of this revision. (Show Details)

rebase

Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2023, 8:10 PM
MaskRay accepted this revision.Jun 30 2023, 12:47 PM
This revision is now accepted and ready to land.Jun 30 2023, 12:47 PM
This revision was landed with ongoing or failed builds.Jul 3 2023, 1:07 AM
This revision was automatically updated to reflect the committed changes.