refactor main RAM allocation to use hostmem backend
Subsystems (5)
Re: [PATCH v2 67/86] ppc:ppc440_bamboo/sam460ex: use memdev for RAM
In reply to Igor MammedovQuoted 59 lines · Igor Mammedov
memory_region_allocate_system_memory()API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and usingMachineState::raminstead of manually initializing RAM memory region.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
---include/hw/ppc/ppc4xx.h | 2 +- hw/ppc/ppc440_bamboo.c | 3 ++- hw/ppc/ppc4xx_devs.c | 9 +++------ hw/ppc/sam460ex.c | 3 ++- 4 files changed, 8 insertions(+), 9 deletions(-)include/hw/ppc/ppc4xx.h +1
-1@@ -42,7 +42,7 @@ enum {qemu_irq *ppcuic_init (CPUPPCState *env,qemu_irq *irqs,uint32_t dcr_base,int has_ssr,int has_vr); -void ppc4xx_sdram_prep (ram_addr_t ram_size,int nr_banks, +void ppc4xx_sdram_prep (MemoryRegion *ram,int nr_banks,MemoryRegion ram_memories[],hwaddr ram_bases[],hwaddr ram_sizes[],const ram_addr_t sdram_bank_sizes[]);hw/ppc/ppc440_bamboo.c +2
-1@@ -202,7 +202,7 @@ static void bamboo_init(MachineState *machine)/* SDRAM controller */ memset (ram_bases,0 ,sizeof (ram_bases));memset (ram_sizes,0 ,sizeof (ram_sizes)); -ppc4xx_sdram_prep (ram_size,PPC440EP_SDRAM_NR_BANKS , ram_memories, +ppc4xx_sdram_prep (machine->ram,PPC440EP_SDRAM_NR_BANKS , ram_memories, ram_bases, ram_sizes, ppc440ep_sdram_bank_sizes);/* XXX 440EP's ECC interrupts are on UIC1, but we've only created UIC0. */ ppc4xx_sdram_init(env, pic[14], PPC440EP_SDRAM_NR_BANKS, ram_memories,@@ -289,6 +289,7 @@ static void bamboo_machine_init(MachineClass *mc) mc->desc ="bamboo" ; mc->init = bamboo_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("440epb" ); + mc->default_ram_id ="ppc4xx.sdram" ; }DEFINE_MACHINE ("bamboo" , bamboo_machine_init)hw/ppc/ppc4xx_devs.c +0
-0
hw/ppc/ppc4xx_devs.c void ppc4xx_sdram_init (CPUPPCState *env, qemu_irq irq, int nbanks, · line 676
Quoted 5 lines
hw/ppc/ppc4xx_devs.c +1
-1@@ -673,13 +673,12 @@ void ppc4xx_sdram_init (CPUPPCState *env, qemu_irq irq, int nbanks,* The 4xx SDRAM controller supports a small number of banks, and each bank * must be one of a small set of sizes. The number of banks and the supported * sizes varies by SoC. */ -void ppc4xx_sdram_prep(ram_addr_t ram_size, int nr_banks, +void ppc4xx_sdram_prep(MemoryRegion *ram, int nr_banks,
Maybe you need to also update the comment above which talks about 'ram_size' that you don't have any more.
Quoted 20 lines
hw/ppc/ppc4xx_devs.c +2
-3MemoryRegion ram_memories[], hwaddr ram_bases[], hwaddr ram_sizes[], const ram_addr_t sdram_bank_sizes[]) { - MemoryRegion *ram = g_malloc0(sizeof(*ram)); -ram_addr_t size_left = ram_size; + ram_addr_t size_left = memory_region_size(ram);ram_addr_t base =0 ;ram_addr_t bank_size;int last_bank =0 ;@@ -704,7 +703,7 @@ void ppc4xx_sdram_prep(ram_addr_t ram_size, int nr_banks, }if (size_left) { -ram_addr_t used_size = ram_size - size_left; +ram_addr_t used_size =memory_region_size (ram) - size_left;GString *s =g_string_new (NULL );for (i =0 ; sdram_bank_sizes[i]; i++) {
hw/ppc/ppc4xx_devs.c void ppc4xx_sdram_prep(ram_addr_t ram_size, int nr_banks, · line 723
Quoted 6 lines
hw/ppc/ppc4xx_devs.c +0
-2@@ -721,8 +720,6 @@ void ppc4xx_sdram_prep(ram_addr_t ram_size, int nr_banks,exit (EXIT_FAILURE ); } -memory_region_allocate_system_memory (ram,NULL ,"ppc4xx.sdram" , ram_size); -for (i =0 ; i <= last_bank; i++) {
Can this for cycle now completely merged with the one above and init the alias regions also there?
Regards,
BALATON Zoltan
Quoted 24 lines
hw/ppc/ppc4xx_devs.c +0
-0char name[32 ];snprintf (name,sizeof (name),"ppc4xx.sdram%d" , i);hw/ppc/sam460ex.c +2
-1@@ -324,7 +324,7 @@ static void sam460ex_init(MachineState *machine)/* SDRAM controller */ /* put all RAM on first bank because board has one slot * and firmware only checks that */ -ppc4xx_sdram_prep (machine->ram_size,1 , ram_memories, ram_bases, ram_sizes, +ppc4xx_sdram_prep (machine->ram,1 , ram_memories, ram_bases, ram_sizes, ppc460ex_sdram_bank_sizes);/* FIXME: does 460EX have ECC interrupts? */ @@ -483,6 +483,7 @@ static void sam460ex_machine_init(MachineClass *mc) mc->init = sam460ex_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("460exb" ); mc->default_ram_size =512 * MiB; + mc->default_ram_id ="ppc4xx.sdram" ; }DEFINE_MACHINE ("sam460ex" , sam460ex_machine_init)
PATCH v3 65/84 ppc/{ppc440_bamboo, sam460ex}: use memdev for RAM
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing RAM memory region.
---
v3:
* drop ram_size from comment above ppc4xx_sdram_banks (BALATON Zoltan <[email protected]>)
* move memory alias initialization into the same loop where RAM is split on banks.
(BALATON Zoltan <[email protected]>)
--- include/hw/ppc/ppc4xx.h | 2 +- hw/ppc/ppc440_bamboo.c | 3 ++- hw/ppc/ppc4xx_devs.c | 26 ++++++++++---------------- hw/ppc/sam460ex.c | 3 ++- 4 files changed, 15 insertions(+), 19 deletions(-)
include/hw/ppc/ppc4xx.h +1 -1
@@ -42,7 +42,7 @@ enum {qemu_irq *ppcuic_init (CPUPPCState *env,qemu_irq *irqs,uint32_t dcr_base,int has_ssr,int has_vr); -void ppc4xx_sdram_banks (ram_addr_t ram_size,int nr_banks, +void ppc4xx_sdram_banks (MemoryRegion *ram,int nr_banks,MemoryRegion ram_memories[],hwaddr ram_bases[],hwaddr ram_sizes[],const ram_addr_t sdram_bank_sizes[]);
hw/ppc/ppc440_bamboo.c +2 -1
@@ -202,7 +202,7 @@ static void bamboo_init(MachineState *machine)/* SDRAM controller */ memset (ram_bases,0 ,sizeof (ram_bases));memset (ram_sizes,0 ,sizeof (ram_sizes)); -ppc4xx_sdram_banks (ram_size,PPC440EP_SDRAM_NR_BANKS , ram_memories, +ppc4xx_sdram_banks (machine->ram,PPC440EP_SDRAM_NR_BANKS , ram_memories, ram_bases, ram_sizes, ppc440ep_sdram_bank_sizes);/* XXX 440EP's ECC interrupts are on UIC1, but we've only created UIC0. */ ppc4xx_sdram_init(env, pic[14], PPC440EP_SDRAM_NR_BANKS, ram_memories,
@@ -289,6 +289,7 @@ static void bamboo_machine_init(MachineClass *mc) mc->desc ="bamboo" ; mc->init = bamboo_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("440epb" ); + mc->default_ram_id ="ppc4xx.sdram" ; }DEFINE_MACHINE ("bamboo" , bamboo_machine_init)
hw/ppc/ppc4xx_devs.c +10 -16
@@ -666,23 +666,21 @@ void ppc4xx_sdram_init (CPUPPCState *env, qemu_irq irq, int nbanks,sdram_map_bcr (sdram); } -/* Fill in consecutive SDRAM banks with 'ram_size' bytes of memory. +/* Split RAM between SDRAM banks. * * sdram_bank_sizes[] must be 0-terminated. * * The 4xx SDRAM controller supports a small number of banks, and each bank * must be one of a small set of sizes. The number of banks and the supported * sizes varies by SoC. */ -void ppc4xx_sdram_banks (ram_addr_t ram_size,int nr_banks, +void ppc4xx_sdram_banks (MemoryRegion *ram,int nr_banks,MemoryRegion ram_memories[],hwaddr ram_bases[],hwaddr ram_sizes[],const ram_addr_t sdram_bank_sizes[]) { -MemoryRegion *ram =g_malloc0 (sizeof (*ram)); -ram_addr_t size_left = ram_size; +ram_addr_t size_left =memory_region_size (ram);ram_addr_t base =0 ;ram_addr_t bank_size; -int last_bank =0 ;int i;int j;
@@ -690,11 +688,16 @@ void ppc4xx_sdram_banks(ram_addr_t ram_size, int nr_banks,for (j =0 ; sdram_bank_sizes[j] !=0 ; j++) { bank_size = sdram_bank_sizes[j];if (bank_size <= size_left) { +char name[32 ]; + ram_bases[i] = base; ram_sizes[i] = bank_size; base += bank_size; size_left -= bank_size; - last_bank = i; + +snprintf (name,sizeof (name),"ppc4xx.sdram%d" , i); +memory_region_init_alias (&ram_memories[i],NULL , name, ram, + ram_bases[i], ram_sizes[i]); } }if (!size_left) {
@@ -704,7 +707,7 @@ void ppc4xx_sdram_banks(ram_addr_t ram_size, int nr_banks, }if (size_left) { -ram_addr_t used_size = ram_size - size_left; +ram_addr_t used_size =memory_region_size (ram) - size_left;GString *s =g_string_new (NULL );for (i =0 ; sdram_bank_sizes[i]; i++) {
@@ -720,15 +723,6 @@ void ppc4xx_sdram_banks(ram_addr_t ram_size, int nr_banks,g_string_free (s, true);exit (EXIT_FAILURE ); } - -memory_region_allocate_system_memory (ram,NULL ,"ppc4xx.sdram" , ram_size); - -for (i =0 ; i <= last_bank; i++) { -char name[32 ]; -snprintf (name,sizeof (name),"ppc4xx.sdram%d" , i); -memory_region_init_alias (&ram_memories[i],NULL , name, ram, - ram_bases[i], ram_sizes[i]); - } }/*****************************************************************************/
hw/ppc/sam460ex.c +2 -1
@@ -324,7 +324,7 @@ static void sam460ex_init(MachineState *machine)/* SDRAM controller */ /* put all RAM on first bank because board has one slot * and firmware only checks that */ -ppc4xx_sdram_banks (machine->ram_size,1 , ram_memories, ram_bases, ram_sizes, +ppc4xx_sdram_banks (machine->ram,1 , ram_memories, ram_bases, ram_sizes, ppc460ex_sdram_bank_sizes);/* FIXME: does 460EX have ECC interrupts? */
@@ -483,6 +483,7 @@ static void sam460ex_machine_init(MachineClass *mc) mc->init = sam460ex_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("460exb" ); mc->default_ram_size =512 * MiB; + mc->default_ram_id ="ppc4xx.sdram" ; }DEFINE_MACHINE ("sam460ex" , sam460ex_machine_init)
Signature · 1 line
2.7.4
PATCH v3 65/82 ppc/{ppc440_bamboo, sam460ex}: use memdev for RAM
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing RAM memory region.
---
v3:
* drop ram_size from comment above ppc4xx_sdram_banks (BALATON Zoltan <[email protected]>)
* move memory alias initialization into the same loop where RAM is split on banks.
(BALATON Zoltan <[email protected]>)
v3.1
* rebase on top of previous patch due to changed context
--- include/hw/ppc/ppc4xx.h | 2 +- hw/ppc/ppc440_bamboo.c | 3 ++- hw/ppc/ppc4xx_devs.c | 25 +++++++++---------------- hw/ppc/sam460ex.c | 3 ++- 4 files changed, 14 insertions(+), 19 deletions(-)
include/hw/ppc/ppc4xx.h +1 -1
@@ -42,7 +42,7 @@ enum {qemu_irq *ppcuic_init (CPUPPCState *env,qemu_irq *irqs,uint32_t dcr_base,int has_ssr,int has_vr); -void ppc4xx_sdram_banks (ram_addr_t ram_size,int nr_banks, +void ppc4xx_sdram_banks (MemoryRegion *ram,int nr_banks,MemoryRegion ram_memories[],hwaddr ram_bases[],hwaddr ram_sizes[],const ram_addr_t sdram_bank_sizes[]);
hw/ppc/ppc440_bamboo.c +2 -1
@@ -202,7 +202,7 @@ static void bamboo_init(MachineState *machine)/* SDRAM controller */ memset (ram_bases,0 ,sizeof (ram_bases));memset (ram_sizes,0 ,sizeof (ram_sizes)); -ppc4xx_sdram_banks (ram_size,PPC440EP_SDRAM_NR_BANKS , ram_memories, +ppc4xx_sdram_banks (machine->ram,PPC440EP_SDRAM_NR_BANKS , ram_memories, ram_bases, ram_sizes, ppc440ep_sdram_bank_sizes);/* XXX 440EP's ECC interrupts are on UIC1, but we've only created UIC0. */ ppc4xx_sdram_init(env, pic[14], PPC440EP_SDRAM_NR_BANKS, ram_memories,
@@ -289,6 +289,7 @@ static void bamboo_machine_init(MachineClass *mc) mc->desc ="bamboo" ; mc->init = bamboo_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("440epb" ); + mc->default_ram_id ="ppc4xx.sdram" ; }DEFINE_MACHINE ("bamboo" , bamboo_machine_init)
hw/ppc/ppc4xx_devs.c +9 -16
@@ -666,23 +666,21 @@ void ppc4xx_sdram_init (CPUPPCState *env, qemu_irq irq, int nbanks,sdram_map_bcr (sdram); } -/* Fill in consecutive SDRAM banks with 'ram_size' bytes of memory. +/* Split RAM between SDRAM banks. * * sdram_bank_sizes[] must be 0-terminated. * * The 4xx SDRAM controller supports a small number of banks, and each bank * must be one of a small set of sizes. The number of banks and the supported * sizes varies by SoC. */ -void ppc4xx_sdram_banks (ram_addr_t ram_size,int nr_banks, +void ppc4xx_sdram_banks (MemoryRegion *ram,int nr_banks,MemoryRegion ram_memories[],hwaddr ram_bases[],hwaddr ram_sizes[],const ram_addr_t sdram_bank_sizes[]) { -MemoryRegion *ram =g_malloc0 (sizeof (*ram)); -ram_addr_t size_left = ram_size; +ram_addr_t size_left =memory_region_size (ram);ram_addr_t base =0 ;ram_addr_t bank_size; -int last_bank =0 ;int i;int j;
@@ -690,11 +688,15 @@ void ppc4xx_sdram_banks(ram_addr_t ram_size, int nr_banks,for (j =0 ; sdram_bank_sizes[j] !=0 ; j++) { bank_size = sdram_bank_sizes[j];if (bank_size <= size_left) { +char name[32 ]; + ram_bases[i] = base; ram_sizes[i] = bank_size; base += bank_size; size_left -= bank_size; - last_bank = i; +snprintf (name,sizeof (name),"ppc4xx.sdram%d" , i); +memory_region_init_alias (&ram_memories[i],NULL , name, ram, + ram_bases[i], ram_sizes[i]);break ; } }
@@ -705,7 +707,7 @@ void ppc4xx_sdram_banks(ram_addr_t ram_size, int nr_banks, }if (size_left) { -ram_addr_t used_size = ram_size - size_left; +ram_addr_t used_size =memory_region_size (ram) - size_left;GString *s =g_string_new (NULL );for (i =0 ; sdram_bank_sizes[i]; i++) {
@@ -721,15 +723,6 @@ void ppc4xx_sdram_banks(ram_addr_t ram_size, int nr_banks,g_string_free (s, true);exit (EXIT_FAILURE ); } - -memory_region_allocate_system_memory (ram,NULL ,"ppc4xx.sdram" , ram_size); - -for (i =0 ; i <= last_bank; i++) { -char name[32 ]; -snprintf (name,sizeof (name),"ppc4xx.sdram%d" , i); -memory_region_init_alias (&ram_memories[i],NULL , name, ram, - ram_bases[i], ram_sizes[i]); - } }/*****************************************************************************/
hw/ppc/sam460ex.c +2 -1
@@ -324,7 +324,7 @@ static void sam460ex_init(MachineState *machine)/* SDRAM controller */ /* put all RAM on first bank because board has one slot * and firmware only checks that */ -ppc4xx_sdram_banks (machine->ram_size,1 , ram_memories, ram_bases, ram_sizes, +ppc4xx_sdram_banks (machine->ram,1 , ram_memories, ram_bases, ram_sizes, ppc460ex_sdram_bank_sizes);/* FIXME: does 460EX have ECC interrupts? */
@@ -483,6 +483,7 @@ static void sam460ex_machine_init(MachineClass *mc) mc->init = sam460ex_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("460exb" ); mc->default_ram_size =512 * MiB; + mc->default_ram_id ="ppc4xx.sdram" ; }DEFINE_MACHINE ("sam460ex" , sam460ex_machine_init)
Signature · 1 line
2.7.4
PATCH v2 68/86 ppc:prep: use memdev for RAM
In reply to Igor Mammedovmemory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing RAM memory region.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- hw/ppc/prep.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
hw/ppc/prep.c +7 -8
@@ -400,7 +400,6 @@ static int PPC_NVRAM_set_params (Nvram *nvram, uint16_t NVRAM_size,/* PowerPC PREP hardware initialisation */ static void ppc_prep_init (MachineState *machine) { -ram_addr_t ram_size = machine->ram_size;const char *kernel_filename = machine->kernel_filename;const char *kernel_cmdline = machine->kernel_cmdline;const char *initrd_filename = machine->initrd_filename;
@@ -413,7 +412,6 @@ static void ppc_prep_init(MachineState *machine)MemoryRegion *xcsr =g_new (MemoryRegion,1 );#endif int linux_boot, i, nb_nics1; -MemoryRegion *ram =g_new (MemoryRegion,1 );uint32_t kernel_base, initrd_base;long kernel_size, initrd_size;DeviceState *dev;
@@ -444,15 +442,14 @@ static void ppc_prep_init(MachineState *machine)qemu_register_reset (ppc_prep_reset, cpu); } -/* allocate RAM */ -memory_region_allocate_system_memory (ram,NULL ,"ppc_prep.ram" , ram_size); -memory_region_add_subregion (sysmem,0 , ram); +/* map RAM */ +memory_region_add_subregion (sysmem,0 , machine->ram);if (linux_boot) { kernel_base =KERNEL_LOAD_ADDR ;/* now we can load the kernel */ kernel_size =load_image_targphys (kernel_filename, kernel_base, - ram_size - kernel_base); + machine->ram_size - kernel_base);if (kernel_size <0 ) {error_report ("could not load kernel '%s'" , kernel_filename);exit (1 );
@@ -461,7 +458,7 @@ static void ppc_prep_init(MachineState *machine)if (initrd_filename) { initrd_base =INITRD_LOAD_ADDR ; initrd_size =load_image_targphys (initrd_filename, initrd_base, - ram_size - initrd_base); + machine->ram_size - initrd_base);if (initrd_size <0 ) {error_report ("could not load initial ram disk '%s'" , initrd_filename);
@@ -576,7 +573,7 @@ static void ppc_prep_init(MachineState *machine) sysctrl->nvram = m48t59;/* Initialise NVRAM */ - PPC_NVRAM_set_params(m48t59, NVRAM_SIZE, "PREP", ram_size, + PPC_NVRAM_set_params(m48t59, NVRAM_SIZE, "PREP", machine->ram_size, ppc_boot_device, kernel_base, kernel_size, kernel_cmdline,
@@ -596,6 +593,7 @@ static void prep_machine_init(MachineClass *mc) mc->default_boot_order ="cad" ; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("602" ); mc->default_display ="std" ; + mc->default_ram_id ="ppc_prep.ram" ; }static int prep_set_cmos_checksum (DeviceState *dev,void *opaque)
@@ -814,6 +812,7 @@ static void ibm_40p_machine_init(MachineClass *mc) mc->init = ibm_40p_init; mc->max_cpus =1 ; mc->default_ram_size =128 * MiB; + mc->default_ram_id ="ppc_prep.ram" ; mc->block_default_type =IF_SCSI ; mc->default_boot_order ="c" ; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("604" );
Signature · 1 line
2.7.4
Re: [PATCH v2 68/86] ppc:prep: use memdev for RAM
Quoted 9 lines · Igor Mammedov
memory_region_allocate_system_memory()API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and usingMachineState::raminstead of manually initializing RAM memory region.Signed-off-by Igor Mammedov <[email protected]>
Although it's probably fairly pointless, since I'm looking to merge a patch removing prep entirely soon.
Quoted 81 lines
---
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/ppc/prep.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)hw/ppc/prep.c +7
-8@@ -400,7 +400,6 @@ static int PPC_NVRAM_set_params (Nvram *nvram, uint16_t NVRAM_size,/* PowerPC PREP hardware initialisation */ static void ppc_prep_init (MachineState *machine) { -ram_addr_t ram_size = machine->ram_size;const char *kernel_filename = machine->kernel_filename;const char *kernel_cmdline = machine->kernel_cmdline;const char *initrd_filename = machine->initrd_filename;@@ -413,7 +412,6 @@ static void ppc_prep_init(MachineState *machine)MemoryRegion *xcsr =g_new (MemoryRegion,1 );#endif int linux_boot, i, nb_nics1; -MemoryRegion *ram =g_new (MemoryRegion,1 );uint32_t kernel_base, initrd_base;long kernel_size, initrd_size;DeviceState *dev;@@ -444,15 +442,14 @@ static void ppc_prep_init(MachineState *machine)qemu_register_reset (ppc_prep_reset, cpu); } -/* allocate RAM */ -memory_region_allocate_system_memory (ram,NULL ,"ppc_prep.ram" , ram_size); -memory_region_add_subregion (sysmem,0 , ram); +/* map RAM */ +memory_region_add_subregion (sysmem,0 , machine->ram);if (linux_boot) { kernel_base =KERNEL_LOAD_ADDR ;/* now we can load the kernel */ kernel_size =load_image_targphys (kernel_filename, kernel_base, - ram_size - kernel_base); + machine->ram_size - kernel_base);if (kernel_size <0 ) {error_report ("could not load kernel '%s'" , kernel_filename);exit (1 );@@ -461,7 +458,7 @@ static void ppc_prep_init(MachineState *machine)if (initrd_filename) { initrd_base =INITRD_LOAD_ADDR ; initrd_size =load_image_targphys (initrd_filename, initrd_base, - ram_size - initrd_base); + machine->ram_size - initrd_base);if (initrd_size <0 ) {error_report ("could not load initial ram disk '%s'" , initrd_filename);@@ -576,7 +573,7 @@ static void ppc_prep_init(MachineState *machine) sysctrl->nvram = m48t59;/* Initialise NVRAM */ - PPC_NVRAM_set_params(m48t59, NVRAM_SIZE, "PREP", ram_size, + PPC_NVRAM_set_params(m48t59, NVRAM_SIZE, "PREP", machine->ram_size, ppc_boot_device, kernel_base, kernel_size, kernel_cmdline,@@ -596,6 +593,7 @@ static void prep_machine_init(MachineClass *mc) mc->default_boot_order ="cad" ; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("602" ); mc->default_display ="std" ; + mc->default_ram_id ="ppc_prep.ram" ; }static int prep_set_cmos_checksum (DeviceState *dev,void *opaque)@@ -814,6 +812,7 @@ static void ibm_40p_machine_init(MachineClass *mc) mc->init = ibm_40p_init; mc->max_cpus =1 ; mc->default_ram_size =128 * MiB; + mc->default_ram_id ="ppc_prep.ram" ; mc->block_default_type =IF_SCSI ; mc->default_boot_order ="c" ; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("604" );
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [PATCH v2 68/86] ppc:prep: use memdev for RAM
Quoted 9 lines · On Thu, 16 Jan 2020 14:26:58 +1000 David Gibson <[email protected]>…
Quoted 8 lines · Igor Mammedov
memory_region_allocate_system_memory()API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and usingMachineState::raminstead of manually initializing RAM memory region.
Quoted 6 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>Acked-by David Gibson <[email protected]>Although it's probably fairly pointless, since I'm looking to merge a patch removing prep entirely soon.
I know,
if that gets merged first, I'll just drop these on respin
Quoted 83 lines
Quoted 82 lines
---
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/ppc/prep.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)hw/ppc/prep.c +7
-8@@ -400,7 +400,6 @@ static int PPC_NVRAM_set_params (Nvram *nvram, uint16_t NVRAM_size,/* PowerPC PREP hardware initialisation */ static void ppc_prep_init (MachineState *machine) { -ram_addr_t ram_size = machine->ram_size;const char *kernel_filename = machine->kernel_filename;const char *kernel_cmdline = machine->kernel_cmdline;const char *initrd_filename = machine->initrd_filename;@@ -413,7 +412,6 @@ static void ppc_prep_init(MachineState *machine)MemoryRegion *xcsr =g_new (MemoryRegion,1 );#endif int linux_boot, i, nb_nics1; -MemoryRegion *ram =g_new (MemoryRegion,1 );uint32_t kernel_base, initrd_base;long kernel_size, initrd_size;DeviceState *dev;@@ -444,15 +442,14 @@ static void ppc_prep_init(MachineState *machine)qemu_register_reset (ppc_prep_reset, cpu); } -/* allocate RAM */ -memory_region_allocate_system_memory (ram,NULL ,"ppc_prep.ram" , ram_size); -memory_region_add_subregion (sysmem,0 , ram); +/* map RAM */ +memory_region_add_subregion (sysmem,0 , machine->ram);if (linux_boot) { kernel_base =KERNEL_LOAD_ADDR ;/* now we can load the kernel */ kernel_size =load_image_targphys (kernel_filename, kernel_base, - ram_size - kernel_base); + machine->ram_size - kernel_base);if (kernel_size <0 ) {error_report ("could not load kernel '%s'" , kernel_filename);exit (1 );@@ -461,7 +458,7 @@ static void ppc_prep_init(MachineState *machine)if (initrd_filename) { initrd_base =INITRD_LOAD_ADDR ; initrd_size =load_image_targphys (initrd_filename, initrd_base, - ram_size - initrd_base); + machine->ram_size - initrd_base);if (initrd_size <0 ) {error_report ("could not load initial ram disk '%s'" , initrd_filename);@@ -576,7 +573,7 @@ static void ppc_prep_init(MachineState *machine) sysctrl->nvram = m48t59;/* Initialise NVRAM */ - PPC_NVRAM_set_params(m48t59, NVRAM_SIZE, "PREP", ram_size, + PPC_NVRAM_set_params(m48t59, NVRAM_SIZE, "PREP", machine->ram_size, ppc_boot_device, kernel_base, kernel_size, kernel_cmdline,@@ -596,6 +593,7 @@ static void prep_machine_init(MachineClass *mc) mc->default_boot_order ="cad" ; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("602" ); mc->default_display ="std" ; + mc->default_ram_id ="ppc_prep.ram" ; }static int prep_set_cmos_checksum (DeviceState *dev,void *opaque)@@ -814,6 +812,7 @@ static void ibm_40p_machine_init(MachineClass *mc) mc->init = ibm_40p_init; mc->max_cpus =1 ; mc->default_ram_size =128 * MiB; + mc->default_ram_id ="ppc_prep.ram" ; mc->block_default_type =IF_SCSI ; mc->default_boot_order ="c" ; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("604" );
Re: [PATCH v2 68/86] ppc:prep: use memdev for RAM
In reply to Igor MammedovQuoted 83 lines · Igor Mammedov
memory_region_allocate_system_memory()API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and usingMachineState::raminstead of manually initializing RAM memory region.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/ppc/prep.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)hw/ppc/prep.c +6
-8@@ -400,7 +400,6 @@ static int PPC_NVRAM_set_params (Nvram *nvram, uint16_t NVRAM_size,/* PowerPC PREP hardware initialisation */ static void ppc_prep_init (MachineState *machine) { -ram_addr_t ram_size = machine->ram_size;const char *kernel_filename = machine->kernel_filename;const char *kernel_cmdline = machine->kernel_cmdline;const char *initrd_filename = machine->initrd_filename;@@ -413,7 +412,6 @@ static void ppc_prep_init(MachineState *machine)MemoryRegion *xcsr =g_new (MemoryRegion,1 );#endif int linux_boot, i, nb_nics1; -MemoryRegion *ram =g_new (MemoryRegion,1 );uint32_t kernel_base, initrd_base;long kernel_size, initrd_size;DeviceState *dev;@@ -444,15 +442,14 @@ static void ppc_prep_init(MachineState *machine)qemu_register_reset (ppc_prep_reset, cpu); } -/* allocate RAM */ -memory_region_allocate_system_memory (ram,NULL ,"ppc_prep.ram" , ram_size); -memory_region_add_subregion (sysmem,0 , ram); +/* map RAM */ +memory_region_add_subregion (sysmem,0 , machine->ram);if (linux_boot) { kernel_base =KERNEL_LOAD_ADDR ;/* now we can load the kernel */ kernel_size =load_image_targphys (kernel_filename, kernel_base, - ram_size - kernel_base); + machine->ram_size - kernel_base);if (kernel_size <0 ) {error_report ("could not load kernel '%s'" , kernel_filename);exit (1 );@@ -461,7 +458,7 @@ static void ppc_prep_init(MachineState *machine)if (initrd_filename) { initrd_base =INITRD_LOAD_ADDR ; initrd_size =load_image_targphys (initrd_filename, initrd_base, - ram_size - initrd_base); + machine->ram_size - initrd_base);if (initrd_size <0 ) {error_report ("could not load initial ram disk '%s'" , initrd_filename);@@ -576,7 +573,7 @@ static void ppc_prep_init(MachineState *machine) sysctrl->nvram = m48t59;/* Initialise NVRAM */ - PPC_NVRAM_set_params(m48t59, NVRAM_SIZE, "PREP", ram_size, + PPC_NVRAM_set_params(m48t59, NVRAM_SIZE, "PREP", machine->ram_size, ppc_boot_device, kernel_base, kernel_size, kernel_cmdline,@@ -596,6 +593,7 @@ static void prep_machine_init(MachineClass *mc) mc->default_boot_order ="cad" ; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("602" ); mc->default_display ="std" ; + mc->default_ram_id ="ppc_prep.ram" ; }static int prep_set_cmos_checksum (DeviceState *dev,void *opaque)
hw/ppc/prep.c static void ibm_40p_machine_init(MachineClass *mc) · line 818
Quoted 7 lines
hw/ppc/prep.c +1
-0@@ -814,6 +812,7 @@ static void ibm_40p_machine_init(MachineClass *mc) mc->init = ibm_40p_init; mc->max_cpus =1 ; mc->default_ram_size =128 * MiB; + mc->default_ram_id ="ppc_prep.ram" ; mc->block_default_type =IF_SCSI ; mc->default_boot_order ="c" ; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("604" );
Note that the prep machine is scheduled for removal soon (I believe Thomas has posted a patch on-list for this), but the 40p part looks fine.
ATB,
Mark.
PATCH v2 69/86 ppc:spapr: use memdev for RAM
In reply to Igor Mammedovmemory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing RAM memory region.
---
CC: [email protected]
CC: [email protected]
--- hw/ppc/spapr.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
hw/ppc/spapr.c +3 -5
@@ -2587,7 +2587,6 @@ static void spapr_machine_init(MachineState *machine)PCIHostState *phb;int i;MemoryRegion *sysmem =get_system_memory (); -MemoryRegion *ram =g_new (MemoryRegion,1 );hwaddr node0_size =spapr_node0_size (machine);long load_limit, fw_size;char *filename;
@@ -2766,10 +2765,8 @@ static void spapr_machine_init(MachineState *machine)kvmppc_enable_h_page_init (); } -/* allocate RAM */ -memory_region_allocate_system_memory (ram,NULL ,"ppc_spapr.ram" , - machine->ram_size); -memory_region_add_subregion (sysmem,0 , ram); +/* map RAM */ +memory_region_add_subregion (sysmem,0 , machine->ram);/* always allocate the device memory information */ machine->device_memory =g_malloc0 (sizeof (*machine->device_memory));
@@ -4344,6 +4341,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) mc->no_parallel =1 ; mc->default_boot_order ="" ; mc->default_ram_size =512 * MiB; + mc->default_ram_id ="ppc_spapr.ram" ; mc->default_display ="std" ; mc->kvm_type = spapr_kvm_type;machine_class_allow_dynamic_sysbus_dev (mc,TYPE_SPAPR_PCI_HOST_BRIDGE );
Signature · 1 line
2.7.4
Re: [PATCH v2 69/86] ppc:spapr: use memdev for RAM
Quoted 9 lines · Igor Mammedov
memory_region_allocate_system_memory()API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and usingMachineState::raminstead of manually initializing RAM memory region.Signed-off-by Igor Mammedov <[email protected]>
Quoted 40 lines
---
CC: [email protected]
CC: [email protected]--- hw/ppc/spapr.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)hw/ppc/spapr.c +3
-5@@ -2587,7 +2587,6 @@ static void spapr_machine_init(MachineState *machine)PCIHostState *phb;int i;MemoryRegion *sysmem =get_system_memory (); -MemoryRegion *ram =g_new (MemoryRegion,1 );hwaddr node0_size =spapr_node0_size (machine);long load_limit, fw_size;char *filename;@@ -2766,10 +2765,8 @@ static void spapr_machine_init(MachineState *machine)kvmppc_enable_h_page_init (); } -/* allocate RAM */ -memory_region_allocate_system_memory (ram,NULL ,"ppc_spapr.ram" , - machine->ram_size); -memory_region_add_subregion (sysmem,0 , ram); +/* map RAM */ +memory_region_add_subregion (sysmem,0 , machine->ram);/* always allocate the device memory information */ machine->device_memory =g_malloc0 (sizeof (*machine->device_memory));@@ -4344,6 +4341,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) mc->no_parallel =1 ; mc->default_boot_order ="" ; mc->default_ram_size =512 * MiB; + mc->default_ram_id ="ppc_spapr.ram" ; mc->default_display ="std" ; mc->kvm_type = spapr_kvm_type;machine_class_allow_dynamic_sysbus_dev (mc,TYPE_SPAPR_PCI_HOST_BRIDGE );
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
PATCH v2 70/86 ppc:virtex_ml507: remove unused arguments
In reply to Igor Mammedov---
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- hw/ppc/virtex_ml507.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
hw/ppc/virtex_ml507.c +2 -5
@@ -89,10 +89,7 @@ static void mmubooke_create_initial_mapping(CPUPPCState *env, tlb->PID =0 ; } -static PowerPCCPU *ppc440_init_xilinx (ram_addr_t *ram_size, -int do_init, -const char *cpu_type, -uint32_t sysclk) +static PowerPCCPU *ppc440_init_xilinx (const char *cpu_type,uint32_t sysclk) {PowerPCCPU *cpu;CPUPPCState *env;
@@ -213,7 +210,7 @@ static void virtex_init(MachineState *machine)int i;/* init CPUs */ - cpu =ppc440_init_xilinx (&ram_size,1 , machine->cpu_type,400000000 ); + cpu =ppc440_init_xilinx (machine->cpu_type,400000000 ); env = &cpu->env;if (env->mmu_model !=POWERPC_MMU_BOOKE ) {
Signature · 1 line
2.7.4
Re: [PATCH v2 70/86] ppc:virtex_ml507: remove unused arguments
Quoted 27 lines · Igor Mammedov
Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/ppc/virtex_ml507.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)hw/ppc/virtex_ml507.c +1
-4@@ -89,10 +89,7 @@ static void mmubooke_create_initial_mapping(CPUPPCState *env, tlb->PID =0 ; } -static PowerPCCPU *ppc440_init_xilinx (ram_addr_t *ram_size, -int do_init, -const char *cpu_type, -uint32_t sysclk) +static PowerPCCPU *ppc440_init_xilinx (const char *cpu_type,uint32_t sysclk) {PowerPCCPU *cpu;CPUPPCState *env;
hw/ppc/virtex_ml507.c static void virtex_init(MachineState *machine) · line 216
Quoted 8 lines
hw/ppc/virtex_ml507.c +1
-1@@ -213,7 +210,7 @@ static void virtex_init(MachineState *machine)int i;/* init CPUs */ - cpu =ppc440_init_xilinx (&ram_size,1 , machine->cpu_type,400000000 ); + cpu =ppc440_init_xilinx (machine->cpu_type,400000000 ); env = &cpu->env;if (env->mmu_model !=POWERPC_MMU_BOOKE ) {
PATCH v2 71/86 ppc:virtex_ml507: use memdev for RAM
In reply to Igor Mammedovmemory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing RAM memory region.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- hw/ppc/virtex_ml507.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
hw/ppc/virtex_ml507.c +5 -7
@@ -193,7 +193,6 @@ static int xilinx_load_device_tree(hwaddr addr,static void virtex_init (MachineState *machine) { -ram_addr_t ram_size = machine->ram_size;const char *kernel_filename = machine->kernel_filename;const char *kernel_cmdline = machine->kernel_cmdline;hwaddr initrd_base =0 ;
@@ -204,7 +203,6 @@ static void virtex_init(MachineState *machine)CPUPPCState *env;hwaddr ram_base =0 ;DriveInfo *dinfo; -MemoryRegion *phys_ram =g_new (MemoryRegion,1 );qemu_irq irq[32 ], *cpu_irq;int kernel_size;int i;
@@ -221,8 +219,7 @@ static void virtex_init(MachineState *machine)qemu_register_reset (main_cpu_reset, cpu); -memory_region_allocate_system_memory (phys_ram,NULL ,"ram" , ram_size); -memory_region_add_subregion (address_space_mem, ram_base, phys_ram); +memory_region_add_subregion (address_space_mem, ram_base, machine->ram); dinfo =drive_get (IF_PFLASH ,0 ,0 ); pflash_cfi01_register(PFLASH_BASEADDR, "virtex.flash", FLASH_SIZE,
@@ -265,7 +262,7 @@ static void virtex_init(MachineState *machine)/* If we failed loading ELF's try a raw image. */ kernel_size =load_image_targphys (kernel_filename, boot_offset, - ram_size); + machine->ram_size); boot_info.bootstrap_pc = boot_offset; high = boot_info.bootstrap_pc + kernel_size +8192 ; }
@@ -276,7 +273,7 @@ static void virtex_init(MachineState *machine)if (machine->initrd_filename) { initrd_base = high =ROUND_UP (high,4 ); initrd_size =load_image_targphys (machine->initrd_filename, - high, ram_size - high); + high, machine->ram_size - high);if (initrd_size <0 ) { error_report("couldn't load ram disk '%s'",
@@ -290,7 +287,7 @@ static void virtex_init(MachineState *machine) boot_info.fdt = high + (8192 *2 ); boot_info.fdt &= ~8191 ; -xilinx_load_device_tree (boot_info.fdt, ram_size, +xilinx_load_device_tree (boot_info.fdt, machine->ram_size, initrd_base, initrd_size, kernel_cmdline); }
@@ -302,6 +299,7 @@ static void virtex_machine_init(MachineClass *mc) mc->desc ="Xilinx Virtex ML507 reference design" ; mc->init = virtex_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("440-xilinx" ); + mc->default_ram_id ="ram" ; }DEFINE_MACHINE ("virtex-ml507" , virtex_machine_init)
Signature · 1 line
2.7.4
Re: [PATCH v2 71/86] ppc:virtex_ml507: use memdev for RAM
Quoted 76 lines · Igor Mammedov
memory_region_allocate_system_memory()API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and usingMachineState::raminstead of manually initializing RAM memory region.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/ppc/virtex_ml507.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)hw/ppc/virtex_ml507.c +4
-7@@ -193,7 +193,6 @@ static int xilinx_load_device_tree(hwaddr addr,static void virtex_init (MachineState *machine) { -ram_addr_t ram_size = machine->ram_size;const char *kernel_filename = machine->kernel_filename;const char *kernel_cmdline = machine->kernel_cmdline;hwaddr initrd_base =0 ;@@ -204,7 +203,6 @@ static void virtex_init(MachineState *machine)CPUPPCState *env;hwaddr ram_base =0 ;DriveInfo *dinfo; -MemoryRegion *phys_ram =g_new (MemoryRegion,1 );qemu_irq irq[32 ], *cpu_irq;int kernel_size;int i;@@ -221,8 +219,7 @@ static void virtex_init(MachineState *machine)qemu_register_reset (main_cpu_reset, cpu); -memory_region_allocate_system_memory (phys_ram,NULL ,"ram" , ram_size); -memory_region_add_subregion (address_space_mem, ram_base, phys_ram); +memory_region_add_subregion (address_space_mem, ram_base, machine->ram); dinfo =drive_get (IF_PFLASH ,0 ,0 ); pflash_cfi01_register(PFLASH_BASEADDR, "virtex.flash", FLASH_SIZE,@@ -265,7 +262,7 @@ static void virtex_init(MachineState *machine)/* If we failed loading ELF's try a raw image. */ kernel_size =load_image_targphys (kernel_filename, boot_offset, - ram_size); + machine->ram_size); boot_info.bootstrap_pc = boot_offset; high = boot_info.bootstrap_pc + kernel_size +8192 ; }@@ -276,7 +273,7 @@ static void virtex_init(MachineState *machine)if (machine->initrd_filename) { initrd_base = high =ROUND_UP (high,4 ); initrd_size =load_image_targphys (machine->initrd_filename, - high, ram_size - high); + high, machine->ram_size - high);if (initrd_size <0 ) { error_report("couldn't load ram disk '%s'",@@ -290,7 +287,7 @@ static void virtex_init(MachineState *machine) boot_info.fdt = high + (8192 *2 ); boot_info.fdt &= ~8191 ; -xilinx_load_device_tree (boot_info.fdt, ram_size, +xilinx_load_device_tree (boot_info.fdt, machine->ram_size, initrd_base, initrd_size, kernel_cmdline); }
hw/ppc/virtex_ml507.c static void virtex_machine_init(MachineClass *mc) · line 305
Quoted 7 lines
hw/ppc/virtex_ml507.c +1
-0@@ -302,6 +299,7 @@ static void virtex_machine_init(MachineClass *mc) mc->desc ="Xilinx Virtex ML507 reference design" ; mc->init = virtex_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("440-xilinx" ); + mc->default_ram_id ="ram" ; }DEFINE_MACHINE ("virtex-ml507" , virtex_machine_init)
Re: [PATCH v2 71/86] ppc:virtex_ml507: use memdev for RAM
In reply to Igor MammedovQuoted 9 lines · Igor Mammedov
memory_region_allocate_system_memory()API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and usingMachineState::raminstead of manually initializing RAM memory region.Signed-off-by Igor Mammedov <[email protected]>
Quoted 73 lines
---
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/ppc/virtex_ml507.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)hw/ppc/virtex_ml507.c +5
-7@@ -193,7 +193,6 @@ static int xilinx_load_device_tree(hwaddr addr,static void virtex_init (MachineState *machine) { -ram_addr_t ram_size = machine->ram_size;const char *kernel_filename = machine->kernel_filename;const char *kernel_cmdline = machine->kernel_cmdline;hwaddr initrd_base =0 ;@@ -204,7 +203,6 @@ static void virtex_init(MachineState *machine)CPUPPCState *env;hwaddr ram_base =0 ;DriveInfo *dinfo; -MemoryRegion *phys_ram =g_new (MemoryRegion,1 );qemu_irq irq[32 ], *cpu_irq;int kernel_size;int i;@@ -221,8 +219,7 @@ static void virtex_init(MachineState *machine)qemu_register_reset (main_cpu_reset, cpu); -memory_region_allocate_system_memory (phys_ram,NULL ,"ram" , ram_size); -memory_region_add_subregion (address_space_mem, ram_base, phys_ram); +memory_region_add_subregion (address_space_mem, ram_base, machine->ram); dinfo =drive_get (IF_PFLASH ,0 ,0 ); pflash_cfi01_register(PFLASH_BASEADDR, "virtex.flash", FLASH_SIZE,@@ -265,7 +262,7 @@ static void virtex_init(MachineState *machine)/* If we failed loading ELF's try a raw image. */ kernel_size =load_image_targphys (kernel_filename, boot_offset, - ram_size); + machine->ram_size); boot_info.bootstrap_pc = boot_offset; high = boot_info.bootstrap_pc + kernel_size +8192 ; }@@ -276,7 +273,7 @@ static void virtex_init(MachineState *machine)if (machine->initrd_filename) { initrd_base = high =ROUND_UP (high,4 ); initrd_size =load_image_targphys (machine->initrd_filename, - high, ram_size - high); + high, machine->ram_size - high);if (initrd_size <0 ) { error_report("couldn't load ram disk '%s'",@@ -290,7 +287,7 @@ static void virtex_init(MachineState *machine) boot_info.fdt = high + (8192 *2 ); boot_info.fdt &= ~8191 ; -xilinx_load_device_tree (boot_info.fdt, ram_size, +xilinx_load_device_tree (boot_info.fdt, machine->ram_size, initrd_base, initrd_size, kernel_cmdline); }@@ -302,6 +299,7 @@ static void virtex_machine_init(MachineClass *mc) mc->desc ="Xilinx Virtex ML507 reference design" ; mc->init = virtex_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("440-xilinx" ); + mc->default_ram_id ="ram" ; }DEFINE_MACHINE ("virtex-ml507" , virtex_machine_init)
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [PATCH v2 71/86] ppc:virtex_ml507: use memdev for RAM
In reply to Igor MammedovQuoted 9 lines · Igor Mammedov
memory_region_allocate_system_memory()API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and usingMachineState::raminstead of manually initializing RAM memory region.Signed-off-by Igor Mammedov <[email protected]>
Since this is (AFAICT) independent of the main purpose of your series, I've also applied it to my ppc-for-5.0 tree. If we get a conflict because of that it should be easy to resolve.
Quoted 73 lines
---
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/ppc/virtex_ml507.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)hw/ppc/virtex_ml507.c +5
-7@@ -193,7 +193,6 @@ static int xilinx_load_device_tree(hwaddr addr,static void virtex_init (MachineState *machine) { -ram_addr_t ram_size = machine->ram_size;const char *kernel_filename = machine->kernel_filename;const char *kernel_cmdline = machine->kernel_cmdline;hwaddr initrd_base =0 ;@@ -204,7 +203,6 @@ static void virtex_init(MachineState *machine)CPUPPCState *env;hwaddr ram_base =0 ;DriveInfo *dinfo; -MemoryRegion *phys_ram =g_new (MemoryRegion,1 );qemu_irq irq[32 ], *cpu_irq;int kernel_size;int i;@@ -221,8 +219,7 @@ static void virtex_init(MachineState *machine)qemu_register_reset (main_cpu_reset, cpu); -memory_region_allocate_system_memory (phys_ram,NULL ,"ram" , ram_size); -memory_region_add_subregion (address_space_mem, ram_base, phys_ram); +memory_region_add_subregion (address_space_mem, ram_base, machine->ram); dinfo =drive_get (IF_PFLASH ,0 ,0 ); pflash_cfi01_register(PFLASH_BASEADDR, "virtex.flash", FLASH_SIZE,@@ -265,7 +262,7 @@ static void virtex_init(MachineState *machine)/* If we failed loading ELF's try a raw image. */ kernel_size =load_image_targphys (kernel_filename, boot_offset, - ram_size); + machine->ram_size); boot_info.bootstrap_pc = boot_offset; high = boot_info.bootstrap_pc + kernel_size +8192 ; }@@ -276,7 +273,7 @@ static void virtex_init(MachineState *machine)if (machine->initrd_filename) { initrd_base = high =ROUND_UP (high,4 ); initrd_size =load_image_targphys (machine->initrd_filename, - high, ram_size - high); + high, machine->ram_size - high);if (initrd_size <0 ) { error_report("couldn't load ram disk '%s'",@@ -290,7 +287,7 @@ static void virtex_init(MachineState *machine) boot_info.fdt = high + (8192 *2 ); boot_info.fdt &= ~8191 ; -xilinx_load_device_tree (boot_info.fdt, ram_size, +xilinx_load_device_tree (boot_info.fdt, machine->ram_size, initrd_base, initrd_size, kernel_cmdline); }@@ -302,6 +299,7 @@ static void virtex_machine_init(MachineClass *mc) mc->desc ="Xilinx Virtex ML507 reference design" ; mc->init = virtex_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("440-xilinx" ); + mc->default_ram_id ="ram" ; }DEFINE_MACHINE ("virtex-ml507" , virtex_machine_init)
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [PATCH v2 71/86] ppc:virtex_ml507: use memdev for RAM
Quoted 9 lines · On Thu, 16 Jan 2020 14:31:57 +1000 David Gibson <[email protected]>…
Quoted 8 lines · Igor Mammedov
memory_region_allocate_system_memory()API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and usingMachineState::raminstead of manually initializing RAM memory region.
Quoted 7 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>Acked-by David Gibson <[email protected]>Since this is (AFAICT) independent of the main purpose of your series, I've also applied it to my ppc-for-5.0 tree. If we get a conflict because of that it should be easy to resolve.
this patch depends on 1-5/86 as prerequsites,
so pls drop it from your queue.
What could be merged independently is patches with following phrases in title:
"drop RAM size fixup"
"add RAM size checks"
that should help by reducing size of this series a bit.
Quoted 74 lines
Quoted 73 lines
---
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/ppc/virtex_ml507.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)hw/ppc/virtex_ml507.c +5
-7@@ -193,7 +193,6 @@ static int xilinx_load_device_tree(hwaddr addr,static void virtex_init (MachineState *machine) { -ram_addr_t ram_size = machine->ram_size;const char *kernel_filename = machine->kernel_filename;const char *kernel_cmdline = machine->kernel_cmdline;hwaddr initrd_base =0 ;@@ -204,7 +203,6 @@ static void virtex_init(MachineState *machine)CPUPPCState *env;hwaddr ram_base =0 ;DriveInfo *dinfo; -MemoryRegion *phys_ram =g_new (MemoryRegion,1 );qemu_irq irq[32 ], *cpu_irq;int kernel_size;int i;@@ -221,8 +219,7 @@ static void virtex_init(MachineState *machine)qemu_register_reset (main_cpu_reset, cpu); -memory_region_allocate_system_memory (phys_ram,NULL ,"ram" , ram_size); -memory_region_add_subregion (address_space_mem, ram_base, phys_ram); +memory_region_add_subregion (address_space_mem, ram_base, machine->ram); dinfo =drive_get (IF_PFLASH ,0 ,0 ); pflash_cfi01_register(PFLASH_BASEADDR, "virtex.flash", FLASH_SIZE,@@ -265,7 +262,7 @@ static void virtex_init(MachineState *machine)/* If we failed loading ELF's try a raw image. */ kernel_size =load_image_targphys (kernel_filename, boot_offset, - ram_size); + machine->ram_size); boot_info.bootstrap_pc = boot_offset; high = boot_info.bootstrap_pc + kernel_size +8192 ; }@@ -276,7 +273,7 @@ static void virtex_init(MachineState *machine)if (machine->initrd_filename) { initrd_base = high =ROUND_UP (high,4 ); initrd_size =load_image_targphys (machine->initrd_filename, - high, ram_size - high); + high, machine->ram_size - high);if (initrd_size <0 ) { error_report("couldn't load ram disk '%s'",@@ -290,7 +287,7 @@ static void virtex_init(MachineState *machine) boot_info.fdt = high + (8192 *2 ); boot_info.fdt &= ~8191 ; -xilinx_load_device_tree (boot_info.fdt, ram_size, +xilinx_load_device_tree (boot_info.fdt, machine->ram_size, initrd_base, initrd_size, kernel_cmdline); }@@ -302,6 +299,7 @@ static void virtex_machine_init(MachineClass *mc) mc->desc ="Xilinx Virtex ML507 reference design" ; mc->init = virtex_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("440-xilinx" ); + mc->default_ram_id ="ram" ; }DEFINE_MACHINE ("virtex-ml507" , virtex_machine_init)
PATCH v2 72/86 sparc:leon3: use memdev for RAM
In reply to Igor Mammedovmemory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing RAM memory region.
--- hw/sparc/leon3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
hw/sparc/leon3.c +3 -3
@@ -189,7 +189,6 @@ static void leon3_generic_hw_init(MachineState *machine)SPARCCPU *cpu;CPUSPARCState *env;MemoryRegion *address_space_mem =get_system_memory (); -MemoryRegion *ram =g_new (MemoryRegion,1 );MemoryRegion *prom =g_new (MemoryRegion,1 );int ret;char *filename;
@@ -251,8 +250,8 @@ static void leon3_generic_hw_init(MachineState *machine)exit (1 ); } -memory_region_allocate_system_memory (ram,NULL ,"leon3.ram" , ram_size); -memory_region_add_subregion (address_space_mem,LEON3_RAM_OFFSET , ram); +memory_region_add_subregion (address_space_mem,LEON3_RAM_OFFSET , + machine->ram);/* Allocate BIOS */ prom_size =8 * MiB;
@@ -358,6 +357,7 @@ static void leon3_generic_machine_init(MachineClass *mc) mc->desc ="Leon-3 generic" ; mc->init = leon3_generic_hw_init; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("LEON3" ); + mc->default_ram_id ="leon3.ram" ; }DEFINE_MACHINE ("leon3_generic" , leon3_generic_machine_init)
Signature · 1 line
2.7.4
PATCH v2 73/86 sparc:sun4m: use memdev for RAM
In reply to Igor Mammedovmemory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing RAM memory region.
Patch moves ram size check into sun4m_hw_init() and drops ram_init() moving remainder to sun4m_hw_init() as well, as it was the only place that called it.
Also it rewrites impl. of RamDevice a little bit, which could serve as an example of frontend device for RAM backend. (Caveats are:
1. it doesn't check for memdev backend being mapped since it's been usurped by generic machine to handle majority of machines which don't have RAM frontend device
2. it still lacks 'addr' property and still has hardcoded sysbus_mmio_map() in board init. If done right, board should set 'addr' property and bus/machine plug handler should map it during device realize time.
)
Further improvements were left as exercise for the future, since frontends are out scope of RAM conversion to memdev.
---
CC: [email protected]
CC: [email protected]
--- hw/sparc/sun4m.c | 73 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 37 deletions(-)
hw/sparc/sun4m.c +36 -37
@@ -777,63 +777,42 @@ static const TypeInfo prom_info = {typedef struct RamDevice {SysBusDevice parent_obj; - -MemoryRegion ram; -uint64_t size; +HostMemoryBackend *memdev; }RamDevice ;/* System RAM */ static void ram_realize (DeviceState *dev,Error **errp) {RamDevice *d =SUN4M_RAM (dev); -SysBusDevice *sbd =SYS_BUS_DEVICE (dev); +MemoryRegion *ram =host_memory_backend_get_memory (d->memdev); -memory_region_allocate_system_memory (&d->ram,OBJECT (d),"sun4m.ram" , - d->size); -sysbus_init_mmio (sbd, &d->ram); +sysbus_init_mmio (SYS_BUS_DEVICE (dev), ram); } -static void ram_init (hwaddr addr,ram_addr_t RAM_size, -uint64_t max_mem) +static void ram_initfn (Object *obj) { -DeviceState *dev; -SysBusDevice *s; -RamDevice *d; - -/* allocate RAM */ -if ((uint64_t )RAM_size > max_mem) { -error_report ("Too much memory for this machine: %" PRId64"," -" maximum %" PRId64, - RAM_size / MiB, max_mem / MiB); -exit (1 ); - } - dev =qdev_create (NULL ,"memory" ); - s =SYS_BUS_DEVICE (dev); - - d =SUN4M_RAM (dev); - d->size = RAM_size; -qdev_init_nofail (dev); - -sysbus_mmio_map (s,0 , addr); +RamDevice *d =SUN4M_RAM (obj); +object_property_add_link (obj,"memdev" ,TYPE_MEMORY_BACKEND , + (Object **)&d->memdev, + object_property_allow_set_link, +OBJ_PROP_LINK_STRONG , &error_abort); +object_property_set_description (obj,"memdev" ,"Set RAM backend" +"Valid value is ID of a hostmem backend" , + &error_abort); } -static Property ram_properties[] = { -DEFINE_PROP_UINT64 ("size" , RamDevice, size,0 ), -DEFINE_PROP_END_OF_LIST (), -}; -static void ram_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = ram_realize; - dc->props = ram_properties; }static const TypeInfo ram_info = { .name =TYPE_SUN4M_MEMORY , .parent =TYPE_SYS_BUS_DEVICE , .instance_size =sizeof (RamDevice), + .instance_init = ram_initfn, .class_init = ram_class_init, };
@@ -880,6 +859,13 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,unsigned int smp_cpus = machine->smp.cpus;unsigned int max_cpus = machine->smp.max_cpus; +if (machine->ram_size > hwdef->max_mem) { +error_report ("Too much memory for this machine: %" PRId64"," +" maximum %" PRId64, + machine->ram_size / MiB, hwdef->max_mem / MiB); +exit (1 ); + } +/* init CPUs */ for (i =0 ; i < smp_cpus; i++) {cpu_devinit (machine->cpu_type, i, hwdef->slavio_base, &cpu_irqs[i]);
@@ -888,9 +874,13 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,for (i = smp_cpus; i <MAX_CPUS ; i++) cpu_irqs[i] =qemu_allocate_irqs (dummy_cpu_set_irq,NULL ,MAX_PILS ); +/* Create and map RAM frontend */ + dev =qdev_create (NULL ,"memory" ); +object_property_set_link (OBJECT (dev),OBJECT (machine->ram_memdev), +"memdev" , &error_fatal); +qdev_init_nofail (dev); +sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,0 ); -/* set up devices */ -ram_init (0 , machine->ram_size, hwdef->max_mem);/* models without ECC don't trap when missing ram is accessed */ if (!hwdef->ecc_base) {empty_slot_init (machine->ram_size, hwdef->max_mem - machine->ram_size);
@@ -1078,7 +1068,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,fw_cfg_add_i16 (fw_cfg,FW_CFG_NB_CPUS , (uint16_t )smp_cpus);fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size); +fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )machine->ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , hwdef->machine_id);fw_cfg_add_i16 (fw_cfg,FW_CFG_SUN4M_DEPTH , graphic_depth);fw_cfg_add_i16 (fw_cfg,FW_CFG_SUN4M_WIDTH , graphic_width);
@@ -1415,6 +1405,7 @@ static void ss5_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("Fujitsu-MB86904" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss5_type = {
@@ -1434,6 +1425,7 @@ static void ss10_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-SuperSparc-II" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss10_type = {
@@ -1453,6 +1445,7 @@ static void ss600mp_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-SuperSparc-II" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss600mp_type = {
@@ -1472,6 +1465,7 @@ static void ss20_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-SuperSparc-II" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss20_type = {
@@ -1490,6 +1484,7 @@ static void voyager_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("Fujitsu-MB86904" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo voyager_type = {
@@ -1508,6 +1503,7 @@ static void ss_lx_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-MicroSparc-I" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss_lx_type = {
@@ -1526,6 +1522,7 @@ static void ss4_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("Fujitsu-MB86904" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss4_type = {
@@ -1544,6 +1541,7 @@ static void scls_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-MicroSparc-I" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo scls_type = {
@@ -1562,6 +1560,7 @@ static void sbook_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-MicroSparc-I" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo sbook_type = {
Signature · 1 line
2.7.4
Re: [PATCH v2 73/86] sparc:sun4m: use memdev for RAM
Quoted 219 lines · Igor Mammedov
memory_region_allocate_system_memory()API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and usingMachineState::raminstead of manually initializing RAM memory region.Patch moves ram size check into
sun4m_hw_init()and dropsram_init()moving remainder tosun4m_hw_init()as well, as it was the only place that called it.Also it rewrites impl. of RamDevice a little bit, which could serve as an example of frontend device for RAM backend. (Caveats are:
1. it doesn't check for memdev backend being mapped since it's been usurped by generic machine to handle majority of machines which don't have RAM frontend device
2. it still lacks 'addr' property and still has hardcodedsysbus_mmio_map()in board init. If done right, board should set 'addr' property and bus/machine plug handler should map it during device realize time.
)
Further improvements were left as exercise for the future, since frontends are out scope of RAM conversion to memdev.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]--- hw/sparc/sun4m.c | 73 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 37 deletions(-)hw/sparc/sun4m.c +35
-37@@ -777,63 +777,42 @@ static const TypeInfo prom_info = {typedef struct RamDevice {SysBusDevice parent_obj; - -MemoryRegion ram; -uint64_t size; +HostMemoryBackend *memdev; }RamDevice ;/* System RAM */ static void ram_realize (DeviceState *dev,Error **errp) {RamDevice *d =SUN4M_RAM (dev); -SysBusDevice *sbd =SYS_BUS_DEVICE (dev); +MemoryRegion *ram =host_memory_backend_get_memory (d->memdev); -memory_region_allocate_system_memory (&d->ram,OBJECT (d),"sun4m.ram" , - d->size); -sysbus_init_mmio (sbd, &d->ram); +sysbus_init_mmio (SYS_BUS_DEVICE (dev), ram); } -static void ram_init (hwaddr addr,ram_addr_t RAM_size, -uint64_t max_mem) +static void ram_initfn (Object *obj) { -DeviceState *dev; -SysBusDevice *s; -RamDevice *d; - -/* allocate RAM */ -if ((uint64_t )RAM_size > max_mem) { -error_report ("Too much memory for this machine: %" PRId64"," -" maximum %" PRId64, - RAM_size / MiB, max_mem / MiB); -exit (1 ); - } - dev =qdev_create (NULL ,"memory" ); - s =SYS_BUS_DEVICE (dev); - - d =SUN4M_RAM (dev); - d->size = RAM_size; -qdev_init_nofail (dev); - -sysbus_mmio_map (s,0 , addr); +RamDevice *d =SUN4M_RAM (obj); +object_property_add_link (obj,"memdev" ,TYPE_MEMORY_BACKEND , + (Object **)&d->memdev, + object_property_allow_set_link, +OBJ_PROP_LINK_STRONG , &error_abort); +object_property_set_description (obj,"memdev" ,"Set RAM backend" +"Valid value is ID of a hostmem backend" , + &error_abort); } -static Property ram_properties[] = { -DEFINE_PROP_UINT64 ("size" , RamDevice, size,0 ), -DEFINE_PROP_END_OF_LIST (), -}; -static void ram_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = ram_realize; - dc->props = ram_properties; }static const TypeInfo ram_info = { .name =TYPE_SUN4M_MEMORY , .parent =TYPE_SYS_BUS_DEVICE , .instance_size =sizeof (RamDevice), + .instance_init = ram_initfn, .class_init = ram_class_init, };@@ -880,6 +859,13 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,unsigned int smp_cpus = machine->smp.cpus;unsigned int max_cpus = machine->smp.max_cpus; +if (machine->ram_size > hwdef->max_mem) { +error_report ("Too much memory for this machine: %" PRId64"," +" maximum %" PRId64, + machine->ram_size / MiB, hwdef->max_mem / MiB); +exit (1 ); + } +/* init CPUs */ for (i =0 ; i < smp_cpus; i++) {cpu_devinit (machine->cpu_type, i, hwdef->slavio_base, &cpu_irqs[i]);@@ -888,9 +874,13 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,for (i = smp_cpus; i <MAX_CPUS ; i++) cpu_irqs[i] =qemu_allocate_irqs (dummy_cpu_set_irq,NULL ,MAX_PILS ); +/* Create and map RAM frontend */ + dev =qdev_create (NULL ,"memory" ); +object_property_set_link (OBJECT (dev),OBJECT (machine->ram_memdev), +"memdev" , &error_fatal); +qdev_init_nofail (dev); +sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,0 ); -/* set up devices */ -ram_init (0 , machine->ram_size, hwdef->max_mem);/* models without ECC don't trap when missing ram is accessed */ if (!hwdef->ecc_base) {empty_slot_init (machine->ram_size, hwdef->max_mem - machine->ram_size);@@ -1078,7 +1068,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,fw_cfg_add_i16 (fw_cfg,FW_CFG_NB_CPUS , (uint16_t )smp_cpus);fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size); +fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )machine->ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , hwdef->machine_id);fw_cfg_add_i16 (fw_cfg,FW_CFG_SUN4M_DEPTH , graphic_depth);fw_cfg_add_i16 (fw_cfg,FW_CFG_SUN4M_WIDTH , graphic_width);@@ -1415,6 +1405,7 @@ static void ss5_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("Fujitsu-MB86904" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss5_type = {@@ -1434,6 +1425,7 @@ static void ss10_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-SuperSparc-II" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss10_type = {@@ -1453,6 +1445,7 @@ static void ss600mp_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-SuperSparc-II" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss600mp_type = {@@ -1472,6 +1465,7 @@ static void ss20_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-SuperSparc-II" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss20_type = {@@ -1490,6 +1484,7 @@ static void voyager_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("Fujitsu-MB86904" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo voyager_type = {@@ -1508,6 +1503,7 @@ static void ss_lx_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-MicroSparc-I" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss_lx_type = {@@ -1526,6 +1522,7 @@ static void ss4_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("Fujitsu-MB86904" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo ss4_type = {@@ -1544,6 +1541,7 @@ static void scls_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-MicroSparc-I" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo scls_type = {
hw/sparc/sun4m.c static void sbook_class_init(ObjectClass *oc, void *data) · line 1566
Quoted 7 lines
hw/sparc/sun4m.c +1
-0@@ -1562,6 +1560,7 @@ static void sbook_class_init(ObjectClass *oc, void *data) mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("TI-MicroSparc-I" ); mc->default_display ="tcx" ; + mc->default_ram_id ="sun4m.ram" ; }static const TypeInfo sbook_type = {
As you say it's a little bit more complicated here, however it looks sensible to me.
ATB,
Mark.
PATCH v2 74/86 sparc:niagara: use memdev for RAM
In reply to Igor Mammedovmemory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing
MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing RAM memory region.
--- hw/sparc64/niagara.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
hw/sparc64/niagara.c +2 -5
@@ -40,7 +40,6 @@ typedef struct NiagaraBoardState { MemoryRegion hv_ram; - MemoryRegion partition_ram; MemoryRegion nvram; MemoryRegion md_rom; MemoryRegion hv_rom;
@@ -111,11 +110,8 @@ static void niagara_init(MachineState *machine) NIAGARA_HV_RAM_SIZE, &error_fatal);memory_region_add_subregion (sysmem,NIAGARA_HV_RAM_BASE , &s->hv_ram); -memory_region_allocate_system_memory (&s->partition_ram,NULL , -"sun4v-partition.ram" , - machine->ram_size);memory_region_add_subregion (sysmem,NIAGARA_PARTITION_RAM_BASE , - &s->partition_ram); + machine->ram);memory_region_init_ram (&s->nvram,NULL ,"sun4v.nvram" ,NIAGARA_NVRAM_SIZE , &error_fatal);
@@ -173,6 +169,7 @@ static void niagara_class_init(ObjectClass *oc, void *data) mc->max_cpus =1 ;/* XXX for now */ mc->default_boot_order ="c" ; mc->default_cpu_type =SPARC_CPU_TYPE_NAME ("Sun-UltraSparc-T1" ); + mc->default_ram_id ="sun4v-partition.ram" ; }static const TypeInfo niagara_type = {
Signature · 1 line
2.7.4
PATCH v2 75/86 remove no longer used memory_region_allocate_system_memory()
In reply to Igor Mammedovall boards were switched to using memdev backend for main RAM, so we can drop no longer used memory_region_allocate_system_memory()
---
CC: [email protected]
CC: [email protected]
--- include/hw/boards.h | 32 -------------------------------- hw/core/numa.c | 34 ---------------------------------- 2 files changed, 66 deletions(-)
include/hw/boards.h +0 -32
@@ -12,38 +12,6 @@#include "qom/object.h" #include "hw/core/cpu.h" -/** -* memory_region_allocate_system_memory - Allocate a board's main memory -* @mr: the #MemoryRegion to be initialized -* @owner: the object that tracks the region's reference count -* @name: name of the memory region -* @ram_size: size of the region in bytes -* -* This function allocates the main memory for a board model, and -* initializes @mr appropriately. It also arranges for the memory -* to be migrated (by calling vmstate_register_ram_global()). -* -* Memory allocated via this function will be backed with the memory -* backend the user provided using "-mem-path" or "-numa node,memdev=..." -* if appropriate; this is typically used to cause host huge pages to be -* used. This function should therefore be called by a board exactly once, -* for the primary or largest RAM area it implements. -* -* For boards where the major RAM is split into two parts in the memory -* map, you can deal with this by calling memory_region_allocate_system_memory() -* once to get a MemoryRegion with enough RAM for both parts, and then -* creating alias MemoryRegions via memory_region_init_alias() which -* alias into different parts of the RAM MemoryRegion and can be mapped -* into the memory map in the appropriate places. -* -* Smaller pieces of memory (display RAM, static RAMs, etc) don't need -* to be backed via the -mem-path memory backend and can simply -* be created via memory_region_init_ram(). -*/ -void memory_region_allocate_system_memory (MemoryRegion *mr,Object *owner, -const char *name, -uint64_t ram_size); -#define TYPE_MACHINE_SUFFIX "-machine"/* Machine class name that needs to be used for class-name-based machine
hw/core/numa.c +0 -34
@@ -806,40 +806,6 @@ void numa_cpu_pre_plug(const CPUArchId *slot, DeviceState *dev, Error **errp) } } -static void allocate_system_memory_nonnuma (MemoryRegion *mr,Object *owner, -const char *name, -uint64_t ram_size) -{ -if (mem_path) { -#ifdef __linux__ -memory_region_init_ram_from_file (mr, owner, name, ram_size,0 ,0 , - mem_path, &error_fatal); -#else -fprintf (stderr,"-mem-path not supported on this host\n" ); -exit (1 ); -#endif - }else { -memory_region_init_ram_nomigrate (mr, owner, name, ram_size, &error_fatal); - } -vmstate_register_ram_global (mr); -} - -void memory_region_allocate_system_memory (MemoryRegion *mr,Object *owner, -const char *name, -uint64_t ram_size) -{ -MachineState *ms =MACHINE (qdev_get_machine ()); - -if (ms->numa_state ==NULL || - ms->numa_state->num_nodes ==0 ||numa_uses_legacy_mem ()) { -allocate_system_memory_nonnuma (mr, owner, name, ram_size); -return ; - } - -memory_region_init (mr, owner, name, ram_size); -numa_init_memdev_container (ms, mr); -} -static void numa_stat_memory_devices (NumaNodeMem node_mem[]) {MemoryDeviceInfoList *info_list =qmp_memory_device_list ();
Signature · 1 line
2.7.4
PATCH v2 76/86 post conversion default_ram_id cleanup
In reply to Igor MammedovWith default_ram_id is always defined, simplify 'if' conditions in vl.c and numa.c
while at it set
MachineClass::default_ram_id = "ram"
and clean up several boards that use "ram" id
--- hw/alpha/dp264.c | 1 - hw/arm/aspeed.c | 1 - hw/arm/digic_boards.c | 1 - hw/arm/raspi.c | 2 -- hw/core/machine.c | 1 + hw/core/null-machine.c | 1 - hw/core/numa.c | 2 +- hw/hppa/machine.c | 1 - hw/ppc/virtex_ml507.c | 1 - vl.c | 1 - 10 files changed, 2 insertions(+), 10 deletions(-)
hw/alpha/dp264.c +0 -1
@@ -183,7 +183,6 @@ static void clipper_machine_init(MachineClass *mc) mc->max_cpus =4 ; mc->is_default =1 ; mc->default_cpu_type =ALPHA_CPU_TYPE_NAME ("ev67" ); - mc->default_ram_id ="ram" ; }DEFINE_MACHINE ("clipper" , clipper_machine_init)
hw/arm/aspeed.c +0 -1
@@ -391,7 +391,6 @@ static void aspeed_machine_class_init(ObjectClass *oc, void *data) mc->no_floppy =1 ; mc->no_cdrom =1 ; mc->no_parallel =1 ; - mc->default_ram_id ="ram" ; }static void aspeed_machine_palmetto_class_init (ObjectClass *oc,void *data)
hw/arm/digic_boards.c +0 -1
@@ -149,7 +149,6 @@ static void canon_a1100_machine_init(MachineClass *mc) mc->init = &canon_a1100_init; mc->ignore_memory_transaction_failures = true; mc->default_ram_size =64 * MiB; - mc->default_ram_id ="ram" ; }DEFINE_MACHINE ("canon-a1100" , canon_a1100_machine_init)
hw/arm/raspi.c +0 -2
@@ -223,7 +223,6 @@ static void raspi2_machine_init(MachineClass *mc) mc->min_cpus =BCM283X_NCPUS ; mc->default_cpus =BCM283X_NCPUS ; mc->default_ram_size =1 * GiB; - mc->default_ram_id ="ram" ; mc->ignore_memory_transaction_failures = true; };DEFINE_MACHINE ("raspi2" , raspi2_machine_init)
@@ -246,7 +245,6 @@ static void raspi3_machine_init(MachineClass *mc) mc->min_cpus =BCM283X_NCPUS ; mc->default_cpus =BCM283X_NCPUS ; mc->default_ram_size =1 * GiB; - mc->default_ram_id ="ram" ; } DEFINE_MACHINE("raspi3", raspi3_machine_init)#endif
hw/core/machine.c +1 -0
@@ -743,6 +743,7 @@ static void machine_class_init(ObjectClass *oc, void *data)/* Default 128 MB as guest ram size */ mc->default_ram_size =128 * MiB; + mc->default_ram_id ="ram" ; mc->rom_file_has_mr = true; mc->smp_parse = smp_parse;
hw/core/null-machine.c +0 -1
@@ -49,7 +49,6 @@ static void machine_none_machine_init(MachineClass *mc) mc->init = machine_none_init; mc->max_cpus =1 ; mc->default_ram_size =0 ; - mc->default_ram_id ="ram" ; }DEFINE_MACHINE ("none" , machine_none_machine_init)
hw/core/numa.c +1 -1
@@ -756,7 +756,7 @@ void numa_complete_configuration(MachineState *ms)exit (1 ); } -if (!numa_uses_legacy_mem () && mc->default_ram_id) { +if (!numa_uses_legacy_mem ()) { ms->ram =g_new (MemoryRegion,1 );memory_region_init (ms->ram,OBJECT (ms), mc->default_ram_id, ram_size);
hw/hppa/machine.c +0 -1
@@ -277,7 +277,6 @@ static void machine_hppa_machine_init(MachineClass *mc) mc->is_default =1 ; mc->default_ram_size =512 * MiB; mc->default_boot_order ="cd" ; - mc->default_ram_id ="ram" ; }DEFINE_MACHINE ("hppa" , machine_hppa_machine_init)
hw/ppc/virtex_ml507.c +0 -1
@@ -299,7 +299,6 @@ static void virtex_machine_init(MachineClass *mc) mc->desc ="Xilinx Virtex ML507 reference design" ; mc->init = virtex_init; mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("440-xilinx" ); - mc->default_ram_id ="ram" ; }DEFINE_MACHINE ("virtex-ml507" , virtex_machine_init)
vl.c +0 -1
@@ -4305,7 +4305,6 @@ int main(int argc, char **argv, char **envp)if (numa_uses_legacy_mem () && machine_class->default_ram_size && - machine_class->default_ram_id && !current_machine->ram_memdev) {create_default_memdev (current_machine, mem_path, mem_prealloc); }
Signature · 1 line
2.7.4
PATCH v2 77/86 exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize()
In reply to Igor MammedovSince all RAM is backed by hostmem backends, drop
global -mem-path invariant and simplify code.
---
CC: [email protected]
CC: [email protected]
--- exec.c | 51 +++++---------------------------------------------- 1 file changed, 5 insertions(+), 46 deletions(-)
exec.c +5 -46
@@ -1667,60 +1667,19 @@ static int find_max_backend_pagesize(Object *obj, void *opaque)*/ long qemu_minrampagesize (void ) { -long hpsize =LONG_MAX ; -long mainrampagesize; -Object *memdev_root; -MachineState *ms =MACHINE (qdev_get_machine ()); - - mainrampagesize =qemu_mempath_getpagesize (mem_path); - -/* it's possible we have memory-backend objects with -* hugepage-backed RAM. these may get mapped into system -* address space via -numa parameters or memory hotplug -* hooks. we want to take these into account, but we -* also want to make sure these supported hugepage -* sizes are applicable across the entire range of memory -* we may boot from, so we take the min across all -* backends, and assume normal pages in cases where a -* backend isn't backed by hugepages. -*/ - memdev_root =object_resolve_path ("/objects" ,NULL ); -if (memdev_root) { -object_child_foreach (memdev_root, find_min_backend_pagesize, &hpsize); - } -if (hpsize ==LONG_MAX ) { -/* No additional memory regions found ==> Report main RAM page size */ -return mainrampagesize; - } - -/* If NUMA is disabled or the NUMA nodes are not backed with a -* memory-backend, then there is at least one node using "normal" RAM, -* so if its page size is smaller we have got to report that size instead. -*/ -if (hpsize > mainrampagesize && - (ms->numa_state ==NULL || - ms->numa_state->num_nodes ==0 || - ms->numa_state->nodes[0 ].node_memdev ==NULL )) { -static bool warned; -if (!warned) { -error_report ("Huge page support disabled (n/a for main memory)." ); - warned = true; - } -return mainrampagesize; - } +long hpsize; +Object *memdev_root =object_resolve_path ("/objects" ,NULL ); +object_child_foreach (memdev_root, find_min_backend_pagesize, &hpsize);return hpsize; }long qemu_maxrampagesize (void ) { -long pagesize =qemu_mempath_getpagesize (mem_path); +long pagesize;Object *memdev_root =object_resolve_path ("/objects" ,NULL ); -if (memdev_root) { -object_child_foreach (memdev_root, find_max_backend_pagesize, - &pagesize); - } +object_child_foreach (memdev_root, find_max_backend_pagesize, &pagesize);return pagesize; }#else
Signature · 1 line
2.7.4
PATCH v2 78/86 exec: drop bogus mem_path from qemu_ram_alloc_from_fd()
In reply to Igor MammedovFunction will report error that will mention global mem_path, which was valid the only if legacy -mem-path was used and only in case of main RAM.
However it doesn't work with hostmem backends
(for example:
"
qemu: -object memory-backend-file,id=ram0,size=128M,mem-path=foo:
backing store (null) size 0x200000 does not match 'size' option 0x8000000
")
and couldn't possibly work in general FD case the function is supposed to handle.
Taking in account that main RAM was converted into memory-backend-foo object, there is no point in printing file name (from inappropriate place) as failing path is a part of backend's error message.
Hence drop bogus mem_path usage from qemu_ram_alloc_from_fd(), it's a job of its user to add file name to error message if applicable.
---
CC: [email protected]
CC: [email protected]
--- exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
exec.c +2 -2
@@ -2308,9 +2308,9 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr, size =HOST_PAGE_ALIGN (size); file_size =get_file_size (fd);if (file_size >0 && file_size < size) { -error_setg (errp,"backing store %s size 0x%" PRIx64 +error_setg (errp,"backing store size 0x%" PRIx64" does not match 'size' option 0x" RAM_ADDR_FMT , - mem_path, file_size, size); + file_size, size);return NULL ; }
Signature · 1 line
2.7.4
PATCH v2 79/86 make mem_path local variable
In reply to Igor MammedovIt's no longer used anywhere beside main(), so make it local variable that is used for CLI compat purposes to keep -mem-path option working.
Under hood QEMU will use it to create
memory-backend-file,mem-path=...
backend and use its MemoryRegion as main RAM.
---
CC: [email protected]
--- include/sysemu/sysemu.h | 1 - vl.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
include/sysemu/sysemu.h +0 -1
@@ -53,7 +53,6 @@ extern uint8_t *boot_splash_filedata;extern bool enable_mlock;extern bool enable_cpu_pm;extern QEMUClockType rtc_clock; -extern const char *mem_path;extern int mem_prealloc;#define MAX_OPTION_ROMS 16
vl.c +1 -1
@@ -140,7 +140,6 @@ enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;int display_opengl;const char * keyboard_layout =NULL ;ram_addr_t ram_size; -const char *mem_path =NULL ;int mem_prealloc =0 ;/* force preallocation of physical target memory */ bool enable_mlock = false;bool enable_cpu_pm = false;
@@ -2874,6 +2873,7 @@ int main(int argc, char **argv, char **envp)Error *err =NULL ;bool list_data_dirs = false;char *dir, **dirs; +const char *mem_path =NULL ;BlockdevOptionsQueue bdo_queue =QSIMPLEQ_HEAD_INITIALIZER (bdo_queue);QemuPluginList plugin_list =QTAILQ_HEAD_INITIALIZER (plugin_list);
Signature · 1 line
2.7.4
PATCH v2 80/86 hostmem: introduce "prealloc-threads" property
In reply to Igor Mammedovthe property will allow user to specify number of threads to use in pre-allocation stage. It also will allow to reduce implicit hostmem dependency on current_machine.
On object creation it will default to 1, but via machine compat property it will be updated to MachineState::smp::cpus to keep current behavior for hostmem and main RAM (which is now also hostmem based).
---
CC: [email protected]
CC: [email protected]
--- include/sysemu/hostmem.h | 2 ++ backends/hostmem.c | 43 +++++++++++++++++++++++++++++++++++++++---- vl.c | 15 +++++++++++---- 3 files changed, 52 insertions(+), 8 deletions(-)
include/sysemu/hostmem.h +2 -0
@@ -61,6 +61,7 @@ struct HostMemoryBackendClass {* @parent: opaque parent object container * @size: amount of memory backend provides * @mr: MemoryRegion representing host memory belonging to backend +* @prealloc_threads: number of threads to be used for preallocatining RAM */ struct HostMemoryBackend {/* private */
@@ -70,6 +71,7 @@ struct HostMemoryBackend {uint64_t size;bool merge, dump, use_canonical_path;bool prealloc, force_prealloc, is_mapped, share; +uint32_t prealloc_threads;DECLARE_BITMAP (host_nodes,MAX_NODES +1 );HostMemPolicy policy;
backends/hostmem.c +39 -4
87 lines not on this page · raw message
vl.c +11 -4
@@ -2820,8 +2820,7 @@ static void configure_accelerators(const char *progname) } } -static void create_default_memdev (MachineState *ms,const char *path, -bool prealloc) +static void create_default_memdev (MachineState *ms,const char *path) {Object *obj;MachineClass *mc =MACHINE_GET_CLASS (ms);
@@ -2830,7 +2829,6 @@ static void create_default_memdev(MachineState *ms, const char *path,if (path) {object_property_set_str (obj, path,"mem-path" , &error_fatal); } -object_property_set_bool (obj, prealloc,"prealloc" , &error_fatal);object_property_set_int (obj, ms->ram_size,"size" , &error_fatal);object_property_add_child (object_get_objects_root (), mc->default_ram_id, obj, &error_fatal);
@@ -3973,6 +3971,15 @@ int main(int argc, char **argv, char **envp)exit (1 ); } +if (mem_prealloc) { +static GlobalProperty p[] = { + {"memory-backend" ,"prealloc-threads" ,NULL }, + }; + + p[0 ].value =g_strdup_printf ("%d" , current_machine->smp.cpus); +compat_props_add (machine_class->compat_props, p,G_N_ELEMENTS (p)); + } +/* * Get the default machine options from the machine if it is not already * specified either by the configuration file or by the command line.
@@ -4306,7 +4313,7 @@ int main(int argc, char **argv, char **envp)if (numa_uses_legacy_mem () && machine_class->default_ram_size && !current_machine->ram_memdev) { -create_default_memdev (current_machine, mem_path, mem_prealloc); +create_default_memdev (current_machine, mem_path); }/* do monitor/qmp handling at preconfig state if requested */ main_loop ();
Signature · 1 line
2.7.4
Re: [PATCH v2 80/86] hostmem: introduce "prealloc-threads" property
vl.c int main(int argc, char **argv, char **envp) · line 3982
Quoted 8 lines · Igor Mammedov
vl.c +8
-0+static GlobalProperty p[] = { + {"memory-backend" ,"prealloc-threads" ,NULL }, + }; + + p[0 ].value =g_strdup_printf ("%d" , current_machine->smp.cpus); +compat_props_add (machine_class->compat_props, p,G_N_ELEMENTS (p)); + } +
object_register_sugar_prop might be slightly cleaner.
Paolo
PATCH v3 80/86 hostmem: introduce "prealloc-threads" property
the property will allow user to specify number of threads to use in pre-allocation stage. It also will allow to reduce implicit hostmem dependency on current_machine.
On object creation it will default to 1, but via machine compat property it will be updated to MachineState::smp::cpus to keep current behavior for hostmem and main RAM (which is now also hostmem based).
---
v3:
- use object_register_sugar_prop() instead of directly hacking compat_props (Paolo Bonzini <[email protected]>)
--- include/sysemu/hostmem.h | 2 ++ backends/hostmem.c | 43 +++++++++++++++++++++++++++++++++++++++---- vl.c | 14 ++++++++++---- 3 files changed, 51 insertions(+), 8 deletions(-)
include/sysemu/hostmem.h +2 -0
@@ -61,6 +61,7 @@ struct HostMemoryBackendClass {* @parent: opaque parent object container * @size: amount of memory backend provides * @mr: MemoryRegion representing host memory belonging to backend +* @prealloc_threads: number of threads to be used for preallocatining RAM */ struct HostMemoryBackend {/* private */
@@ -70,6 +71,7 @@ struct HostMemoryBackend {uint64_t size;bool merge, dump, use_canonical_path;bool prealloc, force_prealloc, is_mapped, share; +uint32_t prealloc_threads;DECLARE_BITMAP (host_nodes,MAX_NODES +1 );HostMemPolicy policy;
backends/hostmem.c +39 -4
87 lines not on this page · raw message
vl.c +10 -4
@@ -2820,8 +2820,7 @@ static void configure_accelerators(const char *progname) } } -static void create_default_memdev (MachineState *ms,const char *path, -bool prealloc) +static void create_default_memdev (MachineState *ms,const char *path) {Object *obj;MachineClass *mc =MACHINE_GET_CLASS (ms);
@@ -2830,7 +2829,6 @@ static void create_default_memdev(MachineState *ms, const char *path,if (path) {object_property_set_str (obj, path,"mem-path" , &error_fatal); } -object_property_set_bool (obj, prealloc,"prealloc" , &error_fatal);object_property_set_int (obj, ms->ram_size,"size" , &error_fatal);object_property_add_child (object_get_objects_root (), mc->default_ram_id, obj, &error_fatal);
@@ -3973,6 +3971,14 @@ int main(int argc, char **argv, char **envp)exit (1 ); } +if (mem_prealloc) { +char *val; + + val =g_strdup_printf ("%d" , current_machine->smp.cpus); +object_register_sugar_prop ("memory-backend" ,"prealloc-threads" , val); +g_free (val); + } +/* * Get the default machine options from the machine if it is not already * specified either by the configuration file or by the command line.
@@ -4306,7 +4312,7 @@ int main(int argc, char **argv, char **envp)if (numa_uses_legacy_mem () && machine_class->default_ram_size && !current_machine->ram_memdev) { -create_default_memdev (current_machine, mem_path, mem_prealloc); +create_default_memdev (current_machine, mem_path); }/* do monitor/qmp handling at preconfig state if requested */ main_loop ();
Signature · 1 line
2.7.4
Re: [PATCH v3 80/86] hostmem: introduce "prealloc-threads" property
Quoted 50 lines · Igor Mammedov
backends/hostmem.c +26
-2@@ -223,7 +223,6 @@ static void host_memory_backend_set_prealloc(Object *obj, bool value, {Error *local_err =NULL ;HostMemoryBackend *backend =MEMORY_BACKEND (obj); -MachineState *ms =MACHINE (qdev_get_machine ());if (backend->force_prealloc) {if (value) {@@ -243,7 +242,7 @@ static void host_memory_backend_set_prealloc(Object *obj, bool value,void *ptr =memory_region_get_ram_ptr (&backend->mr);uint64_t sz =memory_region_size (&backend->mr); -os_mem_prealloc (fd, ptr, sz, ms->smp.cpus, &local_err); +os_mem_prealloc (fd, ptr, sz, backend->prealloc_threads, &local_err);if (local_err) {error_propagate (errp, local_err);return ;@@ -252,14 +251,45 @@ static void host_memory_backend_set_prealloc(Object *obj, bool value, } } +static void host_memory_backend_get_prealloc_threads (Object *obj,Visitor *v, +const char *name,void *opaque,Error **errp) +{ +HostMemoryBackend *backend =MEMORY_BACKEND (obj); +visit_type_uint32 (v, name, &backend->prealloc_threads, errp); +} + +static void host_memory_backend_set_prealloc_threads (Object *obj,Visitor *v, +const char *name,void *opaque,Error **errp) +{ +HostMemoryBackend *backend =MEMORY_BACKEND (obj); +Error *local_err =NULL ; +uint32_t value; + +visit_type_uint32 (v, name, &value, &local_err); +if (local_err) { + goto out; + } +if (value <=0 ) { +error_setg (&local_err, +"property '%s' of %s doesn't take value '%d'" , + name,object_get_typename (obj), value); + goto out; + } + backend->prealloc_threads = value;
backends/hostmem.c static void host_memory_backend_set_prealloc(Object *obj, bool value, · line 288
Quoted 10 lines
backends/hostmem.c +5
-0+out: +error_propagate (errp, local_err); +} +static void host_memory_backend_init (Object *obj) {HostMemoryBackend *backend =MEMORY_BACKEND (obj);MachineState *machine =MACHINE (qdev_get_machine ()); +/* TODO: convert this compat properties */
Did you mean "convert these compat properties" or "convert this compat property"?
Regards,
BALATON Zoltan
Quoted 7 lines
backends/hostmem.c +1
-0backend->merge =machine_mem_merge (machine); backend->dump =machine_dump_guest_core (machine); backend->prealloc = mem_prealloc; + backend->prealloc_threads =1 ; }static void host_memory_backend_post_init (Object *obj)
PATCH v2 80/86 hostmem: introduce "prealloc-threads" property
the property will allow user to specify number of threads to use in pre-allocation stage. It also will allow to reduce implicit hostmem dependency on current_machine.
On object creation it will default to 1, but via machine compat property it will be updated to MachineState::smp::cpus to keep current behavior for hostmem and main RAM (which is now also hostmem based).
---
v3:
- use object_register_sugar_prop() instead of directly hacking compat_props (Paolo Bonzini <[email protected]>)
- fix TODO description
--- include/sysemu/hostmem.h | 2 ++ backends/hostmem.c | 43 +++++++++++++++++++++++++++++++++++++++---- vl.c | 14 ++++++++++---- 3 files changed, 51 insertions(+), 8 deletions(-)
include/sysemu/hostmem.h +2 -0
@@ -61,6 +61,7 @@ struct HostMemoryBackendClass {* @parent: opaque parent object container * @size: amount of memory backend provides * @mr: MemoryRegion representing host memory belonging to backend +* @prealloc_threads: number of threads to be used for preallocatining RAM */ struct HostMemoryBackend {/* private */
@@ -70,6 +71,7 @@ struct HostMemoryBackend {uint64_t size;bool merge, dump, use_canonical_path;bool prealloc, force_prealloc, is_mapped, share; +uint32_t prealloc_threads;DECLARE_BITMAP (host_nodes,MAX_NODES +1 );HostMemPolicy policy;
backends/hostmem.c +39 -4
87 lines not on this page · raw message
vl.c +10 -4
@@ -2820,8 +2820,7 @@ static void configure_accelerators(const char *progname) } } -static void create_default_memdev (MachineState *ms,const char *path, -bool prealloc) +static void create_default_memdev (MachineState *ms,const char *path) {Object *obj;MachineClass *mc =MACHINE_GET_CLASS (ms);
@@ -2830,7 +2829,6 @@ static void create_default_memdev(MachineState *ms, const char *path,if (path) {object_property_set_str (obj, path,"mem-path" , &error_fatal); } -object_property_set_bool (obj, prealloc,"prealloc" , &error_fatal);object_property_set_int (obj, ms->ram_size,"size" , &error_fatal);object_property_add_child (object_get_objects_root (), mc->default_ram_id, obj, &error_fatal);
@@ -3973,6 +3971,14 @@ int main(int argc, char **argv, char **envp)exit (1 ); } +if (mem_prealloc) { +char *val; + + val =g_strdup_printf ("%d" , current_machine->smp.cpus); +object_register_sugar_prop ("memory-backend" ,"prealloc-threads" , val); +g_free (val); + } +/* * Get the default machine options from the machine if it is not already * specified either by the configuration file or by the command line.
@@ -4306,7 +4312,7 @@ int main(int argc, char **argv, char **envp)if (numa_uses_legacy_mem () && machine_class->default_ram_size && !current_machine->ram_memdev) { -create_default_memdev (current_machine, mem_path, mem_prealloc); +create_default_memdev (current_machine, mem_path); }/* do monitor/qmp handling at preconfig state if requested */ main_loop ();
Signature · 1 line
2.7.4
PATCH v2 81/86 hostmem: fix strict bind policy
In reply to Igor MammedovWhen option -mem-prealloc is used with one or more memory-backend objects, created backends may not obey configured bind policy or creation may fail after kernel attempts to move pages according to bind policy.
Reason is in file_ram_alloc(), which will pre-allocate any descriptor based RAM if global mem_prealloc != 0 and that happens way before bind policy is applied to memory range.
One way to fix it would be to extend memory_region_foo() API and add more invariants that could broken later due implicit dependencies that's hard to track.
Another approach is to drop adhoc main RAM allocation and consolidate it around memory-backend. That allows to have single place that allocates guest RAM (main and memdev) in the same way and then global mem_prealloc could be replaced by backend's property[s] that will affect created memory-backend objects but only in correct order this time.
With main RAM now converted to hostmem backends, there is no point in keeping global mem_prealloc around, so alias
-mem-prealloc to "memory-backend.prealloc=on"
machine compat[*] property and make mem_prealloc a local variable to only stir registration of compat property.
*) currently user accessible -global works only with DEVICE
based objects and extra work is needed to make it work with hostmem backends. But that is convenience option and out of scope of this already huge refactoring. Hence machine compat properties were used.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- include/sysemu/hostmem.h | 2 +- include/sysemu/sysemu.h | 1 - backends/hostmem-file.c | 1 - backends/hostmem-memfd.c | 1 - backends/hostmem.c | 12 +----------- exec.c | 11 ----------- vl.c | 3 ++- 7 files changed, 4 insertions(+), 27 deletions(-)
include/sysemu/hostmem.h +1 -1
@@ -70,7 +70,7 @@ struct HostMemoryBackend {/* protected */ uint64_t size;bool merge, dump, use_canonical_path; -bool prealloc, force_prealloc, is_mapped, share; +bool prealloc, is_mapped, share;uint32_t prealloc_threads;DECLARE_BITMAP (host_nodes,MAX_NODES +1 );HostMemPolicy policy;
include/sysemu/sysemu.h +0 -1
@@ -53,7 +53,6 @@ extern uint8_t *boot_splash_filedata;extern bool enable_mlock;extern bool enable_cpu_pm;extern QEMUClockType rtc_clock; -extern int mem_prealloc;#define MAX_OPTION_ROMS 16 typedef struct QEMUOptionRom {
backends/hostmem-file.c +0 -1
@@ -51,7 +51,6 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)return ; } - backend->force_prealloc = mem_prealloc; name =host_memory_backend_get_name (backend); memory_region_init_ram_from_file(&backend->mr, OBJECT(backend), name,
backends/hostmem-memfd.c +0 -1
@@ -45,7 +45,6 @@ memfd_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)return ; } - backend->force_prealloc = mem_prealloc; fd = qemu_memfd_create(TYPE_MEMORY_BACKEND_MEMFD, backend->size, m->hugetlb, m->hugetlbsize, m->seal ? F_SEAL_GROW | F_SEAL_SHRINK | F_SEAL_SEAL : 0,
backends/hostmem.c +1 -11
@@ -215,7 +215,7 @@ static bool host_memory_backend_get_prealloc(Object *obj, Error **errp) {HostMemoryBackend *backend =MEMORY_BACKEND (obj); -return backend->prealloc || backend->force_prealloc; +return backend->prealloc; } static void host_memory_backend_set_prealloc(Object *obj, bool value,
@@ -224,14 +224,6 @@ static void host_memory_backend_set_prealloc(Object *obj, bool value,Error *local_err =NULL ;HostMemoryBackend *backend =MEMORY_BACKEND (obj); -if (backend->force_prealloc) { -if (value) { -error_setg (errp, -"remove -mem-prealloc to use the prealloc property" ); -return ; - } - } -if (!host_memory_backend_mr_inited (backend)) { backend->prealloc = value;return ;
@@ -288,8 +280,6 @@ static void host_memory_backend_init(Object *obj)/* TODO: convert this compat properties */ backend->merge =machine_mem_merge (machine); backend->dump =machine_dump_guest_core (machine); - backend->prealloc = mem_prealloc; - backend->prealloc_threads =1 ; }static void host_memory_backend_post_init (Object *obj)
exec.c +0 -11
@@ -1802,8 +1802,6 @@ static void *file_ram_alloc(RAMBlock *block,bool truncate, Error **errp) { - Error *err = NULL; -MachineState *ms =MACHINE (qdev_get_machine ()); void *area; block->page_size =qemu_fd_getpagesize (fd);
@@ -1859,15 +1857,6 @@ static void *file_ram_alloc(RAMBlock *block,return NULL ; } -if (mem_prealloc) { -os_mem_prealloc (fd, area, memory, ms->smp.cpus, &err); -if (err) { -error_propagate (errp, err); -qemu_ram_munmap (fd, area, memory); -return NULL ; - } - } - block->fd = fd;return area; }
vl.c +2 -1
@@ -140,7 +140,6 @@ enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;int display_opengl;const char * keyboard_layout =NULL ;ram_addr_t ram_size; -int mem_prealloc =0 ;/* force preallocation of physical target memory */ bool enable_mlock = false;bool enable_cpu_pm = false;int nb_nics;
@@ -2874,6 +2873,7 @@ int main(int argc, char **argv, char **envp)const char *mem_path =NULL ;BlockdevOptionsQueue bdo_queue =QSIMPLEQ_HEAD_INITIALIZER (bdo_queue);QemuPluginList plugin_list =QTAILQ_HEAD_INITIALIZER (plugin_list); +int mem_prealloc =0 ;/* force preallocation of physical target memory */ os_set_line_buffering ();
@@ -3974,6 +3974,7 @@ int main(int argc, char **argv, char **envp)if (mem_prealloc) {static GlobalProperty p[] = { {"memory-backend" ,"prealloc-threads" ,NULL }, + {"memory-backend" ,"prealloc" ,"on" }, }; p[0 ].value =g_strdup_printf ("%d" , current_machine->smp.cpus);
Signature · 1 line
2.7.4
PATCH v3 81/86 hostmem: fix strict bind policy
When option -mem-prealloc is used with one or more memory-backend objects, created backends may not obey configured bind policy or creation may fail after kernel attempts to move pages according to bind policy.
Reason is in file_ram_alloc(), which will pre-allocate any descriptor based RAM if global mem_prealloc != 0 and that happens way before bind policy is applied to memory range.
One way to fix it would be to extend memory_region_foo() API and add more invariants that could broken later due implicit dependencies that's hard to track.
Another approach is to drop adhoc main RAM allocation and consolidate it around memory-backend. That allows to have single place that allocates guest RAM (main and memdev) in the same way and then global mem_prealloc could be replaced by backend's property[s] that will affect created memory-backend objects but only in correct order this time.
With main RAM now converted to hostmem backends, there is no point in keeping global mem_prealloc around, so alias
-mem-prealloc to "memory-backend.prealloc=on"
machine compat[*] property and make mem_prealloc a local variable to only stir registration of compat property.
*) currently user accessible -global works only with DEVICE
based objects and extra work is needed to make it work with hostmem backends. But that is convenience option and out of scope of this already huge refactoring. Hence machine compat properties were used.
---
v3:
- use object_register_sugar_prop() instead of directly hacking compat_props (Paolo Bonzini <[email protected]>)
--- include/sysemu/hostmem.h | 2 +- include/sysemu/sysemu.h | 1 - backends/hostmem-file.c | 1 - backends/hostmem-memfd.c | 1 - backends/hostmem.c | 12 +----------- exec.c | 11 ----------- vl.c | 3 ++- 7 files changed, 4 insertions(+), 27 deletions(-)
include/sysemu/hostmem.h +1 -1
@@ -70,7 +70,7 @@ struct HostMemoryBackend {/* protected */ uint64_t size;bool merge, dump, use_canonical_path; -bool prealloc, force_prealloc, is_mapped, share; +bool prealloc, is_mapped, share;uint32_t prealloc_threads;DECLARE_BITMAP (host_nodes,MAX_NODES +1 );HostMemPolicy policy;
include/sysemu/sysemu.h +0 -1
@@ -53,7 +53,6 @@ extern uint8_t *boot_splash_filedata;extern bool enable_mlock;extern bool enable_cpu_pm;extern QEMUClockType rtc_clock; -extern int mem_prealloc;#define MAX_OPTION_ROMS 16 typedef struct QEMUOptionRom {
backends/hostmem-file.c +0 -1
@@ -51,7 +51,6 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)return ; } - backend->force_prealloc = mem_prealloc; name =host_memory_backend_get_name (backend); memory_region_init_ram_from_file(&backend->mr, OBJECT(backend), name,
backends/hostmem-memfd.c +0 -1
@@ -45,7 +45,6 @@ memfd_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)return ; } - backend->force_prealloc = mem_prealloc; fd = qemu_memfd_create(TYPE_MEMORY_BACKEND_MEMFD, backend->size, m->hugetlb, m->hugetlbsize, m->seal ? F_SEAL_GROW | F_SEAL_SHRINK | F_SEAL_SEAL : 0,
backends/hostmem.c +1 -11
@@ -215,7 +215,7 @@ static bool host_memory_backend_get_prealloc(Object *obj, Error **errp) {HostMemoryBackend *backend =MEMORY_BACKEND (obj); -return backend->prealloc || backend->force_prealloc; +return backend->prealloc; } static void host_memory_backend_set_prealloc(Object *obj, bool value,
@@ -224,14 +224,6 @@ static void host_memory_backend_set_prealloc(Object *obj, bool value,Error *local_err =NULL ;HostMemoryBackend *backend =MEMORY_BACKEND (obj); -if (backend->force_prealloc) { -if (value) { -error_setg (errp, -"remove -mem-prealloc to use the prealloc property" ); -return ; - } - } -if (!host_memory_backend_mr_inited (backend)) { backend->prealloc = value;return ;
@@ -288,8 +280,6 @@ static void host_memory_backend_init(Object *obj)/* TODO: convert this compat properties */ backend->merge =machine_mem_merge (machine); backend->dump =machine_dump_guest_core (machine); - backend->prealloc = mem_prealloc; - backend->prealloc_threads =1 ; }static void host_memory_backend_post_init (Object *obj)
exec.c +0 -11
@@ -1802,8 +1802,6 @@ static void *file_ram_alloc(RAMBlock *block,bool truncate, Error **errp) { - Error *err = NULL; -MachineState *ms =MACHINE (qdev_get_machine ()); void *area; block->page_size =qemu_fd_getpagesize (fd);
@@ -1859,15 +1857,6 @@ static void *file_ram_alloc(RAMBlock *block,return NULL ; } -if (mem_prealloc) { -os_mem_prealloc (fd, area, memory, ms->smp.cpus, &err); -if (err) { -error_propagate (errp, err); -qemu_ram_munmap (fd, area, memory); -return NULL ; - } - } - block->fd = fd;return area; }
vl.c +2 -1
@@ -140,7 +140,6 @@ enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;int display_opengl;const char * keyboard_layout =NULL ;ram_addr_t ram_size; -int mem_prealloc =0 ;/* force preallocation of physical target memory */ bool enable_mlock = false;bool enable_cpu_pm = false;int nb_nics;
@@ -2874,6 +2873,7 @@ int main(int argc, char **argv, char **envp)const char *mem_path =NULL ;BlockdevOptionsQueue bdo_queue =QSIMPLEQ_HEAD_INITIALIZER (bdo_queue);QemuPluginList plugin_list =QTAILQ_HEAD_INITIALIZER (plugin_list); +int mem_prealloc =0 ;/* force preallocation of physical target memory */ os_set_line_buffering ();
@@ -3977,6 +3977,7 @@ int main(int argc, char **argv, char **envp) val =g_strdup_printf ("%d" , current_machine->smp.cpus);object_register_sugar_prop ("memory-backend" ,"prealloc-threads" , val);g_free (val); +object_register_sugar_prop ("memory-backend" ,"prealloc" ,"on" ); }/*
Signature · 1 line
2.7.4
PATCH v2 82/86 numa: forbid '-numa node, mem' for 5.0 and newer machine types
In reply to Igor MammedovDeprecation period is ran out and it's a time to flip the switch introduced by cd5ff8333a.
Disable legacy option for new machine types and amend documentation.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- hw/arm/virt.c | 2 +- hw/core/numa.c | 6 ++++++ hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/ppc/spapr.c | 2 +- qemu-deprecated.texi | 16 ---------------- qemu-options.hx | 8 ++++---- 8 files changed, 14 insertions(+), 23 deletions(-)
hw/arm/virt.c +1 -1
@@ -2049,7 +2049,6 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) hc->pre_plug = virt_machine_device_pre_plug_cb; hc->plug = virt_machine_device_plug_cb; hc->unplug_request = virt_machine_device_unplug_request_cb; - mc->numa_mem_supported = true; mc->auto_enable_numa_with_memhp = true; mc->default_ram_id ="mach-virt.ram" ; }
@@ -2153,6 +2152,7 @@ DEFINE_VIRT_MACHINE_AS_LATEST(5, 0)static void virt_machine_4_2_options (MachineClass *mc) {compat_props_add (mc->compat_props, hw_compat_4_2, hw_compat_4_2_len); + mc->numa_mem_supported = true; }DEFINE_VIRT_MACHINE (4 ,2 )
hw/core/numa.c +6 -0
@@ -117,6 +117,12 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node, }if (node->has_mem) { +if (!mc->numa_mem_supported) { +error_setg (errp,"Parameter -numa node,mem is not supported by this" +" machine type. Use -numa node,memdev instead" ); +return ; + } + numa_info[nodenr].node_mem = node->mem;if (!qtest_enabled ()) { warn_report("Parameter -numa node,mem is deprecated,"
hw/i386/pc.c +0 -1
@@ -1947,7 +1947,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) hc->unplug = pc_machine_device_unplug_cb; mc->default_cpu_type =TARGET_DEFAULT_CPU_TYPE ; mc->nvdimm_supported = true; - mc->numa_mem_supported = true; mc->default_ram_id ="pc.ram" ; object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int",
hw/i386/pc_piix.c +1 -0
@@ -435,6 +435,7 @@ static void pc_i440fx_4_2_machine_options(MachineClass *m)pc_i440fx_5_0_machine_options (m); m->alias =NULL ; m->is_default =0 ; + m->numa_mem_supported = true;compat_props_add (m->compat_props, hw_compat_4_2, hw_compat_4_2_len);compat_props_add (m->compat_props, pc_compat_4_2, pc_compat_4_2_len); }
hw/i386/pc_q35.c +1 -0
@@ -363,6 +363,7 @@ static void pc_q35_4_2_machine_options(MachineClass *m) {pc_q35_5_0_machine_options (m); m->alias =NULL ; + m->numa_mem_supported = true;compat_props_add (m->compat_props, hw_compat_4_2, hw_compat_4_2_len);compat_props_add (m->compat_props, pc_compat_4_2, pc_compat_4_2_len); }
hw/ppc/spapr.c +1 -1
@@ -4383,7 +4383,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)* in which LMBs are represented and hot-added */ mc->numa_mem_align_shift =28 ; - mc->numa_mem_supported = true; mc->auto_enable_numa = true; smc->default_caps.caps[SPAPR_CAP_HTM ] =SPAPR_CAP_OFF ;
@@ -4465,6 +4464,7 @@ static void spapr_machine_4_2_class_options(MachineClass *mc) {spapr_machine_5_0_class_options (mc);compat_props_add (mc->compat_props, hw_compat_4_2, hw_compat_4_2_len); + mc->numa_mem_supported = true; } DEFINE_SPAPR_MACHINE(4_2, "4.2", false);
qemu-deprecated.texi +0 -16
@@ -89,22 +89,6 @@ error in the future. The @code{-realtime mlock=on|off} argument has been replaced by the @code{-overcommit mem-lock=on|off} argument. -@subsection -numa node,mem=@var{size} (since 4.1) - -The parameter @option{mem} of @option{-numa node} is used to assign a part of -guest RAM to a NUMA node. But when using it, it's impossible to manage specified -RAM chunk on the host side (like bind it to a host node, setting bind policy, ...), -so guest end-ups with the fake NUMA configuration with suboptiomal performance. -However since 2014 there is an alternative way to assign RAM to a NUMA node -using parameter @option{memdev}, which does the same as @option{mem} and adds -means to actualy manage node RAM on the host side. Use parameter @option{memdev} -with @var{memory-backend-ram} backend as an replacement for parameter @option{mem} -to achieve the same fake NUMA effect or a properly configured -@var{memory-backend-file} backend to actually benefit from NUMA configuration. -In future new machine versions will not accept the option but it will still -work with old machine types. User can check QAPI schema to see if the legacy -option is supported by looking at MachineInfo::numa-mem-supported property. - @subsection -numa node (without memory specified) (since 4.1) Splitting RAM by default between NUMA nodes has the same issues as @option{mem}
qemu-options.hx +4 -4
@@ -223,10 +223,10 @@ For example: -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1 @end example -@samp{mem} assigns a given RAM amount to a node. @samp{memdev} -assigns RAM from a given memory backend device to a node. If -@samp{mem} and @samp{memdev} are omitted in all nodes, RAM is -split equally between them. +Legacy @samp{mem} assigns a given RAM amount to a node (not supported for 5.0 +and newer machine types). @samp{memdev} assigns RAM from a given memory backend +device to a node. If @samp{mem} and @samp{memdev} are omitted in all nodes, RAM +is split equally between them. @samp{mem} and @samp{memdev} are mutually exclusive. Furthermore, if one node uses @samp{memdev}, all of them have to use it.
Signature · 1 line
2.7.4
Re: [libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types
Quoted 16 lines · Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch introduced by
cd5ff8333a.
Disable legacy option for new machine types and amend documentation.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
Quoted 10 lines
--- hw/arm/virt.c | 2 +- hw/core/numa.c | 6 ++++++ hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/ppc/spapr.c | 2 +- qemu-deprecated.texi | 16 ---------------- qemu-options.hx | 8 ++++---- 8 files changed, 14 insertions(+), 23 deletions(-)
I'm afraid nobody bothered to fix it yet:
Re: [libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types
Quoted 28 lines · On Wed, 15 Jan 2020 16:34:53 +0100 Peter Krempa <[email protected]> wrote:
Quoted 16 lines · Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch introduced by
cd5ff8333a.
Disable legacy option for new machine types and amend documentation.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]Quoted 10 lines
--- hw/arm/virt.c | 2 +- hw/core/numa.c | 6 ++++++ hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/ppc/spapr.c | 2 +- qemu-deprecated.texi | 16 ---------------- qemu-options.hx | 8 ++++---- 8 files changed, 14 insertions(+), 23 deletions(-)
Quoted 3 lines
I'm afraid nobody bothered to fix it yet:
It's time to start working on it :)
(looks like just deprecating stuff isn't sufficient motivation, maybe actual switch flipping would work out better)
Re: [libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types
Quoted 31 lines · Igor Mammedov
Quoted 28 lines · On Wed, 15 Jan 2020 16:34:53 +0100 Peter Krempa <[email protected]> wrote:
Quoted 26 lines · Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch introduced by
cd5ff8333a.
Disable legacy option for new machine types and amend documentation.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/arm/virt.c | 2 +- hw/core/numa.c | 6 ++++++ hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/ppc/spapr.c | 2 +- qemu-deprecated.texi | 16 ---------------- qemu-options.hx | 8 ++++---- 8 files changed, 14 insertions(+), 23 deletions(-)
Quoted 8 lines
Quoted 3 lines
I'm afraid nobody bothered to fix it yet:
It's time to start working on it :)
(looks like just deprecating stuff isn't sufficient motivation, maybe actual switch flipping would work out better)
So how was the upgrade from older to newer version resolved? I mean, if the old qemu used -numa node,mem=XXX and it is migrated to a host with newer qemu, the cmd line can't be switched to -numa node,memdev=node0, can it? I'm asking because I've just started working on this.
Michal
Re: [libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types
Quoted 41 lines · On Thu, 16 Jan 2020 11:42:09 +0100 Michal Privoznik <[email protected]> wrote:
Quoted 31 lines · Igor Mammedov
Quoted 28 lines · On Wed, 15 Jan 2020 16:34:53 +0100 Peter Krempa <[email protected]> wrote:
Quoted 26 lines · Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch introduced by
cd5ff8333a.
Disable legacy option for new machine types and amend documentation.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/arm/virt.c | 2 +- hw/core/numa.c | 6 ++++++ hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/ppc/spapr.c | 2 +- qemu-deprecated.texi | 16 ---------------- qemu-options.hx | 8 ++++---- 8 files changed, 14 insertions(+), 23 deletions(-)Quoted 8 lines
Quoted 3 lines
I'm afraid nobody bothered to fix it yet:
It's time to start working on it :)
(looks like just deprecating stuff isn't sufficient motivation, maybe actual switch flipping would work out better)
Quoted 4 lines
So how was the upgrade from older to newer version resolved? I mean, if the old qemu used -numa node,mem=XXX and it is migrated to a host with newer qemu, the cmd line can't be switched to -numa node,memdev=node0, can it? I'm asking because I've just started working on this.
see commit cd5ff8333a3c87 for detailed info.
Short answer is it's not really resolved [*],
-numa node,mem will keep working on newer QEMU but only for old machine types new machine types will accept only -numa node,memdev.
One can check if "mem=' is supported by using QAPI query-machines and checking numa-mem-supported field. That field is flipped to false for 5.0 and later machine types in this patch.
*) I might give another try to removing 'mem' completely in migration compatible manner but that's well beyond the scope of this series So far I hasn't been able to convince myself that previous attempts to do it were absolutely correct for all corner cases that are there.
Quoted 1 line
Michal
Re: [libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types
Quoted 49 lines · Igor Mammedov
Quoted 41 lines · On Thu, 16 Jan 2020 11:42:09 +0100 Michal Privoznik <[email protected]> wrote:
Quoted 31 lines · Igor Mammedov
Quoted 28 lines · On Wed, 15 Jan 2020 16:34:53 +0100 Peter Krempa <[email protected]> wrote:
Quoted 26 lines · Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch introduced by
cd5ff8333a.
Disable legacy option for new machine types and amend documentation.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/arm/virt.c | 2 +- hw/core/numa.c | 6 ++++++ hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/ppc/spapr.c | 2 +- qemu-deprecated.texi | 16 ---------------- qemu-options.hx | 8 ++++---- 8 files changed, 14 insertions(+), 23 deletions(-)Quoted 8 lines
Quoted 3 lines
I'm afraid nobody bothered to fix it yet:
It's time to start working on it :)
(looks like just deprecating stuff isn't sufficient motivation, maybe actual switch flipping would work out better)Quoted 4 lines
So how was the upgrade from older to newer version resolved? I mean, if the old qemu used -numa node,mem=XXX and it is migrated to a host with newer qemu, the cmd line can't be switched to -numa node,memdev=node0, can it? I'm asking because I've just started working on this.
Quoted 8 lines
see commit
cd5ff8333a3c87for detailed info.
Short answer is it's not really resolved [*],
-numa node,mem will keep working on newer QEMU but only for old machine types new machine types will accept only -numa node,memdev.One can check if "mem=' is supported by using QAPI query-machines and checking numa-mem-supported field. That field is flipped to false for 5.0 and later machine types in this patch.
Alright, so what we can do is the following:
1) For new machine types (pc-5.0/q35-5.0 and newer) use memdev= always.
2) For older machine types, we are stuck with mem= until qemu is capable of migrating from mem= to memdev=
I think this is a safe thing to do since migrating from one version of a machine type to another is not supported (since it can change guest ABI). And we will see how much 2) bothers us. Does this sound reasonable?
Michal
Re: [libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types
Quoted 55 lines · On Thu, 16 Jan 2020 14:03:12 +0100 Michal Privoznik <[email protected]> wrote:
Quoted 54 lines · Igor Mammedov
Quoted 41 lines · On Thu, 16 Jan 2020 11:42:09 +0100 Michal Privoznik <[email protected]> wrote:
Quoted 31 lines · Igor Mammedov
Quoted 28 lines · On Wed, 15 Jan 2020 16:34:53 +0100 Peter Krempa <[email protected]> wrote:
Quoted 26 lines · Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch introduced by
cd5ff8333a.
Disable legacy option for new machine types and amend documentation.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/arm/virt.c | 2 +- hw/core/numa.c | 6 ++++++ hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/ppc/spapr.c | 2 +- qemu-deprecated.texi | 16 ---------------- qemu-options.hx | 8 ++++---- 8 files changed, 14 insertions(+), 23 deletions(-)Quoted 8 lines
Quoted 3 lines
I'm afraid nobody bothered to fix it yet:
It's time to start working on it :)
(looks like just deprecating stuff isn't sufficient motivation, maybe actual switch flipping would work out better)Quoted 4 lines
So how was the upgrade from older to newer version resolved? I mean, if the old qemu used -numa node,mem=XXX and it is migrated to a host with newer qemu, the cmd line can't be switched to -numa node,memdev=node0, can it? I'm asking because I've just started working on this.
see commit
cd5ff8333a3c87for detailed info.
Short answer is it's not really resolved [*],
-numa node,mem will keep working on newer QEMU but only for old machine types new machine types will accept only -numa node,memdev.
Quoted 7 lines
Quoted 3 lines
One can check if "mem=' is supported by using QAPI query-machines and checking numa-mem-supported field. That field is flipped to false for 5.0 and later machine types in this patch.
Alright, so what we can do is the following:
1) For new machine types (pc-5.0/q35-5.0 and newer) use memdev= always.
it's not only x86, it's for all machines that support numa hence numa-mem-supported was introduced to make it easier for libvirt to figure out when to use which syntax.
The plan was to release libvirt with support for numa-mem-supported and then when newer QEMU forbids 'mem=' it change will be transparent for relatively fresh livirt.
Whether it still does make sense though.
We could go with your suggestion in which case libvirt unilaterally switches to using only 'memdev' for 5.0 machine types and then later (5.1..) we release QEMU that enforces it.
In this case we can axe numa-mem-supported (I'd volunteer) to avoid supporting yet another ABI/smart logic where your way could be sufficient.
Daniel,
what's your take on Michal's approach?
Quoted 12 lines
2) For older machine types, we are stuck with mem= until qemu is capable of migrating from mem= to memdev=
I think this is a safe thing to do since migrating from one version of a machine type to another is not supported (since it can change guest ABI). And we will see how much 2) bothers us. Does this sound reasonable?\
Michal
Re: [libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types
In reply to Igor MammedovQuoted 49 lines · Igor Mammedov
Quoted 41 lines · On Thu, 16 Jan 2020 11:42:09 +0100 Michal Privoznik <[email protected]> wrote:
Quoted 31 lines · Igor Mammedov
Quoted 28 lines · On Wed, 15 Jan 2020 16:34:53 +0100 Peter Krempa <[email protected]> wrote:
Quoted 26 lines · Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch introduced by
cd5ff8333a.
Disable legacy option for new machine types and amend documentation.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/arm/virt.c | 2 +- hw/core/numa.c | 6 ++++++ hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/ppc/spapr.c | 2 +- qemu-deprecated.texi | 16 ---------------- qemu-options.hx | 8 ++++---- 8 files changed, 14 insertions(+), 23 deletions(-)Quoted 8 lines
Quoted 3 lines
I'm afraid nobody bothered to fix it yet:
It's time to start working on it :)
(looks like just deprecating stuff isn't sufficient motivation, maybe actual switch flipping would work out better)Quoted 4 lines
So how was the upgrade from older to newer version resolved? I mean, if the old qemu used -numa node,mem=XXX and it is migrated to a host with newer qemu, the cmd line can't be switched to -numa node,memdev=node0, can it? I'm asking because I've just started working on this.
Quoted 8 lines
see commit
cd5ff8333a3c87for detailed info.
Short answer is it's not really resolved [*],
-numa node,mem will keep working on newer QEMU but only for old machine types new machine types will accept only -numa node,memdev.One can check if "mem=' is supported by using QAPI query-machines and checking numa-mem-supported field. That field is flipped to false for 5.0 and later machine types in this patch.
Since libvirt droppped the ball here, can we postpone this change to machine types until a later release.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types
Quoted 55 lines · On Thu, 16 Jan 2020 13:06:28 +0000 Daniel P. Berrangé <[email protected]>…
Quoted 54 lines · Igor Mammedov
Quoted 41 lines · On Thu, 16 Jan 2020 11:42:09 +0100 Michal Privoznik <[email protected]> wrote:
Quoted 31 lines · Igor Mammedov
Quoted 28 lines · On Wed, 15 Jan 2020 16:34:53 +0100 Peter Krempa <[email protected]> wrote:
Quoted 26 lines · Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch introduced by
cd5ff8333a.
Disable legacy option for new machine types and amend documentation.Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/arm/virt.c | 2 +- hw/core/numa.c | 6 ++++++ hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/ppc/spapr.c | 2 +- qemu-deprecated.texi | 16 ---------------- qemu-options.hx | 8 ++++---- 8 files changed, 14 insertions(+), 23 deletions(-)Quoted 8 lines
Quoted 3 lines
I'm afraid nobody bothered to fix it yet:
It's time to start working on it :)
(looks like just deprecating stuff isn't sufficient motivation, maybe actual switch flipping would work out better)Quoted 4 lines
So how was the upgrade from older to newer version resolved? I mean, if the old qemu used -numa node,mem=XXX and it is migrated to a host with newer qemu, the cmd line can't be switched to -numa node,memdev=node0, can it? I'm asking because I've just started working on this.
see commit
cd5ff8333a3c87for detailed info.
Short answer is it's not really resolved [*],
-numa node,mem will keep working on newer QEMU but only for old machine types new machine types will accept only -numa node,memdev.
Quoted 6 lines
Quoted 3 lines
One can check if "mem=' is supported by using QAPI query-machines and checking numa-mem-supported field. That field is flipped to false for 5.0 and later machine types in this patch.
Since libvirt droppped the ball here, can we postpone this change to machine types until a later release.
Looks like we have to at this point.
We can do this for [82-86/86] patches which are mostly numa related changes.
The rest could go in this release as it is in-depended of numa, it mainly introduces memdev backend for main RAM and consolidates twisted main RAM allocation logic.
Quoted 3 lines
Regards,
Daniel
Re: [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types
In reply to Igor MammedovQuoted 5 lines · Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch introduced by
cd5ff8333a.
Disable legacy option for new machine types and amend documentation.Signed-off-by Igor Mammedov <[email protected]>
ppc parts
Quoted 161 lines
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- hw/arm/virt.c | 2 +- hw/core/numa.c | 6 ++++++ hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/ppc/spapr.c | 2 +- qemu-deprecated.texi | 16 ---------------- qemu-options.hx | 8 ++++---- 8 files changed, 14 insertions(+), 23 deletions(-)hw/arm/virt.c +1
-1@@ -2049,7 +2049,6 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) hc->pre_plug = virt_machine_device_pre_plug_cb; hc->plug = virt_machine_device_plug_cb; hc->unplug_request = virt_machine_device_unplug_request_cb; - mc->numa_mem_supported = true; mc->auto_enable_numa_with_memhp = true; mc->default_ram_id ="mach-virt.ram" ; }@@ -2153,6 +2152,7 @@ DEFINE_VIRT_MACHINE_AS_LATEST(5, 0)static void virt_machine_4_2_options (MachineClass *mc) {compat_props_add (mc->compat_props, hw_compat_4_2, hw_compat_4_2_len); + mc->numa_mem_supported = true; }DEFINE_VIRT_MACHINE (4 ,2 )hw/core/numa.c +6
-0@@ -117,6 +117,12 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node, }if (node->has_mem) { +if (!mc->numa_mem_supported) { +error_setg (errp,"Parameter -numa node,mem is not supported by this" +" machine type. Use -numa node,memdev instead" ); +return ; + } + numa_info[nodenr].node_mem = node->mem;if (!qtest_enabled ()) { warn_report("Parameter -numa node,mem is deprecated,"hw/i386/pc.c +0
-1@@ -1947,7 +1947,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) hc->unplug = pc_machine_device_unplug_cb; mc->default_cpu_type =TARGET_DEFAULT_CPU_TYPE ; mc->nvdimm_supported = true; - mc->numa_mem_supported = true; mc->default_ram_id ="pc.ram" ; object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int",hw/i386/pc_piix.c +1
-0@@ -435,6 +435,7 @@ static void pc_i440fx_4_2_machine_options(MachineClass *m)pc_i440fx_5_0_machine_options (m); m->alias =NULL ; m->is_default =0 ; + m->numa_mem_supported = true;compat_props_add (m->compat_props, hw_compat_4_2, hw_compat_4_2_len);compat_props_add (m->compat_props, pc_compat_4_2, pc_compat_4_2_len); }hw/i386/pc_q35.c +1
-0@@ -363,6 +363,7 @@ static void pc_q35_4_2_machine_options(MachineClass *m) {pc_q35_5_0_machine_options (m); m->alias =NULL ; + m->numa_mem_supported = true;compat_props_add (m->compat_props, hw_compat_4_2, hw_compat_4_2_len);compat_props_add (m->compat_props, pc_compat_4_2, pc_compat_4_2_len); }hw/ppc/spapr.c +1
-1@@ -4383,7 +4383,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)* in which LMBs are represented and hot-added */ mc->numa_mem_align_shift =28 ; - mc->numa_mem_supported = true; mc->auto_enable_numa = true; smc->default_caps.caps[SPAPR_CAP_HTM ] =SPAPR_CAP_OFF ;@@ -4465,6 +4464,7 @@ static void spapr_machine_4_2_class_options(MachineClass *mc) {spapr_machine_5_0_class_options (mc);compat_props_add (mc->compat_props, hw_compat_4_2, hw_compat_4_2_len); + mc->numa_mem_supported = true; } DEFINE_SPAPR_MACHINE(4_2, "4.2", false);qemu-deprecated.texi +0
-16@@ -89,22 +89,6 @@ error in the future. The @code{-realtime mlock=on|off} argument has been replaced by the @code{-overcommit mem-lock=on|off} argument. -@subsection -numa node,mem=@var{size} (since 4.1) - -The parameter @option{mem} of @option{-numa node} is used to assign a part of -guest RAM to a NUMA node. But when using it, it's impossible to manage specified -RAM chunk on the host side (like bind it to a host node, setting bind policy, ...), -so guest end-ups with the fake NUMA configuration with suboptiomal performance. -However since 2014 there is an alternative way to assign RAM to a NUMA node -using parameter @option{memdev}, which does the same as @option{mem} and adds -means to actualy manage node RAM on the host side. Use parameter @option{memdev} -with @var{memory-backend-ram} backend as an replacement for parameter @option{mem} -to achieve the same fake NUMA effect or a properly configured -@var{memory-backend-file} backend to actually benefit from NUMA configuration. -In future new machine versions will not accept the option but it will still -work with old machine types. User can check QAPI schema to see if the legacy -option is supported by looking at MachineInfo::numa-mem-supported property. - @subsection -numa node (without memory specified) (since 4.1) Splitting RAM by default between NUMA nodes has the same issues as @option{mem}qemu-options.hx +4
-4@@ -223,10 +223,10 @@ For example: -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1 @end example -@samp{mem} assigns a given RAM amount to a node. @samp{memdev} -assigns RAM from a given memory backend device to a node. If -@samp{mem} and @samp{memdev} are omitted in all nodes, RAM is -split equally between them. +Legacy @samp{mem} assigns a given RAM amount to a node (not supported for 5.0 +and newer machine types). @samp{memdev} assigns RAM from a given memory backend +device to a node. If @samp{mem} and @samp{memdev} are omitted in all nodes, RAM +is split equally between them. @samp{mem} and @samp{memdev} are mutually exclusive. Furthermore, if one node uses @samp{memdev}, all of them have to use it.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
PATCH v2 83/86 tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups
In reply to Igor MammedovUse GString to pass argument to make_cli() so that it would be easy to dynamically change test case arguments from main(). The follow up patch will use it to change RAM size options depending on target.
While at it cleanup 'cli' freeing, using g_autofree annotation.
---
PS:
made as a separate patch so it won't clutter followup testcase changes.
--- tests/qtest/numa-test.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-)
tests/qtest/numa-test.c +14 -24
@@ -14,16 +14,16 @@#include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" -static char *make_cli (const char *generic_cli,const char *test_cli) +static char *make_cli (const GString *generic_cli,const char *test_cli) { -return g_strdup_printf ("%s %s" , generic_cli ? generic_cli :"" , test_cli); +return g_strdup_printf ("%s %s" , generic_cli->str, test_cli); }static void test_mon_explicit (const void *data) { -char *s; -char *cli;QTestState *qts; + g_autofree char *s = NULL; + g_autofree char *cli = NULL; cli =make_cli (data,"-smp 8 " "-numa node,nodeid=0,cpus=0-3 "
@@ -33,17 +33,15 @@ static void test_mon_explicit(const void *data) s =qtest_hmp (qts,"info numa" );g_assert (strstr (s,"node 0 cpus: 0 1 2 3" ));g_assert (strstr (s,"node 1 cpus: 4 5 6 7" )); -g_free (s);qtest_quit (qts); -g_free (cli); }static void test_mon_default (const void *data) { -char *s; -char *cli;QTestState *qts; + g_autofree char *s = NULL; + g_autofree char *cli = NULL; cli =make_cli (data,"-smp 8 -numa node -numa node" ); qts =qtest_init (cli);
@@ -51,17 +49,15 @@ static void test_mon_default(const void *data) s =qtest_hmp (qts,"info numa" );g_assert (strstr (s,"node 0 cpus: 0 2 4 6" ));g_assert (strstr (s,"node 1 cpus: 1 3 5 7" )); -g_free (s);qtest_quit (qts); -g_free (cli); }static void test_mon_partial (const void *data) { -char *s; -char *cli;QTestState *qts; + g_autofree char *s = NULL; + g_autofree char *cli = NULL; cli =make_cli (data,"-smp 8 " "-numa node,nodeid=0,cpus=0-1 "
@@ -71,10 +67,8 @@ static void test_mon_partial(const void *data) s =qtest_hmp (qts,"info numa" );g_assert (strstr (s,"node 0 cpus: 0 1 2 3 6 7" ));g_assert (strstr (s,"node 1 cpus: 4 5" )); -g_free (s);qtest_quit (qts); -g_free (cli); }static QList *get_cpus (QTestState *qts,QDict **resp)
@@ -87,11 +81,11 @@ static QList *get_cpus(QTestState *qts, QDict **resp)static void test_query_cpus (const void *data) { -char *cli;QDict *resp;QList *cpus;QObject *e;QTestState *qts; + g_autofree char *cli = NULL; cli =make_cli (data,"-smp 8 -numa node,cpus=0-3 -numa node,cpus=4-7" ); qts =qtest_init (cli);
@@ -120,16 +114,15 @@ static void test_query_cpus(const void *data)qobject_unref (resp);qtest_quit (qts); -g_free (cli); }static void pc_numa_cpu (const void *data) { -char *cli;QDict *resp;QList *cpus;QObject *e;QTestState *qts; + g_autofree char *cli = NULL; cli =make_cli (data,"-cpu pentium -smp 8,sockets=2,cores=2,threads=2 " "-numa node,nodeid=0 -numa node,nodeid=1 "
@@ -174,16 +167,15 @@ static void pc_numa_cpu(const void *data)qobject_unref (resp);qtest_quit (qts); -g_free (cli); }static void spapr_numa_cpu (const void *data) { -char *cli;QDict *resp;QList *cpus;QObject *e;QTestState *qts; + g_autofree char *cli = NULL; cli =make_cli (data,"-smp 4,cores=4 " "-numa node,nodeid=0 -numa node,nodeid=1 "
@@ -220,16 +212,15 @@ static void spapr_numa_cpu(const void *data)qobject_unref (resp);qtest_quit (qts); -g_free (cli); }static void aarch64_numa_cpu (const void *data) { -char *cli;QDict *resp;QList *cpus;QObject *e;QTestState *qts; + g_autofree char *cli = NULL; cli =make_cli (data,"-smp 2 " "-numa node,nodeid=0 -numa node,nodeid=1 "
@@ -264,7 +255,6 @@ static void aarch64_numa_cpu(const void *data)qobject_unref (resp);qtest_quit (qts); -g_free (cli); }static void pc_dynamic_cpu_cfg (const void *data)
@@ -539,11 +529,11 @@ static void pc_hmat_erange_cfg(const void *data)int main (int argc,char **argv) { -const char *args =NULL ; +g_autoptr (GString) args =g_string_new ("" );const char *arch =qtest_get_arch ();if (strcmp (arch,"aarch64" ) ==0 ) { - args ="-machine virt" ; +g_string_append (args," -machine virt" ); }g_test_init (&argc, &argv,NULL );
Signature · 1 line
2.7.4
Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups
Quoted 5 lines · Igor Mammedov
Use GString to pass argument to
make_cli()so that it would be easy to dynamically change test case arguments frommain(). The follow up patch will use it to change RAM size options depending on target.While at it cleanup 'cli' freeing, using
g_autofreeannotation.
Hmm, I'd use g_autofree for new code or do it in a separate cleanup patch, but doing this here distracts quite a bit from the real changes that you are doing...
Quoted 25 lines
Signed-off-by Igor Mammedov <[email protected]>---
PS:
made as a separate patch so it won't clutter followup testcase changes.--- tests/qtest/numa-test.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-)tests/qtest/numa-test.c +2
-2@@ -14,16 +14,16 @@#include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" -static char *make_cli (const char *generic_cli,const char *test_cli) +static char *make_cli (const GString *generic_cli,const char *test_cli) { -return g_strdup_printf ("%s %s" , generic_cli ? generic_cli :"" , test_cli); +return g_strdup_printf ("%s %s" , generic_cli->str, test_cli); }
[...]
tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data) · line 532
Quoted 6 lines
tests/qtest/numa-test.c +1
-1@@ -539,11 +529,11 @@ static void pc_hmat_erange_cfg(const void *data)int main (int argc,char **argv) { -const char *args =NULL ; +g_autoptr (GString) args =g_string_new ("" );
I think g_string_new(NULL) would be better?
tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data)
Quoted 5 lines
tests/qtest/numa-test.c +1
-1const char *arch =qtest_get_arch ();if (strcmp (arch,"aarch64" ) ==0 ) { - args ="-machine virt" ; + g_string_append(args, " -machine virt")> }
Is this really required? Looking at your next patch, you could also simply do
args = " -object memory-backend-ram,id=ram,size=xxxM"
there? So using a GString seems overkill to me here.
Thomas
Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups
Quoted 10 lines · On Thu, 16 Jan 2020 17:35:32 +0100 Thomas Huth <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov
Use GString to pass argument to
make_cli()so that it would be easy to dynamically change test case arguments frommain(). The follow up patch will use it to change RAM size options depending on target.While at it cleanup 'cli' freeing, using
g_autofreeannotation.Hmm, I'd use
g_autofreefor new code or do it in a separate cleanup patch, but doing this here distracts quite a bit from the real changes that you are doing...
I'll split it into separate patch
Quoted 38 lines
Quoted 26 lines
Signed-off-by Igor Mammedov <[email protected]>---
PS:
made as a separate patch so it won't clutter followup testcase changes.--- tests/qtest/numa-test.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-)tests/qtest/numa-test.c +2
-2@@ -14,16 +14,16 @@#include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" -static char *make_cli (const char *generic_cli,const char *test_cli) +static char *make_cli (const GString *generic_cli,const char *test_cli) { -return g_strdup_printf ("%s %s" , generic_cli ? generic_cli :"" , test_cli); +return g_strdup_printf ("%s %s" , generic_cli->str, test_cli); }[...]
tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data) · line 532
Quoted 6 lines
tests/qtest/numa-test.c +1
-1@@ -539,11 +529,11 @@ static void pc_hmat_erange_cfg(const void *data)int main (int argc,char **argv) { -const char *args =NULL ; +g_autoptr (GString) args =g_string_new ("" );I think
g_string_new(NULL)would be better?Quoted 2 lines
tests/qtest/numa-test.c +0
-0const char *arch =qtest_get_arch ();
Quoted 8 lines
tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data)
Quoted 3 lines
tests/qtest/numa-test.c +1
-1if (strcmp (arch,"aarch64" ) ==0 ) { - args ="-machine virt" ; + g_string_append(args, " -machine virt")> }Is this really required? Looking at your next patch, you could also simply do
args = " -object memory-backend-ram,id=ram,size=xxxM"
xxx is variable so options are
1 build this part of CLI dynamically
2 mostly duplicate testcase function and include per target size there 3 make up a test data structure and pass that to test cases
Given simplicity of current testcases, I'd prefer continue with passing CLI as testcase data (option #1).
Quoted 4 lines
there? So using a GString seems overkill to me here.
Thomas
Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups
Quoted 60 lines · Igor Mammedov
Quoted 10 lines · On Thu, 16 Jan 2020 17:35:32 +0100 Thomas Huth <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov
Use GString to pass argument to
make_cli()so that it would be easy to dynamically change test case arguments frommain(). The follow up patch will use it to change RAM size options depending on target.While at it cleanup 'cli' freeing, using
g_autofreeannotation.Hmm, I'd use
g_autofreefor new code or do it in a separate cleanup patch, but doing this here distracts quite a bit from the real changes that you are doing...I'll split it into separate patch
Quoted 45 lines
Quoted 26 lines
Signed-off-by Igor Mammedov <[email protected]>---
PS:
made as a separate patch so it won't clutter followup testcase changes.--- tests/qtest/numa-test.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-)tests/qtest/numa-test.c +2
-2@@ -14,16 +14,16 @@#include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" -static char *make_cli (const char *generic_cli,const char *test_cli) +static char *make_cli (const GString *generic_cli,const char *test_cli) { -return g_strdup_printf ("%s %s" , generic_cli ? generic_cli :"" , test_cli); +return g_strdup_printf ("%s %s" , generic_cli->str, test_cli); }[...]
tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data) · line 532
Quoted 6 lines
tests/qtest/numa-test.c +1
-1@@ -539,11 +529,11 @@ static void pc_hmat_erange_cfg(const void *data)int main (int argc,char **argv) { -const char *args =NULL ; +g_autoptr (GString) args =g_string_new ("" );I think
g_string_new(NULL)would be better?tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data)
Quoted 5 lines
tests/qtest/numa-test.c +1
-1const char *arch =qtest_get_arch ();if (strcmp (arch,"aarch64" ) ==0 ) { - args ="-machine virt" ; + g_string_append(args, " -machine virt")> }Is this really required? Looking at your next patch, you could also simply do
Quoted 8 lines
Quoted 1 line
args = " -object memory-backend-ram,id=ram,size=xxxM"
xxx is variable so options are
1 build this part of CLI dynamically
2 mostly duplicate testcase function and include per target size there 3 make up a test data structure and pass that to test casesGiven simplicity of current testcases, I'd prefer continue with passing CLI as testcase data (option #1).
Sorry, I think I missed something here... currently I see in the next patch:
+ if (!strcmp(arch, "ppc64")) {
+ g_string_append(args, " -object
memory-backend-ram,id=ram,size=512M");
+ } else {
+ g_string_append(args, " -object
memory-backend-ram,id=ram,size=128M");
+ }
... so these are static strings which could also be handled fine without GString? Or do you plan to update this in later patches?
Thomas
Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups
Quoted 80 lines · On Fri, 17 Jan 2020 12:14:11 +0100 Thomas Huth <[email protected]> wrote:
Quoted 60 lines · Igor Mammedov
Quoted 10 lines · On Thu, 16 Jan 2020 17:35:32 +0100 Thomas Huth <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov
Use GString to pass argument to
make_cli()so that it would be easy to dynamically change test case arguments frommain(). The follow up patch will use it to change RAM size options depending on target.While at it cleanup 'cli' freeing, using
g_autofreeannotation.Hmm, I'd use
g_autofreefor new code or do it in a separate cleanup patch, but doing this here distracts quite a bit from the real changes that you are doing...I'll split it into separate patch
Quoted 45 lines
Quoted 26 lines
Signed-off-by Igor Mammedov <[email protected]>---
PS:
made as a separate patch so it won't clutter followup testcase changes.--- tests/qtest/numa-test.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-)tests/qtest/numa-test.c +2
-2@@ -14,16 +14,16 @@#include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" -static char *make_cli (const char *generic_cli,const char *test_cli) +static char *make_cli (const GString *generic_cli,const char *test_cli) { -return g_strdup_printf ("%s %s" , generic_cli ? generic_cli :"" , test_cli); +return g_strdup_printf ("%s %s" , generic_cli->str, test_cli); }[...]
tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data) · line 532
Quoted 6 lines
tests/qtest/numa-test.c +1
-1@@ -539,11 +529,11 @@ static void pc_hmat_erange_cfg(const void *data)int main (int argc,char **argv) { -const char *args =NULL ; +g_autoptr (GString) args =g_string_new ("" );I think
g_string_new(NULL)would be better?tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data)
Quoted 5 lines
tests/qtest/numa-test.c +1
-1const char *arch =qtest_get_arch ();if (strcmp (arch,"aarch64" ) ==0 ) { - args ="-machine virt" ; + g_string_append(args, " -machine virt")> }Is this really required? Looking at your next patch, you could also simply do
Quoted 8 lines
Quoted 1 line
args = " -object memory-backend-ram,id=ram,size=xxxM"
xxx is variable so options are
1 build this part of CLI dynamically
2 mostly duplicate testcase function and include per target size there 3 make up a test data structure and pass that to test casesGiven simplicity of current testcases, I'd prefer continue with passing CLI as testcase data (option #1).
Sorry, I think I missed something here... currently I see in the next patch:
(quoted diff) +2
-0+ if (!strcmp(arch, "ppc64")) { + g_string_append(args, " -objectmemory-backend-ram,id=ram,size=512M");
(quoted diff) +2
-0+ } else { + g_string_append(args, " -objectmemory-backend-ram,id=ram,size=128M");
+ }
Quoted 2 lines
... so these are static strings which could also be handled fine without GString? Or do you plan to update this in later patches?
it's 1 or concatenation of 2 strings
" -object memory-backend-ram,id=ram,size=128M"
" -object memory-backend-ram,id=ram,size=512M"
" -machine virt" + " -object memory-backend-ram,id=ram,size=128M"
It's possible to use static strings in expense of a bit of duplication and long winded "if" chain. So using dynamic string here, looks better to me.
Quoted 1 line
Thomas
Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups
Quoted 83 lines · Igor Mammedov
Quoted 80 lines · On Fri, 17 Jan 2020 12:14:11 +0100 Thomas Huth <[email protected]> wrote:
Quoted 60 lines · Igor Mammedov
Quoted 10 lines · On Thu, 16 Jan 2020 17:35:32 +0100 Thomas Huth <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov
Use GString to pass argument to
make_cli()so that it would be easy to dynamically change test case arguments frommain(). The follow up patch will use it to change RAM size options depending on target.While at it cleanup 'cli' freeing, using
g_autofreeannotation.Hmm, I'd use
g_autofreefor new code or do it in a separate cleanup patch, but doing this here distracts quite a bit from the real changes that you are doing...I'll split it into separate patch
Quoted 45 lines
Quoted 26 lines
Signed-off-by Igor Mammedov <[email protected]>---
PS:
made as a separate patch so it won't clutter followup testcase changes.--- tests/qtest/numa-test.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-)tests/qtest/numa-test.c +2
-2@@ -14,16 +14,16 @@#include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" -static char *make_cli (const char *generic_cli,const char *test_cli) +static char *make_cli (const GString *generic_cli,const char *test_cli) { -return g_strdup_printf ("%s %s" , generic_cli ? generic_cli :"" , test_cli); +return g_strdup_printf ("%s %s" , generic_cli->str, test_cli); }[...]
tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data) · line 532
Quoted 6 lines
tests/qtest/numa-test.c +1
-1@@ -539,11 +529,11 @@ static void pc_hmat_erange_cfg(const void *data)int main (int argc,char **argv) { -const char *args =NULL ; +g_autoptr (GString) args =g_string_new ("" );I think
g_string_new(NULL)would be better?tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data)
Quoted 5 lines
tests/qtest/numa-test.c +1
-1const char *arch =qtest_get_arch ();if (strcmp (arch,"aarch64" ) ==0 ) { - args ="-machine virt" ; + g_string_append(args, " -machine virt")> }Is this really required? Looking at your next patch, you could also simply do
Quoted 8 lines
Quoted 1 line
args = " -object memory-backend-ram,id=ram,size=xxxM"
xxx is variable so options are
1 build this part of CLI dynamically
2 mostly duplicate testcase function and include per target size there 3 make up a test data structure and pass that to test casesGiven simplicity of current testcases, I'd prefer continue with passing CLI as testcase data (option #1).
Sorry, I think I missed something here... currently I see in the next patch:
(quoted diff) +2
-0+ if (!strcmp(arch, "ppc64")) { + g_string_append(args, " -objectmemory-backend-ram,id=ram,size=512M");
(quoted diff) +2
-0+ } else { + g_string_append(args, " -objectmemory-backend-ram,id=ram,size=128M");
+ }
Quoted 6 lines
Quoted 2 lines
... so these are static strings which could also be handled fine without GString? Or do you plan to update this in later patches?
it's 1 or concatenation of 2 strings
" -object memory-backend-ram,id=ram,size=128M"
" -object memory-backend-ram,id=ram,size=512M"
" -machine virt" + " -object memory-backend-ram,id=ram,size=128M"
Ah, well, that's what I was missing. Since the if-arch-statements follow close to each other, I somehow read 'else if (!strcmp(arch, "ppc64"))' ... sorry for that.
Maybe it's more obvious if you'd do it the other way round, first the "-object" lines, then the "-machine virt" stuff?
Anyway, another note: It's a little bit ugly that one if-statment uses strcmp() != 0 while the other one uses !strcmp() ... since you're using GLIB code here anyway, what do you think about converting them to g_str_equal() instead?
Thomas
Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups
Quoted 97 lines · On Fri, 17 Jan 2020 14:52:35 +0100 Thomas Huth <[email protected]> wrote:
Quoted 83 lines · Igor Mammedov
Quoted 80 lines · On Fri, 17 Jan 2020 12:14:11 +0100 Thomas Huth <[email protected]> wrote:
Quoted 60 lines · Igor Mammedov
Quoted 10 lines · On Thu, 16 Jan 2020 17:35:32 +0100 Thomas Huth <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov
Use GString to pass argument to
make_cli()so that it would be easy to dynamically change test case arguments frommain(). The follow up patch will use it to change RAM size options depending on target.While at it cleanup 'cli' freeing, using
g_autofreeannotation.Hmm, I'd use
g_autofreefor new code or do it in a separate cleanup patch, but doing this here distracts quite a bit from the real changes that you are doing...I'll split it into separate patch
Quoted 45 lines
Quoted 26 lines
Signed-off-by Igor Mammedov <[email protected]>---
PS:
made as a separate patch so it won't clutter followup testcase changes.--- tests/qtest/numa-test.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-)tests/qtest/numa-test.c +2
-2@@ -14,16 +14,16 @@#include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" -static char *make_cli (const char *generic_cli,const char *test_cli) +static char *make_cli (const GString *generic_cli,const char *test_cli) { -return g_strdup_printf ("%s %s" , generic_cli ? generic_cli :"" , test_cli); +return g_strdup_printf ("%s %s" , generic_cli->str, test_cli); }[...]
tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data) · line 532
Quoted 6 lines
tests/qtest/numa-test.c +1
-1@@ -539,11 +529,11 @@ static void pc_hmat_erange_cfg(const void *data)int main (int argc,char **argv) { -const char *args =NULL ; +g_autoptr (GString) args =g_string_new ("" );I think
g_string_new(NULL)would be better?tests/qtest/numa-test.c static void pc_hmat_erange_cfg(const void *data)
Quoted 5 lines
tests/qtest/numa-test.c +1
-1const char *arch =qtest_get_arch ();if (strcmp (arch,"aarch64" ) ==0 ) { - args ="-machine virt" ; + g_string_append(args, " -machine virt")> }Is this really required? Looking at your next patch, you could also simply do
Quoted 8 lines
Quoted 1 line
args = " -object memory-backend-ram,id=ram,size=xxxM"
xxx is variable so options are
1 build this part of CLI dynamically
2 mostly duplicate testcase function and include per target size there 3 make up a test data structure and pass that to test casesGiven simplicity of current testcases, I'd prefer continue with passing CLI as testcase data (option #1).
Sorry, I think I missed something here... currently I see in the next patch:
(quoted diff) +2
-0+ if (!strcmp(arch, "ppc64")) { + g_string_append(args, " -objectmemory-backend-ram,id=ram,size=512M");
(quoted diff) +2
-0+ } else { + g_string_append(args, " -objectmemory-backend-ram,id=ram,size=128M");
+ }Quoted 6 lines
Quoted 2 lines
... so these are static strings which could also be handled fine without GString? Or do you plan to update this in later patches?
it's 1 or concatenation of 2 strings
" -object memory-backend-ram,id=ram,size=128M"
" -object memory-backend-ram,id=ram,size=512M"
" -machine virt" + " -object memory-backend-ram,id=ram,size=128M"Ah, well, that's what I was missing. Since the if-arch-statements follow close to each other, I somehow read 'else if (!strcmp(arch, "ppc64"))' ... sorry for that.
Maybe it's more obvious if you'd do it the other way round, first the "-object" lines, then the "-machine virt" stuff?
Quoted 4 lines
Anyway, another note: It's a little bit ugly that one if-statment uses
strcmp()!= 0 while the other one uses !strcmp() ... since you're using GLIB code here anyway, what do you think about converting them tog_str_equal()instead?
will do that
Quoted 2 lines
Thomas
PATCH v2 84/86 tests:numa-test: use explicit memdev to specify node RAM
In reply to Igor MammedovFollow up patches will remove automatic RAM distribution between nodes and will make default machine types require "memdev" option instead of legacy "mem" option.
Make tests to follow new rules and add an additional test for legacy "mem" option on old machine type, to make sure it won't regress in the future.
---
CC: [email protected]
CC: [email protected]
--- tests/qtest/numa-test.c | 52 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 14 deletions(-)
tests/qtest/numa-test.c +38 -14
@@ -25,9 +25,8 @@ static void test_mon_explicit(const void *data) g_autofree char *s = NULL; g_autofree char *cli = NULL; - cli =make_cli (data,"-smp 8 " -"-numa node,nodeid=0,cpus=0-3 " -"-numa node,nodeid=1,cpus=4-7 " ); + cli =make_cli (data,"-smp 8 -numa node,nodeid=0,memdev=ram,cpus=0-3 " +"-numa node,nodeid=1,cpus=4-7" ); qts =qtest_init (cli); s =qtest_hmp (qts,"info numa" );
@@ -37,13 +36,13 @@ static void test_mon_explicit(const void *data)qtest_quit (qts); } -static void test_mon_default (const void *data) +static void test_def_cpu_split (const void *data) {QTestState *qts; g_autofree char *s = NULL; g_autofree char *cli = NULL; - cli =make_cli (data,"-smp 8 -numa node -numa node" ); + cli =make_cli (data,"-smp 8 -numa node,memdev=ram -numa node" ); qts =qtest_init (cli); s =qtest_hmp (qts,"info numa" );
@@ -53,6 +52,23 @@ static void test_mon_default(const void *data)qtest_quit (qts); } +static void test_pc_legacy_mem (const void *data) +{ +QTestState *qts; + g_autofree char *s = NULL; + g_autofree char *cli = NULL; + + cli =make_cli (data,"-M pc-i440fx-4.2 -smp 8 " +"-numa node,mem=64M -numa node,mem=64M" ); + qts =qtest_init (cli); + + s =qtest_hmp (qts,"info numa" ); +g_assert (strstr (s,"node 0 size: 64 MB" )); +g_assert (strstr (s,"node 1 size: 64 MB" )); + +qtest_quit (qts); +} +static void test_mon_partial (const void *data) {QTestState *qts;
@@ -60,7 +76,7 @@ static void test_mon_partial(const void *data) g_autofree char *cli = NULL; cli =make_cli (data,"-smp 8 " -"-numa node,nodeid=0,cpus=0-1 " +"-numa node,nodeid=0,memdev=ram,cpus=0-1 " "-numa node,nodeid=1,cpus=4-5 " ); qts =qtest_init (cli);
@@ -87,7 +103,8 @@ static void test_query_cpus(const void *data)QTestState *qts; g_autofree char *cli = NULL; - cli =make_cli (data,"-smp 8 -numa node,cpus=0-3 -numa node,cpus=4-7" ); + cli =make_cli (data,"-smp 8 -numa node,memdev=ram,cpus=0-3 " +"-numa node,cpus=4-7" ); qts =qtest_init (cli); cpus =get_cpus (qts, &resp);g_assert (cpus);
@@ -125,7 +142,7 @@ static void pc_numa_cpu(const void *data) g_autofree char *cli = NULL; cli =make_cli (data,"-cpu pentium -smp 8,sockets=2,cores=2,threads=2 " -"-numa node,nodeid=0 -numa node,nodeid=1 " +"-numa node,nodeid=0,memdev=ram -numa node,nodeid=1 " "-numa cpu,node-id=1,socket-id=0 " "-numa cpu,node-id=0,socket-id=1,core-id=0 " "-numa cpu,node-id=0,socket-id=1,core-id=1,thread-id=0 "
@@ -178,7 +195,7 @@ static void spapr_numa_cpu(const void *data) g_autofree char *cli = NULL; cli =make_cli (data,"-smp 4,cores=4 " -"-numa node,nodeid=0 -numa node,nodeid=1 " +"-numa node,nodeid=0,memdev=ram -numa node,nodeid=1 " "-numa cpu,node-id=0,core-id=0 " "-numa cpu,node-id=0,core-id=1 " "-numa cpu,node-id=0,core-id=2 "
@@ -223,7 +240,7 @@ static void aarch64_numa_cpu(const void *data) g_autofree char *cli = NULL; cli =make_cli (data,"-smp 2 " -"-numa node,nodeid=0 -numa node,nodeid=1 " +"-numa node,nodeid=0,memdev=ram -numa node,nodeid=1 " "-numa cpu,node-id=1,thread-id=0 " "-numa cpu,node-id=0,thread-id=1" ); qts =qtest_init (cli);
@@ -263,13 +280,14 @@ static void pc_dynamic_cpu_cfg(const void *data)QDict *resp;QList *cpus;QTestState *qs; + g_autofree char *cli = NULL; - qs =qtest_initf ("%s -nodefaults --preconfig -smp 2" , - data ? (char *)data :"" ); + cli =make_cli (data,"-nodefaults --preconfig -smp 2" ); + qs =qtest_init (cli);/* create 2 numa nodes */ g_assert (!qmp_rsp_is_err (qtest_qmp (qs,"{ 'execute': 'set-numa-node'," -" 'arguments': { 'type': 'node', 'nodeid': 0 } }" ))); +" 'arguments': { 'type': 'node', 'nodeid': 0, 'memdev': 'ram' } }" )));g_assert (!qmp_rsp_is_err (qtest_qmp (qs,"{ 'execute': 'set-numa-node'," " 'arguments': { 'type': 'node', 'nodeid': 1 } }" )));
@@ -535,10 +553,15 @@ int main(int argc, char **argv)if (strcmp (arch,"aarch64" ) ==0 ) {g_string_append (args," -machine virt" ); } +if (!strcmp (arch,"ppc64" )) { +g_string_append (args," -object memory-backend-ram,id=ram,size=512M" ); + }else { +g_string_append (args," -object memory-backend-ram,id=ram,size=128M" ); + }g_test_init (&argc, &argv,NULL ); -qtest_add_data_func ("/numa/mon/default" , args, test_mon_default); +qtest_add_data_func ("/numa/mon/cpus/default" , args, test_def_cpu_split);qtest_add_data_func ("/numa/mon/cpus/explicit" , args, test_mon_explicit);qtest_add_data_func ("/numa/mon/cpus/partial" , args, test_mon_partial);qtest_add_data_func ("/numa/qmp/cpus/query-cpus" , args, test_query_cpus);
@@ -549,6 +572,7 @@ int main(int argc, char **argv)qtest_add_data_func ("/numa/pc/hmat/build" , args, pc_hmat_build_cfg);qtest_add_data_func ("/numa/pc/hmat/off" , args, pc_hmat_off_cfg);qtest_add_data_func ("/numa/pc/hmat/erange" , args, pc_hmat_erange_cfg); +qtest_add_data_func ("/numa/pc/legacy/mem" , args, test_pc_legacy_mem); }if (!strcmp (arch,"ppc64" )) {
Signature · 1 line
2.7.4
PATCH v2 85/86 numa: make exit() usage consistent
In reply to Igor Mammedov---
CC: [email protected]
--- hw/core/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/core/numa.c +2 -2
@@ -718,7 +718,7 @@ void numa_complete_configuration(MachineState *ms)/* Report large node IDs first, to make mistakes easier to spot */ if (!numa_info[i].present) {error_report ("numa: Node ID missing: %d" , i); -exit (1 ); +exit (EXIT_FAILURE ); } }
@@ -759,7 +759,7 @@ void numa_complete_configuration(MachineState *ms)error_report ("total memory for NUMA nodes (0x%" PRIx64")" " should equal RAM size (0x" RAM_ADDR_FMT ")" , numa_total, ram_size); -exit (1 ); +exit (EXIT_FAILURE ); }if (!numa_uses_legacy_mem ()) {
Signature · 1 line
2.7.4
Re: [PATCH v2 85/86] numa: make exit() usage consistent
Quoted 22 lines · Igor Mammedov
Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]--- hw/core/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/core/numa.c +1
-1@@ -718,7 +718,7 @@ void numa_complete_configuration(MachineState *ms)/* Report large node IDs first, to make mistakes easier to spot */ if (!numa_info[i].present) {error_report ("numa: Node ID missing: %d" , i); -exit (1 ); +exit (EXIT_FAILURE ); } }
hw/core/numa.c void numa_complete_configuration(MachineState *ms) · line 765
Quoted 8 lines
hw/core/numa.c +1
-1@@ -759,7 +759,7 @@ void numa_complete_configuration(MachineState *ms)error_report ("total memory for NUMA nodes (0x%" PRIx64")" " should equal RAM size (0x" RAM_ADDR_FMT ")" , numa_total, ram_size); -exit (1 ); +exit (EXIT_FAILURE ); }if (!numa_uses_legacy_mem ()) {
Re: [PATCH v2 85/86] numa: make exit() usage consistent
In reply to Igor MammedovQuoted 21 lines · Igor Mammedov
Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]--- hw/core/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/core/numa.c +1
-1@@ -718,7 +718,7 @@ void numa_complete_configuration(MachineState *ms)/* Report large node IDs first, to make mistakes easier to spot */ if (!numa_info[i].present) {error_report ("numa: Node ID missing: %d" , i); -exit (1 ); +exit (EXIT_FAILURE ); } }
hw/core/numa.c void numa_complete_configuration(MachineState *ms) · line 765
Quoted 8 lines
hw/core/numa.c +1
-1@@ -759,7 +759,7 @@ void numa_complete_configuration(MachineState *ms)error_report ("total memory for NUMA nodes (0x%" PRIx64")" " should equal RAM size (0x" RAM_ADDR_FMT ")" , numa_total, ram_size); -exit (1 ); +exit (EXIT_FAILURE ); }if (!numa_uses_legacy_mem ()) {
Please don't. We've had exit(1) vs. exit(EXIT_FAILURE) discussions in the past already, and IIRC there was no clear conclusion which one we want to use. There are examples of changes to the numeric value in our git history (see d54e4d7659ebecd0e1fa7ffc3e954197e09f8a1f for example), and example of the other way round (see 4d1275c24d5d64d22ec4a30ce1b6a0 for example).
Your patch series here is already big enough, so I suggest to drop this patch from the series. If you want to change this, please suggest an update to CODING_STYLE.rst first so that we agree upon one style for exit() ... otherwise somebody else might change this back into numeric values in a couple of months just because they have a different taste.
Thomas
Re: [PATCH v2 85/86] numa: make exit() usage consistent
Quoted 38 lines · On Thu, 16 Jan 2020 17:43:30 +0100 Thomas Huth <[email protected]> wrote:
Quoted 21 lines · Igor Mammedov
Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]--- hw/core/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/core/numa.c +1
-1@@ -718,7 +718,7 @@ void numa_complete_configuration(MachineState *ms)/* Report large node IDs first, to make mistakes easier to spot */ if (!numa_info[i].present) {error_report ("numa: Node ID missing: %d" , i); -exit (1 ); +exit (EXIT_FAILURE ); } }hw/core/numa.c void numa_complete_configuration(MachineState *ms) · line 765
Quoted 8 lines
hw/core/numa.c +1
-1@@ -759,7 +759,7 @@ void numa_complete_configuration(MachineState *ms)error_report ("total memory for NUMA nodes (0x%" PRIx64")" " should equal RAM size (0x" RAM_ADDR_FMT ")" , numa_total, ram_size); -exit (1 ); +exit (EXIT_FAILURE ); }if (!numa_uses_legacy_mem ()) {Please don't. We've had exit(1) vs.
exit(EXIT_FAILURE)discussions in the past already, and IIRC there was no clear conclusion which one we want to use. There are examples of changes to the numeric value in our git history (seed54e4d7659ebecd0e1fa7ffc3e954197e09f8a1ffor example), and example of the other way round (see4d1275c24d5d64d22ec4a30ce1b6a0for example).
Quoted 5 lines
Your patch series here is already big enough, so I suggest to drop this patch from the series. If you want to change this, please suggest an update to
CODING_STYLE.rstfirst so that we agree upon one style forexit()... otherwise somebody else might change this back into numeric values in a couple of months just because they have a different taste.
Ok, will do.
There are other patches that introduce new exit(EXIT_FAILURE), is it fine to use that or should I stick to the style used in nearby code?
Quoted 2 lines
Thomas
Re: [PATCH v2 85/86] numa: make exit() usage consistent
Quoted 47 lines · Igor Mammedov
Quoted 38 lines · On Thu, 16 Jan 2020 17:43:30 +0100 Thomas Huth <[email protected]> wrote:
Quoted 21 lines · Igor Mammedov
Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]--- hw/core/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/core/numa.c +1
-1@@ -718,7 +718,7 @@ void numa_complete_configuration(MachineState *ms)/* Report large node IDs first, to make mistakes easier to spot */ if (!numa_info[i].present) {error_report ("numa: Node ID missing: %d" , i); -exit (1 ); +exit (EXIT_FAILURE ); } }hw/core/numa.c void numa_complete_configuration(MachineState *ms) · line 765
Quoted 8 lines
hw/core/numa.c +1
-1@@ -759,7 +759,7 @@ void numa_complete_configuration(MachineState *ms)error_report ("total memory for NUMA nodes (0x%" PRIx64")" " should equal RAM size (0x" RAM_ADDR_FMT ")" , numa_total, ram_size); -exit (1 ); +exit (EXIT_FAILURE ); }if (!numa_uses_legacy_mem ()) {Please don't. We've had exit(1) vs.
exit(EXIT_FAILURE)discussions in the past already, and IIRC there was no clear conclusion which one we want to use. There are examples of changes to the numeric value in our git history (seed54e4d7659ebecd0e1fa7ffc3e954197e09f8a1ffor example), and example of the other way round (see4d1275c24d5d64d22ec4a30ce1b6a0for example).Quoted 5 lines
Your patch series here is already big enough, so I suggest to drop this patch from the series. If you want to change this, please suggest an update to
CODING_STYLE.rstfirst so that we agree upon one style forexit()... otherwise somebody else might change this back into numeric values in a couple of months just because they have a different taste.
Quoted 4 lines
Ok, will do.
There are other patches that introduce new
exit(EXIT_FAILURE), is it fine to use that or should I stick to the style used in nearby code?
Since we don't have a consensus yet, I guess it's ok to use it ... but adapting to the surrounding code is also a good idea, of course.
Thomas
Re: [PATCH v2 85/86] numa: make exit() usage consistent
In reply to Thomas HuthHi Thomas,
Quoted 38 lines · Thomas Huth
Quoted 21 lines · Igor Mammedov
Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]--- hw/core/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/core/numa.c +1
-1@@ -718,7 +718,7 @@ void numa_complete_configuration(MachineState *ms)/* Report large node IDs first, to make mistakes easier to spot */ if (!numa_info[i].present) {error_report ("numa: Node ID missing: %d" , i); -exit (1 ); +exit (EXIT_FAILURE ); } }hw/core/numa.c void numa_complete_configuration(MachineState *ms) · line 765
Quoted 8 lines
hw/core/numa.c +1
-1@@ -759,7 +759,7 @@ void numa_complete_configuration(MachineState *ms)error_report ("total memory for NUMA nodes (0x%" PRIx64")" " should equal RAM size (0x" RAM_ADDR_FMT ")" , numa_total, ram_size); -exit (1 ); +exit (EXIT_FAILURE ); }if (!numa_uses_legacy_mem ()) {Please don't. We've had exit(1) vs.
exit(EXIT_FAILURE)discussions in the past already, and IIRC there was no clear conclusion which one we want to use. There are examples of changes to the numeric value in our git history (seed54e4d7659ebecd0e1fa7ffc3e954197e09f8a1ffor example), and example of the other way round (see4d1275c24d5d64d22ec4a30ce1b6a0for example).
Quoted 5 lines
Your patch series here is already big enough, so I suggest to drop this patch from the series. If you want to change this, please suggest an update to
CODING_STYLE.rstfirst so that we agree upon one style forexit()... otherwise somebody else might change this back into numeric values in a couple of months just because they have a different taste.
TBH I find your suggestion a bit harsh. If you noticed this, it means you care about finding a consensus about which style the project should use, but then you ask Igor to update to CODING_STYLE to restart the discussion until we get an agreement, so he can apply his patch.
If this patch were single, this could be understandable. Now considering the series size, as you suggested, as the patch author I'd obviously drop my patch and stay away of modifying a 'exit()' line forever.
Maybe it is a good opportunity to restart the discussion and settle on a position, update CODING_STYLE.rst, do a global cleanup, update checkpatch to keep the code clean. As I don't remember such discussions, they might predate my involvement with the project. Do you mind starting a thread with pointers to the previous discussions?
Thanks,
Phil.
Re: [PATCH v2 85/86] numa: make exit() usage consistent
Quoted 56 lines · Philippe Mathieu-Daudé
Hi Thomas,
Quoted 38 lines · Thomas Huth
Quoted 21 lines · Igor Mammedov
Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
---
hw/core/numa.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)hw/core/numa.c +0
-0@@ -718,7 +718,7 @@ void numa_complete_configuration(MachineState *ms) /* Report large node IDs first, to make mistakes easier tospot */
if (!numa_info[i].present) {
error_report("numa: Node ID missing: %d", i); - exit(1);
+exit(EXIT_FAILURE);
}
}
@@ -759,7 +759,7 @@ voidnuma_complete_configuration(MachineState *ms)Quoted 8 lines
error_report("total memory for NUMA nodes (0x%" PRIx64 ")" " should equal RAM size (0x"
RAM_ADDR_FMT")",
numa_total,ram_size);
- exit(1);
+exit(EXIT_FAILURE);
}
if (!numa_uses_legacy_mem()) {Please don't. We've had exit(1) vs.
exit(EXIT_FAILURE)discussions in the past already, and IIRC there was no clear conclusion which one we want to use. There are examples of changes to the numeric value in our git history (seed54e4d7659ebecd0e1fa7ffc3e954197e09f8a1ffor example), and example of the other way round (see4d1275c24d5d64d22ec4a30ce1b6a0for example).Quoted 5 lines
Your patch series here is already big enough, so I suggest to drop this patch from the series. If you want to change this, please suggest an update to
CODING_STYLE.rstfirst so that we agree upon one style forexit()... otherwise somebody else might change this back into numeric values in a couple of months just because they have a different taste.TBH I find your suggestion a bit harsh. If you noticed this, it means you care about finding a consensus about which style the project should use, but then you ask Igor to update to
CODING_STYLEto restart the discussion until we get an agreement, so he can apply his patch.If this patch were single, this could be understandable. Now considering the series size, as you suggested, as the patch author I'd obviously drop my patch and stay away of modifying a '
exit()' line forever.
Quoted 6 lines
Maybe it is a good opportunity to restart the discussion and settle on a position, update
CODING_STYLE.rst, do a global cleanup, update checkpatch to keep the code clean.
As I don't remember such discussions, they might predate my involvement with the project. Do you mind starting a thread with pointers to the previous discussions?
Honestly, I don't care much whether we use exit(EXIT_FAILURE) or exit(1). But I care about having less code churn, so that "git blame" stays somewhat usable in the course of time, i.e. I really like to avoid that we include such ping-pong patches where every author changes such lines to their current taste.
Thus if someone really cares to change such matter-of-taste code lines, I think it's fair to ask them to update CODING_STYLE first. Otherwise, yes, please just leave the exit() lines as they are to avoid unnecessary code churn.
Thanks,
Thomas
Re: [PATCH v2 85/86] numa: make exit() usage consistent
Quoted 70 lines · Thomas Huth
Quoted 56 lines · Philippe Mathieu-Daudé
Hi Thomas,
Quoted 38 lines · Thomas Huth
Quoted 21 lines · Igor Mammedov
Signed-off-by Igor Mammedov <[email protected]>---
CC: [email protected]
---
hw/core/numa.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)hw/core/numa.c +0
-0@@ -718,7 +718,7 @@ void numa_complete_configuration(MachineState *ms) /* Report large node IDs first, to make mistakes easier tospot */
if (!numa_info[i].present) {
error_report("numa: Node ID missing: %d", i); - exit(1);
+exit(EXIT_FAILURE);
}
}
@@ -759,7 +759,7 @@ voidnuma_complete_configuration(MachineState *ms)Quoted 8 lines
error_report("total memory for NUMA nodes (0x%" PRIx64 ")" " should equal RAM size (0x"
RAM_ADDR_FMT")",
numa_total,ram_size);
- exit(1);
+exit(EXIT_FAILURE);
}
if (!numa_uses_legacy_mem()) {Please don't. We've had exit(1) vs.
exit(EXIT_FAILURE)discussions in the past already, and IIRC there was no clear conclusion which one we want to use. There are examples of changes to the numeric value in our git history (seed54e4d7659ebecd0e1fa7ffc3e954197e09f8a1ffor example), and example of the other way round (see4d1275c24d5d64d22ec4a30ce1b6a0for example).Quoted 5 lines
Your patch series here is already big enough, so I suggest to drop this patch from the series. If you want to change this, please suggest an update to
CODING_STYLE.rstfirst so that we agree upon one style forexit()... otherwise somebody else might change this back into numeric values in a couple of months just because they have a different taste.TBH I find your suggestion a bit harsh. If you noticed this, it means you care about finding a consensus about which style the project should use, but then you ask Igor to update to
CODING_STYLEto restart the discussion until we get an agreement, so he can apply his patch.If this patch were single, this could be understandable. Now considering the series size, as you suggested, as the patch author I'd obviously drop my patch and stay away of modifying a '
exit()' line forever.Quoted 6 lines
Maybe it is a good opportunity to restart the discussion and settle on a position, update
CODING_STYLE.rst, do a global cleanup, update checkpatch to keep the code clean.
As I don't remember such discussions, they might predate my involvement with the project. Do you mind starting a thread with pointers to the previous discussions?Honestly, I don't care much whether we use
exit(EXIT_FAILURE)or exit(1). But I care about having less code churn, so that "git blame" stays somewhat usable in the course of time, i.e. I really like to avoid that we include such ping-pong patches where every author changes such lines to their current taste.
Quoted 4 lines
Thus if someone really cares to change such matter-of-taste code lines, I think it's fair to ask them to update
CODING_STYLEfirst. Otherwise, yes, please just leave theexit()lines as they are to avoid unnecessary code churn.
By the way:
$ grep -r 'exit(1)' * | wc -l 795 $ grep -r 'exit(EXIT_FAILURE)' * | wc -l 205
... that indicates that we should maybe rather go with exit(1) instead of exit(EXIT_FAILURE).
Thomas
PATCH v2 86/86 numa: remove deprecated implicit RAM distribution between nodes
In reply to Igor MammedovFeature has been deprecated since 4.1 (4bb4a273),
remove it.
As result if RAM distribution wasn't specified explicitly, the machine won't start and CLI should be changed to explicitly assign RAM to nodes using options:
-node node,memdev (5.0 and newer machine types)
-node node,mem (4.2 and older machine types)
It's recommended to use "memdev" variant for new virtual machines and use "mem" only when it's necessary to migrate already existing virtual machine started with implicit RAM distribution.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- include/hw/boards.h | 3 --- include/sysemu/numa.h | 4 ---- hw/core/machine.c | 6 ----- hw/core/numa.c | 61 +++++---------------------------------------------- hw/i386/pc_piix.c | 1 - hw/i386/pc_q35.c | 1 - hw/ppc/spapr.c | 7 ------ qemu-deprecated.texi | 8 ------- qemu-options.hx | 16 +++++++------- 9 files changed, 13 insertions(+), 94 deletions(-)
include/hw/boards.h +0 -3
@@ -192,12 +192,9 @@ struct MachineClass {int minimum_page_bits;bool has_hotpluggable_cpus;bool ignore_memory_transaction_failures; -int numa_mem_align_shift;const char **valid_cpu_types;strList *allowed_dynamic_sysbus_devices;bool auto_enable_numa_with_memhp; -void (*numa_auto_assign_ram)(MachineClass *mc,NodeInfo *nodes, -int nb_nodes,ram_addr_t size);bool ignore_boot_device_suffixes;bool smbus_no_migration_support;bool nvdimm_supported;
include/sysemu/numa.h +0 -4
@@ -106,10 +106,6 @@ void parse_numa_hmat_cache(MachineState *ms, NumaHmatCacheOptions *node,void numa_complete_configuration (MachineState *ms);void query_numa_node_mem (NumaNodeMem node_mem[],MachineState *ms);extern QemuOptsList qemu_numa_opts; -void numa_legacy_auto_assign_ram (MachineClass *mc,NodeInfo *nodes, -int nb_nodes,ram_addr_t size); -void numa_default_auto_assign_ram (MachineClass *mc,NodeInfo *nodes, -int nb_nodes,ram_addr_t size);void numa_cpu_pre_plug (const struct CPUArchId *slot,DeviceState *dev,Error **errp);bool numa_uses_legacy_mem (void );
hw/core/machine.c +0 -6
@@ -747,12 +747,6 @@ static void machine_class_init(ObjectClass *oc, void *data) mc->rom_file_has_mr = true; mc->smp_parse = smp_parse; -/* numa node memory size aligned on 8MB by default. -* On Linux, each node's border has to be 8MB aligned -*/ - mc->numa_mem_align_shift =23 ; - mc->numa_auto_assign_ram = numa_default_auto_assign_ram; -object_class_property_add_str (oc,"kernel" , machine_get_kernel, machine_set_kernel, &error_abort); object_class_property_set_description(oc, "kernel",
hw/core/numa.c +5 -56
77 lines not on this page · raw message
hw/i386/pc_piix.c +0 -1
@@ -532,7 +532,6 @@ static void pc_i440fx_2_9_machine_options(MachineClass *m)pc_i440fx_2_10_machine_options (m);compat_props_add (m->compat_props, hw_compat_2_9, hw_compat_2_9_len);compat_props_add (m->compat_props, pc_compat_2_9, pc_compat_2_9_len); - m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; } DEFINE_I440FX_MACHINE(v2_9, "pc-i440fx-2.9", NULL,
hw/i386/pc_q35.c +0 -1
@@ -466,7 +466,6 @@ static void pc_q35_2_10_machine_options(MachineClass *m)pc_q35_2_11_machine_options (m);compat_props_add (m->compat_props, hw_compat_2_10, hw_compat_2_10_len);compat_props_add (m->compat_props, pc_compat_2_10, pc_compat_2_10_len); - m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; m->auto_enable_numa_with_memhp = false; }
hw/ppc/spapr.c +0 -7
@@ -4378,11 +4378,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) xic->ics_resend = spapr_ics_resend; xic->icp_get = spapr_icp_get; ispc->print_info = spapr_pic_print_info; -/* Force NUMA node memory size to be a multiple of -* SPAPR_MEMORY_BLOCK_SIZE (256M) since that's the granularity -* in which LMBs are represented and hot-added -*/ - mc->numa_mem_align_shift =28 ; mc->auto_enable_numa = true; smc->default_caps.caps[SPAPR_CAP_HTM ] =SPAPR_CAP_OFF ;
@@ -4635,7 +4630,6 @@ static void spapr_machine_2_9_class_options(MachineClass *mc)spapr_machine_2_10_class_options (mc);compat_props_add (mc->compat_props, hw_compat_2_9, hw_compat_2_9_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); - mc->numa_auto_assign_ram = numa_legacy_auto_assign_ram; smc->pre_2_10_has_unused_icps = true; smc->resize_hpt_default =SPAPR_RESIZE_HPT_DISABLED ; }
@@ -4655,7 +4649,6 @@ static void spapr_machine_2_8_class_options(MachineClass *mc)spapr_machine_2_9_class_options (mc);compat_props_add (mc->compat_props, hw_compat_2_8, hw_compat_2_8_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); - mc->numa_mem_align_shift =23 ; } DEFINE_SPAPR_MACHINE(2_8, "2.8", false);
qemu-deprecated.texi +0 -8
@@ -89,14 +89,6 @@ error in the future. The @code{-realtime mlock=on|off} argument has been replaced by the @code{-overcommit mem-lock=on|off} argument. -@subsection -numa node (without memory specified) (since 4.1) - -Splitting RAM by default between NUMA nodes has the same issues as @option{mem} -parameter described above with the difference that the role of the user plays -QEMU using implicit generic or board specific splitting rule. -Use @option{memdev} with @var{memory-backend-ram} backend or @option{mem} (if -it's supported by used machine type) to define mapping explictly instead. - @subsection RISC-V -bios (since 4.1) QEMU 4.1 introduced support for the -bios option in QEMU for RISC-V for the
qemu-options.hx +8 -8
@@ -172,16 +172,16 @@ If any on the three values is given, the total number of CPUs @var{n} can be omi ETEXI DEF("numa", HAS_ARG, QEMU_OPTION_numa, - "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" - "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" + "-numa node,mem=size[,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" + "-numa node,memdev=id[,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" "-numa dist,src=source,dst=destination,val=distance\n" "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n" "-numa hmat-lb,initiator=node,target=node,hierarchy=memory|first-level|second-level|third-level,data-type=access-latency|read-latency|write-latency[,latency=lat][,bandwidth=bw]\n" "-numa hmat-cache,node-id=node,size=size,level=level[,associativity=none|direct|complex][,policy=none|write-back|write-through][,line=size]\n", QEMU_ARCH_ALL) STEXI -@item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}][,initiator=@var{initiator}] -@itemx -numa node[,memdev=@var{id}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}][,initiator=@var{initiator}] +@item -numa node,mem=@var{size}[,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}][,initiator=@var{initiator}] +@itemx -numa node,memdev=@var{id}[,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}][,initiator=@var{initiator}] @itemx -numa dist,src=@var{source},dst=@var{destination},val=@var{distance} @itemx -numa cpu,node-id=@var{node}[,socket-id=@var{x}][,core-id=@var{y}][,thread-id=@var{z}] @itemx -numa hmat-lb,initiator=@var{node},target=@var{node},hierarchy=@var{hierarchy},data-type=@var{tpye}[,latency=@var{lat}][,bandwidth=@var{bw}]
@@ -202,7 +202,7 @@ split between them. For example, the following option assigns VCPUs 0, 1, 2 and 5 to a NUMA node: @example --numa node,cpus=0-2,cpus=5 +-numa node,cpus=0-2,cpus=5,memdev=ram-backend-id @end example @samp{cpu} option is a new alternative to @samp{cpus} option
@@ -219,14 +219,14 @@ For example: @example -M pc \ -smp 1,sockets=2,maxcpus=2 \ --numa node,nodeid=0 -numa node,nodeid=1 \ +-m 512M -object memory-backend-ram,id=mem,size=512M \ +-numa node,nodeid=0,memdev=mem -numa node,nodeid=1 \ -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1 @end example Legacy @samp{mem} assigns a given RAM amount to a node (not supported for 5.0 and newer machine types). @samp{memdev} assigns RAM from a given memory backend -device to a node. If @samp{mem} and @samp{memdev} are omitted in all nodes, RAM -is split equally between them. +device to a node. @samp{mem} and @samp{memdev} are mutually exclusive. Furthermore, if one node uses @samp{memdev}, all of them have to use it.
Signature · 1 line
2.7.4
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===
TEST iotest-qcow2: 217socket_accept failed: Resource temporarily unavailable
**
ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)/tmp/qemu-test/src/tests/qtest/libqtest.c:140: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)
make: *** [check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs....
TEST check-qtest-aarch64: tests/qtest/test-hmp
TEST iotest-qcow2: 220
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=12c9dd935934490eafad943ba0236226', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-r7by0ks3/src/docker-src.2020-01-15-11.30.32.23980:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=12c9dd935934490eafad943ba0236226
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-r7by0ks3/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 12m1.521s
user 0m8.822s
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Subject: [PATCH v2 00/86] refactor main RAM allocation to use hostmem backend
Type: series
Message-id: [email protected]
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Switched to a new branch 'test'
1209a36 numa: remove deprecated implicit RAM distribution between nodes 19d06fb numa: make exit() usage consistent
7f1c3cb tests:numa-test: use explicit memdev to specify node RAM 1f9e2a0 tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups 599a9d5 numa: forbid '-numa node, mem' for 5.0 and newer machine types abc7dcb hostmem: fix strict bind policy
f128425 hostmem: introduce "prealloc-threads" property
29a5753 make mem_path local variable
9c8eede exec: drop bogus mem_path from qemu_ram_alloc_from_fd() ae8a358 exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize() bd38eb7 post conversion default_ram_id cleanup
531214b remove no longer used memory_region_allocate_system_memory() 9aa9b21 sparc:niagara: use memdev for RAM
7501234 sparc:sun4m: use memdev for RAM
362d299 sparc:leon3: use memdev for RAM
3d80e73 ppc:virtex_ml507: use memdev for RAM
3f9b614 ppc:virtex_ml507: remove unused arguments
23206b2 ppc:spapr: use memdev for RAM
21d8ec6 ppc:prep: use memdev for RAM
b2dfc41 ppc:ppc440_bamboo/sam460ex: use memdev for RAM
f7dba1d ppc/{ppc440_bamboo,sam460x}: drop RAM size fixup
6797fc9 ppc:ppc405_boards: use memdev for RAM
6589023 ppc:ppc405_boards: add RAM size checks
f4e844d ppc:pnv: use memdev for RAM
7a5c1e0 ppc:mac_oldworld: use memdev for RAM
c0070ff ppc:mac_newworld: use memdev for RAM
891c437 ppc:e500: use memdev for RAM
e356db0 ppc:e500: drop RAM size fixup
d9d748a mips:mips_r4k: use memdev for RAM
c3aeedd mips:mips_mipssim: use memdev for RAM
f1ae813 mips:mips_malta: use memdev for RAM
8135812 mips:mips_jazz: use memdev for RAM
6bb5173 mips:mips_fulong2e: use memdev for RAM
7918bc6 mips:mips_fulong2e: drop RAM size fixup
03ed964 mips:boston-cube: use memdev for RAM
50de1db m68k:next-cube: use memdev for RAM
11359d6 m68k:mcf5208: use memdev for RAM
0f6e187 m68k:an5206: use memdev for RAM
1dbf590 lm32:milkymist: use memdev for RAM
1ec9f92 lm32:lm32_boards: use memdev for RAM
cfda441 x86:pc: use memdev for RAM
cf3880a x86:microvm: use memdev for RAM
bd518f7 hppa: use memdev for RAM
4fc8795 hw/hppa/machine: Map the PDC memory region with higher priority 8198bbb hw/hppa/machine: Restrict the total memory size to 3GB b734915 hw/hppa/machine: Correctly check the firmware is in PDC range f132881 cris:axis_dev88: use memdev for RAM
afed772 null-machine: use memdev for RAM
42efb21 s390x:s390-virtio-ccw: use memdev for RAM
e09d9d5 arm:xlnx-zcu102: use memdev for RAM
f4cfdc5 arm:xlnx-versal-virt: use memdev for RAM
27cb15f arm:xilinx_zynq: use memdev for RAM
c4d7543 arm:xilinx_zynq: drop RAM size fixup
4cee731 arm:virt: use memdev for RAM
bc8706f arm:vexpress: use memdev for RAM
8f9a8d5 arm:versatilepb: use memdev for RAM
7534670 arm:sbsa-ref: use memdev for RAM
f7a5bd5 arm:sabrelite: use memdev for RAM
c543136 arm:raspi: use memdev for RAM
1980a99 arm:palm: use memdev for RAM
f2a8a27 arm:omap_sx1: use memdev for RAM
83e43bd arm:nseries: use memdev for RAM
ce56f6f arm:musicpal: use memdev for RAM
8d8a3df arm:mps2: use memdev for RAM
cde4e5c arm:mps2-tz: use memdev for RAM
496e1ec arm:mcimx7d-sabre: use memdev for RAM
107798d arm:mcimx6ul-evk: use memdev for RAM
2aad52a arm:kzm: use memdev for RAM
931e8ed arm:kzm: drop RAM size fixup
3a6db19 arm:integratorcp: use memdev for RAM
7027643 arm:imx25_pdk: use memdev for RAM
34af242 arm:imx25_pdk: drop RAM size fixup
40d5268 arm:highbank: use memdev for RAM
7b39bf2 arm:digic_boards: use memdev for RAM
4ce882d arm:cubieboard: use memdev for RAM
9e5f1e4 arm:collie: use memdev for RAM
4271c25 arm:aspeed: use memdev for RAM
51eb68b hw:aspeed: drop warning and bogus ram_size fixup
d19f874 arm:aspeed: actually check RAM size
5e95ab5 arm:aspeed: convert valid RAM sizes to data
b9b1823 alpha:dp264: use memdev for RAM
54d3324 initialize MachineState::ram in NUMA case
a905e67 machine: introduce convenience MachineState::ram
c4baa19 machine: alias -mem-path and -mem-prealloc into memory-foo backend f4626dd machine: introduce ram-memdev property
c37dfff numa: remove deprecated -mem-path fallback to anonymous RAM
=== OUTPUT BEGIN ===
1/86 Checking commit c37dfffa4efd (numa: remove deprecated -mem-path fallback to anonymous RAM) 2/86 Checking commit f4626dd69b26 (machine: introduce ram-memdev property)
3/86 Checking commit c4baa192a911 (machine: alias -mem-path and -mem-prealloc into memory-foo backend) 4/86 Checking commit a905e67b7c6f (machine: introduce convenience MachineState::ram) 5/86 Checking commit 54d3324c4016 (initialize MachineState::ram in NUMA case)
6/86 Checking commit b9b1823833a3 (alpha:dp264: use memdev for RAM)
ERROR: spaces required around that '*' (ctx:WxV)
#30: FILE: hw/alpha/alpha_sys.h:14:
+PCIBus *typhoon_init(MemoryRegion *, ISABus **, qemu_irq *, AlphaCPU *[4],
^
total: 1 errors, 0 warnings, 49 lines checked
Patch 6/86 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
7/86 Checking commit 5e95ab5c9cbf (arm:aspeed: convert valid RAM sizes to data)
8/86 Checking commit d19f87410bb0 (arm:aspeed: actually check RAM size)
9/86 Checking commit 51eb68b5b6dd (hw:aspeed: drop warning and bogus ram_size fixup)
10/86 Checking commit 4271c257d2dc (arm:aspeed: use memdev for RAM)
11/86 Checking commit 9e5f1e40a8a1 (arm:collie: use memdev for RAM)
12/86 Checking commit 4ce882df0248 (arm:cubieboard: use memdev for RAM)
13/86 Checking commit 7b39bf2154ee (arm:digic_boards: use memdev for RAM)
14/86 Checking commit 40d526890ff2 (arm:highbank: use memdev for RAM)
15/86 Checking commit 34af2429cba4 (arm:imx25_pdk: drop RAM size fixup)
16/86 Checking commit 702764368746 (arm:imx25_pdk: use memdev for RAM)
17/86 Checking commit 3a6db19653b8 (arm:integratorcp: use memdev for RAM)
18/86 Checking commit 931e8edc73be (arm:kzm: drop RAM size fixup)
19/86 Checking commit 2aad52a98a7f (arm:kzm: use memdev for RAM)
20/86 Checking commit 107798df7551 (arm:mcimx6ul-evk: use memdev for RAM)
21/86 Checking commit 496e1ec4c802 (arm:mcimx7d-sabre: use memdev for RAM)
22/86 Checking commit cde4e5c62e6c (arm:mps2-tz: use memdev for RAM)
23/86 Checking commit 8d8a3df592ff (arm:mps2: use memdev for RAM)
24/86 Checking commit ce56f6fa5c27 (arm:musicpal: use memdev for RAM)
25/86 Checking commit 83e43bd9c245 (arm:nseries: use memdev for RAM)
26/86 Checking commit f2a8a2703e2c (arm:omap_sx1: use memdev for RAM)
27/86 Checking commit 1980a9933328 (arm:palm: use memdev for RAM)
28/86 Checking commit c54313643e04 (arm:raspi: use memdev for RAM)
29/86 Checking commit f7a5bd5a1a37 (arm:sabrelite: use memdev for RAM)
30/86 Checking commit 75346700226a (arm:sbsa-ref: use memdev for RAM)
31/86 Checking commit 8f9a8d5832e9 (arm:versatilepb: use memdev for RAM)
32/86 Checking commit bc8706f5e2d5 (arm:vexpress: use memdev for RAM)
33/86 Checking commit 4cee731800bb (arm:virt: use memdev for RAM)
34/86 Checking commit c4d7543f065b (arm:xilinx_zynq: drop RAM size fixup)
35/86 Checking commit 27cb15f0d997 (arm:xilinx_zynq: use memdev for RAM)
36/86 Checking commit f4cfdc5a94bb (arm:xlnx-versal-virt: use memdev for RAM)
37/86 Checking commit e09d9d544217 (arm:xlnx-zcu102: use memdev for RAM)
38/86 Checking commit 42efb216e23c (s390x:s390-virtio-ccw: use memdev for RAM)
39/86 Checking commit afed77250a9e (null-machine: use memdev for RAM)
40/86 Checking commit f132881e85cd (cris:axis_dev88: use memdev for RAM)
41/86 Checking commit b734915b4a79 (hw/hppa/machine: Correctly check the firmware is in PDC range) 42/86 Checking commit 8198bbbb80a8 (hw/hppa/machine: Restrict the total memory size to 3GB) 43/86 Checking commit 4fc879584148 (hw/hppa/machine: Map the PDC memory region with higher priority) 44/86 Checking commit bd518f7b1afe (hppa: use memdev for RAM)
45/86 Checking commit cf3880ae2cde (x86:microvm: use memdev for RAM)
46/86 Checking commit cfda4411481a (x86:pc: use memdev for RAM)
47/86 Checking commit 1ec9f92af351 (lm32:lm32_boards: use memdev for RAM)
48/86 Checking commit 1dbf590a6f2e (lm32:milkymist: use memdev for RAM)
49/86 Checking commit 0f6e18798454 (m68k:an5206: use memdev for RAM)
50/86 Checking commit 11359d6d7fca (m68k:mcf5208: use memdev for RAM)
51/86 Checking commit 50de1db70670 (m68k:next-cube: use memdev for RAM)
52/86 Checking commit 03ed96483838 (mips:boston-cube: use memdev for RAM)
53/86 Checking commit 7918bc615c00 (mips:mips_fulong2e: drop RAM size fixup)
54/86 Checking commit 6bb51739bef8 (mips:mips_fulong2e: use memdev for RAM)
55/86 Checking commit 8135812a7f8f (mips:mips_jazz: use memdev for RAM)
56/86 Checking commit f1ae813bc679 (mips:mips_malta: use memdev for RAM)
57/86 Checking commit c3aeedd1f9e7 (mips:mips_mipssim: use memdev for RAM)
58/86 Checking commit d9d748a3c5c4 (mips:mips_r4k: use memdev for RAM)
59/86 Checking commit e356db0d9dc1 (ppc:e500: drop RAM size fixup)
60/86 Checking commit 891c437f30de (ppc:e500: use memdev for RAM)
61/86 Checking commit c0070fff31f7 (ppc:mac_newworld: use memdev for RAM)
62/86 Checking commit 7a5c1e08eb9a (ppc:mac_oldworld: use memdev for RAM)
63/86 Checking commit f4e844d0b244 (ppc:pnv: use memdev for RAM)
64/86 Checking commit 6589023692a3 (ppc:ppc405_boards: add RAM size checks)
65/86 Checking commit 6797fc946c2f (ppc:ppc405_boards: use memdev for RAM)
66/86 Checking commit f7dba1dc9cee (ppc/{ppc440_bamboo,sam460x}: drop RAM size fixup)
67/86 Checking commit b2dfc417ea25 (ppc:ppc440_bamboo/sam460ex: use memdev for RAM)
68/86 Checking commit 21d8ec68c790 (ppc:prep: use memdev for RAM)
69/86 Checking commit 23206b2a4e7e (ppc:spapr: use memdev for RAM)
70/86 Checking commit 3f9b6144afb3 (ppc:virtex_ml507: remove unused arguments)
71/86 Checking commit 3d80e73f3489 (ppc:virtex_ml507: use memdev for RAM)
72/86 Checking commit 362d2997578e (sparc:leon3: use memdev for RAM)
73/86 Checking commit 7501234325d1 (sparc:sun4m: use memdev for RAM)
74/86 Checking commit 9aa9b2166491 (sparc:niagara: use memdev for RAM)
75/86 Checking commit 531214b20a79 (remove no longer used memory_region_allocate_system_memory()) 76/86 Checking commit bd38eb7acb3b (post conversion default_ram_id cleanup)
77/86 Checking commit ae8a35855f2c (exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize()) 78/86 Checking commit 9c8eede386a4 (exec: drop bogus mem_path from qemu_ram_alloc_from_fd()) 79/86 Checking commit 29a5753391ee (make mem_path local variable)
80/86 Checking commit f128425ba191 (hostmem: introduce "prealloc-threads" property)
81/86 Checking commit abc7dcbd0c46 (hostmem: fix strict bind policy)
82/86 Checking commit 599a9d539ae3 (numa: forbid '-numa node, mem' for 5.0 and newer machine types) 83/86 Checking commit 1f9e2a07e397 (tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups) 84/86 Checking commit 7f1c3cb94728 (tests:numa-test: use explicit memdev to specify node RAM) 85/86 Checking commit 19d06fb502bb (numa: make exit() usage consistent)
86/86 Checking commit 1209a3623bcc (numa: remove deprecated implicit RAM distribution between nodes) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Quoted 8 lines · On Wed, 15 Jan 2020 08:43:33 -0800 (PST) [email protected] wrote:
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
[...]
Quoted 4 lines
6/86 Checking commit
b9b1823833a3(alpha:dp264: use memdev for RAM)
ERROR: spaces required around that '*' (ctx:WxV)
#30: FILE:hw/alpha/alpha_sys.h:14:
+PCIBus *typhoon_init(MemoryRegion *, ISABus **,qemu_irq*, AlphaCPU *[4],
patch keeps the same style that was used in original code I can rewrite it on the next respin to mach current codestyle
[...]
Quoted 13 lines · Igor Mammedov
Quoted 8 lines · On Wed, 15 Jan 2020 08:43:33 -0800 (PST) [email protected] wrote:
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
[...]
Quoted 7 lines
Quoted 4 lines
6/86 Checking commit
b9b1823833a3(alpha:dp264: use memdev for RAM)
ERROR: spaces required around that '*' (ctx:WxV)
#30: FILE:hw/alpha/alpha_sys.h:14:
+PCIBus *typhoon_init(MemoryRegion *, ISABus **,qemu_irq*, AlphaCPU *[4],patch keeps the same style that was used in original code I can rewrite it on the next respin to mach current codestyle
False positive I think.
Quoted 13 lines · Igor Mammedov
Quoted 8 lines · On Wed, 15 Jan 2020 08:43:33 -0800 (PST) [email protected] wrote:
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
[...]
Quoted 7 lines
Quoted 4 lines
6/86 Checking commit
b9b1823833a3(alpha:dp264: use memdev for RAM)
ERROR: spaces required around that '*' (ctx:WxV)
#30: FILE:hw/alpha/alpha_sys.h:14:
+PCIBus *typhoon_init(MemoryRegion *, ISABus **,qemu_irq*, AlphaCPU *[4],patch keeps the same style that was used in original code I can rewrite it on the next respin to mach current codestyle
False positive. The script doesn't understand pointers well, and it's triggering the rule for multiplication.
r~
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===
TEST iotest-qcow2: 217socket_accept failed: Resource temporarily unavailable
**
ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)/tmp/qemu-test/src/tests/qtest/libqtest.c:140: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)
make: *** [check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs....
TEST check-qtest-aarch64: tests/qtest/test-hmp
TEST check-qtest-aarch64: tests/qtest/qos-test
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=aa025f08c88c41f3b0736fd7ac33b1a2', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-jbjm9w29/src/docker-src.2020-01-15-13.02.21.6647:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=aa025f08c88c41f3b0736fd7ac33b1a2
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-jbjm9w29/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 11m57.320s
user 0m8.844s
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Subject: [PATCH v2 00/86] refactor main RAM allocation to use hostmem backend
Type: series
Message-id: [email protected]
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
0b4d672 numa: remove deprecated implicit RAM distribution between nodes 1098011 numa: make exit() usage consistent
02b386f tests:numa-test: use explicit memdev to specify node RAM 66a2225 tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups b20b2ff numa: forbid '-numa node, mem' for 5.0 and newer machine types a13aa68 hostmem: fix strict bind policy
83a7d87 hostmem: introduce "prealloc-threads" property
7257d12 make mem_path local variable
04d4c6f exec: drop bogus mem_path from qemu_ram_alloc_from_fd() eb6daec exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize() 07bfbd9 post conversion default_ram_id cleanup
c0bf61f remove no longer used memory_region_allocate_system_memory() a912f8b sparc:niagara: use memdev for RAM
b744bcd sparc:sun4m: use memdev for RAM
49ea0ec sparc:leon3: use memdev for RAM
0c356f0 ppc:virtex_ml507: use memdev for RAM
f361e08 ppc:virtex_ml507: remove unused arguments
3523e7b ppc:spapr: use memdev for RAM
7df88ce ppc:prep: use memdev for RAM
3158bcf ppc:ppc440_bamboo/sam460ex: use memdev for RAM
c05ab6d ppc/{ppc440_bamboo,sam460x}: drop RAM size fixup
71deb34 ppc:ppc405_boards: use memdev for RAM04b505db ppc:ppc405_boards: add RAM size checks
dffbdde ppc:pnv: use memdev for RAM
02936f7 ppc:mac_oldworld: use memdev for RAM
181345a ppc:mac_newworld: use memdev for RAM
5810983 ppc:e500: use memdev for RAM
2753e72 ppc:e500: drop RAM size fixup
b2ec371 mips:mips_r4k: use memdev for RAM
beb034d mips:mips_mipssim: use memdev for RAM
608d78b mips:mips_malta: use memdev for RAM
b823794 mips:mips_jazz: use memdev for RAM
8916374 mips:mips_fulong2e: use memdev for RAM
d4a34dc mips:mips_fulong2e: drop RAM size fixup
151530e mips:boston-cube: use memdev for RAM
6e84bad m68k:next-cube: use memdev for RAM
00daf85 m68k:mcf5208: use memdev for RAM
61d3597 m68k:an5206: use memdev for RAM
ff9accd lm32:milkymist: use memdev for RAM
4d05cc4 lm32:lm32_boards: use memdev for RAM
96ef68d x86:pc: use memdev for RAM
ccb281c x86:microvm: use memdev for RAM
de745ce hppa: use memdev for RAM
81d7bb5 hw/hppa/machine: Map the PDC memory region with higher priority 0172fe7 hw/hppa/machine: Restrict the total memory size to 3GB ec0c2c2 hw/hppa/machine: Correctly check the firmware is in PDC range 79d6742 cris:axis_dev88: use memdev for RAM
4a1b6a3 null-machine: use memdev for RAM
df8c7b3 s390x:s390-virtio-ccw: use memdev for RAM
8b28fb8 arm:xlnx-zcu102: use memdev for RAM
bcf19b6 arm:xlnx-versal-virt: use memdev for RAM
a0e14c0 arm:xilinx_zynq: use memdev for RAM
7aacf46 arm:xilinx_zynq: drop RAM size fixup
58602f5 arm:virt: use memdev for RAM
6fb0d33 arm:vexpress: use memdev for RAM
9a6e064 arm:versatilepb: use memdev for RAM
d365f71 arm:sbsa-ref: use memdev for RAM
623e61c arm:sabrelite: use memdev for RAM
3382b3b arm:raspi: use memdev for RAM
46a5bef arm:palm: use memdev for RAM
50bef2a arm:omap_sx1: use memdev for RAM
edba4fc arm:nseries: use memdev for RAM
1e880cb arm:musicpal: use memdev for RAM
500bdb0 arm:mps2: use memdev for RAM
26f6109 arm:mps2-tz: use memdev for RAM
3115479 arm:mcimx7d-sabre: use memdev for RAM
5ae9d66 arm:mcimx6ul-evk: use memdev for RAM
f60a931 arm:kzm: use memdev for RAM
5caf28a arm:kzm: drop RAM size fixup
bbce546 arm:integratorcp: use memdev for RAM
f6cd712 arm:imx25_pdk: use memdev for RAM
31d092e arm:imx25_pdk: drop RAM size fixup
2c1e1fc arm:highbank: use memdev for RAM
21c0ab0 arm:digic_boards: use memdev for RAM
e1e35dd arm:cubieboard: use memdev for RAM
c218c33 arm:collie: use memdev for RAM
f07ceb1 arm:aspeed: use memdev for RAM
bdb5ad7 hw:aspeed: drop warning and bogus ram_size fixup
667a1a9 arm:aspeed: actually check RAM size
ff498af arm:aspeed: convert valid RAM sizes to data
ab2a965 alpha:dp264: use memdev for RAM
4836a67 initialize MachineState::ram in NUMA case
e3fce82 machine: introduce convenience MachineState::ram
f29549f machine: alias -mem-path and -mem-prealloc into memory-foo backend 78d829c machine: introduce ram-memdev property
aa1fc16 numa: remove deprecated -mem-path fallback to anonymous RAM
=== OUTPUT BEGIN ===
1/86 Checking commit aa1fc16b0c38 (numa: remove deprecated -mem-path fallback to anonymous RAM) 2/86 Checking commit 78d829c16792 (machine: introduce ram-memdev property)
3/86 Checking commit f29549fc3446 (machine: alias -mem-path and -mem-prealloc into memory-foo backend) 4/86 Checking commit e3fce82f8b0a (machine: introduce convenience MachineState::ram) 5/86 Checking commit 4836a67b492c (initialize MachineState::ram in NUMA case)
6/86 Checking commit ab2a965aecf2 (alpha:dp264: use memdev for RAM)
ERROR: spaces required around that '*' (ctx:WxV)
#30: FILE: hw/alpha/alpha_sys.h:14:
+PCIBus *typhoon_init(MemoryRegion *, ISABus **, qemu_irq *, AlphaCPU *[4],
^
total: 1 errors, 0 warnings, 49 lines checked
Patch 6/86 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
7/86 Checking commit ff498afe2397 (arm:aspeed: convert valid RAM sizes to data)
8/86 Checking commit 667a1a9689eb (arm:aspeed: actually check RAM size)
9/86 Checking commit bdb5ad7c6690 (hw:aspeed: drop warning and bogus ram_size fixup)
10/86 Checking commit f07ceb15e3d0 (arm:aspeed: use memdev for RAM)
11/86 Checking commit c218c33c2c1d (arm:collie: use memdev for RAM)
12/86 Checking commit e1e35dddfd68 (arm:cubieboard: use memdev for RAM)
13/86 Checking commit 21c0ab02cca0 (arm:digic_boards: use memdev for RAM)
14/86 Checking commit 2c1e1fc73e44 (arm:highbank: use memdev for RAM)
15/86 Checking commit 31d092e263da (arm:imx25_pdk: drop RAM size fixup)
16/86 Checking commit f6cd7125515e (arm:imx25_pdk: use memdev for RAM)
17/86 Checking commit bbce54683de4 (arm:integratorcp: use memdev for RAM)
18/86 Checking commit 5caf28a157a9 (arm:kzm: drop RAM size fixup)
19/86 Checking commit f60a9311a03d (arm:kzm: use memdev for RAM)
20/86 Checking commit 5ae9d66de2cd (arm:mcimx6ul-evk: use memdev for RAM)
21/86 Checking commit 3115479701b8 (arm:mcimx7d-sabre: use memdev for RAM)
22/86 Checking commit 26f610919991 (arm:mps2-tz: use memdev for RAM)
23/86 Checking commit 500bdb012a0c (arm:mps2: use memdev for RAM)
24/86 Checking commit 1e880cb6ed27 (arm:musicpal: use memdev for RAM)
25/86 Checking commit edba4fc51907 (arm:nseries: use memdev for RAM)
26/86 Checking commit 50bef2a1ff8b (arm:omap_sx1: use memdev for RAM)
27/86 Checking commit 46a5bef0b355 (arm:palm: use memdev for RAM)
28/86 Checking commit 3382b3ba4f8f (arm:raspi: use memdev for RAM)
29/86 Checking commit 623e61c61ef1 (arm:sabrelite: use memdev for RAM)
30/86 Checking commit d365f71e6f61 (arm:sbsa-ref: use memdev for RAM)
31/86 Checking commit 9a6e0641e7de (arm:versatilepb: use memdev for RAM)
32/86 Checking commit 6fb0d331c71f (arm:vexpress: use memdev for RAM)
33/86 Checking commit 58602f5a313d (arm:virt: use memdev for RAM)
34/86 Checking commit 7aacf4698262 (arm:xilinx_zynq: drop RAM size fixup)
35/86 Checking commit a0e14c032a21 (arm:xilinx_zynq: use memdev for RAM)
36/86 Checking commit bcf19b6579a4 (arm:xlnx-versal-virt: use memdev for RAM)
37/86 Checking commit 8b28fb8cdc7c (arm:xlnx-zcu102: use memdev for RAM)
38/86 Checking commit df8c7b3d1caa (s390x:s390-virtio-ccw: use memdev for RAM)
39/86 Checking commit 4a1b6a36ff0b (null-machine: use memdev for RAM)
40/86 Checking commit 79d6742c68f7 (cris:axis_dev88: use memdev for RAM)
41/86 Checking commit ec0c2c299493 (hw/hppa/machine: Correctly check the firmware is in PDC range) 42/86 Checking commit 0172fe7158ea (hw/hppa/machine: Restrict the total memory size to 3GB) 43/86 Checking commit 81d7bb57c125 (hw/hppa/machine: Map the PDC memory region with higher priority) 44/86 Checking commit de745cef12ed (hppa: use memdev for RAM)
45/86 Checking commit ccb281ca428b (x86:microvm: use memdev for RAM)
46/86 Checking commit 96ef68dbcb5d (x86:pc: use memdev for RAM)
47/86 Checking commit 4d05cc4b128a (lm32:lm32_boards: use memdev for RAM)
48/86 Checking commit ff9accd82e74 (lm32:milkymist: use memdev for RAM)
49/86 Checking commit 61d3597a9224 (m68k:an5206: use memdev for RAM)
50/86 Checking commit 00daf85e44af (m68k:mcf5208: use memdev for RAM)
51/86 Checking commit 6e84bad3fba6 (m68k:next-cube: use memdev for RAM)
52/86 Checking commit 151530ecb6a0 (mips:boston-cube: use memdev for RAM)
53/86 Checking commit d4a34dcb1a7f (mips:mips_fulong2e: drop RAM size fixup)
54/86 Checking commit 891637498130 (mips:mips_fulong2e: use memdev for RAM)
55/86 Checking commit b823794fa4db (mips:mips_jazz: use memdev for RAM)
56/86 Checking commit 608d78bdb560 (mips:mips_malta: use memdev for RAM)
57/86 Checking commit beb034d464c7 (mips:mips_mipssim: use memdev for RAM)
58/86 Checking commit b2ec371658a2 (mips:mips_r4k: use memdev for RAM)
59/86 Checking commit 2753e7251dbf (ppc:e500: drop RAM size fixup)
60/86 Checking commit 5810983e05d9 (ppc:e500: use memdev for RAM)
61/86 Checking commit 181345a14032 (ppc:mac_newworld: use memdev for RAM)
62/86 Checking commit 02936f711900 (ppc:mac_oldworld: use memdev for RAM)
63/86 Checking commit dffbddec7484 (ppc:pnv: use memdev for RAM)
64/86 Checking commit 04b505db53c6 (ppc:ppc405_boards: add RAM size checks)
65/86 Checking commit 71deb34da16d (ppc:ppc405_boards: use memdev for RAM)
66/86 Checking commit c05ab6dbc400 (ppc/{ppc440_bamboo,sam460x}: drop RAM size fixup)
67/86 Checking commit 3158bcf2a286 (ppc:ppc440_bamboo/sam460ex: use memdev for RAM)
68/86 Checking commit 7df88cedb210 (ppc:prep: use memdev for RAM)
69/86 Checking commit 3523e7ba15a3 (ppc:spapr: use memdev for RAM)
70/86 Checking commit f361e0899be6 (ppc:virtex_ml507: remove unused arguments)
71/86 Checking commit 0c356f0f4c22 (ppc:virtex_ml507: use memdev for RAM)
72/86 Checking commit 49ea0ecbeecb (sparc:leon3: use memdev for RAM)
73/86 Checking commit b744bcd27695 (sparc:sun4m: use memdev for RAM)
74/86 Checking commit a912f8bc8c61 (sparc:niagara: use memdev for RAM)
75/86 Checking commit c0bf61f45183 (remove no longer used memory_region_allocate_system_memory()) 76/86 Checking commit 07bfbd96c08c (post conversion default_ram_id cleanup)
77/86 Checking commit eb6daec88a8a (exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize()) 78/86 Checking commit 04d4c6faaca2 (exec: drop bogus mem_path from qemu_ram_alloc_from_fd()) 79/86 Checking commit 7257d1263a5d (make mem_path local variable)
80/86 Checking commit 83a7d87c1fce (hostmem: introduce "prealloc-threads" property)
81/86 Checking commit a13aa6825527 (hostmem: fix strict bind policy)
82/86 Checking commit b20b2ff4cdac (numa: forbid '-numa node, mem' for 5.0 and newer machine types) 83/86 Checking commit 66a22250b5c1 (tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups) 84/86 Checking commit 02b386f71ab9 (tests:numa-test: use explicit memdev to specify node RAM) 85/86 Checking commit 1098011efcda (numa: make exit() usage consistent)
86/86 Checking commit 0b4d672f1b99 (numa: remove deprecated implicit RAM distribution between nodes) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===
TEST iotest-qcow2: 184socket_accept failed: Resource temporarily unavailable
**
ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)/tmp/qemu-test/src/tests/qtest/libqtest.c:140: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)
TEST iotest-qcow2: 186
make: *** [check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs....
TEST iotest-qcow2: 187
TEST iotest-qcow2: 190
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=22666b33f869455386111b839b4d494c', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-2tanos8_/src/docker-src.2020-01-15-14.28.46.4844:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=22666b33f869455386111b839b4d494c
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-2tanos8_/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 10m47.563s
user 0m8.283s
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Subject: [PATCH v2 00/86] refactor main RAM allocation to use hostmem backend
Type: series
Message-id: [email protected]
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Switched to a new branch 'test'
11a20c3 numa: remove deprecated implicit RAM distribution between nodes d86b08b numa: make exit() usage consistent
8646e5e tests:numa-test: use explicit memdev to specify node RAM e73639d tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups 22e8003 numa: forbid '-numa node, mem' for 5.0 and newer machine types 4636732 hostmem: fix strict bind policy
547e119 hostmem: introduce "prealloc-threads" property
37e2c24 make mem_path local variable
3f12da2 exec: drop bogus mem_path from qemu_ram_alloc_from_fd() 82d8312 exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize() fad9d83 post conversion default_ram_id cleanup
dba7fdb remove no longer used memory_region_allocate_system_memory() b3cee01 sparc:niagara: use memdev for RAM
193cdb5 sparc:sun4m: use memdev for RAM
7b57adc sparc:leon3: use memdev for RAM
1b43407 ppc:virtex_ml507: use memdev for RAM
d151f5a ppc:virtex_ml507: remove unused arguments
9696d27 ppc:spapr: use memdev for RAM
42503a2 ppc:prep: use memdev for RAM
07bab1c ppc:ppc440_bamboo/sam460ex: use memdev for RAM
78dacf7 ppc/{ppc440_bamboo,sam460x}: drop RAM size fixup
c946d56 ppc:ppc405_boards: use memdev for RAM
90799d8 ppc:ppc405_boards: add RAM size checks
95965c8 ppc:pnv: use memdev for RAM
8794a61 ppc:mac_oldworld: use memdev for RAM
803a239 ppc:mac_newworld: use memdev for RAM
de3715d ppc:e500: use memdev for RAM
aa12e5f ppc:e500: drop RAM size fixup
05ef318 mips:mips_r4k: use memdev for RAM
0577baa mips:mips_mipssim: use memdev for RAM
a1226bd mips:mips_malta: use memdev for RAM
f059e6d mips:mips_jazz: use memdev for RAM
9fde8b0 mips:mips_fulong2e: use memdev for RAM
974b1c0 mips:mips_fulong2e: drop RAM size fixup
6f147f5 mips:boston-cube: use memdev for RAM
f97cebd m68k:next-cube: use memdev for RAM
aa9050c m68k:mcf5208: use memdev for RAM
2e37399 m68k:an5206: use memdev for RAM
7471a18 lm32:milkymist: use memdev for RAM
06d3b1b lm32:lm32_boards: use memdev for RAM
b72206f x86:pc: use memdev for RAM
f0ed8ae x86:microvm: use memdev for RAM
56cec52 hppa: use memdev for RAM
dad8af3 hw/hppa/machine: Map the PDC memory region with higher priority 14d9db7 hw/hppa/machine: Restrict the total memory size to 3GB 8bb59b8 hw/hppa/machine: Correctly check the firmware is in PDC range f66c661 cris:axis_dev88: use memdev for RAM
30ec2c7 null-machine: use memdev for RAM
eca7ad3 s390x:s390-virtio-ccw: use memdev for RAM
9efacaa arm:xlnx-zcu102: use memdev for RAM
6c17f5e arm:xlnx-versal-virt: use memdev for RAM
c974680 arm:xilinx_zynq: use memdev for RAM
5214578 arm:xilinx_zynq: drop RAM size fixup
487a287 arm:virt: use memdev for RAM
f59a421 arm:vexpress: use memdev for RAM
5f18495 arm:versatilepb: use memdev for RAM
4ef5f91 arm:sbsa-ref: use memdev for RAM
e67a909 arm:sabrelite: use memdev for RAM
8b211a1 arm:raspi: use memdev for RAM
c2fe517 arm:palm: use memdev for RAM
59fa4ec arm:omap_sx1: use memdev for RAM
54372f1 arm:nseries: use memdev for RAM
a460240 arm:musicpal: use memdev for RAM
00a31d8 arm:mps2: use memdev for RAM
6384dde arm:mps2-tz: use memdev for RAM
d675a78 arm:mcimx7d-sabre: use memdev for RAM
a5d1f43 arm:mcimx6ul-evk: use memdev for RAM
e5d7dc1 arm:kzm: use memdev for RAM
c3cc180 arm:kzm: drop RAM size fixup
f843b3e arm:integratorcp: use memdev for RAM
4dee2dc arm:imx25_pdk: use memdev for RAM
c794dcf arm:imx25_pdk: drop RAM size fixup
999f220 arm:highbank: use memdev for RAM
91d80f4 arm:digic_boards: use memdev for RAM
aab50b1 arm:cubieboard: use memdev for RAM
8d954fe arm:collie: use memdev for RAM
7b0d326 arm:aspeed: use memdev for RAM
6a7c2af hw:aspeed: drop warning and bogus ram_size fixup
172ef43 arm:aspeed: actually check RAM size
0e55e08 arm:aspeed: convert valid RAM sizes to data
ff6444e alpha:dp264: use memdev for RAM
b02edb3 initialize MachineState::ram in NUMA case
5d0b636 machine: introduce convenience MachineState::ram
0fc2004 machine: alias -mem-path and -mem-prealloc into memory-foo backend 6d984b5 machine: introduce ram-memdev property
08fae89 numa: remove deprecated -mem-path fallback to anonymous RAM
=== OUTPUT BEGIN ===
1/86 Checking commit 08fae890b67d (numa: remove deprecated -mem-path fallback to anonymous RAM) 2/86 Checking commit 6d984b5dbe35 (machine: introduce ram-memdev property)
3/86 Checking commit 0fc2004b03fa (machine: alias -mem-path and -mem-prealloc into memory-foo backend) 4/86 Checking commit 5d0b6369dddd (machine: introduce convenience MachineState::ram) 5/86 Checking commit b02edb340b79 (initialize MachineState::ram in NUMA case)
6/86 Checking commit ff6444e72906 (alpha:dp264: use memdev for RAM)
ERROR: spaces required around that '*' (ctx:WxV)
#30: FILE: hw/alpha/alpha_sys.h:14:
+PCIBus *typhoon_init(MemoryRegion *, ISABus **, qemu_irq *, AlphaCPU *[4],
^
total: 1 errors, 0 warnings, 49 lines checked
Patch 6/86 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
7/86 Checking commit 0e55e08f3939 (arm:aspeed: convert valid RAM sizes to data)
8/86 Checking commit 172ef43b9b4c (arm:aspeed: actually check RAM size)
9/86 Checking commit 6a7c2afd4d79 (hw:aspeed: drop warning and bogus ram_size fixup)
10/86 Checking commit 7b0d32621113 (arm:aspeed: use memdev for RAM)
11/86 Checking commit 8d954fe5f96f (arm:collie: use memdev for RAM)
12/86 Checking commit aab50b18bced (arm:cubieboard: use memdev for RAM)
13/86 Checking commit 91d80f466fe8 (arm:digic_boards: use memdev for RAM)
14/86 Checking commit 999f220da883 (arm:highbank: use memdev for RAM)
15/86 Checking commit c794dcf7bf01 (arm:imx25_pdk: drop RAM size fixup)
16/86 Checking commit 4dee2dcc09ca (arm:imx25_pdk: use memdev for RAM)
17/86 Checking commit f843b3e1c9f9 (arm:integratorcp: use memdev for RAM)
18/86 Checking commit c3cc18081f36 (arm:kzm: drop RAM size fixup)
19/86 Checking commit e5d7dc1e5edf (arm:kzm: use memdev for RAM)
20/86 Checking commit a5d1f434a0e5 (arm:mcimx6ul-evk: use memdev for RAM)
21/86 Checking commit d675a780389d (arm:mcimx7d-sabre: use memdev for RAM)
22/86 Checking commit 6384dde578a1 (arm:mps2-tz: use memdev for RAM)
23/86 Checking commit 00a31d86e9a8 (arm:mps2: use memdev for RAM)
24/86 Checking commit a4602403859e (arm:musicpal: use memdev for RAM)
25/86 Checking commit 54372f185c92 (arm:nseries: use memdev for RAM)
26/86 Checking commit 59fa4ec0862b (arm:omap_sx1: use memdev for RAM)
27/86 Checking commit c2fe517abcc9 (arm:palm: use memdev for RAM)
28/86 Checking commit 8b211a1daf3d (arm:raspi: use memdev for RAM)
29/86 Checking commit e67a9091bf3d (arm:sabrelite: use memdev for RAM)
30/86 Checking commit 4ef5f91d1d96 (arm:sbsa-ref: use memdev for RAM)
31/86 Checking commit 5f184952ed5b (arm:versatilepb: use memdev for RAM)
32/86 Checking commit f59a42177faf (arm:vexpress: use memdev for RAM)
33/86 Checking commit 487a287b51b3 (arm:virt: use memdev for RAM)
34/86 Checking commit 521457884d96 (arm:xilinx_zynq: drop RAM size fixup)
35/86 Checking commit c9746806716e (arm:xilinx_zynq: use memdev for RAM)
36/86 Checking commit 6c17f5ec4b48 (arm:xlnx-versal-virt: use memdev for RAM)
37/86 Checking commit 9efacaa92b99 (arm:xlnx-zcu102: use memdev for RAM)
38/86 Checking commit eca7ad3c361e (s390x:s390-virtio-ccw: use memdev for RAM)
39/86 Checking commit 30ec2c7dc4c1 (null-machine: use memdev for RAM)
40/86 Checking commit f66c661dad7f (cris:axis_dev88: use memdev for RAM)
41/86 Checking commit 8bb59b8d7d9b (hw/hppa/machine: Correctly check the firmware is in PDC range) 42/86 Checking commit 14d9db719ee9 (hw/hppa/machine: Restrict the total memory size to 3GB) 43/86 Checking commit dad8af336ab4 (hw/hppa/machine: Map the PDC memory region with higher priority) 44/86 Checking commit 56cec5259b48 (hppa: use memdev for RAM)
45/86 Checking commit f0ed8aea05ec (x86:microvm: use memdev for RAM)
46/86 Checking commit b72206fa355a (x86:pc: use memdev for RAM)
47/86 Checking commit 06d3b1b78666 (lm32:lm32_boards: use memdev for RAM)
48/86 Checking commit 7471a180c3a6 (lm32:milkymist: use memdev for RAM)
49/86 Checking commit 2e3739900bd8 (m68k:an5206: use memdev for RAM)
50/86 Checking commit aa9050cb0d06 (m68k:mcf5208: use memdev for RAM)
51/86 Checking commit f97cebd672df (m68k:next-cube: use memdev for RAM)
52/86 Checking commit 6f147f566f68 (mips:boston-cube: use memdev for RAM)
53/86 Checking commit 974b1c015a30 (mips:mips_fulong2e: drop RAM size fixup)
54/86 Checking commit 9fde8b0b7ebd (mips:mips_fulong2e: use memdev for RAM)
55/86 Checking commit f059e6d82739 (mips:mips_jazz: use memdev for RAM)
56/86 Checking commit a1226bd6ef36 (mips:mips_malta: use memdev for RAM)
57/86 Checking commit 0577baa20231 (mips:mips_mipssim: use memdev for RAM)
58/86 Checking commit 05ef318bd0cc (mips:mips_r4k: use memdev for RAM)
59/86 Checking commit aa12e5f0638e (ppc:e500: drop RAM size fixup)
60/86 Checking commit de3715db85f6 (ppc:e500: use memdev for RAM)
61/86 Checking commit 803a2393fc14 (ppc:mac_newworld: use memdev for RAM)
62/86 Checking commit 8794a61a8dde (ppc:mac_oldworld: use memdev for RAM)
63/86 Checking commit 95965c87139d (ppc:pnv: use memdev for RAM)
64/86 Checking commit 90799d8e395f (ppc:ppc405_boards: add RAM size checks)
65/86 Checking commit c946d56eda0e (ppc:ppc405_boards: use memdev for RAM)
66/86 Checking commit 78dacf71acea (ppc/{ppc440_bamboo,sam460x}: drop RAM size fixup)
67/86 Checking commit 07bab1c01b30 (ppc:ppc440_bamboo/sam460ex: use memdev for RAM)
68/86 Checking commit 42503a255083 (ppc:prep: use memdev for RAM)
69/86 Checking commit 9696d2717401 (ppc:spapr: use memdev for RAM)
70/86 Checking commit d151f5a5742e (ppc:virtex_ml507: remove unused arguments)
71/86 Checking commit 1b434072e43b (ppc:virtex_ml507: use memdev for RAM)
72/86 Checking commit 7b57adc2d77a (sparc:leon3: use memdev for RAM)
73/86 Checking commit 193cdb51d4bf (sparc:sun4m: use memdev for RAM)
74/86 Checking commit b3cee011513d (sparc:niagara: use memdev for RAM)
75/86 Checking commit dba7fdb96a10 (remove no longer used memory_region_allocate_system_memory()) 76/86 Checking commit fad9d8348bef (post conversion default_ram_id cleanup)
77/86 Checking commit 82d8312d1497 (exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize()) 78/86 Checking commit 3f12da229964 (exec: drop bogus mem_path from qemu_ram_alloc_from_fd()) 79/86 Checking commit 37e2c242f0f5 (make mem_path local variable)
80/86 Checking commit 547e1199adae (hostmem: introduce "prealloc-threads" property)
81/86 Checking commit 46367323657c (hostmem: fix strict bind policy)
82/86 Checking commit 22e8003d2397 (numa: forbid '-numa node, mem' for 5.0 and newer machine types) 83/86 Checking commit e73639dfcea1 (tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups) 84/86 Checking commit 8646e5e3e3b3 (tests:numa-test: use explicit memdev to specify node RAM) 85/86 Checking commit d86b08b42b99 (numa: make exit() usage consistent)
86/86 Checking commit 11a20c3ae98b (numa: remove deprecated implicit RAM distribution between nodes) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===
TEST iotest-qcow2: 217socket_accept failed: Resource temporarily unavailable
**
ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)/tmp/qemu-test/src/tests/qtest/libqtest.c:140: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)
make: *** [check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs....
TEST check-qtest-aarch64: tests/qtest/test-hmp
TEST iotest-qcow2: 220
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=755fcbfd171f40b1b16d6aac34e7c09b', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-qd5wtatm/src/docker-src.2020-01-15-15.50.14.28652:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=755fcbfd171f40b1b16d6aac34e7c09b
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-qd5wtatm/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 11m0.219s
user 0m8.267s
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Quoted 16 lines · On 1/15/20 10:01 PM, [email protected] wrote:
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===
Quoted 7 lines
TEST iotest-qcow2: 217
socket_acceptfailed: Resource temporarily unavailable
**
ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd>= 0 &&s->qmp_fd>= 0)/tmp/qemu-test/src/tests/qtest/libqtest.c:140:kill_qemu()tried to terminate QEMU process but encountered exit status 1 (expected 0) ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd>= 0 &&s->qmp_fd>= 0)
make: *** [check-qtest-x86_64] Error 1
Is this something we should care about?
Quoted 21 lines
make: *** Waiting for unfinished jobs....
TEST check-qtest-aarch64: tests/qtest/test-hmp
TEST iotest-qcow2: 220
---
raiseCalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=755fcbfd171f40b1b16d6aac34e7c09b', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-qd5wtatm/src/docker-src.2020-01-15-15.50.14.28652:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=755fcbfd171f40b1b16d6aac34e7c09b
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-qd5wtatm/src'
make: *** [docker-run-test-quick@centos7] Error 2real 11m0.219s
user 0m8.267sThe full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Quoted 7 lines · On Thu, 16 Jan 2020 16:43:07 +0100 Philippe Mathieu-Daudé <[email protected]>…
Quoted 6 lines · On 1/15/20 10:01 PM, [email protected] wrote:
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
Quoted 8 lines
Quoted 8 lines
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
it doesn't work on my host, since it tries to use /tmp for building an image and fails with no space.
is there any way to point it to some other place?
Quoted 11 lines
Quoted 9 lines
=== TEST SCRIPT END ===
TEST iotest-qcow2: 217
socket_acceptfailed: Resource temporarily unavailable
**
ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd>= 0 &&s->qmp_fd>= 0)/tmp/qemu-test/src/tests/qtest/libqtest.c:140:kill_qemu()tried to terminate QEMU process but encountered exit status 1 (expected 0) ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:272:qtest_init_without_qmp_handshake: assertion failed: (s->fd>= 0 &&s->qmp_fd>= 0)
make: *** [check-qtest-x86_64] Error 1Is this something we should care about?
#217 passes on my host, albeit it takes time to complete
Quoted 24 lines
Quoted 22 lines
make: *** Waiting for unfinished jobs....
TEST check-qtest-aarch64: tests/qtest/test-hmp
TEST iotest-qcow2: 220
---
raiseCalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=755fcbfd171f40b1b16d6aac34e7c09b', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-qd5wtatm/src/docker-src.2020-01-15-15.50.14.28652:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=755fcbfd171f40b1b16d6aac34e7c09b
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-qd5wtatm/src'
make: *** [docker-run-test-quick@centos7] Error 2real 11m0.219s
user 0m8.267sThe full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Quoted 14 lines · Igor Mammedov
Quoted 11 lines · On Thu, 16 Jan 2020 16:43:07 +0100 Philippe Mathieu-Daudé <[email protected]>…
Quoted 10 lines · On 1/15/20 10:01 PM, [email protected] wrote:
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1it doesn't work on my host, since it tries to use /tmp for building an image and fails with no space.
is there any way to point it to some other place?
What is failing? Building the docker image, or building QEMU withing the docker container?
Quoted 20 lines · On Fri, 17 Jan 2020 17:19:26 +0100 Philippe Mathieu-Daudé <[email protected]>…
Quoted 19 lines · Igor Mammedov
Quoted 15 lines · On Thu, 16 Jan 2020 16:43:07 +0100 Philippe Mathieu-Daudé <[email protected]>…
Quoted 14 lines · On 1/15/20 10:01 PM, [email protected] wrote:
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
Quoted 6 lines
Quoted 3 lines
it doesn't work on my host, since it tries to use /tmp for building an image and fails with no space.
is there any way to point it to some other place?What is failing? Building the docker image, or building QEMU withing the docker container?
docker image
Quoted 23 lines · Igor Mammedov
Quoted 20 lines · On Fri, 17 Jan 2020 17:19:26 +0100 Philippe Mathieu-Daudé <[email protected]>…
Quoted 19 lines · Igor Mammedov
Quoted 15 lines · On Thu, 16 Jan 2020 16:43:07 +0100 Philippe Mathieu-Daudé <[email protected]>…
Quoted 14 lines · On 1/15/20 10:01 PM, [email protected] wrote:
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
it doesn't work on my host, since it tries to use /tmp for building an image and fails with no space.
is there any way to point it to some other place?What is failing? Building the docker image, or building QEMU withing the docker container?
docker image
Odd. I thought image was built in default storage dir: /var/lib/docker
# docker system info | fgrep / Docker Root Dir: /var/lib/docker
The default might be distrib dependent, my workstation is on Fedora.
Maybe while building a tmpfs is mount as /tmp within the temp container, and your ram is limited so it gets full while downloading packages to install? Sincerely I have no clue. Docker is not your friend :/
Here they say you can change the docker dir with '-g'
https://forums.docker.com/t/how-do-i-change-the-docker-image-installation-directory/1169/4
Can you paste the error context?
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Subject: [PATCH v2 00/86] refactor main RAM allocation to use hostmem backend
Type: series
Message-id: [email protected]
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Switched to a new branch 'test'
2d14010 numa: remove deprecated implicit RAM distribution between nodes bac70b8 numa: make exit() usage consistent
53861b0 tests:numa-test: use explicit memdev to specify node RAM 56297b3 tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups 3e6445f numa: forbid '-numa node, mem' for 5.0 and newer machine types d70a9f2 hostmem: fix strict bind policy
92d7974 hostmem: introduce "prealloc-threads" property
4fd9cfe make mem_path local variable
74d0083 exec: drop bogus mem_path from qemu_ram_alloc_from_fd() afb329b exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize() 7dfb5ed post conversion default_ram_id cleanup
f7cb074 remove no longer used memory_region_allocate_system_memory() 738f1a3 sparc:niagara: use memdev for RAM
e120e67 sparc:sun4m: use memdev for RAM
24b259e sparc:leon3: use memdev for RAM
4904e75 ppc:virtex_ml507: use memdev for RAM
65dbc2c ppc:virtex_ml507: remove unused arguments
ab63a98 ppc:spapr: use memdev for RAM
b4d5ea5 ppc:prep: use memdev for RAM
036f996 ppc:ppc440_bamboo/sam460ex: use memdev for RAM
73d3d69 ppc/{ppc440_bamboo,sam460x}: drop RAM size fixup
4525782 ppc:ppc405_boards: use memdev for RAM
53365b4 ppc:ppc405_boards: add RAM size checks
f025b4f ppc:pnv: use memdev for RAM
0329900 ppc:mac_oldworld: use memdev for RAM
92fb2bc ppc:mac_newworld: use memdev for RAM
eaab307 ppc:e500: use memdev for RAM
5bc78d1 ppc:e500: drop RAM size fixup
b959a8d mips:mips_r4k: use memdev for RAM
4fa91f4 mips:mips_mipssim: use memdev for RAM
f726ba3 mips:mips_malta: use memdev for RAM
e50c092 mips:mips_jazz: use memdev for RAM
d9a07ca mips:mips_fulong2e: use memdev for RAM
05d6a5e mips:mips_fulong2e: drop RAM size fixup
73027e0 mips:boston-cube: use memdev for RAM
eb6e93f m68k:next-cube: use memdev for RAM
3ad54a8 m68k:mcf5208: use memdev for RAM
31b4fbd m68k:an5206: use memdev for RAM
17a90ad lm32:milkymist: use memdev for RAM
934be97 lm32:lm32_boards: use memdev for RAM
debb3a4 x86:pc: use memdev for RAM
64a0031 x86:microvm: use memdev for RAM
c14b753 hppa: use memdev for RAM
9838169 hw/hppa/machine: Map the PDC memory region with higher priority 329d37d hw/hppa/machine: Restrict the total memory size to 3GB 82196f2 hw/hppa/machine: Correctly check the firmware is in PDC range 18f08804 cris:axis_dev88: use memdev for RAM
420420e null-machine: use memdev for RAM
fab1efc s390x:s390-virtio-ccw: use memdev for RAM
cb1a184 arm:xlnx-zcu102: use memdev for RAM
dafc5fe arm:xlnx-versal-virt: use memdev for RAM
8939184 arm:xilinx_zynq: use memdev for RAM
64008ac arm:xilinx_zynq: drop RAM size fixup
edc3824 arm:virt: use memdev for RAM
9c8ff93 arm:vexpress: use memdev for RAM
9f032bc arm:versatilepb: use memdev for RAM
03de308 arm:sbsa-ref: use memdev for RAM
bc94738 arm:sabrelite: use memdev for RAM
af2175c arm:raspi: use memdev for RAM
1943756 arm:palm: use memdev for RAM
b329f68 arm:omap_sx1: use memdev for RAM
04a9490 arm:nseries: use memdev for RAM
7769298 arm:musicpal: use memdev for RAM
6d13cec arm:mps2: use memdev for RAM
e0e52ec arm:mps2-tz: use memdev for RAM
d9daba7 arm:mcimx7d-sabre: use memdev for RAM
a701677 arm:mcimx6ul-evk: use memdev for RAM
b3879f1 arm:kzm: use memdev for RAM
91d718e arm:kzm: drop RAM size fixup
18d4ce5 arm:integratorcp: use memdev for RAM
a396753 arm:imx25_pdk: use memdev for RAM
77e06e0 arm:imx25_pdk: drop RAM size fixup
f404c60 arm:highbank: use memdev for RAM
c60b4f9 arm:digic_boards: use memdev for RAM
deb657f arm:cubieboard: use memdev for RAM
be1ddd2 arm:collie: use memdev for RAM
fca3baa arm:aspeed: use memdev for RAM
99a74b3 hw:aspeed: drop warning and bogus ram_size fixup
f2ccbf8 arm:aspeed: actually check RAM size
0fd04a9 arm:aspeed: convert valid RAM sizes to data
06f609f alpha:dp264: use memdev for RAM
40a1eec initialize MachineState::ram in NUMA case
9ef003b machine: introduce convenience MachineState::ram
16ac6d5 machine: alias -mem-path and -mem-prealloc into memory-foo backend 3026057 machine: introduce ram-memdev property
58ea704 numa: remove deprecated -mem-path fallback to anonymous RAM
=== OUTPUT BEGIN ===
1/86 Checking commit 58ea704ecde0 (numa: remove deprecated -mem-path fallback to anonymous RAM) 2/86 Checking commit 3026057508a7 (machine: introduce ram-memdev property)
3/86 Checking commit 16ac6d5dfca0 (machine: alias -mem-path and -mem-prealloc into memory-foo backend) 4/86 Checking commit 9ef003bf86b0 (machine: introduce convenience MachineState::ram) 5/86 Checking commit 40a1eec31617 (initialize MachineState::ram in NUMA case)
6/86 Checking commit 06f609f99e7f (alpha:dp264: use memdev for RAM)
ERROR: spaces required around that '*' (ctx:WxV)
#30: FILE: hw/alpha/alpha_sys.h:14:
+PCIBus *typhoon_init(MemoryRegion *, ISABus **, qemu_irq *, AlphaCPU *[4],
^
total: 1 errors, 0 warnings, 49 lines checked
Patch 6/86 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
7/86 Checking commit 0fd04a92fedc (arm:aspeed: convert valid RAM sizes to data)
8/86 Checking commit f2ccbf8db44d (arm:aspeed: actually check RAM size)
9/86 Checking commit 99a74b3ee938 (hw:aspeed: drop warning and bogus ram_size fixup)
10/86 Checking commit fca3baaab72b (arm:aspeed: use memdev for RAM)
11/86 Checking commit be1ddd2cd5f5 (arm:collie: use memdev for RAM)
12/86 Checking commit deb657fd5ee9 (arm:cubieboard: use memdev for RAM)
13/86 Checking commit c60b4f9d6cd2 (arm:digic_boards: use memdev for RAM)
14/86 Checking commit f404c60b1167 (arm:highbank: use memdev for RAM)
15/86 Checking commit 77e06e009693 (arm:imx25_pdk: drop RAM size fixup)
16/86 Checking commit a396753185ed (arm:imx25_pdk: use memdev for RAM)
17/86 Checking commit 18d4ce56967b (arm:integratorcp: use memdev for RAM)
18/86 Checking commit 91d718e5a482 (arm:kzm: drop RAM size fixup)
19/86 Checking commit b3879f1c1c31 (arm:kzm: use memdev for RAM)
20/86 Checking commit a701677008f3 (arm:mcimx6ul-evk: use memdev for RAM)
21/86 Checking commit d9daba789ed4 (arm:mcimx7d-sabre: use memdev for RAM)
22/86 Checking commit e0e52ecc43a7 (arm:mps2-tz: use memdev for RAM)
23/86 Checking commit 6d13cec0d94c (arm:mps2: use memdev for RAM)
24/86 Checking commit 77692988c319 (arm:musicpal: use memdev for RAM)
25/86 Checking commit 04a94904d1c1 (arm:nseries: use memdev for RAM)
26/86 Checking commit b329f683db50 (arm:omap_sx1: use memdev for RAM)
27/86 Checking commit 19437567583f (arm:palm: use memdev for RAM)
28/86 Checking commit af2175c080a5 (arm:raspi: use memdev for RAM)
29/86 Checking commit bc947389baf6 (arm:sabrelite: use memdev for RAM)
30/86 Checking commit 03de30800363 (arm:sbsa-ref: use memdev for RAM)
31/86 Checking commit 9f032bcc0136 (arm:versatilepb: use memdev for RAM)
32/86 Checking commit 9c8ff937f348 (arm:vexpress: use memdev for RAM)
33/86 Checking commit edc382449643 (arm:virt: use memdev for RAM)
34/86 Checking commit 64008acd6753 (arm:xilinx_zynq: drop RAM size fixup)
35/86 Checking commit 8939184e5a43 (arm:xilinx_zynq: use memdev for RAM)
36/86 Checking commit dafc5feec590 (arm:xlnx-versal-virt: use memdev for RAM)
37/86 Checking commit cb1a184d0d59 (arm:xlnx-zcu102: use memdev for RAM)
38/86 Checking commit fab1efc6394f (s390x:s390-virtio-ccw: use memdev for RAM)
39/86 Checking commit 420420e49f1c (null-machine: use memdev for RAM)
40/86 Checking commit 18f08804dee9 (cris:axis_dev88: use memdev for RAM)
41/86 Checking commit 82196f232d2f (hw/hppa/machine: Correctly check the firmware is in PDC range) 42/86 Checking commit 329d37dd2228 (hw/hppa/machine: Restrict the total memory size to 3GB) 43/86 Checking commit 98381695ee75 (hw/hppa/machine: Map the PDC memory region with higher priority) 44/86 Checking commit c14b75322640 (hppa: use memdev for RAM)
45/86 Checking commit 64a0031a7bad (x86:microvm: use memdev for RAM)
46/86 Checking commit debb3a43be01 (x86:pc: use memdev for RAM)
47/86 Checking commit 934be970aa9a (lm32:lm32_boards: use memdev for RAM)
48/86 Checking commit 17a90ad29627 (lm32:milkymist: use memdev for RAM)
49/86 Checking commit 31b4fbd90a84 (m68k:an5206: use memdev for RAM)
50/86 Checking commit 3ad54a87de75 (m68k:mcf5208: use memdev for RAM)
51/86 Checking commit eb6e93f3e88b (m68k:next-cube: use memdev for RAM)
52/86 Checking commit 73027e0d5845 (mips:boston-cube: use memdev for RAM)
53/86 Checking commit 05d6a5e8846c (mips:mips_fulong2e: drop RAM size fixup)
54/86 Checking commit d9a07ca1579d (mips:mips_fulong2e: use memdev for RAM)
55/86 Checking commit e50c092c974f (mips:mips_jazz: use memdev for RAM)
56/86 Checking commit f726ba38fe1f (mips:mips_malta: use memdev for RAM)
57/86 Checking commit 4fa91f449f97 (mips:mips_mipssim: use memdev for RAM)
58/86 Checking commit b959a8d62bde (mips:mips_r4k: use memdev for RAM)
59/86 Checking commit 5bc78d153004 (ppc:e500: drop RAM size fixup)
60/86 Checking commit eaab307ef25b (ppc:e500: use memdev for RAM)
61/86 Checking commit 92fb2bc7ec58 (ppc:mac_newworld: use memdev for RAM)
62/86 Checking commit 03299009858f (ppc:mac_oldworld: use memdev for RAM)
63/86 Checking commit f025b4fa1ed0 (ppc:pnv: use memdev for RAM)
64/86 Checking commit 53365b477d95 (ppc:ppc405_boards: add RAM size checks)
65/86 Checking commit 452578232871 (ppc:ppc405_boards: use memdev for RAM)
66/86 Checking commit 73d3d6916582 (ppc/{ppc440_bamboo,sam460x}: drop RAM size fixup)
67/86 Checking commit 036f996aa26f (ppc:ppc440_bamboo/sam460ex: use memdev for RAM)
68/86 Checking commit b4d5ea58deba (ppc:prep: use memdev for RAM)
69/86 Checking commit ab63a98c1459 (ppc:spapr: use memdev for RAM)
70/86 Checking commit 65dbc2c76e20 (ppc:virtex_ml507: remove unused arguments)
71/86 Checking commit 4904e75da051 (ppc:virtex_ml507: use memdev for RAM)
72/86 Checking commit 24b259e879cf (sparc:leon3: use memdev for RAM)
73/86 Checking commit e120e6728b65 (sparc:sun4m: use memdev for RAM)
74/86 Checking commit 738f1a334ba2 (sparc:niagara: use memdev for RAM)
75/86 Checking commit f7cb0749de91 (remove no longer used memory_region_allocate_system_memory()) 76/86 Checking commit 7dfb5ede2cbe (post conversion default_ram_id cleanup)
77/86 Checking commit afb329be6ce1 (exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize()) 78/86 Checking commit 74d0083098a9 (exec: drop bogus mem_path from qemu_ram_alloc_from_fd()) 79/86 Checking commit 4fd9cfe4fef6 (make mem_path local variable)
80/86 Checking commit 92d79746afa0 (hostmem: introduce "prealloc-threads" property)
81/86 Checking commit d70a9f290f8b (hostmem: fix strict bind policy)
82/86 Checking commit 3e6445f81e47 (numa: forbid '-numa node, mem' for 5.0 and newer machine types) 83/86 Checking commit 56297b3d07ef (tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups) 84/86 Checking commit 53861b0c262a (tests:numa-test: use explicit memdev to specify node RAM) 85/86 Checking commit bac70b89e82c (numa: make exit() usage consistent)
86/86 Checking commit 2d14010cf86c (numa: remove deprecated implicit RAM distribution between nodes) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]