dc68054305
- Restore 29 recipe symlinks (libdrm, qtbase, dbus, sddm, pipewire, etc.) - Restore 33 patches (KDE, libdrm, mesa, pipewire, sddm, wireplumber) - Restore 20+ local/scripts (audit, lint, test, build helpers) - Restore src/cook/scheduler.rs, status.rs, gnu-config/ - Restore scripts/patch-inclusion-gate.sh, run_mini1.sh, validate-collision-log.sh - Recover TLC source from HEAD (was overwritten by 0.2.3 checkout) - Recover 11 local/docs plans from HEAD (were overwritten) - Recover qt6-wayland-smoke symlink from HEAD - Fix MOTD: remove garbled ASCII art, use clean text - Update version: 0.2.0 -> 0.2.4 in os-release, motd, config - Reduce filesystem_size: 1536 -> 512 MiB - Add ABSOLUTE RULE to AGENTS.md: never delete/ignore packages - Reduce pcid scheme log verbosity: info -> debug
99 lines
2.5 KiB
C
99 lines
2.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2012 Advanced Micro Devices, Inc.
|
|
* Author: Joerg Roedel <joerg.roedel@amd.com>
|
|
*
|
|
* This header file contains the interface of the interrupt remapping code to
|
|
* the x86 interrupt management code.
|
|
*/
|
|
|
|
#ifndef __X86_IRQ_REMAPPING_H
|
|
#define __X86_IRQ_REMAPPING_H
|
|
|
|
#include <asm/irqdomain.h>
|
|
#include <asm/hw_irq.h>
|
|
#include <asm/io_apic.h>
|
|
|
|
struct msi_msg;
|
|
struct irq_alloc_info;
|
|
|
|
enum irq_remap_cap {
|
|
IRQ_POSTING_CAP = 0,
|
|
};
|
|
|
|
enum {
|
|
IRQ_REMAP_XAPIC_MODE,
|
|
IRQ_REMAP_X2APIC_MODE,
|
|
};
|
|
|
|
/*
|
|
* This is mainly used to communicate information back-and-forth
|
|
* between SVM and IOMMU for setting up and tearing down posted
|
|
* interrupt
|
|
*/
|
|
struct amd_iommu_pi_data {
|
|
u64 vapic_addr; /* Physical address of the vCPU's vAPIC. */
|
|
u32 ga_tag;
|
|
u32 vector; /* Guest vector of the interrupt */
|
|
int cpu;
|
|
bool ga_log_intr;
|
|
bool is_guest_mode;
|
|
void *ir_data;
|
|
};
|
|
|
|
struct intel_iommu_pi_data {
|
|
u64 pi_desc_addr; /* Physical address of PI Descriptor */
|
|
u32 vector; /* Guest vector of the interrupt */
|
|
};
|
|
|
|
#ifdef CONFIG_IRQ_REMAP
|
|
|
|
extern raw_spinlock_t irq_2_ir_lock;
|
|
|
|
extern bool irq_remapping_cap(enum irq_remap_cap cap);
|
|
extern void set_irq_remapping_broken(void);
|
|
extern int irq_remapping_prepare(void);
|
|
extern int irq_remapping_enable(void);
|
|
extern void irq_remapping_disable(void);
|
|
extern int irq_remapping_reenable(int);
|
|
extern int irq_remap_enable_fault_handling(void);
|
|
extern void panic_if_irq_remap(const char *msg);
|
|
|
|
/* Get parent irqdomain for interrupt remapping irqdomain */
|
|
static inline struct irq_domain *arch_get_ir_parent_domain(void)
|
|
{
|
|
return x86_vector_domain;
|
|
}
|
|
|
|
extern bool enable_posted_msi;
|
|
|
|
static inline bool posted_msi_enabled(void)
|
|
{
|
|
return IS_ENABLED(CONFIG_X86_POSTED_MSI) &&
|
|
enable_posted_msi && irq_remapping_cap(IRQ_POSTING_CAP);
|
|
}
|
|
|
|
#else /* CONFIG_IRQ_REMAP */
|
|
|
|
static inline bool irq_remapping_cap(enum irq_remap_cap cap) { return 0; }
|
|
static inline void set_irq_remapping_broken(void) { }
|
|
static inline int irq_remapping_prepare(void) { return -ENODEV; }
|
|
static inline int irq_remapping_enable(void) { return -ENODEV; }
|
|
static inline void irq_remapping_disable(void) { }
|
|
static inline int irq_remapping_reenable(int eim) { return -ENODEV; }
|
|
static inline int irq_remap_enable_fault_handling(void) { return -ENODEV; }
|
|
|
|
static inline void panic_if_irq_remap(const char *msg)
|
|
{
|
|
}
|
|
|
|
#endif /* CONFIG_IRQ_REMAP */
|
|
|
|
#ifdef CONFIG_X86_POSTED_MSI
|
|
void intel_ack_posted_msi_irq(struct irq_data *irqd);
|
|
#else
|
|
#define intel_ack_posted_msi_irq NULL
|
|
#endif
|
|
|
|
#endif /* __X86_IRQ_REMAPPING_H */
|