> -----Original Message-----
> From: Paul Durrant <[email protected]>
> Sent: 31 July 2020 14:44
> To: 'Jan Beulich' <[email protected]>
> Cc: [email protected]; 'Paul Durrant' <[email protected]>; 
> 'Andrew Cooper'
> <[email protected]>; 'Wei Liu' <[email protected]>; 'Roger Pau Monné' 
> <[email protected]>
> Subject: RE: [PATCH v2 2/2] x86/hvm: simplify 'mmio_direct' check in 
> epte_get_entry_emt()
> 
> > -----Original Message-----
> > From: Jan Beulich <[email protected]>
> > Sent: 31 July 2020 14:41
> > To: [email protected]
> > Cc: [email protected]; 'Paul Durrant' <[email protected]>; 
> > 'Andrew Cooper'
> > <[email protected]>; 'Wei Liu' <[email protected]>; 'Roger Pau Monné' 
> > <[email protected]>
> > Subject: Re: [PATCH v2 2/2] x86/hvm: simplify 'mmio_direct' check in 
> > epte_get_entry_emt()
> >
> > On 31.07.2020 15:07, Paul Durrant wrote:
> > >> -----Original Message-----
> > >> From: Jan Beulich <[email protected]>
> > >> Sent: 31 July 2020 13:58
> > >> To: Paul Durrant <[email protected]>
> > >> Cc: [email protected]; Paul Durrant <[email protected]>; 
> > >> Andrew Cooper
> > >> <[email protected]>; Wei Liu <[email protected]>; Roger Pau Monné 
> > >> <[email protected]>
> > >> Subject: Re: [PATCH v2 2/2] x86/hvm: simplify 'mmio_direct' check in 
> > >> epte_get_entry_emt()
> > >>
> > >> On 31.07.2020 14:39, Paul Durrant wrote:
> > >>> From: Paul Durrant <[email protected]>
> > >>>
> > >>> Re-factor the code to take advantage of the fact that the APIC access 
> > >>> page is
> > >>> a 'special' page.
> > >>
> > >> Hmm, that's going quite as far as I was thinking to go: In
> > >> particular, you leave in place the set_mmio_p2m_entry() use
> > >> in vmx_alloc_vlapic_mapping(). With that replaced, the
> > >> re-ordering in epte_get_entry_emt() that you do shouldn't
> > >> be necessary; you'd simple drop the checking of the
> > >> specific MFN.
> > >
> > > Ok, it still needs to go in the p2m though so are you suggesting
> > > just calling p2m_set_entry() directly?
> >
> > Yes, if this works. The main question really is whether there are
> > any hidden assumptions elsewhere that this page gets mapped as an
> > MMIO one.
> >
> 
> Actually, it occurs to me that logdirty is going to be an issue if I use 
> p2m_ram_rw. If I'm not going
> to use p2m_mmio_direct then do you have another suggestion?
> 

Looking further I'm uneasy to move away from setting that APIC access page to 
anything other than mmio_direct so I'd rather leave the VMX code alone and 
re-order things here.

  Paul



Reply via email to