summaryrefslogtreecommitdiff
path: root/drivers/xen
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-03-10 17:17:41 -0700
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-03-30 09:27:07 -0700
commita649b720614d5675dc402bef75a92576143fede7 (patch)
tree149d7daf4b6fc8ce4433b9a76bd0ef6ad09a4ba2 /drivers/xen
parentcff7e81b3dd7c25cd2248cd7a04c5764552d5d55 (diff)
downloadlinux-3.10-a649b720614d5675dc402bef75a92576143fede7.tar.gz
linux-3.10-a649b720614d5675dc402bef75a92576143fede7.tar.bz2
linux-3.10-a649b720614d5675dc402bef75a92576143fede7.zip
xen/sys/hypervisor: change writable_pt to features
/sys/hypervisor/properties/writable_pt was misnamed. Rename to features, expressed as a bit array in hex. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/sys-hypervisor.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
index cb29d1ccf0d..1267d6fcc0c 100644
--- a/drivers/xen/sys-hypervisor.c
+++ b/drivers/xen/sys-hypervisor.c
@@ -293,37 +293,48 @@ static ssize_t pagesize_show(struct hyp_sysfs_attr *attr, char *buffer)
HYPERVISOR_ATTR_RO(pagesize);
-/* eventually there will be several more features to export */
static ssize_t xen_feature_show(int index, char *buffer)
{
- int ret = -ENOMEM;
- struct xen_feature_info *info;
+ ssize_t ret;
+ struct xen_feature_info info;
- info = kmalloc(sizeof(struct xen_feature_info), GFP_KERNEL);
- if (info) {
- info->submap_idx = index;
- ret = HYPERVISOR_xen_version(XENVER_get_features, info);
- if (!ret)
- ret = sprintf(buffer, "%d\n", info->submap);
- kfree(info);
- }
+ info.submap_idx = index;
+ ret = HYPERVISOR_xen_version(XENVER_get_features, &info);
+ if (!ret)
+ ret = sprintf(buffer, "%08x", info.submap);
return ret;
}
-static ssize_t writable_pt_show(struct hyp_sysfs_attr *attr, char *buffer)
+static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer)
{
- return xen_feature_show(XENFEAT_writable_page_tables, buffer);
+ ssize_t len;
+ int i;
+
+ len = 0;
+ for (i = XENFEAT_NR_SUBMAPS-1; i >= 0; i--) {
+ int ret = xen_feature_show(i, buffer + len);
+ if (ret < 0) {
+ if (len == 0)
+ len = ret;
+ break;
+ }
+ len += ret;
+ }
+ if (len > 0)
+ buffer[len++] = '\n';
+
+ return len;
}
-HYPERVISOR_ATTR_RO(writable_pt);
+HYPERVISOR_ATTR_RO(features);
static struct attribute *xen_properties_attrs[] = {
&capabilities_attr.attr,
&changeset_attr.attr,
&virtual_start_attr.attr,
&pagesize_attr.attr,
- &writable_pt_attr.attr,
+ &features_attr.attr,
NULL
};