diff for duplicates of <1534282125.24160.9.camel@intel.com> diff --git a/a/content_digest b/N1/content_digest index 564019c..56947c4 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -30,7 +30,7 @@ Oleg Nesterov <oleg@redhat.com> Pavel Machek <pavel@ucw.cz> Ravi V. Shankar <ravi.v.shankar@intel.com> - " Vedvyas\0" + " Vedvyas Shanbhogue <vedvyas.shanbhogue@intel.com>\0" "\00:1\0" "b\0" "On Wed, 2018-07-11 at 11:06 +0200, Peter Zijlstra wrote:\n" @@ -97,4 +97,4 @@ "Thanks,\n" Yu-cheng -8c330aeeca8a6230ff9b35e8e2a372c20f9c1aac132e80efb4118cd4af726532 +5cca94dc06d314843dab76c5336bb16f3325f260b7dcb3e8e394b50ee1e060fd
diff --git a/a/1.txt b/N2/1.txt index e72ce4d..135e532 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -9,23 +9,23 @@ On Wed, 2018-07-11 at 11:06 +0200, Peter Zijlstra wrote: > > > + entry = pte_mkdirty(entry); > > > + > > > + entry = maybe_mkwrite(entry, vma); -> > > if (ptep_set_access_flags(vma, vmf->address, vmf->pte, +> > > A if (ptep_set_access_flags(vma, vmf->address, vmf->pte, > > > entry, 1)) -> > > update_mmu_cache(vma, vmf->address, vmf->pte); -> > > pte_unmap_unlock(vmf->pte, vmf->ptl); +> > > A update_mmu_cache(vma, vmf->address, vmf->pte); +> > > A pte_unmap_unlock(vmf->pte, vmf->ptl); > > > @@ -2526,7 +2532,11 @@ static int wp_page_copy(struct vm_fault > > > *vmf) -> > > } -> > > flush_cache_page(vma, vmf->address, +> > > A } +> > > A flush_cache_page(vma, vmf->address, > > > pte_pfn(vmf->orig_pte)); -> > > entry = mk_pte(new_page, vma->vm_page_prot); +> > > A entry = mk_pte(new_page, vma->vm_page_prot); > > > - entry = maybe_mkwrite(pte_mkdirty(entry), vma); > > > + if (is_shstk_mapping(vma->vm_flags)) > > > + entry = pte_mkdirty_shstk(entry); > > > + else > > > + entry = pte_mkdirty(entry); > > > + entry = maybe_mkwrite(entry, vma); -> > Do we want to lift this hunk of code and put it elsewhere? Maybe: +> > Do we want to lift this hunk of code and put it elsewhere?A A Maybe: > > > > entry = pte_set_vma_features(entry, vma); > > @@ -34,10 +34,10 @@ On Wed, 2018-07-11 at 11:06 +0200, Peter Zijlstra wrote: > > pte_t pte_set_vma_features(pte_t entry, struct vm_area_struct) > > { > > /* -> > * Shadow stack PTEs are always dirty and always -> > * writable. They have a different encoding for -> > * this than normal PTEs, though. -> > */ +> > A * Shadow stack PTEs are always dirty and always +> > A * writable.A A They have a different encoding for +> > A * this than normal PTEs, though. +> > A */ > > if (is_shstk_mapping(vma->vm_flags)) > > entry = pte_mkdirty_shstk(entry); > > else @@ -54,7 +54,7 @@ On Wed, 2018-07-11 at 11:06 +0200, Peter Zijlstra wrote: > code? We use is_shstk_mapping() only to determine PAGE_DIRTY_SW or -PAGE_DIRTY_HW should be set in a PTE. One way to remove this shadow +PAGE_DIRTY_HW should be set in a PTE. A One way to remove this shadow stack code from generic code is changing pte_mkdirty(pte) to pte_mkdirty(pte, vma), and in the arch code we handle shadow stack. Is this acceptable? diff --git a/a/content_digest b/N2/content_digest index 564019c..7e5a14e 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -30,7 +30,7 @@ Oleg Nesterov <oleg@redhat.com> Pavel Machek <pavel@ucw.cz> Ravi V. Shankar <ravi.v.shankar@intel.com> - " Vedvyas\0" + " Vedvyas Shanbhogue <vedvyas.shanbhogue@intel.com>\0" "\00:1\0" "b\0" "On Wed, 2018-07-11 at 11:06 +0200, Peter Zijlstra wrote:\n" @@ -44,23 +44,23 @@ "> > > +\t\tentry = pte_mkdirty(entry);\n" "> > > +\n" "> > > +\tentry = maybe_mkwrite(entry, vma);\n" - "> > > \302\240\tif (ptep_set_access_flags(vma, vmf->address, vmf->pte,\n" + "> > > A \tif (ptep_set_access_flags(vma, vmf->address, vmf->pte,\n" "> > > entry, 1))\n" - "> > > \302\240\t\tupdate_mmu_cache(vma, vmf->address, vmf->pte);\n" - "> > > \302\240\tpte_unmap_unlock(vmf->pte, vmf->ptl);\n" + "> > > A \t\tupdate_mmu_cache(vma, vmf->address, vmf->pte);\n" + "> > > A \tpte_unmap_unlock(vmf->pte, vmf->ptl);\n" "> > > @@ -2526,7 +2532,11 @@ static int wp_page_copy(struct vm_fault\n" "> > > *vmf)\n" - "> > > \302\240\t\t}\n" - "> > > \302\240\t\tflush_cache_page(vma, vmf->address,\n" + "> > > A \t\t}\n" + "> > > A \t\tflush_cache_page(vma, vmf->address,\n" "> > > pte_pfn(vmf->orig_pte));\n" - "> > > \302\240\t\tentry = mk_pte(new_page, vma->vm_page_prot);\n" + "> > > A \t\tentry = mk_pte(new_page, vma->vm_page_prot);\n" "> > > -\t\tentry = maybe_mkwrite(pte_mkdirty(entry), vma);\n" "> > > +\t\tif (is_shstk_mapping(vma->vm_flags))\n" "> > > +\t\t\tentry = pte_mkdirty_shstk(entry);\n" "> > > +\t\telse\n" "> > > +\t\t\tentry = pte_mkdirty(entry);\n" "> > > +\t\tentry = maybe_mkwrite(entry, vma);\n" - "> > Do we want to lift this hunk of code and put it elsewhere?\302\240\302\240Maybe:\n" + "> > Do we want to lift this hunk of code and put it elsewhere?A A Maybe:\n" "> > \n" "> > \tentry = pte_set_vma_features(entry, vma);\n" "> > \n" @@ -69,10 +69,10 @@ "> > pte_t pte_set_vma_features(pte_t entry, struct vm_area_struct)\n" "> > {\n" "> > \t\t/*\n" - "> > \t\t\302\240* Shadow stack PTEs are always dirty and always\n" - "> > \t\t\302\240* writable.\302\240\302\240They have a different encoding for\n" - "> > \t\t\302\240* this than normal PTEs, though.\n" - "> > \t\t\302\240*/\n" + "> > \t\tA * Shadow stack PTEs are always dirty and always\n" + "> > \t\tA * writable.A A They have a different encoding for\n" + "> > \t\tA * this than normal PTEs, though.\n" + "> > \t\tA */\n" "> > \t\tif (is_shstk_mapping(vma->vm_flags))\n" "> > \t\t\tentry = pte_mkdirty_shstk(entry);\n" "> > \t\telse\n" @@ -89,7 +89,7 @@ "> code?\n" "\n" "We use is_shstk_mapping() only to determine PAGE_DIRTY_SW or\n" - "PAGE_DIRTY_HW should be set in a PTE. \302\240One way to remove this shadow\n" + "PAGE_DIRTY_HW should be set in a PTE. A One way to remove this shadow\n" "stack code from generic code is changing pte_mkdirty(pte) to\n" "pte_mkdirty(pte, vma), and in the arch code we handle shadow stack.\n" "Is this acceptable?\n" @@ -97,4 +97,4 @@ "Thanks,\n" Yu-cheng -8c330aeeca8a6230ff9b35e8e2a372c20f9c1aac132e80efb4118cd4af726532 +24d2d961ffabedced414e41f8f5219f9a759d97c701f6f2bd85ad600c56949ea
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.