VirtualBox

Ignore:
Timestamp:
May 20, 2019 11:04:08 PM (6 years ago)
Author:
vboxsync
Message:

winnt/vboxsf: Don't flush and purge the cache twice on newer systems, instead do a library trick to redirect relevant imports from write.obj and read.obj to our wrappers that uses CcCoherencyFlushAndPurgeCache when possible to get better coherency between mmap regions and file content when writing and reading normally. This comes at a cost when the file has been mmapped at some point previously (or currently) and we may need to purge stuff. bugref:9172

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/Makefile.kmk

    r78304 r78608  
    4646VBoxSF_LIBS.x86  = \
    4747        $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/rxce.lib \
    48         $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/rdbsslib.lib \
     48        $(VBoxSF_0_OUTDIR)/rdbsslib.lib \
    4949        $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/copysup.lib \
    5050        $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/ntoskrnl.lib \
     
    5555VBoxSF_LIBS.amd64  = \
    5656        $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/rxce.lib \
    57         $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/rdbsslib.lib \
     57        $(VBoxSF_0_OUTDIR)/rdbsslib.lib \
    5858        $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/copysup.lib \
    5959        $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/ntoskrnl.lib \
     
    6666        $(VBOX_LIB_IPRT_GUEST_R0)
    6767
     68VBoxSF_CLEAN = \
     69        $(VBoxSF_0_OUTDIR)/rdbsslib.lib
     70
     71
    6872include $(FILE_KBUILD_SUB_FOOTER)
    6973
     74ifeq ($(KBUILD_TARGET_ARCH),x86)
     75$(VBoxSF_0_OUTDIR)/rdbsslib.lib: $$(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib | $$(dir $$@) $(VBOX_EDIT_COFF_LIB)
     76        $(VBOX_EDIT_COFF_LIB) --input "$<" --output "$@" \
     77                --select "write.obj" \
     78               --redefine-sym "__imp__CcFlushCache@16=_g_pfnWrFlushCache" \
     79               --redefine-sym "__imp__CcPurgeCacheSection@16=_g_pfnWrPurgeCacheSection" \
     80                --select "read.obj" \
     81               --redefine-sym "__imp__CcFlushCache@16=_g_pfnRdFlushCache"
     82else
     83$(VBoxSF_0_OUTDIR)/rdbsslib.lib: $$(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib | $$(dir $$@) $(VBOX_EDIT_COFF_LIB)
     84        $(VBOX_EDIT_COFF_LIB) --input "$<" --output "$@" -v -v -v -v -v -v \
     85                --select "write.obj" \
     86               --redefine-sym "__imp_CcFlushCache=g_pfnWrFlushCache" \
     87               --redefine-sym "__imp_CcPurgeCacheSection=g_pfnWrPurgeCacheSection" \
     88                --select "read.obj" \
     89               --redefine-sym "__imp_CcFlushCache=g_pfnRdFlushCache"
     90endif
     91
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette