[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v4 9/9] plat/linuxu: Correct timeout calculation for ukplat_lcpu_halt_to()



Hi Sharan,

On 08/30/2018 01:34 PM, Sharan Santhanam wrote:
--- a/plat/linuxu/lcpu.c
+++ b/plat/linuxu/lcpu.c
@@ -60,7 +60,12 @@ void halt(void)
  void time_block_until(__snsec until)
  {
      struct timespec timeout;

We are using this timespec from nolibc in the platform library. I would suggest we define a single design principle and stick with it.
+    __nsec now = ukplat_monotonic_clock();
+    if (until < 0 || (__nsec) until < now)
+        return; /* timeout expired already */
+
+    until -= now;
      timeout.tv_sec  = until / ukarch_time_sec_to_nsec(1);
      timeout.tv_nsec = until % ukarch_time_sec_to_nsec(1);

Indeed, I'll fix that, too.

Cheers,
Florian

--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.