Commit Graph

1145 Commits

Author SHA1 Message Date
Balazs Gerofi
ec5328de69 HFI1: refactor sdma_select_user_engine() 2018-06-13 00:31:41 +09:00
Balazs Gerofi
880dd6ddb2 page_fault_handler(): enable on-demand mapping of Linux ioremap area 2018-06-13 00:31:41 +09:00
Balazs Gerofi
b08331b21a ihk_hfi1_common.h: use IRQ restore unlock in spin_unlock 2018-06-13 00:31:41 +09:00
Balazs Gerofi
c196c996dd HFI: add dd to generated sdma_engine 2018-06-13 00:31:41 +09:00
Balazs Gerofi
20e179f6dc sdma_select_user_engine(): refactor selection code 2018-06-13 00:31:40 +09:00
Balazs Gerofi
32fbc015f5 HFI1: eliminate lots of dead code 2018-06-13 00:31:40 +09:00
Balazs Gerofi
558c250bb3 HFI1: generate headers for sdma_state and sdma_engine structures 2018-06-13 00:31:40 +09:00
Balazs Gerofi
96ea2d3658 dwarf-extract: support enumerations 2018-06-13 00:31:40 +09:00
Balazs Gerofi
9c91298ccf do_munmap(): hook to HFI1 deferred unmap 2018-06-13 00:31:40 +09:00
Balazs Gerofi
b08da83a51 hfi1_file_ioctl(): execute HFI1_IOCTL_TID_INVAL_READ locally 2018-06-13 00:31:40 +09:00
Balazs Gerofi
fcc8310454 HFI1: track receive TIDs in a tree 2018-06-13 00:31:40 +09:00
Balazs Gerofi
96b8b30516 MM: facility for deferred munmap()
Conflicts:
	kernel/process.c
2018-06-13 00:31:40 +09:00
Balazs Gerofi
521e0dc707 HFI1: add a bunch of fields to hfi1_devdata and hfi1_filedata for receive TID handling, do necessary mappings in hfi1_map_device_addresses() 2018-06-13 00:31:40 +09:00
Balazs Gerofi
e2e773d883 HFI: fix tidinfo and length calculation in program_rcvarray() 2018-06-13 00:31:39 +09:00
Balazs Gerofi
04d22d90a3 do_mmap(): debug message cosmetics 2018-06-13 00:31:39 +09:00
Balazs Gerofi
f6405081a6 page_fault_handler(): map Linux ioremap addresses on demand (disabled) 2018-06-13 00:31:39 +09:00
Balazs Gerofi
5bea237581 HFI1: make kmalloc caches per-CPU and pre-allocate at boot time 2018-06-13 00:31:39 +09:00
Balazs Gerofi
33ad55e72b kmalloc_cache_prealloc(): specify nr_elems as argument 2018-06-13 00:31:39 +09:00
Balazs Gerofi
6848c2ecf7 HFI1: move tid_rb_node to header 2018-06-13 00:31:39 +09:00
Balazs Gerofi
79f9a2d31a HFI1: don't print at open() time 2018-06-13 00:31:39 +09:00
Balazs Gerofi
2900ce20f7 HFI1: hfi1_unmap_device_addresses() at process terminate time 2018-06-13 00:31:39 +09:00
Balazs Gerofi
002b78372d open(): ignore /proc/sys/vm/overcommit_memory 2018-06-13 00:31:38 +09:00
Dominique Martinet
5fce5e4e3c hfi1 generated headers: add missing filedata file 2018-06-13 00:31:38 +09:00
Balazs Gerofi
7a1ad31183 HFI: call hfi1_map_device_addresses() at initialization time
Conflicts:
	kernel/syscall.c
2018-06-13 00:31:38 +09:00
Dominique Martinet
54bdb3419d hfi1 generated headers:
- split headers into one file per struct
 - add filedata
 - fix s/modprobe/modinfo/ for guessed .ko path
2018-06-13 00:31:38 +09:00
Dominique Martinet
03fed4d1c8 automatically generate hfi structs from dwarf info 2018-06-13 00:31:38 +09:00
Dominique Martinet
6279f69f5c compiler.h: take in recent linux updates for newer gcc support
Had to remove from original compiler-gcc:
 - things that deal with types, e.g. READ_ONCE macro and friends;
 - #define barrier(). This one would be better there at some point.

hfi1: remove ACCESS_ONCE from hfi1 header
2018-06-13 00:31:38 +09:00
Balazs Gerofi
6959d5ead4 HFI: port to SFI driver version 10.5.1.0.2 2018-06-13 00:31:38 +09:00
Balazs Gerofi
a5aa68744f hfi1: use kmalloc_cache for tid_rb_node allocations 2018-06-13 00:31:38 +09:00
Balazs Gerofi
89c5aaa9e9 hfi1_user_exp_rcv_setup(): rewrite main loop 2018-06-13 00:31:37 +09:00
Balazs Gerofi
15422d886f hif1_file_ioctl(): use dkprintf() 2018-06-13 00:31:37 +09:00
Balazs Gerofi
f139bef0cb mmap(): remove force large page extension (meant to be RESET) 2018-06-13 00:31:37 +09:00
Dominique Martinet
de82cf8779 hfi1/user_exp_rcv/setup: keep track of position within page
ihk_mc_pt_lookup_pte + pte_get_phys will get us the physical address
for the start of the page we're looking at.
Re-offset it by position within buffer.
2018-06-13 00:31:37 +09:00
Dominique Martinet
662895c020 hfi1/user_exp_rcv: explicitely call hfi1_map_device_addresses
There were cases where nobody else did this mapping for us
2018-06-13 00:31:37 +09:00
Dominique Martinet
d23939da8c process/vm: fix lookup_process_memory_range (again)
That optimistically going left was a more serious bug than just
last iteration, we could just pass by a match and continue down
the tree if the match was not a leaf.

Fix the actual algorithm issue

Conflicts:
	kernel/process.c
2018-06-13 00:31:37 +09:00
Dominique Martinet
67529f21ff hfi1: replace true/false defines by stddef include 2018-06-13 00:31:37 +09:00
Dominique Martinet
5c11ff0950 process/vm: fix lookup_process_memory_range with small start address
Cherry-picked from 6370520e

Conflicts:
	kernel/process.c
2018-06-13 00:31:37 +09:00
Dominique Martinet
ce4eb0d409 hfi1/user_exp_rcv/setup: add access_ok check 2018-06-13 00:31:36 +09:00
Dominique Martinet
04434320fc hfi1/user_exp_rcv/setup: do not skip over pages
If the vaddr we consider is not at the start of a page, we could skip
over (smaller, not contigous) areas.

For example consider this segment of virtual memory:
[ 2MB | 4k | 4k | ... ]
Starting at 1MB offset, we would get a pgsize of 2MB so would skip
straight over 1MB worth of 4k pages.
2018-06-13 00:31:36 +09:00
Dominique Martinet
50fafa6d71 hfi1/user_exp_rcv/setup: use cache_alloc for tidlist 2018-06-13 00:31:36 +09:00
Dominique Martinet
f5ced648ef hfi1/user_exp_rcv: rework main loop
New loop now takes into account pages not physically contiguous.
Also some minor improvements, e.g. make the spin_lock used more locally,
reuse a group we had if we had one, etc.
2018-06-13 00:31:36 +09:00
Dominique Martinet
0f8f88ca46 hfi1/user_exp_rcv/invalid: Remove function
user_exp_rcv_invalid is only used together with the mmu cache
(its purpose is the delayed freeing of tids that were invalidated in cache)

Since we do not use that cache, the function can go
2018-06-13 00:31:36 +09:00
Dominique Martinet
e99f19e812 hfi1/user_exp_rcv/setup: set length in tidinfo
This was dropped early on by mistake/excessive haste, it's actually
pretty useful.
2018-06-13 00:31:36 +09:00
Dominique Martinet
9a36e5d213 hfi1/user_exp_rcv/setup: increment phys appropriately
Old code was always registering the same section with different size,
instead of properly covering the requested map
2018-06-13 00:31:36 +09:00
Dominique Martinet
4816f27639 hfi1/user_exp_rcv/setup: split into multiple tids
Do not round up to next power of two, but issue multiple requests
if necessary (e.g. 260k would be 256 + 4k in two registrations)
2018-06-13 00:31:36 +09:00
Dominique Martinet
23f178d718 hfi1/user_exp_rcv/clear: implement TID_FREE ioctl 2018-06-13 00:31:36 +09:00
Dominique Martinet
159c18b98b hfi1/ioctl: only forward ioctl if hfi1_file_ioctl didn't handle it
Conflicts:
	kernel/syscall.c
2018-06-13 00:31:35 +09:00
Dominique Martinet
1847a3ac11 hfi1/user_exp_rcv/setup: cleanup locks/groups usage 2018-06-13 00:31:35 +09:00
Dominique Martinet
15b16ffbbb hfi1/user_exp_rcv/setup: map is noop, skip it
In the original driver's dma.c hfi1_dma_map_single just passes
the physical address back, so directly use that.
2018-06-13 00:31:35 +09:00
Dominique Martinet
e64d89cd48 hfi: bases for user_exp_rcv
This implements a skeleton setup function and call it on ioctl

Many missing points:
 - missing pci mapping to make setup work
 - no clear (passed to linux, so will likely bug out)
 - missing locks/safe-guards

Conflicts:
	kernel/Makefile.build.in
2018-06-13 00:31:35 +09:00