MDST: Rename function name and variable order

 - Better function naming
 - Better macro naming
 - Re-ordered function variables
 - calculate max_mdst_entry after allocating memory
   for mdst table.

No change in functionality.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
MDST: Validate TCE alignment

We assumed that we always get TCE aligned address and size. But
its possible that we may non-aligned address (specially when we
add OPAL interface. This patch adds TCE validation.

Also defer TCE mapping until we make MBOX command. This is required
when we add OPAL interface. Ended up introducing new variable to
hold real address and size.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
MDST: Check for duplicate dump region entry

Presently we assume that we don't try to add new entry with
same ID again. But when we add OPAL interface we may get new entry
with same ID again (like when host does kexec). This patch checks
and removes old entry before adding new entry with same ID.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
MDST: Add OPAL interface to register host memory region

Add OPAL interface to add host memory region to SYSDUMP.

[ Added exported IDs in opal.h --BenH ]

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
MDST: Add OPAL interface to unregister dump region

Add OPAL interface to remove host memory region from SYSDUMP.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
MDST: Improve error logging

Add informational event in add dump region path. Also change the
severity of the existing elog event.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>