linux-kernel-test/drivers/iommu
Alexander Gordeev ff16432412 x86/apic: Make cpu_mask_to_apicid() operations return error code
Current cpu_mask_to_apicid() and cpu_mask_to_apicid_and()
implementations have few shortcomings:

1. A value returned by cpu_mask_to_apicid() is written to
hardware registers unconditionally. Should BAD_APICID get ever
returned it will be written to a hardware too. But the value of
BAD_APICID is not universal across all hardware in all modes and
might cause unexpected results, i.e. interrupts might get routed
to CPUs that are not configured to receive it.

2. Because the value of BAD_APICID is not universal it is
counter- intuitive to return it for a hardware where it does not
make sense (i.e. x2apic).

3. cpu_mask_to_apicid_and() operation is thought as an
complement to cpu_mask_to_apicid() that only applies a AND mask
on top of a cpumask being passed. Yet, as consequence of 18374d8
commit the two operations are inconsistent in that of:
  cpu_mask_to_apicid() should not get a offline CPU with the cpumask
  cpu_mask_to_apicid_and() should not fail and return BAD_APICID
These limitations are impossible to realize just from looking at
the operations prototypes.

Most of these shortcomings are resolved by returning a error
code instead of BAD_APICID. As the result, faults are reported
back early rather than possibilities to cause a unexpected
behaviour exist (in case of [1]).

The only exception is setup_timer_IRQ0_pin() routine. Although
obviously controversial to this fix, its existing behaviour is
preserved to not break the fragile check_timer() and would
better addressed in a separate fix.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/20120607131559.GF4759@dhcp-26-207.brq.redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-06-08 11:44:29 +02:00
..
amd_iommu_init.c Merge branches 'iommu/fixes', 'arm/tegra' and 'x86/amd' into next 2012-03-22 19:28:39 +01:00
amd_iommu_proto.h iommu/amd: Add function to get IOMMUv2 domain for pdev 2011-12-12 15:19:05 +01:00
amd_iommu_types.h iommu/amd: Set IOTLB invalidation timeout 2011-12-22 14:56:56 +01:00
amd_iommu_v2.c iommu/amd: Don't initialize IOMMUv2 resources when not required 2012-03-15 12:46:40 +01:00
amd_iommu.c iommu/amd: Add workaround for event log erratum 2012-04-12 14:16:14 +02:00
dmar.c iommu: Fix off by one in dmar_get_fault_reason() 2012-05-14 14:37:47 +02:00
exynos-iommu.c iommu/exynos: Add iommu driver for EXYNOS Platforms 2012-05-12 05:56:09 +09:00
intel_irq_remapping.c x86/apic: Make cpu_mask_to_apicid() operations return error code 2012-06-08 11:44:29 +02:00
intel-iommu.c intel-iommu: Move duplicate list-mangling code into unlink_domain_info() helper 2012-05-25 15:50:29 -07:00
iommu.c iommu/core: pass a user-provided token to fault handlers 2012-05-22 18:08:08 +02:00
iova.c
irq_remapping.c irq_remap: Fix UP build failure 2012-05-08 11:17:30 +02:00
irq_remapping.h irq_remap: Fix UP build failure 2012-05-08 11:17:30 +02:00
Kconfig arm-soc: driver specific updates 2012-05-26 12:22:27 -07:00
Makefile arm-soc: driver specific updates 2012-05-26 12:22:27 -07:00
msm_iommu_dev.c
msm_iommu.c iommu/msm: Fix error handling in msm_iommu_unmap() 2012-01-30 12:53:14 +01:00
omap-iommu-debug.c simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
omap-iommu.c iommu: OMAP: device detach on domain destroy 2012-04-19 15:07:23 +02:00
omap-iovmm.c Merge branches 'iommu/fixes', 'arm/omap' and 'x86/amd' into next 2012-01-09 13:04:05 +01:00
tegra-gart.c iommu/tegra: gart: Fix register offset correctly 2012-05-11 11:42:05 +02:00
tegra-smmu.c iommu/tegra: smmu: Print device name correctly 2012-04-16 12:52:41 +02:00