Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-22 Thread Jan Beulich
>>> On 22.02.19 at 14:24, wrote: On 22.02.19 at 14:19, wrote: > > I have only realised this today: essentially we will end up implementing > > xmalloc with vmalloc, which at the moment depends on xmalloc to allocate > > the array of mfns. > > Which (potential locking issues aside) is not a

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-22 Thread Jan Beulich
>>> On 22.02.19 at 14:19, wrote: > I have only realised this today: essentially we will end up implementing > xmalloc with vmalloc, which at the moment depends on xmalloc to allocate > the array of mfns. Which (potential locking issues aside) is not a problem, as the size of the MFN array will re

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-22 Thread Wei Liu
On Fri, Feb 22, 2019 at 05:47:13AM -0700, Jan Beulich wrote: > >>> On 22.02.19 at 13:11, wrote: > > On Fri, Feb 22, 2019 at 05:06:03AM -0700, Jan Beulich wrote: > >> >>> On 22.02.19 at 12:50, wrote: > >> > On Fri, Feb 22, 2019 at 04:48:09AM -0700, Jan Beulich wrote: > >> >> >>> On 20.02.19 at 18:

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-22 Thread Jan Beulich
>>> On 22.02.19 at 13:11, wrote: > On Fri, Feb 22, 2019 at 05:06:03AM -0700, Jan Beulich wrote: >> >>> On 22.02.19 at 12:50, wrote: >> > On Fri, Feb 22, 2019 at 04:48:09AM -0700, Jan Beulich wrote: >> >> >>> On 20.02.19 at 18:08, wrote: >> >> > On Wed, Feb 20, 2019 at 01:09:56PM +, Wei Liu w

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-22 Thread Wei Liu
On Fri, Feb 22, 2019 at 05:06:03AM -0700, Jan Beulich wrote: > >>> On 22.02.19 at 12:50, wrote: > > On Fri, Feb 22, 2019 at 04:48:09AM -0700, Jan Beulich wrote: > >> >>> On 20.02.19 at 18:08, wrote: > >> > On Wed, Feb 20, 2019 at 01:09:56PM +, Wei Liu wrote: > >> > [...] > >> >> I think under

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-22 Thread Jan Beulich
>>> On 22.02.19 at 12:50, wrote: > On Fri, Feb 22, 2019 at 04:48:09AM -0700, Jan Beulich wrote: >> >>> On 20.02.19 at 18:08, wrote: >> > On Wed, Feb 20, 2019 at 01:09:56PM +, Wei Liu wrote: >> > [...] >> >> I think under-allocate-then-map looks plausible. xmalloc will need >> >> to allocate p

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-22 Thread Wei Liu
On Fri, Feb 22, 2019 at 04:48:09AM -0700, Jan Beulich wrote: > >>> On 20.02.19 at 18:08, wrote: > > On Wed, Feb 20, 2019 at 01:09:56PM +, Wei Liu wrote: > > [...] > >> I think under-allocate-then-map looks plausible. xmalloc will need > >> to allocate pages, put them into an array and call __v

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-22 Thread Jan Beulich
>>> On 20.02.19 at 18:08, wrote: > On Wed, Feb 20, 2019 at 01:09:56PM +, Wei Liu wrote: > [...] >> I think under-allocate-then-map looks plausible. xmalloc will need >> to allocate pages, put them into an array and call __vmap on that array >> directly. > > The biggest issue with this approac

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-21 Thread Wei Liu
On Thu, Feb 21, 2019 at 10:59:41AM +0100, Roger Pau Monné wrote: > On Wed, Feb 20, 2019 at 05:08:09PM +, Wei Liu wrote: > > On Wed, Feb 20, 2019 at 01:09:56PM +, Wei Liu wrote: > > [...] > > > I think under-allocate-then-map looks plausible. xmalloc will need > > > to allocate pages, put th

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-21 Thread Roger Pau Monné
On Wed, Feb 20, 2019 at 05:08:09PM +, Wei Liu wrote: > On Wed, Feb 20, 2019 at 01:09:56PM +, Wei Liu wrote: > [...] > > I think under-allocate-then-map looks plausible. xmalloc will need > > to allocate pages, put them into an array and call __vmap on that array > > directly. > > The bigge

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-20 Thread Wei Liu
On Wed, Feb 20, 2019 at 01:09:56PM +, Wei Liu wrote: [...] > I think under-allocate-then-map looks plausible. xmalloc will need > to allocate pages, put them into an array and call __vmap on that array > directly. The biggest issue with this approach is that we now need an array of 1UL

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-20 Thread Wei Liu
On Wed, Feb 20, 2019 at 02:00:52PM +0100, Roger Pau Monné wrote: > On Wed, Feb 20, 2019 at 12:29:01PM +, Wei Liu wrote: > > On Thu, Jan 24, 2019 at 11:44:55AM +, Wei Liu wrote: > > > 3. Implement xenheap using vmap infrastructure > > > > > > This helps preserve xenheap's "always mapped" pr

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-20 Thread Roger Pau Monné
On Wed, Feb 20, 2019 at 12:29:01PM +, Wei Liu wrote: > On Thu, Jan 24, 2019 at 11:44:55AM +, Wei Liu wrote: > > 3. Implement xenheap using vmap infrastructure > > > > This helps preserve xenheap's "always mapped" property. At the moment, > > vmap relies on xenheap, we want to turn this rel

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-20 Thread Wei Liu
On Thu, Jan 24, 2019 at 11:44:55AM +, Wei Liu wrote: > 3. Implement xenheap using vmap infrastructure > > This helps preserve xenheap's "always mapped" property. At the moment, > vmap relies on xenheap, we want to turn this relationship around. > > There is a loop what needs breaking in the n

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-02-07 Thread Wei Liu
On Thu, Jan 24, 2019 at 11:44:55AM +, Wei Liu wrote: [...] > 3.2 Switch page table allocation to use domheap page > > We think that 3.2 is a worthwhile thing to do anyway. This work just > gives us a good excuse to do it. I just posted a patch series for this work item. See [PATCH RFC 00/5

Re: [Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-01-24 Thread George Dunlap
On 1/24/19 11:44 AM, Wei Liu wrote: > Below is a summary for a discussion on this topic between Jan and me. I've skimmed this over and it looks reasonable. Thanks for doing this. -George ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https

[Xen-devel] Reducing or removing direct map from xen (was Re: Ongoing/future speculative mitigation work)

2019-01-24 Thread Wei Liu
Below is a summary for a discussion on this topic between Jan and me. End goal: reduce the size of direct map or remove it completely Constraints: 1. We want unified xenheap and domheap. 2. We want to preserve xenheap's semantics -- always globally mapped so that pointers can be stashed safel