Re: [PATCH 2/2] m68k: introduce a virtual m68k machine
From: Laurent Vivier
Date: Thu Sep 30 2021 - 17:11:26 EST
Le 28/04/2021 à 14:04, Geert Uytterhoeven a écrit :
> Hi Laurent,
>
> On Tue, Mar 23, 2021 at 11:14 PM Laurent Vivier <laurent@xxxxxxxxx> wrote:
>> This machine allows to have up to 3.2 GiB and 128 Virtio devices.
>>
>> It is based on android goldfish devices.
>>
>> Signed-off-by: Laurent Vivier <laurent@xxxxxxxxx>
>
> Thanks for your patch!
Thank you for the review, sorry for the very late answer.
Only two comments before I send a v2.
>> --- a/arch/m68k/Kconfig.machine
>> +++ b/arch/m68k/Kconfig.machine
>> @@ -145,6 +145,23 @@ config SUN3
>>
>> If you don't want to compile a kernel exclusively for a Sun 3, say N.
>>
>> +config VIRT
>> + bool "Virtual M68k Machine support"
>> + depends on MMU
>> + select MMU_MOTOROLA if MMU
>> + select M68040
>> + select LEGACY_TIMER_TICK
>
> Can we avoid selecting this for a new platform?
>
I tried but I was not able to have a working scheduler.
As the machine has been tested with this option and most of the other m68k machines uses it, I will
keep it.
...
>> --- /dev/null
>> +++ b/arch/m68k/virt/platform.c
>> @@ -0,0 +1,80 @@
...
>> +
>> + if (!MACH_IS_VIRT)
>> + return -ENODEV;
>> +
>> + min_low_pfn = 0;
>
> Why is this needed?
>
This is needed to be able to have working DMA in goldfish_tty.
Without this, memory provided for the buffer in goldish_tty_rw() are not usable with DMA and we
cannot transfer the data. If I remember correctly dma_map_single() fails.
I think this is because the memory provided by the kernel is not in the DMA area. But the virt
machine has no DMA...
Perhaps you can propose better solution?
Thanks,
Laurent