Mailing List Archive

[PATCH 1 of 2] xen/x86: make __direct_remap_pfn_range()'s return value meaningful
arch/x86/mm/ioremap-xen.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)


This change fixes the xc_map_foreign_bulk interface, which would
otherwise cause SIGBUS when pages are gone because -ENOENT is not
returned as expected by the IOCTL_PRIVCMD_MMAPBATCH_V2 ioctl.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

diff -r 164cbc688ec7 -r df9e25a0189b arch/x86/mm/ioremap-xen.c
--- a/arch/x86/mm/ioremap-xen.c
+++ b/arch/x86/mm/ioremap-xen.c
@@ -48,7 +48,7 @@ static int __direct_remap_pfn_range(stru
pgprot_t prot,
domid_t domid)
{
- int rc;
+ int rc = 0;
unsigned long i, start_address;
mmu_update_t *u, *v, *w;

@@ -68,8 +68,8 @@ static int __direct_remap_pfn_range(stru
direct_remap_area_pte_fn, &w);
if (rc)
goto out;
- rc = -EFAULT;
- if (HYPERVISOR_mmu_update(u, v - u, NULL, domid) < 0)
+ rc = HYPERVISOR_mmu_update(u, v - u, NULL, domid);
+ if (rc < 0)
goto out;
v = w = u;
start_address = address;
@@ -94,13 +94,9 @@ static int __direct_remap_pfn_range(stru
direct_remap_area_pte_fn, &w);
if (rc)
goto out;
- rc = -EFAULT;
- if (unlikely(HYPERVISOR_mmu_update(u, v - u, NULL, domid) < 0))
- goto out;
+ rc = HYPERVISOR_mmu_update(u, v - u, NULL, domid);
}

- rc = 0;
-
out:
flush_tlb_all();


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: [PATCH 1 of 2] xen/x86: make __direct_remap_pfn_range()'s return value meaningful [ In reply to ]
>>> On 01.12.11 at 21:51, Andres Lagar-Cavilla <andres@lagarcavilla.org> wrote:
> arch/x86/mm/ioremap-xen.c | 12 ++++--------
> 1 files changed, 4 insertions(+), 8 deletions(-)
>
>
> This change fixes the xc_map_foreign_bulk interface, which would
> otherwise cause SIGBUS when pages are gone because -ENOENT is not
> returned as expected by the IOCTL_PRIVCMD_MMAPBATCH_V2 ioctl.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>

You lost authorship here.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: [PATCH 1 of 2] xen/x86: make __direct_remap_pfn_range()'s return value meaningful [ In reply to ]
> wrote:
>> arch/x86/mm/ioremap-xen.c | 12 ++++--------
>> 1 files changed, 4 insertions(+), 8 deletions(-)
>>
>>
>> This change fixes the xc_map_foreign_bulk interface, which would
>> otherwise cause SIGBUS when pages are gone because -ENOENT is not
>> returned as expected by the IOCTL_PRIVCMD_MMAPBATCH_V2 ioctl.
>>
>> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>
> You lost authorship here.
I used this:
http://xenbits.xen.org/hg/linux-2.6.18-xen.hg/rev/0051d294bb60
Andres
>
> Jan
>
>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: [PATCH 1 of 2] xen/x86: make __direct_remap_pfn_range()'s return value meaningful [ In reply to ]
>>> On 02.12.11 at 16:31, "Andres Lagar-Cavilla" <andres@lagarcavilla.org> wrote:
>> wrote:
>>> arch/x86/mm/ioremap-xen.c | 12 ++++--------
>>> 1 files changed, 4 insertions(+), 8 deletions(-)
>>>
>>>
>>> This change fixes the xc_map_foreign_bulk interface, which would
>>> otherwise cause SIGBUS when pages are gone because -ENOENT is not
>>> returned as expected by the IOCTL_PRIVCMD_MMAPBATCH_V2 ioctl.
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>>
>> You lost authorship here.
> I used this:
> http://xenbits.xen.org/hg/linux-2.6.18-xen.hg/rev/0051d294bb60

And you dropped the "From: Olaf Hering <ohering@novell.com>" line.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: [PATCH 1 of 2] xen/x86: make __direct_remap_pfn_range()'s return value meaningful [ In reply to ]
>>>> On 02.12.11 at 16:31, "Andres Lagar-Cavilla" <andres@lagarcavilla.org>
>>>> wrote:
>>> >>> On 01.12.11 at 21:51, Andres Lagar-Cavilla
>>> <andres@lagarcavilla.org>
>>> wrote:
>>>> arch/x86/mm/ioremap-xen.c | 12 ++++--------
>>>> 1 files changed, 4 insertions(+), 8 deletions(-)
>>>>
>>>>
>>>> This change fixes the xc_map_foreign_bulk interface, which would
>>>> otherwise cause SIGBUS when pages are gone because -ENOENT is not
>>>> returned as expected by the IOCTL_PRIVCMD_MMAPBATCH_V2 ioctl.
>>>>
>>>> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>>>
>>> You lost authorship here.
>> I used this:
>> http://xenbits.xen.org/hg/linux-2.6.18-xen.hg/rev/0051d294bb60
>
> And you dropped the "From: Olaf Hering <ohering@novell.com>" line.
Righto ... very sorry. I can resend ... if this gets traction.
Andres
>
> Jan
>
>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel