diff --git a/security/sandbox/chromium/base/cpu.cc b/security/sandbox/chromium/base/cpu.cc index dcba3b6e73e5..8d37d170145b 100644 --- a/security/sandbox/chromium/base/cpu.cc +++ b/security/sandbox/chromium/base/cpu.cc @@ -51,6 +51,16 @@ CPU::CPU() namespace { #if defined(ARCH_CPU_X86_FAMILY) +#if defined(_MSC_VER) && (_MSC_FULL_VER < 160040219) +// Prior to VS2010 SP1, _xgetbv is not defined in immintrin.h, so we need to +// define our own version using the assembly operation. +// By using __fastcall we ensure that xcr is already in register ecx for xgetbv +// and xgetbv populates the correct registers (eax edx) for our return value. +uint64_t __fastcall _xgetbv(uint32_t xcr) { + __asm xgetbv; +} +#endif + #ifndef _MSC_VER #if defined(__pic__) && defined(__i386__) diff --git a/security/sandbox/modifications-to-chromium-to-reapply-after-upstream-merge.txt b/security/sandbox/modifications-to-chromium-to-reapply-after-upstream-merge.txt index 8fe2b8a81cdc..0463838cfd6a 100644 --- a/security/sandbox/modifications-to-chromium-to-reapply-after-upstream-merge.txt +++ b/security/sandbox/modifications-to-chromium-to-reapply-after-upstream-merge.txt @@ -1,5 +1,6 @@ Please add a link to the bugzilla bug and patch name that should be re-applied. Also, please update any existing links to their actual mozilla-central changeset. -https://bugzilla.mozilla.org/show_bug.cgi?id=1041775 bug1041775part3.patch -https://bugzilla.mozilla.org/show_bug.cgi?id=928044 bug928044part3.patch +https://hg.mozilla.org/mozilla-central/rev/365d1073111a +https://hg.mozilla.org/mozilla-central/rev/0f763c186855 +https://bugzilla.mozilla.org/show_bug.cgi?id=1105729 bug1105729.patch