All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"Jaggi, Manish" <Manish.Jaggi@caviumnetworks.com>
Cc: "Prasun.kapoor@cavium.com" <Prasun.kapoor@cavium.com>,
	"Kumar, Vijaya" <Vijaya.Kumar@caviumnetworks.com>,
	Julien Grall <julien.grall@linaro.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Xen Devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 2/2] xen/arm: Make HAS_PCI compilable on ARM by adding place-holder code
Date: Tue, 14 Apr 2015 14:27:12 +0100	[thread overview]
Message-ID: <552D15B0.70901@citrix.com> (raw)
In-Reply-To: <552CECDD.5040901@citrix.com>

On 14/04/15 11:33, Julien Grall wrote:
> On 14/04/15 10:28, Stefano Stabellini wrote:
>> On Tue, 14 Apr 2015, Jaggi, Manish wrote:
>>>> diff --git a/xen/include/asm-arm/pci.h b/xen/include/asm-arm/pci.h
>>>> index de13359..b8ec882 100644
>>>> --- a/xen/include/asm-arm/pci.h
>>>> +++ b/xen/include/asm-arm/pci.h
>>>> @@ -1,7 +1,8 @@
>>>> -#ifndef __X86_PCI_H__
>>>> -#define __X86_PCI_H__
>>>> +#ifndef __ARM_PCI_H__
>>>> +#define __ARM_PCI_H__
>>>>
>>>>  struct arch_pci_dev {
>>>> +    void *dev;
>>>
>>> void * is error-prone. Why can't you use the use the real structure?
>>>
>>> [manish]Will change it.  I believe dev_archdata structure has also a void *  (in asm-arm/device.h). So all void * are error prone in xen ?
>>>
>>
>> As you know void* works around the type system, so it prevents the
>> compiler from making many type safety checks. We should try to avoid
>> them if we can.
> 
> In this case, the pointer add more management (allocation...).
> 
> As for the device tree solution, the field should be a struct device.
> 
>> I think that you are right, the void *iommu in dev_archdata should
>> actually be struct arm_smmu_xen_device *iommu.
> 
> I agree that void* should be void in most of the case when we know the
> underlaying type. Although there is some place where the number of type
> of unknown because it could be used to store driver specific case.
> 
> This is actually the case of this field. It contains private data for
> IOMMU driver. When a new driver will be implemented, it will likely use
> a different structure.
> 
> Furthermore, the SMMU drivers is self contained in a file, using struct
> arm_smmu_xen_device* would require to export/define some part of the
> driver in an header.

A similar example would be the scheduler coder (see sched_data in
include/xen/sched-if.h). We don't want to expose the underlying
structure out of the file.

Regards,


-- 
Julien Grall

  reply	other threads:[~2015-04-14 13:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13  7:48 [PATCH 2/2] xen/arm: Make HAS_PCI compilable on ARM by adding place-holder code Manish Jaggi
2015-04-13 10:14 ` Stefano Stabellini
2015-04-13 10:31   ` Manish Jaggi
2015-04-13 10:42 ` Julien Grall
2015-04-14  1:28   ` Jaggi, Manish
2015-04-14  9:28     ` Stefano Stabellini
2015-04-14 10:33       ` Julien Grall
2015-04-14 13:27         ` Julien Grall [this message]
2015-04-16 15:36 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=552D15B0.70901@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Manish.Jaggi@caviumnetworks.com \
    --cc=Prasun.kapoor@cavium.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.