diff for duplicates of <1518431633.2959.9.camel@kernel.crashing.org> diff --git a/a/1.txt b/N1/1.txt index b01e68d..47992eb 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -17,16 +17,16 @@ On Mon, 2018-02-12 at 10:57 +0100, Paolo Bonzini wrote: > Yeah, hva_to_pfn has all those arguments to tweak its behavior, however > you can treat it as essentially get_user_pages_unlocked: > -> - if async=false && atomic=false you can ignore hva_to_pfn_fast. +> - if async==false && atomic==false you can ignore hva_to_pfn_fast. > (hva_to_pfn_fast uses __get_user_pages_fast) -Do you mean async = NULL && atomic = false ? IE. async is a +Do you mean async == NULL && atomic == false ? IE. async is a pointer... > - hva_to_pfn_slow then is essentially get_user_pages_unlocked. > Optionally it's followed by __get_user_pages_fast to get a writable > mapping if the caller would like it but does not require it, but you can -> ignore this if you pass writable=NULL. +> ignore this if you pass writable==NULL. > > PPC uses get_user_pages_fast; x86 cannot use it directly because we need > FOLL_HWPOISON and get_user_pages_fast does not support it. @@ -101,7 +101,7 @@ Ben. > return false; > > npages = __get_user_pages_fast(addr, 1, 1, page); -> - if (npages = 1) { +> - if (npages == 1) { > - *pfn = page_to_pfn(page[0]); > + if (npages < 0) > + return ERR_PTR(npages); @@ -142,7 +142,7 @@ Ben. > - struct page *wpage[1]; > - > - npages = __get_user_pages_fast(addr, 1, 1, wpage); -> - if (npages = 1) { +> - if (npages == 1) { > - *writable = true; > + struct page *wpage; > + wpage = __hva_to_page_fast(addr, write_fault, writable); @@ -187,16 +187,16 @@ Ben. > return KVM_PFN_ERR_FAULT; > > - npages = hva_to_pfn_slow(addr, async, write_fault, writable, &pfn); -> - if (npages = 1) +> - if (npages == 1) > - return pfn; > + page = hva_to_page_unlocked(addr, async, write_fault, writable); > + if (!IS_ERR(page)) > + goto got_page; > > down_read(¤t->mm->mmap_sem); -> - if (npages = -EHWPOISON || +> - if (npages == -EHWPOISON || > + /* FIXME, is check_user_page_hwpoison still needed? */ -> + if (PTR_ERR(page) = -EHWPOISON || +> + if (PTR_ERR(page) == -EHWPOISON || > (!async && check_user_page_hwpoison(addr))) { > - pfn = KVM_PFN_ERR_HWPOISON; > - goto exit; @@ -208,7 +208,7 @@ Ben. > + *p_page = NULL; > vma = find_vma_intersection(current->mm, addr, addr + 1); > -> if (vma = NULL) +> if (vma == NULL) > @@ -1529,9 +1523,13 @@ static kvm_pfn_t hva_to_pfn(unsigned long addr, bool atomic, bool *async, > *async = true; > pfn = KVM_PFN_ERR_FAULT; diff --git a/a/content_digest b/N1/content_digest index 0d7e672..1cd43fd 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -6,7 +6,7 @@ "ref\0f0d6d84c-1a59-a38f-1b38-eec798236378@redhat.com\0" "From\0Benjamin Herrenschmidt <benh@kernel.crashing.org>\0" "Subject\0Re: [RFC PATCH] KVM: PPC: Book3S HV: add support for page faults in VM_IO|VM_PFNMAP vmas\0" - "Date\0Mon, 12 Feb 2018 10:33:53 +0000\0" + "Date\0Mon, 12 Feb 2018 21:33:53 +1100\0" "To\0Paolo Bonzini <pbonzini@redhat.com>" " C\303\251dric Le Goater <clg@kaod.org>" kvm-ppc@vger.kernel.org @@ -33,16 +33,16 @@ "> Yeah, hva_to_pfn has all those arguments to tweak its behavior, however \n" "> you can treat it as essentially get_user_pages_unlocked:\n" "> \n" - "> - if async=false && atomic=false you can ignore hva_to_pfn_fast. \n" + "> - if async==false && atomic==false you can ignore hva_to_pfn_fast. \n" "> (hva_to_pfn_fast uses __get_user_pages_fast)\n" "\n" - "Do you mean async = NULL && atomic = false ? IE. async is a\n" + "Do you mean async == NULL && atomic == false ? IE. async is a\n" "pointer...\n" "\n" "> - hva_to_pfn_slow then is essentially get_user_pages_unlocked. \n" "> Optionally it's followed by __get_user_pages_fast to get a writable \n" "> mapping if the caller would like it but does not require it, but you can \n" - "> ignore this if you pass writable=NULL.\n" + "> ignore this if you pass writable==NULL.\n" ">\n" "> PPC uses get_user_pages_fast; x86 cannot use it directly because we need \n" "> FOLL_HWPOISON and get_user_pages_fast does not support it.\n" @@ -117,7 +117,7 @@ "> \t\treturn false;\n" "> \n" "> \tnpages = __get_user_pages_fast(addr, 1, 1, page);\n" - "> -\tif (npages = 1) {\n" + "> -\tif (npages == 1) {\n" "> -\t\t*pfn = page_to_pfn(page[0]);\n" "> +\tif (npages < 0)\n" "> +\t\treturn ERR_PTR(npages);\n" @@ -158,7 +158,7 @@ "> -\t\tstruct page *wpage[1];\n" "> -\n" "> -\t\tnpages = __get_user_pages_fast(addr, 1, 1, wpage);\n" - "> -\t\tif (npages = 1) {\n" + "> -\t\tif (npages == 1) {\n" "> -\t\t\t*writable = true;\n" "> +\t\tstruct page *wpage;\n" "> +\t\twpage = __hva_to_page_fast(addr, write_fault, writable);\n" @@ -203,16 +203,16 @@ "> \t\treturn KVM_PFN_ERR_FAULT;\n" "> \n" "> -\tnpages = hva_to_pfn_slow(addr, async, write_fault, writable, &pfn);\n" - "> -\tif (npages = 1)\n" + "> -\tif (npages == 1)\n" "> -\t\treturn pfn;\n" "> +\tpage = hva_to_page_unlocked(addr, async, write_fault, writable);\n" "> +\tif (!IS_ERR(page))\n" "> +\t\tgoto got_page;\n" "> \n" "> \tdown_read(¤t->mm->mmap_sem);\n" - "> -\tif (npages = -EHWPOISON ||\n" + "> -\tif (npages == -EHWPOISON ||\n" "> +\t/* FIXME, is check_user_page_hwpoison still needed? */\n" - "> +\tif (PTR_ERR(page) = -EHWPOISON ||\n" + "> +\tif (PTR_ERR(page) == -EHWPOISON ||\n" "> \t (!async && check_user_page_hwpoison(addr))) {\n" "> -\t\tpfn = KVM_PFN_ERR_HWPOISON;\n" "> -\t\tgoto exit;\n" @@ -224,7 +224,7 @@ "> +\t*p_page = NULL;\n" "> \tvma = find_vma_intersection(current->mm, addr, addr + 1);\n" "> \n" - "> \tif (vma = NULL)\n" + "> \tif (vma == NULL)\n" "> @@ -1529,9 +1523,13 @@ static kvm_pfn_t hva_to_pfn(unsigned long addr, bool atomic, bool *async,\n" "> \t\t\t*async = true;\n" "> \t\tpfn = KVM_PFN_ERR_FAULT;\n" @@ -250,4 +250,4 @@ "> EXPORT_SYMBOL_GPL(__gfn_to_pfn_memslot);\n" > -485bb53d0797fdf415706a656f03c858d07b9be6c646e73b9228ac375d5f3695 +6115e996dcbf8bb11ff8b5b22f8d6164ae622151b126ab23067f8ed9a8ab8598
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.