Rename kernel option ACPI_DMAR to IOMMU.
This is mostly needed for a common arm64/amd64 iommu code. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D26587
This commit is contained in:
parent
61c4a6f317
commit
6186bfbd18
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366267
@ -102,6 +102,7 @@ options WITNESS # Enable checks to detect deadlocks and cycles
|
|||||||
options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
|
options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
|
||||||
options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
|
options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
|
||||||
options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default
|
options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default
|
||||||
|
options IOMMU
|
||||||
|
|
||||||
# Kernel Sanitizers
|
# Kernel Sanitizers
|
||||||
#options COVERAGE # Generic kernel coverage. Used by KCOV
|
#options COVERAGE # Generic kernel coverage. Used by KCOV
|
||||||
@ -127,7 +128,6 @@ device cpufreq
|
|||||||
|
|
||||||
# Bus support.
|
# Bus support.
|
||||||
device acpi
|
device acpi
|
||||||
options ACPI_DMAR
|
|
||||||
device pci
|
device pci
|
||||||
options PCI_HP # PCI-Express native HotPlug
|
options PCI_HP # PCI-Express native HotPlug
|
||||||
options PCI_IOV # PCI SR-IOV support
|
options PCI_IOV # PCI SR-IOV support
|
||||||
|
@ -93,6 +93,7 @@ options WITNESS # Enable checks to detect deadlocks and cycles
|
|||||||
options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
|
options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
|
||||||
options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
|
options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
|
||||||
options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default
|
options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default
|
||||||
|
options IOMMU
|
||||||
|
|
||||||
# Make an SMP-capable kernel by default
|
# Make an SMP-capable kernel by default
|
||||||
options SMP # Symmetric MultiProcessor Kernel
|
options SMP # Symmetric MultiProcessor Kernel
|
||||||
@ -103,7 +104,6 @@ device cpufreq
|
|||||||
|
|
||||||
# Bus support.
|
# Bus support.
|
||||||
device acpi
|
device acpi
|
||||||
options ACPI_DMAR
|
|
||||||
device pci
|
device pci
|
||||||
|
|
||||||
# atkbdc0 controls both the keyboard and the PS/2 mouse
|
# atkbdc0 controls both the keyboard and the PS/2 mouse
|
||||||
|
@ -165,8 +165,8 @@ dev/imcsmb/imcsmb.c optional imcsmb
|
|||||||
dev/imcsmb/imcsmb_pci.c optional imcsmb pci
|
dev/imcsmb/imcsmb_pci.c optional imcsmb pci
|
||||||
dev/intel/spi.c optional intelspi
|
dev/intel/spi.c optional intelspi
|
||||||
dev/io/iodev.c optional io
|
dev/io/iodev.c optional io
|
||||||
dev/iommu/busdma_iommu.c optional acpi acpi_dmar pci
|
dev/iommu/busdma_iommu.c optional acpi iommu pci
|
||||||
dev/iommu/iommu_gas.c optional acpi acpi_dmar pci
|
dev/iommu/iommu_gas.c optional acpi iommu pci
|
||||||
dev/ipmi/ipmi.c optional ipmi
|
dev/ipmi/ipmi.c optional ipmi
|
||||||
dev/ipmi/ipmi_acpi.c optional ipmi acpi
|
dev/ipmi/ipmi_acpi.c optional ipmi acpi
|
||||||
dev/ipmi/ipmi_isa.c optional ipmi isa
|
dev/ipmi/ipmi_isa.c optional ipmi isa
|
||||||
@ -302,14 +302,14 @@ x86/cpufreq/hwpstate_amd.c optional cpufreq
|
|||||||
x86/cpufreq/hwpstate_intel.c optional cpufreq
|
x86/cpufreq/hwpstate_intel.c optional cpufreq
|
||||||
x86/cpufreq/p4tcc.c optional cpufreq
|
x86/cpufreq/p4tcc.c optional cpufreq
|
||||||
x86/cpufreq/powernow.c optional cpufreq
|
x86/cpufreq/powernow.c optional cpufreq
|
||||||
x86/iommu/intel_ctx.c optional acpi acpi_dmar pci
|
x86/iommu/intel_ctx.c optional acpi iommu pci
|
||||||
x86/iommu/intel_drv.c optional acpi acpi_dmar pci
|
x86/iommu/intel_drv.c optional acpi iommu pci
|
||||||
x86/iommu/intel_fault.c optional acpi acpi_dmar pci
|
x86/iommu/intel_fault.c optional acpi iommu pci
|
||||||
x86/iommu/intel_idpgtbl.c optional acpi acpi_dmar pci
|
x86/iommu/intel_idpgtbl.c optional acpi iommu pci
|
||||||
x86/iommu/intel_intrmap.c optional acpi acpi_dmar pci
|
x86/iommu/intel_intrmap.c optional acpi iommu pci
|
||||||
x86/iommu/intel_qi.c optional acpi acpi_dmar pci
|
x86/iommu/intel_qi.c optional acpi iommu pci
|
||||||
x86/iommu/intel_quirks.c optional acpi acpi_dmar pci
|
x86/iommu/intel_quirks.c optional acpi iommu pci
|
||||||
x86/iommu/intel_utils.c optional acpi acpi_dmar pci
|
x86/iommu/intel_utils.c optional acpi iommu pci
|
||||||
x86/isa/atrtc.c standard
|
x86/isa/atrtc.c standard
|
||||||
x86/isa/clock.c standard
|
x86/isa/clock.c standard
|
||||||
x86/isa/isa.c optional isa
|
x86/isa/isa.c optional isa
|
||||||
|
@ -704,9 +704,11 @@ EPOCH_TRACE opt_global.h
|
|||||||
ACPI_DEBUG opt_acpi.h
|
ACPI_DEBUG opt_acpi.h
|
||||||
ACPI_MAX_TASKS opt_acpi.h
|
ACPI_MAX_TASKS opt_acpi.h
|
||||||
ACPI_MAX_THREADS opt_acpi.h
|
ACPI_MAX_THREADS opt_acpi.h
|
||||||
ACPI_DMAR opt_acpi.h
|
|
||||||
DEV_ACPI opt_acpi.h
|
DEV_ACPI opt_acpi.h
|
||||||
|
|
||||||
|
# options for IOMMU support
|
||||||
|
IOMMU opt_iommu.h
|
||||||
|
|
||||||
# ISA support
|
# ISA support
|
||||||
DEV_ISA opt_isa.h
|
DEV_ISA opt_isa.h
|
||||||
ISAPNP opt_isa.h
|
ISAPNP opt_isa.h
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "opt_acpi.h"
|
#include "opt_acpi.h"
|
||||||
|
#include "opt_iommu.h"
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
@ -459,7 +460,7 @@ acpi_pci_detach(device_t dev)
|
|||||||
return (pci_detach(dev));
|
return (pci_detach(dev));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
static bus_dma_tag_t
|
static bus_dma_tag_t
|
||||||
acpi_pci_get_dma_tag(device_t bus, device_t child)
|
acpi_pci_get_dma_tag(device_t bus, device_t child)
|
||||||
{
|
{
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "opt_acpi.h"
|
#include "opt_acpi.h"
|
||||||
|
#include "opt_iommu.h"
|
||||||
#include "opt_bus.h"
|
#include "opt_bus.h"
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -5683,7 +5684,7 @@ pci_get_resource_list (device_t dev, device_t child)
|
|||||||
return (&dinfo->resources);
|
return (&dinfo->resources);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
bus_dma_tag_t
|
bus_dma_tag_t
|
||||||
pci_get_dma_tag(device_t bus, device_t dev)
|
pci_get_dma_tag(device_t bus, device_t dev)
|
||||||
{
|
{
|
||||||
|
@ -93,6 +93,7 @@ options WITNESS # Enable checks to detect deadlocks and cycles
|
|||||||
options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
|
options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
|
||||||
options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
|
options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
|
||||||
options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default
|
options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default
|
||||||
|
options IOMMU
|
||||||
|
|
||||||
# Make an SMP-capable kernel by default
|
# Make an SMP-capable kernel by default
|
||||||
options SMP # Symmetric MultiProcessor Kernel
|
options SMP # Symmetric MultiProcessor Kernel
|
||||||
@ -104,7 +105,6 @@ device cpufreq
|
|||||||
|
|
||||||
# Bus support.
|
# Bus support.
|
||||||
device acpi
|
device acpi
|
||||||
options ACPI_DMAR
|
|
||||||
device pci
|
device pci
|
||||||
|
|
||||||
# atkbdc0 controls both the keyboard and the PS/2 mouse
|
# atkbdc0 controls both the keyboard and the PS/2 mouse
|
||||||
|
@ -439,6 +439,8 @@ device s3pci
|
|||||||
device tdfx # Enable 3Dfx Voodoo support
|
device tdfx # Enable 3Dfx Voodoo support
|
||||||
device tdfx_linux # Enable Linuxulator support
|
device tdfx_linux # Enable Linuxulator support
|
||||||
|
|
||||||
|
options IOMMU # Enable IOMMU support
|
||||||
|
|
||||||
#
|
#
|
||||||
# ACPI support using the Intel ACPI Component Architecture reference
|
# ACPI support using the Intel ACPI Component Architecture reference
|
||||||
# implementation.
|
# implementation.
|
||||||
@ -450,7 +452,6 @@ device tdfx_linux # Enable Linuxulator support
|
|||||||
|
|
||||||
device acpi
|
device acpi
|
||||||
options ACPI_DEBUG
|
options ACPI_DEBUG
|
||||||
options ACPI_DMAR
|
|
||||||
|
|
||||||
# ACPI WMI Mapping driver
|
# ACPI WMI Mapping driver
|
||||||
device acpi_wmi
|
device acpi_wmi
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "opt_acpi.h"
|
#include "opt_acpi.h"
|
||||||
|
#include "opt_iommu.h"
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
@ -268,7 +269,7 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat)
|
|||||||
return (tc->impl->tag_destroy(dmat));
|
return (tc->impl->tag_destroy(dmat));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ACPI_DMAR
|
#ifndef IOMMU
|
||||||
bool bus_dma_iommu_set_buswide(device_t dev);
|
bool bus_dma_iommu_set_buswide(device_t dev);
|
||||||
int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map,
|
int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||||
vm_paddr_t start, vm_size_t length, int flags);
|
vm_paddr_t start, vm_size_t length, int flags);
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "opt_acpi.h"
|
#include "opt_acpi.h"
|
||||||
|
#include "opt_iommu.h"
|
||||||
#include "opt_isa.h"
|
#include "opt_isa.h"
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -314,7 +315,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin)
|
|||||||
{
|
{
|
||||||
struct ioapic *io = (struct ioapic *)intpin->io_intsrc.is_pic;
|
struct ioapic *io = (struct ioapic *)intpin->io_intsrc.is_pic;
|
||||||
uint32_t low, high;
|
uint32_t low, high;
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
int error;
|
int error;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -331,7 +332,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin)
|
|||||||
ioapic_write(io->io_addr,
|
ioapic_write(io->io_addr,
|
||||||
IOAPIC_REDTBL_LO(intpin->io_intpin),
|
IOAPIC_REDTBL_LO(intpin->io_intpin),
|
||||||
low | IOART_INTMSET);
|
low | IOART_INTMSET);
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
mtx_unlock_spin(&icu_lock);
|
mtx_unlock_spin(&icu_lock);
|
||||||
iommu_unmap_ioapic_intr(io->io_apic_id,
|
iommu_unmap_ioapic_intr(io->io_apic_id,
|
||||||
&intpin->io_remap_cookie);
|
&intpin->io_remap_cookie);
|
||||||
@ -340,7 +341,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
mtx_unlock_spin(&icu_lock);
|
mtx_unlock_spin(&icu_lock);
|
||||||
error = iommu_map_ioapic_intr(io->io_apic_id,
|
error = iommu_map_ioapic_intr(io->io_apic_id,
|
||||||
intpin->io_cpu, intpin->io_vector, intpin->io_edgetrigger,
|
intpin->io_cpu, intpin->io_vector, intpin->io_edgetrigger,
|
||||||
@ -712,7 +713,7 @@ ioapic_create(vm_paddr_t addr, int32_t apic_id, int intbase)
|
|||||||
intpin->io_cpu = PCPU_GET(apic_id);
|
intpin->io_cpu = PCPU_GET(apic_id);
|
||||||
value = ioapic_read(apic, IOAPIC_REDTBL_LO(i));
|
value = ioapic_read(apic, IOAPIC_REDTBL_LO(i));
|
||||||
ioapic_write(apic, IOAPIC_REDTBL_LO(i), value | IOART_INTMSET);
|
ioapic_write(apic, IOAPIC_REDTBL_LO(i), value | IOART_INTMSET);
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
/* dummy, but sets cookie */
|
/* dummy, but sets cookie */
|
||||||
mtx_unlock_spin(&icu_lock);
|
mtx_unlock_spin(&icu_lock);
|
||||||
iommu_map_ioapic_intr(io->io_apic_id,
|
iommu_map_ioapic_intr(io->io_apic_id,
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "opt_acpi.h"
|
#include "opt_acpi.h"
|
||||||
|
#include "opt_iommu.h"
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/bus.h>
|
#include <sys/bus.h>
|
||||||
@ -383,7 +384,7 @@ msi_alloc(device_t dev, int count, int maxcount, int *irqs)
|
|||||||
struct msi_intsrc *msi, *fsrc;
|
struct msi_intsrc *msi, *fsrc;
|
||||||
u_int cpu, domain, *mirqs;
|
u_int cpu, domain, *mirqs;
|
||||||
int cnt, i, vector;
|
int cnt, i, vector;
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
u_int cookies[count];
|
u_int cookies[count];
|
||||||
int error;
|
int error;
|
||||||
#endif
|
#endif
|
||||||
@ -449,7 +450,7 @@ msi_alloc(device_t dev, int count, int maxcount, int *irqs)
|
|||||||
return (ENOSPC);
|
return (ENOSPC);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
mtx_unlock(&msi_lock);
|
mtx_unlock(&msi_lock);
|
||||||
error = iommu_alloc_msi_intr(dev, cookies, count);
|
error = iommu_alloc_msi_intr(dev, cookies, count);
|
||||||
mtx_lock(&msi_lock);
|
mtx_lock(&msi_lock);
|
||||||
@ -531,7 +532,7 @@ msi_release(int *irqs, int count)
|
|||||||
msi = (struct msi_intsrc *)intr_lookup_source(irqs[i]);
|
msi = (struct msi_intsrc *)intr_lookup_source(irqs[i]);
|
||||||
KASSERT(msi->msi_first == first, ("message not in group"));
|
KASSERT(msi->msi_first == first, ("message not in group"));
|
||||||
KASSERT(msi->msi_dev == first->msi_dev, ("owner mismatch"));
|
KASSERT(msi->msi_dev == first->msi_dev, ("owner mismatch"));
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
iommu_unmap_msi_intr(first->msi_dev, msi->msi_remap_cookie);
|
iommu_unmap_msi_intr(first->msi_dev, msi->msi_remap_cookie);
|
||||||
#endif
|
#endif
|
||||||
msi->msi_first = NULL;
|
msi->msi_first = NULL;
|
||||||
@ -541,7 +542,7 @@ msi_release(int *irqs, int count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Clear out the first message. */
|
/* Clear out the first message. */
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
mtx_unlock(&msi_lock);
|
mtx_unlock(&msi_lock);
|
||||||
iommu_unmap_msi_intr(first->msi_dev, first->msi_remap_cookie);
|
iommu_unmap_msi_intr(first->msi_dev, first->msi_remap_cookie);
|
||||||
mtx_lock(&msi_lock);
|
mtx_lock(&msi_lock);
|
||||||
@ -564,7 +565,7 @@ msi_map(int irq, uint64_t *addr, uint32_t *data)
|
|||||||
{
|
{
|
||||||
struct msi_intsrc *msi;
|
struct msi_intsrc *msi;
|
||||||
int error;
|
int error;
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
struct msi_intsrc *msi1;
|
struct msi_intsrc *msi1;
|
||||||
int i, k;
|
int i, k;
|
||||||
#endif
|
#endif
|
||||||
@ -595,7 +596,7 @@ msi_map(int irq, uint64_t *addr, uint32_t *data)
|
|||||||
msi = msi->msi_first;
|
msi = msi->msi_first;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
if (!msi->msi_msix) {
|
if (!msi->msi_msix) {
|
||||||
for (k = msi->msi_count - 1, i = first_msi_irq; k > 0 &&
|
for (k = msi->msi_count - 1, i = first_msi_irq; k > 0 &&
|
||||||
i < first_msi_irq + num_msi_irqs; i++) {
|
i < first_msi_irq + num_msi_irqs; i++) {
|
||||||
@ -633,7 +634,7 @@ msix_alloc(device_t dev, int *irq)
|
|||||||
struct msi_intsrc *msi;
|
struct msi_intsrc *msi;
|
||||||
u_int cpu, domain;
|
u_int cpu, domain;
|
||||||
int i, vector;
|
int i, vector;
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
u_int cookie;
|
u_int cookie;
|
||||||
int error;
|
int error;
|
||||||
#endif
|
#endif
|
||||||
@ -684,7 +685,7 @@ msix_alloc(device_t dev, int *irq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
msi->msi_dev = dev;
|
msi->msi_dev = dev;
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
mtx_unlock(&msi_lock);
|
mtx_unlock(&msi_lock);
|
||||||
error = iommu_alloc_msi_intr(dev, &cookie, 1);
|
error = iommu_alloc_msi_intr(dev, &cookie, 1);
|
||||||
mtx_lock(&msi_lock);
|
mtx_lock(&msi_lock);
|
||||||
@ -739,7 +740,7 @@ msix_release(int irq)
|
|||||||
KASSERT(msi->msi_dev != NULL, ("unowned message"));
|
KASSERT(msi->msi_dev != NULL, ("unowned message"));
|
||||||
|
|
||||||
/* Clear out the message. */
|
/* Clear out the message. */
|
||||||
#ifdef ACPI_DMAR
|
#ifdef IOMMU
|
||||||
mtx_unlock(&msi_lock);
|
mtx_unlock(&msi_lock);
|
||||||
iommu_unmap_msi_intr(msi->msi_dev, msi->msi_remap_cookie);
|
iommu_unmap_msi_intr(msi->msi_dev, msi->msi_remap_cookie);
|
||||||
mtx_lock(&msi_lock);
|
mtx_lock(&msi_lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user