Re: Mapping memory regions on s390

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

 



>>> a 1 GB memory hole which is similar to that seen on older PCs.]  
>>
>> That would be a hole inside the memory or beyond the memory? For obvious
>> reasons a hole is not good. Considering usecases like a DAX-enabled
>> filesystem 1GB seem pretty small for such cases.  So would that rather be
>> a mapping after the maximum memory size until the architecture limit.
> 
> The orginal idea was
> guest memory
> shared regions
> memory for virtio-mem and friends
> 
> Alternative layout see below; I understand that the 1 GB limit would be
> problematic, but I'm not sure what virtio-mem will need. David probably
> understands more :)

David here. The alternative layout most probably makes more sense, as it
gives us more flexibility. For memory devices we know via QEMU "maxmem"
how much memory we will need pretty much exactly ("problem shifted to
the user"). Similar to existing DIMM code e.g. on x86/power

> 
>>
>> Do we know the size of the device mappings upfront (So that we can setup
>> the max memory size)?
>> Something like
>> 4GB guest + 2 deviced with 1TB each. So we would set the max memory size
>> to 2.004TB
> 
> For a non-hotplugged device, we should know. For hotplugged, this is
> more difficult; maybe we can fail it if a pre-alloced pool is exhausted?

We can
a) make it configurable similar to maxmem (e.g. machine property)
b) guarantee a minimum size (e.g. X GB) we can glue to compat machines.

Especially we should also provide a way to disable it completely, for
small guests. (can also be done via such a parameter)

In addition, the "max out current address space size" can always be done
without issues.

> 
>>
>> Christian
>>>
>>> On Fri, 15 Feb 2019 23:08:12 +0100
>>> David Hildenbrand <david@xxxxxxxxxx> wrote:
>>>   
>>>>>> On s390x, we have to define the size of the host->guest page table when
>>>>>> starting the guest. So we need some upper limit.    
>>>>>
>>>>> That's OK; x86 also has that because they have a limited physical
>>>>> and virtual address size [which may or may not be correctly passed to
>>>>> the guest!].
>>>>>     
>>>>>> Mapping anywhere, I
>>>>>> really don't like. Letting the guest define the mapping, I really don't
>>>>>> like.    
>>>>>
>>>>> Well it's OK to have a hole for it, but letting the guest choose where
>>>>> those mappings go in the hole is the norm for PCI (there are
>>>>> exceptions).    
>>>>
>>>> Yes, but at least if we need a new interface for this for s390x (what I
>>>> assume), not allowing the guest to map is obviously easier. However if
>>>> there is good reason why it is needed, nothing speaks against it. We
>>>> just have to offer the guest enough information to do it.  
>>>
>>> Speaking of host/guest: It's probably fine to do something that
>>> requires a hypervisor; it just needs to work within the constraints of
>>> the architecture. Not sure if SCLP or a diag hypercall should come into
>>> play.
>>>   
>>>>  
>>>>>     
>>>>>> We can of course switch the order of mappings
>>>>>>
>>>>>> [0x000000000000000      ]
>>>>>> ... Memory region containing RAM
>>>>>> [ram_size         	]
>>>>>> ... Memory region for memory devices (virtio-pmem, virtio-mem ...)
>>>>>> [maxram_size - ram_size ]
>>>>>> ... Memory region for e.g. special PCI/CCW devices
>>>>>> [                    TBD]
>>>>>>
>>>>>> We can size TBD in a way that we e.g. max out the current page table
>>>>>> size before having to switch to more levels.    
> 
> This is what I meant with the alternative approach.
> 
>>>>>
>>>>> Yes, that's fine to set some upper limit; you've just got to make sure
>>>>> that the hypervisor knows where it can put stuff and if the guest
>>>>> does PCI that it knows where it's allowed to put stuff and as long
>>>>> as the two don't overlap everyone is happy.  
>>>
>>> Hm... is that an issue for pci? Do we need to care, as s390 uses
>>> special instructions anyway? Or do we want to avoid going through them,
>>> so that the guest can use normal read/write?
>>>   
>>>>>
>>>>> [We should probably take this level of detail off this list - it's
>>>>> parsecs away from the detail of virtio]    
>>>>
>>>> Yes indeed, I guess this gives Conny an idea on how it could work, so
>>>> now she can design an interface - and clarify all the details ;)  
>>>
>>> I really need someone familiar with memory handling for that, though :)
>>>   
>>>> I guess we'll need something for both, virtio-ccw and virtio-pci on s390x.  
>>>
>>> My guess is that we can use the same mechanism for pci. The hard part
>>> is probably coming up with a memory layout...
> 
> I'm also still unsure about possible zpci implications; maybe someone
> who is familiar with that one has an idea.
> 

I'm afraid I can't help here :/

-- 

Thanks,

David / dhildenb



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux