[PATCH v2 2/4] microvm: drop max-ram-below-4g support

Gerd Hoffmann posted 4 patches 5 years, 8 months ago
Maintainers: Sergio Lopez <slp@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Eduardo Habkost <ehabkost@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Richard Henderson <rth@twiddle.net>, Paolo Bonzini <pbonzini@redhat.com>
There is a newer version of this series
[PATCH v2 2/4] microvm: drop max-ram-below-4g support
Posted by Gerd Hoffmann 5 years, 8 months ago
Not useful for microvm and allows users to shoot themself
into the foot (make ram + mmio overlap).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/microvm.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index 44f940813b07..5e931975a06d 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -173,25 +173,6 @@ static void microvm_memory_init(MicrovmMachineState *mms)
     ram_addr_t lowmem = 0xc0000000; /* 3G */
     int i;
 
-    /*
-     * Handle the machine opt max-ram-below-4g.  It is basically doing
-     * min(qemu limit, user limit).
-     */
-    if (!x86ms->max_ram_below_4g) {
-        x86ms->max_ram_below_4g = 4 * GiB;
-    }
-    if (lowmem > x86ms->max_ram_below_4g) {
-        lowmem = x86ms->max_ram_below_4g;
-        if (machine->ram_size - lowmem > lowmem &&
-            lowmem & (1 * GiB - 1)) {
-            warn_report("There is possibly poor performance as the ram size "
-                        " (0x%" PRIx64 ") is more then twice the size of"
-                        " max-ram-below-4g (%"PRIu64") and"
-                        " max-ram-below-4g is not a multiple of 1G.",
-                        (uint64_t)machine->ram_size, x86ms->max_ram_below_4g);
-        }
-    }
-
     if (machine->ram_size > lowmem) {
         x86ms->above_4g_mem_size = machine->ram_size - lowmem;
         x86ms->below_4g_mem_size = lowmem;
-- 
2.18.4


Re: [PATCH v2 2/4] microvm: drop max-ram-below-4g support
Posted by Philippe Mathieu-Daudé 5 years, 8 months ago
On 5/28/20 3:40 PM, Gerd Hoffmann wrote:
> Not useful for microvm and allows users to shoot themself
> into the foot (make ram + mmio overlap).
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/i386/microvm.c | 19 -------------------
>  1 file changed, 19 deletions(-)
> 
> diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
> index 44f940813b07..5e931975a06d 100644
> --- a/hw/i386/microvm.c
> +++ b/hw/i386/microvm.c
> @@ -173,25 +173,6 @@ static void microvm_memory_init(MicrovmMachineState *mms)
>      ram_addr_t lowmem = 0xc0000000; /* 3G */
>      int i;
>  
> -    /*
> -     * Handle the machine opt max-ram-below-4g.  It is basically doing
> -     * min(qemu limit, user limit).
> -     */
> -    if (!x86ms->max_ram_below_4g) {
> -        x86ms->max_ram_below_4g = 4 * GiB;
> -    }
> -    if (lowmem > x86ms->max_ram_below_4g) {
> -        lowmem = x86ms->max_ram_below_4g;
> -        if (machine->ram_size - lowmem > lowmem &&
> -            lowmem & (1 * GiB - 1)) {
> -            warn_report("There is possibly poor performance as the ram size "
> -                        " (0x%" PRIx64 ") is more then twice the size of"
> -                        " max-ram-below-4g (%"PRIu64") and"
> -                        " max-ram-below-4g is not a multiple of 1G.",
> -                        (uint64_t)machine->ram_size, x86ms->max_ram_below_4g);
> -        }
> -    }
> -
>      if (machine->ram_size > lowmem) {
>          x86ms->above_4g_mem_size = machine->ram_size - lowmem;
>          x86ms->below_4g_mem_size = lowmem;
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>