aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dmar.h
diff options
context:
space:
mode:
authorLi, Zhen-Hua <zhen-hual@hp.com>2014-11-05 15:30:19 +0800
committerJoerg Roedel <jroedel@suse.de>2014-11-06 14:40:10 +0100
commit1a2262f90f493103496f3383741fb5d594c33738 (patch)
treec039b0b57766843c631deb690ce96c75c01d4681 /include/linux/dmar.h
parentLinux 3.18-rc3 (diff)
downloadlinux-dev-1a2262f90f493103496f3383741fb5d594c33738.tar.xz
linux-dev-1a2262f90f493103496f3383741fb5d594c33738.zip
x86/vt-d: Fix incorrect bit operations in setting values
The function context_set_address_root() and set_root_value are setting new address in a wrong way, and this patch is trying to fix this problem. According to Intel Vt-d specs(Feb 2011, Revision 1.3), Chapter 9.1 and 9.2, field ctp in root entry is using bits 12:63, field asr in context entry is using bits 12:63. To set these fields, the following functions are used: static inline void context_set_address_root(struct context_entry *context, unsigned long value); and static inline void set_root_value(struct root_entry *root, unsigned long value) But they are using an invalid method to set these fields, in current code, only a '|' operator is used to set it. This will not set the asr to the expected value if it has an old value. For example: Before calling this function, context->lo = 0x3456789012111; value = 0x123456789abcef12; After we call context_set_address_root(context, value), expected result is context->lo == 0x123456789abce111; But the actual result is: context->lo == 0x1237577f9bbde111; So we need to clear bits 12:63 before setting the new value, this will fix this problem. Signed-off-by: Li, Zhen-Hua <zhen-hual@hp.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux/dmar.h')
0 files changed, 0 insertions, 0 deletions