diff options
Diffstat (limited to 'src/VBox/Additions/linux')
-rwxr-xr-x | src/VBox/Additions/linux/drm/files_vboxvideo_drv | 1 | ||||
-rw-r--r-- | src/VBox/Additions/linux/drm/vbox_drv.c | 6 | ||||
-rw-r--r-- | src/VBox/Additions/linux/drm/vbox_drv.h | 2 | ||||
-rw-r--r-- | src/VBox/Additions/linux/drm/vbox_ttm.c | 20 | ||||
-rwxr-xr-x | src/VBox/Additions/linux/sharedfolders/files_vboxsf | 1 | ||||
-rw-r--r-- | src/VBox/Additions/linux/sharedfolders/regops.c | 17 | ||||
-rw-r--r-- | src/VBox/Additions/linux/sharedfolders/utils.c | 5 | ||||
-rw-r--r-- | src/VBox/Additions/linux/sharedfolders/vfsmod.c | 11 |
8 files changed, 48 insertions, 15 deletions
diff --git a/src/VBox/Additions/linux/drm/files_vboxvideo_drv b/src/VBox/Additions/linux/drm/files_vboxvideo_drv index 04092484..46fdf366 100755 --- a/src/VBox/Additions/linux/drm/files_vboxvideo_drv +++ b/src/VBox/Additions/linux/drm/files_vboxvideo_drv @@ -38,6 +38,7 @@ FILES_VBOXVIDEO_DRM_NOBIN=" \ ${PATH_ROOT}/include/VBox/Graphics/HGSMIDefs.h=>hgsmi_defs.h \ ${PATH_ROOT}/include/VBox/Graphics/VBoxVideoErr.h=>vbox_err.h \ ${PATH_ROOT}/include/VBox/Graphics/VBoxVideoVBE.h=>vboxvideo_vbe.h \ + ${PATH_ROOT}/include/VBox/VBoxLnxModInline.h=>VBox/VBoxLnxModInline.h \ ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp=>hgsmi_base.c \ ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp=>modesetting.c \ ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp=>vbva_base.c \ diff --git a/src/VBox/Additions/linux/drm/vbox_drv.c b/src/VBox/Additions/linux/drm/vbox_drv.c index 3e4cbc60..7d2561dd 100644 --- a/src/VBox/Additions/linux/drm/vbox_drv.c +++ b/src/VBox/Additions/linux/drm/vbox_drv.c @@ -63,6 +63,8 @@ # define VBOX_VIDEO_NOMODESET() 0 #endif /* !CONFIG_VGA_CONSOLE */ +#include <VBox/VBoxLnxModInline.h> + static int vbox_modeset = -1; MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); @@ -413,6 +415,10 @@ static struct drm_driver driver = { static int __init vbox_init(void) { + /* Check if modue loading was disabled. */ + if (!vbox_mod_should_load()) + return -EINVAL; + printk("vboxvideo: loading version " VBOX_VERSION_STRING " r" __stringify(VBOX_SVN_REV) "\n"); if (VBOX_VIDEO_NOMODESET()) { diff --git a/src/VBox/Additions/linux/drm/vbox_drv.h b/src/VBox/Additions/linux/drm/vbox_drv.h index 8eb9f83e..aaaef937 100644 --- a/src/VBox/Additions/linux/drm/vbox_drv.h +++ b/src/VBox/Additions/linux/drm/vbox_drv.h @@ -538,9 +538,7 @@ int vbox_gem_prime_mmap(struct drm_gem_object *obj, int vbox_irq_init(struct vbox_private *vbox); void vbox_irq_fini(struct vbox_private *vbox); void vbox_report_hotplug(struct vbox_private *vbox); -#if RTLNX_VER_MAX(5,15,0) && !RTLNX_RHEL_MAJ_PREREQ(9,1) && !RTLNX_SUSE_MAJ_PREREQ(15,5) irqreturn_t vbox_irq_handler(int irq, void *arg); -#endif /* vbox_hgsmi.c */ void *hgsmi_buffer_alloc(struct gen_pool *guest_pool, size_t size, diff --git a/src/VBox/Additions/linux/drm/vbox_ttm.c b/src/VBox/Additions/linux/drm/vbox_ttm.c index d020aa3f..d5c64ceb 100644 --- a/src/VBox/Additions/linux/drm/vbox_ttm.c +++ b/src/VBox/Additions/linux/drm/vbox_ttm.c @@ -532,10 +532,15 @@ void vbox_ttm_placement(struct vbox_bo *bo, u32 mem_type) #endif bo->placement.placement = bo->placements; +#if RTLNX_VER_MAX(6,9,0) bo->placement.busy_placement = bo->placements; +#endif if (mem_type & VBOX_MEM_TYPE_VRAM) { -#if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) +#if RTLNX_VER_MIN(6,9,0) + bo->placements[c].mem_type = TTM_PL_VRAM; + PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_FLAG_DESIRED; +#elif RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) bo->placements[c].mem_type = TTM_PL_VRAM; PLACEMENT_FLAGS(bo->placements[c++]) = 0; #elif RTLNX_VER_MIN(5,10,0) @@ -548,7 +553,11 @@ void vbox_ttm_placement(struct vbox_bo *bo, u32 mem_type) #endif } if (mem_type & VBOX_MEM_TYPE_SYSTEM) { -#if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) + +#if RTLNX_VER_MIN(6,9,0) + bo->placements[c].mem_type = TTM_PL_SYSTEM; + PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_FLAG_DESIRED; +#elif RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) bo->placements[c].mem_type = TTM_PL_SYSTEM; PLACEMENT_FLAGS(bo->placements[c++]) = 0; #elif RTLNX_VER_MIN(5,10,0) @@ -561,7 +570,10 @@ void vbox_ttm_placement(struct vbox_bo *bo, u32 mem_type) #endif } if (!c) { -#if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) +#if RTLNX_VER_MIN(6,9,0) + bo->placements[c].mem_type = TTM_PL_SYSTEM; + PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_FLAG_DESIRED; +#elif RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) bo->placements[c].mem_type = TTM_PL_SYSTEM; PLACEMENT_FLAGS(bo->placements[c++]) = 0; #elif RTLNX_VER_MIN(5,10,0) @@ -575,7 +587,9 @@ void vbox_ttm_placement(struct vbox_bo *bo, u32 mem_type) } bo->placement.num_placement = c; +#if RTLNX_VER_MAX(6,9,0) bo->placement.num_busy_placement = c; +#endif #if RTLNX_VER_MIN(3,18,0) || RTLNX_RHEL_MAJ_PREREQ(7,2) for (i = 0; i < c; ++i) { diff --git a/src/VBox/Additions/linux/sharedfolders/files_vboxsf b/src/VBox/Additions/linux/sharedfolders/files_vboxsf index 8187ad33..4de23b09 100755 --- a/src/VBox/Additions/linux/sharedfolders/files_vboxsf +++ b/src/VBox/Additions/linux/sharedfolders/files_vboxsf @@ -72,6 +72,7 @@ FILES_VBOXSF_NOBIN=" \ ${PATH_ROOT}/include/VBox/VBoxGuestMangling.h=>include/VBox/VBoxGuestMangling.h \ ${PATH_ROOT}/include/VBox/VMMDev.h=>include/VBox/VMMDev.h \ ${PATH_ROOT}/include/VBox/VMMDevCoreTypes.h=>include/VBox/VMMDevCoreTypes.h \ + ${PATH_ROOT}/include/VBox/VBoxLnxModInline.h=>VBox/VBoxLnxModInline.h \ ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibInternal.h=>VBoxGuestR0LibInternal.h \ ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibGenericRequest.cpp=>VBoxGuestR0LibGenericRequest.c \ ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibHGCM.cpp=>VBoxGuestR0LibHGCM.c \ diff --git a/src/VBox/Additions/linux/sharedfolders/regops.c b/src/VBox/Additions/linux/sharedfolders/regops.c index ca604090..d98add74 100644 --- a/src/VBox/Additions/linux/sharedfolders/regops.c +++ b/src/VBox/Additions/linux/sharedfolders/regops.c @@ -2535,7 +2535,11 @@ static ssize_t vbsf_reg_read_iter_locking(struct kiocb *kio, struct iov_iter *it if (rc == 0) { size_t iPage = cPages; while (iPage-- > 0) - pReq->PgLst.aPages[iPage] = page_to_phys(papPages[iPage]); + { + RTGCPHYS64 * paDstPages = pReq->PgLst.aPages; + paDstPages[iPage] = page_to_phys(papPages[iPage]); + } + pReq->PgLst.offFirstPage = (uint16_t)offPage0; AssertStmt(cbChunk <= cbToRead, cbChunk = cbToRead); } else { @@ -2749,7 +2753,10 @@ static ssize_t vbsf_reg_write_iter_locking(struct kiocb *kio, struct iov_iter *i if (rc == 0) { size_t iPage = cPages; while (iPage-- > 0) - pReq->PgLst.aPages[iPage] = page_to_phys(papPages[iPage]); + { + RTGCPHYS64 * paDstPages = pReq->PgLst.aPages; + paDstPages[iPage] = page_to_phys(papPages[iPage]); + } pReq->PgLst.offFirstPage = (uint16_t)offPage0; AssertStmt(cbChunk <= cbToWrite, cbChunk = cbToWrite); } else { @@ -3505,7 +3512,7 @@ static struct vm_operations_struct const g_LoggingVmOpsTemplate = { }; /** file_operations::mmap wrapper for logging purposes. */ -extern int vbsf_reg_mmap(struct file *file, struct vm_area_struct *vma) +static int vbsf_reg_mmap(struct file *file, struct vm_area_struct *vma) { int rc; SFLOGFLOW(("vbsf_reg_mmap: file=%p vma=%p\n", file, vma)); @@ -3786,14 +3793,14 @@ static inline void vbsf_write_begin_warn(loff_t pos, unsigned len, unsigned flag } # if RTLNX_VER_MIN(5,19,0) || RTLNX_RHEL_RANGE(9,3, 9,99) -int vbsf_write_begin(struct file *file, struct address_space *mapping, loff_t pos, +static int vbsf_write_begin(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, struct page **pagep, void **fsdata) { vbsf_write_begin_warn(pos, len, 0); return simple_write_begin(file, mapping, pos, len, pagep, fsdata); } # else -int vbsf_write_begin(struct file *file, struct address_space *mapping, loff_t pos, +static int vbsf_write_begin(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata) { vbsf_write_begin_warn(pos, len, flags); diff --git a/src/VBox/Additions/linux/sharedfolders/utils.c b/src/VBox/Additions/linux/sharedfolders/utils.c index b75997a8..7c1fba95 100644 --- a/src/VBox/Additions/linux/sharedfolders/utils.c +++ b/src/VBox/Additions/linux/sharedfolders/utils.c @@ -190,10 +190,11 @@ int vbsf_nls_to_shflstring(struct vbsf_super_info *pSuperInfo, const char *pszNl if (cchNls + 1 < _64K) { pString = (PSHFLSTRING)kmalloc(SHFLSTRING_HEADER_SIZE + cchNls + 1, GFP_KERNEL); if (pString) { + char *pchDst = pString->String.ach; pString->u16Length = (uint16_t)cchNls; pString->u16Size = (uint16_t)(cchNls + 1); - RT_BCOPY_UNFORTIFIED(pString->String.ach, pszNls, cchNls); - pString->String.ach[cchNls] = '\0'; + RT_BCOPY_UNFORTIFIED(pchDst, pszNls, cchNls); + pchDst[cchNls] = '\0'; rc = 0; } else { Log(("vbsf_nls_to_shflstring: failed to allocate %u bytes\n", SHFLSTRING_HEADER_SIZE + cchNls + 1)); diff --git a/src/VBox/Additions/linux/sharedfolders/vfsmod.c b/src/VBox/Additions/linux/sharedfolders/vfsmod.c index 18324fe1..0c5c77af 100644 --- a/src/VBox/Additions/linux/sharedfolders/vfsmod.c +++ b/src/VBox/Additions/linux/sharedfolders/vfsmod.c @@ -63,6 +63,7 @@ #elif RTLNX_VER_MIN(2,6,0) # include <linux/parser.h> #endif +#include <VBox/VBoxLnxModInline.h> /********************************************************************************************************************************* @@ -1408,7 +1409,7 @@ static int vbsf_parse_param(struct fs_context *fc, struct fs_parameter *param) switch (opt) { case Opt_iocharset: case Opt_nls: - strlcpy(info->nls_name, param->string, sizeof(info->nls_name)); + RTStrCopy(info->nls_name, sizeof(info->nls_name), param->string); break; case Opt_uid: info->uid = result.uint_32; @@ -1469,7 +1470,7 @@ static int vbsf_parse_param(struct fs_context *fc, struct fs_parameter *param) printk(KERN_WARNING "vboxsf: cache mode (%u) is out of range, using default instead.\n", result.uint_32); break; case Opt_tag: - strlcpy(info->szTag, param->string, sizeof(info->szTag)); + RTStrCopy(info->szTag, sizeof(info->szTag), param->string); break; default: return invalf(fc, "Invalid mount option: '%s'", param->key); @@ -1528,7 +1529,7 @@ static int vbsf_get_tree(struct fs_context *fc) } /* fc->source (the shared folder name) is set after vbsf_init_fs_ctx() */ - strlcpy(info->name, fc->source, sizeof(info->name)); + RTStrCopy(info->name, sizeof(info->name), fc->source); # if RTLNX_VER_MAX(5,3,0) return vfs_get_super(fc, vfs_get_independent_super, vbsf_read_super_aux); @@ -1621,6 +1622,10 @@ static int __init init(void) int rc; SFLOGFLOW(("vboxsf: init\n")); + /* Check if modue loading was disabled. */ + if (!vbox_mod_should_load()) + return -EINVAL; + /* * Must be paranoid about the vbsf_mount_info_new size. */ |