diff options
| author | Bibo Mao <maobibo@loongson.cn> | 2025-05-07 10:37:53 +0800 |
|---|---|---|
| committer | Song Gao <gaosong@loongson.cn> | 2025-05-14 15:55:30 +0800 |
| commit | 2493ff01dc7c9b06a0579f6e66c3df69da4d5d23 (patch) | |
| tree | 69041b18d53737ffad0ba1bd20d4b172f9669a81 | |
| parent | ce5efc2f44d1a2809c4adb2bad2083db29a03c71 (diff) | |
| download | focaccia-qemu-2493ff01dc7c9b06a0579f6e66c3df69da4d5d23.tar.gz focaccia-qemu-2493ff01dc7c9b06a0579f6e66c3df69da4d5d23.zip | |
hw/intc/loongarch_pch: Set flexible memory access size with iomem region
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> Message-Id: <20250507023754.1877445-4-maobibo@loongson.cn> Signed-off-by: Song Gao <gaosong@loongson.cn>
| -rw-r--r-- | hw/intc/loongarch_pch_pic.c | 13 |
1 files 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, }; |