mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
1ab66d1fba
Nvlink2 supports address translation services (ATS) allowing devices to request address translations from an mmu known as the nest MMU which is setup to walk the CPU page tables. To access this functionality certain firmware calls are required to setup and manage hardware context tables in the nvlink processing unit (NPU). The NPU also manages forwarding of TLB invalidates (known as address translation shootdowns/ATSDs) to attached devices. This patch exports several methods to allow device drivers to register a process id (PASID/PID) in the hardware tables and to receive notification of when a device should stop issuing address translation requests (ATRs). It also adds a fault handler to allow device drivers to demand fault pages in. Signed-off-by: Alistair Popple <alistair@popple.id.au> [mpe: Fix up comment formatting, use flush_tlb_mm()] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
42 lines
1.4 KiB
C
42 lines
1.4 KiB
C
/*
|
|
* Copyright 2017 IBM Corp.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version
|
|
* 2 of the License, or (at your option) any later version.
|
|
*/
|
|
|
|
#ifndef _ASM_POWERNV_H
|
|
#define _ASM_POWERNV_H
|
|
|
|
#ifdef CONFIG_PPC_POWERNV
|
|
#define NPU2_WRITE 1
|
|
extern void powernv_set_nmmu_ptcr(unsigned long ptcr);
|
|
extern struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
|
|
unsigned long flags,
|
|
struct npu_context *(*cb)(struct npu_context *, void *),
|
|
void *priv);
|
|
extern void pnv_npu2_destroy_context(struct npu_context *context,
|
|
struct pci_dev *gpdev);
|
|
extern int pnv_npu2_handle_fault(struct npu_context *context, uintptr_t *ea,
|
|
unsigned long *flags, unsigned long *status,
|
|
int count);
|
|
#else
|
|
static inline void powernv_set_nmmu_ptcr(unsigned long ptcr) { }
|
|
static inline struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
|
|
unsigned long flags,
|
|
struct npu_context *(*cb)(struct npu_context *, void *),
|
|
void *priv) { return ERR_PTR(-ENODEV); }
|
|
static inline void pnv_npu2_destroy_context(struct npu_context *context,
|
|
struct pci_dev *gpdev) { }
|
|
|
|
static inline int pnv_npu2_handle_fault(struct npu_context *context,
|
|
uintptr_t *ea, unsigned long *flags,
|
|
unsigned long *status, int count) {
|
|
return -ENODEV;
|
|
}
|
|
#endif
|
|
|
|
#endif /* _ASM_POWERNV_H */
|