NPT: temporarily retain page table mapping in do_recalc()

Commit b3e024f3 ("x86/NPT: don't walk page tables when changing types
on a range") neglected the fact that p2m_next_level() replaces the
previous level's mapping with the new level's one, hence dereferencing
a stale pointer the translation for which may no longer be available
(timing dependent). Add a parameter to that function allowing the
caller to request that the mapping be retained (the unmapping will be
taken care of by the caller then).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
x86/time: cpuid_time_leaf() cleanup

* Don't mix uint32_t and unsigned int between prototype and definition
* Don't bitwise or with 0

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
x86,amd_ucode: verify max allowed patch size before apply

Each family has a stipulated max patch_size. Use this as
additional sanity check before we apply it.

Also, tone down the amount of debug messages and
Follow microcode_intel's implementation of pr_debug.

While at it, fix comment at very top to indicate we support ucode
patch loading from fam10h and higher.

Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
Reviewed-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
x86: define macros CPUINFO_features and CPUINFO_FEATURE_OFFSET

This patch defines macros CPUINFO_features and CPUINFO_FEATURE_OFFSET.
CPUINFO_features can be used as the base of the offset for cpu features,
while CPUINFO_FEATURE_OFFSET is used to define the right offset for
specific CPU feature.

Signed-off-by: Feng Wu <feng.wu@intel.com>

Some further cleanup (both to the patch and to surrounding code).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
x86: move common_interrupt to entry.S

This patch moves label common_interrupt from asm_defns.h to entry.S and
convert SAVE_ALL from a C to an assembler macro.

Signed-off-by: Feng Wu <feng.wu@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
x86: merge stuff from asm-x86/x86_64/asm_defns.h to asm-x86/asm_defns.h

This patch move stuff unchanged from asm-x86/x86_64/asm_defns.h to
asm-x86/asm_defns.h

Signed-off-by: Feng Wu <feng.wu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>