All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@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:24:30 +0300	[thread overview]
Message-ID: <4FB4C3CE.9010907@redhat.com> (raw)
In-Reply-To: <20120517080731.GZ32036@redhat.com>

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

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)());

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
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


  reply	other threads:[~2012-05-17  9:24 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 [this message]
2012-05-17  9:34                               ` Gleb Natapov
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=4FB4C3CE.9010907@redhat.com \
    --to=avi@redhat.com \
    --cc=gleb@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 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.