All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiaojuan Yang <yangxiaojuan@loongson.cn>
To: qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org, gaosong@loongson.cn,
	maobibo@loongson.cn, mark.cave-ayland@ilande.co.uk,
	mst@redhat.com, imammedo@redhat.com, ani@anisinha.ca,
	f4bug@amsat.org, peter.maydell@linaro.org,
	chenhuacai@loongson.cn
Subject: [PATCH 09/10] target/loongarch: Fix the meaning of ECFG reg's VS field
Date: Wed, 22 Jun 2022 18:43:00 +0800	[thread overview]
Message-ID: <20220622104301.804447-10-yangxiaojuan@loongson.cn> (raw)
In-Reply-To: <20220622104301.804447-1-yangxiaojuan@loongson.cn>

By the manual of LoongArch CSR, the VS field(18:16 bits) of
ECFG reg means that the number of instructions between each
exception entry is 2^VS.

Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
---
 target/loongarch/cpu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index 401d3fd30a..d1a87e8e1c 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -219,6 +219,10 @@ static void loongarch_cpu_do_interrupt(CPUState *cs)
     env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, PLV, 0);
     env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, IE, 0);
 
+    if (vec_size) {
+        vec_size = (1 << vec_size) * 4;
+    }
+
     if  (cs->exception_index == EXCCODE_INT) {
         /* Interrupt */
         uint32_t vector = 0;
-- 
2.31.1



  parent reply	other threads:[~2022-06-22 10:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22 10:42 [PATCH 00/10] Add functions for LoongArch virt machine Xiaojuan Yang
2022-06-22 10:42 ` [PATCH 01/10] hw/loongarch: rename macro prefix LS_PCI to LS7A_PCI Xiaojuan Yang
2022-06-22 15:05   ` Richard Henderson
2022-06-22 10:42 ` [PATCH 02/10] hw/loongarch: Add fw_cfg table support Xiaojuan Yang
2022-06-22 10:42 ` [PATCH 03/10] hw/loongarch: Add uefi bios loading support Xiaojuan Yang
2022-06-22 10:42 ` [PATCH 04/10] hw/loongarch: Add linux kernel booting support Xiaojuan Yang
2022-06-22 10:42 ` [PATCH 05/10] hw/loongarch: Add smbios support Xiaojuan Yang
2022-06-22 10:42 ` [PATCH 06/10] hw/loongarch: Add acpi ged support Xiaojuan Yang
2022-06-22 10:42 ` [PATCH 07/10] hw/loongarch: Add fdt support Xiaojuan Yang
2022-06-22 10:42 ` [PATCH 08/10] hw/loongarch: Fix ipi device access of 64bits Xiaojuan Yang
2022-06-22 10:43 ` Xiaojuan Yang [this message]
2022-06-22 10:43 ` [PATCH 10/10] target/loongarch: Add lock when writing timer clear reg Xiaojuan Yang

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=20220622104301.804447-10-yangxiaojuan@loongson.cn \
    --to=yangxiaojuan@loongson.cn \
    --cc=ani@anisinha.ca \
    --cc=chenhuacai@loongson.cn \
    --cc=f4bug@amsat.org \
    --cc=gaosong@loongson.cn \
    --cc=imammedo@redhat.com \
    --cc=maobibo@loongson.cn \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.