]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agouse .Mt to mark up email addresses consistently (part2)
bapt [Fri, 20 Jun 2014 09:57:27 +0000 (09:57 +0000)]
use .Mt to mark up email addresses consistently (part2)

PR: 191174
Submitted by: Franco Fichtner  <franco@lastsummer.de>

10 years agouse .Mt to mark up email addresses consistently (part1)
bapt [Fri, 20 Jun 2014 09:40:43 +0000 (09:40 +0000)]
use .Mt to mark up email addresses consistently (part1)

PR: 191174
Submitted by: Franco Fichtner  <franco@lastsummer.de>

10 years agoAssert that the new entry is inserted into the right location in the
kib [Fri, 20 Jun 2014 07:01:53 +0000 (07:01 +0000)]
Assert that the new entry is inserted into the right location in the
map entries list, and that it does not overlap with the previous and
next entries.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoIncrement the pending packets more aggressively for TSO
bryanv [Fri, 20 Jun 2014 02:54:04 +0000 (02:54 +0000)]
Increment the pending packets more aggressively for TSO

Assume the number of description used is reasonable value to
increment this otherwise opaque field by.

While here, reduce a minor difference between the legacy and
multiqueue transmit paths.

MFC after: 1 week

10 years agoHandle multiple calls to rxq_eof for single packet completion
bryanv [Fri, 20 Jun 2014 02:49:03 +0000 (02:49 +0000)]
Handle multiple calls to rxq_eof for single packet completion

This requires the VMware vmxnet3 device to flip the start of packet
descriptor's generation before the rest of the packet's descriptors
have been loaded into the Rx ring. I've never observed this behavior,
and it seems to make the most sense not to do it this way. But it is
not a lot of work for the driver to handle this situation just in case.

MFC after: 1 week

10 years agoRemove an unnecessary kick of the host at the end of transmitting
bryanv [Fri, 20 Jun 2014 02:31:52 +0000 (02:31 +0000)]
Remove an unnecessary kick of the host at the end of transmitting

MFC after: 1 week

10 years agoSet target->sbp field to valid value when sbp device is created.
kan [Fri, 20 Jun 2014 01:45:03 +0000 (01:45 +0000)]
Set target->sbp field to valid value when sbp device is created.

The sbp_cam_detach_target can be called from sbp_post_explore function
on the first target that is not really attached and it was written with
the corresponding safety check in place to tolerate that. Unfortunately
the recent locking cleanup did add a locking assertion that tries to
dereference the target->sbp pointer unconditionally, which causes less
than desirable outcome. Since the assertion is useful, just initialize
the target sbp pointer once when sbp device is being initialized instead
of when the target is being attached. This makes assertion work in all
cases and fixes the crash on boot.

10 years agoFollowing comments in r242565 add the possibility to specify ecx when
attilio [Thu, 19 Jun 2014 21:54:41 +0000 (21:54 +0000)]
Following comments in r242565 add the possibility to specify ecx when
performing cpuid calls.
Add also a new way to specify the level type to cpucontrol(8) as
reported in the manpage.

Sponsored by: EMC / Isilon storage division
Reviewed by: bdrewery, gcooper
Testerd by: bdrewery

10 years agoEliminate a pointless call to vm_map_clip_start() from vm_map_growstack().
alc [Thu, 19 Jun 2014 21:05:07 +0000 (21:05 +0000)]
Eliminate a pointless call to vm_map_clip_start() from vm_map_growstack().
For this call to do anything at all we would have to have two overlapping
map entries.

Submitted by: kib

10 years agoDon't dump core when the ELF file has no section headers. The ELF
marcel [Thu, 19 Jun 2014 20:12:28 +0000 (20:12 +0000)]
Don't dump core when the ELF file has no section headers. The ELF
core files created by gcore are among those.

10 years agoserial_num and device_id fields are not necessarily null-terminated.
mav [Thu, 19 Jun 2014 19:28:35 +0000 (19:28 +0000)]
serial_num and device_id fields are not necessarily null-terminated.

Before this it was impossible to use all 16 bytes of serial number, and
client always got serial number NULL-terminated, that is not required.

MFC after: 2 weeks

10 years agoTrust the state of a power resource that get from a working _STA method
jhb [Thu, 19 Jun 2014 18:35:14 +0000 (18:35 +0000)]
Trust the state of a power resource that get from a working _STA method
instead of trying to cache it.

Previously, we only trusted the state if we did not have a cached state.
However, once a state was cached, the _STA method was always ignored.
Specifically, once a power resource had been turned on once (e.g.
during resume), the driver assumed it was always on even if _STA said it
was off and never turned it back on.  This prevented the power resource
from being turned back on if a laptop was resumed twice, for example.

To fix, just remove the cached state entirely and always use the results
of _STA.  The loops already skip any resources where _STA fails.

Submitted by: trasz (initial patch to invoke _ON)
MFC after: 1 week

10 years agoWhen MAP_STACK_GROWS_{DOWN,UP} are passed to vm_map_insert() set the
alc [Thu, 19 Jun 2014 16:26:16 +0000 (16:26 +0000)]
When MAP_STACK_GROWS_{DOWN,UP} are passed to vm_map_insert() set the
corresponding flag(s) in the new map entry.  Previously, the caller was
responsible for setting them after vm_map_insert() returned.

Pass MAP_STACK_GROWS_DOWN to vm_map_insert() from vm_map_growstack() when
extending the stack in the downward direction.

Together these changes slightly simplify the caller's task when creating a
downward growing stack.  In particular, the caller no longer needs to clip
the previous entry, because the new stack entry can't possibly coalesce
with the previous entry.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division

10 years agoExecute task management request directly in ctl_queue() context.
mav [Thu, 19 Jun 2014 13:19:35 +0000 (13:19 +0000)]
Execute task management request directly in ctl_queue() context.

From one side it allows to remove CTL_FLAG_TASK_PENDING flag, handling of
which significantly complicates fine-grained locking.  From the other side
it reduces task management requests latency even below then that flag could.
As downside, it denies task management code to sleep, but that is not needed
any way now.

Discussed with: ken

10 years agoUse Mt macro to properly format mailto links
skreuzer [Thu, 19 Jun 2014 13:18:23 +0000 (13:18 +0000)]
Use Mt macro to properly format mailto links

Approved by: hrs (mentor)

10 years agoAdd some more CTL_FLAG_ABORT check points.
mav [Thu, 19 Jun 2014 12:43:41 +0000 (12:43 +0000)]
Add some more CTL_FLAG_ABORT check points.

This should allow to abort commands doing mostly disk I/O, such as VERIFY
or WRITE SAME.  Before this change CTL_FLAG_ABORT was only checked around
data moves, which for these commands may not happen for a very long time.

MFC after: 2 weeks

10 years agoUse SOCK_CLOEXEC.
ume [Thu, 19 Jun 2014 11:49:36 +0000 (11:49 +0000)]
Use SOCK_CLOEXEC.

MFC after: 1 week

10 years agoIncrease CTL_DEVID_LEN from 16 to 64 bytes.
mav [Thu, 19 Jun 2014 09:46:43 +0000 (09:46 +0000)]
Increase CTL_DEVID_LEN from 16 to 64 bytes.

SPC-4 recommends T10 vendor ID based LUN ID was created by concatenating
product name and serial number (and istgt follows that).  But product name
is 16 bytes long by itself, so 16 bytes total length is clearly not enough
to fit both.

To keep compatibility with existing configurations, pad short device IDs
to old length of 16, same as before.

This change probably breaks CTL user-level ABI, so control tools should
be rebuilt after this change.

MFC after: 2 weeks

10 years agoDon't denounce peripherals on system shutdown. Together with r267321,
marius [Thu, 19 Jun 2014 09:08:20 +0000 (09:08 +0000)]
Don't denounce peripherals on system shutdown. Together with r267321,
we're now back to the pre-r228483 level of default verbosity. This in
turn again typically allows for reading information that userland might
have printed on the screen before initiating a halt, but still permits
to debug potential device shutdown problems on system shutdown via
CAM_DEBUG etc.

Reviewed by: mav
MFC after: 3 days
Sponsored by: Bally Wulff Games & Entertainment GmbH

10 years agoAdd iSCSI Target Name ID descriptor to VPD 83h.
mav [Thu, 19 Jun 2014 08:13:53 +0000 (08:13 +0000)]
Add iSCSI Target Name ID descriptor to VPD 83h.

It shall/should be there according to SPC-4, and istgt also provides it.

MFC after: 2 weeks

10 years agoFix address matching rule.
hrs [Thu, 19 Jun 2014 07:39:28 +0000 (07:39 +0000)]
Fix address matching rule.

Reported by: jase

10 years agoAdd Bartek Rutkowski (myself) to committers-ports.dot file with swills and marino...
robak [Thu, 19 Jun 2014 06:31:27 +0000 (06:31 +0000)]
Add Bartek Rutkowski (myself) to committers-ports.dot file with swills and marino as mentors.

Approved by: swills (mentor)

10 years agoFix case where fastroute or "to interface" is used with incorrect FIB.
cy [Thu, 19 Jun 2014 05:45:17 +0000 (05:45 +0000)]
Fix case where fastroute or "to interface" is used with incorrect FIB.

PR: 183065
Submitted by: p-freebsd-bugs@ziemba.us
Approved by: glebius
MFC after: 1 week

10 years agoInitialize sysctl OID structure by record.
hselasky [Thu, 19 Jun 2014 05:28:42 +0000 (05:28 +0000)]
Initialize sysctl OID structure by record.

MFC after: 2 weeks

10 years agoFix GCC compile warning: Variable(s) can be used uninitialized.
hselasky [Thu, 19 Jun 2014 05:10:03 +0000 (05:10 +0000)]
Fix GCC compile warning: Variable(s) can be used uninitialized.

10 years agoFix compile warning: Remove duplicate external declaration.
hselasky [Thu, 19 Jun 2014 05:06:24 +0000 (05:06 +0000)]
Fix compile warning: Remove duplicate external declaration.

10 years agoAdd MAP_EXCL flag for mmap(2). It should be combined with MAP_FIXED,
kib [Thu, 19 Jun 2014 05:00:39 +0000 (05:00 +0000)]
Add MAP_EXCL flag for mmap(2).  It should be combined with MAP_FIXED,
and prevents the request from deleting existing mappings in the
region, failing instead.

Reviewed by: alc
Discussed with: jhb
Tested by: markj, pho (previous version, as part of the bigger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoThe time come to remove the wrapper, most likely, but tidy up it code
kib [Thu, 19 Jun 2014 04:55:00 +0000 (04:55 +0000)]
The time come to remove the wrapper, most likely, but tidy up it code
instead for now.  Remove spurious blank line, use C89 definition, wrap
long line.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agostrptime: add support for %t and %n
pfg [Wed, 18 Jun 2014 23:34:48 +0000 (23:34 +0000)]
strptime: add support for %t and %n

Posix strptime() requires support for %t and %n, which were added
to the illumos port.  Curiously we were skipping white spaces by
default in most other cases making %t meaningless.

We now skip spaces in the case of the %e specifier as strftime(3)
explicitly adds a space for the single digit case.

Reference:
http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html

Obtained from: Illumos (Rev. a11c1571b6942161b0186d0588609448066892c2)
MFC after: 3 weeks

10 years agoSuspend vt(4) initialization if "kern.vt.disable" kenv is set.
ray [Wed, 18 Jun 2014 22:30:22 +0000 (22:30 +0000)]
Suspend vt(4) initialization if "kern.vt.disable" kenv is set.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

10 years agoAllow to disable syscons(4) if "hw.syscons.disable" kenv is set.
ray [Wed, 18 Jun 2014 22:23:10 +0000 (22:23 +0000)]
Allow to disable syscons(4) if "hw.syscons.disable" kenv is set.

Sponsored by: The FreeBSD Foundation

10 years agosyscons(4) and vt(4) can be built together now.
ray [Wed, 18 Jun 2014 22:18:58 +0000 (22:18 +0000)]
syscons(4) and vt(4) can be built together now.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

10 years agoRemove stale link to deleted vt(4) xboxfb driver.
ray [Wed, 18 Jun 2014 22:16:44 +0000 (22:16 +0000)]
Remove stale link to deleted vt(4) xboxfb driver.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

10 years agoRename vt(4) vga module to dismiss interference with syscons(4) vga module.
ray [Wed, 18 Jun 2014 22:10:10 +0000 (22:10 +0000)]
Rename vt(4) vga module to dismiss interference with syscons(4) vga module.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

10 years agoFix syntax error.
wblock [Wed, 18 Jun 2014 18:31:35 +0000 (18:31 +0000)]
Fix syntax error.

PR: 191131
Submitted by: dan.mcgregor@usask.ca
MFC after: 1 week

10 years agoFix spelling, typos, missing articles, contractions. Expanded version
wblock [Wed, 18 Jun 2014 18:27:16 +0000 (18:27 +0000)]
Fix spelling, typos, missing articles, contractions.  Expanded version
of patch supplied with PR.

PR: 191001
Submitted by: olgeni
MFC after: 1 week

10 years agoRetooling addrconfig() to exclude addresses on loopback interfaces
ume [Wed, 18 Jun 2014 18:07:19 +0000 (18:07 +0000)]
Retooling addrconfig() to exclude addresses on loopback interfaces
when looking for configured addresses.
This change is based upon the code from the submitter, and made
following changes:
- Exclude addresses assigned on interfaces which are down, like NetBSD
  does.
- Exclude addresses assigned on interfaces which are ifdisabled.

PR: 190824
Submitted by: Justin McOmie
MFC after: 1 week

10 years agoRename a variable; no functional changes.
trasz [Wed, 18 Jun 2014 17:48:30 +0000 (17:48 +0000)]
Rename a variable; no functional changes.

Sponsored by: The FreeBSD Foundation

10 years agoAdd "iscsictl -M", which allows one to change session parameters
trasz [Wed, 18 Jun 2014 17:46:34 +0000 (17:46 +0000)]
Add "iscsictl -M", which allows one to change session parameters
without removing it and adding back.

Sponsored by: The FreeBSD Foundation

10 years agoImplement redirection handling in initiator.
trasz [Wed, 18 Jun 2014 17:35:40 +0000 (17:35 +0000)]
Implement redirection handling in initiator.

Sponsored by: The FreeBSD Foundation

10 years agoGet rid of unneccessary argument.
trasz [Wed, 18 Jun 2014 17:21:38 +0000 (17:21 +0000)]
Get rid of unneccessary argument.

Sponsored by: The FreeBSD Foundation

10 years agoFix typo and rename macro KDB_SYS_FLAG to KBD_SYS_FLAG.
neel [Wed, 18 Jun 2014 17:20:02 +0000 (17:20 +0000)]
Fix typo and rename macro KDB_SYS_FLAG to KBD_SYS_FLAG.

Reviewed by: tychon

10 years agoRework session termination in iSCSI target to actually wait
trasz [Wed, 18 Jun 2014 17:13:18 +0000 (17:13 +0000)]
Rework session termination in iSCSI target to actually wait
for any outstanding commands to be properly aborted by CTL.
Without it, in some cases (such as files backing the LUNs
stored on failing disk drives), terminating a busy session
would result in panic.

Reviewed by: mav@ (earlier version)
Sponsored by: The FreeBSD Foundation

10 years agoImprove code a little; no functional changes.
trasz [Wed, 18 Jun 2014 17:04:25 +0000 (17:04 +0000)]
Improve code a little; no functional changes.

Sponsored by: The FreeBSD Foundation

10 years agoUse proper term in debug messages.
trasz [Wed, 18 Jun 2014 17:00:41 +0000 (17:00 +0000)]
Use proper term in debug messages.

MFC after: 1 month
Sponsored by: FreeBSD Foundation

10 years agoxen: fix out-of-bounds access to ipi_handle
royger [Wed, 18 Jun 2014 13:41:20 +0000 (13:41 +0000)]
xen: fix out-of-bounds access to ipi_handle

Fix the gate in xen_pv_lapic_ipi_vectored to prevent access to element
at position nitems(xen_ipis).

Sponsored by: Citrix Systems R&D
Coverity ID: 1223203
Approved by: gibbs

10 years agoOn discovery stage add set of TargetAddress keys to reply, reporting to
mav [Wed, 18 Jun 2014 12:26:02 +0000 (12:26 +0000)]
On discovery stage add set of TargetAddress keys to reply, reporting to
the client all the portal groups addresses and ports.

Reviewed by: trasz@
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

10 years agoAdd polish vt(4) keymap.
trasz [Wed, 18 Jun 2014 07:23:04 +0000 (07:23 +0000)]
Add polish vt(4) keymap.

Sponsored by: The FreeBSD Foundation

10 years agostdtime: style(9) fixes.
pfg [Wed, 18 Jun 2014 02:36:21 +0000 (02:36 +0000)]
stdtime: style(9) fixes.

Obtained from: illumos
MFC after: 5 days

10 years agocxgbe(4): Fix bug in the fast rx buffer recycle path. In some cases rx
np [Wed, 18 Jun 2014 00:16:35 +0000 (00:16 +0000)]
cxgbe(4):  Fix bug in the fast rx buffer recycle path.  In some cases rx
buffers were getting recycled when they should have been left alone.

MFC after: 3 days

10 years ago- Add a LOCAL_ITOOLS to allow adding additional tools required for the
bdrewery [Tue, 17 Jun 2014 22:23:36 +0000 (22:23 +0000)]
- Add a LOCAL_ITOOLS to allow adding additional tools required for the
  installworld and distributeworld targets

PR: 179562
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>
MFC after: 1 week

10 years agoDifferent versions of the ARM processor use different registers.
tuexen [Tue, 17 Jun 2014 21:48:04 +0000 (21:48 +0000)]
Different versions of the ARM processor use different registers.
Fix the code used on a Raspberry Pi.

Reviewed by: markm@

10 years agoDrop 'Inc.' for consistency.
gjb [Tue, 17 Jun 2014 21:08:49 +0000 (21:08 +0000)]
Drop 'Inc.' for consistency.

Sponsored by: The FreeBSD Foundation

10 years agoConvert the potential console port over to using 3wire, for i386/amd64.
grehan [Tue, 17 Jun 2014 18:51:03 +0000 (18:51 +0000)]
Convert the potential console port over to using 3wire, for i386/amd64.

(This change was already in place for other arches via r262957)

Reviewed by: nwhitehorn
MFC after: 1 week

10 years agoDon't bother clearing maps for static DMA allocations to NULL. Instead,
jhb [Tue, 17 Jun 2014 18:10:06 +0000 (18:10 +0000)]
Don't bother clearing maps for static DMA allocations to NULL.  Instead,
leave them as purely opaque values that are only set by bus_dmamem_alloc().

10 years agoUpdate src.conf.5 after r267582
emaste [Tue, 17 Jun 2014 16:25:50 +0000 (16:25 +0000)]
Update src.conf.5 after r267582

10 years agoshare/vt now also includes keymaps
emaste [Tue, 17 Jun 2014 16:21:50 +0000 (16:21 +0000)]
share/vt now also includes keymaps

10 years agoFix various bugs with freeing static DMA allocations in sound drivers:
jhb [Tue, 17 Jun 2014 16:07:57 +0000 (16:07 +0000)]
Fix various bugs with freeing static DMA allocations in sound drivers:
- Don't compare the DMA map to NULL to determine if bus_dmamap_unload()
  should be called when releasing a static allocation.  Instead, compare
  the bus address against 0.
- Don't assume that the DMA map for static allocations is NULL.  Instead,
  save the value set by bus_dmamem_alloc() so it can later be passed to
  bus_dmamem_free().  Also, add missing calls to bus_dmamap_unload() in
  these cases before freeing the buffer.
- Use the bus address from the bus_dma callback instead of calling
  vtophys() on the address allocated by bus_dmamem_alloc().

Reviewed by: kan

10 years agoFix teardown of static DMA allocations in various NIC drivers:
jhb [Tue, 17 Jun 2014 14:47:49 +0000 (14:47 +0000)]
Fix teardown of static DMA allocations in various NIC drivers:
- Add missing calls to bus_dmamap_unload() in et(4).
- Check the bus address against 0 to decide when to call
  bus_dmamap_unload() instead of comparing the bus_dma map against NULL.
- Check the virtual address against NULL to decide when to call
  bus_dmamem_free() instead of comparing the bus_dma map against NULL.
- Don't clear bus_dma map pointers to NULL for static allocations.
  Instead, treat the value as completely opaque.
- Pass the correct virtual address to bus_dmamem_free() in wpi(4) instead
  of trying to free a pointer to the virtual address.

Reviewed by: yongari

10 years agoAdd glyphs from converted syscons iso* fonts
emaste [Tue, 17 Jun 2014 13:12:30 +0000 (13:12 +0000)]
Add glyphs from converted syscons iso* fonts

This consists of the unique glyphs from the following font files in
/usr/share/syscons/fonts:

iso*.fnt     ISO-8859-1 West European
iso02*.fnt   ISO-8859-2 Central European
iso04*.fnt   ISO-8859-4 Baltic
iso05*.fnt   ISO-8859-5 Cyrillic
iso07*.fnt   ISO-8859-7 Greek
iso08*.fnt   ISO-8859-8 Hebrew
iso09*.fnt   ISO-8859-9 Turkish
iso15*.fnt   ISO-8859-15 West European

Sponsored by: The FreeBSD Foundation

10 years agoAdd a stub send-pr that simply points people towards the online support
gavin [Tue, 17 Jun 2014 12:59:03 +0000 (12:59 +0000)]
Add a stub send-pr that simply points people towards the online support
pages, to give people used to send-pr a bit of guidance.

MFC after: 3 days

10 years agoDo not reference native_lapic_ipi_*() functions in the UP build.
kib [Tue, 17 Jun 2014 09:33:22 +0000 (09:33 +0000)]
Do not reference native_lapic_ipi_*() functions in the UP build.
The functions' definitions are protected by #ifdef SMP.
Keeping apic_ops.ipi_*() methods NULL would allow to catch the use
on UP machines.

Reviewed by: royger
Sponsored by: The FreeBSD Foundation

10 years agoMake cs_terminating a bool; no functional changes.
trasz [Tue, 17 Jun 2014 09:02:10 +0000 (09:02 +0000)]
Make cs_terminating a bool; no functional changes.

Sponsored by: The FreeBSD Foundation

10 years agoMFV r249332 (illumos-gate 14005:55fc53126003)
delphij [Tue, 17 Jun 2014 08:11:45 +0000 (08:11 +0000)]
MFV r249332 (illumos-gate 14005:55fc53126003)

Illumos ZFS issues:
  3654 zdb should print number of ganged blocks

MFC after: 2 weeks

10 years agoIn msdosfs_setattr(), add a check for result of the utimes(2)
kib [Tue, 17 Jun 2014 07:11:00 +0000 (07:11 +0000)]
In msdosfs_setattr(), add a check for result of the utimes(2)
permissions test, forgotten in r164033.

Refactor the permission checks for utimes(2) into vnode helper
function vn_utimes_perm(9), and simplify its code comparing with the
UFS origin, by writing the call to VOP_ACCESSX only once.  Use the
helper for UFS(5), tmpfs(5), devfs(5) and msdosfs(5).

Reported by: bde
Reviewed by: bde, trasz
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoRevert r266925 as it can lead to instant panic at fexecve():
dchagin [Tue, 17 Jun 2014 05:29:18 +0000 (05:29 +0000)]
Revert r266925 as it can lead to instant panic at fexecve():

To allow to run the interpreter itself add a new ELF branding type.

Pointed out by: kib, mjg

10 years agoAdd MLINKS for macros decribed in queue.3 manpage.
kevlo [Tue, 17 Jun 2014 02:10:40 +0000 (02:10 +0000)]
Add MLINKS for macros decribed in queue.3 manpage.

10 years agoSupport for multiple disks and tap devices.
alfred [Tue, 17 Jun 2014 00:53:00 +0000 (00:53 +0000)]
Support for multiple disks and tap devices.

This allows you to give a bhyve instance multiple network devices
and disk devices easily by specifying additional "-d " and "-t "
options.

Reviewed by: neel
Sponsored by: Norse

10 years agoBring an overly enthusiastic KASSERT inline with the Intel SDM.
tychon [Mon, 16 Jun 2014 22:59:18 +0000 (22:59 +0000)]
Bring an overly enthusiastic KASSERT inline with the Intel SDM.

Reviewed by: neel

10 years agoAdd &citrix; and &citrix.rd; macros.
gjb [Mon, 16 Jun 2014 20:21:15 +0000 (20:21 +0000)]
Add &citrix; and &citrix.rd; macros.

Sponsored by: The FreeBSD Foundation

10 years agoDocument r267536, Xen PVH DomU support for amd64.
gjb [Mon, 16 Jun 2014 20:20:54 +0000 (20:20 +0000)]
Document r267536, Xen PVH DomU support for amd64.

Submitted by: royger
Sponsored by: The FreeBSD Foundation

10 years agoAdd comment explaining a potential problem with just added LUN ID.
trasz [Mon, 16 Jun 2014 19:05:51 +0000 (19:05 +0000)]
Add comment explaining a potential problem with just added LUN ID.

Reminded by: mav@
Sponsored by: The FreeBSD Foundation

10 years ago- Modify vm_page_unwire() and vm_page_enqueue() to directly accept
attilio [Mon, 16 Jun 2014 18:15:27 +0000 (18:15 +0000)]
- Modify vm_page_unwire() and vm_page_enqueue() to directly accept
  the queue where to enqueue pages that are going to be unwired.
- Add stronger checks to the enqueue/dequeue for the pagequeues when
  adding and removing pages to them.

Of course, for unmanaged pages the queue parameter of vm_page_unwire() will
be ignored, just as the active parameter today.
This makes adding new pagequeues quicker.

This change effectively modifies the KPI.  __FreeBSD_version will be,
however, bumped just when the full cache of free pages will be
evicted.

Sponsored by: EMC / Isilon storage division
Reviewed by: alc
Tested by: pho

10 years agoAdd LUN-associated name to VPD, to make Hyper-V Failover Cluster happy.
trasz [Mon, 16 Jun 2014 18:14:05 +0000 (18:14 +0000)]
Add LUN-associated name to VPD, to make Hyper-V Failover Cluster happy.

Sponsored by: The FreeBSD Foundation

10 years agoTidy up the early parts of vm_map_insert(), in particular, simplify one
alc [Mon, 16 Jun 2014 16:37:41 +0000 (16:37 +0000)]
Tidy up the early parts of vm_map_insert(), in particular, simplify one
of the assertions and eliminate a comment that has grown stale.

Reviewed by: kib
MFC after: 1 week

10 years agoUpdate license to strptime(3) implementation.
pfg [Mon, 16 Jun 2014 14:55:09 +0000 (14:55 +0000)]
Update license to strptime(3) implementation.

Our strptime(3) implementation was the base for the illumos
implementation and after contacting the author, Kevin Rudy
stated the code is under a 2-Clause BSD License [1]

After reviewing our local changes to the file in question,
the FreeBSD Foundation has agreed that their contributions
to this file are not required to carry clause 3 or 4 so
the file can be relicensed as in Illumos [2].

References:

[1] https://www.illumos.org/issues/357
[2] Illumos Revision: 13222:02526851ba75

Approved: core (jhb)
Approved: FreeBSD Foundation (emaste)
MFC after: 4 days

10 years agoFix destruction of character devices by passing correct pointer to
hselasky [Mon, 16 Jun 2014 14:02:14 +0000 (14:02 +0000)]
Fix destruction of character devices by passing correct pointer to
kernel in IOCTL request.

Submitted by: Andrey Zholos <aaz@q-fu.com>

10 years agoAdd support for VERIFY(10/12/16) and COMPARE AND WRITE SCSI commands.
mav [Mon, 16 Jun 2014 11:00:14 +0000 (11:00 +0000)]
Add support for VERIFY(10/12/16) and COMPARE AND WRITE SCSI commands.

Make data_submit backends method support not only read and write requests,
but also two new ones: verify and compare.  Verify just checks readability
of the data in specified location without transferring them outside.
Compare reads the specified data and compares them to received data,
returning error if they are different.

VERIFY(10/12/16) commands request either verify or compare from backend,
depending on BYTCHK CDB field.  COMPARE AND WRITE command executed in two
stages: first it requests compare, and then, if succeesed, requests write.
Atomicity of operation is guarantied by CTL request ordering code.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

10 years agoxen: add missing files
royger [Mon, 16 Jun 2014 08:54:04 +0000 (08:54 +0000)]
xen: add missing files

Commit missing files that actually belong to previous commits.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

10 years agoisa: allow ISA bus to attach to xenpv bus
royger [Mon, 16 Jun 2014 08:49:16 +0000 (08:49 +0000)]
isa: allow ISA bus to attach to xenpv bus

This is needed because syscons depends on ISA.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

x86/isa/isa.c:
 - Allow the ISA bus to attach to xenpv.

10 years agoxen: unify gnttab initialization for PVHVM and PVH
royger [Mon, 16 Jun 2014 08:48:42 +0000 (08:48 +0000)]
xen: unify gnttab initialization for PVHVM and PVH

Switch the initialization of gnttab to use an unused physical memory
range for both PVHVM and PVH.

In the past PVHVM was using the xenpci BAR, but there's no reason to
do that, and in fact FreeBSD was probably doing it because it was the
way it was done in Windows, were drivers cannot probably request for
unused physical memory ranges, but it was never enforced in the
hypervisor.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

xen/gnttab.c:
 - Allocate contiguous physical memory for grant table frames for both
   PVHVM and PVH.
 - Since gnttab is not a device, use the xenpv device in order to
   request for this allocation.

dev/xen/xenpci/xenpcivar.h:
dev/xen/xenpci/xenpci.c:
 - Remove the now unused xenpci_alloc_space and xenpci_alloc_space_int
   functions.

xen/gnttab.h:
 - Change the prototype of gnttab_init and gnttab_resume, that now
   takes a device_t parameter.

dev/xen/control/control.c:
x86/xen/xenpv.c:
 - Changes to accomodate the new prototype of gnttab_init and
   gnttab_resume.

10 years agoxen: init gnttab from xenpv
royger [Mon, 16 Jun 2014 08:48:06 +0000 (08:48 +0000)]
xen: init gnttab from xenpv

Currently the grant table is initialized from xenstore, but a better
place to do this would be xenpv, so move grant table initialization
there.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

x86/xen/xenpv.c:
 - Add gnttab initialization.

xen/xenstore/xenstore.c:
 - Remove gnttab initialization.

10 years agoxen: xenstore changes to support PVH
royger [Mon, 16 Jun 2014 08:47:15 +0000 (08:47 +0000)]
xen: xenstore changes to support PVH

For PVH guests the xenstore parameters are fetched from the start_info
struct, just like on PV.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

xen/xenstore/xenstore.c:
 - Fetch xenstore event channel port from start_info.

10 years agoxen: add shutdown hook for PVH
royger [Mon, 16 Jun 2014 08:46:31 +0000 (08:46 +0000)]
xen: add shutdown hook for PVH

Add the PV shutdown hook to PVH.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

dev/xen/control/control.c:
 - Make xen_pv_shutdown_final available on XENHVM builds.
 - Register the Xen PV shutdown hook for PVH guests.

10 years agoxen: create a Xen nexus to use in PV/PVH
royger [Mon, 16 Jun 2014 08:45:51 +0000 (08:45 +0000)]
xen: create a Xen nexus to use in PV/PVH

Introduce a Xen specific nexus that is going to be used by Xen PV/PVH
guests.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

x86/xen/xen_nexus.c:
 - Introduce a Nexus to use on Xen PV(H) guests, this prevents PV(H)
   guests from using the legacy Nexus.

conf/files.amd64:
conf/files.i386:
 - Add the xen nexus to the build.

10 years agoxen: create a PV CPU device for PVH guests
royger [Mon, 16 Jun 2014 08:45:12 +0000 (08:45 +0000)]
xen: create a PV CPU device for PVH guests

Since there's no ACPI on PVH guests, we need to create a dummy CPU
device in order to fill the pcpu->pc_device field.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

dev/xen/pvcpu/pvcpu.c:
 - Create a dummy CPU device for PVH guests in order to fill the
   per-cpu pc_device field.

conf/files:
 - Add the pvcpu device to kernels using XEN or XENHVM options.

10 years agoxen: introduce xenpv bus
royger [Mon, 16 Jun 2014 08:44:33 +0000 (08:44 +0000)]
xen: introduce xenpv bus

Create a dummy bus so top level Xen devices can attach to it (instead
of attaching directly to the nexus). This allows to have all the Xen
related devices grouped under a single bus.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

x86/xen/xenpv.c:
 - Attach the xenpv bus when running as a Xen guest.
 - Attach the ISA bus if needed, in order to attach syscons.

conf/files.amd6:
conf/files.i386:
 - Include the xenpv.c file in the build of i386/amd64 kernels using
   XENHVM.

dev/xen/console/console.c:
dev/xen/timer/timer.c:
xen/xenstore/xenstore.c:
 - Attach to the xenpv bus instead of the Nexus.

dev/xen/xenpci/xenpci.c:
 - Xen specific devices on PVHVM guests are no longer attached to the
   xenpci device, they are instead attached to the xenpv bus, remove
   the now unused methods.

10 years agoxen: add hooks for Xen PV APIC
royger [Mon, 16 Jun 2014 08:43:45 +0000 (08:43 +0000)]
xen: add hooks for Xen PV APIC

Create the necessary hooks in order to provide a Xen PV APIC
implementation that can be used on PVH. Most of the lapic ops
shouldn't be called on Xen, since we trap those operations at a higher
layer.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

x86/xen/hvm.c:
x86/xen/xen_apic.c:
 - Move IPI related code to xen_apic.c

x86/xen/xen_apic.c:
 - Introduce Xen PV APIC implementation, most of the functions of the
   lapic interface should never be called when running as PV(H) guest,
   so make sure FreeBSD panics when trying to use one of those.
 - Define the Xen APIC implementation in xen_apic_ops.

xen/xen_pv.h:
 - Extern declaration of the xen_apic struct.

x86/xen/pv.c:
 - Use xen_apic_ops as apic_ops when running as PVH guest.

conf/files.amd64:
conf/files.i386:
 - Include the xen_apic.c file in the build of i386/amd64 kernels
   using XENHVM.

10 years agoamd64/i386: introduce APIC hooks for different APIC implementations.
royger [Mon, 16 Jun 2014 08:43:03 +0000 (08:43 +0000)]
amd64/i386: introduce APIC hooks for different APIC implementations.

This is needed for Xen PV(H) guests, since there's no hardware lapic
available on this kind of domains. This commit should not change
functionality.

Sponsored by: Citrix Systems R&D
Reviewed by: jhb
Approved by: gibbs

amd64/include/cpu.h:
amd64/amd64/mp_machdep.c:
i386/include/cpu.h:
i386/i386/mp_machdep.c:
 - Remove lapic_ipi_vectored hook from cpu_ops, since it's now
   implemented in the lapic hooks.

amd64/amd64/mp_machdep.c:
i386/i386/mp_machdep.c:
 - Use lapic_ipi_vectored directly, since it's now an inline function
   that will call the appropiate hook.

x86/x86/local_apic.c:
 - Prefix bare metal public lapic functions with native_ and mark them
   as static.
 - Define default implementation of apic_ops.

x86/include/apicvar.h:
 - Declare the apic_ops structure and create inline functions to
   access the hooks, so the change is transparent to existing users of
   the lapic_ functions.

x86/xen/hvm.c:
 - Switch to use the new apic_ops.

10 years agoxen: fix style in pv.c
royger [Mon, 16 Jun 2014 08:41:57 +0000 (08:41 +0000)]
xen: fix style in pv.c

Fix the lenght of some comments, and also add proper indentation to
xen_init_ops

Sponsored by: Citrix Systems R&D
Approved by: gibbs

10 years agoForce two byte alignment for all control message headers
bryanv [Mon, 16 Jun 2014 04:32:27 +0000 (04:32 +0000)]
Force two byte alignment for all control message headers

The header structure consists of two 1-byte elements, but it must always
be describable by a single SG entry. Note for consistency, specify the
alignment everywhere, even if the structure has the appropriate natural
alignment since it contains a uint16_t.

Obtained from: DragonFlyBSD
MFC after: 1 week

10 years agoMake the feature negotiation code easier to follow
bryanv [Mon, 16 Jun 2014 04:29:28 +0000 (04:29 +0000)]
Make the feature negotiation code easier to follow

MFC after: 1 week

10 years agoMove the VIRTIO_RING_F_* defines out of virtqueue.h into virtio_config.h
bryanv [Mon, 16 Jun 2014 04:25:04 +0000 (04:25 +0000)]
Move the VIRTIO_RING_F_* defines out of virtqueue.h into virtio_config.h

These defines are applicable to userland too, but virtqueue.h contains
the kernel virtqueue interface, and is therefore not usable in userland.

Note that Linux places these defines in virtio_ring.h, but I don't want
the drivers including this header file to keep the VirtIO ring opaque to
everything but the virtqueue.

MFC after: 1 week

10 years agoRemove kernel specific macro out of the VirtIO PCI header file
bryanv [Mon, 16 Jun 2014 04:16:31 +0000 (04:16 +0000)]
Remove kernel specific macro out of the VirtIO PCI header file

The eventual goal is to share this file with userland, so
remove the macro that is only specific for virtio_pci(4).
Instead, add the VIRTIO_PCI_CONFIG_OFF macro from Linux to
get the config size whether MSIX is enabled or not.

MFC after: 1 week

10 years ago - Remove two write-only local variables
bryanv [Mon, 16 Jun 2014 04:12:33 +0000 (04:12 +0000)]
  - Remove two write-only local variables
  - Remove unused element in the vtnet_rxq structure

MFC after: 1 week

10 years agoMake backends track completion by processed number of sectors instead of
mav [Sun, 15 Jun 2014 20:14:11 +0000 (20:14 +0000)]
Make backends track completion by processed number of sectors instead of
total transfer size.

Commands such as VERIFY or COMPARE AND WRITE may have transfer size not
matching directly to number of sectors.

10 years agoMinor mdoc improvements.
joel [Sun, 15 Jun 2014 18:39:10 +0000 (18:39 +0000)]
Minor mdoc improvements.

10 years agomdoc: add missing width to Bl -tag.
joel [Sun, 15 Jun 2014 18:30:26 +0000 (18:30 +0000)]
mdoc: add missing width to Bl -tag.

10 years agoRemove memcpy() from ctl_private[] accesses.
mav [Sun, 15 Jun 2014 18:16:51 +0000 (18:16 +0000)]
Remove memcpy() from ctl_private[] accesses.

That union is aligned enough to access data directly.

10 years agoMove kern_total_len setting from backend to core code.
mav [Sun, 15 Jun 2014 17:14:52 +0000 (17:14 +0000)]
Move kern_total_len setting from backend to core code.