Re: Running OSv on kvmtool

2018-04-11 Thread Waldek Kozaczuk
Relateely I came across something called qemu-lite 
- https://github.com/clearcontainers/qemu/tree/qemu-lite-v2.9.0 
and https://github.com/intel/qemu-lite/wiki. It looks like a lighter qemu 
with many features compiled. Now QEMU+OSv runs in around 250ms.

 OSv v0.24-510-g451dc6d
4 CPUs detected
Firmware vendor: SeaBIOS
bsd: initializing - done
VFS: mounting ramfs at /
VFS: mounting devfs at /dev
net: initializing - done
vga: Add VGA device instance
virtio-blk: Add blk device instances 0 as vblk0, devsize=8520192
random: intel drng, rdrand registered as a source.
random:  initialized
VFS: unmounting /dev
VFS: mounting rofs at /rofs
VFS: mounting devfs at /dev
VFS: mounting procfs at /proc
VFS: mounting ramfs at /tmp
disk read (real mode): 39.68ms, (+39.68ms)
uncompress lzloader.elf: 60.83ms, (+21.15ms)
TLS initialization: 61.42ms, (+0.59ms)
.init functions: 63.09ms, (+1.67ms)
SMP launched: 63.88ms, (+0.79ms)
VFS initialized: 66.43ms, (+2.55ms)
Network initialized: 66.87ms, (+0.44ms)
pvpanic done: 66.98ms, (+0.11ms)
pci enumerated: 72.82ms, (+5.84ms)
drivers probe: 72.82ms, (+0.00ms)
drivers loaded: 131.03ms, (+58.21ms)
ROFS mounted: 133.29ms, (+2.27ms)
Total time: 133.29ms, (+0.00ms)
Hello from C code
VFS: unmounting /dev
VFS: unmounting /proc
VFS: unmounting /
ROFS: spent 0.82 ms reading from disk
ROFS: read 21 512-byte blocks from disk
ROFS: allocated 18 512-byte blocks of cache memory
ROFS: hit ratio is 89.47%
Powering off.

real 0m0.266s
user 0m0.105s
sys 0m0.152s

Still 4 times slower than hyperkit on the same machine on OSX - please see 
my other email.

Waldek 

On Wednesday, April 11, 2018 at 12:29:37 PM UTC-4, Pekka Enberg wrote:
>
> Hi,
>
> On Wed, Apr 11, 2018 at 6:08 PM, Waldek Kozaczuk  > wrote:
>
>> Do you know if kvmtool supports multiboot? If so which version?
>>
>
> It does not support Multiboot at all. The main problem with booting OSv is 
> indeed the loading part. kvmtool on x86 only supports Linux bzImage. The 
> MIPS port supports ELF so perhaps that could be included for x86 to to boot 
> OSv.
>
> - Pekka 
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] fix no output boot_time event "TLS initialization"

2018-04-11 Thread Wang Yu



在 18/4/12 上午10:50, Waldek Kozaczuk 写道:

Including the author of the patch.

Sent from my iPhone

On Apr 10, 2018, at 23:44, Waldek Kozaczuk > wrote:



Nice catch.

Even though the patch addresses the bug it also makes _event member 
variable public and therefore weakens encapsulation. I wonder if we 
can address this bug along these lines:

i agree it, thanks for your review,
then i commit v2 patch, and add reviewer Waldek Kozaczuk 


ok?


diff --git a/arch/x64/arch-setup.cc  
b/arch/x64/arch-setup.cc 

index 325c26a..e4c1ab0 100644
--- a/arch/x64/arch-setup.cc 
+++ b/arch/x64/arch-setup.cc 
@@ -134,11 +134,11 @@ void arch_setup_free_memory()
 u64 time;
 time = omb.tsc_init_hi;
 time = (time << 32) | omb.tsc_init;
-boot_time.arrays[0] = { "", time };
+boot_time.event(0, "", time );
 time = omb.tsc_disk_done_hi;
 time = (time << 32) | omb.tsc_disk_done;
-boot_time.arrays[1] = { "disk read (real mode)", time };
+boot_time.event(1, "disk read (real mode)", time );
 auto c = processor::cpuid(0x8000);
 if (c.a >= 0x8008) {
diff --git a/core/chart.cc  b/core/chart.cc 


index 86153a2..59311a9 100644
--- a/core/chart.cc 
+++ b/core/chart.cc 
@@ -20,8 +20,18 @@ void boot_time_chart::print_one_time(int index)
 void boot_time_chart::event(const char *str)
 {
-arrays[_event].str  = str;
-arrays[_event++].stamp = processor::ticks();
+event(_event++, str, processor::ticks());
+}
+
+void boot_time_chart::event(int event_idx, const char *str)
+{
+event(event_idx, str, processor::ticks());
+}
+
+void boot_time_chart::event(int event_idx, const char *str, u64 stamp)
+{
+arrays[event_idx].str = str;
+arrays[event_idx].stamp = stamp;
 }
 void boot_time_chart::print_chart()
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index eb97cc9..391ad8f 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -12,16 +12,17 @@ public:
 class boot_time_chart {
 public:
 void event(const char *str);
+void event(int event_idx, const char *str);
+void event(int event_idx, const char *str, u64 stamp);
 void print_chart();
-time_element arrays[16];
-friend void arch_setup_free_memory();
 private:
 // Can we keep it at 0 and let the initial two users increment 
it?  No, we
 // cannot. The reason is that the code that *parses* those 
fields run
 // relatively late (the code that takes the measure is so early 
it cannot
 // call this one directly. Therefore, the measurements would 
appear in the

 // middle of the list, and we want to preserve order.
-int _event = 2;
+int _event = 3;
+time_element arrays[16];
 void print_one_time(int index);
 double to_msec(u64 time);
diff --git a/loader.cc  b/loader.cc 
index f6cbd4d..de1d772 100644
--- a/loader.cc 
+++ b/loader.cc 
@@ -109,7 +109,8 @@ void premain()
 }
 setup_tls(inittab);
-boot_time.event("TLS initialization");
+debug("After TLS initialization");
+boot_time.event(2, "TLS initialization");
 for (auto init = inittab.start; init < inittab.start + 
inittab.count; ++init) {

 (*init)();
 }


Waldek


On Monday, April 9, 2018 at 8:17:11 AM UTC-4, Wang Yu wrote:

before patch boot with --bootchart, "TLS initialization"
is not output
...
disk read (real mode): 50.71ms, (+50.71ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
after patch,
...
disk read (real mode): 50.71ms, (+50.71ms)
TLS initialization: 83.72ms, (+33.01ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
Signed-off-by: Wang Yu 
---
 include/osv/boot.hh | 4 ++--
loader.cc    | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index eb97cc9..ec5301c 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -15,13 +15,13 @@ public:
 void print_chart();
 time_element arrays[16];
 friend void arch_setup_free_memory();
-private:
 // Can we keep it at 0 and let the initial two users
increment it?  No, we
 // cannot. The reason is that the code that *parses* those
fields run
 // relatively late (the code that takes the measure is so
early it cannot
 // call this one directly. Therefore, the measurements would
appear in the
 // middle 

Re: [PATCH] add boot_time event of uncompress lzloader.elf

2018-04-11 Thread Waldek Kozaczuk
Including the author of the patch. 

Sent from my iPhone

> On Apr 10, 2018, at 23:45, Waldek Kozaczuk  wrote:
> 
> Again it looks correct but if we rework previous patch this would have had to 
> be adjusted as well.
> 
> Regards,
> Waldek
> 
>> On Monday, April 9, 2018 at 8:46:56 AM UTC-4, Wang Yu wrote:
>> sometimes i found uncompres cost serival times, 
>> so add boot_time event of uncompress lzloader.elf 
>> after patch 
>> ... 
>> disk read (real mode): 45.09ms, (+45.09ms) 
>> uncompress lzloader.elf: 76.90ms, (+31.81ms) 
>> TLS initialization: 77.65ms, (+0.75ms) 
>> .init functions: 82.69ms, (+5.04ms) 
>> SMP launched: 83.72ms, (+1.03ms) 
>> VFS initialized: 88.67ms, (+4.95ms) 
>> ... 
>> Signed-off-by: Wang Yu  
>> --- 
>>  arch/x64/arch-setup.cc | 5 + 
>>  arch/x64/boot16.S  | 7 ++- 
>>  include/osv/boot.hh| 2 +- 
>>  loader.cc  | 2 +- 
>>  4 files changed, 13 insertions(+), 3 deletions(-) 
>> 
>> diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc 
>> index 325c26a..ce81437 100644 
>> --- a/arch/x64/arch-setup.cc 
>> +++ b/arch/x64/arch-setup.cc 
>> @@ -50,6 +50,7 @@ struct osv_multiboot_info_type { 
>>  struct multiboot_info_type mb; 
>>  u32 tsc_init, tsc_init_hi; 
>>  u32 tsc_disk_done, tsc_disk_done_hi; 
>> +u32 tsc_uncompress_done, tsc_uncompress_done_hi; 
>>  u8 disk_err; 
>>  } __attribute__((packed)); 
>>   
>> @@ -140,6 +141,10 @@ void arch_setup_free_memory() 
>>  time = (time << 32) | omb.tsc_disk_done; 
>>  boot_time.arrays[1] = { "disk read (real mode)", time }; 
>>   
>> +time = omb.tsc_uncompress_done_hi; 
>> +time = (time << 32) | omb.tsc_uncompress_done; 
>> +boot_time.arrays[2] = { "uncompress lzloader.elf", time }; 
>> + 
>>  auto c = processor::cpuid(0x8000); 
>>  if (c.a >= 0x8008) { 
>>  c = processor::cpuid(0x8008); 
>> diff --git a/arch/x64/boot16.S b/arch/x64/boot16.S 
>> index d8808bd..d053a3f 100644 
>> --- a/arch/x64/boot16.S 
>> +++ b/arch/x64/boot16.S 
>> @@ -20,7 +20,9 @@ mb_tsc1_lo = (mb_info + 88) 
>>  mb_tsc1_hi = (mb_info + 88 + 4) 
>>  mb_tsc_disk_lo = (mb_info + 88 + 8) 
>>  mb_tsc_disk_hi = (mb_info + 88 + 12) 
>> -mb_disk_err = (mb_info + 88 + 16) 
>> +mb_uncompress_lo = (mb_info + 88 + 16) 
>> +mb_uncompress_hi = (mb_info + 88 + 20) 
>> +mb_disk_err = (mb_info + 88 + 24) 
>>  mb_cmdline = (mb_info + 16) 
>>  mb_mmap_len = (mb_info + 44) 
>>  mb_mmap_addr = (mb_info + 48) 
>> @@ -161,6 +163,9 @@ done_e820: 
>>  mov %eax, %fs 
>>  mov %eax, %ss 
>>  call *lzentry 
>> +rdtsc 
>> +mov %eax, mb_uncompress_lo 
>> +mov %edx, mb_uncompress_hi 
>>  mov $loader, %eax 
>>  mov $mb_info, %ebx 
>>  call *entry 
>> diff --git a/include/osv/boot.hh b/include/osv/boot.hh 
>> index ec5301c..4c67410 100644 
>> --- a/include/osv/boot.hh 
>> +++ b/include/osv/boot.hh 
>> @@ -20,7 +20,7 @@ public: 
>>  // relatively late (the code that takes the measure is so early it 
>> cannot 
>>  // call this one directly. Therefore, the measurements would appear in 
>> the 
>>  // middle of the list, and we want to preserve order. 
>> -int _event = 3; 
>> +int _event = 4; 
>>  private: 
>>   
>>  void print_one_time(int index); 
>> diff --git a/loader.cc b/loader.cc 
>> index 0d97151..841e146 100644 
>> --- a/loader.cc 
>> +++ b/loader.cc 
>> @@ -109,7 +109,7 @@ void premain() 
>>  } 
>>   
>>  setup_tls(inittab); 
>> -boot_time._event=2; 
>> +boot_time._event=3; 
>>  boot_time.event("TLS initialization"); 
>>  for (auto init = inittab.start; init < inittab.start + inittab.count; 
>> ++init) { 
>>  (*init)(); 
>> -- 
>> 1.8.3.1 
>> 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "OSv Development" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/osv-dev/Ttl_xdH51i8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] fix no output boot_time event "TLS initialization"

2018-04-11 Thread Waldek Kozaczuk
Including the author of the patch. 

Sent from my iPhone

> On Apr 10, 2018, at 23:44, Waldek Kozaczuk  wrote:
> 
> Nice catch.
> 
> Even though the patch addresses the bug it also makes _event member variable 
> public and therefore weakens encapsulation. I wonder if we can address this 
> bug along these lines:
> 
> diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc
> index 325c26a..e4c1ab0 100644
> --- a/arch/x64/arch-setup.cc
> +++ b/arch/x64/arch-setup.cc
> @@ -134,11 +134,11 @@ void arch_setup_free_memory()
>  u64 time;
>  time = omb.tsc_init_hi;
>  time = (time << 32) | omb.tsc_init;
> -boot_time.arrays[0] = { "", time };
> +boot_time.event(0, "", time );
>  
>  time = omb.tsc_disk_done_hi;
>  time = (time << 32) | omb.tsc_disk_done;
> -boot_time.arrays[1] = { "disk read (real mode)", time };
> +boot_time.event(1, "disk read (real mode)", time );
>  
>  auto c = processor::cpuid(0x8000);
>  if (c.a >= 0x8008) {
> diff --git a/core/chart.cc b/core/chart.cc
> index 86153a2..59311a9 100644
> --- a/core/chart.cc
> +++ b/core/chart.cc
> @@ -20,8 +20,18 @@ void boot_time_chart::print_one_time(int index)
>  
>  void boot_time_chart::event(const char *str)
>  {
> -arrays[_event].str  = str;
> -arrays[_event++].stamp = processor::ticks();
> +event(_event++, str, processor::ticks());
> +}
> +
> +void boot_time_chart::event(int event_idx, const char *str)
> +{
> +event(event_idx, str, processor::ticks());
> +}
> +
> +void boot_time_chart::event(int event_idx, const char *str, u64 stamp)
> +{
> +arrays[event_idx].str = str;
> +arrays[event_idx].stamp = stamp;
>  }
>  
>  void boot_time_chart::print_chart()
> diff --git a/include/osv/boot.hh b/include/osv/boot.hh
> index eb97cc9..391ad8f 100644
> --- a/include/osv/boot.hh
> +++ b/include/osv/boot.hh
> @@ -12,16 +12,17 @@ public:
>  class boot_time_chart {
>  public:
>  void event(const char *str);
> +void event(int event_idx, const char *str);
> +void event(int event_idx, const char *str, u64 stamp);
>  void print_chart();
> -time_element arrays[16];
> -friend void arch_setup_free_memory();
>  private:
>  // Can we keep it at 0 and let the initial two users increment it?  No, 
> we
>  // cannot. The reason is that the code that *parses* those fields run
>  // relatively late (the code that takes the measure is so early it cannot
>  // call this one directly. Therefore, the measurements would appear in 
> the
>  // middle of the list, and we want to preserve order.
> -int _event = 2;
> +int _event = 3;
> +time_element arrays[16];
>  
>  void print_one_time(int index);
>  double to_msec(u64 time);
> diff --git a/loader.cc b/loader.cc
> index f6cbd4d..de1d772 100644
> --- a/loader.cc
> +++ b/loader.cc
> @@ -109,7 +109,8 @@ void premain()
>  }
>  
>  setup_tls(inittab);
> -boot_time.event("TLS initialization");
> +debug("After TLS initialization");
> +boot_time.event(2, "TLS initialization");
>  for (auto init = inittab.start; init < inittab.start + inittab.count; 
> ++init) {
>  (*init)();
>  }
> 
> 
> Waldek
> 
> 
>> On Monday, April 9, 2018 at 8:17:11 AM UTC-4, Wang Yu wrote:
>> before patch boot with --bootchart, "TLS initialization" 
>> is not output 
>> ... 
>> disk read (real mode): 50.71ms, (+50.71ms) 
>> .init functions: 89.20ms, (+5.48ms) 
>> SMP launched: 90.56ms, (+1.36ms) 
>> VFS initialized: 95.76ms, (+5.20ms) 
>> ... 
>> after patch, 
>> ... 
>> disk read (real mode): 50.71ms, (+50.71ms) 
>> TLS initialization: 83.72ms, (+33.01ms) 
>> .init functions: 89.20ms, (+5.48ms) 
>> SMP launched: 90.56ms, (+1.36ms) 
>> VFS initialized: 95.76ms, (+5.20ms) 
>> ... 
>> Signed-off-by: Wang Yu  
>> --- 
>>  include/osv/boot.hh | 4 ++-- 
>>  loader.cc   | 1 + 
>>  2 files changed, 3 insertions(+), 2 deletions(-) 
>> 
>> diff --git a/include/osv/boot.hh b/include/osv/boot.hh 
>> index eb97cc9..ec5301c 100644 
>> --- a/include/osv/boot.hh 
>> +++ b/include/osv/boot.hh 
>> @@ -15,13 +15,13 @@ public: 
>>  void print_chart(); 
>>  time_element arrays[16]; 
>>  friend void arch_setup_free_memory(); 
>> -private: 
>>  // Can we keep it at 0 and let the initial two users increment it?  No, 
>> we 
>>  // cannot. The reason is that the code that *parses* those fields run 
>>  // relatively late (the code that takes the measure is so early it 
>> cannot 
>>  // call this one directly. Therefore, the measurements would appear in 
>> the 
>>  // middle of the list, and we want to preserve order. 
>> -int _event = 2; 
>> +int _event = 3; 
>> +private: 
>>   
>>  void print_one_time(int index); 
>>  double to_msec(u64 time); 
>> diff --git a/loader.cc b/loader.cc 
>> index f6cbd4d..0d97151 

Re: [PATCH] fix no output boot_time event "TLS initialization"

2018-04-11 Thread Wang Yu



在 18/4/12 上午10:22, Waldek Kozaczuk 写道:

Hi.

I reviewed this and other patch and replied on the the mailing list. Have my 
replies not reached you ?.
I haven't recieved it, maybe i am not in the mail list, and you re send 
reviewed  mail to me?


--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] fix no output boot_time event "TLS initialization"

2018-04-11 Thread Waldek Kozaczuk
Hi. 

I reviewed this and other patch and replied on the the mailing list. Have my 
replies not reached you ?

Waldek

Sent from my iPhone

> On Apr 11, 2018, at 22:15, Wang Yu  wrote:
> 
> no one review?
> 
> 
>> 在 18/4/9 下午8:37, Wang Yu 写道:
>> before patch boot with --bootchart, "TLS initialization"
>> is not output
>>...
>>disk read (real mode): 50.71ms, (+50.71ms)
>>.init functions: 89.20ms, (+5.48ms)
>>SMP launched: 90.56ms, (+1.36ms)
>>VFS initialized: 95.76ms, (+5.20ms)
>>...
>> after patch,
>>...
>>disk read (real mode): 50.71ms, (+50.71ms)
>>TLS initialization: 83.72ms, (+33.01ms)
>>.init functions: 89.20ms, (+5.48ms)
>>SMP launched: 90.56ms, (+1.36ms)
>>VFS initialized: 95.76ms, (+5.20ms)
>>...
>> Signed-off-by: Wang Yu 
>> ---
>>  include/osv/boot.hh | 4 ++--
>>  loader.cc   | 1 +
>>  2 files changed, 3 insertions(+), 2 deletions(-)
>> 
>> diff --git a/include/osv/boot.hh b/include/osv/boot.hh
>> index eb97cc9..ec5301c 100644
>> --- a/include/osv/boot.hh
>> +++ b/include/osv/boot.hh
>> @@ -15,13 +15,13 @@ public:
>>  void print_chart();
>>  time_element arrays[16];
>>  friend void arch_setup_free_memory();
>> -private:
>>  // Can we keep it at 0 and let the initial two users increment it?  No, 
>> we
>>  // cannot. The reason is that the code that *parses* those fields run
>>  // relatively late (the code that takes the measure is so early it 
>> cannot
>>  // call this one directly. Therefore, the measurements would appear in 
>> the
>>  // middle of the list, and we want to preserve order.
>> -int _event = 2;
>> +int _event = 3;
>> +private:
>>void print_one_time(int index);
>>  double to_msec(u64 time);
>> diff --git a/loader.cc b/loader.cc
>> index f6cbd4d..0d97151 100644
>> --- a/loader.cc
>> +++ b/loader.cc
>> @@ -109,6 +109,7 @@ void premain()
>>  }
>>setup_tls(inittab);
>> +boot_time._event=2;
>>  boot_time.event("TLS initialization");
>>  for (auto init = inittab.start; init < inittab.start + inittab.count; 
>> ++init) {
>>  (*init)();
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "OSv Development" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/osv-dev/XWBt6oDA6_4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] add boot_time event of uncompress lzloader.elf

2018-04-11 Thread Wang Yu

pls review


在 18/4/9 下午8:46, Wang Yu 写道:

sometimes i found uncompres cost serival times,
so add boot_time event of uncompress lzloader.elf
after patch
...
disk read (real mode): 45.09ms, (+45.09ms)
uncompress lzloader.elf: 76.90ms, (+31.81ms)
TLS initialization: 77.65ms, (+0.75ms)
.init functions: 82.69ms, (+5.04ms)
SMP launched: 83.72ms, (+1.03ms)
VFS initialized: 88.67ms, (+4.95ms)
...
Signed-off-by: Wang Yu 
---
  arch/x64/arch-setup.cc | 5 +
  arch/x64/boot16.S  | 7 ++-
  include/osv/boot.hh| 2 +-
  loader.cc  | 2 +-
  4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc
index 325c26a..ce81437 100644
--- a/arch/x64/arch-setup.cc
+++ b/arch/x64/arch-setup.cc
@@ -50,6 +50,7 @@ struct osv_multiboot_info_type {
  struct multiboot_info_type mb;
  u32 tsc_init, tsc_init_hi;
  u32 tsc_disk_done, tsc_disk_done_hi;
+u32 tsc_uncompress_done, tsc_uncompress_done_hi;
  u8 disk_err;
  } __attribute__((packed));
  
@@ -140,6 +141,10 @@ void arch_setup_free_memory()

  time = (time << 32) | omb.tsc_disk_done;
  boot_time.arrays[1] = { "disk read (real mode)", time };
  
+time = omb.tsc_uncompress_done_hi;

+time = (time << 32) | omb.tsc_uncompress_done;
+boot_time.arrays[2] = { "uncompress lzloader.elf", time };
+
  auto c = processor::cpuid(0x8000);
  if (c.a >= 0x8008) {
  c = processor::cpuid(0x8008);
diff --git a/arch/x64/boot16.S b/arch/x64/boot16.S
index d8808bd..d053a3f 100644
--- a/arch/x64/boot16.S
+++ b/arch/x64/boot16.S
@@ -20,7 +20,9 @@ mb_tsc1_lo = (mb_info + 88)
  mb_tsc1_hi = (mb_info + 88 + 4)
  mb_tsc_disk_lo = (mb_info + 88 + 8)
  mb_tsc_disk_hi = (mb_info + 88 + 12)
-mb_disk_err = (mb_info + 88 + 16)
+mb_uncompress_lo = (mb_info + 88 + 16)
+mb_uncompress_hi = (mb_info + 88 + 20)
+mb_disk_err = (mb_info + 88 + 24)
  mb_cmdline = (mb_info + 16)
  mb_mmap_len = (mb_info + 44)
  mb_mmap_addr = (mb_info + 48)
@@ -161,6 +163,9 @@ done_e820:
  mov %eax, %fs
  mov %eax, %ss
  call *lzentry
+rdtsc
+mov %eax, mb_uncompress_lo
+mov %edx, mb_uncompress_hi
  mov $loader, %eax
  mov $mb_info, %ebx
  call *entry
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index ec5301c..4c67410 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -20,7 +20,7 @@ public:
  // relatively late (the code that takes the measure is so early it cannot
  // call this one directly. Therefore, the measurements would appear in the
  // middle of the list, and we want to preserve order.
-int _event = 3;
+int _event = 4;
  private:
  
  void print_one_time(int index);

diff --git a/loader.cc b/loader.cc
index 0d97151..841e146 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,7 +109,7 @@ void premain()
  }
  
  setup_tls(inittab);

-boot_time._event=2;
+boot_time._event=3;
  boot_time.event("TLS initialization");
  for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
  (*init)();


--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] fix no output boot_time event "TLS initialization"

2018-04-11 Thread Wang Yu

no one review?


在 18/4/9 下午8:37, Wang Yu 写道:

before patch boot with --bootchart, "TLS initialization"
is not output
...
disk read (real mode): 50.71ms, (+50.71ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
after patch,
...
disk read (real mode): 50.71ms, (+50.71ms)
TLS initialization: 83.72ms, (+33.01ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
Signed-off-by: Wang Yu 
---
  include/osv/boot.hh | 4 ++--
  loader.cc   | 1 +
  2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index eb97cc9..ec5301c 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -15,13 +15,13 @@ public:
  void print_chart();
  time_element arrays[16];
  friend void arch_setup_free_memory();
-private:
  // Can we keep it at 0 and let the initial two users increment it?  No, we
  // cannot. The reason is that the code that *parses* those fields run
  // relatively late (the code that takes the measure is so early it cannot
  // call this one directly. Therefore, the measurements would appear in the
  // middle of the list, and we want to preserve order.
-int _event = 2;
+int _event = 3;
+private:
  
  void print_one_time(int index);

  double to_msec(u64 time);
diff --git a/loader.cc b/loader.cc
index f6cbd4d..0d97151 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,6 +109,7 @@ void premain()
  }
  
  setup_tls(inittab);

+boot_time._event=2;
  boot_time.event("TLS initialization");
  for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
  (*init)();


--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Build failed in Jenkins: osv-build-nightly #1439

2018-04-11 Thread jenkins
See 


--
[...truncated 140.73 KB...]
Adding /tests/misc-fsx.so...
Adding /tests/tst-sleep.so...
Adding /tests/tst-resolve.so...
Adding /tests/tst-except.so...
Adding /tests/misc-tcp-sendonly.so...
Adding /tests/tst-tcp-nbwrite.so...
Adding /tests/misc-tcp-hash-srv.so...
Adding /tests/misc-loadbalance.so...
Adding /tests/misc-scheduler.so...
Adding /tests/tst-console.so...
Adding /tests/tst-app.so...
Adding /tests/misc-setpriority.so...
Adding /tests/misc-timeslice.so...
Adding /tests/misc-tls.so...
Adding /tests/misc-gtod.so...
Adding /tests/tst-dns-resolver.so...
Adding /tests/tst-fs-link.so...
Adding /tests/tst-kill.so...
Adding /tests/tst-truncate.so...
Adding /tests/misc-panic.so...
Adding /tests/tst-utimes.so...
Adding /tests/tst-utimensat.so...
Adding /tests/tst-futimesat.so...
Adding /tests/misc-tcp.so...
Adding /tests/tst-strerror_r.so...
Adding /tests/misc-random.so...
Adding /tests/misc-urandom.so...
Adding /tests/tst-commands.so...
Adding /tests/tst-threadcomplete.so...
Adding /tests/tst-timerfd.so...
Adding /tests/tst-nway-merger.so...
Adding /tests/tst-memmove.so...
Adding /tests/tst-pthread-clock.so...
Adding /tests/misc-procfs.so...
Adding /tests/tst-chdir.so...
Adding /tests/tst-chmod.so...
Adding /tests/tst-hello.so...
Adding /tests/misc-concurrent-io.so...
Adding /tests/tst-concurrent-init.so...
Adding /tests/tst-ring-spsc-wraparound.so...
Adding /tests/tst-shm.so...
Adding /tests/tst-align.so...
Adding /tests/tst-cxxlocale.so...
Adding /tests/misc-tcp-close-without-reading.so...
Adding /tests/tst-sigwait.so...
Adding /tests/tst-sampler.so...
Adding /tests/misc-malloc.so...
Adding /tests/misc-memcpy.so...
Adding /tests/misc-free-perf.so...
Adding /tests/tst-fallocate.so...
Adding /tests/misc-printf.so...
Adding /tests/tst-hostname.so...
Adding /tests/tst-sendfile.so...
Adding /tests/misc-lock-perf.so...
Adding /tests/tst-uio.so...
Adding /tests/tst-printf.so...
Adding /tests/tst-pthread-affinity.so...
Adding /tests/tst-pthread-tsd.so...
Adding /tests/tst-thread-local.so...
Adding /tests/tst-zfs-mount.so...
Adding /tests/tst-regex.so...
Adding /tests/tst-tcp-siocoutq.so...
Adding /tests/libtls.so...
Adding /tests/tst-tls.so...
Adding /tests/tst-select-timeout.so...
Adding /tests/tst-faccessat.so...
Adding /tests/tst-fstatat.so...
Adding /tests/misc-reboot.so...
Adding /tests/tst-fcntl.so...
Adding /tests/payload-namespace.so...
Adding /tests/tst-namespace.so...
Adding /tests/tst-without-namespace.so...
Adding /tests/payload-env.so...
Adding /tests/payload-merge-env.so...
Adding /tests/misc-execve.so...
Adding /tests/misc-execve-payload.so...
Adding /tests/misc-mutex2.so...
Adding /tests/tst-pthread-setcancelstate.so...
Adding /tests/tst-syscall.so...
Adding /tests/tst-pin.so...
Adding /tests/tst-run.so...
Adding /tests/tst-ifaddrs.so...
Adding /tests/tst-pthread-affinity-inherit.so...
Adding /tests/tst-sem-timed-wait.so...
Adding /tests/tst-ttyname.so...
Adding /tests/tst-pthread-barrier.so...
Adding /tests/tst-feexcept.so...
Adding /tests/tst-math.so...
Adding /tests/tst-sigaltstack.so...
Adding /tests/tst-fread.so...
Adding /tests/tst-tcp-cork.so...
Adding /tests/tst-tcp-v6.so...
Adding /tests/tst-calloc.so...
Adding /tests/testrunner.so...
Adding /tests/tst-rename.so...
Adding /tests/tst-vfs.so...
Adding /tests/tst-libc-locking.so...
Adding /tests/misc-fs-stress.so...
Adding /tests/misc-bdev-write.so...
Adding /tests/misc-bdev-wlatency.so...
Adding /tests/misc-bdev-rw.so...
Adding /tests/tst-promise.so...
Adding /tests/tst-dlfcn.so...
Adding /tests/tst-stat.so...
Adding /tests/tst-wait-for.so...
Adding /tests/tst-bsd-tcp1.so...
Adding /tests/tst-bsd-tcp1-zsnd.so...
Adding /tests/tst-bsd-tcp1-zrcv.so...
Adding /tests/tst-bsd-tcp1-zsndrcv.so...
Adding /tests/tst-async.so...
Adding /tests/tst-rcu-list.so...
Adding /tests/tst-tcp-listen.so...
Adding /tests/tst-poll.so...
Adding /tests/tst-bitset-iter.so...
Adding /tests/tst-timer-set.so...
Adding /tests/tst-clock.so...
Adding /tests/tst-rcu-hashtable.so...
Adding /tests/tst-unordered-ring-mpsc.so...
Adding /tests/tst-seek.so...
Adding /tests/tst-solaris-taskq.so...
Adding /tests/misc-zfs-io.so...
cpiod finished
+ cd 
+ exec ./scripts/test.py
  TEST java-perms  OK  (8.681 s)
  TEST java_isolated   OK  (13.119 s)
  TEST java_non_isolated   OK  (8.797 s)
  TEST tcp_close_without_reading  qemu-system-x86_64: -redir 
tcp:::: The -redir option is deprecated. Please use '-netdev 
user,hostfwd=...' instead.
 OK  (3.139 s)
  TEST tracing_smoke_test  OK  (16.594 s)
  TEST tst-af-local.so OK  (5.523 s)
  TEST tst-align.soOK  (2.905 s)
  TEST tst-app.so  OK  (2.811 s)
  TEST tst-async.so 

Re: Running OSv on kvmtool

2018-04-11 Thread Pekka Enberg
Hi,

On Wed, Apr 11, 2018 at 6:08 PM, Waldek Kozaczuk 
wrote:

> Do you know if kvmtool supports multiboot? If so which version?
>

It does not support Multiboot at all. The main problem with booting OSv is
indeed the loading part. kvmtool on x86 only supports Linux bzImage. The
MIPS port supports ELF so perhaps that could be included for x86 to to boot
OSv.

- Pekka

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running OSv on kvmtool

2018-04-11 Thread Waldek Kozaczuk
Hi, thanks for the info. 

Do you know if kvmtool supports multiboot? If so which version?

Waldek

Sent from my iPhone

> On Apr 11, 2018, at 09:06, Asias He  wrote:
> 
> 
> 
>> On Wed, Apr 11, 2018 at 9:00 PM, Waldek Kozaczuk  
>> wrote:
>> Has anybody tried it? Is it lighter and faster than QEMU?
>> 
>> Waldek
>> 
>> PS. I have been trying to find an official github repo and many things popup 
>> but hard to tell which one is what.
> 
> 
> The current maintainer's repo is here:
> 
>  https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git
> 
> I update this github repo from time to time:
> 
> https://github.com/kvmtool/kvmtool
> 
> The above two repo should be identical at the moment.
> 
> 
>  
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "OSv Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to osv-dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> -- 
> Asias

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running OSv on kvmtool

2018-04-11 Thread Asias He
On Wed, Apr 11, 2018 at 9:00 PM, Waldek Kozaczuk 
wrote:

> Has anybody tried it? Is it lighter and faster than QEMU?
>
> Waldek
>
> PS. I have been trying to find an official github repo and many things
> popup but hard to tell which one is what.
>


The current maintainer's repo is here:

 https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git

I update this github repo from time to time:

https://github.com/kvmtool/kvmtool

The above two repo should be identical at the moment.




> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Asias

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Running OSv on kvmtool

2018-04-11 Thread Waldek Kozaczuk
Has anybody tried it? Is it lighter and faster than QEMU?

Waldek

PS. I have been trying to find an official github repo and many things 
popup but hard to tell which one is what.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.