[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 01/11] x86/HVM: avoid effectively open-coding xzalloc_flex_struct()
Drop hvm_irq_size(), which exists for just this purpose. There is a difference in generated code: xzalloc_bytes() forces SMP_CACHE_BYTES alignment. I think we not only don't need this here, but actually don't want it. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -642,7 +642,8 @@ int hvm_domain_initialise(struct domain d->arch.hvm.params = xzalloc_array(uint64_t, HVM_NR_PARAMS); d->arch.hvm.io_handler = xzalloc_array(struct hvm_io_handler, NR_IO_HANDLERS); - d->arch.hvm.irq = xzalloc_bytes(hvm_irq_size(nr_gsis)); + d->arch.hvm.irq = xzalloc_flex_struct(struct hvm_irq, + gsi_assert_count, nr_gsis); rc = -ENOMEM; if ( !d->arch.hvm.pl_time || !d->arch.hvm.irq || --- a/xen/include/asm-x86/hvm/irq.h +++ b/xen/include/asm-x86/hvm/irq.h @@ -98,7 +98,6 @@ struct hvm_irq { #define hvm_pci_intx_link(dev, intx) \ (((dev) + (intx)) & 3) #define hvm_domain_irq(d) ((d)->arch.hvm.irq) -#define hvm_irq_size(cnt) offsetof(struct hvm_irq, gsi_assert_count[cnt]) #define hvm_isa_irq_to_gsi(isa_irq) ((isa_irq) ? : 2)
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |