From: Fabiano Rosas <farosas@linux.ibm.com>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, danielhb413@gmail.com, philmd@redhat.com,
clg@kaod.org, david@gibson.dropbear.id.au
Subject: Re: [PATCH v2] Revert "target/ppc: Move SPR_DSISR setting to powerpc_excp"
Date: Fri, 17 Dec 2021 15:07:35 -0300 [thread overview]
Message-ID: <8735mr85qw.fsf@linux.ibm.com> (raw)
In-Reply-To: <3d5b6237-de28-8285-b0a4-080f18ba5acd@linaro.org>
Richard Henderson <richard.henderson@linaro.org> writes:
> On 12/9/21 9:33 AM, Fabiano Rosas wrote:
>> This reverts commit 336e91f85332dda0ede4c1d15b87a19a0fb898a2.
>>
>> It breaks the --disable-tcg build:
>>
>> ../target/ppc/excp_helper.c:463:29: error: implicit declaration of
>> function ‘cpu_ldl_code’ [-Werror=implicit-function-declaration]
>>
>> We should not have TCG code in powerpc_excp because some kvm-only
>> routines use it indirectly to dispatch interrupts. See
>> kvm_handle_debug, spapr_mce_req_event and
>> spapr_do_system_reset_on_cpu.
>>
>> We can re-introduce the change once we have split the interrupt
>> injection code between KVM and TCG.
>>
>> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
>> ---
>> target/ppc/excp_helper.c | 21 ++++++++++++---------
>> 1 file changed, 12 insertions(+), 9 deletions(-)
>
> This is fine. I had thought it would turn out to be helpful in conjunction with my
> user-only unaligned patch set, but in the end I went a different way and have a separate
> hook for user-only.
>
> It is correct to simply revert the patch first.
>
> I have ideas for further cleanup, if you have time:
>
> (1) The assignment to DSISR does not need to wait until powerpc_excp. I believe we can
> assign to it directly in do_unaligned_access, and avoid using env->error_code as an
> intermediary.
Makes sense. I see that not all processors use DSISR during the
Alignment interrupt. I'll check the manuals and fix that as well.
I'm writing some tests to check each individual Alignment case and DAR
is not being set for ALIGN_LE. There might be others missing. I'll
probably end up moving the DAR code from ppc_cpu_do_unaligned_access
into powerpc_excp after all.
>
> (2) The note about opcode fields being set incorrectly could be fixed during translation.
> You'd use TARGET_INSN_START_EXTRA_WORDS to record the necessary information during
> translation, is provided to restore_state_to_opc during unwinding, and then moved into
> DSISR in do_unaligned_access. Similar to target/arm and how env->exception.syndrome is
> managed, especially disas_set_insn_syndrome.
>
Ok, I'll give it a shot. Thanks for the detailed pointers.
next prev parent reply other threads:[~2021-12-17 18:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-09 17:33 [PATCH v2] Revert "target/ppc: Move SPR_DSISR setting to powerpc_excp" Fabiano Rosas
2021-12-11 16:50 ` Richard Henderson
2021-12-17 18:07 ` Fabiano Rosas [this message]
2021-12-15 16:52 ` Cédric Le Goater
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=8735mr85qw.fsf@linux.ibm.com \
--to=farosas@linux.ibm.com \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.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;
as well as URLs for NNTP newsgroup(s).