From 9846ff10af12f9e7caac696737db6c990592a74a Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Mon, 30 Jan 2012 16:21:48 +0000 Subject: xen: support pirq_eoi_map The pirq_eoi_map is a bitmap offered by Xen to check which pirqs need to be EOI'd without having to issue an hypercall every time. We use PHYSDEVOP_pirq_eoi_gmfn_v2 to map the bitmap, then if we succeed we use pirq_eoi_map to check whether pirqs need eoi. Changes in v3: - explicitly use PHYSDEVOP_pirq_eoi_gmfn_v2 rather than PHYSDEVOP_pirq_eoi_gmfn; - introduce pirq_check_eoi_map, a function to check if a pirq needs an eoi using the map; -rename pirq_needs_eoi into pirq_needs_eoi_flag; - introduce a function pointer called pirq_needs_eoi that is going to be set to the right implementation depending on the availability of PHYSDEVOP_pirq_eoi_gmfn_v2. Signed-off-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk --- include/xen/interface/physdev.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/xen') diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h index 0c28989007fb..9ce788d8cf49 100644 --- a/include/xen/interface/physdev.h +++ b/include/xen/interface/physdev.h @@ -38,6 +38,27 @@ struct physdev_eoi { uint32_t irq; }; +/* + * Register a shared page for the hypervisor to indicate whether the guest + * must issue PHYSDEVOP_eoi. The semantics of PHYSDEVOP_eoi change slightly + * once the guest used this function in that the associated event channel + * will automatically get unmasked. The page registered is used as a bit + * array indexed by Xen's PIRQ value. + */ +#define PHYSDEVOP_pirq_eoi_gmfn_v1 17 +/* + * Register a shared page for the hypervisor to indicate whether the + * guest must issue PHYSDEVOP_eoi. This hypercall is very similar to + * PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't change the semantics of + * PHYSDEVOP_eoi. The page registered is used as a bit array indexed by + * Xen's PIRQ value. + */ +#define PHYSDEVOP_pirq_eoi_gmfn_v2 28 +struct physdev_pirq_eoi_gmfn { + /* IN */ + unsigned long gmfn; +}; + /* * Query the status of an IRQ line. * @arg == pointer to physdev_irq_status_query structure. -- cgit v1.2.3 From 8e6f7c23c135b13f3adf90906fac7edd325bb9af Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 3 Feb 2012 15:09:04 +0000 Subject: xen/tmem: cleanup Use 'bool' for boolean variables. Do proper section placement. Eliminate an unnecessary export. Signed-off-by: Jan Beulich Acked-by: Dan Magenheimer Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/tmem.c | 21 ++++++++------------- include/xen/tmem.h | 6 +++++- 2 files changed, 13 insertions(+), 14 deletions(-) (limited to 'include/xen') diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c index d369965e8f8a..6a8f76dd5a22 100644 --- a/drivers/xen/tmem.c +++ b/drivers/xen/tmem.c @@ -9,7 +9,6 @@ #include #include #include -#include #include /* temporary ifdef until include/linux/frontswap.h is upstream */ @@ -128,15 +127,13 @@ static int xen_tmem_flush_object(u32 pool_id, struct tmem_oid oid) return xen_tmem_op(TMEM_FLUSH_OBJECT, pool_id, oid, 0, 0, 0, 0, 0); } -int tmem_enabled __read_mostly; -EXPORT_SYMBOL(tmem_enabled); +bool __read_mostly tmem_enabled = false; static int __init enable_tmem(char *s) { - tmem_enabled = 1; + tmem_enabled = true; return 1; } - __setup("tmem", enable_tmem); #ifdef CONFIG_CLEANCACHE @@ -229,17 +226,16 @@ static int tmem_cleancache_init_shared_fs(char *uuid, size_t pagesize) return xen_tmem_new_pool(shared_uuid, TMEM_POOL_SHARED, pagesize); } -static int use_cleancache = 1; +static bool __initdata use_cleancache = true; static int __init no_cleancache(char *s) { - use_cleancache = 0; + use_cleancache = false; return 1; } - __setup("nocleancache", no_cleancache); -static struct cleancache_ops tmem_cleancache_ops = { +static struct cleancache_ops __initdata tmem_cleancache_ops = { .put_page = tmem_cleancache_put_page, .get_page = tmem_cleancache_get_page, .flush_page = tmem_cleancache_flush_page, @@ -356,17 +352,16 @@ static void tmem_frontswap_init(unsigned ignored) xen_tmem_new_pool(private, TMEM_POOL_PERSIST, PAGE_SIZE); } -static int __initdata use_frontswap = 1; +static bool __initdata use_frontswap = true; static int __init no_frontswap(char *s) { - use_frontswap = 0; + use_frontswap = false; return 1; } - __setup("nofrontswap", no_frontswap); -static struct frontswap_ops tmem_frontswap_ops = { +static struct frontswap_ops __initdata tmem_frontswap_ops = { .put_page = tmem_frontswap_put_page, .get_page = tmem_frontswap_get_page, .flush_page = tmem_frontswap_flush_page, diff --git a/include/xen/tmem.h b/include/xen/tmem.h index 82e2c83a32f5..591550a22ac7 100644 --- a/include/xen/tmem.h +++ b/include/xen/tmem.h @@ -1,5 +1,9 @@ #ifndef _XEN_TMEM_H #define _XEN_TMEM_H + +#include + /* defined in drivers/xen/tmem.c */ -extern int tmem_enabled; +extern bool tmem_enabled; + #endif /* _XEN_TMEM_H */ -- cgit v1.2.3