From: Liam R. Howlett Date: Thu, 5 Jan 2017 20:58:41 +0000 (-0500) Subject: sparc64: Zero pages on allocation for mondo and error queues. X-Git-Tag: v4.1.12-92~1^2~22 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7f6a6dd4a07aeea3904ec4cfa6c0d2433d10262d;p=users%2Fjedix%2Flinux-maple.git sparc64: Zero pages on allocation for mondo and error queues. Error queues use a non-zero first word to detect if the queues are full. Using pages that have not been zeroed may result in false positive overflow events. These queues are set up once during boot so zeroing all mondo and error queue pages is safe. Note that this does not always occur because the page allocation for these queues is so early in the boot cycle that higher number CPUs get fresh pages. It is only when traps are serviced with lower number CPUs who were given already used pages that this issue is exposed. orabug: 23054018 Signed-off-by: Liam R. Howlett Signed-off-by: Allen Pais --- diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c index 787076a752c70..d8e5cc9c7f10f 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c @@ -1156,7 +1156,7 @@ static int alloc_one_queue(unsigned long *pa_ptr, unsigned long qmask) unsigned long order = get_order(size); unsigned long p; - p = __get_free_pages(GFP_KERNEL | __GFP_COMP, order); + p = __get_free_pages(GFP_KERNEL | __GFP_COMP | __GFP_ZERO, order); if (!p) { pr_err("SUN4V: Error, cannot allocate queue.\n"); return -ENOMEM;