mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
256ba2c168
A new kernel deserves a clean slate. Any pages shared with the hypervisor is unshared before invoking the new kernel. However there are exceptions. If the new kernel is invoked to dump the current kernel, or if there is a explicit request to preserve the state of the current kernel, unsharing of pages is skipped. NOTE: While testing crashkernel, make sure at least 256M is reserved for crashkernel. Otherwise SWIOTLB allocation will fail and crash kernel will fail to boot. Signed-off-by: Ram Pai <linuxram@us.ibm.com> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190820021326.6884-11-bauerman@linux.ibm.com
50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Ultravisor definitions
|
|
*
|
|
* Copyright 2019, IBM Corporation.
|
|
*
|
|
*/
|
|
#ifndef _ASM_POWERPC_ULTRAVISOR_H
|
|
#define _ASM_POWERPC_ULTRAVISOR_H
|
|
|
|
#include <asm/asm-prototypes.h>
|
|
#include <asm/ultravisor-api.h>
|
|
#include <asm/firmware.h>
|
|
|
|
int early_init_dt_scan_ultravisor(unsigned long node, const char *uname,
|
|
int depth, void *data);
|
|
|
|
/*
|
|
* In ultravisor enabled systems, PTCR becomes ultravisor privileged only for
|
|
* writing and an attempt to write to it will cause a Hypervisor Emulation
|
|
* Assistance interrupt.
|
|
*/
|
|
static inline void set_ptcr_when_no_uv(u64 val)
|
|
{
|
|
if (!firmware_has_feature(FW_FEATURE_ULTRAVISOR))
|
|
mtspr(SPRN_PTCR, val);
|
|
}
|
|
|
|
static inline int uv_register_pate(u64 lpid, u64 dw0, u64 dw1)
|
|
{
|
|
return ucall_norets(UV_WRITE_PATE, lpid, dw0, dw1);
|
|
}
|
|
|
|
static inline int uv_share_page(u64 pfn, u64 npages)
|
|
{
|
|
return ucall_norets(UV_SHARE_PAGE, pfn, npages);
|
|
}
|
|
|
|
static inline int uv_unshare_page(u64 pfn, u64 npages)
|
|
{
|
|
return ucall_norets(UV_UNSHARE_PAGE, pfn, npages);
|
|
}
|
|
|
|
static inline int uv_unshare_all_pages(void)
|
|
{
|
|
return ucall_norets(UV_UNSHARE_ALL_PAGES);
|
|
}
|
|
|
|
#endif /* _ASM_POWERPC_ULTRAVISOR_H */
|