From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v2 4/4] xen: add helpers to allocate unpopulated memory
Date: Fri, 24 Jul 2020 23:46:19 +0800 [thread overview]
Message-ID: <202007242335.TRijZOnV%lkp@intel.com> (raw)
In-Reply-To: <20200724124241.48208-5-roger.pau@citrix.com>
[-- Attachment #1: Type: text/plain, Size: 4875 bytes --]
Hi Roger,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on xen-tip/linux-next]
[also build test ERROR on linus/master v5.8-rc6 next-20200724]
[cannot apply to linux/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Roger-Pau-Monne/xen-balloon-fixes-for-memory-hotplug/20200724-204452
base: https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git linux-next
config: i386-debian-10.3 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/xen/xen_drm_front_gem.c: In function 'gem_create':
>> drivers/gpu/drm/xen/xen_drm_front_gem.c:102:9: error: implicit declaration of function 'xen_alloc_unpopulated_pages' [-Werror=implicit-function-declaration]
102 | ret = xen_alloc_unpopulated_pages(xen_obj->num_pages,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/xen/xen_drm_front_gem.c: In function 'xen_drm_front_gem_free_object_unlocked':
>> drivers/gpu/drm/xen/xen_drm_front_gem.c:155:5: error: implicit declaration of function 'xen_free_unpopulated_pages' [-Werror=implicit-function-declaration]
155 | xen_free_unpopulated_pages(xen_obj->num_pages,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/xen_alloc_unpopulated_pages +102 drivers/gpu/drm/xen/xen_drm_front_gem.c
77
78 static struct xen_gem_object *gem_create(struct drm_device *dev, size_t size)
79 {
80 struct xen_drm_front_drm_info *drm_info = dev->dev_private;
81 struct xen_gem_object *xen_obj;
82 int ret;
83
84 size = round_up(size, PAGE_SIZE);
85 xen_obj = gem_create_obj(dev, size);
86 if (IS_ERR_OR_NULL(xen_obj))
87 return xen_obj;
88
89 if (drm_info->front_info->cfg.be_alloc) {
90 /*
91 * backend will allocate space for this buffer, so
92 * only allocate array of pointers to pages
93 */
94 ret = gem_alloc_pages_array(xen_obj, size);
95 if (ret < 0)
96 goto fail;
97
98 /*
99 * allocate ballooned pages which will be used to map
100 * grant references provided by the backend
101 */
> 102 ret = xen_alloc_unpopulated_pages(xen_obj->num_pages,
103 xen_obj->pages);
104 if (ret < 0) {
105 DRM_ERROR("Cannot allocate %zu ballooned pages: %d\n",
106 xen_obj->num_pages, ret);
107 gem_free_pages_array(xen_obj);
108 goto fail;
109 }
110
111 xen_obj->be_alloc = true;
112 return xen_obj;
113 }
114 /*
115 * need to allocate backing pages now, so we can share those
116 * with the backend
117 */
118 xen_obj->num_pages = DIV_ROUND_UP(size, PAGE_SIZE);
119 xen_obj->pages = drm_gem_get_pages(&xen_obj->base);
120 if (IS_ERR_OR_NULL(xen_obj->pages)) {
121 ret = PTR_ERR(xen_obj->pages);
122 xen_obj->pages = NULL;
123 goto fail;
124 }
125
126 return xen_obj;
127
128 fail:
129 DRM_ERROR("Failed to allocate buffer with size %zu\n", size);
130 return ERR_PTR(ret);
131 }
132
133 struct drm_gem_object *xen_drm_front_gem_create(struct drm_device *dev,
134 size_t size)
135 {
136 struct xen_gem_object *xen_obj;
137
138 xen_obj = gem_create(dev, size);
139 if (IS_ERR_OR_NULL(xen_obj))
140 return ERR_CAST(xen_obj);
141
142 return &xen_obj->base;
143 }
144
145 void xen_drm_front_gem_free_object_unlocked(struct drm_gem_object *gem_obj)
146 {
147 struct xen_gem_object *xen_obj = to_xen_gem_obj(gem_obj);
148
149 if (xen_obj->base.import_attach) {
150 drm_prime_gem_destroy(&xen_obj->base, xen_obj->sgt_imported);
151 gem_free_pages_array(xen_obj);
152 } else {
153 if (xen_obj->pages) {
154 if (xen_obj->be_alloc) {
> 155 xen_free_unpopulated_pages(xen_obj->num_pages,
156 xen_obj->pages);
157 gem_free_pages_array(xen_obj);
158 } else {
159 drm_gem_put_pages(&xen_obj->base,
160 xen_obj->pages, true, false);
161 }
162 }
163 }
164 drm_gem_object_release(gem_obj);
165 kfree(xen_obj);
166 }
167
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34602 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Roger Pau Monne <roger.pau@citrix.com>, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, Roger Pau Monne <roger.pau@citrix.com>,
Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Dan Carpenter <error27@gmail.com>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH v2 4/4] xen: add helpers to allocate unpopulated memory
Date: Fri, 24 Jul 2020 23:46:19 +0800 [thread overview]
Message-ID: <202007242335.TRijZOnV%lkp@intel.com> (raw)
In-Reply-To: <20200724124241.48208-5-roger.pau@citrix.com>
[-- Attachment #1: Type: text/plain, Size: 4742 bytes --]
Hi Roger,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on xen-tip/linux-next]
[also build test ERROR on linus/master v5.8-rc6 next-20200724]
[cannot apply to linux/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Roger-Pau-Monne/xen-balloon-fixes-for-memory-hotplug/20200724-204452
base: https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git linux-next
config: i386-debian-10.3 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/xen/xen_drm_front_gem.c: In function 'gem_create':
>> drivers/gpu/drm/xen/xen_drm_front_gem.c:102:9: error: implicit declaration of function 'xen_alloc_unpopulated_pages' [-Werror=implicit-function-declaration]
102 | ret = xen_alloc_unpopulated_pages(xen_obj->num_pages,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/xen/xen_drm_front_gem.c: In function 'xen_drm_front_gem_free_object_unlocked':
>> drivers/gpu/drm/xen/xen_drm_front_gem.c:155:5: error: implicit declaration of function 'xen_free_unpopulated_pages' [-Werror=implicit-function-declaration]
155 | xen_free_unpopulated_pages(xen_obj->num_pages,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/xen_alloc_unpopulated_pages +102 drivers/gpu/drm/xen/xen_drm_front_gem.c
77
78 static struct xen_gem_object *gem_create(struct drm_device *dev, size_t size)
79 {
80 struct xen_drm_front_drm_info *drm_info = dev->dev_private;
81 struct xen_gem_object *xen_obj;
82 int ret;
83
84 size = round_up(size, PAGE_SIZE);
85 xen_obj = gem_create_obj(dev, size);
86 if (IS_ERR_OR_NULL(xen_obj))
87 return xen_obj;
88
89 if (drm_info->front_info->cfg.be_alloc) {
90 /*
91 * backend will allocate space for this buffer, so
92 * only allocate array of pointers to pages
93 */
94 ret = gem_alloc_pages_array(xen_obj, size);
95 if (ret < 0)
96 goto fail;
97
98 /*
99 * allocate ballooned pages which will be used to map
100 * grant references provided by the backend
101 */
> 102 ret = xen_alloc_unpopulated_pages(xen_obj->num_pages,
103 xen_obj->pages);
104 if (ret < 0) {
105 DRM_ERROR("Cannot allocate %zu ballooned pages: %d\n",
106 xen_obj->num_pages, ret);
107 gem_free_pages_array(xen_obj);
108 goto fail;
109 }
110
111 xen_obj->be_alloc = true;
112 return xen_obj;
113 }
114 /*
115 * need to allocate backing pages now, so we can share those
116 * with the backend
117 */
118 xen_obj->num_pages = DIV_ROUND_UP(size, PAGE_SIZE);
119 xen_obj->pages = drm_gem_get_pages(&xen_obj->base);
120 if (IS_ERR_OR_NULL(xen_obj->pages)) {
121 ret = PTR_ERR(xen_obj->pages);
122 xen_obj->pages = NULL;
123 goto fail;
124 }
125
126 return xen_obj;
127
128 fail:
129 DRM_ERROR("Failed to allocate buffer with size %zu\n", size);
130 return ERR_PTR(ret);
131 }
132
133 struct drm_gem_object *xen_drm_front_gem_create(struct drm_device *dev,
134 size_t size)
135 {
136 struct xen_gem_object *xen_obj;
137
138 xen_obj = gem_create(dev, size);
139 if (IS_ERR_OR_NULL(xen_obj))
140 return ERR_CAST(xen_obj);
141
142 return &xen_obj->base;
143 }
144
145 void xen_drm_front_gem_free_object_unlocked(struct drm_gem_object *gem_obj)
146 {
147 struct xen_gem_object *xen_obj = to_xen_gem_obj(gem_obj);
148
149 if (xen_obj->base.import_attach) {
150 drm_prime_gem_destroy(&xen_obj->base, xen_obj->sgt_imported);
151 gem_free_pages_array(xen_obj);
152 } else {
153 if (xen_obj->pages) {
154 if (xen_obj->be_alloc) {
> 155 xen_free_unpopulated_pages(xen_obj->num_pages,
156 xen_obj->pages);
157 gem_free_pages_array(xen_obj);
158 } else {
159 drm_gem_put_pages(&xen_obj->base,
160 xen_obj->pages, true, false);
161 }
162 }
163 }
164 drm_gem_object_release(gem_obj);
165 kfree(xen_obj);
166 }
167
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34602 bytes --]
next prev parent reply other threads:[~2020-07-24 15:46 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-24 12:42 [PATCH v2 0/4] xen/balloon: fixes for memory hotplug Roger Pau Monne
2020-07-24 12:42 ` Roger Pau Monne
2020-07-24 12:42 ` [PATCH v2 1/4] xen/balloon: fix accounting in alloc_xenballooned_pages error path Roger Pau Monne
2020-07-24 12:42 ` Roger Pau Monne
2020-07-24 13:11 ` Jürgen Groß
2020-07-24 13:11 ` Jürgen Groß
2020-07-24 12:42 ` [PATCH v2 2/4] xen/balloon: make the balloon wait interruptible Roger Pau Monne
2020-07-24 12:42 ` Roger Pau Monne
2020-07-24 13:13 ` Jürgen Groß
2020-07-24 13:13 ` Jürgen Groß
2020-07-24 12:42 ` [PATCH v2 3/4] Revert "xen/balloon: Fix crash when ballooning on x86 32 bit PAE" Roger Pau Monne
2020-07-24 12:42 ` Roger Pau Monne
2020-07-24 13:20 ` Jürgen Groß
2020-07-24 13:20 ` Jürgen Groß
2020-07-24 12:42 ` [PATCH v2 4/4] xen: add helpers to allocate unpopulated memory Roger Pau Monne
2020-07-24 12:42 ` Roger Pau Monne
2020-07-24 12:42 ` Roger Pau Monne
2020-07-24 14:33 ` Jürgen Groß
2020-07-24 14:33 ` Jürgen Groß
2020-07-24 14:33 ` Jürgen Groß
2020-07-24 14:34 ` David Hildenbrand
2020-07-24 14:34 ` David Hildenbrand
2020-07-24 14:34 ` David Hildenbrand
2020-07-24 16:36 ` Boris Ostrovsky
2020-07-24 16:36 ` Boris Ostrovsky
2020-07-27 8:00 ` David Hildenbrand
2020-07-27 8:00 ` David Hildenbrand
2020-07-27 8:42 ` Roger Pau Monné
2020-07-27 8:42 ` Roger Pau Monné
2020-07-27 8:42 ` Roger Pau Monné
2020-07-24 15:46 ` kernel test robot [this message]
2020-07-24 15:46 ` kernel test robot
2020-07-25 2:48 ` kernel test robot
2020-07-25 2:48 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202007242335.TRijZOnV%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.