Re: [Qemu-devel] [PULL 24/37] qtest: Add set_irq_in command to set IRQ/GPIO level

2019-01-09 Thread Matthew Ogilvie via Qemu-devel
tml > which never got merged. > > Signed-off-by: Steffen Görtz > Reviewed-by: Stefan Hajnoczi > Reviewed-by: Thomas Huth > Reviewed-by: Laurent Vivier > Signed-off-by: Stefan Hajnoczi > Message-id: 20190103091119.9367-2-stefa...@redhat.com > Originally-by: Matthew Ogil

Re: [Qemu-devel] fix clearing i8259 IRQ lines (Was: Should the i8259 devices remain no-user?)

2013-10-26 Thread Matthew Ogilvie
ent noticably more time on qemu patches than I had intended to spend total on playing with this guest, although I may continue if I have a clearly defined strategy.) - Matthew Ogilvie

Re: [Qemu-devel] [PATCH KVM v2 1/4] KVM: fix i8254 IRQ0 to be normally high

2013-01-15 Thread Matthew Ogilvie
On Fri, Jan 11, 2013 at 05:45:28PM +0200, Gleb Natapov wrote: > On Thu, Jan 10, 2013 at 11:40:07PM -0700, Matthew Ogilvie wrote: > > On Tue, Jan 08, 2013 at 09:31:19AM +0200, Gleb Natapov wrote: > > > On Mon, Jan 07, 2013 at 06:17:22PM -0600, mmogi...@miniinfo.net wrote: > >

Re: [Qemu-devel] [PATCH KVM v2 1/4] KVM: fix i8254 IRQ0 to be normally high

2013-01-10 Thread Matthew Ogilvie
On Tue, Jan 08, 2013 at 09:31:19AM +0200, Gleb Natapov wrote: > On Mon, Jan 07, 2013 at 06:17:22PM -0600, mmogi...@miniinfo.net wrote: > > On Mon, 7 Jan 2013 11:39:18 +0200, Gleb Natapov wrote: > > > On Wed, Dec 26, 2012 at 10:39:53PM -0700, Matthew Ogilvie wrote: > > &g

Re: [Qemu-devel] [PATCH KVM v2 2/4] KVM: additional i8254 output fixes

2013-01-10 Thread Matthew Ogilvie
On Tue, Jan 08, 2013 at 09:41:36AM +0200, Gleb Natapov wrote: > On Mon, Jan 07, 2013 at 06:35:47PM -0600, mmogi...@miniinfo.net wrote: > > On Mon, 7 Jan 2013 14:04:03 +0200, Gleb Natapov wrote: > > > On Wed, Dec 26, 2012 at 10:39:54PM -0700, Matthew Ogilvie wrote: >

[Qemu-devel] [PATCH KVM v2 2/4] KVM: additional i8254 output fixes

2012-12-26 Thread Matthew Ogilvie
ch the net for 23124406.pdf. Signed-off-by: Matthew Ogilvie --- arch/x86/kvm/i8254.c | 44 ++-- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index cd4ec60..fd38938 100644 --- a/arch/x86/kvm/i82

[Qemu-devel] [PATCH KVM v2 3/4] KVM: fix i8259 interrupt high to low transition logic

2012-12-26 Thread Matthew Ogilvie
y to deliver an interrupt to the CPU even though IRQ2 had dropped again, resulting in a spurious interupt (IRQ15) and a panicked UNIX kernel. Signed-off-by: Matthew Ogilvie --- arch/x86/kvm/i8259.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/i82

[Qemu-devel] [PATCH KVM v2 1/4] KVM: fix i8254 IRQ0 to be normally high

2012-12-26 Thread Matthew Ogilvie
rth the effort. Signed-off-by: Matthew Ogilvie --- arch/x86/kvm/i8254.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index c1d30b2..cd4ec60 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -290,8 +290,12 @@

[Qemu-devel] [PATCH KVM v2 0/4] fix KVM i8259 IRQ trailing-edge logic

2012-12-26 Thread Matthew Ogilvie
ll probably dig into qemu_irq_pulse() callers more carefully eventually, but there are lot of them, and any high-level incite anyone can provide into them would be helpful. See the Dec 16 patch series I sent to the qemu mailing list for more information. http://search.gmane.org/?query=ogilvie&g

[Qemu-devel] [PATCH KVM v2 4/4] KVM: i8259: refactor pic_set_irq level logic

2012-12-26 Thread Matthew Ogilvie
No change in functionality. Clarify that the only difference between level triggered and edge triggered interrupts is on the leading edge. Signed-off-by: Matthew Ogilvie --- arch/x86/kvm/i8259.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a

[Qemu-devel] [PATCH v8 09/10] qtest: add set_irq_{in, out} infrastructure for testing interrupt controllers

2012-12-16 Thread Matthew Ogilvie
Signed-off-by: Matthew Ogilvie --- hw/i8259.c | 6 ++ qtest.c | 51 +++ tests/libqtest.c | 12 tests/libqtest.h | 48 4 files changed, 117 insertions(+) diff --git

[Qemu-devel] [PATCH v8 06/10] i8259: fix so that dropping IRQ level always clears the interrupt request

2012-12-16 Thread Matthew Ogilvie
ent edge during initialization, but had been masked off even before I masked it off?] --- Patched qemu: cmdRead unmask IRR=4005 mask IRR=4001 sti unmask irq14 IRR=0001 DONE ------- Signed-off-by: Matthew Ogilvie --- There is a risk that some other device models depend on the brok

[Qemu-devel] [PATCH v8 04/10] vga: add some optional CGA compatibility hacks

2012-12-16 Thread Matthew Ogilvie
issues in this patch). Eventually real MDA and/or CGA support might provide an alternative to this patch, although a hybrid approach like this patch might still be useful in marginal cases. Signed-off-by: Matthew Ogilvie --- hw/pc.h | 4 hw/vga.c

[Qemu-devel] [PATCH v8 02/10] vl: fix -hdachs/-hda argument order parsing issues

2012-12-16 Thread Matthew Ogilvie
Signed-off-by: Matthew Ogilvie --- vl.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/vl.c b/vl.c index 3ebf01f..12786f0 100644 --- a/vl.c +++ b/vl.c @@ -2528,8 +2528,9 @@ int main(int argc, char **argv, char **envp)

[Qemu-devel] [PATCH v8 10/10] add test/pic-test.c

2012-12-16 Thread Matthew Ogilvie
tests), but it seems best to fix the issue generically if possible. Signed-off-by: Matthew Ogilvie --- tests/Makefile | 2 + tests/pic-test.c | 127 +++ 2 files changed, 129 insertions(+) create mode 100644 tests/pic-test.c diff --git

[Qemu-devel] [PATCH v8 08/10] qtest: fix qemu_irq_intercept_out()

2012-12-16 Thread Matthew Ogilvie
For the 8259 (at least), we need to modify the entries in gpio_out (which is pointing at PICCommonState::int_out) in-place rather than change it to point to a totally different table. The 8259 sends its output to int_out even if gpio_out is a different table. Signed-off-by: Matthew Ogilvie

[Qemu-devel] [PATCH v8 03/10] qemu-options.hx: mention retrace= VGA option

2012-12-16 Thread Matthew Ogilvie
The feature was added in commit cb5a7aa8c32141bb Sep 2008. My description is based on "Better VGA retrace emulation (needed for some DOS games/demos)" from http://www.boblycat.org/~malc/code/patches/qemu/index.html Signed-off-by: Matthew Ogilvie --- qemu-options.hx | 8 +++- 1 fi

[Qemu-devel] [PATCH v8 00/10] i8254, i8259 and running Microport UNIX (ca 1987)

2012-12-16 Thread Matthew Ogilvie
empted to only fix the cascade interrupt (IRQ2) in the i8259 (leaving others as-is), until such time as all these device models are improved. - Matthew Ogilvie (10): fix some debug printf format strings vl: fix -hdachs/-hda argument order parsing issues qemu-options.hx: mention retrace=

[Qemu-devel] [PATCH v8 05/10] fix i8254 output logic to match the spec

2012-12-16 Thread Matthew Ogilvie
est to reset the PIT mode 4 one-shot counter "soon enough". This combination should be rare enough that more complicated solutions are not worth the effort. Signed-off-by: Matthew Ogilvie --- hw/i8254.c| 24 ++-- hw/i8254_common.c | 18 ++--

[Qemu-devel] [PATCH v8 07/10] i8259: refactor pic_set_irq level logic

2012-12-16 Thread Matthew Ogilvie
No change in functionality. Clarify that the only difference between level triggered and edge triggered interrupts is on the leading edge. Signed-off-by: Matthew Ogilvie --- hw/i8259.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/hw/i8259.c b

[Qemu-devel] [PATCH v8 01/10] fix some debug printf format strings

2012-12-16 Thread Matthew Ogilvie
These are normally ifdefed out and don't matter. But if you enable them, they ought to be correct. Signed-off-by: Matthew Ogilvie --- hw/cirrus_vga.c | 4 ++-- hw/i8259.c | 3 ++- hw/ide/cmd646.c | 5 +++-- hw/ide/via.c| 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-)

Re: [Qemu-devel] [PATCH v7 00/10] i8254, i8259 and running Microport UNIX (ca 1987)

2012-12-11 Thread Matthew Ogilvie
On Tue, Dec 11, 2012 at 06:19:56PM +0200, Gleb Natapov wrote: > On Sun, Nov 25, 2012 at 02:51:36PM -0700, Matthew Ogilvie wrote: > > > > Still needed: > > > > * Corresponding KVM patches. The best approach may depend > > on what

Re: [Qemu-devel] [PATCH v7 00/10] i8254, i8259 and running Microport UNIX (ca 1987)

2012-12-11 Thread Matthew Ogilvie
On Tue, Dec 11, 2012 at 11:20:05AM +, Jamie Lokier wrote: > Matthew Ogilvie wrote: > > 2. Just fix it immediately, and don't worry about migration. Squash > >the last few patches together. A single missed periodic > >timer tick that only happens when migrati

Re: [Qemu-devel] [PATCH v7 00/10] i8254, i8259 and running Microport UNIX (ca 1987)

2012-12-10 Thread Matthew Ogilvie
On Mon, Dec 10, 2012 at 10:47:59AM -0600, Anthony Liguori wrote: > Jan Kiszka writes: > > > On 2012-12-10 06:14, Matthew Ogilvie wrote: > >> On Sun, Nov 25, 2012 at 02:51:36PM -0700, Matthew Ogilvie wrote: > >>> This series makes a series of mostly-unrelated fi

Re: [Qemu-devel] [PATCH v7 00/10] i8254, i8259 and running Microport UNIX (ca 1987)

2012-12-09 Thread Matthew Ogilvie
On Sun, Nov 25, 2012 at 02:51:36PM -0700, Matthew Ogilvie wrote: > This series makes a series of mostly-unrelated fixes to allow > running an old Microport UNIX (ca 1987) guest under qemu. > > Changes since version 6: >* Patches 1 through 6 haven't changed, other tha

[Qemu-devel] [PATCH v7 06/10] i8259: refactor pic_set_irq level logic

2012-11-25 Thread Matthew Ogilvie
No change in functionality. Clarify that the only difference between level triggered and edge triggered interrupts is on the leading edge. Signed-off-by: Matthew Ogilvie --- hw/i8259.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/hw/i8259.c b

[Qemu-devel] [PATCH v7 01/10] fix some debug printf format strings

2012-11-25 Thread Matthew Ogilvie
These are normally ifdefed out and don't matter. But if you enable them, they ought to be correct. Signed-off-by: Matthew Ogilvie --- hw/cirrus_vga.c | 4 ++-- hw/i8259.c | 3 ++- hw/ide/cmd646.c | 5 +++-- hw/ide/via.c| 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-)

[Qemu-devel] [PATCH v7 08/10] i8254: add comments about fixing timings

2012-11-25 Thread Matthew Ogilvie
There may be risk of problems with migration if these are just fixed blindly, but at least comment what it ought to be changed to. Signed-off-by: Matthew Ogilvie --- hw/i8254.c| 31 ++- hw/i8254_common.c | 40 2 files

[Qemu-devel] [PATCH v7 07/10] i8254/i8259: workaround to make IRQ0 work like before

2012-11-25 Thread Matthew Ogilvie
Someday it should be fixed properly, but doing so may break migration. So go with an incremental approach instead. Signed-off-by: Matthew Ogilvie --- hw/i8259.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/hw/i8259.c b/hw/i8259.c index 9b2ec40

[Qemu-devel] [PATCH v7 05/10] i8259: fix so that dropping IRQ level always clears the interrupt request

2012-11-25 Thread Matthew Ogilvie
ent edge during initialization, but had been masked off even before I masked it off?] --- Patched qemu: cmdRead unmask IRR=4005 mask IRR=4001 sti unmask irq14 IRR=0001 DONE ------- Signed-off-by: Matthew Ogilvie --- hw/i8259.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw

[Qemu-devel] [PATCH v7 00/10] i8254, i8259 and running Microport UNIX (ca 1987)

2012-11-25 Thread Matthew Ogilvie
t's certainly getting rather far afield from running Microport UNIX... Matthew Ogilvie (10): fix some debug printf format strings vl: fix -hdachs/-hda argument order parsing issues qemu-options.hx: mention retrace= VGA option vga: add some optional CGA compatibility hacks i8259: fix

[Qemu-devel] [PATCH v7 10/10] FOR FUTURE: fix i8254/i8259 IRQ0 line logic

2012-11-25 Thread Matthew Ogilvie
ed in with earlier patches instead of kept separate. Signed-off-by: Matthew Ogilvie --- hw/i8254.c| 106 +++--- hw/i8254_common.c | 58 -- hw/i8259.c| 19 +- 3 files changed, 20 insertions(+), 163

[Qemu-devel] [PATCH v7 09/10] i8254: prepare for migration compatibility with future fixes

2012-11-25 Thread Matthew Ogilvie
. Signed-off-by: Matthew Ogilvie --- Alternatives: An alternative for mode 2 might involve tweaking pit_get_next_transition_time() to create an extra pseudo-transition at the same clock tick that will eventually have the "real" transition (so it has 3 "transitions" per period).

[Qemu-devel] [PATCH v7 04/10] vga: add some optional CGA compatibility hacks

2012-11-25 Thread Matthew Ogilvie
issues in this patch). Eventually real MDA and/or CGA support might provide an alternative to this patch, although a hybrid approach like this patch might still be useful in marginal cases. Signed-off-by: Matthew Ogilvie --- hw/pc.h | 4 hw/vga.c

[Qemu-devel] [PATCH v7 03/10] qemu-options.hx: mention retrace= VGA option

2012-11-25 Thread Matthew Ogilvie
The feature was added in commit cb5a7aa8c32141bb Sep 2008. My description is based on "Better VGA retrace emulation (needed for some DOS games/demos)" from http://www.boblycat.org/~malc/code/patches/qemu/index.html Signed-off-by: Matthew Ogilvie --- qemu-options.hx | 8 +++- 1 fi

[Qemu-devel] [PATCH v7 02/10] vl: fix -hdachs/-hda argument order parsing issues

2012-11-25 Thread Matthew Ogilvie
Signed-off-by: Matthew Ogilvie --- vl.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/vl.c b/vl.c index c8e9c78..c6c7d95 100644 --- a/vl.c +++ b/vl.c @@ -2533,8 +2533,9 @@ int main(int argc, char **argv, char **envp)

Re: [Qemu-devel] [PATCH v5 5/6] i8259: fix so that dropping IRQ level always clears the interrupt request

2012-11-19 Thread Matthew Ogilvie
On Mon, Nov 19, 2012 at 04:28:31PM +0100, BALATON Zoltan wrote: > On Sun, 9 Sep 2012, Matthew Ogilvie wrote: > > Intel's definition of "edge triggered" means: "asserted with a > > low-to-high transition at the time an interrupt is registered and > > then ke

[Qemu-devel] [PATCH v6 8/8] i8259/i8254: migration workaround for timer

2012-09-30 Thread Matthew Ogilvie
Signed-off-by: Matthew Ogilvie --- It is not at all clear that this is the best way to handle this. See the detailed notes in the cover letter of this patch series. UPDATE: Also, some fixes moved the leading edge by 1 CLK tick (CLK ticks at about 1.1 MHz), and some strategies like this might

[Qemu-devel] [PATCH v6 3/8] qemu-options.hx: mention retrace= VGA option

2012-09-30 Thread Matthew Ogilvie
The feature was added in commit cb5a7aa8c32141bb Sep 2008. My description is based on "Better VGA retrace emulation (needed for some DOS games/demos)" from http://www.boblycat.org/~malc/code/patches/qemu/index.html Signed-off-by: Matthew Ogilvie --- qemu-options.hx | 8 +++- 1 fi

[Qemu-devel] [PATCH v6 0/8] i8254, i8259 and running Microport UNIX (ca 1987)

2012-09-30 Thread Matthew Ogilvie
be low, etc), as long as it isn't trying to catch up. This could lead to somewhat random durations of IRQ0=low, which might cause more intermitment/confusing bugs than just always modeling it as short-duration. Perhaps if some rare guest cares about IRQ0=low duration, then user could just disable

[Qemu-devel] [PATCH v6 7/8] i8259: refactor pic_set_irq level logic

2012-09-30 Thread Matthew Ogilvie
No change in functionality. Clarify that the only difference between level triggered and edge triggered interrupts is on the leading edge. Signed-off-by: Matthew Ogilvie --- hw/i8259.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/hw/i8259.c b

[Qemu-devel] [PATCH v6 5/8] i8254: fix inaccuracies in pit_get_out()

2012-09-30 Thread Matthew Ogilvie
only be an issue for some migration cases. Signed-off-by: Matthew Ogilvie --- There are still some things not quite modeled correctly. See the cover letter of this patch series for details, and the FIXME comments added to the code. hw/i8254.c| 24 ++-- hw/i8254_com

[Qemu-devel] [PATCH v6 6/8] i8259: fix so that dropping IRQ level always clears the interrupt request

2012-09-30 Thread Matthew Ogilvie
ent edge during initialization, but had been masked off even before I masked it off?] --- Patched qemu: cmdRead unmask IRR=4005 mask IRR=4001 sti unmask irq14 IRR=0001 DONE ------- Signed-off-by: Matthew Ogilvie --- hw/i8259.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw

[Qemu-devel] [PATCH v6 1/8] fix some debug printf format strings

2012-09-30 Thread Matthew Ogilvie
These are normally ifdefed out and don't matter. But if you enable them, they ought to be correct. Signed-off-by: Matthew Ogilvie --- hw/cirrus_vga.c | 4 ++-- hw/i8259.c | 3 ++- hw/ide/cmd646.c | 5 +++-- hw/ide/via.c| 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-)

[Qemu-devel] [PATCH v6 4/8] vga: add some optional CGA compatibility hacks

2012-09-30 Thread Matthew Ogilvie
issues in this patch). Eventually real MDA and/or CGA support might provide an alternative to this patch, although a hybrid approach like this patch might still be useful in marginal cases. Signed-off-by: Matthew Ogilvie --- hw/pc.h | 4 hw/vga.c

[Qemu-devel] [PATCH v6 2/8] vl: fix -hdachs/-hda argument order parsing issues

2012-09-30 Thread Matthew Ogilvie
Signed-off-by: Matthew Ogilvie --- vl.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/vl.c b/vl.c index 8d305ca..e1d2f7e 100644 --- a/vl.c +++ b/vl.c @@ -2362,8 +2362,9 @@ int main(int argc, char **argv, char **envp) char boot_

Re: [Qemu-devel] [PATCH 1/2] KVM: fix i8259 interrupt high to low transition logic

2012-09-12 Thread Matthew Ogilvie
On Wed, Sep 12, 2012 at 10:57:57AM +0200, Jan Kiszka wrote: > On 2012-09-12 10:51, Avi Kivity wrote: > > On 09/12/2012 11:48 AM, Jan Kiszka wrote: > >> On 2012-09-12 10:01, Avi Kivity wrote: > >>> On 09/10/2012 04:29 AM, Matthew Ogilvie wrote: > >>>>

Re: [Qemu-devel] [PATCH 1/2] KVM: fix i8259 interrupt high to low transition logic

2012-09-10 Thread Matthew Ogilvie
On Tue, Sep 11, 2012 at 01:49:51AM +0100, Maciej W. Rozycki wrote: > On Sun, 9 Sep 2012, Matthew Ogilvie wrote: > > > This bug manifested itself when the guest was Microport UNIX > > System V/386 v2.1 (ca. 1987), because it would sometimes mask > > off IRQ14 in the slave

Re: [Qemu-devel] [PATCH v5 5/6] i8259: fix so that dropping IRQ level always clears the interrupt request

2012-09-10 Thread Matthew Ogilvie
On Mon, Sep 10, 2012 at 11:09:27AM +0200, Jan Kiszka wrote: > On 2012-09-10 10:56, Avi Kivity wrote: > > On 09/10/2012 04:27 AM, Matthew Ogilvie wrote: > >> Intel's definition of "edge triggered" means: "asserted with a > >> low-to-high transi

[Qemu-devel] [PATCH v5 2/6] vl: fix -hdachs/-hda argument order parsing issues

2012-09-09 Thread Matthew Ogilvie
Signed-off-by: Matthew Ogilvie --- vl.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/vl.c b/vl.c index 7c577fa..febfd62 100644 --- a/vl.c +++ b/vl.c @@ -2352,8 +2352,9 @@ int main(int argc, char **argv, char **envp) char boot_

[Qemu-devel] [PATCH v5 4/6] vga: add some optional CGA compatibility hacks

2012-09-09 Thread Matthew Ogilvie
issues in this patch). Eventually real MDA and/or CGA support might provide an alternative to this patch, although a hybrid approach like this patch might still be useful in marginal cases. Signed-off-by: Matthew Ogilvie --- hw/pc.h | 4 hw/vga.c

[Qemu-devel] [PATCH v5 5/6] i8259: fix so that dropping IRQ level always clears the interrupt request

2012-09-09 Thread Matthew Ogilvie
y to deliver an interrupt even though IRQ2 had dropped again, resulting in a spurious interupt (IRQ15) and a panicked kernel. Signed-off-by: Matthew Ogilvie --- If you missed the previous thread about this, see http://www.mail-archive.com/qemu-devel@nongnu.org/msg129071.html hw/i8259.c

[Qemu-devel] [PATCH 1/2] KVM: fix i8259 interrupt high to low transition logic

2012-09-09 Thread Matthew Ogilvie
y to deliver an interrupt even though IRQ2 had dropped again, resulting in a spurious interupt (IRQ15) and a panicked UNIX kernel. Signed-off-by: Matthew Ogilvie --- There has been some discussions about this on the qemu mailing list; for example see http://www.mail-archive.com/qemu-devel@nongnu

[Qemu-devel] [PATCH v5 3/6] qemu-options.hx: mention retrace= VGA option

2012-09-09 Thread Matthew Ogilvie
The feature was added in commit cb5a7aa8c32141bb Sep 2008. My description is based on "Better VGA retrace emulation (needed for some DOS games/demos)" from http://www.boblycat.org/~malc/code/patches/qemu/index.html Signed-off-by: Matthew Ogilvie --- qemu-options.hx | 8 +++- 1 fi

[Qemu-devel] [PATCH 2/2] KVM: i8259: refactor pic_set_irq level logic

2012-09-09 Thread Matthew Ogilvie
No change in functionality. Clarify that the only difference between level triggered and edge triggered interrupts is on the leading edge. Signed-off-by: Matthew Ogilvie --- arch/x86/kvm/i8259.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a

[Qemu-devel] [PATCH v5 6/6] i8259: refactor pic_set_irq level logic

2012-09-09 Thread Matthew Ogilvie
No change in functionality. Clarify that the only difference between level triggered and edge triggered interrupts is on the leading edge. Signed-off-by: Matthew Ogilvie --- hw/i8259.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/hw/i8259.c b

[Qemu-devel] [PATCH] [kvm-unit-tests] add x86/test8259.S

2012-09-09 Thread Matthew Ogilvie
This tests how the master i8259 handles a falling IRQ2 cascade interrupt when the original interrupt is masked off in the slave's IMR register. It should cancel the interrupt, and not deliver anything to the CPU until it is unmasked again. Signed-off-by: Matthew Ogilvie --- On Mon, S

[Qemu-devel] [PATCH v5 1/6] fix some debug printf format strings

2012-09-09 Thread Matthew Ogilvie
These are normally ifdefed out and don't matter. But if you enable them, they ought to be correct. Signed-off-by: Matthew Ogilvie --- hw/cirrus_vga.c | 4 ++-- hw/i8259.c | 3 ++- hw/ide/cmd646.c | 5 +++-- hw/ide/via.c| 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-)

[Qemu-devel] [PATCH v5 0/6] Running Microport UNIX (ca 1987)

2012-09-09 Thread Matthew Ogilvie
separately: * Two KVM (Linux kernel) patches that do roughly the same thing as patches 5 and 6, only for the in-kernel PIC. * A patch for the kvm-unit-tests project that adds a test case to demonstrate the trailing edge behavior. Matthew Ogilvie (6): fix some debug printf form

Re: [Qemu-devel] [PATCH v4 5/5] i8259: fix dynamically masking slave IRQs with IMR register

2012-09-04 Thread Matthew Ogilvie
} pic_update_irq(s); } Perhaps it would be worth it to swap around the "if"s a little bit to avoid the (!level) duplication, and clarify that the only difference is in the low to high transition? - Matthew Ogilvie

[Qemu-devel] [PATCH v4 5/5] i8259: fix dynamically masking slave IRQs with IMR register

2012-09-02 Thread Matthew Ogilvie
qemu delivers a spurious interrupt (IRQ15) instead when running the test program. Signed-off-by: Matthew Ogilvie --- I've written a test program (in the form of a floppy disk boot sector) that demonstrates that qemu's emulation of IRQ2 propagation from the slave i8259 to the maste

[Qemu-devel] [PATCH v4 3/5] qemu-options.hx: mention retrace= VGA option

2012-09-02 Thread Matthew Ogilvie
The feature was added in commit cb5a7aa8c32141bb Sep 2008. My description is based on "Better VGA retrace emulation (needed for some DOS games/demos)" from http://www.boblycat.org/~malc/code/patches/qemu/index.html Signed-off-by: Matthew Ogilvie --- qemu-options.hx | 8 +++- 1 fi

[Qemu-devel] [PATCH v4 4/5] vga: add some optional CGA compatibility hacks

2012-09-02 Thread Matthew Ogilvie
issues in this patch). Eventually real MDA and/or CGA support might provide an alternative to this patch, although a hybrid approach like this patch might still be useful in marginal cases. Signed-off-by: Matthew Ogilvie --- Change since v2: The v3 tweak (fix conditions for palette blanking hack

[Qemu-devel] [PATCH v4 1/5] fix some debug printf format strings

2012-09-02 Thread Matthew Ogilvie
These are normally ifdefed out and don't matter. But if you enable them, they ought to be correct. Signed-off-by: Matthew Ogilvie --- Changes since v2: The v3 tweak (adding back a dropped "02") has been squashed in. hw/cirrus_vga.c | 4 ++-- hw/i8259.c | 3 ++- hw/i

[Qemu-devel] [PATCH v4 2/5] vl: fix -hdachs/-hda argument order parsing issues

2012-09-02 Thread Matthew Ogilvie
Signed-off-by: Matthew Ogilvie --- vl.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/vl.c b/vl.c index 7c577fa..febfd62 100644 --- a/vl.c +++ b/vl.c @@ -2352,8 +2352,9 @@ int main(int argc, char **argv, char **envp) char boot_

[Qemu-devel] [PATCH v4 0/5] Running Microport UNIX (ca 1987)

2012-09-02 Thread Matthew Ogilvie
een applied (and not reverted), and is no longer included with this series. Matthew Ogilvie (5): fix some debug printf format strings vl: fix -hdachs/-hda argument order parsing issues qemu-options.hx: mention retrace= VGA option vga: add some optional CGA compatibility hacks i8

[Qemu-devel] [PATCH 2/3] vga cga_hack=palette_blanking: narrower conditions for hack

2012-08-24 Thread Matthew Ogilvie
In commit 482f7bf86b43af9f, I mistakenly inverted the logic I intended for ar_flip_flop. I intended to allow the GMODE_BLANK case as soon as any palette register was modified. Also include minor tweak to documentation about how to list multiple hacks on the command line. Signed-off-by: Matthew

[Qemu-devel] [PATCH 3/3] doc: mention that -no-spurious-interrupt-hack doesn't work with KVM

2012-08-24 Thread Matthew Ogilvie
Signed-off-by: Matthew Ogilvie --- On Fri, Aug 24, 2012 at 07:40:36AM +0200, Jan Kiszka wrote: > Has to mention or even actively warn that it doesn't work with KVM and > its in-kernel irqchip (as that PIC model lacks your hack). qemu-options.hx | 3 ++- 1 file changed, 2 inser

[Qemu-devel] [PATCH 1/3] debug printf (cirrus_vga): fixup unintended format change

2012-08-24 Thread Matthew Ogilvie
I unintentionally dropped an "02" from one of the format strings in commit 145c7c880ff520a9, as noted by Andreas Färber . Signed-off-by: Matthew Ogilvie --- The "02" in debug code seems extremely low priority, but on the other hand, there is no good reason to change it.

[Qemu-devel] [PATCH v3 0/3] Microport UNIX series (was: [PATCH v2 0/6] ...)

2012-08-24 Thread Matthew Ogilvie
ted for the release, I can post a version 4 with version 3 squashed in later. Overall, the first four patches of version 2 seem more like simple bug fixes than the last two. Maybe keep at least the first 4 (possilby with just the first patch of version 3 as well)? Matthew Ogilvie (3): debug

Re: [Qemu-devel] [PATCH v2 6/6] i8259: add -no-spurious-interrupt-hack option

2012-08-24 Thread Matthew Ogilvie
On Fri, Aug 24, 2012 at 07:40:36AM +0200, Jan Kiszka wrote: > On 2012-08-23 08:24, Matthew Ogilvie wrote: > > This patch provides a way to optionally suppress spurious interrupts, [snip] > > I'm not sure why it only sporadically hits this sequence of events. > > Ther

[Qemu-devel] [PATCH v2 4/6] qemu-options.hx: mention retrace= VGA option

2012-08-23 Thread Matthew Ogilvie
The feature was added in commit cb5a7aa8c32141bb Sep 2008. My description is based on "Better VGA retrace emulation (needed for some DOS games/demos)" from http://www.boblycat.org/~malc/code/patches/qemu/index.html Signed-off-by: Matthew Ogilvie --- This is the first version of this

[Qemu-devel] [PATCH v2 5/6] vga: add some optional CGA compatibility hacks

2012-08-22 Thread Matthew Ogilvie
issues in this patch). Eventually real MDA and/or CGA support might provide an alternative to this patch, although a hybrid approach like this patch might still be useful in marginal cases. Signed-off-by: Matthew Ogilvie --- Note: checkpatches.pl gives an error about initializing the gl

[Qemu-devel] [PATCH v2 2/6] target-i386/translate.c: mov to/from crN/drN: ignore mod bits

2012-08-22 Thread Matthew Ogilvie
eal Intel 386 and 486 CPU's (at least), but does not run in qemu without this patch. Signed-off-by: Matthew Ogilvie --- This version of the patch tweaks some of the comments to refer to AMD's documentation, based on "malc "'s response to version 1. It is functionally iden

[Qemu-devel] [PATCH v2 3/6] vl: fix -hdachs/-hda argument order parsing issues

2012-08-22 Thread Matthew Ogilvie
Signed-off-by: Matthew Ogilvie --- Version 1 of this patch had the confusing subject "Re: [Qemu-devel] [PATCH 0/3] Attempting to run Microport UNIX (ca 1987)". This version reworks things a little to avoid duplicated code between the "-hda" and "just a file" cases, ba

[Qemu-devel] [PATCH v2 6/6] i8259: add -no-spurious-interrupt-hack option

2012-08-22 Thread Matthew Ogilvie
nongnu.org/archive/html/qemu-devel/2005-06/msg00243.html (I don't have this system to test.) Signed-off-by: Matthew Ogilvie --- Note: checkpatches.pl gives an error about initializing the global "int no_spurious_interrupt_hack = 0;", even though existing lines near it are doing t

[Qemu-devel] [PATCH v2 0/6] Running Microport UNIX (ca 1987)

2012-08-22 Thread Matthew Ogilvie
INT/unix", and issue the gdb command "target remote:1234". After the floppy boots (kernel loaded in RAM), but before it accesses the hard disk, I could set breakpoints early in panic like "break splintpanic2". I could examine registers ("inf

[Qemu-devel] [PATCH v2 1/6] fix some debug printf format strings

2012-08-22 Thread Matthew Ogilvie
These are normally ifdefed out and don't matter. But if you enable them, they ought to be correct. Signed-off-by: Matthew Ogilvie --- This version of the patch adds i8259.c. An alternative approach might be to eliminate these printf's, and/or replace them with trace*() calls,

Re: [Qemu-devel] [PATCH 0/3] Attempting to run Microport UNIX (ca 1987)

2012-07-28 Thread Matthew Ogilvie
On Sat, Jul 28, 2012 at 08:33:54AM +0200, Markus Armbruster wrote: > Matthew Ogilvie writes: [...] > > 1. It doesn't seem to recognize the hard drive geometry, even > > if I use "-hdachs" and keep it carefully inside ancient > > limitations. Note t

[Qemu-devel] [PATCH 2/3] target-i386/translate.c: mov to/from crN/drN: ignore mod bits

2012-07-27 Thread Matthew Ogilvie
es the bits and assumes they are 1's, rather than trigger an illegal instruction if they aren't. Also fixed: The dissassembled kernel also accesses debug registers in a similar way, although other problems prevent me verifiing that those instructions are reachable in UNIX. Signe

[Qemu-devel] [PATCH 3/3] HACKS for vga text mode with Microport UNIX (ca 1987)

2012-07-27 Thread Matthew Ogilvie
Background: I don't really think it is appropriate to include this patch in it's current form, but I'm posting it to illustrate some of the obscure things that Microport UNIX System V/386 v 2.1 (ca 1987) is trying to do to the video card. On real hardware, this version of UNIX c

[Qemu-devel] [PATCH 1/3] fix some debug printf 64bit format strings

2012-07-27 Thread Matthew Ogilvie
Signed-off-by: Matthew Ogilvie --- hw/cirrus_vga.c | 4 ++-- hw/ide/cmd646.c | 5 +++-- hw/ide/via.c| 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index 623dd68..24ddea6 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c

[Qemu-devel] [PATCH 0/3] Attempting to run Microport UNIX (ca 1987)

2012-07-27 Thread Matthew Ogilvie
either. --- If anyone is interested in examining this system for themselves, contact me and I can send you at least the first (bootable) installation floppy image. -- Matthew Ogilvie (3): fix debug printf 64bit format strings target-i386/translate.c: mov to/from crN/drN: ignore mod bits H