2019-05-27 08:55:01 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* This file contains the generic code to perform a call to the
|
|
|
|
* pSeries LPAR hypervisor.
|
|
|
|
*/
|
2015-04-09 13:51:32 +10:00
|
|
|
#include <linux/jump_label.h>
|
2005-04-16 15:20:36 -07:00
|
|
|
#include <asm/hvcall.h>
|
|
|
|
#include <asm/processor.h>
|
|
|
|
#include <asm/ppc_asm.h>
|
2006-09-06 16:23:12 -07:00
|
|
|
#include <asm/asm-offsets.h>
|
2010-11-18 15:06:17 +00:00
|
|
|
#include <asm/ptrace.h>
|
2018-07-05 16:25:01 +00:00
|
|
|
#include <asm/feature-fixups.h>
|
2014-07-03 15:52:03 +10:00
|
|
|
|
|
|
|
.section ".text"
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2009-10-26 18:50:29 +00:00
|
|
|
#ifdef CONFIG_TRACEPOINTS
|
|
|
|
|
2018-12-31 00:14:15 +09:00
|
|
|
#ifndef CONFIG_JUMP_LABEL
|
2022-09-26 15:38:23 +10:00
|
|
|
.data
|
2009-10-26 18:50:29 +00:00
|
|
|
|
|
|
|
.globl hcall_tracepoint_refcount
|
|
|
|
hcall_tracepoint_refcount:
|
2017-03-09 16:42:12 +11:00
|
|
|
.8byte 0
|
2009-10-26 18:50:29 +00:00
|
|
|
|
|
|
|
.section ".text"
|
2014-07-03 15:52:03 +10:00
|
|
|
#endif
|
2009-10-26 18:50:29 +00:00
|
|
|
|
2006-09-06 16:23:12 -07:00
|
|
|
/*
|
2012-06-25 13:33:14 +00:00
|
|
|
* precall must preserve all registers. use unused STK_PARAM()
|
2022-11-27 22:49:30 +10:00
|
|
|
* areas to save snapshots and opcode. STK_PARAM() in the caller's
|
|
|
|
* frame will be available even on ELFv2 because these are all
|
|
|
|
* variadic functions.
|
2006-09-06 16:23:12 -07:00
|
|
|
*/
|
2009-10-26 18:51:09 +00:00
|
|
|
#define HCALL_INST_PRECALL(FIRST_REG) \
|
2009-10-26 18:50:29 +00:00
|
|
|
mflr r0; \
|
2012-06-25 13:33:14 +00:00
|
|
|
std r3,STK_PARAM(R3)(r1); \
|
|
|
|
std r4,STK_PARAM(R4)(r1); \
|
|
|
|
std r5,STK_PARAM(R5)(r1); \
|
|
|
|
std r6,STK_PARAM(R6)(r1); \
|
|
|
|
std r7,STK_PARAM(R7)(r1); \
|
|
|
|
std r8,STK_PARAM(R8)(r1); \
|
|
|
|
std r9,STK_PARAM(R9)(r1); \
|
|
|
|
std r10,STK_PARAM(R10)(r1); \
|
2009-10-26 18:50:29 +00:00
|
|
|
std r0,16(r1); \
|
2012-06-25 13:33:14 +00:00
|
|
|
addi r4,r1,STK_PARAM(FIRST_REG); \
|
2022-11-27 22:49:30 +10:00
|
|
|
stdu r1,-STACK_FRAME_MIN_SIZE(r1); \
|
2023-04-08 12:17:50 +10:00
|
|
|
bl CFUNC(__trace_hcall_entry); \
|
2022-11-27 22:49:30 +10:00
|
|
|
ld r3,STACK_FRAME_MIN_SIZE+STK_PARAM(R3)(r1); \
|
|
|
|
ld r4,STACK_FRAME_MIN_SIZE+STK_PARAM(R4)(r1); \
|
|
|
|
ld r5,STACK_FRAME_MIN_SIZE+STK_PARAM(R5)(r1); \
|
|
|
|
ld r6,STACK_FRAME_MIN_SIZE+STK_PARAM(R6)(r1); \
|
|
|
|
ld r7,STACK_FRAME_MIN_SIZE+STK_PARAM(R7)(r1); \
|
|
|
|
ld r8,STACK_FRAME_MIN_SIZE+STK_PARAM(R8)(r1); \
|
|
|
|
ld r9,STACK_FRAME_MIN_SIZE+STK_PARAM(R9)(r1); \
|
|
|
|
ld r10,STACK_FRAME_MIN_SIZE+STK_PARAM(R10)(r1)
|
2009-10-26 18:50:29 +00:00
|
|
|
|
2006-09-06 16:23:12 -07:00
|
|
|
/*
|
|
|
|
* postcall is performed immediately before function return which
|
2014-07-03 15:52:03 +10:00
|
|
|
* allows liberal use of volatile registers.
|
2006-09-06 16:23:12 -07:00
|
|
|
*/
|
2009-10-26 18:51:09 +00:00
|
|
|
#define __HCALL_INST_POSTCALL \
|
2022-11-27 22:49:30 +10:00
|
|
|
ld r0,STACK_FRAME_MIN_SIZE+STK_PARAM(R3)(r1); \
|
|
|
|
std r3,STACK_FRAME_MIN_SIZE+STK_PARAM(R3)(r1); \
|
2009-10-26 18:50:29 +00:00
|
|
|
mr r4,r3; \
|
2014-07-03 15:52:56 +10:00
|
|
|
mr r3,r0; \
|
2023-04-08 12:17:50 +10:00
|
|
|
bl CFUNC(__trace_hcall_exit); \
|
2022-11-27 22:49:30 +10:00
|
|
|
ld r0,STACK_FRAME_MIN_SIZE+16(r1); \
|
|
|
|
addi r1,r1,STACK_FRAME_MIN_SIZE; \
|
2012-06-25 13:33:14 +00:00
|
|
|
ld r3,STK_PARAM(R3)(r1); \
|
2014-07-03 15:52:03 +10:00
|
|
|
mtlr r0
|
2009-10-26 18:51:09 +00:00
|
|
|
|
|
|
|
#define HCALL_INST_POSTCALL_NORETS \
|
|
|
|
li r5,0; \
|
|
|
|
__HCALL_INST_POSTCALL
|
|
|
|
|
|
|
|
#define HCALL_INST_POSTCALL(BUFREG) \
|
|
|
|
mr r5,BUFREG; \
|
|
|
|
__HCALL_INST_POSTCALL
|
|
|
|
|
2018-12-31 00:14:15 +09:00
|
|
|
#ifdef CONFIG_JUMP_LABEL
|
2014-07-03 15:52:03 +10:00
|
|
|
#define HCALL_BRANCH(LABEL) \
|
|
|
|
ARCH_STATIC_BRANCH(LABEL, hcall_tracepoint_key)
|
|
|
|
#else
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We branch around this in early init (eg when populating the MMU
|
|
|
|
* hashtable) by using an unconditional cpu feature.
|
|
|
|
*/
|
|
|
|
#define HCALL_BRANCH(LABEL) \
|
|
|
|
BEGIN_FTR_SECTION; \
|
|
|
|
b 1f; \
|
|
|
|
END_FTR_SECTION(0, 1); \
|
2022-09-26 15:38:23 +10:00
|
|
|
LOAD_REG_ADDR(r12, hcall_tracepoint_refcount) ; \
|
2023-05-09 19:15:59 +10:00
|
|
|
ld r12,0(r12); \
|
2014-07-03 15:52:03 +10:00
|
|
|
cmpdi r12,0; \
|
|
|
|
bne- LABEL; \
|
|
|
|
1:
|
|
|
|
#endif
|
|
|
|
|
2006-09-06 16:23:12 -07:00
|
|
|
#else
|
2009-10-26 18:51:09 +00:00
|
|
|
#define HCALL_INST_PRECALL(FIRST_ARG)
|
|
|
|
#define HCALL_INST_POSTCALL_NORETS
|
|
|
|
#define HCALL_INST_POSTCALL(BUFREG)
|
2014-07-03 15:52:03 +10:00
|
|
|
#define HCALL_BRANCH(LABEL)
|
2006-09-06 16:23:12 -07:00
|
|
|
#endif
|
|
|
|
|
2021-05-08 20:14:52 +10:00
|
|
|
_GLOBAL_TOC(plpar_hcall_norets_notrace)
|
|
|
|
HMT_MEDIUM
|
|
|
|
|
|
|
|
mfcr r0
|
|
|
|
stw r0,8(r1)
|
|
|
|
HVSC /* invoke the hypervisor */
|
2021-06-18 01:51:03 +10:00
|
|
|
|
|
|
|
li r4,0
|
|
|
|
stb r4,PACASRR_VALID(r13)
|
|
|
|
|
2021-05-08 20:14:52 +10:00
|
|
|
lwz r0,8(r1)
|
|
|
|
mtcrf 0xff,r0
|
|
|
|
blr /* return r3 = status */
|
|
|
|
|
2014-05-13 20:48:57 +10:00
|
|
|
_GLOBAL_TOC(plpar_hcall_norets)
|
2005-05-01 08:58:46 -07:00
|
|
|
HMT_MEDIUM
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
mfcr r0
|
|
|
|
stw r0,8(r1)
|
2014-07-03 15:52:03 +10:00
|
|
|
HCALL_BRANCH(plpar_hcall_norets_trace)
|
2005-04-16 15:20:36 -07:00
|
|
|
HVSC /* invoke the hypervisor */
|
|
|
|
|
2021-06-18 01:51:03 +10:00
|
|
|
li r4,0
|
|
|
|
stb r4,PACASRR_VALID(r13)
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
lwz r0,8(r1)
|
|
|
|
mtcrf 0xff,r0
|
|
|
|
blr /* return r3 = status */
|
|
|
|
|
2014-07-03 15:52:03 +10:00
|
|
|
#ifdef CONFIG_TRACEPOINTS
|
|
|
|
plpar_hcall_norets_trace:
|
|
|
|
HCALL_INST_PRECALL(R4)
|
|
|
|
HVSC
|
|
|
|
HCALL_INST_POSTCALL_NORETS
|
2021-06-18 01:51:03 +10:00
|
|
|
|
|
|
|
li r4,0
|
|
|
|
stb r4,PACASRR_VALID(r13)
|
|
|
|
|
2014-07-03 15:52:03 +10:00
|
|
|
lwz r0,8(r1)
|
|
|
|
mtcrf 0xff,r0
|
|
|
|
blr
|
|
|
|
#endif
|
|
|
|
|
2014-05-13 20:48:57 +10:00
|
|
|
_GLOBAL_TOC(plpar_hcall)
|
2005-05-01 08:58:46 -07:00
|
|
|
HMT_MEDIUM
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
mfcr r0
|
|
|
|
stw r0,8(r1)
|
|
|
|
|
2014-07-03 15:52:03 +10:00
|
|
|
HCALL_BRANCH(plpar_hcall_trace)
|
2006-09-06 16:23:12 -07:00
|
|
|
|
2012-06-25 13:33:14 +00:00
|
|
|
std r4,STK_PARAM(R4)(r1) /* Save ret buffer */
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-07-19 08:01:28 +10:00
|
|
|
mr r4,r5
|
|
|
|
mr r5,r6
|
|
|
|
mr r6,r7
|
|
|
|
mr r7,r8
|
|
|
|
mr r8,r9
|
|
|
|
mr r9,r10
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
HVSC /* invoke the hypervisor */
|
|
|
|
|
2012-06-25 13:33:14 +00:00
|
|
|
ld r12,STK_PARAM(R4)(r1)
|
2006-07-19 08:01:28 +10:00
|
|
|
std r4, 0(r12)
|
|
|
|
std r5, 8(r12)
|
|
|
|
std r6, 16(r12)
|
|
|
|
std r7, 24(r12)
|
2006-03-30 22:47:14 +02:00
|
|
|
|
2021-06-18 01:51:03 +10:00
|
|
|
li r4,0
|
|
|
|
stb r4,PACASRR_VALID(r13)
|
|
|
|
|
2014-07-03 15:52:03 +10:00
|
|
|
lwz r0,8(r1)
|
|
|
|
mtcrf 0xff,r0
|
|
|
|
|
|
|
|
blr /* return r3 = status */
|
|
|
|
|
|
|
|
#ifdef CONFIG_TRACEPOINTS
|
|
|
|
plpar_hcall_trace:
|
|
|
|
HCALL_INST_PRECALL(R5)
|
|
|
|
|
|
|
|
mr r4,r5
|
|
|
|
mr r5,r6
|
|
|
|
mr r6,r7
|
|
|
|
mr r7,r8
|
|
|
|
mr r8,r9
|
|
|
|
mr r9,r10
|
|
|
|
|
|
|
|
HVSC
|
|
|
|
|
powerpc/pseries: Fix STK_PARAM access in the hcall tracing code
In powerpc pseries system, below behaviour is observed while
enabling tracing on hcall:
# cd /sys/kernel/debug/tracing/
# cat events/powerpc/hcall_exit/enable
0
# echo 1 > events/powerpc/hcall_exit/enable
# ls
-bash: fork: Bad address
Above is from power9 lpar with latest kernel. Past this, softlockup
is observed. Initially while attempting via perf_event_open to
use "PERF_TYPE_TRACEPOINT", kernel panic was observed.
perf config used:
================
memset(&pe[1],0,sizeof(struct perf_event_attr));
pe[1].type=PERF_TYPE_TRACEPOINT;
pe[1].size=96;
pe[1].config=0x26ULL; /* 38 raw_syscalls/sys_exit */
pe[1].sample_type=0; /* 0 */
pe[1].read_format=PERF_FORMAT_TOTAL_TIME_ENABLED|PERF_FORMAT_TOTAL_TIME_RUNNING|PERF_FORMAT_ID|PERF_FORMAT_GROUP|0x10ULL; /* 1f */
pe[1].inherit=1;
pe[1].precise_ip=0; /* arbitrary skid */
pe[1].wakeup_events=0;
pe[1].bp_type=HW_BREAKPOINT_EMPTY;
pe[1].config1=0x1ULL;
Kernel panic logs:
==================
Kernel attempted to read user page (8) - exploit attempt? (uid: 0)
BUG: Kernel NULL pointer dereference on read at 0x00000008
Faulting instruction address: 0xc0000000004c2814
Oops: Kernel access of bad area, sig: 11 [#1]
LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
Modules linked in: nfnetlink bonding tls rfkill sunrpc dm_service_time dm_multipath pseries_rng xts vmx_crypto xfs libcrc32c sd_mod t10_pi crc64_rocksoft crc64 sg ibmvfc scsi_transport_fc ibmveth dm_mirror dm_region_hash dm_log dm_mod fuse
CPU: 0 PID: 1431 Comm: login Not tainted 6.4.0+ #1
Hardware name: IBM,8375-42A POWER9 (raw) 0x4e0202 0xf000005 of:IBM,FW950.30 (VL950_892) hv:phyp pSeries
NIP page_remove_rmap+0x44/0x320
LR wp_page_copy+0x384/0xec0
Call Trace:
0xc00000001416e400 (unreliable)
wp_page_copy+0x384/0xec0
__handle_mm_fault+0x9d4/0xfb0
handle_mm_fault+0xf0/0x350
___do_page_fault+0x48c/0xc90
hash__do_page_fault+0x30/0x70
do_hash_fault+0x1a4/0x330
data_access_common_virt+0x198/0x1f0
--- interrupt: 300 at 0x7fffae971abc
git bisect tracked this down to below commit:
'commit baa49d81a94b ("powerpc/pseries: hvcall stack frame overhead")'
This commit changed STACK_FRAME_OVERHEAD (112 ) to
STACK_FRAME_MIN_SIZE (32 ) since 32 bytes is the minimum size
for ELFv2 stack. With the latest kernel, when running on ELFv2,
STACK_FRAME_MIN_SIZE is used to allocate stack size.
During plpar_hcall_trace, first call is made to HCALL_INST_PRECALL
which saves the registers and allocates new stack frame. In the
plpar_hcall_trace code, STK_PARAM is accessed at two places.
1. To save r4: std r4,STK_PARAM(R4)(r1)
2. To access r4 back: ld r12,STK_PARAM(R4)(r1)
HCALL_INST_PRECALL precall allocates a new stack frame. So all
the stack parameter access after the precall, needs to be accessed
with +STACK_FRAME_MIN_SIZE. So the store instruction should be:
std r4,STACK_FRAME_MIN_SIZE+STK_PARAM(R4)(r1)
If the "std" is not updated with STACK_FRAME_MIN_SIZE, we will
end up with overwriting stack contents and cause corruption.
But instead of updating 'std', we can instead remove it since
HCALL_INST_PRECALL already saves it to the correct location.
similarly load instruction should be:
ld r12,STACK_FRAME_MIN_SIZE+STK_PARAM(R4)(r1)
Fix the load instruction to correctly access the stack parameter
with +STACK_FRAME_MIN_SIZE and remove the store of r4 since the
precall saves it correctly.
Cc: stable@vger.kernel.org # v6.2+
Fixes: baa49d81a94b ("powerpc/pseries: hvcall stack frame overhead")
Co-developed-by: Naveen N Rao <naveen@kernel.org>
Signed-off-by: Naveen N Rao <naveen@kernel.org>
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230929172337.7906-1-atrajeev@linux.vnet.ibm.com
2023-09-29 22:53:36 +05:30
|
|
|
ld r12,STACK_FRAME_MIN_SIZE+STK_PARAM(R4)(r1)
|
2014-07-03 15:52:03 +10:00
|
|
|
std r4,0(r12)
|
|
|
|
std r5,8(r12)
|
|
|
|
std r6,16(r12)
|
|
|
|
std r7,24(r12)
|
|
|
|
|
2009-10-26 18:51:09 +00:00
|
|
|
HCALL_INST_POSTCALL(r12)
|
2006-09-06 16:23:12 -07:00
|
|
|
|
2021-06-18 01:51:03 +10:00
|
|
|
li r4,0
|
|
|
|
stb r4,PACASRR_VALID(r13)
|
|
|
|
|
2006-03-30 22:47:14 +02:00
|
|
|
lwz r0,8(r1)
|
|
|
|
mtcrf 0xff,r0
|
|
|
|
|
2014-07-03 15:52:03 +10:00
|
|
|
blr
|
|
|
|
#endif
|
2006-03-30 22:47:14 +02:00
|
|
|
|
2007-03-21 11:21:32 +05:30
|
|
|
/*
|
|
|
|
* plpar_hcall_raw can be called in real mode. kexec/kdump need some
|
|
|
|
* hypervisor calls to be executed in real mode. So plpar_hcall_raw
|
|
|
|
* does not access the per cpu hypervisor call statistics variables,
|
|
|
|
* since these variables may not be present in the RMO region.
|
|
|
|
*/
|
|
|
|
_GLOBAL(plpar_hcall_raw)
|
|
|
|
HMT_MEDIUM
|
|
|
|
|
|
|
|
mfcr r0
|
|
|
|
stw r0,8(r1)
|
|
|
|
|
2012-06-25 13:33:14 +00:00
|
|
|
std r4,STK_PARAM(R4)(r1) /* Save ret buffer */
|
2007-03-21 11:21:32 +05:30
|
|
|
|
|
|
|
mr r4,r5
|
|
|
|
mr r5,r6
|
|
|
|
mr r6,r7
|
|
|
|
mr r7,r8
|
|
|
|
mr r8,r9
|
|
|
|
mr r9,r10
|
|
|
|
|
|
|
|
HVSC /* invoke the hypervisor */
|
|
|
|
|
2012-06-25 13:33:14 +00:00
|
|
|
ld r12,STK_PARAM(R4)(r1)
|
2007-03-21 11:21:32 +05:30
|
|
|
std r4, 0(r12)
|
|
|
|
std r5, 8(r12)
|
|
|
|
std r6, 16(r12)
|
|
|
|
std r7, 24(r12)
|
|
|
|
|
2021-06-18 01:51:03 +10:00
|
|
|
li r4,0
|
|
|
|
stb r4,PACASRR_VALID(r13)
|
|
|
|
|
2007-03-21 11:21:32 +05:30
|
|
|
lwz r0,8(r1)
|
|
|
|
mtcrf 0xff,r0
|
|
|
|
|
|
|
|
blr /* return r3 = status */
|
|
|
|
|
2014-05-13 20:48:57 +10:00
|
|
|
_GLOBAL_TOC(plpar_hcall9)
|
2006-03-30 22:47:14 +02:00
|
|
|
HMT_MEDIUM
|
|
|
|
|
|
|
|
mfcr r0
|
|
|
|
stw r0,8(r1)
|
|
|
|
|
2014-07-03 15:52:03 +10:00
|
|
|
HCALL_BRANCH(plpar_hcall9_trace)
|
2006-09-06 16:23:12 -07:00
|
|
|
|
2012-06-25 13:33:14 +00:00
|
|
|
std r4,STK_PARAM(R4)(r1) /* Save ret buffer */
|
2006-07-19 08:01:28 +10:00
|
|
|
|
|
|
|
mr r4,r5
|
|
|
|
mr r5,r6
|
|
|
|
mr r6,r7
|
|
|
|
mr r7,r8
|
|
|
|
mr r8,r9
|
|
|
|
mr r9,r10
|
2012-06-25 13:33:14 +00:00
|
|
|
ld r10,STK_PARAM(R11)(r1) /* put arg7 in R10 */
|
|
|
|
ld r11,STK_PARAM(R12)(r1) /* put arg8 in R11 */
|
|
|
|
ld r12,STK_PARAM(R13)(r1) /* put arg9 in R12 */
|
2006-03-30 22:47:14 +02:00
|
|
|
|
|
|
|
HVSC /* invoke the hypervisor */
|
|
|
|
|
2007-01-09 02:37:16 +11:00
|
|
|
mr r0,r12
|
2012-06-25 13:33:14 +00:00
|
|
|
ld r12,STK_PARAM(R4)(r1)
|
2006-07-19 08:01:28 +10:00
|
|
|
std r4, 0(r12)
|
|
|
|
std r5, 8(r12)
|
|
|
|
std r6, 16(r12)
|
|
|
|
std r7, 24(r12)
|
|
|
|
std r8, 32(r12)
|
|
|
|
std r9, 40(r12)
|
|
|
|
std r10,48(r12)
|
|
|
|
std r11,56(r12)
|
2007-01-09 02:37:16 +11:00
|
|
|
std r0, 64(r12)
|
2006-03-30 22:47:14 +02:00
|
|
|
|
2021-06-18 01:51:03 +10:00
|
|
|
li r4,0
|
|
|
|
stb r4,PACASRR_VALID(r13)
|
|
|
|
|
2014-07-03 15:52:03 +10:00
|
|
|
lwz r0,8(r1)
|
|
|
|
mtcrf 0xff,r0
|
|
|
|
|
|
|
|
blr /* return r3 = status */
|
|
|
|
|
|
|
|
#ifdef CONFIG_TRACEPOINTS
|
|
|
|
plpar_hcall9_trace:
|
|
|
|
HCALL_INST_PRECALL(R5)
|
|
|
|
|
|
|
|
mr r4,r5
|
|
|
|
mr r5,r6
|
|
|
|
mr r6,r7
|
|
|
|
mr r7,r8
|
|
|
|
mr r8,r9
|
|
|
|
mr r9,r10
|
2022-11-27 22:49:30 +10:00
|
|
|
ld r10,STACK_FRAME_MIN_SIZE+STK_PARAM(R11)(r1)
|
|
|
|
ld r11,STACK_FRAME_MIN_SIZE+STK_PARAM(R12)(r1)
|
|
|
|
ld r12,STACK_FRAME_MIN_SIZE+STK_PARAM(R13)(r1)
|
2014-07-03 15:52:03 +10:00
|
|
|
|
|
|
|
HVSC
|
|
|
|
|
|
|
|
mr r0,r12
|
2022-11-27 22:49:30 +10:00
|
|
|
ld r12,STACK_FRAME_MIN_SIZE+STK_PARAM(R4)(r1)
|
2014-07-03 15:52:03 +10:00
|
|
|
std r4,0(r12)
|
|
|
|
std r5,8(r12)
|
|
|
|
std r6,16(r12)
|
|
|
|
std r7,24(r12)
|
|
|
|
std r8,32(r12)
|
|
|
|
std r9,40(r12)
|
|
|
|
std r10,48(r12)
|
|
|
|
std r11,56(r12)
|
|
|
|
std r0,64(r12)
|
|
|
|
|
2009-10-26 18:51:09 +00:00
|
|
|
HCALL_INST_POSTCALL(r12)
|
2006-09-06 16:23:12 -07:00
|
|
|
|
2021-06-18 01:51:03 +10:00
|
|
|
li r4,0
|
|
|
|
stb r4,PACASRR_VALID(r13)
|
|
|
|
|
2006-03-30 22:47:14 +02:00
|
|
|
lwz r0,8(r1)
|
|
|
|
mtcrf 0xff,r0
|
|
|
|
|
2014-07-03 15:52:03 +10:00
|
|
|
blr
|
|
|
|
#endif
|
2010-05-10 20:28:26 +00:00
|
|
|
|
|
|
|
/* See plpar_hcall_raw to see why this is needed */
|
|
|
|
_GLOBAL(plpar_hcall9_raw)
|
|
|
|
HMT_MEDIUM
|
|
|
|
|
|
|
|
mfcr r0
|
|
|
|
stw r0,8(r1)
|
|
|
|
|
2012-06-25 13:33:14 +00:00
|
|
|
std r4,STK_PARAM(R4)(r1) /* Save ret buffer */
|
2010-05-10 20:28:26 +00:00
|
|
|
|
|
|
|
mr r4,r5
|
|
|
|
mr r5,r6
|
|
|
|
mr r6,r7
|
|
|
|
mr r7,r8
|
|
|
|
mr r8,r9
|
|
|
|
mr r9,r10
|
2012-06-25 13:33:14 +00:00
|
|
|
ld r10,STK_PARAM(R11)(r1) /* put arg7 in R10 */
|
|
|
|
ld r11,STK_PARAM(R12)(r1) /* put arg8 in R11 */
|
|
|
|
ld r12,STK_PARAM(R13)(r1) /* put arg9 in R12 */
|
2010-05-10 20:28:26 +00:00
|
|
|
|
|
|
|
HVSC /* invoke the hypervisor */
|
|
|
|
|
|
|
|
mr r0,r12
|
2012-06-25 13:33:14 +00:00
|
|
|
ld r12,STK_PARAM(R4)(r1)
|
2010-05-10 20:28:26 +00:00
|
|
|
std r4, 0(r12)
|
|
|
|
std r5, 8(r12)
|
|
|
|
std r6, 16(r12)
|
|
|
|
std r7, 24(r12)
|
|
|
|
std r8, 32(r12)
|
|
|
|
std r9, 40(r12)
|
|
|
|
std r10,48(r12)
|
|
|
|
std r11,56(r12)
|
|
|
|
std r0, 64(r12)
|
|
|
|
|
2021-06-18 01:51:03 +10:00
|
|
|
li r4,0
|
|
|
|
stb r4,PACASRR_VALID(r13)
|
|
|
|
|
2010-05-10 20:28:26 +00:00
|
|
|
lwz r0,8(r1)
|
|
|
|
mtcrf 0xff,r0
|
|
|
|
|
|
|
|
blr /* return r3 = status */
|