OpenBSD CVS

CVS log for src/usr.sbin/vmd/i8259.c


[BACK] Up to [local] / src / usr.sbin / vmd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.22 / (download) - annotate - [select for diffs], Fri Sep 1 19:42:26 2023 UTC (9 months, 1 week ago) by dv
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.21: +9 -13 lines
Diff to previous 1.21 (colored)

vmd(8): ignore masks on asserts, use synchronous deasserts.

The i8259 was considering the state of the mask register when a
device requested raising the bit in the interrupt request register.
This caused a race condition where if the virtio device asserted
the irq while it was masked in the i8259 by the vm, we'd miss the
interrupt request. The device and the pic would become out of sync
and users reported virtio block device stalls as the vioblk(4)
driver would starve, waiting for an interrupt that will never arrive.

The mask is now considered only at ack time, when finding possible
interrupts to inject. This bug was never a problem previously as
virtio devices were emulated synchronously.

Deasserts related to the vcpu reading the virtio isr register are
also made now in response to the read request instead of issued
asynchronously. This removes a subsequent race condition.

Testing from mbuhl@, stsp@, and Florian Riehm.

ok mlarkin@

Revision 1.21 / (download) - annotate - [select for diffs], Thu Nov 10 18:58:02 2022 UTC (18 months, 4 weeks ago) by mbuhl
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Initialize data before passing it to get_input_data.  Strictly
speaking this is not necessary as all used bits of the uint32_t are
zeroed.
ok mlarkin

Revision 1.20 / (download) - annotate - [select for diffs], Wed Jun 16 16:55:02 2021 UTC (2 years, 11 months ago) by dv
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored)

cleanup vmd(8) includes and header files

Lots of organic growth other the years lead to unnecessary includes
(proc.h everywhere) and odd dependencies between header files. This
cleans things up a bit to help with upcoming cleanup around dhcp
code.

No functional change.

"go for it" mlarkin@

Revision 1.19 / (download) - annotate - [select for diffs], Thu Jul 12 10:15:44 2018 UTC (5 years, 10 months ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.18: +5 -5 lines
Diff to previous 1.18 (colored)

vmm(8)/vmm(4): send a copy of the guest register state to vmd on exit,
avoiding multiple readregs ioctls back to vmm in case register content
is needed subsequently.

ok phessler

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jun 19 17:12:34 2018 UTC (5 years, 11 months ago) by reyk
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

knf

Revision 1.17 / (download) - annotate - [select for diffs], Fri Apr 27 12:15:10 2018 UTC (6 years, 1 month ago) by mlarkin
Branch: MAIN
Changes since 1.16: +98 -8 lines
Diff to previous 1.16 (colored)

vmd(8): implement vmd side of ELCR registers

ok guenther

Revision 1.16 / (download) - annotate - [select for diffs], Wed Nov 29 22:08:40 2017 UTC (6 years, 6 months ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

vmd(8): fix broken IRR bit setting for the slave PIC. Noticed by claudio
when he tried to make a vm with 4 network interfaces.

ok claudio

Revision 1.15 / (download) - annotate - [select for diffs], Mon Sep 18 00:05:15 2017 UTC (6 years, 8 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.14: +52 -29 lines
Diff to previous 1.14 (colored)

protect i8259 state with a mutex.

this allows interrupts to be safely posted by multiple threads.

ok mlarkin@

Revision 1.14 / (download) - annotate - [select for diffs], Mon May 8 09:08:40 2017 UTC (7 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.13: +25 -1 lines
Diff to previous 1.13 (colored)

Adds functions to read and write state of devices in vmd.

This is required for implementing vmctl send and vmctl receive.  vmctl
send / receive are two new options that will support snapshotting VMs
and migrating VMs from one host to another. The atomicio files are
copied from usr.bin/ssh.

Patch from Pratik Vyas; this project was undertaken at San Jose State
University along with his three teammates, Ashwin, Harshada and Siri
with mlarkin@ as the advisor.

OK mlarkin@

Revision 1.13 / (download) - annotate - [select for diffs], Sat Apr 8 19:06:29 2017 UTC (7 years, 2 months ago) by mlarkin
Branch: MAIN
Changes since 1.12: +10 -3 lines
Diff to previous 1.12 (colored)

implement nonspecific EOI mode for the legacy PIC

ok deraadt

Revision 1.12 / (download) - annotate - [select for diffs], Sat Mar 25 22:36:53 2017 UTC (7 years, 2 months ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.11: +4 -2 lines
Diff to previous 1.11 (colored)

Last bits needed to get seabios + alpine linux working. This is enough
to get started and let more people help finding and fixing bugs.

ok kettenis, deraadt

Revision 1.11 / (download) - annotate - [select for diffs], Sat Mar 25 07:46:24 2017 UTC (7 years, 2 months ago) by mlarkin
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

Introduce a new function to obtain properly sized input data, and convert
i8253/i8259/mc146818 emulation to use this.

Revision 1.10 / (download) - annotate - [select for diffs], Fri Mar 24 11:08:43 2017 UTC (7 years, 2 months ago) by reyk
Branch: MAIN
Changes since 1.9: +1 -1 lines
Diff to previous 1.9 (colored)

Backout mlarkin's previous commit while he is away:
The newly-used function get_input_data() is missing and broke the tree.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Mar 24 09:11:49 2017 UTC (7 years, 2 months ago) by mlarkin
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Last bits of cleanup for linux/seabios support in i8253/i8259 emulation
code.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Mar 23 06:56:33 2017 UTC (7 years, 2 months ago) by mlarkin
Branch: MAIN
Changes since 1.7: +3 -5 lines
Diff to previous 1.7 (colored)

use proper return data size when doing PIC reads - don't clobber %eax
high bits.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Mar 19 03:42:38 2017 UTC (7 years, 2 months ago) by mlarkin
Branch: MAIN
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored)

Handle master/slave PIC vector base properly. OpenBSD uses 0x20/0x28
(respectively). Seabios uses 0x8/0x78 and linux uses 0x30/0x38. Respond
properly to PIC vector base assignment and calculate VMX injection
vectors based on current values, instead of always assuming OpenBSD
defaults.

Needed for both seabios serial console support as well as linux guest
support. Tested on -current as is, does not break existing OpenBSD
guest support.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Mar 19 03:10:57 2017 UTC (7 years, 2 months ago) by mlarkin
Branch: MAIN
Changes since 1.5: +55 -27 lines
Diff to previous 1.5 (colored)

Convert some log_warn into log_warnx, and provide pic names (master,slave)
in debugging output.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Jan 17 21:51:01 2017 UTC (7 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.4: +9 -10 lines
Diff to previous 1.4 (colored)

Nuke some whitespace that keeps poking me in the eye as I try to
steal code.

Revision 1.4 / (download) - annotate - [select for diffs], Sun Nov 20 22:54:40 2016 UTC (7 years, 6 months ago) by mlarkin
Branch: MAIN
Changes since 1.3: +2 -11 lines
Diff to previous 1.3 (colored)


Remove some old code that isn't needed anymore.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Oct 3 06:00:17 2016 UTC (7 years, 8 months ago) by mlarkin
Branch: MAIN
Changes since 1.2: +1 -0 lines
Diff to previous 1.2 (colored)


add RCS tags

Revision 1.2 / (download) - annotate - [select for diffs], Thu Sep 1 16:40:06 2016 UTC (7 years, 9 months ago) by mlarkin
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored)


change some log_warn to log_warnx and convert some integer literals to
enumerand values

Revision 1.1 / (download) - annotate - [select for diffs], Thu Sep 1 14:48:09 2016 UTC (7 years, 9 months ago) by mlarkin
Branch: MAIN


Add a set of emulated legacy devices (PIT, PIC, RTC)

discussed with stefan and deraadt

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.