summaryrefslogtreecommitdiff
path: root/include/linux/iova.h
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2017-08-10 16:58:18 +0200
committerJoerg Roedel <jroedel@suse.de>2017-08-15 18:23:52 +0200
commit9a005a800ae817c2c90ef117d7cd77614d866777 (patch)
tree380a778f1cf83c7033eb74c240dd821d5ada21fc /include/linux/iova.h
parent8109c2a2f8463852dddd6a1c3fcf262047c0c124 (diff)
downloadlwn-9a005a800ae817c2c90ef117d7cd77614d866777.tar.gz
lwn-9a005a800ae817c2c90ef117d7cd77614d866777.zip
iommu/iova: Add flush timer
Add a timer to flush entries from the Flush-Queues every 10ms. This makes sure that no stale TLB entries remain for too long after an IOVA has been unmapped. Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux/iova.h')
-rw-r--r--include/linux/iova.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/iova.h b/include/linux/iova.h
index 913a690cd4b0..d179b9bf7814 100644
--- a/include/linux/iova.h
+++ b/include/linux/iova.h
@@ -48,6 +48,9 @@ typedef void (* iova_entry_dtor)(unsigned long data);
/* Number of entries per Flush Queue */
#define IOVA_FQ_SIZE 256
+/* Timeout (in ms) after which entries are flushed from the Flush-Queue */
+#define IOVA_FQ_TIMEOUT 10
+
/* Flush Queue entry for defered flushing */
struct iova_fq_entry {
unsigned long iova_pfn;
@@ -86,6 +89,11 @@ struct iova_domain {
atomic64_t fq_flush_finish_cnt; /* Number of TLB flushes that
have been finished */
+
+ struct timer_list fq_timer; /* Timer to regularily empty the
+ flush-queues */
+ atomic_t fq_timer_on; /* 1 when timer is active, 0
+ when not */
};
static inline unsigned long iova_size(struct iova *iova)