Displaying 6 results from an estimated 6 matches for "b75b3750e03d".
2020 Mar 17
2
[PATCH 3/4] mm: simplify device private page handling in hmm_range_fault
On Tue, Mar 17, 2020 at 09:15:36AM -0300, Jason Gunthorpe wrote:
> > Getting rid of HMM_PFN_DEVICE_PRIVATE seems reasonable to me since a driver can
> > look at the struct page but what if a driver needs to fault in a page from
> > another device's private memory? Should it call handle_mm_fault()?
>
> Isn't that what this series basically does?
>
> The
2020 Mar 17
0
[PATCH 3/4] mm: simplify device private page handling in hmm_range_fault
...port for them.
>
> No, with this series (and all actual callers before this series)
> we never fault in device private pages.
IFF we want to fault it in we'd need something like this. But I'd
really prefer to see test cases for that first.
diff --git a/mm/hmm.c b/mm/hmm.c
index b75b3750e03d..2884a3d11a1f 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -276,7 +276,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
if (!fault && !write_fault)
return 0;
- if (!non_swap_entry(entry))
+ if (!non_swap_entry(entry) || is_device_private_entry(entry))
g...
2020 Mar 16
0
[PATCH 4/4] mm: check the device private page owner in hmm_range_fault
...of device private pages
*/
struct hmm_range {
struct mmu_interval_notifier *notifier;
@@ -144,6 +145,7 @@ struct hmm_range {
uint64_t default_flags;
uint64_t pfn_flags_mask;
uint8_t pfn_shift;
+ void *dev_private_owner;
};
/*
diff --git a/mm/hmm.c b/mm/hmm.c
index cfad65f6a67b..b75b3750e03d 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -216,6 +216,14 @@ int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr,
unsigned long end, uint64_t *pfns, pmd_t pmd);
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+static inline bool hmm_is_device_private_entry(struct hmm_range *range,
+ swp_en...
2020 Mar 20
2
[PATCH 4/4] mm: check the device private page owner in hmm_range_fault
On Mon, Mar 16, 2020 at 08:32:16PM +0100, Christoph Hellwig wrote:
> diff --git a/mm/hmm.c b/mm/hmm.c
> index cfad65f6a67b..b75b3750e03d 100644
> +++ b/mm/hmm.c
> @@ -216,6 +216,14 @@ int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr,
> unsigned long end, uint64_t *pfns, pmd_t pmd);
> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>
> +static inline bool hmm_is_device_private_entry(struct hmm_range *r...
2020 Mar 17
3
[PATCH 3/4] mm: simplify device private page handling in hmm_range_fault
...t returns a hard failure, and
generates faults. AFAIK, GUP will fault in this case?
I need this for making ODP use this API. ODP is the one that is highly
likely to see other driver's device_private pages and must have them
always fault to CPU.
> diff --git a/mm/hmm.c b/mm/hmm.c
> index b75b3750e03d..2884a3d11a1f 100644
> +++ b/mm/hmm.c
> @@ -276,7 +276,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
> if (!fault && !write_fault)
> return 0;
>
> - if (!non_swap_entry(entry))
> + if (!non_swap_entry(entry) || is_device_private...
2020 Mar 16
14
ensure device private pages have an owner v2
When acting on device private mappings a driver needs to know if the
device (or other entity in case of kvmppc) actually owns this private
mapping. This series adds an owner field and converts the migrate_vma
code over to check it. I looked into doing the same for
hmm_range_fault, but as far as I can tell that code has never been
wired up to actually work for device private memory, so instead of