[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/28] hw/intc/loongson_ipi: Access memory in little endian
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 03/28] hw/intc/loongson_ipi: Access memory in little endian |
Date: |
Tue, 23 Jul 2024 22:38:30 +0200 |
From: Bibo Mao <maobibo@loongson.cn>
Loongson IPI is only available in little-endian,
so use that to access the guest memory (in case
we run on a big-endian host).
Cc: qemu-stable@nongnu.org
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Fixes: f6783e3438 ("hw/loongarch: Add LoongArch ipi interrupt support")
[PMD: Extracted from bigger commit, added commit description]
Co-Developed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Tested-by: Bibo Mao <maobibo@loongson.cn>
Acked-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Message-Id: <20240718133312.10324-3-philmd@linaro.org>
---
hw/intc/loongson_ipi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c
index e6a7142480c..e7979dbdd8b 100644
--- a/hw/intc/loongson_ipi.c
+++ b/hw/intc/loongson_ipi.c
@@ -14,6 +14,7 @@
#include "qapi/error.h"
#include "qemu/log.h"
#include "exec/address-spaces.h"
+#include "exec/memory.h"
#include "migration/vmstate.h"
#ifdef TARGET_LOONGARCH64
#include "target/loongarch/cpu.h"
@@ -102,7 +103,7 @@ static MemTxResult send_ipi_data(CPUState *cpu, uint64_t
val, hwaddr addr,
* if the mask is 0, we need not to do anything.
*/
if ((val >> 27) & 0xf) {
- data = address_space_ldl(iocsr_as, addr, attrs, NULL);
+ data = address_space_ldl_le(iocsr_as, addr, attrs, NULL);
for (i = 0; i < 4; i++) {
/* get mask for byte writing */
if (val & (0x1 << (27 + i))) {
@@ -113,7 +114,7 @@ static MemTxResult send_ipi_data(CPUState *cpu, uint64_t
val, hwaddr addr,
data &= mask;
data |= (val >> 32) & ~mask;
- address_space_stl(iocsr_as, addr, data, attrs, NULL);
+ address_space_stl_le(iocsr_as, addr, data, attrs, NULL);
return MEMTX_OK;
}
--
2.41.0
- [PULL 00/28] Misc HW+ patches for 2024-07-23, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 01/28] accel: Restrict probe_access*() functions to TCG, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 02/28] hw/i386/intel_iommu: Extract device IOTLB invalidation logic, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 03/28] hw/intc/loongson_ipi: Access memory in little endian,
Philippe Mathieu-Daudé <=
- [PULL 04/28] hw/intc/loongson_ipi: Fix resource leak, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 05/28] hw/intc/loongson_ipi: Declare QOM types using DEFINE_TYPES() macro, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 06/28] docs: Correct Loongarch -> LoongArch, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 07/28] docs/interop/firmware.json: add new enum FirmwareFormat, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 08/28] docs/interop/firmware.json: add new enum FirmwareArchitecture, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 09/28] docs/interop/firmware.json: convert "Example" section, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 10/28] hw/i2c/mpc_i2c: Fix mmio region size, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 11/28] hw/mips/loongson3_virt: remove useless type cast, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 12/28] util/range: Make ranges_overlap() return bool, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 15/28] system/memory_mapping: make range overlap check more readable, Philippe Mathieu-Daudé, 2024/07/23