qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm <qemu-arm@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Stephen Long <steplong@quicinc.com>
Subject: Re: [PATCH v2 10/17] linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG
Date: Thu, 17 Dec 2020 11:24:01 -0600	[thread overview]
Message-ID: <817d21f6-6494-e7c7-5eca-037b04b64f9f@linaro.org> (raw)
In-Reply-To: <CAFEAcA8fAB_DDrBjjVCCKwiE_n=05q1KYyWMR_2EuhOa0+EKww@mail.gmail.com>

On 6/25/20 11:50 AM, Peter Maydell wrote:
> On Fri, 5 Jun 2020 at 05:17, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> These prctl fields are required for the function of MTE.
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> 
> This API doesn't seem to be in the upstream kernel yet, right?

It has finally landed in 5.10.
Thus the long delay since my last revision.

>> +                    /*
>> +                     * Write PR_MTE_TCF to SCTLR_EL1[TCF0].
>> +                     * Note that the syscall values are consistent with hw.
>> +                     */
>> +                    env->cp15.sctlr_el[1] =
>> +                        deposit64(env->cp15.sctlr_el[1], 38, 2,
>> +                                  arg2 >> TARGET_PR_MTE_TCF_SHIFT);
> 
> This actually will be per-thread since each linux-user thread has
> its own CPU. You probably need to do something to make it be
> inherited across clone and fork, though (assuming those are
> the required semantics).

FWIW, these are a per-thread quantities.

>From arch/arm64/kernel/mte.c:
> void mte_thread_switch(struct task_struct *next)
> {
>         if (!system_supports_mte())
>                 return;
> 
>         /* avoid expensive SCTLR_EL1 accesses if no change */
>         if (current->thread.sctlr_tcf0 != next->thread.sctlr_tcf0)
>                 update_sctlr_el1_tcf0(next->thread.sctlr_tcf0);
>         update_gcr_el1_excl(next->thread.gcr_user_incl);
> }

I don't think I have to do anything special wrt fork/clone, as env->cp15 will
get copied by our own cpu_copy().


r~


  reply	other threads:[~2020-12-17 17:39 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05  4:17 [PATCH v2 00/17] target-arm: Implement ARMv8.5-MemTag, user mode Richard Henderson
2020-06-05  4:17 ` [PATCH v2 01/17] tcg: Introduce target-specific page data for user-only Richard Henderson
2020-06-25 16:20   ` Peter Maydell
2020-07-11 21:42     ` Richard Henderson
2020-07-13  1:44     ` Richard Henderson
2020-06-05  4:17 ` [PATCH v2 02/17] linux-user: Introduce PAGE_ANON Richard Henderson
2020-06-25 16:23   ` Peter Maydell
2020-06-05  4:17 ` [PATCH v2 03/17] linux-user: Check for overflow in access_ok Richard Henderson
2020-06-25 16:25   ` Peter Maydell
2020-06-05  4:17 ` [PATCH v2 04/17] linux-user: Tidy VERIFY_READ/VERIFY_WRITE Richard Henderson
2020-06-25 16:29   ` Peter Maydell
2020-06-05  4:17 ` [PATCH v2 05/17] bsd-user: " Richard Henderson
2020-06-25 16:30   ` Peter Maydell
2020-06-05  4:17 ` [PATCH v2 06/17] linux-user: Do not use guest_addr_valid for h2g_valid Richard Henderson
2020-06-25 16:34   ` Peter Maydell
2020-07-11 19:30     ` Richard Henderson
2020-07-11 19:37       ` Richard Henderson
2020-06-05  4:17 ` [PATCH v2 07/17] linux-user: Fix guest_addr_valid vs reserved_va Richard Henderson
2020-06-25 16:37   ` Peter Maydell
2020-07-11 19:26     ` Richard Henderson
2020-06-05  4:17 ` [PATCH v2 08/17] exec: Add support for TARGET_TAGGED_ADDRESSES Richard Henderson
2020-06-25 16:43   ` Peter Maydell
2020-06-05  4:17 ` [PATCH v2 09/17] linux-user/aarch64: Implement PR_TAGGED_ADDR_ENABLE Richard Henderson
2020-06-25 16:46   ` Peter Maydell
2020-06-05  4:17 ` [PATCH v2 10/17] linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG Richard Henderson
2020-06-25 16:50   ` Peter Maydell
2020-12-17 17:24     ` Richard Henderson [this message]
2020-06-05  4:17 ` [PATCH v2 11/17] linux-user/aarch64: Implement PROT_MTE Richard Henderson
2020-06-25 16:53   ` Peter Maydell
2020-06-05  4:17 ` [PATCH v2 12/17] linux-user/aarch64: Pass syndrome to EXC_*_ABORT Richard Henderson
2020-06-25 17:00   ` Peter Maydell
2020-06-05  4:17 ` [PATCH v2 13/17] linux-user/aarch64: Signal SEGV_MTESERR for sync tag check fault Richard Henderson
2020-06-05  4:17 ` [PATCH v2 14/17] linux-user/aarch64: Signal SEGV_MTEAERR for async tag check error Richard Henderson
2020-06-05  4:17 ` [PATCH v2 15/17] target/arm: Add allocation tag storage for user mode Richard Henderson
2020-06-05  4:17 ` [PATCH v2 16/17] target/arm: Enable MTE for user-only Richard Henderson
2020-06-05  4:17 ` [PATCH v2 17/17] tests/tcg/aarch64: Add mte smoke tests Richard Henderson
2020-06-25 17:13 ` [PATCH v2 00/17] target-arm: Implement ARMv8.5-MemTag, user mode Peter Maydell

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=817d21f6-6494-e7c7-5eca-037b04b64f9f@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=steplong@quicinc.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 NNTP newsgroup(s).