|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xsm_remove_from_physmap is (so far) only defined for X86 architecture, not for ARM
On Tue, 2013-01-15 at 11:52 +0000, Stefano Stabellini wrote:
> > @@ -100,7 +104,9 @@ static int domain_has_xen(struct domain *d, u32
> perms)
> >
> > static int get_irq_sid(int irq, u32 *sid, struct avc_audit_data
> *ad)
> > {
> > +#ifdef CONFIG_X86
> > struct irq_desc *desc = irq_to_desc(irq);
> > +#endif
> > if ( irq >= nr_irqs || irq < 0 )
> > return -EINVAL;
> > if ( irq < nr_static_irqs ) {
> > @@ -110,6 +116,7 @@ static int get_irq_sid(int irq, u32 *sid, struct
> avc_audit_data *ad)
> > }
> > return security_irq_sid(irq, sid);
> > }
> > +#ifdef CONFIG_X86
> > if ( desc->msi_desc ) {
> > struct pci_dev *dev = desc->msi_desc->dev;
> > u32 sbdf = (dev->seg << 16) | (dev->bus << 8) | dev->devfn;
> > @@ -119,6 +126,7 @@ static int get_irq_sid(int irq, u32 *sid, struct
> avc_audit_data *ad)
> > }
> > return security_device_sid(sbdf, sid);
> > }
> > +#endif
> > if (ad) {
> > AVC_AUDIT_DATA_INIT(ad, IRQ);
> > ad->irq = irq;
> > @@ -822,7 +830,9 @@ static int flask_map_domain_pirq (struct domain
> *d, int irq, void *data)
> > {
> > u32 sid, dsid;
> > int rc = -EPERM;
> > +#ifdef CONFIG_X86
> > struct msi_info *msi = data;
> > +#endif
> > struct avc_audit_data ad;
> >
> > rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
> > @@ -830,12 +840,17 @@ static int flask_map_domain_pirq (struct
> domain *d, int irq, void *data)
> > if ( rc )
> > return rc;
> >
> > - if ( irq >= nr_static_irqs && msi ) {
> > +#ifdef CONFIG_X86
> > + if ( irq >= nr_static_irqs && msi )
> > + {
> > u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) |
> msi->devfn;
> > AVC_AUDIT_DATA_INIT(&ad, DEV);
> > ad.device = machine_bdf;
> > rc = security_device_sid(machine_bdf, &sid);
> > - } else {
> > + }
> > + else
> > +#endif
> > + {
> > rc = get_irq_sid(irq, &sid, &ad);
> > }
> > if ( rc )
>
> this part is a bit ugly, can we refactor the msi checks into separate,
> arch specific, functions?
Yes that would be better. I'll give Daniel a chance to respond to the
rest before I respin with this change.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |