[vbox-dev] Opportunity to significantly shrink the vboxsf Linux driver

Michael Thayer michael.thayer at oracle.com
Mon Jul 10 15:12:36 GMT 2017


Hello Hans,

10.07.2017 12:29, Hans de Goede wrote:
> Hi,
> 
> On 10-07-17 12:08, Hans de Goede wrote:
>> Hi all,
>>
>> During my vboxguest Linux cleanup work I made a small
>> detour to the vboxsf driver.
>>
>> I noticed that although it depends on vboxguest to make
>> hgcm calls, it still comes with its own copy of
>> GenericRequest, Physheap, Init and VMMDev.c
>>
>> It seems the only reason it uses this is to get
>> g_vbgldata.hostVersion so that it can check for
>> page-list support.
>>
>> IMHO it would be better if the vboxguest driver were
>> to store the hostVersion in an exported global
>> variable, say vbg_host_version. And then
>> vboxfs would use that. Combine that with moving:
>>
>> RTSEMFASTMUTEX mutexHGCMHandle;
>> struct VBGLHGCMHANDLEDATA aHGCMHandleData[64];
>>
>>  From g_vbgldata to static globals in HGCM.c
>> and then g_vbgldata can be dropped from
>> VBGLInternal.h together with dropping
>> GenericRequest, Physheap, Init and VMMDev.c
>> completely.
>>
>> I've attached a patch which does this from my
>> own local vboxsf version.
> 
> Ok, that version was no good, I did not notice that
> some of the removed code was responsible for
> calling vbglR0HGCMInit(), here is a new version
> replacing the VbglR0SfInit call with vbglR0HGCMInit.

I have just started reviewing the patch, as the person most familiar
with the code is away just now.  I am not terribly familiar with the
code, but I have had to go through it on occasion in the past, and my
first thought is that this might cause problems on other platforms,
since the common code is shared by the Windows and Solaris drivers.  I
will give you an update when I have read more code.

Regards
Michael

> 
> Regards,
> 
> Hans

-- 
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister
der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher



More information about the vbox-dev mailing list