search for: pte_special

Displaying 20 results from an estimated 22 matches for "pte_special".

2019 Sep 12
1
[PATCH 2/4] mm/hmm: allow snapshot of the special zero page
...n(-) > > diff --git a/mm/hmm.c b/mm/hmm.c > index 06041d4399ff..7217912bef13 100644 > --- a/mm/hmm.c > +++ b/mm/hmm.c > @@ -532,7 +532,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, > return -EBUSY; > } else if (IS_ENABLED(CONFIG_ARCH_HAS_PTE_SPECIAL) && pte_special(pte)) { > *pfn = range->values[HMM_PFN_SPECIAL]; > - return -EFAULT; > + return is_zero_pfn(pte_pfn(pte)) ? 0 : -EFAULT; Any chance to just use a normal if here: if (!is_zero_pfn(pte_pfn(pte))) return -EFAULT; return 0;
2019 Sep 11
0
[PATCH 2/4] mm/hmm: allow snapshot of the special zero page
...file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hmm.c b/mm/hmm.c index 06041d4399ff..7217912bef13 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -532,7 +532,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, return -EBUSY; } else if (IS_ENABLED(CONFIG_ARCH_HAS_PTE_SPECIAL) && pte_special(pte)) { *pfn = range->values[HMM_PFN_SPECIAL]; - return -EFAULT; + return is_zero_pfn(pte_pfn(pte)) ? 0 : -EFAULT; } *pfn = hmm_device_entry_from_pfn(range, pte_pfn(pte)) | cpu_flags; -- 2.20.1
2008 May 23
0
[PATCH] x86/paravirt: add pte_flags to just get pte flags
...PAGE_PSE; } static inline int pte_global(pte_t pte) { - return pte_val(pte) & _PAGE_GLOBAL; + return pte_flags(pte) & _PAGE_GLOBAL; } static inline int pte_exec(pte_t pte) { - return !(pte_val(pte) & _PAGE_NX); + return !(pte_flags(pte) & _PAGE_NX); } static inline int pte_special(pte_t pte) @@ -304,7 +304,7 @@ return __pgprot(preservebits | addbits); } -#define pte_pgprot(x) __pgprot(pte_val(x) & ~PTE_MASK) +#define pte_pgprot(x) __pgprot(pte_flags(x) & ~PTE_MASK) #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask)
2008 May 23
0
[PATCH] x86/paravirt: add pte_flags to just get pte flags
...PAGE_PSE; } static inline int pte_global(pte_t pte) { - return pte_val(pte) & _PAGE_GLOBAL; + return pte_flags(pte) & _PAGE_GLOBAL; } static inline int pte_exec(pte_t pte) { - return !(pte_val(pte) & _PAGE_NX); + return !(pte_flags(pte) & _PAGE_NX); } static inline int pte_special(pte_t pte) @@ -304,7 +304,7 @@ return __pgprot(preservebits | addbits); } -#define pte_pgprot(x) __pgprot(pte_val(x) & ~PTE_MASK) +#define pte_pgprot(x) __pgprot(pte_flags(x) & ~PTE_MASK) #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask)
2019 Aug 06
0
[PATCH 04/15] mm: remove the pgmap field from struct hmm_vma_walk
...if (pte_devmap(pte)) { - hmm_vma_walk->pgmap = get_dev_pagemap(pte_pfn(pte), - hmm_vma_walk->pgmap); - if (unlikely(!hmm_vma_walk->pgmap)) + *pgmap = get_dev_pagemap(pte_pfn(pte), *pgmap); + if (unlikely(!*pgmap)) return -EBUSY; } else if (IS_ENABLED(CONFIG_ARCH_HAS_PTE_SPECIAL) && pte_special(pte)) { *pfn = range->values[HMM_PFN_SPECIAL]; @@ -604,10 +600,10 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, return 0; fault: - if (hmm_vma_walk->pgmap) { - put_dev_pagemap(hmm_vma_walk->pgmap); - hmm_vma_walk->pgmap = NU...
2024 Jan 22
2
[PATCH] mm: Remove double faults once write a device pfn
...> * Return: vm_fault_t value. > */ > vm_fault_t vmf_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, > - unsigned long pfn, pgprot_t pgprot) > + unsigned long pfn, pgprot_t pgprot, bool mkwrite) > { > /* > * Technically, architectures with pte_special can avoid all these > @@ -2246,7 +2247,7 @@ vm_fault_t vmf_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, > track_pfn_insert(vma, &pgprot, __pfn_to_pfn_t(pfn, PFN_DEV)); > > return insert_pfn(vma, addr, __pfn_to_pfn_t(pfn, PFN_DEV), pgprot, > - false);...
2024 Jan 24
1
[PATCH] mm: Remove double faults once write a device pfn
...pfn, pgprot_t pgprot) >> >>>>> + unsigned long pfn, pgprot_t pgprot, bool >> >>>>> + mkwrite) >> >>>>> { >> >>>>> /* >> >>>>> * Technically, architectures with pte_special can avoid all >> >>>>> these @@ -2246,7 +2247,7 @@ vm_fault_t >> vmf_insert_pfn_prot(struct >> >>>> vm_area_struct *vma, unsigned long addr, >> >>>>> track_pfn_insert(vma, &pgprot, __pfn_to_pfn_t(pfn, >> >>>&...
2024 Jan 23
2
[PATCH] mm: Remove double faults once write a device pfn
...truct vm_area_struct *vma, unsigned >> long addr, >>> - unsigned long pfn, pgprot_t pgprot) >>> + unsigned long pfn, pgprot_t pgprot, bool mkwrite) >>> { >>> /* >>> * Technically, architectures with pte_special can avoid all these >>> @@ -2246,7 +2247,7 @@ vm_fault_t vmf_insert_pfn_prot(struct >> vm_area_struct *vma, unsigned long addr, >>> track_pfn_insert(vma, &pgprot, __pfn_to_pfn_t(pfn, PFN_DEV)); >>> >>> return insert_pfn(vma, addr, __pfn_to_pfn...
2024 Jan 24
2
[PATCH] mm: Remove double faults once write a device pfn
...t;>> - unsigned long pfn, pgprot_t pgprot) >>>>> + unsigned long pfn, pgprot_t pgprot, bool >>>>> + mkwrite) >>>>> { >>>>> /* >>>>> * Technically, architectures with pte_special can avoid all >>>>> these @@ -2246,7 +2247,7 @@ vm_fault_t vmf_insert_pfn_prot(struct >>>> vm_area_struct *vma, unsigned long addr, >>>>> track_pfn_insert(vma, &pgprot, __pfn_to_pfn_t(pfn, PFN_DEV)); >>>>> >>>>>...
2020 Apr 13
2
Build regressions/improvements in v5.7-rc1
...e/asm/book3s/64/pgtable.h: error: redefinition of 'pte_pud': => 933:21 > + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_read': => 421:19 > + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_special': => 490:19 > + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_unmap': => 1022:20 > + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_update': => 353:29 > + /kisskb/src/arch/powe...
2020 Apr 13
2
Build regressions/improvements in v5.7-rc1
...e/asm/book3s/64/pgtable.h: error: redefinition of 'pte_pud': => 933:21 > + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_read': => 421:19 > + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_special': => 490:19 > + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_unmap': => 1022:20 > + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_update': => 353:29 > + /kisskb/src/arch/powe...
2013 Dec 04
5
[PATCH] arm: xen: foreign mapping PTEs are special.
These mappings are in fact special and require special handling in privcmd, which already exists. Failure to mark the PTE as special on arm64 causes all sorts of bad PTE fun. x86 already gets this correct. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Cc: xen-devel@lists.xenproject.org --- arch/arm/xen/enlighten.c |
2020 Apr 14
0
Build regressions/improvements in v5.7-rc1
...ok3s/64/pgtable.h: error: redefinition of 'pte_pud': => 933:21 >> + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_read': => 421:19 >> + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_special': => 490:19 >> + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_unmap': => 1022:20 >> + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_update': => 353:29 >> + /kisskb/s...
2020 Apr 14
1
Build regressions/improvements in v5.7-rc1
...table.h: error: redefinition of 'pte_pud': => 933:21 > >> + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_read': => 421:19 > >> + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_special': => 490:19 > >> + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_unmap': => 1022:20 > >> + /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h: error: redefinition of 'pte_update': => 353:29 > >&g...
2020 Apr 22
0
[PATCH hmm 5/5] mm/hmm: remove the customizable pfn format from hmm_range_fault
...orig_pfn, cpu_flags); + required_fault = + hmm_pte_need_fault(hmm_vma_walk, pfn_req_flags, cpu_flags); if (required_fault) goto fault; @@ -297,15 +287,15 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, * fall through and treat it like a normal page. */ if (pte_special(pte) && !is_zero_pfn(pte_pfn(pte))) { - if (hmm_pte_need_fault(hmm_vma_walk, orig_pfn, 0)) { + if (hmm_pte_need_fault(hmm_vma_walk, pfn_req_flags, 0)) { pte_unmap(ptep); return -EFAULT; } - *pfn = range->values[HMM_PFN_ERROR]; + *hmm_pfn = HMM_PFN_ERROR; return 0; }...
2020 May 01
0
[PATCH hmm v2 5/5] mm/hmm: remove the customizable pfn format from hmm_range_fault
...orig_pfn, cpu_flags); + required_fault = + hmm_pte_need_fault(hmm_vma_walk, pfn_req_flags, cpu_flags); if (required_fault) goto fault; @@ -297,15 +287,15 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, * fall through and treat it like a normal page. */ if (pte_special(pte) && !is_zero_pfn(pte_pfn(pte))) { - if (hmm_pte_need_fault(hmm_vma_walk, orig_pfn, 0)) { + if (hmm_pte_need_fault(hmm_vma_walk, pfn_req_flags, 0)) { pte_unmap(ptep); return -EFAULT; } - *pfn = range->values[HMM_PFN_ERROR]; + *hmm_pfn = HMM_PFN_ERROR; return 0; }...
2020 Apr 22
1
[PATCH hmm 5/5] mm/hmm: remove the customizable pfn format from hmm_range_fault
...> + hmm_pte_need_fault(hmm_vma_walk, pfn_req_flags, cpu_flags); > if (required_fault) > goto fault; > > @@ -297,15 +287,15 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, > * fall through and treat it like a normal page. > */ > if (pte_special(pte) && !is_zero_pfn(pte_pfn(pte))) { > - if (hmm_pte_need_fault(hmm_vma_walk, orig_pfn, 0)) { > + if (hmm_pte_need_fault(hmm_vma_walk, pfn_req_flags, 0)) { > pte_unmap(ptep); > return -EFAULT; > } > - *pfn = range->values[HMM_PFN_ERROR]; > + *hmm_pfn...
2019 Sep 11
6
[PATCH 0/4] HMM tests and minor fixes
These changes are based on Jason's latest hmm branch. Patch 1 was previously posted here [1] but was dropped from the orginal series. Hopefully, the tests will reduce concerns about edge conditions. I'm sure more tests could be usefully added but I thought this was a good starting point. [1] https://lore.kernel.org/linux-mm/20190726005650.2566-6-rcampbell at nvidia.com/ Ralph Campbell
2020 Apr 22
11
[PATCH hmm 0/5] Adjust hmm_range_fault() API
From: Jason Gunthorpe <jgg at mellanox.com> The API is a bit complicated for the uses we actually have, and disucssions for simplifying have come up a number of times. This small series removes the customizable pfn format and simplifies the return code of hmm_range_fault() All the drivers are adjusted to process in the simplified format. I would appreciated tested-by's for the two
2019 Aug 06
24
hmm cleanups, v2
Hi Jérôme, Ben, Felix and Jason, below is a series against the hmm tree which cleans up various minor bits and allows HMM_MIRROR to be built on all architectures. Diffstat: 11 files changed, 94 insertions(+), 210 deletions(-) A git tree is also available at: git://git.infradead.org/users/hch/misc.git hmm-cleanups.2 Gitweb: