#include #include #include #include #include "slab.h" #include void kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node) { struct page *shadow; int pages; int i; pages = 1 << order; /* * With kmemcheck enabled, we need to allocate a memory area for the * shadow bits as well. */ shadow = alloc_pages_node(node, flags | __GFP_NOTRACK, order); if (!shadow) { if (printk_ratelimit()) pr_err("kmemcheck: failed to allocate shadow bitmap\n"); return; } for(i = 0; i < pages; ++i) page[i].shadow = page_address(&shadow[i]); /* * Mark it as non-present for the MMU so that our accesses to * this memory will trigger a page fault and let us analyze * the memory accesses. */ kmemcheck_hide_pages(page, pages); } void kmemcheck_free_shadow(struct page *page, int order) { struct page *shadow; int pages; int i; if (!kmemcheck_page_is_tracked(page)) return; pages = 1 << order; kmemcheck_show_pages(page, pages); shadow = virt_to_page(page[0].shadow); for(i = 0; i < pages; ++i) page[i].shadow = NULL; __free_pages(shadow, order); } void kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object, size_t size) { if (unlikely(!object)) /* Skip object if allocation failed */ return; /* * Has already been memset(), which initializes the shadow for us * as well. */ if (gfpflags & __GFP_ZERO) return; /* No need to initialize the shadow of a non-tracked slab. */ if (s->flags & SLAB_NOTRACK) return; if (!kmemcheck_enabled || gfpflags & __GFP_NOTRACK) { /* * Allow notracked objects to be allocated from * tracked caches. Note however that these objects * will still get page faults on access, they just * won't ever be flagged as uninitialized. If page * faults are not acceptable, the slab cache itself * should be marked NOTRACK. */ kmemcheck_mark_initialized(object, size); } else if (!s->ctor) { /* * New objects should be marked uninitialized before * they're returned to the called. */ kmemcheck_mark_uninitialized(object, size); } } void kmemcheck_slab_free(struct kmem_cache *s, void *object, size_t size) { /* TODO: RCU freeing is unsupported for now; hide false positives. */ if (!s->ctor && !(s->flags & SLAB_DESTROY_BY_RCU)) kmemcheck_mark_freed(object, size); } void kmemcheck_pagealloc_alloc(struct page *page, unsigned int order, gfp_t gfpflags) { int pages; if (gfpflags & (__GFP_HIGHMEM | __GFP_NOTRACK)) return; pages = 1 << order; /* * NOTE: We choose to track GFP_ZERO pages too; in fact, they * can become uninitialized by copying uninitialized memory * into them. */ /* XXX: Can use zone->node for node? */ kmemcheck_alloc_shadow(page, order, gfpflags, -1); if (gfpflags & __GFP_ZERO) kmemcheck_mark_initialized_pages(page, pages); else kmemcheck_mark_uninitialized_pages(page, pages); } b6c8ae630b0'>sunrpc/auth_gss/gss_krb5_seal.c
tion value='3' selected='selected'>3
AgeCommit message (Expand)AuthorFilesLines
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2017-01-17 16:00:48 +0000
committerThomas Gleixner <tglx@linutronix.de>2017-01-30 15:18:56 +0100
commit08d85f3ea99f1eeafc4e8507936190e86a16ee8c (patch)
tree410bb1acd0cd7dcfaad37ae7b63ff243b7fa4bee /include/uapi/drm/r128_drm.h
parent566cf877a1fcb6d6dc0126b076aad062054c2637 (diff)
irqdomain: Avoid activating interrupts more than once
Since commit f3b0946d629c ("genirq/msi: Make sure PCI MSIs are activated early"), we can end-up activating a PCI/MSI twice (once at allocation time, and once at startup time). This is normally of no consequences, except that there is some HW out there that may misbehave if activate is used more than once (the GICv3 ITS, for example, uses the activate callback to issue the MAPVI command, and the architecture spec says that "If there is an existing mapping for the EventID-DeviceID combination, behavior is UNPREDICTABLE"). While this could be worked around in each individual driver, it may make more sense to tackle the issue at the core level. In order to avoid getting in that situation, let's have a per-interrupt flag to remember if we have already activated that interrupt or not. Fixes: f3b0946d629c ("genirq/msi: Make sure PCI MSIs are activated early") Reported-and-tested-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/1484668848-24361-1-git-send-email-marc.zyngier@arm.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/uapi/drm/r128_drm.h')