From: Nicholas Piggin <npiggin@gmail.com>
To: Christophe Leroy <christophe.leroy@c-s.fr>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v3] powerpc/64: system call implement the bulk of the logic in C
Date: Fri, 06 Sep 2019 08:29:22 +1000 [thread overview]
Message-ID: <1567722266.e46t8f2fyp.astroid@bobo.none> (raw)
In-Reply-To: <5407d893-5d04-5363-906b-32607479c925@c-s.fr>
Christophe Leroy's on September 6, 2019 2:29 am:
>
>
> Le 05/09/2019 à 14:35, Nicholas Piggin a écrit :
>> -.Lsyscall_error_cont:
>> - ld r7,_NIP(r1)
>> BEGIN_FTR_SECTION
>> stdcx. r0,0,r1 /* to clear the reservation */
>> END_FTR_SECTION_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
>> - andi. r6,r8,MSR_PR
>> - ld r4,_LINK(r1)
>>
>> - kuap_check_amr r10, r11
>> + mtspr SPRN_SRR0,r4
>> + mtspr SPRN_SRR1,r5
>
> That looks dangerous. Once you have modified SRR0 and SRR1, your
> exception becomes unrecoverable, so this should be done as close as
> possible to the rfi.
Worse than that even, when we set MSR[RI]=0 the exception becomes
unrecoverable, and that happens in the C code!
> Here you seem to do many thinks inbetween,
> including restoring some registers from the stack.
The code it replaces has a pretty large non-recoverable window as
well, interrupt entry has large ones particularly for KVM. It's an
unfortunate quirk of the architecture but it's not worth getting
too worried about or sacrificing too much performance for.
I do have some later patches which improves this a lot, but that will
wait until after the interrupt return is also changed to C.
Thanks,
Nick
prev parent reply other threads:[~2019-09-05 22:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 12:35 [PATCH v3] powerpc/64: system call implement the bulk of the logic in C Nicholas Piggin
2019-09-05 15:25 ` Christophe Leroy
2019-09-05 17:46 ` Michal Suchánek
2019-09-05 18:18 ` Christophe Leroy
2019-09-05 16:29 ` Christophe Leroy
2019-09-05 22:29 ` Nicholas Piggin [this message]
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=1567722266.e46t8f2fyp.astroid@bobo.none \
--to=npiggin@gmail.com \
--cc=christophe.leroy@c-s.fr \
--cc=linuxppc-dev@lists.ozlabs.org \
/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