1
0
Fork 0
alistair23-linux/arch/x86/xen
Mike Rapoport 8a7f97b902 treewide: add checks for the return value of memblock_alloc*()
Add check for the return value of memblock_alloc*() functions and call
panic() in case of error.  The panic message repeats the one used by
panicing memblock allocators with adjustment of parameters to include
only relevant ones.

The replacement was mostly automated with semantic patches like the one
below with manual massaging of format strings.

  @@
  expression ptr, size, align;
  @@
  ptr = memblock_alloc(size, align);
  + if (!ptr)
  + 	panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, size, align);

[anders.roxell@linaro.org: use '%pa' with 'phys_addr_t' type]
  Link: http://lkml.kernel.org/r/20190131161046.21886-1-anders.roxell@linaro.org
[rppt@linux.ibm.com: fix format strings for panics after memblock_alloc]
  Link: http://lkml.kernel.org/r/1548950940-15145-1-git-send-email-rppt@linux.ibm.com
[rppt@linux.ibm.com: don't panic if the allocation in sparse_buffer_init fails]
  Link: http://lkml.kernel.org/r/20190131074018.GD28876@rapoport-lnx
[akpm@linux-foundation.org: fix xtensa printk warning]
Link: http://lkml.kernel.org/r/1548057848-15136-20-git-send-email-rppt@linux.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Reviewed-by: Guo Ren <ren_guo@c-sky.com>		[c-sky]
Acked-by: Paul Burton <paul.burton@mips.com>		[MIPS]
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>	[s390]
Reviewed-by: Juergen Gross <jgross@suse.com>		[Xen]
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>	[m68k]
Acked-by: Max Filippov <jcmvbkbc@gmail.com>		[xtensa]
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Christoph Hellwig <hch@lst.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Guo Ren <guoren@kernel.org>
Cc: Mark Salter <msalter@redhat.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Rich Felker <dalias@libc.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-03-12 10:04:02 -07:00
..
Kconfig xen/pvh: Split CONFIG_XEN_PVH into CONFIG_PVH and CONFIG_XEN_PVH 2018-12-13 13:41:49 -05:00
Makefile xen/pvh: Create a new file for Xen specific PVH code 2018-12-13 13:41:49 -05:00
apic.c Merge branch 'WIP.x86/asm' into x86/urgent, because the topic is ready 2018-04-12 09:42:34 +02:00
debugfs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
debugfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
efi.c x86/xen: Add SPDX identifier in arch/x86/xen files 2018-09-03 16:50:33 +02:00
enlighten.c xen: fixes for 4.20-rc5 2018-12-02 12:15:55 -08:00
enlighten_hvm.c x86/xen: Add SPDX identifier in arch/x86/xen files 2018-09-03 16:50:33 +02:00
enlighten_pv.c always clear the X2APIC_ENABLE bit for PV guest 2019-01-14 09:00:32 -05:00
enlighten_pvh.c xen/pvh: Move Xen code for getting mem map via hcall out of common file 2018-12-13 13:41:49 -05:00
grant-table.c x86/xen: Add SPDX identifier in arch/x86/xen files 2018-09-03 16:50:33 +02:00
irq.c x86/paravirt: Use a single ops structure 2018-09-03 16:50:35 +02:00
mmu.c x86/xen: Add SPDX identifier in arch/x86/xen files 2018-09-03 16:50:33 +02:00
mmu.h mm: update ptep_modify_prot_start/commit to take vm_area_struct as arg 2019-03-05 21:07:18 -08:00
mmu_hvm.c x86/paravirt: Use a single ops structure 2018-09-03 16:50:35 +02:00
mmu_pv.c mm: update ptep_modify_prot_start/commit to take vm_area_struct as arg 2019-03-05 21:07:18 -08:00
multicalls.c xen/x86: add diagnostic printout to xen_mc_flush() in case of error 2018-11-29 17:53:16 +01:00
multicalls.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
p2m.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
pci-swiotlb-xen.c x86/xen: Add SPDX identifier in arch/x86/xen files 2018-09-03 16:50:33 +02:00
platform-pci-unplug.c xen/pvh: don't try to unplug emulated devices 2018-10-26 09:16:57 +02:00
pmu.c Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-10-23 16:16:40 +01:00
pmu.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
setup.c x86: Fix various typos in comments 2018-12-03 10:49:13 +01:00
smp.c x86/xen: Calculate __max_logical_packages on PV domains 2018-02-17 09:40:45 +01:00
smp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
smp_hvm.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
smp_pv.c x86/stackprotector: Remove the call to boot_init_stack_canary() from cpu_startup_entry() 2018-10-22 04:07:24 +02:00
spinlock.c x86/xen: cleanup includes in arch/x86/xen/spinlock.c 2018-11-22 16:47:50 +01:00
suspend.c x86/xen: Zero MSR_IA32_SPEC_CTRL before suspend 2018-02-28 16:03:19 +01:00
suspend_hvm.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
suspend_pv.c x86/xen/time: Initialize pv xen time in init_hypervisor_platform() 2018-07-20 00:02:39 +02:00
time.c xen: Fix x86 sched_clock() interface for xen 2019-01-16 13:06:05 -05:00
trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vdso.h x86/xen: Add SPDX identifier in arch/x86/xen files 2018-09-03 16:50:33 +02:00
vga.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xen-asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xen-asm_32.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xen-asm_64.S kprobes/x86/xen: blacklist non-attachable xen interrupt functions 2018-12-17 10:27:59 -05:00
xen-head.S xen/pvh: Indicate XENFEAT_linux_rsdp_unrestricted to Xen 2018-04-10 09:22:22 -04:00
xen-ops.h x86/xen: remove unused function xen_auto_xlated_memory_setup() 2018-08-20 14:46:18 -04:00