qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Song Gao <gaosong@loongson.cn>, qemu-devel@nongnu.org
Cc: laurent@vivier.eu, Xiaojuan Yang <yangxiaojuan@loongson.cn>
Subject: Re: [PATCH v16 7/9] target/loongarch: Adjust functions and structure to support user-mode
Date: Tue, 14 Jun 2022 09:43:10 -0700	[thread overview]
Message-ID: <a9539054-044f-7cfb-8de4-a5b821679b6f@linaro.org> (raw)
In-Reply-To: <20220614090536.1103616-8-gaosong@loongson.cn>

On 6/14/22 02:05, Song Gao wrote:
> @@ -172,17 +173,20 @@ static void loongarch_cpu_do_interrupt(CPUState *cs)
>           update_badinstr = 0;
>           break;
>       case EXCCODE_ADEM:
> +    case EXCCODE_BCE:
>       case EXCCODE_SYS:
>       case EXCCODE_BRK:
> +    case EXCCODE_INE:
> +    case EXCCODE_IPE:
> +    case EXCCODE_FPE:
> +        env->badvaddr = env->pc;
> +        QEMU_FALLTHROUGH;

This is incorrect still.

(1) env->badaddr (in this patch renamed badvaddr) is actually unused prior to this patch 
and should go away.  It seems to have been copied from RISC-V?  The correct LoongArch 
variable is env->CSR_BADV (see raise_mmu_exception in tlb_helper.c).

(2) EXCCODE_ADEM is on the wrong side of this FALLTHROUGH.  This is the exception raised 
by TLB faults, and should retain the BADV address of the fault, not the faulting instruction.

Also, this patch is trying to do too many things at once.  Please split it into smaller 
logical changes.  Any bug fixes for the system code, for instance raising EXCCODE_BCE 
instead of EXCCODE_ADEM for helper_asrtle_d should be completely separated.


r~


  reply	other threads:[~2022-06-14 17:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-14  9:05 [PATCH v16 0/9] Add LoongArch linux-user emulation support Song Gao
2022-06-14  9:05 ` [PATCH v16 1/9] linux-user: Add LoongArch generic header files Song Gao
2022-06-14  9:05 ` [PATCH v16 2/9] linux-user: Add LoongArch signal support Song Gao
2022-06-14 16:15   ` Richard Henderson
2022-06-15  9:57     ` gaosong
2022-06-15 15:00       ` Richard Henderson
2022-06-14  9:05 ` [PATCH v16 3/9] linux-user: Add LoongArch elf support Song Gao
2022-06-14 16:21   ` Richard Henderson
2022-06-15  9:44     ` gaosong
2022-06-15 14:49       ` Richard Henderson
2022-06-14  9:05 ` [PATCH v16 4/9] linux-user: Add LoongArch syscall support Song Gao
2022-06-14  9:05 ` [PATCH v16 5/9] linux-user: Add LoongArch cpu_loop support Song Gao
2022-06-14  9:05 ` [PATCH v16 6/9] scripts: add loongarch64 binfmt config Song Gao
2022-06-14  9:05 ` [PATCH v16 7/9] target/loongarch: Adjust functions and structure to support user-mode Song Gao
2022-06-14 16:43   ` Richard Henderson [this message]
2022-06-15  9:49     ` gaosong
2022-06-14  9:05 ` [PATCH v16 8/9] default-configs: Add loongarch linux-user support Song Gao
2022-06-14  9:05 ` [PATCH v16 9/9] target/loongarch: Update README Song Gao
2022-06-14 16:43   ` Richard Henderson

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=a9539054-044f-7cfb-8de4-a5b821679b6f@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=gaosong@loongson.cn \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=yangxiaojuan@loongson.cn \
    /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).