kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix i8259 for target-arches not supporting KVM
@ 2012-01-29 13:18 Sergei Trofimovich
  2012-01-30 10:08 ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Sergei Trofimovich @ 2012-01-29 13:18 UTC (permalink / raw)
  To: kvm; +Cc: Avi Kivity, Sergei Trofimovich

From: Sergei Trofimovich <slyfox@gentoo.org>

  $ ./configure --target-list=alpha-softmmu && make

      CC    alpha-softmmu/i8259.o
    cc1: warnings being treated as errors
    /home/slyfox/dev/git/qemu-kvm/hw/i8259.c: In function 'kvm_i8259_set_irq':
    /home/slyfox/dev/git/qemu-kvm/hw/i8259.c:688:13: error: implicit declaration of function 'apic_set_irq_delivered'

    /home/slyfox/dev/git/qemu-kvm/hw/i8259.c:688:13: error: nested extern declaration of 'apic_set_irq_delivered'
    make[1]: *** [i8259.o] Error 1
    make: *** [subdir-alpha-softmmu] Error 2

      LINK  alpha-softmmu/qemu-system-alpha
    i8259.o: In function `kvm_i8259_set_irq':
    /tmp/portage/app-emulation/qemu-kvm-9999/work/qemu-kvm-9999/hw/i8259.c:689: undefined reference to `apic_set_irq_delivered'

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 hw/i8259.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/i8259.c b/hw/i8259.c
index 0632ea2..2f6789d 100644
--- a/hw/i8259.c
+++ b/hw/i8259.c
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "apic.h"
 #include "hw.h"
 #include "pc.h"
 #include "isa.h"
@@ -682,12 +683,14 @@ static int kvm_kernel_pic_load_from_user(PicState *s)
 
 static void kvm_i8259_set_irq(void *opaque, int irq, int level)
 {
+#ifdef CONFIG_KVM
     int pic_ret;
     if (kvm_set_irq(irq, level, &pic_ret)) {
         if (pic_ret != 0)
             apic_set_irq_delivered();
         return;
     }
+#endif
 }
 
 device_init(pic_register)
-- 
1.7.8.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix i8259 for target-arches not supporting KVM
  2012-01-29 13:18 [PATCH] Fix i8259 for target-arches not supporting KVM Sergei Trofimovich
@ 2012-01-30 10:08 ` Jan Kiszka
  2012-01-30 17:15   ` Sergei Trofimovich
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2012-01-30 10:08 UTC (permalink / raw)
  To: Sergei Trofimovich; +Cc: kvm, Avi Kivity, Sergei Trofimovich

On 2012-01-29 14:18, Sergei Trofimovich wrote:
> From: Sergei Trofimovich <slyfox@gentoo.org>
> 
>   $ ./configure --target-list=alpha-softmmu && make
> 
>       CC    alpha-softmmu/i8259.o
>     cc1: warnings being treated as errors
>     /home/slyfox/dev/git/qemu-kvm/hw/i8259.c: In function 'kvm_i8259_set_irq':
>     /home/slyfox/dev/git/qemu-kvm/hw/i8259.c:688:13: error: implicit declaration of function 'apic_set_irq_delivered'
> 
>     /home/slyfox/dev/git/qemu-kvm/hw/i8259.c:688:13: error: nested extern declaration of 'apic_set_irq_delivered'
>     make[1]: *** [i8259.o] Error 1
>     make: *** [subdir-alpha-softmmu] Error 2
> 
>       LINK  alpha-softmmu/qemu-system-alpha
>     i8259.o: In function `kvm_i8259_set_irq':
>     /tmp/portage/app-emulation/qemu-kvm-9999/work/qemu-kvm-9999/hw/i8259.c:689: undefined reference to `apic_set_irq_delivered'
> 
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> ---
>  hw/i8259.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/i8259.c b/hw/i8259.c
> index 0632ea2..2f6789d 100644
> --- a/hw/i8259.c
> +++ b/hw/i8259.c
> @@ -21,6 +21,7 @@
>   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
>   * THE SOFTWARE.
>   */
> +#include "apic.h"

Won't be needed with current master.

>  #include "hw.h"
>  #include "pc.h"
>  #include "isa.h"
> @@ -682,12 +683,14 @@ static int kvm_kernel_pic_load_from_user(PicState *s)
>  
>  static void kvm_i8259_set_irq(void *opaque, int irq, int level)
>  {
> +#ifdef CONFIG_KVM
>      int pic_ret;
>      if (kvm_set_irq(irq, level, &pic_ret)) {
>          if (pic_ret != 0)
>              apic_set_irq_delivered();
>          return;
>      }
> +#endif
>  }
>  
>  device_init(pic_register)

This might be in trivial conflict with the current version. You should
rebase, already to remove the include. More consistent would be
KVM_CAP_IRQCHIP in fact, but it doesn't matter that much as this code
will go away soon.

BTW, is the reason for using this repository instead of qemu upstream
for non-x86 related to packaging? It's not qemu-kvm's normal use case
(which doesn't mean it is allowed to break).

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix i8259 for target-arches not supporting KVM
  2012-01-30 10:08 ` Jan Kiszka
@ 2012-01-30 17:15   ` Sergei Trofimovich
  2012-01-30 21:13     ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Sergei Trofimovich @ 2012-01-30 17:15 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: kvm, Avi Kivity

[-- Attachment #1: Type: text/plain, Size: 2884 bytes --]

On Mon, 30 Jan 2012 11:08:37 +0100
Jan Kiszka <jan.kiszka@siemens.com> wrote:

> On 2012-01-29 14:18, Sergei Trofimovich wrote:
> > From: Sergei Trofimovich <slyfox@gentoo.org>
> > 
> >   $ ./configure --target-list=alpha-softmmu && make
> > 
> >       CC    alpha-softmmu/i8259.o
> >     cc1: warnings being treated as errors
> >     /home/slyfox/dev/git/qemu-kvm/hw/i8259.c: In function 'kvm_i8259_set_irq':
> >     /home/slyfox/dev/git/qemu-kvm/hw/i8259.c:688:13: error: implicit declaration of function 'apic_set_irq_delivered'
> > 
> >     /home/slyfox/dev/git/qemu-kvm/hw/i8259.c:688:13: error: nested extern declaration of 'apic_set_irq_delivered'
> >     make[1]: *** [i8259.o] Error 1
> >     make: *** [subdir-alpha-softmmu] Error 2
> > 
> >       LINK  alpha-softmmu/qemu-system-alpha
> >     i8259.o: In function `kvm_i8259_set_irq':
> >     /tmp/portage/app-emulation/qemu-kvm-9999/work/qemu-kvm-9999/hw/i8259.c:689: undefined reference to `apic_set_irq_delivered'
> > 
> > Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> > ---
> >  hw/i8259.c |    3 +++
> >  1 files changed, 3 insertions(+), 0 deletions(-)
> > 
> > diff --git a/hw/i8259.c b/hw/i8259.c
> > index 0632ea2..2f6789d 100644
> > --- a/hw/i8259.c
> > +++ b/hw/i8259.c
> > @@ -21,6 +21,7 @@
> >   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> >   * THE SOFTWARE.
> >   */
> > +#include "apic.h"
> 
> Won't be needed with current master.
> 
> >  #include "hw.h"
> >  #include "pc.h"
> >  #include "isa.h"
> > @@ -682,12 +683,14 @@ static int kvm_kernel_pic_load_from_user(PicState *s)
> >  
> >  static void kvm_i8259_set_irq(void *opaque, int irq, int level)
> >  {
> > +#ifdef CONFIG_KVM
> >      int pic_ret;
> >      if (kvm_set_irq(irq, level, &pic_ret)) {
> >          if (pic_ret != 0)
> >              apic_set_irq_delivered();
> >          return;
> >      }
> > +#endif
> >  }
> >  
> >  device_init(pic_register)
> 
> This might be in trivial conflict with the current version. You should
> rebase, already to remove the include. More consistent would be
> KVM_CAP_IRQCHIP in fact, but it doesn't matter that much as this code
> will go away soon.

Yeah, it was. Will redo with KVM_CAP_IRQCHIP you are eager to accept
such changes (see below).

> BTW, is the reason for using this repository instead of qemu upstream
> for non-x86 related to packaging? It's not qemu-kvm's normal use case
> (which doesn't mean it is allowed to break).

Yeah, I build-only qemu-kvm and use qemu for exotics.

I thought it would help later merging of qemu and qemu-kvm. If it does
not make sense for you (and only creates annoying merge collisions)
I'll stop bothering kvm@ otherwise I'll amend things  and resend :]
(ppc trivially broke as well after recent acpi merge).

Thanks!

-- 

  Sergei

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix i8259 for target-arches not supporting KVM
  2012-01-30 17:15   ` Sergei Trofimovich
@ 2012-01-30 21:13     ` Jan Kiszka
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2012-01-30 21:13 UTC (permalink / raw)
  To: Sergei Trofimovich; +Cc: kvm, Avi Kivity

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2012-01-30 18:15, Sergei Trofimovich wrote:
> On Mon, 30 Jan 2012 11:08:37 +0100 Jan Kiszka
> <jan.kiszka@siemens.com> wrote:
> 
>> On 2012-01-29 14:18, Sergei Trofimovich wrote:
>>> From: Sergei Trofimovich <slyfox@gentoo.org>
>>> 
>>> $ ./configure --target-list=alpha-softmmu && make
>>> 
>>> CC    alpha-softmmu/i8259.o cc1: warnings being treated as
>>> errors /home/slyfox/dev/git/qemu-kvm/hw/i8259.c: In function
>>> 'kvm_i8259_set_irq': 
>>> /home/slyfox/dev/git/qemu-kvm/hw/i8259.c:688:13: error:
>>> implicit declaration of function 'apic_set_irq_delivered'
>>> 
>>> /home/slyfox/dev/git/qemu-kvm/hw/i8259.c:688:13: error: nested
>>> extern declaration of 'apic_set_irq_delivered' make[1]: ***
>>> [i8259.o] Error 1 make: *** [subdir-alpha-softmmu] Error 2
>>> 
>>> LINK  alpha-softmmu/qemu-system-alpha i8259.o: In function
>>> `kvm_i8259_set_irq': 
>>> /tmp/portage/app-emulation/qemu-kvm-9999/work/qemu-kvm-9999/hw/i8259.c:689:
>>> undefined reference to `apic_set_irq_delivered'
>>> 
>>> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> --- 
>>> hw/i8259.c |    3 +++ 1 files changed, 3 insertions(+), 0
>>> deletions(-)
>>> 
>>> diff --git a/hw/i8259.c b/hw/i8259.c index 0632ea2..2f6789d
>>> 100644 --- a/hw/i8259.c +++ b/hw/i8259.c @@ -21,6 +21,7 @@ *
>>> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>>> DEALINGS IN * THE SOFTWARE. */ +#include "apic.h"
>> 
>> Won't be needed with current master.
>> 
>>> #include "hw.h" #include "pc.h" #include "isa.h" @@ -682,12
>>> +683,14 @@ static int kvm_kernel_pic_load_from_user(PicState
>>> *s)
>>> 
>>> static void kvm_i8259_set_irq(void *opaque, int irq, int
>>> level) { +#ifdef CONFIG_KVM int pic_ret; if (kvm_set_irq(irq,
>>> level, &pic_ret)) { if (pic_ret != 0) 
>>> apic_set_irq_delivered(); return; } +#endif }
>>> 
>>> device_init(pic_register)
>> 
>> This might be in trivial conflict with the current version. You
>> should rebase, already to remove the include. More consistent
>> would be KVM_CAP_IRQCHIP in fact, but it doesn't matter that much
>> as this code will go away soon.
> 
> Yeah, it was. Will redo with KVM_CAP_IRQCHIP you are eager to
> accept such changes (see below).
> 
>> BTW, is the reason for using this repository instead of qemu
>> upstream for non-x86 related to packaging? It's not qemu-kvm's
>> normal use case (which doesn't mean it is allowed to break).
> 
> Yeah, I build-only qemu-kvm and use qemu for exotics.
> 
> I thought it would help later merging of qemu and qemu-kvm. If it
> does not make sense for you (and only creates annoying merge
> collisions) I'll stop bothering kvm@ otherwise I'll amend things
> and resend :] (ppc trivially broke as well after recent acpi
> merge).

Helping to clean up things is always appreciated. While the code here
will not make it into upstream, other bits may - or will at least
serve as blueprints for the upstream patches. And maybe certain
distros will like this as well. Some used to build QEMU out of
qemu-kvm sources, IIRC.

Just make sure that a fix is not actually addressing an upstream
issue. Then it should go there first.

Thanks,
Jan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8nCAMACgkQitSsb3rl5xRq0wCeNMkGrJMREb4W0SL8yeo8k/js
vRAAn0eNdzetHn58OyFC0IUbQsArj3c9
=E0j2
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-30 21:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-29 13:18 [PATCH] Fix i8259 for target-arches not supporting KVM Sergei Trofimovich
2012-01-30 10:08 ` Jan Kiszka
2012-01-30 17:15   ` Sergei Trofimovich
2012-01-30 21:13     ` Jan Kiszka

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