Commit a6581ebe authored by Michal Wajdeczko's avatar Michal Wajdeczko Committed by Rodrigo Vivi

drm/xe/vf: Introduce Memory Based Interrupts Handler

The register based interrupts infrastructure does not scale
efficiently to allow delivering interrupts to a large number
of virtual machines. Memory based interrupt reporting provides
an efficient and scalable infrastructure.

Define handler to read and dispatch memory based interrupts.
We will use this handler in upcoming patch.

Cc: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20231214185955.1791-8-michal.wajdeczko@intel.comSigned-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
parent f15de193
......@@ -146,7 +146,9 @@ xe-y += xe_bb.o \
xe-$(CONFIG_HWMON) += xe_hwmon.o
# graphics virtualization (SR-IOV) support
xe-y += xe_sriov.o
xe-y += \
xe_memirq.o \
xe_sriov.o
xe-$(CONFIG_PCI_IOV) += \
xe_lmtt.o \
......
......@@ -29,12 +29,14 @@
#include "xe_gt.h"
#include "xe_gt_mcr.h"
#include "xe_irq.h"
#include "xe_memirq.h"
#include "xe_mmio.h"
#include "xe_module.h"
#include "xe_pat.h"
#include "xe_pcode.h"
#include "xe_pm.h"
#include "xe_query.h"
#include "xe_sriov.h"
#include "xe_tile.h"
#include "xe_ttm_stolen_mgr.h"
#include "xe_ttm_sys_mgr.h"
......@@ -456,6 +458,11 @@ int xe_device_probe(struct xe_device *xe)
err = xe_ggtt_init_early(tile->mem.ggtt);
if (err)
return err;
if (IS_SRIOV_VF(xe)) {
err = xe_memirq_init(&tile->sriov.vf.memirq);
if (err)
return err;
}
}
err = drmm_add_action_or_reset(&xe->drm, xe_driver_flr_fini, xe);
......
......@@ -168,6 +168,11 @@ static inline bool xe_device_has_sriov(struct xe_device *xe)
return xe->info.has_sriov;
}
static inline bool xe_device_has_memirq(struct xe_device *xe)
{
return GRAPHICS_VERx100(xe) >= 1250;
}
u32 xe_device_ccs_bytes(struct xe_device *xe, u64 size);
#endif
......@@ -16,6 +16,7 @@
#include "xe_heci_gsc.h"
#include "xe_gt_types.h"
#include "xe_lmtt_types.h"
#include "xe_memirq_types.h"
#include "xe_platform_types.h"
#include "xe_pt_types.h"
#include "xe_sriov_types.h"
......@@ -192,6 +193,10 @@ struct xe_tile {
/** @sriov.pf.lmtt: Local Memory Translation Table. */
struct xe_lmtt lmtt;
} pf;
struct {
/** @sriov.vf.memirq: Memory Based Interrupts. */
struct xe_memirq memirq;
} vf;
} sriov;
/** @migrate: Migration helper for vram blits and clearing */
......
This diff is collapsed.
/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2023 Intel Corporation
*/
#ifndef _XE_MEMIRQ_H_
#define _XE_MEMIRQ_H_
#include <linux/types.h>
struct xe_guc;
struct xe_memirq;
int xe_memirq_init(struct xe_memirq *memirq);
u32 xe_memirq_source_ptr(struct xe_memirq *memirq);
u32 xe_memirq_status_ptr(struct xe_memirq *memirq);
u32 xe_memirq_enable_ptr(struct xe_memirq *memirq);
void xe_memirq_reset(struct xe_memirq *memirq);
void xe_memirq_postinstall(struct xe_memirq *memirq);
void xe_memirq_handler(struct xe_memirq *memirq);
int xe_memirq_init_guc(struct xe_memirq *memirq, struct xe_guc *guc);
#endif
/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2023 Intel Corporation
*/
#ifndef _XE_MEMIRQ_TYPES_H_
#define _XE_MEMIRQ_TYPES_H_
#include <linux/iosys-map.h>
struct xe_bo;
/* ISR */
#define XE_MEMIRQ_STATUS_OFFSET 0x0
/* IIR */
#define XE_MEMIRQ_SOURCE_OFFSET 0x400
/* IMR */
#define XE_MEMIRQ_ENABLE_OFFSET 0x440
/**
* struct xe_memirq - Data used by the `Memory Based Interrupts`_.
*
* @bo: buffer object with `Memory Based Interrupts Page Layout`_.
* @source: iosys pointer to `Interrupt Source Report Page`_.
* @status: iosys pointer to `Interrupt Status Report Page`_.
* @mask: iosys pointer to Interrupt Enable Mask.
* @enabled: internal flag used to control processing of the interrupts.
*/
struct xe_memirq {
struct xe_bo *bo;
struct iosys_map source;
struct iosys_map status;
struct iosys_map mask;
bool enabled;
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment