Re: [Qemu-devel] BIT_WORD(start >> TARGET_PAGE_BITS)

2017-06-30 Thread ali saeedi
thank you so much Eric
Sorry for too questions
I certainly follow your guide
thanks a lot


On Fri, Jun 30, 2017 at 5:49 PM, Eric Blake  wrote:

> On 06/30/2017 08:02 AM, ali saeedi wrote:
> > Hello
> > what does the following code do?
> > 'unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS)' ?
>
> I've noticed you've been asking a lot of questions (each as a new
> thread, rather than replying to previous answers), that seem like you
> are not trying very hard to read the code and find an answer for
> yourself.  Rather than just answer you, I'm going to try to teach you
> how to read the source and answer the question yourself.  You may also
> get better answers to your future questions if you ask in the form of
> "this code is confusing me, I think it means this, based on what I read
> at xyz, but would like confirmation or correction" (showing WHAT you
> have already researched) rather than just "what does this code do" (and
> making it feel like you are off-loading the research work onto others).
>
> First, figure out what BIT_WORD does:
>
> $ git grep 'define BIT_WORD'
>
> That should have only one hit, in include/qemu/bitops.h.  Reading it in
> context doesn't have any more comments, but it looks like it is
> computing the number of bits that are available in a word, and looks
> like it is defining a word to be the type most efficiently operated on
> for the current ABI (a long is 32 bits on a 32-bit OS, and 64 bits on a
> 64-bit OS).
>
> It also looks like you are scaling a start address by the number of bits
> in a target page.
>
> So it probably means you are computing the index for which page 'start'
> occurs on (depending on values, it might mean that 'start == 0x0' is
> page 0, 'start == 0x1' is page 1, and so on), where start is
> initially in the form of the number of bits per page.
>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.   +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org
>
>


[Qemu-devel] BIT_WORD(start >> TARGET_PAGE_BITS)

2017-06-30 Thread ali saeedi
Hello
what does the following code do?
'unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS)' ?
thanks a lot


[Qemu-devel] Page Block word

2017-06-30 Thread ali saeedi
Hello
what is the difference between word, page and block in qemu?
thanks a lot


[Qemu-devel] DIRTY_MEMORY_BLOCK_SIZE;

2017-06-30 Thread ali saeedi
Hello
what does 'DIRTY_MEMORY_BLOCK_SIZE' mean?
is it the number of words in a block? or number of pages in a block? or
number of bytes in a block?
thanks a lot


[Qemu-devel] Fwd: migration_bitmap_sync()

2017-06-28 Thread ali saeedi
-- Forwarded message --
From: ali saeedi 
Date: Sat, Jun 24, 2017 at 2:50 PM
Subject: migration_bitmap_sync()
To: qemu-devel@nongnu.org


Hello
What does ' migration_bitmap_sync()' function do?
thanks a lot


[Qemu-devel] migration_bitmap_sync()

2017-06-24 Thread ali saeedi
Hello
What does ' migration_bitmap_sync()' function do?
thanks a lot


Re: [Qemu-devel] TARGET_PAGE_BITS

2017-06-23 Thread ali saeedi
thank you for answer
So. why do we have right shift in qemu by "TARGET_PAGE_BITS" ? for exampe
in below code, what does it mean?

static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start,
   ram_addr_t length)
{
unsigned long end, page;

end = TARGET_PAGE_ALIGN(start + length) >> TARGET_PAGE_BITS;
page = start >> TARGET_PAGE_BITS;
...
}
thanks a lot

On Fri, Jun 23, 2017 at 7:11 PM, Alex Bennée  wrote:

>
> ali saeedi  writes:
>
> > Hello
> > What does TARGET_PAGE_BITS mean in qemu code?
>
> It's the page size of the target. e.g.
>
>   TARGET_PAGE_BITS 12
>
>   1 << 12 = 4096 = 4k pages
>
>
> > thanks a lot
>
>
> --
> Alex Bennée
>


[Qemu-devel] TARGET_PAGE_BITS

2017-06-23 Thread ali saeedi
Hello
What does TARGET_PAGE_BITS mean in qemu code?
thanks a lot


[Qemu-devel] migration_bitmap_rcu

2017-06-21 Thread ali saeedi
Hello
Is 'migration_bitmap_rcu-> bmap' a bitmap of *all pages* in ram?
thanks a lot


[Qemu-devel] NMI watchdog bug

2017-06-14 Thread ali saeedi
Hello
I run qemu on linux kernel 4.11.4 at ubuntu lts 16.04 but when booting
guest i encouner this in qemu monitor ' nmi watchdog: bug: soft lockup -
cpu#0 stuck for 23s! [swapper:0/1]'
i follow this link 'http://wiki.qemu.org/Hosts/Linux'
what is the problem
thanks a lot


[Qemu-devel] global bitmap

2017-06-13 Thread ali saeedi
Hello
can i have a bitmap of all pages in the ram? in qemu code, it seems that we
only can have bitmap of pages in a block and we have no global bitmap of
pages.
thanks a lot


Re: [Qemu-devel] Memory dirty event

2017-06-10 Thread ali saeedi
Hello
thanks for your answer
Do i code in kernel space for writing this API?
Please give me more guide about what should i do to write this API.
thanks a lot

On Thu, May 25, 2017 at 5:50 PM, Xiao Guangrong 
wrote:

>
> No API directly supports your case, but you can do it in KVM by using
> page-track mechanism.
>
>
>
> On 05/25/2017 08:26 PM, ali saeedi wrote:
>
>> Hello
>> How can i receive an event when a page or block is dirtied in qemu code?
>> thanks a lot
>>
>>


[Qemu-devel] MemoryRegion and RamBlock

2017-06-06 Thread ali saeedi
Hello all
what does these concepts 'MemoryRegion' and 'RamBlock' mean?
thanks a lot


[Qemu-devel] qemu, kvm and qemu-kvm

2017-06-01 Thread ali saeedi
Hello
what are the difference between kvm, qemu and kvm-qemu?
thanks a lot


[Qemu-devel] page dirtying

2017-05-30 Thread ali saeedi
Hello
I want to have the order of dirty pages in an array and do prediction about
the next page that will be dirtied . so it is important for me to achieve
this order in qemu code. in other word  i need understand as soon as a page
dirties.  what is your recommendations to have this order? I have no
background for kernel coding.
thanks a lot


[Qemu-devel] Memory dirty event

2017-05-25 Thread ali saeedi
Hello
How can i receive an event when a page or block is dirtied in qemu code?
thanks a lot


[Qemu-devel] bitmap

2017-05-22 Thread ali saeedi
Hi
does this code 'atomic_rcu_read(&migration_bitmap_rcu)->bmap' return bitmap
of dirty blocks or bitmap of pages?
thanks a lot


[Qemu-devel] TARGET_PAGE_BITS

2017-05-22 Thread ali saeedi
Hello
What is TARGET_PAGE_BITS in ram.c?
thanks a lot


[Qemu-devel] Offset

2017-05-22 Thread ali saeedi
Hello
what is the difference between offset is available in 'PageSearchStatus'
struct and offset in 'RamBlock' struct in Ram.c File?
thanks a lot


[Qemu-devel] Precopy VM Live Migration

2017-05-21 Thread ali saeedi
Hello
I have understood from code that In Precopy, there is no Priority for
sending dirty pages and qemu  sends a page as soon as it is found in a
block(by linear searching in blocks). in other word, qemu does not consider
to pages that dirties more than others until sends them later than other
pages.
is my understanding true?
thanks a lot


[Qemu-devel] get_queued_page

2017-05-21 Thread ali saeedi
Hello
Is "get_queued_page" function (which is called in line 1383 of ram.c) only
used in postcopy mode and has no usage in precopy mode?
thanks a lot


[Qemu-devel] old_vm_running boolean variable

2017-05-19 Thread ali saeedi
Hello
What is the role of  "old_vm_running" variable in migration_thread?
thanks a lot


[Qemu-devel] order of dirtying pages in vm live migration iterations

2017-05-11 Thread ali saeedi
Hi
Is it possible to have the order of dirtying pages in every iteration of vm
live migration?
thanks a lot


[Qemu-devel] qemu_savevm_state_begin

2017-05-06 Thread ali saeedi
Hi
what is the difference between functions "qemu_savevm_state_begin" and
"qemu_savevm_state_header" in migration_thread?
thanks a lot


[Qemu-devel] vmstate_save_state

2017-05-06 Thread ali saeedi
what does "vmstate_save_state(f, &vmstate_configuration, &savevm_state, 0)"
function call do in "qemu_savevm_state_header" function in savevm.c at line
968 ?
why has "savevm_state" been passed to this function?
thanks a lot


[Qemu-devel] MigrationParams

2017-05-06 Thread ali saeedi
Hi
what are 'blk' and 'shared' boolean variables in MigrationParams structure
in migration.h?
thanks a lot


[Qemu-devel] QEMU_VM_SECTION START/END/PART/FULL

2017-05-04 Thread ali saeedi
Hi
What are  "QEMU_VM_SECTION START/END/PART/FULL" in savevm.c ?
please explain them to me.
thanks a lot.


[Qemu-devel] bytes xfer

2017-04-28 Thread ali saeedi
Hi
what does 'bytes_xfer' and 'xfer_limit' mean?
I am new in qemu.
thanks a lot


[Qemu-devel] qemu_savevm_state_header(s->to_dst_file)

2017-04-27 Thread ali saeedi
Hi
does 'qemu_savevm_state_header(s->to_dst_file)' function in migration.c
only stores header in qemu file and does not send it to destination? if it
sends to destination  which function does that?
thanks alot


[Qemu-devel] sleeping in vm live migration code

2017-04-12 Thread ali saeedi
Hi
why we have below code in vm live migration?
  * g_usleep((initial_time + BUFFER_DELAY - current_time)*1000);*
thanks a lot


[Qemu-devel] help for code

2017-04-12 Thread ali saeedi
Hi
I am new in qemu vm live migration. why we have this condition
"current_time >= initial_time + BUFFER_DELAY" in qemu?
thanks


[Qemu-devel] qemu_file_rate_limit

2017-04-06 Thread ali saeedi
Hi
what does 'qemu_file_rate_limit' function do?
thanks


[Qemu-devel] bytes_xfer and xfer_limit

2017-04-04 Thread ali saeedi
Hi
What are the variables 'bytes_xfer' and 'xfer_limit' in qemu-file.c ?
what does the function 'qemu_file_rate_limit' do?
thanks


[Qemu-devel] Qemu VM Live Migration Code

2017-04-04 Thread ali saeedi
Hello
I am a student who is interested in vm live migration. I want to understand
vm live migration code in qemu. so I tried to understand the code that is
available in 'migration.c' but it is very difficult for me to understand (I
have started from migration_thread function). I also has studied
migration.txt doc in docs folder. but i need more simple document to understand
the code. I know the basic for precopy, postcopy and hybrid algorithms of
vm live migration. I want to understand this implementation and implement
myown  idea by changing this code but I have problems for understanding it.
I also studied this link:
https://developers.redhat.com/blog/2015/03/24/live-
migrating-qemu-kvm-virtual-machines/
but i need more detail to  understand. I will be so grateful if anybody
recommend me a document, resource or any advice that help me for realizing
migration code in 'migration.c' ?
thanks a lot


[Qemu-devel] qemu_savevm_state_header()

2017-04-04 Thread ali saeedi
Hi
I am new in qemu vm live migration. what does 'qemu_savevm_state_header()'
fuction do?
thanks