x86/page: Implement {get,set}_pte_flags() as static inlines
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 6 Sep 2017 13:34:04 +0000 (14:34 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 7 Sep 2017 15:55:10 +0000 (16:55 +0100)
commite9cb0d1d0eb3a9e4d8b97432c9246cdfbb3b0309
treecdc34e6a2d4b88c0e96d7401724c48ed3967cf4b
parentd6b12add90da95e657ba398475285ae8de3ad0ad
x86/page: Implement {get,set}_pte_flags() as static inlines

This resolves 11 Coverity issues along the lines of the following:

1600        for ( i = 0; i < NR_RESERVED_GDT_PAGES; i++ )

    CID: Operands don't affect result
    (CONSTANT_EXPRESSION_RESULT)result_independent_of_operands: ((33U /* 1U |
    0x20U */) | (({...}) ? 8388608U /* 1U << 23 */ : 0) | 0x40U | 2U) & 4095
    is always 0x63 regardless of the values of its operands. This occurs as
    the bitwise second operand of "|".

1601            l1e_write(pl1e + FIRST_RESERVED_GDT_PAGE + i,
1602                      l1e_from_pfn(mfn + i, __PAGE_HYPERVISOR_RW));

This is presumably because once preprocessed, the association of joint logic
inside {get,set}_pte_flags() is lost.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
xen/include/asm-x86/x86_64/page.h