[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/5] hw/arm/virt: Use the PA range to compute the memory m
From: |
Andrew Jones |
Subject: |
Re: [PATCH v2 4/5] hw/arm/virt: Use the PA range to compute the memory map |
Date: |
Mon, 4 Oct 2021 12:15:20 +0200 |
On Sun, Oct 03, 2021 at 05:46:04PM +0100, Marc Zyngier wrote:
...
> @@ -1662,9 +1665,17 @@ static void virt_set_memmap(VirtMachineState *vms)
> vms->memmap[i].size = size;
> base += size;
> }
> - vms->highest_gpa = (vms->highmem ?
> - base :
> - vms->memmap[VIRT_MEM].base + ms->maxram_size) - 1;
> +
> + /*
> + * If base fits within pa_bits, all good. If it doesn't, limit it
> + * to the end of RAM, which is guaranteed to fit within pa_bits.
> + */
> + if (base <= BIT_ULL(pa_bits)) {
> + vms->highest_gpa = base -1;
^ missing space here
> + } else {
> + vms->highest_gpa = memtop - 1;
> + }
> +
> if (device_memory_size > 0) {
> ms->device_memory = g_malloc0(sizeof(*ms->device_memory));
> ms->device_memory->base = device_memory_base;
Thanks,
drew
- [PATCH v2 0/5] target/arm: Reduced-IPA space and highmem=off fixes, Marc Zyngier, 2021/10/03
- [PATCH v2 1/5] hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam, Marc Zyngier, 2021/10/03
- [PATCH v2 4/5] hw/arm/virt: Use the PA range to compute the memory map, Marc Zyngier, 2021/10/03
- [PATCH v2 3/5] hw/arm/virt: Honor highmem setting when computing the memory map, Marc Zyngier, 2021/10/03
- [PATCH v2 5/5] hw/arm/virt: Disable highmem devices that don't fit in the PA range, Marc Zyngier, 2021/10/03
- [PATCH v2 2/5] hw/arm/virt: Add a control for the the highmem redistributors, Marc Zyngier, 2021/10/03