]> xenbits.xensource.com Git - xen.git/commit
VT-d: introduce update_irte to update irte safely
authorChao Gao <chao.gao@intel.com>
Fri, 7 Apr 2017 13:38:17 +0000 (15:38 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Apr 2017 13:38:17 +0000 (15:38 +0200)
commit93358e8e83db01d6e5b7fb40ab96082fe31447b1
tree63e92a19035d39757e4a543b9dfc448b9ccb415f
parent92fc8d10f5b59bd59455962b41953d6ca3ecfd16
VT-d: introduce update_irte to update irte safely

We used structure assignment to update irte which was non-atomic when the
whole IRTE was to be updated. It is unsafe when a interrupt happened during
update. Furthermore, no bug or warning would be reported when this happened.

This patch introduces two variants, atomic and non-atomic, to update irte.
For initialization and release case, the non-atomic variant will be used. for
other cases (such as reprogramming to set irq affinity), the atomic variant
will be used. If the caller requests an atomic update but we can't meet it, we
raise a bug.

Signed-off-by: Chao Gao <chao.gao@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com> [x86]
xen/arch/x86/msi.c
xen/drivers/passthrough/vtd/intremap.c
xen/include/asm-x86/msi.h