public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: liuhongt <hongtao.liu@intel.com>,
	gcc-patches@gcc.gnu.org, crazylht@gmail.com,  ubizjak@gmail.com,
	Florian Weimer <fweimer@redhat.com>
Subject: Re: [PATCH 0/2] Support HWASAN with Intel LAM
Date: Mon, 28 Nov 2022 18:10:37 -0800	[thread overview]
Message-ID: <CAMe9rOp4gqdjE4n=6F8bEFD1Ngz6u6EKf+=77DF2qoDm5ky8cA@mail.gmail.com> (raw)
In-Reply-To: <f0531ffd-f26f-f684-b61e-886c1cefe478@suse.cz>

On Mon, Nov 28, 2022 at 6:40 AM Martin Liška <mliska@suse.cz> wrote:
>
> On 11/11/22 02:26, liuhongt via Gcc-patches wrote:
> >    2 years ago, ARM folks support HWASAN[1] in GCC[2], and introduced several
> > target hooks(Many thanks to their work) so other backends can do similar
> > things if they have similar feature.
> >    Intel LAM(linear Address Masking)[3 Charpter 14] supports similar feature with
> > the upper bits of pointers can be used as metadata, LAM support two modes:
> >    LAM_U48:bits 48-62 can be used as metadata
> >    LAM_U57:bits 57-62 can be used as metedata.
> >
> > These 2 patches mainly support those target hooks, but HWASAN is not really
> > enabled until the final decision for the LAM kernel interface which may take
> > quite a long time. We have verified our patches with a "fake" interface locally[4], and
> > decided to push the backend patches to the GCC13 to make other HWASAN developper's work
> > easy.
>
> Hello.
>
> A few random comments I noticed:
>
> 1) please document the new target -mlam in extend.texi
> 2) the description speaks about bits [48-62] or [57-62], can explain why the patch contains:
>
> +  /* Mask off bit63 when LAM_U57.  */
> +  if (ix86_lam_type == lam_u57)
> ?
>
> 3) Shouldn't the -lman option emit GNU_PROPERTY_X86_FEATURE_1_LAM_U57 or GNU_PROPERTY_X86_FEATURE_1_LAM_U48
> .gnu.property note?

Since there are no clear usages for these LAM bits, we can
leave them out for now.

> 4) Can you please explain Florian's comment here:
> https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/13#note_1181396487
>
> Thanks,
> Martin
>
> >
> > [1] https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html
> > [2] https://gcc.gnu.org/pipermail/gcc-patches/2020-November/557857.html
> > [3] https://www.intel.com/content/dam/develop/external/us/en/documents/architecture-instruction-set-extensions-programming-reference.pdf
> > [4] https://gitlab.com/x86-gcc/gcc/-/tree/users/intel/lam/master
> >
> >
> > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
> > Ok for trunk?
> >
> > liuhongt (2):
> >    Implement hwasan target_hook.
> >    Enable hwasan for x86-64.
> >
> >   gcc/config/i386/i386-expand.cc  |  12 ++++
> >   gcc/config/i386/i386-options.cc |   3 +
> >   gcc/config/i386/i386-opts.h     |   6 ++
> >   gcc/config/i386/i386-protos.h   |   2 +
> >   gcc/config/i386/i386.cc         | 123 ++++++++++++++++++++++++++++++++
> >   gcc/config/i386/i386.opt        |  16 +++++
> >   libsanitizer/configure.tgt      |   1 +
> >   7 files changed, 163 insertions(+)
> >
>


-- 
H.J.

  reply	other threads:[~2022-11-29  2:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11  1:26 liuhongt
2022-11-11  1:26 ` [PATCH 1/2] Implement hwasan target_hook liuhongt
2022-11-30  5:21   ` [PATCH 1/2 V2] " liuhongt
2022-11-11  1:26 ` [PATCH 2/2] Enable hwasan for x86-64 liuhongt
2022-11-28  3:35 ` [PATCH 0/2] Support HWASAN with Intel LAM Hongtao Liu
2022-11-28  7:12   ` Uros Bizjak
2022-11-28 14:40 ` Martin Liška
2022-11-29  2:10   ` H.J. Lu [this message]
2022-11-29  2:37   ` Hongtao Liu
2022-11-30 14:07     ` Martin Liška
2022-12-09  2:04       ` Hongtao Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMe9rOp4gqdjE4n=6F8bEFD1Ngz6u6EKf+=77DF2qoDm5ky8cA@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=crazylht@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=mliska@suse.cz \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).