[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 15/16] hw/intc/loongarch_pch: Set flexible memory access size
From: |
Bibo Mao |
Subject: |
[PATCH v4 15/16] hw/intc/loongarch_pch: Set flexible memory access size with iomem region |
Date: |
Wed, 7 May 2025 10:37:53 +0800 |
The original iomem region only supports 4 bytes access size, set it ok
with 1/2/4/8 bytes. Also unaligned memory access is not supported.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
---
hw/intc/loongarch_pch_pic.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/hw/intc/loongarch_pch_pic.c b/hw/intc/loongarch_pch_pic.c
index 076b984d93..e9126a0c1f 100644
--- a/hw/intc/loongarch_pch_pic.c
+++ b/hw/intc/loongarch_pch_pic.c
@@ -262,12 +262,19 @@ static const MemoryRegionOps loongarch_pch_pic_ops = {
.read = loongarch_pch_pic_read,
.write = loongarch_pch_pic_write,
.valid = {
- .min_access_size = 4,
+ .min_access_size = 1,
.max_access_size = 8,
+ /*
+ * PCH PIC device would not work correctly if the guest was doing
+ * unaligned access. This might not be a limitation on the real
+ * device but in practice there is no reason for a guest to access
+ * this device unaligned.
+ */
+ .unaligned = false,
},
.impl = {
- .min_access_size = 4,
- .max_access_size = 4,
+ .min_access_size = 1,
+ .max_access_size = 8,
},
.endianness = DEVICE_LITTLE_ENDIAN,
};
--
2.39.3
- [PATCH v4 06/16] hw/intc/loongarch_pch: Discard write operation with ISR register, (continued)
- [PATCH v4 06/16] hw/intc/loongarch_pch: Discard write operation with ISR register, Bibo Mao, 2025/05/06
- [PATCH v4 02/16] hw/intc/loongarch_pch: Modify register name PCH_PIC_xxx_OFFSET with PCH_PIC_xxx, Bibo Mao, 2025/05/06
- [PATCH v4 03/16] hw/intc/loongarch_pch: Remove some duplicate macro, Bibo Mao, 2025/05/06
- [PATCH v4 07/16] hw/intc/loongarch_pch: Use generic read callback for iomem32_low region, Bibo Mao, 2025/05/06
- [PATCH v4 09/16] hw/intc/loongarch_pch: Use generic read callback for iomem8 region, Bibo Mao, 2025/05/06
- [PATCH v4 10/16] hw/intc/loongarch_pch: Use generic write callback for iomem32_low region, Bibo Mao, 2025/05/06
- [PATCH v4 08/16] hw/intc/loongarch_pch: Use generic read callback for iomem32_high region, Bibo Mao, 2025/05/06
- [PATCH v4 11/16] hw/intc/loongarch_pch: Use generic write callback for iomem32_high region, Bibo Mao, 2025/05/06
- [PATCH v4 12/16] hw/intc/loongarch_pch: Use generic write callback for iomem8 region, Bibo Mao, 2025/05/06
- Re: [PATCH v4 00/16] hw/intc/loongarch_pch: Cleanup with memory region ops, gaosong, 2025/05/14