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: <20120826185233.GJ3690@breakpoint.cc>
Date:	Sun, 26 Aug 2012 20:52:33 +0200
From:	Sebastian Andrzej Siewior <sebastian@...akpoint.cc>
To:	Joerg Roedel <joerg.roedel@....com>
Cc:	x86@...nel.org, linux-kernel@...r.kernel.org, joro@...tes.org,
	Suresh Siddha <suresh.b.siddha@...el.com>,
	Yinghai Lu <yinghai@...nel.org>
Subject: Re: [PATCH 18/19] x86, io_apic: Introduce eoi_ioapic_pin call-back

On Mon, Aug 20, 2012 at 03:56:04PM +0200, Joerg Roedel wrote:
> diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> index aac3f62..d4db390 100644
> --- a/arch/x86/kernel/apic/io_apic.c
> +++ b/arch/x86/kernel/apic/io_apic.c
> @@ -557,19 +557,10 @@ static void unmask_ioapic_irq(struct irq_data *data)
>   * Otherwise, we simulate the EOI message manually by changing the trigger
>   * mode to edge and then back to level, with RTE being masked during this.
>   */
> -static void __eoi_ioapic_pin(int apic, int pin, int vector, struct irq_cfg *cfg)
> +void native_eoi_ioapic_pin(int apic, int pin, int vector)
>  {
>  	if (mpc_ioapic_ver(apic) >= 0x20) {
> -		/*
> -		 * Intr-remapping uses pin number as the virtual vector
> -		 * in the RTE. Actual vector is programmed in
> -		 * intr-remapping table entry. Hence for the io-apic
> -		 * EOI we use the pin number.
> -		 */
> -		if (cfg && irq_remapped(cfg))
> -			io_apic_eoi(apic, pin);
> -		else
> -			io_apic_eoi(apic, vector);
> +		io_apic_eoi(apic, vector);
>  	} else {
>  		struct IO_APIC_route_entry entry, entry1;
>  
> diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
> index e61a174..d62e757 100644
> --- a/drivers/iommu/irq_remapping.c
> +++ b/drivers/iommu/irq_remapping.c
> @@ -94,12 +94,24 @@ static void __init irq_remapping_setup_timer_pin(unsigned int ioapic_idx,
>  	/* Not needed with interrupt remapping */
>  }
>  
> +void eoi_ioapic_pin_remapped(int apic, int pin, int vector)
> +{
> +	/*
> +	 * Intr-remapping uses pin number as the virtual vector
> +	 * in the RTE. Actual vector is programmed in
> +	 * intr-remapping table entry. Hence for the io-apic
> +	 * EOI we use the pin number.
> +	 */
> +	io_apic_eoi(apic, pin);
> +}
> +

Basically you shuffle the code from up there, down there and call from behind
a function pointer. There are two things different this time:
- no version check >= 0x20
  I belive this is obsolete since this runs only on x86-64 with x(2)apic
  support and assumes more or less version 0x20+ or we wouldn't be here at
  all.
- the irq_remapped(cfg) check is gone. The cfg thing is per-interrupt basis
  created so you _now_ you act like the interrupt is remapped even if it is
  not. Or am I wrong here?

> @@ -316,3 +328,4 @@ bool setup_remapped_irq(int irq, struct irq_cfg *cfg, struct irq_chip *chip)
>  		return false;
>  	}
>  }
> +
New line and the end? Why would that be?

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