lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87lh9vv9pv.fsf@vitty.brq.redhat.com>
Date:	Wed, 18 Nov 2015 12:16:28 +0100
From:	Vitaly Kuznetsov <vkuznets@...hat.com>
To:	Boris Ostrovsky <boris.ostrovsky@...cle.com>
Cc:	konrad.wilk@...cle.com, david.vrabel@...rix.com, jgross@...e.com,
	tglx@...utronix.de, linux-kernel@...r.kernel.org,
	xen-devel@...ts.xen.org
Subject: Re: [Xen-devel] [PATCH] xen/events: Always allocate legacy interrupts on PV guests

Boris Ostrovsky <boris.ostrovsky@...cle.com> writes:

> After commit 8c058b0b9c34 ("x86/irq: Probe for PIC presence before
> allocating descs for legacy IRQs") early_irq_init() will no longer
> preallocate descriptors for legacy interrupts if PIT does not
> exist.

PIC?

>
> Therefore we need to allocate those descriptors for PV guests
> ourselves.
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@...cle.com>
> Suggested-by: Thomas Gleixner <tglx@...utronix.de>
> ---
>  drivers/xen/events/events_base.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
> index 849500e..a2bb333 100644
> --- a/drivers/xen/events/events_base.c
> +++ b/drivers/xen/events/events_base.c
> @@ -419,8 +419,8 @@ static int __must_check xen_allocate_irq_gsi(unsigned gsi)
>  	if (xen_pv_domain() && !xen_initial_domain())
>  		return xen_allocate_irq_dynamic();
>
> -	/* Legacy IRQ descriptors are already allocated by the arch. */
> -	if (gsi < NR_IRQS_LEGACY)
> +	/* On HVM legacy IRQ descriptors are already allocated by the arch. */
> +	if (xen_hvm_domain() && gsi < NR_IRQS_LEGACY)
>  		irq = gsi;

Wouldn't it be better to write it as
 if (gsi < nr_legacy_irqs()) ?

I think it's possible to have PIC-less HVM guests in future (btw, what
about HVMlite?). I see nr_legacy_irqs() is x86-only but it can easily be
defined to NR_IRQS_LEGACY on other arches.

>  	else
>  		irq = irq_alloc_desc_at(gsi, -1);
> @@ -445,8 +445,8 @@ static void xen_free_irq(unsigned irq)
>
>  	kfree(info);
>
> -	/* Legacy IRQ descriptors are managed by the arch. */
> -	if (irq < NR_IRQS_LEGACY)
> +	/* On HVM legacy IRQ descriptors are managed by the arch. */
> +	if (xen_hvm_domain() && irq < NR_IRQS_LEGACY)
>  		return;
>
>  	irq_free_desc(irq);

-- 
  Vitaly
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ