[vbox-dev] Fixes for API changes in kernel 4.20

Michael Thayer michael.thayer at oracle.com
Fri Dec 7 15:21:10 GMT 2018


Hello Sedat,

Have you tried the latest test builds?

https://www.virtualbox.org/wiki/Testbuilds

Regards
Michael

07.12.18 15:26, Sedat Dilek wrote:
> Hi,
> 
> what is the status of the patch proposal(s)?
> 
> Next weekend there will be Linux v4.20-rc6 and in approx. 2 weeks
> Linux 4.20 final will be released.
> 
> Looking into the issue with ktime_get_real_ts() in
> <r0drv/linux/time-r0drv-linux.c>:
> Are there users requesting to compile against Linux 2.6.16 (see code
> snippets below)?
> Or to ask the other way: Which Linux versions are supported with vbox-5.2.22?
> What is the minimum supported Linux version?
> Do you see an opportunity to purify (shrink) the code?
> 
> In my 1st patch I used timespec64 and ktime_get_real_ts64() which is
> available in Linux >= 3.17 as workaround (being aware this is not
> future-proof).
> 2nd patch recognizes ethtool_ops::ethtool_link_ksettings.
> For the relevant commits see [3]..[5].
> 
> Thanks.
> 
> Regards,
> - Sedat -
> 
> P.S.: Here on Debian/testing AMD64, I got vbox-5.2.22 compiled as a
> DKMS module without errors against Linux v4.20-rc2+.
> P.S.S.: I use builddeb script from the Linux sources to build a Debian
> package which requires the snippet from [2].
> 
> Details see thread on linux-kbuild mailing-list:
> "builddeb: Missing arch/x86/kernel/macros.s when building modules with dkms"
> 
> [1] https://marc.info/?t=154212770600037&r=1&w=2
> [2] https://marc.info/?l=linux-kbuild&m=154302078221592&w=2
> [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/core-api/timekeeping.rst#n140
> -> See "Deprecated time interfaces"
> [4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=976516404ff3fab2a8caa8bd6f5efc1437fed0b8
> ("y2038: remove unused time interfaces")
> [5] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9b3004953503462a4fab31b85e44ae446d48f0bd
> ("ethtool: drop get_settings and set_settings callbacks")
> 
> [ CODE SNIPPETS ]
> 
> [ virtualbox-5.2.22/r0drv/linux/time-r0drv-linux.c ]
> 
> RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime)
> {
>     IPRT_LINUX_SAVE_EFL_AC();
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16)
>     struct timespec Ts;
>     ktime_get_real_ts(&Ts);
>     IPRT_LINUX_RESTORE_EFL_AC();
>     return RTTimeSpecSetTimespec(pTime, &Ts);
> 
> #else   /* < 2.6.16 */
>     struct timeval Tv;
>     do_gettimeofday(&Tv);
>     IPRT_LINUX_RESTORE_EFL_AC();
>     return RTTimeSpecSetTimeval(pTime, &Tv);
> #endif
> }
> RT_EXPORT_SYMBOL(RTTimeNow);
> 
> [ virtualbox-5.2.22/include/iprt/time.h ]
> 
> /**
>  * Sets the time as POSIX timespec.
>  *
>  * @returns pTime.
>  * @param   pTime       The time spec to modify.
>  * @param   pTimespec   Pointer to the POSIX timespec struct with the new time.
>  */
> DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec(PRTTIMESPEC pTime, const
> struct timespec *pTimespec)
> {
>     return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime,
> pTimespec->tv_sec), pTimespec->tv_nsec);
> }
> #endif /* various ways of detecting struct timespec */
> 
> - EOT -
> 

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 2468 bytes
Desc: not available
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20181207/8b9f3686/attachment.bin>


More information about the vbox-dev mailing list