Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:Update
xen.33137
libxc-sr-add-xc_is_known_page_type.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libxc-sr-add-xc_is_known_page_type.patch of Package xen.33137
From: Olaf Hering <olaf@aepfle.de> Date: Wed, 28 Oct 2020 12:21:18 +0100 Subject: libxc sr add xc_is_known_page_type tools: add xc_is_known_page_type to libxenctrl Users of xc_get_pfn_type_batch may want to sanity check the data returned by Xen. Add a simple helper for this purpose. Signed-off-by: Olaf Hering <olaf@aepfle.de> --- tools/libxc/xc_private.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) --- xen-4.14.0-testing.orig/tools/libxc/xc_private.h +++ xen-4.14.0-testing/tools/libxc/xc_private.h @@ -385,6 +385,39 @@ void *xc_map_foreign_ranges(xc_interface int xc_get_pfn_type_batch(xc_interface *xch, uint32_t dom, unsigned int num, xen_pfn_t *); +/* Sanitiy check for types returned by Xen */ +static inline bool xc_is_known_page_type(xen_pfn_t type) +{ + bool ret; + + switch (type) + { + case XEN_DOMCTL_PFINFO_NOTAB: + + case XEN_DOMCTL_PFINFO_L1TAB: + case XEN_DOMCTL_PFINFO_L1TAB | XEN_DOMCTL_PFINFO_LPINTAB: + + case XEN_DOMCTL_PFINFO_L2TAB: + case XEN_DOMCTL_PFINFO_L2TAB | XEN_DOMCTL_PFINFO_LPINTAB: + + case XEN_DOMCTL_PFINFO_L3TAB: + case XEN_DOMCTL_PFINFO_L3TAB | XEN_DOMCTL_PFINFO_LPINTAB: + + case XEN_DOMCTL_PFINFO_L4TAB: + case XEN_DOMCTL_PFINFO_L4TAB | XEN_DOMCTL_PFINFO_LPINTAB: + + case XEN_DOMCTL_PFINFO_XTAB: + case XEN_DOMCTL_PFINFO_XALLOC: + case XEN_DOMCTL_PFINFO_BROKEN: + ret = true; + break; + default: + ret = false; + break; + } + return ret; +} + void bitmap_64_to_byte(uint8_t *bp, const uint64_t *lp, int nbits); void bitmap_byte_to_64(uint64_t *lp, const uint8_t *bp, int nbits);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor