public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <levinsasha928@gmail.com>
To: penberg@kernel.org
Cc: kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com,
	gorcunov@gmail.com, Sasha Levin <levinsasha928@gmail.com>
Subject: [PATCH 2/3] kvm tools: Add kvm__trigger_irq()
Date: Thu, 11 Aug 2011 15:43:55 +0300	[thread overview]
Message-ID: <1313066636-28332-2-git-send-email-levinsasha928@gmail.com> (raw)
In-Reply-To: <1313066636-28332-1-git-send-email-levinsasha928@gmail.com>

Add a helper function to trigger an IRQ.

This function is usefull when an IRQ line has to be raised and lowered
such as when using MSI-X.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/include/kvm/kvm.h |    1 +
 tools/kvm/kvm.c             |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/include/kvm/kvm.h b/tools/kvm/include/kvm/kvm.h
index 1cbe3c7..ccb20bf 100644
--- a/tools/kvm/include/kvm/kvm.h
+++ b/tools/kvm/include/kvm/kvm.h
@@ -63,6 +63,7 @@ void kvm__setup_bios(struct kvm *kvm);
 void kvm__start_timer(struct kvm *kvm);
 void kvm__stop_timer(struct kvm *kvm);
 void kvm__irq_line(struct kvm *kvm, int irq, int level);
+void kvm__irq_trigger(struct kvm *kvm, int irq);
 bool kvm__emulate_io(struct kvm *kvm, u16 port, void *data, int direction, int size, u32 count);
 bool kvm__emulate_mmio(struct kvm *kvm, u64 phys_addr, u8 *data, u32 len, u8 is_write);
 void kvm__register_mem(struct kvm *kvm, u64 guest_phys, u64 size, void *userspace_addr);
diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c
index 740851d..be4a02a 100644
--- a/tools/kvm/kvm.c
+++ b/tools/kvm/kvm.c
@@ -676,6 +676,12 @@ void kvm__irq_line(struct kvm *kvm, int irq, int level)
 		die_perror("KVM_IRQ_LINE failed");
 }
 
+void kvm__irq_trigger(struct kvm *kvm, int irq)
+{
+	kvm__irq_line(kvm, irq, 1);
+	kvm__irq_line(kvm, irq, 0);
+}
+
 void kvm__dump_mem(struct kvm *kvm, unsigned long addr, unsigned long size)
 {
 	unsigned char *p;
-- 
1.7.6


  reply	other threads:[~2011-08-11 12:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 12:43 [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path Sasha Levin
2011-08-11 12:43 ` Sasha Levin [this message]
2011-08-11 12:43 ` [PATCH 3/3] kvm tools: Add MSI-X support to virtio-net Sasha Levin
2011-08-11 13:33 ` [PATCH 1/3] kvm tools: Make keyboard termination go through regular termination path walimis
2011-08-11 13:39 ` Pekka Enberg
2011-08-11 13:41   ` Sasha Levin
2011-08-11 13:47     ` Pekka Enberg
2011-08-11 13:48       ` Sasha Levin
2011-08-11 14:04         ` Pekka Enberg

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=1313066636-28332-2-git-send-email-levinsasha928@gmail.com \
    --to=levinsasha928@gmail.com \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@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