|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [v8][PATCH 02/17] introduce XEN_DOMCTL_set_rdm
On 2014/12/8 16:43, Jan Beulich wrote: On 08.12.14 at 07:06, <tiejun.chen@xxxxxxxxx> wrote:On 2014/12/4 23:33, Jan Beulich wrote:On 01.12.14 at 10:24, <tiejun.chen@xxxxxxxxx> wrote:Looks this could be fine, d->arch.hvm_domain.pci_force = xdsr->flags & PCI_DEV_RDM_CHECK;Which is correct only because PCI_DEV_RDM_CHECK happens to be 1. Such hidden dependencies shouldn't be introduced though, in particular to avoid others then cloning the code for a flag that's not 1. The canonical form (found in many places throughout the treei Right. Fixed.
In theory, we may have at most the number, domain(16bit) x bus(8bit) x device(5bit) x function(3bit), 2^16 x 2^8 x 2^5 x 2^3 = 0x1000000, so could we define a macro like this, #define PCI_DEVICES_NUM_UP 0x1000000 maintained count or a suitable estimate thereof doesn't matter. [snip] I really didn't necessarily mean individual comments - one for the whole group would suffice. Also I don't think pci_force is really the right name - all_pcidevs or some such would seem more suitable following the entire series. And finally, I'm generally advocating for avoiding redundant data items - I'm sure this "all" notion can be encoded reasonable with just the other two field (and a suitable checking macro). Yeah.
Are you saying this way?
#define PCI_DEVS_NUM_UP 0x1000000
#define ALL_PCI_DEVS (0x1 << 31)
#define is_all_pcidevs(d) ((d)->arch.hvm_domain.num_pcidevs & ALL_PCI_DEVS)
#define is_valid_pcidevs_num(d) \
((d)->arch.hvm_domain.num_pcidevs <= PCI_DEVS_NUM_UP)
/*
* num_pcidevs:
* bit31 indicates if all devices need to be checked/reserved
* Reserved Device Memory.
* bit30 ~ bit25 are reserved now.
* bit24 ~ bit0 represent actually how many pci devices we
* need to check/reserve Reserved Device Memory. They are
* valid just when bit31 is zero.
*
* pcidevs represent these pci device instances associated to
* bit42 ~ bit0.
*/
uint32_t num_pcidevs;
struct xen_guest_pcidev_info *pcidevs;
Thanks
Tiejun
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |