Changeset 82590 in vbox
- Timestamp:
- Dec 16, 2019 5:48:40 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r81304 r82590 2019 2019 SUPR0DECL(void) SUPR0BadContext(PSUPDRVSESSION pSession, const char *pszFile, uint32_t uLine, const char *pszExpr); 2020 2020 2021 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) 2022 /** 2023 * Translates a physical address to a virtual mapping (valid up to end of page). 2024 * @returns VBox status code. 2025 * @param HCPhys The physical address, must be page aligned. 2026 * @param ppv Where to store the mapping address on success. 2027 */ 2028 SUPR0DECL(int) SUPR0HCPhysToVirt(RTHCPHYS HCPhys, void **ppv); 2029 #endif 2030 2021 2031 /** Context structure returned by SUPR0IoCtlSetup for use with 2022 2032 * SUPR0IoCtlPerform and cleaned up by SUPR0IoCtlCleanup. */ -
trunk/src/VBox/HostDrivers/Support/Makefile.kmk
r81158 r82590 762 762 $(PATH_SUB_CURRENT)/$(KBUILD_TARGET)/Makefile \ 763 763 $$(if $$(eq $$(Support/$(KBUILD_TARGET)/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \ 764 $$(if $$(eq $$(Support/$(KBUILD_TARGET)/Makefile_VBOX_RAM_IN_KERNEL),$$(VBOX_WITH_RAM_IN_KERNEL)),,FORCE) \ 764 765 | $$(dir $$@) 765 766 $(call MSG_TOOL,Creating,,$@) 766 767 $(QUIET)$(SED) -e "" \ 767 768 $(if-expr !defined(VBOX_WITH_HARDENING) ,-e "s;VBOX_WITH_HARDENING;;g",) \ 768 $(if-expr ($(VBOX_VERSION_BUILD) % 2) == 0 \769 $(if-expr ($(VBOX_VERSION_BUILD) % 2) == 0 || defined(VBOX_WITH_RAM_IN_KERNEL) \ 769 770 , -e "s;VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV;;g" -e "s;IPRT_WITH_EFLAGS_AC_PRESERVING;;g",) \ 771 $(if-expr !defined(VBOX_WITH_RAM_IN_KERNEL) \ 772 , -e 's;VBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV;;g' -e 's;IPRT_WITHOUT_EFLAGS_AC_PRESERVING;;g',) \ 770 773 --output $@ $< 771 774 %$(QUIET2)$(APPEND) -t '$(PATH_TARGET)/vboxdrv-src-1.dep' \ 772 'Support/$(KBUILD_TARGET)/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)' 775 'Support/$(KBUILD_TARGET)/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)' \ 776 'Support/$(KBUILD_TARGET)/Makefile_VBOX_RAM_IN_KERNEL=$(VBOX_WITH_RAM_IN_KERNEL)' 773 777 774 778 # -
trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp
r81623 r82590 105 105 * Checks that the AC flag is set if SMAP is enabled. If AC is not set, it 106 106 * will be logged and @a a_BadExpr is executed. */ 107 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX)107 #if (defined(RT_OS_DARWIN) || defined(RT_OS_LINUX)) && !defined(VBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV) 108 108 # define SUPDRV_CHECK_SMAP_SETUP() uint32_t const fKernelFeatures = SUPR0GetKernelFeatures() 109 109 # define SUPDRV_CHECK_SMAP_CHECK(a_pDevExt, a_BadExpr) \ … … 227 227 { "SUPR0PageMapKernel", (void *)(uintptr_t)SUPR0PageMapKernel }, 228 228 { "SUPR0PageProtect", (void *)(uintptr_t)SUPR0PageProtect }, 229 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) 230 { "SUPR0HCPhysToVirt", (void *)(uintptr_t)SUPR0HCPhysToVirt }, /* only-linux, only solaris */ 231 #endif 229 232 { "SUPR0Printf", (void *)(uintptr_t)SUPR0Printf }, 230 233 { "SUPR0GetSessionGVM", (void *)(uintptr_t)SUPR0GetSessionGVM }, -
trunk/src/VBox/HostDrivers/Support/linux/Makefile
r77403 r82590 154 154 VBOX_WITH_HARDENING \ 155 155 SUPDRV_WITH_RELEASE_LOGGER \ 156 VBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV \ 156 157 VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV \ 158 IPRT_WITHOUT_EFLAGS_AC_PRESERVING \ 157 159 IPRT_WITH_EFLAGS_AC_PRESERVING \ 158 160 VBOX_WITH_64_BITS_GUESTS # <-- must be consistent with Config.kmk! -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r79444 r82590 558 558 PSUPDRVSESSION pSession = (PSUPDRVSESSION)pFilp->private_data; 559 559 int rc; 560 #if defined(VBOX_STRICT) || defined(VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV) 560 #ifndef VBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV 561 # if defined(VBOX_STRICT) || defined(VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV) 561 562 RTCCUINTREG fSavedEfl; 562 563 … … 577 578 stac(); 578 579 # endif 580 #endif 579 581 580 582 /* … … 599 601 #endif /* !HAVE_UNLOCKED_IOCTL */ 600 602 601 #if defined(VBOX_STRICT) || defined(VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV) 603 #ifndef VBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV 604 # if defined(VBOX_STRICT) || defined(VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV) 602 605 /* 603 606 * Before we restore AC and the rest of EFLAGS, check if the IOCtl handler code … … 612 615 } 613 616 ASMSetFlags(fSavedEfl); 614 # else617 # else 615 618 clac(); 619 # endif 616 620 #endif 617 621 return rc; … … 1388 1392 1389 1393 1394 SUPR0DECL(int) SUPR0HCPhysToVirt(RTHCPHYS HCPhys, void **ppv) 1395 { 1396 AssertReturn(!(HCPhys & PAGE_OFFSET_MASK), VERR_INVALID_POINTER); 1397 AssertReturn(HCPhys != NIL_RTHCPHYS, VERR_INVALID_POINTER); 1398 /* Would've like to use valid_phys_addr_range for this test, but it isn't exported. */ 1399 AssertReturn((HCPhys | PAGE_OFFSET_MASK) < __pa(high_memory), VERR_INVALID_POINTER); 1400 *ppv = phys_to_virt(HCPhys); 1401 return VINF_SUCCESS; 1402 } 1403 1404 1390 1405 RTDECL(int) SUPR0Printf(const char *pszFormat, ...) 1391 1406 { -
trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
r76553 r82590 46 46 #include <sys/file.h> 47 47 #include <sys/priv_names.h> 48 #include <vm/hat.h> 48 49 #undef u /* /usr/include/sys/user.h:249:1 is where this is defined to (curproc->p_user). very cool. */ 49 50 … … 64 65 65 66 #include "dtrace/SUPDrv.h" 67 68 extern "C" caddr_t hat_kpm_pfn2va(pfn_t); /* Found in vm/hat.h on solaris 11.3, but not on older like 10u7. */ 66 69 67 70 … … 1277 1280 1278 1281 1282 SUPR0DECL(int) SUPR0HCPhysToVirt(RTHCPHYS HCPhys, void **ppv) 1283 { 1284 AssertReturn(!(HCPhys & PAGE_OFFSET_MASK), VERR_INVALID_POINTER); 1285 AssertReturn(HCPhys != NIL_RTHCPHYS, VERR_INVALID_POINTER); 1286 HCPhys >>= PAGE_SHIFT; 1287 AssertReturn(HCPhys <= physmax, VERR_INVALID_POINTER); 1288 *ppv = hat_kpm_pfn2va(HCPhys); 1289 return VINF_SUCCESS; 1290 } 1291 1292 1279 1293 RTDECL(int) SUPR0Printf(const char *pszFormat, ...) 1280 1294 { -
trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
r81587 r82590 420 420 * restoring flags. 421 421 * @{ */ 422 #if defined(CONFIG_X86_SMAP) || defined(RT_STRICT) || defined(IPRT_WITH_EFLAGS_AC_PRESERVING) 422 #if (defined(CONFIG_X86_SMAP) || defined(RT_STRICT) || defined(IPRT_WITH_EFLAGS_AC_PRESERVING)) \ 423 && !defined(IPRT_WITHOUT_EFLAGS_AC_PRESERVING) 423 424 # include <iprt/asm-amd64-x86.h> 424 425 # define IPRT_X86_EFL_AC RT_BIT(18)
Note:
See TracChangeset
for help on using the changeset viewer.