History log of /netbsd-src/sys/dev/hyperv/vmbus.c (Results 1 – 18 of 18)
Revision Date Author Comments
# fdd3eadb 20-May-2022 nonaka <nonaka@NetBSD.org>

Improve Hyper-V support.

vmbus(4):
- Added support for multichannel.

hvn(4):
- Added support for multichannel.
- Added support for change MTU.
- Added support for TX aggregation.
- Improve VLA

Improve Hyper-V support.

vmbus(4):
- Added support for multichannel.

hvn(4):
- Added support for multichannel.
- Added support for change MTU.
- Added support for TX aggregation.
- Improve VLAN support.
- Improve checksum offload support.

show more ...


# ef3476fb 09-Apr-2022 riastradh <riastradh@NetBSD.org>

sys: Use membar_release/acquire around reference drop.

This just goes through my recent reference count membar audit and
changes membar_exit to membar_release and membar_enter to
membar_acquire -- t

sys: Use membar_release/acquire around reference drop.

This just goes through my recent reference count membar audit and
changes membar_exit to membar_release and membar_enter to
membar_acquire -- this should make everything cheaper on most CPUs
without hurting correctness, because membar_acquire is generally
cheaper than membar_enter.

show more ...


# 122a3e8a 12-Mar-2022 riastradh <riastradh@NetBSD.org>

sys: Membar audit around reference count releases.

If two threads are using an object that is freed when the reference
count goes to zero, we need to ensure that all memory operations
related to the

sys: Membar audit around reference count releases.

If two threads are using an object that is freed when the reference
count goes to zero, we need to ensure that all memory operations
related to the object happen before freeing the object.

Using an atomic_dec_uint_nv(&refcnt) == 0 ensures that only one
thread takes responsibility for freeing, but it's not enough to
ensure that the other thread's memory operations happen before the
freeing.

Consider:

Thread A Thread B
obj->foo = 42; obj->baz = 73;
mumble(&obj->bar); grumble(&obj->quux);
/* membar_exit(); */ /* membar_exit(); */
atomic_dec -- not last atomic_dec -- last
/* membar_enter(); */
KASSERT(invariant(obj->foo,
obj->bar));
free_stuff(obj);

The memory barriers ensure that

obj->foo = 42;
mumble(&obj->bar);

in thread A happens before

KASSERT(invariant(obj->foo, obj->bar));
free_stuff(obj);

in thread B. Without them, this ordering is not guaranteed.

So in general it is necessary to do

membar_exit();
if (atomic_dec_uint_nv(&obj->refcnt) != 0)
return;
membar_enter();

to release a reference, for the `last one out hit the lights' style
of reference counting. (This is in contrast to the style where one
thread blocks new references and then waits under a lock for existing
ones to drain with a condvar -- no membar needed thanks to mutex(9).)

I searched for atomic_dec to find all these. Obviously we ought to
have a better abstraction for this because there's so much copypasta.
This is a stop-gap measure to fix actual bugs until we have that. It
would be nice if an abstraction could gracefully handle the different
styles of reference counting in use -- some years ago I drafted an
API for this, but making it cover everything got a little out of hand
(particularly with struct vnode::v_usecount) and I ended up setting
it aside to work on psref/localcount instead for better scalability.

I got bored of adding #ifdef __HAVE_ATOMIC_AS_MEMBAR everywhere, so I
only put it on things that look performance-critical on 5sec review.
We should really adopt membar_enter_preatomic/membar_exit_postatomic
or something (except they are applicable only to atomic r/m/w, not to
atomic_load/store_*, making the naming annoying) and get rid of all
the ifdefs.

show more ...


# 49769dfe 23-Dec-2021 yamaguchi <yamaguchi@NetBSD.org>

hyper-v: move idt vector allocating to vmbus_init_interrupts_md()
for refactoring

And, the deallocating is also moved to
vmbus_deinit_interrupts_md().

reviewed by nonaka@n.o.


# c7fb772b 07-Aug-2021 thorpej <thorpej@NetBSD.org>

Merge thorpej-cfargs2.


# 2685996b 24-Apr-2021 thorpej <thorpej@NetBSD.org>

Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass a

Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).

show more ...


# aa3a0098 29-Jan-2021 nonaka <nonaka@NetBSD.org>

vmbus(4): Don't wait forever.


# b74d80df 26-May-2020 nonaka <nonaka@NetBSD.org>

vmbus(4): Do not call hyperv_dma_alloc() in interrupt context.

The channel offer and rescind process is performed on another context.


# fd5152a9 26-May-2020 nonaka <nonaka@NetBSD.org>

vmbus(4): Fixed incorrect use of vmbus_wait() in vmbus_channel_scan().

Found by kUBSan.


# a08e08e6 25-May-2020 nonaka <nonaka@NetBSD.org>

Use howmany() macro.


# c9d5b091 10-Dec-2019 nonaka <nonaka@NetBSD.org>

hvn(4) can be added and deleted dynamically.


# 82065bef 07-Dec-2019 nonaka <nonaka@NetBSD.org>

Get a Hyper-V virtual processor id in cpu_hatch().

Currently, it is got in config_interrupts context.
However, since it is required when attaching a device,
it is got earlier than now.


# 2c4e9c99 06-Dec-2019 nonaka <nonaka@NetBSD.org>

Clear the allocated memory in hyperv_dma_alloc().


# c0318f0b 22-Nov-2019 nonaka <nonaka@NetBSD.org>

vmbus(4), hvn(4), hvkbd(4): Fixed wait time for tsleep(9).


# 5449d224 09-Jul-2019 nakayama <nakayama@NetBSD.org>

Zero clear the allocated ring buffer for vmbus_channel.
This change makes Hyper-V's vmbus devices work properly even after reboot.


# 13deebdd 24-May-2019 nonaka <nonaka@NetBSD.org>

Added drivers for Hyper-V Synthetic Keyboard and Video device.


# 1cc92a5e 15-Feb-2019 hannken <hannken@NetBSD.org>

Add __diagused.


# 50517e57 15-Feb-2019 nonaka <nonaka@NetBSD.org>

Added Microsoft Hyper-V support. It ported from OpenBSD and FreeBSD.

graphical console is not work on Gen.2 VM yet. To use the serial console,
enter "consdev com,0x3f8,115200" on efiboot.