qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 00/35] MIPS patches for 2021-01-03


From: Philippe Mathieu-Daudé
Subject: Re: [PULL 00/35] MIPS patches for 2021-01-03
Date: Tue, 5 Jan 2021 09:44:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

On 1/5/21 2:53 AM, Huacai Chen wrote:
> Hi, Philippe and Peter,
> 
> On Tue, Jan 5, 2021 at 2:30 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>
>> On 1/4/21 7:24 PM, Philippe Mathieu-Daudé wrote:
>>> On 1/4/21 6:39 PM, Philippe Mathieu-Daudé wrote:
>>>> On 1/4/21 4:01 PM, Peter Maydell wrote:
>>>>> On Mon, 4 Jan 2021 at 13:59, Philippe Mathieu-Daudé <f4bug@amsat.org> 
>>>>> wrote:
>>>>>> I don't have access to OSX host. I'll see to install an aarch32 chroot 
>>>>>> and
>>>>>> keep testing (not sure what can differ from an i386 guest).
>>>>>> If I can't find anything I'll resend the same series without the 
>>>>>> Loongson-3
>>>>>> machine, which is the single part adding QOM objects.
>>>
>>> OK I guess I found the problem, we have:
>>>
>>> struct LoongsonMachineState {
>>>     MachineState parent_obj;
>>>     MemoryRegion *pio_alias;
>>>     MemoryRegion *mmio_alias;
>>>     MemoryRegion *ecam_alias;
>>> };
>>>
>>> Then:
>>>
>>> static inline void loongson3_virt_devices_init(MachineState *machine,
>>>                                                DeviceState *pic)
>>> {
>>>     int i;
>>>     qemu_irq irq;
>>>     PCIBus *pci_bus;
>>>     DeviceState *dev;
>>>     MemoryRegion *mmio_reg, *ecam_reg;
>>>     LoongsonMachineState *s = LOONGSON_MACHINE(machine);
>>>
>>> LoongsonMachineState is never allocated... Accessing its MR lead
>>> to BOF.
>>
>> I'm going to respin with this (pass 32-bit tests):
>>
>> -- >8 --
>> diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
>> index e3723d3dd0f..d4a82fa5367 100644
>> --- a/hw/mips/loongson3_virt.c
>> +++ b/hw/mips/loongson3_virt.c
>> @@ -612,8 +612,10 @@ static void mips_loongson3_virt_init(MachineState
>> *machine)
>>      loongson3_virt_devices_init(machine, liointc);
>>  }
>>
>> -static void mips_loongson3_virt_machine_init(MachineClass *mc)
>> +static void loongson3v_machine_class_init(ObjectClass *oc, void *data)
>>  {
>> +    MachineClass *mc = MACHINE_CLASS(oc);
>> +
>>      mc->desc = "Loongson-3 Virtualization Platform";
>>      mc->init = mips_loongson3_virt_init;
>>      mc->block_default_type = IF_IDE;
>> @@ -624,4 +626,13 @@ static void
>> mips_loongson3_virt_machine_init(MachineClass *mc)
>>      mc->minimum_page_bits = 14;
>>  }
>>
>> -DEFINE_MACHINE("loongson3-virt", mips_loongson3_virt_machine_init)
>> +static const TypeInfo loongson3_machine_types[] = {
>> +    {
>> +        .name           = TYPE_LOONGSON_MACHINE,
>> +        .parent         = TYPE_MACHINE,
>> +        .instance_size  = sizeof(LoongsonMachineState),
>> +        .class_init     = loongson3v_machine_class_init,
>> +    }
>> +};
>> +
>> +DEFINE_TYPES(loongson3_machine_types)
>> ---
>>
>> Thanks Peter for catching this (we really need a 32-bit host runner
>> on GitLab...).
>>
> Should I send a new version?

No, I'll squash that in and resend (preparing MIPS pull requests
involve some manual testing, I couldn't automate all the steps
yet, so it takes me some time).

Regards,

Phil.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]