lkml.org 
[lkml]   [2019]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/4] xen-pcifront: Align address of flags to size of unsigned long
On Tue, Nov 26, 2019 at 11:02:13AM +0100, Jürgen Groß wrote:
> On 25.11.19 20:43, Fenghua Yu wrote:
> > The address of "flags" is passed to atomic bitops which require the
> > address is aligned to size of unsigned long.
> >
> > Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
> > ---
> > include/xen/interface/io/pciif.h | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/xen/interface/io/pciif.h b/include/xen/interface/io/pciif.h
> > index d9922ae36eb5..639d5fb484a3 100644
> > --- a/include/xen/interface/io/pciif.h
> > +++ b/include/xen/interface/io/pciif.h
> > @@ -103,8 +103,11 @@ struct xen_pcie_aer_op {
> > uint32_t devfn;
> > };
> > struct xen_pci_sharedinfo {
> > - /* flags - XEN_PCIF_* */
> > - uint32_t flags;
> > + /* flags - XEN_PCIF_*. Force alignment for atomic bit operations. */
> > + union {
> > + uint32_t flags;
> > + unsigned long flags_alignment;
> > + };
> > struct xen_pci_op op;
> > struct xen_pcie_aer_op aer_op;
> > };
> >
>
> NAK.
>
> This is an interface definition for communication between Xen dom0 and
> guests via shared memory. It can't be changed.

Bother. There doesn't seem to be anything else in the xen_pci_sharedinfo
structure (or any of its sub-components) that would force the whole thing
to be any more strictly aligned than uint32_t

Oh ... but it looks like this is the only allocation:


pdev->sh_info =
(struct xen_pci_sharedinfo *)__get_free_page(GFP_KERNEL);

so "flags" is page aligned.

Fenghua: drop this patch, it isn't needed.

-Tony

\
 
 \ /
  Last update: 2019-12-02 19:29    [W:0.075 / U:8.412 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site