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: <47ED5542.2060503@goop.org>
Date:	Fri, 28 Mar 2008 13:29:54 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Isaku Yamahata <yamahata@...inux.co.jp>
CC:	chrisw@...s-sol.org, sct@...hat.com,
	virtualization@...ts.linux-foundation.org,
	linux-kernel@...r.kernel.org, xen-ia64-devel@...ts.xensource.com,
	eddie.dong@...el.com
Subject: Re: [PATCH 08/12] xen: add resend_irq_on_evtchn() definition into
 events.c.

Isaku Yamahata wrote:
> Define resend_irq_on_evtchn() which ia64/xen uses.
> Although it isn't used by current x86/xen code, it's arch generic
> so that put it into common code.
> make ipi_to_irq[] visible removing static because
> ia64/xen needs to access the variable from ia64 specific code
>   

What kind of access?  Would it be better to add some accessor functions?

If nothing else, it needs to be prefixed with xen_ if it goes non-static.

(As should resend_irq_on_evtchn(), but I'm less concerned about a name 
collision.)

    J

> Signed-off-by: Isaku Yamahata <yamahata@...inux.co.jp>
> ---
>  drivers/xen/events.c |   18 +++++++++++++++++-
>  include/xen/events.h |    1 +
>  2 files changed, 18 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index 2396b44..1c2c193 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -48,7 +48,7 @@ static DEFINE_SPINLOCK(irq_mapping_update_lock);
>  static DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]) = {[0 ... NR_VIRQS-1] = -1};
>  
>  /* IRQ <-> IPI mapping */
> -static DEFINE_PER_CPU(int, ipi_to_irq[XEN_NR_IPIS]) = {[0 ... XEN_NR_IPIS-1] = -1};
> +DEFINE_PER_CPU(int, ipi_to_irq[XEN_NR_IPIS]) = {[0 ... XEN_NR_IPIS-1] = -1};
>  
>  /* Packed IRQ information: binding type, sub-type index, and event channel. */
>  struct packed_irq
> @@ -586,6 +586,22 @@ static void set_affinity_irq(unsigned irq, cpumask_t dest)
>  	rebind_irq_to_cpu(irq, tcpu);
>  }
>  
> +int resend_irq_on_evtchn(unsigned int irq)
> +{
> +	int masked, evtchn = evtchn_from_irq(irq);
> +	struct shared_info *s = HYPERVISOR_shared_info;
> +
> +	if (!VALID_EVTCHN(evtchn))
> +		return 1;
> +
> +	masked = sync_test_and_set_bit(evtchn, s->evtchn_mask);
> +	sync_set_bit(evtchn, s->evtchn_pending);
> +	if (!masked)
> +		unmask_evtchn(evtchn);
> +
> +	return 1;
> +}
> +
>  static void enable_dynirq(unsigned int irq)
>  {
>  	int evtchn = evtchn_from_irq(irq);
> diff --git a/include/xen/events.h b/include/xen/events.h
> index 2bde54d..574cfa4 100644
> --- a/include/xen/events.h
> +++ b/include/xen/events.h
> @@ -37,6 +37,7 @@ int bind_ipi_to_irqhandler(enum ipi_vector ipi,
>  void unbind_from_irqhandler(unsigned int irq, void *dev_id);
>  
>  void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector);
> +int resend_irq_on_evtchn(unsigned int irq);
>  
>  static inline void notify_remote_via_evtchn(int port)
>  {
>   

--
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