mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
dmaengine: idxd: Separate user and kernel pasid enabling
The idxd driver always gated the pasid enabling under a single knob and this assumption is incorrect. The pasid used for kernel operation can be independently toggled and has no dependency on the user pasid (and vice versa). Split the two so they are independent "enabled" flags. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/165231431746.986466.5666862038354800551.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
@@ -239,6 +239,7 @@ enum idxd_device_flag {
|
||||
IDXD_FLAG_CONFIGURABLE = 0,
|
||||
IDXD_FLAG_CMD_RUNNING,
|
||||
IDXD_FLAG_PASID_ENABLED,
|
||||
IDXD_FLAG_USER_PASID_ENABLED,
|
||||
};
|
||||
|
||||
struct idxd_dma_dev {
|
||||
@@ -469,9 +470,20 @@ static inline bool device_pasid_enabled(struct idxd_device *idxd)
|
||||
return test_bit(IDXD_FLAG_PASID_ENABLED, &idxd->flags);
|
||||
}
|
||||
|
||||
static inline bool device_swq_supported(struct idxd_device *idxd)
|
||||
static inline bool device_user_pasid_enabled(struct idxd_device *idxd)
|
||||
{
|
||||
return (support_enqcmd && device_pasid_enabled(idxd));
|
||||
return test_bit(IDXD_FLAG_USER_PASID_ENABLED, &idxd->flags);
|
||||
}
|
||||
|
||||
static inline bool wq_pasid_enabled(struct idxd_wq *wq)
|
||||
{
|
||||
return (is_idxd_wq_kernel(wq) && device_pasid_enabled(wq->idxd)) ||
|
||||
(is_idxd_wq_user(wq) && device_user_pasid_enabled(wq->idxd));
|
||||
}
|
||||
|
||||
static inline bool wq_shared_supported(struct idxd_wq *wq)
|
||||
{
|
||||
return (support_enqcmd && wq_pasid_enabled(wq));
|
||||
}
|
||||
|
||||
enum idxd_portal_prot {
|
||||
|
||||
Reference in New Issue
Block a user