* Re: QEMU Clock record and replay [not found] <CAJGDS+F0Mtv+XFXeR4wOP35UjmfKt+fiMAfraT7mg9J-4t+SiA@mail.gmail.com> @ 2021-02-25 15:43 ` Philippe Mathieu-Daudé 2021-02-26 6:24 ` Pavel Dovgalyuk 0 siblings, 1 reply; 5+ messages in thread From: Philippe Mathieu-Daudé @ 2021-02-25 15:43 UTC (permalink / raw) To: Arnabjyoti Kalita, qemu-discuss, qemu-devel Cc: Alex Bennée, Pavel Dovgalyuk Cc'ing Pavel/Alex. On 2/25/21 4:09 PM, Arnabjyoti Kalita wrote: > Hello all, > > I am trying to understand how the clock values are recorded and replayed > in QEMU (when it runs in TCG mode). I have been specifically following > the document that has been provided here - > https://github.com/qemu/qemu/blob/master/docs/replay.txt > <https://github.com/qemu/qemu/blob/master/docs/replay.txt> > > I have the following 4 questions to ask- > > - Why are clock values being replayed off a cache and not directly off > the file as seen here - > https://github.com/qemu/qemu/blob/stable-5.0/replay/replay-time.c#L45? > <https://github.com/qemu/qemu/blob/stable-5.0/replay/replay-time.c#L45?>? > > - I have a requirement to record and replay host clock values. Can it so > happen that if incorrect values of the host clock are replayed, then the > timers in the guest start expiring incorrectly, during replay? > > - Let's say we record the clock values when the guest starts in KVM > mode, and we replay the clock values when the guest starts in TCG mode. > Does the record-replay functionality change a lot? > > - Also, I couldn't understand the specific purpose of replaying the > 'virtual real time clock' ? Do I still need to record and replay the > 'virtual real time clock' if we record the clock values in KVM mode, and > replay the clock values in TCG mode? > > Thank you very much. > > Best Regards, > Arnab > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: QEMU Clock record and replay 2021-02-25 15:43 ` QEMU Clock record and replay Philippe Mathieu-Daudé @ 2021-02-26 6:24 ` Pavel Dovgalyuk 2021-02-26 9:54 ` Alex Bennée 2021-02-27 16:13 ` Arnabjyoti Kalita 0 siblings, 2 replies; 5+ messages in thread From: Pavel Dovgalyuk @ 2021-02-26 6:24 UTC (permalink / raw) To: Philippe Mathieu-Daudé, Arnabjyoti Kalita, qemu-discuss, qemu-devel Cc: Alex Bennée, Pavel Dovgalyuk On 25.02.2021 18:43, Philippe Mathieu-Daudé wrote: > Cc'ing Pavel/Alex. > > On 2/25/21 4:09 PM, Arnabjyoti Kalita wrote: >> Hello all, >> >> I am trying to understand how the clock values are recorded and replayed >> in QEMU (when it runs in TCG mode). I have been specifically following >> the document that has been provided here - >> https://github.com/qemu/qemu/blob/master/docs/replay.txt >> <https://github.com/qemu/qemu/blob/master/docs/replay.txt> >> >> I have the following 4 questions to ask- >> >> - Why are clock values being replayed off a cache and not directly off >> the file as seen here - >> https://github.com/qemu/qemu/blob/stable-5.0/replay/replay-time.c#L45? >> <https://github.com/qemu/qemu/blob/stable-5.0/replay/replay-time.c#L45?>? The cache was needed when replay does not follow the record behavior. E.g., included additional deadline calculations or timer checks. I'm not sure, that it is still needed, and I'll check it during future refactoring session. >> - I have a requirement to record and replay host clock values. Can it so >> happen that if incorrect values of the host clock are replayed, then the >> timers in the guest start expiring incorrectly, during replay? This is a bug, when the host clock is replayed incorrectly. >> - Let's say we record the clock values when the guest starts in KVM >> mode, and we replay the clock values when the guest starts in TCG mode. >> Does the record-replay functionality change a lot? Only if you want to replay just the clock. But replaying whole execution includes instruction counting and thread synchronization. >> - Also, I couldn't understand the specific purpose of replaying the >> 'virtual real time clock' ? Do I still need to record and replay the >> 'virtual real time clock' if we record the clock values in KVM mode, and >> replay the clock values in TCG mode? This clock is used for icount-related timers. For now icount is required for record replay. If you want to replay only host clock, you don't need this one. Pavel Dovgalyuk ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: QEMU Clock record and replay 2021-02-26 6:24 ` Pavel Dovgalyuk @ 2021-02-26 9:54 ` Alex Bennée 2021-02-27 16:31 ` Arnabjyoti Kalita 2021-02-27 16:13 ` Arnabjyoti Kalita 1 sibling, 1 reply; 5+ messages in thread From: Alex Bennée @ 2021-02-26 9:54 UTC (permalink / raw) To: Pavel Dovgalyuk Cc: Pavel Dovgalyuk, Philippe Mathieu-Daudé, qemu-devel, Arnabjyoti Kalita, qemu-discuss Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru> writes: > On 25.02.2021 18:43, Philippe Mathieu-Daudé wrote: >> Cc'ing Pavel/Alex. >> >> On 2/25/21 4:09 PM, Arnabjyoti Kalita wrote: >>> Hello all, >>> >>> I am trying to understand how the clock values are recorded and replayed >>> in QEMU (when it runs in TCG mode). I have been specifically following >>> the document that has been provided here - >>> https://github.com/qemu/qemu/blob/master/docs/replay.txt >>> <https://github.com/qemu/qemu/blob/master/docs/replay.txt> >>> >>> I have the following 4 questions to ask- >>> >>> - Why are clock values being replayed off a cache and not directly off >>> the file as seen here - >>> https://github.com/qemu/qemu/blob/stable-5.0/replay/replay-time.c#L45? >>> <https://github.com/qemu/qemu/blob/stable-5.0/replay/replay-time.c#L45?>? > > The cache was needed when replay does not follow the record behavior. > E.g., included additional deadline calculations or timer checks. > I'm not sure, that it is still needed, and I'll check it during future > refactoring session. > >>> - I have a requirement to record and replay host clock values. Can it so >>> happen that if incorrect values of the host clock are replayed, then the >>> timers in the guest start expiring incorrectly, during replay? > > This is a bug, when the host clock is replayed incorrectly. When you say host clock what do you mean? Surely all the cycle counters are VIRTUAL? Or do you mean things like the RTC? -- Alex Bennée ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: QEMU Clock record and replay 2021-02-26 9:54 ` Alex Bennée @ 2021-02-27 16:31 ` Arnabjyoti Kalita 0 siblings, 0 replies; 5+ messages in thread From: Arnabjyoti Kalita @ 2021-02-27 16:31 UTC (permalink / raw) To: Alex Bennée Cc: Philippe Mathieu-Daudé, Pavel Dovgalyuk, qemu-devel, Pavel Dovgalyuk, qemu-discuss [-- Attachment #1: Type: text/plain, Size: 2091 bytes --] The host clock refers to one of the clock types used by QEMU - ``` @QEMU_CLOCK_HOST: host clock * * The host clock should be used for device models that emulate accurate * real time sources. It will continue to run when the virtual machine * is suspended, and it will reflect system time changes the host may * undergo (e.g. due to NTP). ``` Thanks. Best Regards, Arnab On Fri, Feb 26, 2021 at 3:25 PM Alex Bennée <alex.bennee@linaro.org> wrote: > > Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru> writes: > > > On 25.02.2021 18:43, Philippe Mathieu-Daudé wrote: > >> Cc'ing Pavel/Alex. > >> > >> On 2/25/21 4:09 PM, Arnabjyoti Kalita wrote: > >>> Hello all, > >>> > >>> I am trying to understand how the clock values are recorded and > replayed > >>> in QEMU (when it runs in TCG mode). I have been specifically following > >>> the document that has been provided here - > >>> https://github.com/qemu/qemu/blob/master/docs/replay.txt > >>> <https://github.com/qemu/qemu/blob/master/docs/replay.txt> > >>> > >>> I have the following 4 questions to ask- > >>> > >>> - Why are clock values being replayed off a cache and not directly off > >>> the file as seen here - > >>> https://github.com/qemu/qemu/blob/stable-5.0/replay/replay-time.c#L45? > >>> <https://github.com/qemu/qemu/blob/stable-5.0/replay/replay-time.c#L45 > ?>? > > > > The cache was needed when replay does not follow the record behavior. > > E.g., included additional deadline calculations or timer checks. > > I'm not sure, that it is still needed, and I'll check it during future > > refactoring session. > > > >>> - I have a requirement to record and replay host clock values. Can it > so > >>> happen that if incorrect values of the host clock are replayed, then > the > >>> timers in the guest start expiring incorrectly, during replay? > > > > This is a bug, when the host clock is replayed incorrectly. > > When you say host clock what do you mean? Surely all the cycle counters > are VIRTUAL? Or do you mean things like the RTC? > > -- > Alex Bennée > [-- Attachment #2: Type: text/html, Size: 4710 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: QEMU Clock record and replay 2021-02-26 6:24 ` Pavel Dovgalyuk 2021-02-26 9:54 ` Alex Bennée @ 2021-02-27 16:13 ` Arnabjyoti Kalita 1 sibling, 0 replies; 5+ messages in thread From: Arnabjyoti Kalita @ 2021-02-27 16:13 UTC (permalink / raw) To: Pavel Dovgalyuk Cc: Alex Bennée, Philippe Mathieu-Daudé, qemu-devel, Pavel Dovgalyuk, qemu-discuss [-- Attachment #1: Type: text/plain, Size: 2406 bytes --] Thank you Pavel. You answered all of my questions. The clock record-replay functionality is much clearer now. Best Regards, Arnab On Fri, Feb 26, 2021 at 11:54 AM Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru> wrote: > On 25.02.2021 18:43, Philippe Mathieu-Daudé wrote: > > Cc'ing Pavel/Alex. > > > > On 2/25/21 4:09 PM, Arnabjyoti Kalita wrote: > >> Hello all, > >> > >> I am trying to understand how the clock values are recorded and replayed > >> in QEMU (when it runs in TCG mode). I have been specifically following > >> the document that has been provided here - > >> https://github.com/qemu/qemu/blob/master/docs/replay.txt > >> <https://github.com/qemu/qemu/blob/master/docs/replay.txt> > >> > >> I have the following 4 questions to ask- > >> > >> - Why are clock values being replayed off a cache and not directly off > >> the file as seen here - > >> https://github.com/qemu/qemu/blob/stable-5.0/replay/replay-time.c#L45? > >> <https://github.com/qemu/qemu/blob/stable-5.0/replay/replay-time.c#L45 > ?>? > > The cache was needed when replay does not follow the record behavior. > E.g., included additional deadline calculations or timer checks. > I'm not sure, that it is still needed, and I'll check it during future > refactoring session. > > >> - I have a requirement to record and replay host clock values. Can it so > >> happen that if incorrect values of the host clock are replayed, then the > >> timers in the guest start expiring incorrectly, during replay? > > This is a bug, when the host clock is replayed incorrectly. > > >> - Let's say we record the clock values when the guest starts in KVM > >> mode, and we replay the clock values when the guest starts in TCG mode. > >> Does the record-replay functionality change a lot? > > Only if you want to replay just the clock. > But replaying whole execution includes instruction counting and thread > synchronization. > > >> - Also, I couldn't understand the specific purpose of replaying the > >> 'virtual real time clock' ? Do I still need to record and replay the > >> 'virtual real time clock' if we record the clock values in KVM mode, and > >> replay the clock values in TCG mode? > > This clock is used for icount-related timers. For now icount is required > for record replay. If you want to replay only host clock, you don't need > this one. > > Pavel Dovgalyuk > [-- Attachment #2: Type: text/html, Size: 3479 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-02-27 16:32 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <CAJGDS+F0Mtv+XFXeR4wOP35UjmfKt+fiMAfraT7mg9J-4t+SiA@mail.gmail.com> 2021-02-25 15:43 ` QEMU Clock record and replay Philippe Mathieu-Daudé 2021-02-26 6:24 ` Pavel Dovgalyuk 2021-02-26 9:54 ` Alex Bennée 2021-02-27 16:31 ` Arnabjyoti Kalita 2021-02-27 16:13 ` Arnabjyoti Kalita
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).