diff mbox series

[PULL,3/3] hw/loongarch: Modify flash block size to 256K

Message ID 20240719022604.781608-4-gaosong@loongson.cn (mailing list archive)
State New, archived
Headers show
Series [PULL,1/3] target/loongarch/gdbstub: Add vector registers support | expand

Commit Message

gaosong July 19, 2024, 2:26 a.m. UTC
From: Xianglai Li <lixianglai@loongson.cn>

loongarch added a common library for edk2 to
parse flash base addresses through fdt.
For compatibility with other architectures,
the flash block size in qemu is now changed to 256k.

Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20240624033319.999631-1-lixianglai@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
 include/hw/loongarch/virt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé July 19, 2024, 8:12 a.m. UTC | #1
On 19/7/24 04:26, Song Gao wrote:
> From: Xianglai Li <lixianglai@loongson.cn>
> 
> loongarch added a common library for edk2 to
> parse flash base addresses through fdt.
> For compatibility with other architectures,
> the flash block size in qemu is now changed to 256k.
> 
> Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
> Reviewed-by: Song Gao <gaosong@loongson.cn>
> Message-Id: <20240624033319.999631-1-lixianglai@loongson.cn>
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
>   include/hw/loongarch/virt.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/loongarch/virt.h b/include/hw/loongarch/virt.h
> index 8fdfacf268..603c1cebdb 100644
> --- a/include/hw/loongarch/virt.h
> +++ b/include/hw/loongarch/virt.h
> @@ -20,7 +20,7 @@
>   #define VIRT_FWCFG_BASE         0x1e020000UL
>   #define VIRT_BIOS_BASE          0x1c000000UL
>   #define VIRT_BIOS_SIZE          (16 * MiB)
> -#define VIRT_FLASH_SECTOR_SIZE  (128 * KiB)
> +#define VIRT_FLASH_SECTOR_SIZE  (256 * KiB)

Again, I believe this breaks machine migration. See the recent
example Daniel explained to me:
https://lore.kernel.org/qemu-devel/Zn6EQ39Q57KtmKPU@redhat.com/
Daniel P. Berrangé July 19, 2024, 8:18 a.m. UTC | #2
On Fri, Jul 19, 2024 at 10:12:20AM +0200, Philippe Mathieu-Daudé wrote:
> On 19/7/24 04:26, Song Gao wrote:
> > From: Xianglai Li <lixianglai@loongson.cn>
> > 
> > loongarch added a common library for edk2 to
> > parse flash base addresses through fdt.
> > For compatibility with other architectures,
> > the flash block size in qemu is now changed to 256k.
> > 
> > Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
> > Reviewed-by: Song Gao <gaosong@loongson.cn>
> > Message-Id: <20240624033319.999631-1-lixianglai@loongson.cn>
> > Signed-off-by: Song Gao <gaosong@loongson.cn>
> > ---
> >   include/hw/loongarch/virt.h | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/hw/loongarch/virt.h b/include/hw/loongarch/virt.h
> > index 8fdfacf268..603c1cebdb 100644
> > --- a/include/hw/loongarch/virt.h
> > +++ b/include/hw/loongarch/virt.h
> > @@ -20,7 +20,7 @@
> >   #define VIRT_FWCFG_BASE         0x1e020000UL
> >   #define VIRT_BIOS_BASE          0x1c000000UL
> >   #define VIRT_BIOS_SIZE          (16 * MiB)
> > -#define VIRT_FLASH_SECTOR_SIZE  (128 * KiB)
> > +#define VIRT_FLASH_SECTOR_SIZE  (256 * KiB)
> 
> Again, I believe this breaks machine migration. See the recent
> example Daniel explained to me:
> https://lore.kernel.org/qemu-devel/Zn6EQ39Q57KtmKPU@redhat.com/

Yes, changing flash size breaks migration compat, but note that loongarch
does not have any versioned machine types, so it has zero migration compat
right now regardles of this change. IOW, now is the right time to make the
change, before someone asks for versioned machines with loongarch.

With regards,
Daniel
Philippe Mathieu-Daudé July 19, 2024, 9:22 a.m. UTC | #3
On 19/7/24 10:18, Daniel P. Berrangé wrote:
> On Fri, Jul 19, 2024 at 10:12:20AM +0200, Philippe Mathieu-Daudé wrote:
>> On 19/7/24 04:26, Song Gao wrote:
>>> From: Xianglai Li <lixianglai@loongson.cn>
>>>
>>> loongarch added a common library for edk2 to
>>> parse flash base addresses through fdt.
>>> For compatibility with other architectures,
>>> the flash block size in qemu is now changed to 256k.
>>>
>>> Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
>>> Reviewed-by: Song Gao <gaosong@loongson.cn>
>>> Message-Id: <20240624033319.999631-1-lixianglai@loongson.cn>
>>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>>> ---
>>>    include/hw/loongarch/virt.h | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/include/hw/loongarch/virt.h b/include/hw/loongarch/virt.h
>>> index 8fdfacf268..603c1cebdb 100644
>>> --- a/include/hw/loongarch/virt.h
>>> +++ b/include/hw/loongarch/virt.h
>>> @@ -20,7 +20,7 @@
>>>    #define VIRT_FWCFG_BASE         0x1e020000UL
>>>    #define VIRT_BIOS_BASE          0x1c000000UL
>>>    #define VIRT_BIOS_SIZE          (16 * MiB)
>>> -#define VIRT_FLASH_SECTOR_SIZE  (128 * KiB)
>>> +#define VIRT_FLASH_SECTOR_SIZE  (256 * KiB)
>>
>> Again, I believe this breaks machine migration. See the recent
>> example Daniel explained to me:
>> https://lore.kernel.org/qemu-devel/Zn6EQ39Q57KtmKPU@redhat.com/
> 
> Yes, changing flash size breaks migration compat, but note that loongarch
> does not have any versioned machine types, so it has zero migration compat
> right now regardles of this change. IOW, now is the right time to make the
> change, before someone asks for versioned machines with loongarch.

Oh I see now, thanks for clarifying!

It would have been nice to mention that in the commit description,
but too late so I don't mind.

Regards,

Phil.
diff mbox series

Patch

diff --git a/include/hw/loongarch/virt.h b/include/hw/loongarch/virt.h
index 8fdfacf268..603c1cebdb 100644
--- a/include/hw/loongarch/virt.h
+++ b/include/hw/loongarch/virt.h
@@ -20,7 +20,7 @@ 
 #define VIRT_FWCFG_BASE         0x1e020000UL
 #define VIRT_BIOS_BASE          0x1c000000UL
 #define VIRT_BIOS_SIZE          (16 * MiB)
-#define VIRT_FLASH_SECTOR_SIZE  (128 * KiB)
+#define VIRT_FLASH_SECTOR_SIZE  (256 * KiB)
 #define VIRT_FLASH0_BASE        VIRT_BIOS_BASE
 #define VIRT_FLASH0_SIZE        VIRT_BIOS_SIZE
 #define VIRT_FLASH1_BASE        0x1d000000UL