xpmem: Add xpmem_openat
In arm64, glibc-open of /dev/xpmem is hooked in sys_openat. This commit adds xpmem_openat which is called by sys_openat. This commit silently applies copy_from_user fix to sys_open as well. Change-Id: I3b4f7bf0e152c359250bb2b56910db9192390cb1 Fujitsu: POSTK_DEBUG_ARCH_DEP_46, POSTK_DEBUG_ARCH_DEP_62
This commit is contained in:
committed by
Dominique Martinet
parent
e12d5ed341
commit
04c11f35e9
@@ -19,14 +19,13 @@
|
||||
|
||||
#define XPMEM_DEV_PATH "/dev/xpmem"
|
||||
|
||||
#if defined(POSTK_DEBUG_ARCH_DEP_46) || defined(POSTK_DEBUG_ARCH_DEP_62)
|
||||
extern int xpmem_open(int, const char*, int, ihk_mc_user_context_t *ctx);
|
||||
#else /* POSTK_DEBUG_ARCH_DEP_46 || POSTK_DEBUG_ARCH_DEP_62 */
|
||||
extern int xpmem_open(ihk_mc_user_context_t *ctx);
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_46 || POSTK_DEBUG_ARCH_DEP_62 */
|
||||
extern int xpmem_remove_process_memory_range(struct process_vm *vm,
|
||||
int xpmem_open(const char *pathname,
|
||||
int flags, ihk_mc_user_context_t *ctx);
|
||||
int xpmem_openat(const char *pathname,
|
||||
int flags, ihk_mc_user_context_t *ctx);
|
||||
int xpmem_remove_process_memory_range(struct process_vm *vm,
|
||||
struct vm_range *vmr);
|
||||
extern int xpmem_fault_process_memory_range(struct process_vm *vm,
|
||||
int xpmem_fault_process_memory_range(struct process_vm *vm,
|
||||
struct vm_range *vmr, unsigned long vaddr, uint64_t reason);
|
||||
|
||||
#endif /* _XPMEM_H */
|
||||
|
||||
@@ -305,8 +305,8 @@ static int xpmem_pin_page(struct xpmem_thread_group *, struct thread *,
|
||||
static void xpmem_unpin_pages(struct xpmem_segment *, struct process_vm *,
|
||||
unsigned long, size_t);
|
||||
|
||||
static struct xpmem_thread_group * __xpmem_tg_ref_by_tgid_nolock_internal(
|
||||
pid_t, int, int);
|
||||
static struct xpmem_thread_group *__xpmem_tg_ref_by_tgid_nolock_internal(
|
||||
pid_t tgid, int index, int return_destroying);
|
||||
|
||||
static inline struct xpmem_thread_group *__xpmem_tg_ref_by_tgid(
|
||||
pid_t tgid,
|
||||
@@ -355,16 +355,16 @@ static inline struct xpmem_thread_group *__xpmem_tg_ref_by_tgid_nolock(
|
||||
#define xpmem_tg_ref_by_tgid_nolock(t) __xpmem_tg_ref_by_tgid_nolock(t, 0)
|
||||
#define xpmem_tg_ref_by_tgid_all_nolock(t) __xpmem_tg_ref_by_tgid_nolock(t, 1)
|
||||
|
||||
static struct xpmem_thread_group * xpmem_tg_ref_by_segid(xpmem_segid_t);
|
||||
static struct xpmem_thread_group * xpmem_tg_ref_by_apid(xpmem_apid_t);
|
||||
static void xpmem_tg_deref(struct xpmem_thread_group *);
|
||||
static struct xpmem_thread_group *xpmem_tg_ref_by_segid(xpmem_segid_t);
|
||||
static struct xpmem_thread_group *xpmem_tg_ref_by_apid(xpmem_apid_t);
|
||||
static void xpmem_tg_deref(struct xpmem_thread_group *tg);
|
||||
static struct xpmem_segment *xpmem_seg_ref_by_segid(struct xpmem_thread_group *,
|
||||
xpmem_segid_t);
|
||||
static void xpmem_seg_deref(struct xpmem_segment *);
|
||||
static void xpmem_seg_deref(struct xpmem_segment *seg);
|
||||
static struct xpmem_access_permit * xpmem_ap_ref_by_apid(
|
||||
struct xpmem_thread_group *, xpmem_apid_t);
|
||||
static void xpmem_ap_deref(struct xpmem_access_permit *);
|
||||
static void xpmem_att_deref(struct xpmem_attachment *);
|
||||
struct xpmem_thread_group *ap_tg, xpmem_apid_t apid);
|
||||
static void xpmem_ap_deref(struct xpmem_access_permit *ap);
|
||||
static void xpmem_att_deref(struct xpmem_attachment *att);
|
||||
static int xpmem_validate_access(struct xpmem_access_permit *, off_t, size_t,
|
||||
int, unsigned long *);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user