powerpc/mm: Fixup tlbie vs mtpidr/mtlpidr ordering issue on POWER9
[linux-2.6-block.git] / arch / powerpc / include / asm / fadump-internal.h
index 8ecd23421b6ca80b28a5430e7af02e1cf06b1ec6..c814a2b55389325393d8edfbfed5411d6bc2e039 100644 (file)
@@ -9,24 +9,10 @@
 #ifndef _ASM_POWERPC_FADUMP_INTERNAL_H
 #define _ASM_POWERPC_FADUMP_INTERNAL_H
 
-/*
- * The RMA region will be saved for later dumping when kernel crashes.
- * RMA is Real Mode Area, the first block of logical memory address owned
- * by logical partition, containing the storage that may be accessed with
- * translate off.
- */
-#define RMA_START      0x0
-#define RMA_END                (ppc64_rma_size)
+/* Maximum number of memory regions kernel supports */
+#define FADUMP_MAX_MEM_REGS                    128
 
-/*
- * On some Power systems where RMO is 128MB, it still requires minimum of
- * 256MB for kernel to boot successfully. When kdump infrastructure is
- * configured to save vmcore over network, we run into OOM issue while
- * loading modules related to network setup. Hence we need additional 64M
- * of memory to avoid OOM issue.
- */
-#define MIN_BOOT_MEM   (((RMA_END < (0x1UL << 28)) ? (0x1UL << 28) : RMA_END) \
-                       + (0x1UL << 26))
+#ifndef CONFIG_PRESERVE_FA_DUMP
 
 /* The upper limit percentage for user specified boot memory size (25%) */
 #define MAX_BOOT_MEM_RATIO                     4
@@ -72,9 +58,18 @@ struct fadump_crash_info_header {
        struct cpumask  online_mask;
 };
 
-struct fad_crash_memory_ranges {
-       unsigned long long      base;
-       unsigned long long      size;
+struct fadump_memory_range {
+       u64     base;
+       u64     size;
+};
+
+/* fadump memory ranges info */
+struct fadump_mrange_info {
+       char                            name[16];
+       struct fadump_memory_range      *mem_ranges;
+       u32                             mem_ranges_sz;
+       u32                             mem_range_cnt;
+       u32                             max_mem_ranges;
 };
 
 /* Platform specific callback functions */
@@ -88,13 +83,30 @@ struct fw_dump {
        unsigned long   reserve_bootvar;
 
        unsigned long   cpu_state_data_size;
+       u64             cpu_state_dest_vaddr;
+       u32             cpu_state_data_version;
+       u32             cpu_state_entry_size;
+
        unsigned long   hpte_region_size;
+
        unsigned long   boot_memory_size;
+       u64             boot_mem_dest_addr;
+       u64             boot_mem_addr[FADUMP_MAX_MEM_REGS];
+       u64             boot_mem_sz[FADUMP_MAX_MEM_REGS];
+       u64             boot_mem_top;
+       u64             boot_mem_regs_cnt;
 
        unsigned long   fadumphdr_addr;
        unsigned long   cpu_notes_buf_vaddr;
        unsigned long   cpu_notes_buf_size;
 
+       /*
+        * Maximum size supported by firmware to copy from source to
+        * destination address per entry.
+        */
+       u64             max_copy_size;
+       u64             kernel_metadata;
+
        int             ibm_configure_kernel_dump;
 
        unsigned long   fadump_enabled:1;
@@ -108,9 +120,13 @@ struct fw_dump {
 
 struct fadump_ops {
        u64     (*fadump_init_mem_struct)(struct fw_dump *fadump_conf);
+       u64     (*fadump_get_metadata_size)(void);
+       int     (*fadump_setup_metadata)(struct fw_dump *fadump_conf);
+       u64     (*fadump_get_bootmem_min)(void);
        int     (*fadump_register)(struct fw_dump *fadump_conf);
        int     (*fadump_unregister)(struct fw_dump *fadump_conf);
        int     (*fadump_invalidate)(struct fw_dump *fadump_conf);
+       void    (*fadump_cleanup)(struct fw_dump *fadump_conf);
        int     (*fadump_process)(struct fw_dump *fadump_conf);
        void    (*fadump_region_show)(struct fw_dump *fadump_conf,
                                      struct seq_file *m);
@@ -126,6 +142,16 @@ void fadump_update_elfcore_header(char *bufp);
 bool is_fadump_boot_mem_contiguous(void);
 bool is_fadump_reserved_mem_contiguous(void);
 
+#else /* !CONFIG_PRESERVE_FA_DUMP */
+
+/* Firmware-assisted dump configuration details. */
+struct fw_dump {
+       u64     boot_mem_top;
+       u64     dump_active;
+};
+
+#endif /* CONFIG_PRESERVE_FA_DUMP */
+
 #ifdef CONFIG_PPC_PSERIES
 extern void rtas_fadump_dt_scan(struct fw_dump *fadump_conf, u64 node);
 #else
@@ -133,4 +159,11 @@ static inline void
 rtas_fadump_dt_scan(struct fw_dump *fadump_conf, u64 node) { }
 #endif
 
+#ifdef CONFIG_PPC_POWERNV
+extern void opal_fadump_dt_scan(struct fw_dump *fadump_conf, u64 node);
+#else
+static inline void
+opal_fadump_dt_scan(struct fw_dump *fadump_conf, u64 node) { }
+#endif
+
 #endif /* _ASM_POWERPC_FADUMP_INTERNAL_H */