From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
x86@kernel.org, kvm@vger.kernel.org,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCHv4 3/5] kvm: host side for eoi optimization
Date: Thu, 17 May 2012 12:34:17 +0300 [thread overview]
Message-ID: <20120517093417.GB10209@redhat.com> (raw)
In-Reply-To: <4FB4C3CE.9010907@redhat.com>
On Thu, May 17, 2012 at 12:24:30PM +0300, Avi Kivity wrote:
> On 05/17/2012 11:07 AM, Gleb Natapov wrote:
> > >
> > > No, let's refactor this so it makes sense. The {has|get}_interrupt
> > > split is the cause of the problem, I think. We need a single function,
> > > with callbacks that are called when an event happens. The callbacks can
> > > request an irq window exit, inject an interrupt, play with pveoi, or
> > > cause a #vmexit.
> > >
> > Not sure what do you mean here. I kind of like the code we have now, but
> > this may be because I understand it :)
>
> Right now we have
>
> if (has_interrupt)
> do something
> if (get_interrupt)
> do_something_else
>
Not exactly. Now we have:
if (has_interrupt && can inject)
inject(get_interrupt())
if (still has_interrupt)
notify me when I can inject it.
There is not if(get_interrupt).
> this duplicates some of the logic and causes non-atomicty (which isn't a
> problem per se, but requires us to think of what happens if conditions
> change between the two steps).
>
> What I'm thinking of is
>
> void process_interrupt(bool (*handle)());
Why we even want to pass different handle() to the function?
>
> Where the return value tells us whether the interrupt was accepted by
> the handler. The callback could decide to enable the irq window, to
> queue the interrupt, or to #vmexit (note that the latter can return
Queuing interrupt and requesting irq window ate not mutually exclusive.
> either true or false, depending on whether vmx is configured to ack the
> interrupt or not; svm would return true here if interrupts are intercepted).
>
> --
> error compiling committee.c: too many arguments to function
--
Gleb.
next prev parent reply other threads:[~2012-05-17 9:34 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-16 11:45 [PATCHv4 0/5] apic: eoi optimization support Michael S. Tsirkin
2012-05-16 11:45 ` [PATCHv4 1/5] kvm_para: guest side for eoi avoidance Michael S. Tsirkin
2012-05-16 11:46 ` [PATCHv4 2/5] x86/bitops: note on __test_and_clear_bit atomicity Michael S. Tsirkin
2012-05-16 11:46 ` [PATCHv4 3/5] kvm: host side for eoi optimization Michael S. Tsirkin
2012-05-16 15:49 ` Marcelo Tosatti
2012-05-16 16:22 ` Michael S. Tsirkin
2012-05-16 16:32 ` Gleb Natapov
2012-05-16 16:50 ` Michael S. Tsirkin
2012-05-16 17:04 ` Marcelo Tosatti
2012-05-16 17:21 ` Gleb Natapov
2012-05-16 17:23 ` Marcelo Tosatti
2012-05-16 17:34 ` Gleb Natapov
2012-05-16 17:40 ` Marcelo Tosatti
2012-05-16 17:48 ` Gleb Natapov
2012-05-16 17:53 ` Michael S. Tsirkin
2012-05-16 17:20 ` Marcelo Tosatti
2012-05-16 17:58 ` Michael S. Tsirkin
2012-05-16 18:15 ` Marcelo Tosatti
2012-05-16 18:25 ` Gleb Natapov
2012-05-16 18:29 ` Michael S. Tsirkin
2012-05-16 18:38 ` Gleb Natapov
2012-05-16 19:07 ` Michael S. Tsirkin
2012-05-16 21:37 ` Marcelo Tosatti
2012-05-17 7:28 ` Gleb Natapov
2012-05-17 7:49 ` Michael S. Tsirkin
2012-05-17 7:56 ` Gleb Natapov
2012-05-17 7:57 ` Avi Kivity
2012-05-17 8:07 ` Gleb Natapov
2012-05-17 9:24 ` Avi Kivity
2012-05-17 9:34 ` Gleb Natapov [this message]
2012-05-17 9:10 ` Michael S. Tsirkin
2012-05-17 9:12 ` Gleb Natapov
2012-05-17 9:25 ` Avi Kivity
2012-05-16 18:28 ` Michael S. Tsirkin
2012-05-16 18:35 ` Michael S. Tsirkin
2012-05-17 9:28 ` Avi Kivity
2012-05-16 11:46 ` [PATCHv4 4/5] kvm: eoi msi documentation Michael S. Tsirkin
2012-05-16 11:46 ` [PATCHv4 5/5] kvm: only sync when attention bits set Michael S. Tsirkin
2012-05-16 15:41 ` [PATCHv4 0/5] apic: eoi optimization support Michael S. Tsirkin
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=20120517093417.GB10209@redhat.com \
--to=gleb@redhat.com \
--cc=avi@redhat.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox