Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1550028 > unrolled thread

Re: [PATCH V2] Xen: ARM: Zero reserved fields of xatp before making hypervisor call

Started byStefano Stabellini <sstabellini@kernel.org>
First post2017-01-03 19:10 +0100
Last post2017-01-16 16:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH V2] Xen: ARM: Zero reserved fields of xatp before making  hypervisor call Stefano Stabellini <sstabellini@kernel.org> - 2017-01-03 19:10 +0100
    Re: [PATCH V2] Xen: ARM: Zero reserved fields of xatp before making  hypervisor call Julien Grall <julien.grall@arm.com> - 2017-01-16 16:10 +0100

#1550028 — Re: [PATCH V2] Xen: ARM: Zero reserved fields of xatp before making hypervisor call

FromStefano Stabellini <sstabellini@kernel.org>
Date2017-01-03 19:10 +0100
SubjectRe: [PATCH V2] Xen: ARM: Zero reserved fields of xatp before making hypervisor call
Message-ID<sVBH3-1F1-17@gated-at.bofh.it>
On Mon, 2 Jan 2017, Juergen Gross wrote:
> On 28/12/16 01:47, Jiandi An wrote:
> > Ensure all reserved fields of xatp are zero before making
> > hypervisor call to XEN in xen_map_device_mmio().
> > xenmem_add_to_physmap_one() in XEN fails the mapping request if
> > extra.res reserved field in xatp is not zero for XENMAPSPACE_dev_mmio
> > request.
> > 
> > Signed-off-by: Jiandi An <anjiandi@codeaurora.org>
> > ---
> > Changed zeroing xatp to a static initialization
> > of .domid and .space for xatp.
> > 
> >  drivers/xen/arm-device.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/xen/arm-device.c b/drivers/xen/arm-device.c
> > index 778acf8..85dd20e 100644
> > --- a/drivers/xen/arm-device.c
> > +++ b/drivers/xen/arm-device.c
> > @@ -58,9 +58,13 @@ static int xen_map_device_mmio(const struct resource *resources,
> >  	xen_pfn_t *gpfns;
> >  	xen_ulong_t *idxs;
> >  	int *errs;
> > -	struct xen_add_to_physmap_range xatp;
> >  
> >  	for (i = 0; i < count; i++) {
> > +		struct xen_add_to_physmap_range xatp = {
> > +			.domid = DOMID_SELF,
> > +			.space = XENMAPSPACE_dev_mmio
> > +		};
> > +
> 
> I still don't see the need to re-initialize the input parts of xatp
> on each loop iteration unless you can show the need for it (e.g. a
> buggy hypervisor version not conforming to the interface specification).
> 
> OTOH I don't feel really strong about it and let Stefano being the
> maintainer for the ARM parts decide.

I don't feel strongly about this either - I think this patch is good
enough. I'll apply to xentip.

[toc] | [next] | [standalone]


#1559819

FromJulien Grall <julien.grall@arm.com>
Date2017-01-16 16:10 +0100
Message-ID<t0h4Z-23f-7@gated-at.bofh.it>
In reply to#1550028
Hi Stefano,

On 03/01/17 18:03, Stefano Stabellini wrote:
> On Mon, 2 Jan 2017, Juergen Gross wrote:
>> On 28/12/16 01:47, Jiandi An wrote:
>>> Ensure all reserved fields of xatp are zero before making
>>> hypervisor call to XEN in xen_map_device_mmio().
>>> xenmem_add_to_physmap_one() in XEN fails the mapping request if
>>> extra.res reserved field in xatp is not zero for XENMAPSPACE_dev_mmio
>>> request.
>>>
>>> Signed-off-by: Jiandi An <anjiandi@codeaurora.org>
>>> ---
>>> Changed zeroing xatp to a static initialization
>>> of .domid and .space for xatp.
>>>
>>>  drivers/xen/arm-device.c | 8 +++++---
>>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/xen/arm-device.c b/drivers/xen/arm-device.c
>>> index 778acf8..85dd20e 100644
>>> --- a/drivers/xen/arm-device.c
>>> +++ b/drivers/xen/arm-device.c
>>> @@ -58,9 +58,13 @@ static int xen_map_device_mmio(const struct resource *resources,
>>>  	xen_pfn_t *gpfns;
>>>  	xen_ulong_t *idxs;
>>>  	int *errs;
>>> -	struct xen_add_to_physmap_range xatp;
>>>
>>>  	for (i = 0; i < count; i++) {
>>> +		struct xen_add_to_physmap_range xatp = {
>>> +			.domid = DOMID_SELF,
>>> +			.space = XENMAPSPACE_dev_mmio
>>> +		};
>>> +
>>
>> I still don't see the need to re-initialize the input parts of xatp
>> on each loop iteration unless you can show the need for it (e.g. a
>> buggy hypervisor version not conforming to the interface specification).
>>
>> OTOH I don't feel really strong about it and let Stefano being the
>> maintainer for the ARM parts decide.
>
> I don't feel strongly about this either - I think this patch is good
> enough. I'll apply to xentip.

I think this patch should be backported to stable trees because the 
issue could appear depending on the compiler.

Cheers,

-- 
Julien Grall

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web