[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 2/2] amd-iommu: replace occurrences of u<N> with uint<N>_t...



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: 26 November 2018 11:49
> To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
> Cc: Brian Woods <brian.woods@xxxxxxx>; Suravee Suthikulpanit
> <suravee.suthikulpanit@xxxxxxx>; xen-devel <xen-
> devel@xxxxxxxxxxxxxxxxxxxx>
> Subject: Re: [Xen-devel] [PATCH v2 2/2] amd-iommu: replace occurrences of
> u<N> with uint<N>_t...
> 
> >>> On 26.11.18 at 12:32, <paul.durrant@xxxxxxxxxx> wrote:
> > @@ -306,7 +307,8 @@ void iommu_dte_set_guest_cr3(u32 *dte, u16 dom_id,
> u64 gcr3,
> >  uint64_t amd_iommu_get_address_from_pte(void *pte)
> >  {
> >      uint32_t *entry = pte;
> > -    uint64_t addr_lo, addr_hi, ptr;
> > +    uint32_t addr_lo, addr_hi;
> > +    uint64_t ptr;
> >
> >      addr_lo = get_field_from_reg_u32(entry[0],
> >                                       IOMMU_PTE_ADDR_LOW_MASK,
> > @@ -316,29 +318,30 @@ uint64_t amd_iommu_get_address_from_pte(void *pte)
> >                                       IOMMU_PTE_ADDR_HIGH_MASK,
> >                                       IOMMU_PTE_ADDR_HIGH_SHIFT);
> >
> > -    ptr = (addr_hi << 32) | (addr_lo << PAGE_SHIFT);
> > +    ptr = ((uint64_t)addr_hi << 32) |
> > +          ((uint64_t)addr_lo << PAGE_SHIFT);
> >      return ptr;
> >  }
> 
> This is actually an increase in casts. I assume you've done this for
> consistency, but it would have been nice if the description said so.

Yes, it was indeed for consistency. Still a net reduction overall but, yes, the 
comment could have been clearer.

> Anyway,
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> 

Thanks,

  Paul

> Jan
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.