From: Nicholas Piggin <npiggin@gmail•com>
To: Christophe Leroy <christophe.leroy@csgroup•eu>
Cc: linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH v4 02/21] powerpc/64s: move the last of the page fault handling logic to C
Date: Sun, 03 Jan 2021 19:17:20 +1000 [thread overview]
Message-ID: <1609663625.fcccd2vjjf.astroid@bobo.none> (raw)
In-Reply-To: <20210102185630.Horde.GwG0xTTuKDzS6PsMZTUftw1@messagerie.c-s.fr>
Excerpts from Christophe Leroy's message of January 3, 2021 3:56 am:
> Nicholas Piggin <npiggin@gmail•com> a écrit :
>
>> The page fault handling still has some complex logic particularly around
>> hash table handling, in asm. Implement this in C instead.
>
> Hi,
>
> I'm afk at the moment and unable to look at this in details before one
> week but this looks pretty complexe, especially the churn around
> ___do_page_fault
> Do we really need 3 layers of do_page_fault() ?
Actually it doesn't, patch 10 wants it. I can move it to there at least
which should make this a bit less churn.
It's convenient because lots of return paths in __do_page_fault, but I
could try convert that to a `goto out` style.
> I think it would likely be more straight forward to just move
> handle_page_fault() to C.
The hash fault stuff makes things work better this way. Perhaps if I can
get to the bottom of the context tracking in the hash fault (I think we
perhaps should avoid it), then it could go back to a common code path.
> There also seems to be some unrelated changes, like the (msr & MSR_PR)
> changed to user_mode(regs).
That's part of making it callable from asm and the radix vs hash
prototypes the same so there are no added complexity in the asm:
>> @@ -1439,13 +1440,17 @@ EXC_COMMON_BEGIN(data_access_common)
>> GEN_COMMON data_access
>> ld r4,_DAR(r1)
>> ld r5,_DSISR(r1)
>> + addi r3,r1,STACK_FRAME_OVERHEAD
>> BEGIN_MMU_FTR_SECTION
>> - ld r6,_MSR(r1)
>> - li r3,0x300
>> - b do_hash_page /* Try to handle as hpte fault */
>> + bl do_hash_fault
>> MMU_FTR_SECTION_ELSE
>> - b handle_page_fault
>> + bl do_page_fault
>> ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
I'll see if anything can be done to move some such changes ahead.
Thanks,
Nick
next prev parent reply other threads:[~2021-01-03 9:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-02 12:24 [PATCH v4 00/21] powerpc: interrupt wrappers Nicholas Piggin
2021-01-02 12:24 ` [PATCH v4 01/21] powerpc/32s: Do DABR match out of handle_page_fault() Nicholas Piggin
2021-01-02 12:24 ` [PATCH v4 02/21] powerpc/64s: move the last of the page fault handling logic to C Nicholas Piggin
2021-01-02 17:56 ` Christophe Leroy
2021-01-03 9:17 ` Nicholas Piggin [this message]
2021-01-02 12:24 ` [PATCH v4 03/21] powerpc: remove arguments from fault handler functions Nicholas Piggin
2021-01-02 12:24 ` [PATCH v4 04/21] powerpc: bad_page_fault, do_break get registers from regs Nicholas Piggin
2021-01-02 12:24 ` [PATCH v4 05/21] powerpc/perf: move perf irq/nmi handling details into traps.c Nicholas Piggin
2021-01-02 12:24 ` [PATCH v4 06/21] powerpc: interrupt handler wrapper functions Nicholas Piggin
2021-01-02 12:24 ` [PATCH v4 07/21] powerpc: add interrupt wrapper entry / exit stub functions Nicholas Piggin
2021-01-02 12:24 ` [PATCH v4 08/21] powerpc: add interrupt_cond_local_irq_enable helper Nicholas Piggin
2021-01-02 12:24 ` [PATCH v4 09/21] powerpc/64: context tracking remove _TIF_NOHZ Nicholas Piggin
2021-01-02 12:24 ` [PATCH v4 10/21] powerpc/64s/hash: improve context tracking of hash faults Nicholas Piggin
2021-01-02 12:24 ` [PATCH v4 11/21] powerpc/64: context tracking move to interrupt wrappers Nicholas Piggin
2021-01-02 12:24 ` [PATCH v4 12/21] powerpc/64: add context tracking to asynchronous interrupts Nicholas Piggin
2021-01-02 12:25 ` [PATCH v4 13/21] powerpc: handle irq_enter/irq_exit in interrupt handler wrappers Nicholas Piggin
2021-01-02 12:25 ` [PATCH v4 14/21] powerpc/64s: move context tracking exit to interrupt exit path Nicholas Piggin
2021-01-02 12:25 ` [PATCH v4 15/21] powerpc/64s: reconcile interrupts in C Nicholas Piggin
2021-01-02 12:25 ` [PATCH v4 16/21] powerpc/64: move account_stolen_time into its own function Nicholas Piggin
2021-01-02 12:25 ` [PATCH v4 17/21] powerpc/64: entry cpu time accounting in C Nicholas Piggin
2021-01-02 12:25 ` [PATCH v4 18/21] powerpc: move NMI entry/exit code into wrapper Nicholas Piggin
2021-01-02 12:25 ` [PATCH v4 19/21] powerpc/64s: move NMI soft-mask handling to C Nicholas Piggin
2021-01-02 12:25 ` [PATCH v4 20/21] powerpc/64s: runlatch interrupt handling in C Nicholas Piggin
2021-01-02 12:25 ` [PATCH v4 21/21] powerpc/64s: power4 nap fixup " Nicholas Piggin
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=1609663625.fcccd2vjjf.astroid@bobo.none \
--to=npiggin@gmail$(echo .)com \
--cc=christophe.leroy@csgroup$(echo .)eu \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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