Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-25 Thread Joao Martins
On 2/25/22 16:15, Alex Williamson wrote: > On Fri, 25 Feb 2022 12:36:24 + > Joao Martins wrote: > >> On 2/24/22 21:40, Alex Williamson wrote: >>> On Thu, 24 Feb 2022 20:34:40 + >>> Joao Martins wrote: Of all those cases I would feel the machine-property is better, and more f

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-25 Thread Joao Martins
On 2/25/22 12:49, Michael S. Tsirkin wrote: > On Fri, Feb 25, 2022 at 12:36:24PM +, Joao Martins wrote: >> I am trying to approach this iteratively and starting by fixing AMD 1T+ >> guests >> with something that hopefully is less painful to bear and unbreaks users >> doing >> multi-TB guests

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-25 Thread Alex Williamson
On Fri, 25 Feb 2022 12:36:24 + Joao Martins wrote: > On 2/24/22 21:40, Alex Williamson wrote: > > On Thu, 24 Feb 2022 20:34:40 + > > Joao Martins wrote: > >> Of all those cases I would feel the machine-property is better, > >> and more flexible than having VFIO/VDPA deal with a bad memor

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-25 Thread Michael S. Tsirkin
On Fri, Feb 25, 2022 at 12:36:24PM +, Joao Martins wrote: > I am trying to approach this iteratively and starting by fixing AMD 1T+ guests > with something that hopefully is less painful to bear and unbreaks users doing > multi-TB guests on kernels >= 5.4. While for < 5.4 it would not wrongly b

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-25 Thread Joao Martins
On 2/25/22 05:22, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at 08:34:40PM +, Joao Martins wrote: >> On 2/24/22 20:12, Michael S. Tsirkin wrote: >>> On Thu, Feb 24, 2022 at 08:04:48PM +, Joao Martins wrote: On 2/24/22 19:54, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-25 Thread Joao Martins
On 2/24/22 21:40, Alex Williamson wrote: > On Thu, 24 Feb 2022 20:34:40 + > Joao Martins wrote: > >> On 2/24/22 20:12, Michael S. Tsirkin wrote: >>> On Thu, Feb 24, 2022 at 08:04:48PM +, Joao Martins wrote: On 2/24/22 19:54, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 08:34:40PM +, Joao Martins wrote: > On 2/24/22 20:12, Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 08:04:48PM +, Joao Martins wrote: > >> On 2/24/22 19:54, Michael S. Tsirkin wrote: > >>> On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: > O

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Jason Wang
On Fri, Feb 25, 2022 at 2:30 AM Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: > > On 2/24/22 17:23, Michael S. Tsirkin wrote: > > > On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: > > >> On 2/23/22 23:35, Joao Martins wrote: > > >>> On 2/

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Alex Williamson
On Thu, 24 Feb 2022 20:34:40 + Joao Martins wrote: > On 2/24/22 20:12, Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 08:04:48PM +, Joao Martins wrote: > >> On 2/24/22 19:54, Michael S. Tsirkin wrote: > >>> On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: >

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/24/22 20:12, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at 08:04:48PM +, Joao Martins wrote: >> On 2/24/22 19:54, Michael S. Tsirkin wrote: >>> On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: On 2/24/22 18:30, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 08:04:48PM +, Joao Martins wrote: > > > On 2/24/22 19:54, Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: > >> On 2/24/22 18:30, Michael S. Tsirkin wrote: > >>> On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: >

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/24/22 19:54, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: >> On 2/24/22 18:30, Michael S. Tsirkin wrote: >>> On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: On 2/24/22 17:23, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: > On 2/24/22 18:30, Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: > >> On 2/24/22 17:23, Michael S. Tsirkin wrote: > >>> On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: > O

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/24/22 18:30, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: >> On 2/24/22 17:23, Michael S. Tsirkin wrote: >>> On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: On 2/23/22 23:35, Joao Martins wrote: > On 2/23/22 21:22, Michael S.

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: > On 2/24/22 17:23, Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: > >> On 2/23/22 23:35, Joao Martins wrote: > >>> On 2/23/22 21:22, Michael S. Tsirkin wrote: > > +static void x86_update_

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/24/22 17:23, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: >> On 2/23/22 23:35, Joao Martins wrote: >>> On 2/23/22 21:22, Michael S. Tsirkin wrote: > +static void x86_update_above_4g_mem_start(PCMachineState *pcms, > +

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: > On 2/23/22 23:35, Joao Martins wrote: > > On 2/23/22 21:22, Michael S. Tsirkin wrote: > >>> +static void x86_update_above_4g_mem_start(PCMachineState *pcms, > >>> + uint64_t pci_hole64_size) > >

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/23/22 23:35, Joao Martins wrote: > On 2/23/22 21:22, Michael S. Tsirkin wrote: >>> +static void x86_update_above_4g_mem_start(PCMachineState *pcms, >>> + uint64_t pci_hole64_size) >>> +{ >>> +X86MachineState *x86ms = X86_MACHINE(pcms); >>> +uint

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/23/22 18:44, Joao Martins wrote: > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > index 360f4e10001b..6e4f5c87a2e5 100644 > --- a/hw/i386/pc.c > +++ b/hw/i386/pc.c > @@ -802,6 +802,78 @@ void xen_load_linux(PCMachineState *pcms) > #define PC_ROM_ALIGN 0x800 > #define PC_ROM_SIZE(PC

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-23 Thread Joao Martins
On 2/23/22 21:22, Michael S. Tsirkin wrote: > On Wed, Feb 23, 2022 at 06:44:53PM +, Joao Martins wrote: >> It is assumed that the whole GPA space is available to be DMA >> addressable, within a given address space limit, expect for a >> tiny region before the 4G. Since Linux v5.4, VFIO validate

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-23 Thread Michael S. Tsirkin
On Wed, Feb 23, 2022 at 06:44:53PM +, Joao Martins wrote: > It is assumed that the whole GPA space is available to be DMA > addressable, within a given address space limit, expect for a > tiny region before the 4G. Since Linux v5.4, VFIO validates > whether the selected GPA is indeed valid i.e.