[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 5/6] i386/pc: warn if phys-bits is too low
From: |
Joao Martins |
Subject: |
Re: [PATCH v3 5/6] i386/pc: warn if phys-bits is too low |
Date: |
Thu, 24 Feb 2022 14:42:37 +0000 |
On 2/23/22 18:44, Joao Martins wrote:
> @@ -896,6 +897,15 @@ void pc_memory_init(PCMachineState *pcms,
>
> x86_update_above_4g_mem_start(pcms, pci_hole64_size);
>
> + maxphysaddr = ((hwaddr)1 << X86_CPU(first_cpu)->phys_bits) - 1;
> + maxusedaddr = x86_max_phys_addr(pcms, pci_hole64_size);
> + if (maxphysaddr < maxusedaddr) {
> + warn_report("Address space above 4G at %"PRIx64"-%"PRIx64
> + " phys-bits too low (%u)",
> + x86ms->above_4g_mem_start, maxusedaddr,
> + X86_CPU(first_cpu)->phys_bits);
> + }
> +
And in addition to the change in patch 4, for 32-bit I will change this
to an error_report(...) and exit right after, and updating commit message
accordingly. The error message changes slightly too given that it was
too specific to the above 4G region. All qtests pass.
diffstat below:
@@ -904,6 +905,16 @@ void pc_memory_init(PCMachineState *pcms,
x86_update_above_4g_mem_start(pcms, pci_hole64_size);
+ maxphysaddr = ((hwaddr)1 << X86_CPU(first_cpu)->phys_bits) - 1;
+ maxusedaddr = x86_max_phys_addr(pcms, pci_hole64_size);
+ if (maxphysaddr < maxusedaddr) {
+ error_report("Address space limit 0x%"PRIx64" < 0x%"PRIx64
+ " phys-bits too low (%u)",
+ maxphysaddr, maxusedaddr,
+ X86_CPU(first_cpu)->phys_bits);
+ exit(EXIT_FAILURE);
+ }
- Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable, (continued)
- Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable, Michael S. Tsirkin, 2022/02/24
- Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable, Joao Martins, 2022/02/24
- Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable, Michael S. Tsirkin, 2022/02/24
- Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable, Joao Martins, 2022/02/24
- Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable, Michael S. Tsirkin, 2022/02/24
- Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable, Joao Martins, 2022/02/24
- Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable, Alex Williamson, 2022/02/24
- Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable, Jason Wang, 2022/02/24
Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable, Joao Martins, 2022/02/24
[PATCH v3 5/6] i386/pc: warn if phys-bits is too low, Joao Martins, 2022/02/23
- Re: [PATCH v3 5/6] i386/pc: warn if phys-bits is too low,
Joao Martins <=
[PATCH v3 6/6] i386/pc: restrict AMD only enforcing of valid IOVAs to new machine type, Joao Martins, 2022/02/23