All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nadav Amit <nadav.amit@gmail.com>
To: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH] x86: eventinj: Do a real io_delay()
Date: Fri, 3 May 2019 10:45:03 -0700	[thread overview]
Message-ID: <2D0191F2-105B-4446-89DB-38CC9A3B0527@gmail.com> (raw)
In-Reply-To: <57fcfc11-ec47-8f54-a6d2-e40a706e3a71@oracle.com>

> On May 3, 2019, at 10:38 AM, Krish Sadhukhan <krish.sadhukhan@oracle.com> wrote:
> 
> 
> On 5/2/19 11:49 AM, nadav.amit@gmail.com wrote:
>> From: Nadav Amit <nadav.amit@gmail.com>
>> 
>> There is no guarantee that a self-IPI would be delivered immediately.
>> io_delay() is called after self-IPI is generated but does nothing.
>> Instead, change io_delay() to wait for 10000 cycles, which should be
>> enough on any system whatsoever.
>> 
>> Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
>> ---
>>  x86/eventinj.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/x86/eventinj.c b/x86/eventinj.c
>> index 8064eb9..250537b 100644
>> --- a/x86/eventinj.c
>> +++ b/x86/eventinj.c
>> @@ -18,6 +18,11 @@ void do_pf_tss(void);
>>    static inline void io_delay(void)
>>  {
>> +	u64 start = rdtsc();
>> +
>> +	do {
>> +		pause();
>> +	} while (rdtsc() - start < 10000);
>>  }
>>    static void apic_self_ipi(u8 v)
> 
> Perhaps call delay() (in delay.c) inside of io_delay() OR perhaps replace
> all instances of io_delay() with delay() ?

There is such a mess with this delay(). It times stuff based on number of
pause() invocations. There is an additional implementation in ioapic.c
(which by itself is broken, since there is no compiler barrier).

Let me see what I can do...

      reply	other threads:[~2019-05-03 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 18:49 [kvm-unit-tests PATCH] x86: eventinj: Do a real io_delay() nadav.amit
2019-05-03 17:38 ` Krish Sadhukhan
2019-05-03 17:45   ` Nadav Amit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2D0191F2-105B-4446-89DB-38CC9A3B0527@gmail.com \
    --to=nadav.amit@gmail.com \
    --cc=krish.sadhukhan@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.