search for: page_to_balloon_pfn

Displaying 20 results from an estimated 134 matches for "page_to_balloon_pfn".

2012 Apr 12
3
[PATCH 0/3] Bugfixes for virtio balloon driver
This series contains one cleanup and two bug fixes for the virtio balloon driver.
2012 Apr 12
3
[PATCH 0/3] Bugfixes for virtio balloon driver
This series contains one cleanup and two bug fixes for the virtio balloon driver.
2012 Apr 13
0
[PATCH] virtio_balloon: fix handling of PAGE_SIZE != 4k
As reported by David Gibson, current code handles PAGE_SIZE != 4k completely wrong which can lead to guest memory corruption errors. - page_to_balloon_pfn is wrong: e.g. on system with 64K page size it gives the same pfn value for 16 different pages. - we also need to convert back to linux pfns when we free. - for each linux page we need to tell host about multiple balloon pages, but code only adds one pfn to the array. Signed-off-by: David Gib...
2012 Apr 13
0
[PATCH] virtio_balloon: fix handling of PAGE_SIZE != 4k
As reported by David Gibson, current code handles PAGE_SIZE != 4k completely wrong which can lead to guest memory corruption errors. - page_to_balloon_pfn is wrong: e.g. on system with 64K page size it gives the same pfn value for 16 different pages. - we also need to convert back to linux pfns when we free. - for each linux page we need to tell host about multiple balloon pages, but code only adds one pfn to the array. Signed-off-by: David Gib...
2016 May 18
4
[PATCH] virtio_balloon: fix PFN format for virtio-1
...e) +static void set_page_pfns(struct virtio_balloon *vb, + __virtio32 pfns[], struct page *page) { unsigned int i; /* Set balloon pfns pointing at this page. * Note that the first pfn points at start of the page. */ for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++) - pfns[i] = page_to_balloon_pfn(page) + i; + pfns[i] = cpu_to_virtio32(vb->vdev, + page_to_balloon_pfn(page) + i); } static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) @@ -158,7 +160,7 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) msleep(200); break; } - set_page...
2016 May 18
4
[PATCH] virtio_balloon: fix PFN format for virtio-1
...e) +static void set_page_pfns(struct virtio_balloon *vb, + __virtio32 pfns[], struct page *page) { unsigned int i; /* Set balloon pfns pointing at this page. * Note that the first pfn points at start of the page. */ for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++) - pfns[i] = page_to_balloon_pfn(page) + i; + pfns[i] = cpu_to_virtio32(vb->vdev, + page_to_balloon_pfn(page) + i); } static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) @@ -158,7 +160,7 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) msleep(200); break; } - set_page...
2016 May 24
3
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...------------------------------------------------------- > > ----------- > > +static void set_page_bitmap(struct virtio_balloon *vb, struct page > > +*page) { > > + unsigned int i; > > + unsigned long *bitmap = vb->page_bitmap; > > + unsigned long balloon_pfn = page_to_balloon_pfn(page); > > + > > + for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++) > > + set_bit(balloon_pfn + i, bitmap); > > BTW, there's a page size value in header so there is no longer need to set > multiple bits per page. Yes, you are right. > > > + if (bal...
2016 May 24
3
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...------------------------------------------------------- > > ----------- > > +static void set_page_bitmap(struct virtio_balloon *vb, struct page > > +*page) { > > + unsigned int i; > > + unsigned long *bitmap = vb->page_bitmap; > > + unsigned long balloon_pfn = page_to_balloon_pfn(page); > > + > > + for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++) > > + set_bit(balloon_pfn + i, bitmap); > > BTW, there's a page size value in header so there is no longer need to set > multiple bits per page. Yes, you are right. > > > + if (bal...
2016 Jun 13
0
[PATCH] virtio_balloon: fix PFN format for virtio-1
...tio_balloon *vb, > + __virtio32 pfns[], struct page *page) > { > unsigned int i; > > /* Set balloon pfns pointing at this page. > * Note that the first pfn points at start of the page. */ > for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++) > - pfns[i] = page_to_balloon_pfn(page) + i; > + pfns[i] = cpu_to_virtio32(vb->vdev, > + page_to_balloon_pfn(page) + i); > } > > static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) > @@ -158,7 +160,7 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) > mslee...
2016 Oct 25
1
[RESEND PATCH v3 kernel 4/7] virtio-balloon: speed up inflate/deflate process
...gt; > +static inline void init_pfn_range(struct virtio_balloon *vb) > +{ > + vb->min_pfn = ULONG_MAX; > + vb->max_pfn = 0; > +} > + > +static inline void update_pfn_range(struct virtio_balloon *vb, > + struct page *page) > +{ > + unsigned long balloon_pfn = page_to_balloon_pfn(page); > + > + if (balloon_pfn < vb->min_pfn) > + vb->min_pfn = balloon_pfn; > + if (balloon_pfn > vb->max_pfn) > + vb->max_pfn = balloon_pfn; > +} > + rename to hint these are all bitmap related. > static void tell_host(struct virtio_balloon *vb, str...
2016 Oct 25
1
[RESEND PATCH v3 kernel 4/7] virtio-balloon: speed up inflate/deflate process
...gt; > +static inline void init_pfn_range(struct virtio_balloon *vb) > +{ > + vb->min_pfn = ULONG_MAX; > + vb->max_pfn = 0; > +} > + > +static inline void update_pfn_range(struct virtio_balloon *vb, > + struct page *page) > +{ > + unsigned long balloon_pfn = page_to_balloon_pfn(page); > + > + if (balloon_pfn < vb->min_pfn) > + vb->min_pfn = balloon_pfn; > + if (balloon_pfn > vb->max_pfn) > + vb->max_pfn = balloon_pfn; > +} > + rename to hint these are all bitmap related. > static void tell_host(struct virtio_balloon *vb, str...
2016 Jan 01
1
[PATCH v4 1/2] virtio_balloon: Restore the entire balloon after the system freeze
...a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c > index 7efc32945810..d73a86db2490 100644 > --- a/drivers/virtio/virtio_balloon.c > +++ b/drivers/virtio/virtio_balloon.c > @@ -135,9 +135,10 @@ static void set_page_pfns(u32 pfns[], struct page *page) > pfns[i] = page_to_balloon_pfn(page) + i; > } > > -static void fill_balloon(struct virtio_balloon *vb, size_t num) > +static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) > { > struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info; > + unsigned num_allocated_pages; > >...
2016 Jan 01
1
[PATCH v4 1/2] virtio_balloon: Restore the entire balloon after the system freeze
...a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c > index 7efc32945810..d73a86db2490 100644 > --- a/drivers/virtio/virtio_balloon.c > +++ b/drivers/virtio/virtio_balloon.c > @@ -135,9 +135,10 @@ static void set_page_pfns(u32 pfns[], struct page *page) > pfns[i] = page_to_balloon_pfn(page) + i; > } > > -static void fill_balloon(struct virtio_balloon *vb, size_t num) > +static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) > { > struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info; > + unsigned num_allocated_pages; > >...
2016 May 24
2
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...d will be used in the function tell_host(): --------------------------------------------------------------------------------- +static void set_page_bitmap(struct virtio_balloon *vb, struct page +*page) { + unsigned int i; + unsigned long *bitmap = vb->page_bitmap; + unsigned long balloon_pfn = page_to_balloon_pfn(page); + + for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++) + set_bit(balloon_pfn + i, bitmap); + if (balloon_pfn < vb->start_pfn) + vb->start_pfn = balloon_pfn; + if (balloon_pfn > vb->end_pfn) + vb->end_pfn = balloon_pfn; +} + unsigned long start_pfn, end_pfn, flags...
2016 May 24
2
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...d will be used in the function tell_host(): --------------------------------------------------------------------------------- +static void set_page_bitmap(struct virtio_balloon *vb, struct page +*page) { + unsigned int i; + unsigned long *bitmap = vb->page_bitmap; + unsigned long balloon_pfn = page_to_balloon_pfn(page); + + for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++) + set_bit(balloon_pfn + i, bitmap); + if (balloon_pfn < vb->start_pfn) + vb->start_pfn = balloon_pfn; + if (balloon_pfn > vb->end_pfn) + vb->end_pfn = balloon_pfn; +} + unsigned long start_pfn, end_pfn, flags...
2016 Aug 08
0
[PATCH v3 kernel 4/7] virtio-balloon: speed up inflate/deflate process
...truct virtqueue *vq) wake_up(&vb->acked); } +static inline void init_pfn_range(struct virtio_balloon *vb) +{ + vb->min_pfn = ULONG_MAX; + vb->max_pfn = 0; +} + +static inline void update_pfn_range(struct virtio_balloon *vb, + struct page *page) +{ + unsigned long balloon_pfn = page_to_balloon_pfn(page); + + if (balloon_pfn < vb->min_pfn) + vb->min_pfn = balloon_pfn; + if (balloon_pfn > vb->max_pfn) + vb->max_pfn = balloon_pfn; +} + static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) { - struct scatterlist sg; - unsigned int len; + struct scatterlist...
2016 Oct 21
0
[RESEND PATCH v3 kernel 4/7] virtio-balloon: speed up inflate/deflate process
...truct virtqueue *vq) wake_up(&vb->acked); } +static inline void init_pfn_range(struct virtio_balloon *vb) +{ + vb->min_pfn = ULONG_MAX; + vb->max_pfn = 0; +} + +static inline void update_pfn_range(struct virtio_balloon *vb, + struct page *page) +{ + unsigned long balloon_pfn = page_to_balloon_pfn(page); + + if (balloon_pfn < vb->min_pfn) + vb->min_pfn = balloon_pfn; + if (balloon_pfn > vb->max_pfn) + vb->max_pfn = balloon_pfn; +} + static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) { - struct scatterlist sg; - unsigned int len; + struct scatterlist...
2016 Jul 27
0
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...truct virtqueue *vq) wake_up(&vb->acked); } +static inline void init_pfn_range(struct virtio_balloon *vb) +{ + vb->min_pfn = ULONG_MAX; + vb->max_pfn = 0; +} + +static inline void update_pfn_range(struct virtio_balloon *vb, + struct page *page) +{ + unsigned long balloon_pfn = page_to_balloon_pfn(page); + + if (balloon_pfn < vb->min_pfn) + vb->min_pfn = balloon_pfn; + if (balloon_pfn > vb->max_pfn) + vb->max_pfn = balloon_pfn; +} + static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) { struct scatterlist sg; unsigned int len; - sg_init_one(&...
2016 Jul 27
1
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...gt; > +static inline void init_pfn_range(struct virtio_balloon *vb) > +{ > + vb->min_pfn = ULONG_MAX; > + vb->max_pfn = 0; > +} > + > +static inline void update_pfn_range(struct virtio_balloon *vb, > + struct page *page) > +{ > + unsigned long balloon_pfn = page_to_balloon_pfn(page); > + > + if (balloon_pfn < vb->min_pfn) > + vb->min_pfn = balloon_pfn; > + if (balloon_pfn > vb->max_pfn) > + vb->max_pfn = balloon_pfn; > +} > + > static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) > { > struct scatter...
2016 Jul 27
1
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...gt; > +static inline void init_pfn_range(struct virtio_balloon *vb) > +{ > + vb->min_pfn = ULONG_MAX; > + vb->max_pfn = 0; > +} > + > +static inline void update_pfn_range(struct virtio_balloon *vb, > + struct page *page) > +{ > + unsigned long balloon_pfn = page_to_balloon_pfn(page); > + > + if (balloon_pfn < vb->min_pfn) > + vb->min_pfn = balloon_pfn; > + if (balloon_pfn > vb->max_pfn) > + vb->max_pfn = balloon_pfn; > +} > + > static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) > { > struct scatter...