summaryrefslogtreecommitdiffstats
path: root/core/test
Commit message (Collapse)AuthorAgeFilesLines
* cpufeatures: Add tm-suspend-hypervisor-assist and tm-suspend-xer-so-bug nodeStewart Smith2019-04-092-0/+156
| | | | | | | | | | | | | | | | | tm-suspend-hypervisor-assist for P9 >=DD2.2 And a tm-suspend-xer-so-bug node for P9 DD2.2 only. I also treat P9P as P9 DD2.3 and add a unit test for the cpufeatures infrastructure. Fixes: https://github.com/open-power/skiboot/issues/233 Suggested-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com> Tested-by: Michael Neuling <mikey@neuling.org> Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Tested-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> [stewart: drop USABLE_OS for tm-suspend-hypervisor-assist] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* firmware-versions: Add test case for parsing VERSIONStewart Smith2019-02-1315-0/+190
| | | | | | | | | | | | | | | | Also make it possible to use with afl-lop/afl-fuzz just to help make *sure* we're all good. Additionally, if we hit a entry in VERSION that is larger than our buffer size, we skip over it gracefully rather than overwriting the stack. This is only a problem if VERSION isn't trusted, which as of 4b8cc05a94513816d43fb8bd6178896b430af08f it is verified as part of Secure Boot. CC: stable # v5.9+ Fixes: 9727fe384b8685270d344201f7e051475eea3a0b [stewart: fix up include ordering for building on centos7] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* core/device: Test dt_new_check()Stewart Smith2018-10-161-2/+4
| | | | Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* core/device: increase test coverage for dt_new_addr and dt_new_2addrStewart Smith2018-10-161-0/+2
| | | | Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* core/device: add test for dt_new() a duplicate nodeStewart Smith2018-10-161-0/+1
| | | | Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* core/device: Add test for duplicate nodes with dt_attach_root()Stewart Smith2018-10-161-1/+8
| | | | Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* platform: Restructure bmc_platform typeAndrew Jeffery2018-10-111-0/+8
| | | | | | | | | | Segregate the BMC platform configuration into hardware and software components. This allows population of platform default values for hardware configuration that may no-longer be accessible by the host. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> [stewart: fixup pci-quirk unit test] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* core/mem_region: mambo reserve kernel payload areasNicholas Piggin2018-09-209-0/+15
| | | | | | | | | | Mambo image payloads get overwritten by the OS and by fast reboot memory clearing because they have no region defined. Add them, which allows fast reboot to work. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [stewart: fix up 'make check'] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* Fixup unit tests for cpu_queue_job() in mem_region.cStewart Smith2018-07-183-3/+12
| | | | | Fixes: 06808a037d44231ba36e814ff1dbf66bc8b707da Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* cpu: add cpu_queue_job_on_node()Nicholas Piggin2018-07-1511-54/+102
| | | | | | | | | | Add a job scheduling API which will run the job on the requested chip_id (or return failure). Includes test harness fixes from Stewart. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* core: Add test for PCI quirksAndrew Jeffery2018-06-182-1/+68
| | | | | | | | | | Ensure that quirks are run (or not) for given PCI vendor and device IDs. This tests the quirk infrastructure and the PCI_VENDOR_ID() and PCI_DEVICE_ID() macros, the latter of which was recently found to be broken. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* core/test/run_mem_region: fix GCC8 compile errorStewart Smith2018-05-293-3/+3
| | | | | | | | error: ‘const’ attribute on function returning ‘void’ [-Werror=attributes] Fix by not putting the const attribute in the stub Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* SBE: Add timer supportVasant Hegde2018-04-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SBE on P9 provides one shot programmable timer facility. We can use this to implement OPAL timers and hence limit the reliance on the Linux heartbeat (similar to HW timer facility provided by SLW on P8). Design: - We will continue to run Linux heartbeat. - Each chip has SBE. This patch always schedules timer on SBE on master chip. - Start timer option starts new timer or modifies an active timer for the specified timeout. - SBE expects timeout value in microseconds. We track timeout value in TB. Hence we convert tb to microseconds before sending request to SBE. - We are requesting ack from SBE for timer message. It gaurantees that SBE has scheduled timer. - Disabling SBE timer We expect SBE to send timer expiry interrupt whenever timer expires. We wait for 10 more ms before disabling timer. In future we can consider below alternative approaches: - Presently SBE timer disable is permanent (until we reboot system). SBE sends "I'm back" interrupt after reset. We can consider restarting timer after SBE reset. - Reset SBE and start timer again. - Each chip has SBE. On multi chip system we can try to schedule timer on different chip. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* Move P8 timer code to separate fileVasant Hegde2018-04-301-1/+1
| | | | | | | | | | | | | Lets move P8 timer support code from slw.c to sbe-p8.c (as suggested by BenH). There is a difference between timer support in P8 and P9. Hence I think it makes sense to name it as sbe-p8.c. Note that this is pure code movement and renaming functions/variables. No functionality changes. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* core: Fix mismatched names between reserved memory nodes & propertiesJeremy Kerr2018-02-211-1/+4
| | | | | | | | | | | | | | | | | | | OPAL exposes reserved memory regions through the device tree in both new (nodes) and old (properties) formats. However, the names used for these don't match - we use a generated cell address for the nodes, but the plain region name for the properties. This change, heavily based on code from Oliver O'Halloran <oohall@gmail.com>, reworks the dt-generation code to firstly generate the new-format nodes, then uses those same names to generate the property data. Reported-by: Deb McLemore <debmc@linux.vnet.ibm.com> CC: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> [stewart: fix test case] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/device.c: Fix dt_find_compatible_nodeAlistair Popple2018-02-131-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | dt_find_compatible_node() and dt_find_compatible_node_on_chip() are used to find device nodes under a parent/root node with a given compatible property. dt_next(root, prev) is used to walk the child nodes of the given parent and takes two arguments - root contains the parent node to walk whilst prev contains the previous child to search from so that it can be used as an iterator over all children nodes. The first iteration of dt_find_compatible_node(root, prev) calls dt_next(root, root) which is not a well defined operation as prev is assumed to be child of the root node. The result is that when a node contains no children it will start returning the parent nodes siblings until it hits the top of the tree at which point a NULL derefence is attempted when looking for the root nodes parent. Dereferencing NULL can result in undesirable data exceptions during system boot and untimely non-hilarious system crashes. dt_next() should not be called with prev == root. Instead we add a check to dt_next() such that passing prev = NULL will cause it to start iterating from the first child node (if any). Also add a unit test for this case to run-device.c. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* lock: Add additional lock auditing codeBenjamin Herrenschmidt2017-12-2012-12/+27
| | | | | | | | | | | | | | | | | Keep track of lock owner name and replace lock_depth counter with a per-cpu list of locks held by the cpu. This allows us to print the actual locks held in case we hit the (in)famous message about opal_pollers being run with a lock held. It also allows us to warn (and drop them) if locks are still held when returning to the OS or completing a scheduled job. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> [stewart: fix unit tests] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* make check: Make valgrind optionalMichael Ellerman2017-12-181-1/+1
| | | | | | | | | | To (slightly) lower the barrier for contributions, we can make valgrind optional with just a small amount of plumbing. This allows make check to run successfully without valgrind. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* nvram: Fix 'missing' nvram on FSP systems.Cyril Bur2017-11-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | commit ba4d46fdd9eb ("console: Set log level from nvram") wants to read from NVRAM rather early. This works fine on BMC based systems as nvram_init() is actually synchronous. This is not true for FSP systems and it turns out that the query for the console log level simply queries blank nvram. The simple fix is to wait for the NVRAM read to complete before performing any query. Unfortunately it turns out that the fsp-nvram code does not inform the generic NVRAM layer when the read is complete, rather, it must be prompted to do so. This patch addresses both these problems. This patch adds a check before the first read of the NVRAM (for the console log level) that the read has completed. The fsp-nvram code has been updated to inform the generic layer as soon as the read completes. The old prompt to the fsp-nvram code has been removed but a check to ensure that the NVRAM has been loaded remains. It is conservative but if the NVRAM is not done loading before the host is booted it will not have an nvram device-tree node which means it won't be able to access the NVRAM at all, ever, even after the NVRAM has loaded. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/bitmap: Test bitmap foreach functionsStewart Smith2017-11-281-0/+11
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/test/run-msg: don't depend on unittest mem layoutStewart Smith2017-08-241-1/+1
| | | | | | In the world of unit tests all "RAM" is valid Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/test/run-device: fix memory leak on exitStewart Smith2017-08-241-0/+1
| | | | | | Shuts LeakSanitizer up Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* test/mem_region: fix incorrect ibm,os-reserve region lengthStewart Smith2017-08-242-4/+4
| | | | | | | | | | | We were reserving all of memory up to the heap, which is fine *unless* the system libc chooses to allocate something in that block of memory that we use, which means we have overlapping regions and general pain. This should fix failing unit tests on some systems (e.g. Debian) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix mem leak in core/test/run-time-utilsStewart Smith2017-08-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fixes the following LeakSanitizer errors: ================================================================= ==32426==ERROR: LeakSanitizer: detected memory leaks Direct leak of 56 byte(s) in 1 object(s) allocated from: #0 0x7fd94a1fa850 in malloc (/lib64/libasan.so.4+0xde850) #1 0x4014d4 in main core/test/run-time-utils.c:30 #2 0x7fd94904c509 in __libc_start_main (/lib64/libc.so.6+0x20509) Direct leak of 8 byte(s) in 1 object(s) allocated from: #0 0x7fd94a1fa850 in malloc (/lib64/libasan.so.4+0xde850) #1 0x4014f0 in main core/test/run-time-utils.c:32 #2 0x7fd94904c509 in __libc_start_main (/lib64/libc.so.6+0x20509) Direct leak of 4 byte(s) in 1 object(s) allocated from: #0 0x7fd94a1fa850 in malloc (/lib64/libasan.so.4+0xde850) #1 0x4014e2 in main core/test/run-time-utils.c:31 #2 0x7fd94904c509 in __libc_start_main (/lib64/libc.so.6+0x20509) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* attrconst for testsStewart Smith2017-07-193-3/+3
| | | | | | Fixes build warnings when running with higher optimization than -O0 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* dt: Add phandle fixup helpersMadhavan Srinivasan2017-06-271-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | When there is a new device tree that needs to be added to the main dt of the opal (ex, IMC catalog dtb loaded from pnor partition), we need to check for the phandle values in the new incoming device tree before attaching it. Reason is that, incoming device tree could already have phandle values initialized for its nodes. Now, if we attach this new device tree to the main opal DT, we could potentially hit phandle duplicate error (since the phandles value usually start with 1). To avoid this, a new helper function dt_adjust_subtree_phandle() is added to scan the incoming device tree and update node "phandle" accordingly based on the opal "last_phandle" value. Add to this, helper function also supports updates of "properties" with in a node which may refer the "phandle" value in the incoming device tree. Helper function will also fix the "properties" field accordingly. Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Convert important polling loops to spin at lowest SMT priorityNicholas Piggin2017-06-061-0/+2
| | | | | | | | | | | The pattern of calling cpu_relax() inside a polling loop does not suit the powerpc SMT priority instructions. Prefrred is to set a low priority then spin until break condition is reached, then restore priority. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [stewart@linux.vnet.ibm.com: fixup lpc-uart wait_tx_room() and unit test] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mem_region: rename HW_RESERVE to FW_RESERVEOliver O'Halloran2017-05-262-3/+3
| | | | | | | | | | | Currently all existing reservations are made by hostboot itself or on behalf of some other part of system firmware (e.g. the OCCs). We want to add a "true" hardware reservation type that should not be touched by the host OS. To prepare for that this patch renames the existing reservation type to refect it's actual usage. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/test: Test pre-init memory reservationsOliver O'Halloran2017-05-161-6/+9
| | | | | Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* device: add dt_find_by_name_addrOliver O'Halloran2017-04-071-0/+1
| | | | | | | | | | | | Adds two helper functions that allow device nodes to be found via their name and unit address. One will take an integer address and format it to a hex string while the other looks up the unit based a user supplied string. This is handy in a few places inside the HDAT parser. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/test: use strcmp for console testsOliver O'Halloran2017-03-072-6/+6
| | | | | | | | | The console logging tests use a memcmp and strlen() with string literal arguments. Unfortunately the strings were updated at some point and not kept in sync. strcmp() should be fine here so use that instead. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/test/run-trace: Reduce number of samples when running under valgrindStewart Smith2017-03-071-1/+3
| | | | | | | This reduces 'make check' run time by ~10 seconds on my laptop, and just the run-trace test itself takes 15 seconds less (under valgrind). Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* device: implement dt_translate_address() properlyOliver O'Halloran2017-03-071-1/+46
| | | | | | | | | | | | | | | | Currently this is implemented by calling dt_get_address() which only works when a device is a child of the root node. This patch implements the functionality to work with nested nodes when all parent nodes have an appropriate "ranges" property. This implementation only works for up to 64 bit addresses. Properly supporting larger addressing schemes is a fair amount of (probably pointless) work, so I'm leaving supporting that until we have an actual a need for it. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Tested-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* nvram-format: Fix endian issuesStewart Smith2017-02-231-3/+3
| | | | | | | | | | NVRAM formats are always BE, so let's use the sparse annotation to catch any issues (and correct said issues). On LE platforms, the test was erroneously passing as with building the nvram-format code on LE we were produces an incorrect NVRAM image. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/test/run-buddy: add one more test to get to 100% lines coveredStewart Smith2017-01-051-1/+2
| | | | | | We're now only missing some assert() branches in buddy testing. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* buddy: Add a simple generic buddy allocatorBenjamin Herrenschmidt2017-01-052-1/+84
| | | | | | | | | | | It operates on bits representing whatever objects the caller wants it to represent, it's not per-se a memory allocator (it's meant to be used among others by XIVE for VP allocations). As such it cannot keep linked lists of free objects, so don't expect stellar perfs. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: add (C) header, fix gcc4.8 build error] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add bitmap testStewart Smith2017-01-042-1/+82
| | | | | | The worst test suite ever Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/flash-subpartition: compute partition size from subpartition structStewart Smith2016-10-251-1/+5
| | | | | | | | | | | | | From the subpartition structure, we have the ability to compute the full partition size. Do that. This lets us only read the amount of a subpartition that is valid and needed to be read, rather than having to read the entire thing. We continue the current behaviour of loading flash partitions though. Based-on-patch-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/flash: Move subpartition locating logic out into own file, add testsStewart Smith2016-10-252-0/+56
| | | | | | | | | | A unit test for parsing sub-partition info is useful for a number of reasons, one of which showed its head during development of secure/trusted boot. This patch just moves things around, there's no functional changes. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* console-log: print full remaining timebase in skiboot logStewart Smith2016-10-173-9/+9
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* nvram: force re-verification after writingOliver O'Halloran2016-10-141-0/+5
| | | | | | | | | | The running OS is free to re-write the contents of NVRAM. The skiboot NVRAM parser relies on the NVRAM contents being valid so we need to force the NVRAM contents to be revalidated after the host OS has written to it. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/pel: Validate 'system-id' DT property before usingVasant Hegde2016-10-111-5/+19
| | | | | | | | | Platforms like mambo doesn't populate 'system-id' DT property. Validate these properties before using. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com, memset(0) for not found dt props, fix unit test] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* consolidate gcov flags into HOSTGCOVFLAGS for host binariesStewart Smith2016-09-021-2/+2
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/test: add tests for nvram_query()Oliver O'Halloran2016-08-301-0/+46
| | | | | | | | Adds some basic functionality tests for nvram_query() to the core test suite. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/test: add test for nul check in nvram_format()Oliver O'Halloran2016-08-301-0/+6
| | | | | | | | Adds a test for nvram_check() that the ibm,skiboot nvram partition is correctly terminated. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Make console-log time more readable: seconds rather than timebaseBalbir Singh2016-08-243-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've tried to align it with what the kernel prints today The existing logs show: [20287269125,5] PSI[0x000]: Found PSI bridge [working=1, active=0] [890425679,5] BT: Interface initialized, IO 0x00e4 [1249199642,4] SLW: HB-provided idle states property found [1249344409,5] NVRAM: Size is 576 KB [1484422964,3] NVRAM: Layout appears sane The mftb() output is not very meaningful, the changed output shows: [ 38.315784591,5] CENTAUR: FSI host: 0x0 cMFSI0 port 2 [ 38.315922971,5] PSI[0x000]: Found PSI bridge [working=1, active=0] [ 1.448765255,5] BT: Interface initialized, IO 0x00e4 [ 2.398136129,5] NVRAM: Size is 576 KB [ 3.145017865,3] NVRAM: Layout appears sane For the output sample, I've taken bits where one can see the time move back w.r.t. previous log, but that was always the case. I don't think that is worth fixing here Adds an additional divide and modulo for every log printed. I've also fixed the test cases that run as a part of make check Signed-off-by: Balbir Singh <bsingharora@gmail.com> [stewart@linux.vnet.ibm.com: fix up tb in console tests] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* check: Fix bugs in mem region testsBenjamin Herrenschmidt2016-08-182-2/+0
| | | | | | | | We shouldn't delete the list element after list_pop, it's already been deleted. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Build host programs (and checks) with debug enabledBenjamin Herrenschmidt2016-08-183-1/+4
| | | | | | | | This enables memory poisoning in allocations and list checking among other things. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Use additional checks in skiboot for pointersBalbir Singh2016-08-171-0/+3
| | | | | | | | | | | The checks validate pointers sent in using opal_addr_valid() in opal_call API's provided via the console, cpu, fdt, flash, i2c, interrupts, nvram, opal-msg, opal, opal-pci, xscom and cec modules Signed-off-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add infrastructure for pointer validation.Balbir Singh2016-08-122-0/+52
| | | | | | | | | | | | | | If the kernel called an OPAL API with vmalloc'd address or any other address range in real mode, we would hit a problem with aliasing. Since the top 4 bits are ignored in real mode, pointers from 0xc.. and 0xd.. (and other ranges) could collide and lead to hard to solve bugs. This patch adds the infrastructure for pointer validation and a simple test case for testing the API Signed-off-by: Balbir Singh <bsingharora@gmail.com> [stewart@linux.vnet.ibm.com: move function to opal-internal.h rather than opal-api.h] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud