Matthew Dillon [Sat, 23 Apr 2016 05:08:43 +0000 (22:08 -0700)]
kernel - Reduce BSS size (2)
* Fix a bunch of other places in the kernel where large BSS arrays are
declared. Reduces the kernel image by another ~2MB or so on top of
the ~6MB saved in the last commit.
* Primarily these are places where a 'struct thread' is being embedded
in a structure which is being declared [MAXCPU]. With MAXCPU at 256
the result is pretty bloated. Changing the embedded thread to a
thread pointer removes most of the bloat.
Charlie Root [Sat, 23 Apr 2016 03:33:37 +0000 (20:33 -0700)]
kernel - Reduce BSS size to fix loader initrd problem
* kernel + modules + initrd.img (unpacked) exceeded the 63MB the loader has
available for load-time data.
* Top hogs are mainly in BSS. Make intr_info_ary and pcpu_sysctl
kmalloc after boot instead of BSS as a temporary fix.
335872 ifnet_threads
335872 netisr_cpu
339968 dummy_pcpu
344064 bsd4_pcpu
344064 stoppcbs
346112 softclock_pcpu_ary
538624 cpu_topology_nodes
755712 dfly_pcpu
786432 icu_irqmaps
958464 map_entry_init
1048576 idt_arr
1064960 pcpu_sysctl <---- now kmallocd
1179648 ioapic_irqmaps <---- (used too early, cannot be kmallocd)
5242880 intr_info_ary <---- now kmallocd
* Should fix loader issues when trying to use initrd.img[.gz] for now.
Reported-by: Valheru
Imre Vadász [Sun, 2 Aug 2015 10:30:28 +0000 (12:30 +0200)]
ahci: Add some DevSleep defintions. Recognize DevSleep link state.
* Add the AHCI_PREG_SSTS_IPM_DEVSLEEP definition, and recognize
the DevSleep power-state via the dev.ahci.X.Y.link_pwr_state sysctl.
* Use AHCI_PREG_SSTS_* definitions in ahci_port_link_pwr_state(), instead
of SATA_PM_SSTS_* ones.
* Add CAP2 bits for DevSleep.
* Add DEVSLP register definitions.
Imre Vadász [Fri, 22 Apr 2016 18:18:30 +0000 (20:18 +0200)]
ahci: Clean up SET_FEATURES definitions. Add some power-mgmt definitions.
* The ATA_C_SATA_FEATURE_ENA and ATA_C_SATA_FEATURE_DIS definitions aren't
ata commands themselves, they are subcommands of ATA_C_SET_FEATURES.
* Add definitions for device-initiated power-management and for the
devsleep power-state (which isn't supported in DragonFly yet).
François Tigeot [Fri, 22 Apr 2016 09:17:20 +0000 (11:17 +0200)]
kernel/linux: Move M_DRM definition to kern_slaballoc.c
Making it available to more than the drm subsystem
François Tigeot [Fri, 22 Apr 2016 08:50:07 +0000 (10:50 +0200)]
drm/radeon: Add explicit dependency to the acpi module
Suggested-by: zrj
François Tigeot [Fri, 22 Apr 2016 08:48:38 +0000 (10:48 +0200)]
drm/i915: Add explicit dependency to the acpi module
Suggested-by: zrj
François Tigeot [Wed, 20 Apr 2016 05:15:51 +0000 (07:15 +0200)]
gpt: Align partitions to 1MiB
Submitted-by: pascii, bug report #2830
zrj [Tue, 19 Apr 2016 11:14:09 +0000 (14:14 +0300)]
efi/boot1: Fix best text mode detection.
According to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL QueryMode() specs
Mode 0 is 80x25 and Mode 1 is 80x50, rest of device supported
modes follow as modes 2 and above. In case when device does not
support Mode 1, querying for it will return EFI_UNSUPPORTED.
Tested-on: Toshiba laptop w/o Mode 1 support.
Tomohiro Kusumi [Mon, 18 Apr 2016 19:15:26 +0000 (04:15 +0900)]
sys/kern: Fix mountctl options list
Add some minor mount flags that are missing in vfs_flagstostr().
MNT_IGNORE should be ignored since the purpose of this flag is to ignore.
Imre Vadász [Mon, 18 Apr 2016 19:09:23 +0000 (21:09 +0200)]
sys/boot/efi/loader: Make module autoloading work as in pc32/loader.
* For now keep sys/boot/efi/loader/autoload.c around, but we just
use i386_module() from sys/boot/pc32/libi386/i386_module.c.
Tomohiro Kusumi [Mon, 18 Apr 2016 10:01:29 +0000 (19:01 +0900)]
sbin/hammer: Use printf() instead of fprintf(stdout)
Follow sbin/hammer's coding style (as well as C in general).
# grep "fprintf(stdout" sbin/hammer -riI
sbin/hammer/cmd_info.c: fprintf(stdout, "\n");
sbin/hammer/cmd_info.c: fprintf(stdout, "No mounted HAMMER filesystems found\n");
sbin/hammer/cmd_info.c: fprintf(stdout, "No mounted filesystems found\n");
sbin/hammer/cmd_info.c: fprintf(stdout, "Volume identification\n");
sbin/hammer/cmd_info.c: fprintf(stdout, "\tLabel %s\n", fip->vol_name);
sbin/hammer/cmd_info.c: fprintf(stdout, "\tNo. Volumes %d\n", fip->nvolumes);
sbin/hammer/cmd_info.c: fprintf(stdout, "\tHAMMER Volumes ");
sbin/hammer/cmd_info.c: fprintf(stdout, "\tRoot Volume %s\n", rootvol);
sbin/hammer/cmd_info.c: fprintf(stdout, "\tFSID %s\n", fsid);
sbin/hammer/cmd_info.c: fprintf(stdout, "\tHAMMER Version %d\n", fip->version);
sbin/hammer/cmd_info.c: fprintf(stdout, "Big-block information\n");
sbin/hammer/cmd_info.c: fprintf(stdout, "\tTotal %10jd\n", (intmax_t)fip->bigblocks);
sbin/hammer/cmd_info.c: fprintf(stdout, "\tUsed %10jd (%.2lf%%)\n"
sbin/hammer/cmd_info.c: fprintf(stdout, "Space information\n");
sbin/hammer/cmd_info.c: fprintf(stdout, "\tNo. Inodes %10jd\n", (intmax_t)fip->inodes);
sbin/hammer/cmd_info.c: fprintf(stdout, "\tTotal size %6s (%jd bytes)\n",
sbin/hammer/cmd_info.c: fprintf(stdout, "\tUsed %6s (%.2lf%%)\n", buf,
sbin/hammer/cmd_info.c: fprintf(stdout, "\tReserved %6s (%.2lf%%)\n", buf,
sbin/hammer/cmd_info.c: fprintf(stdout, "\tFree %6s (%.2lf%%)\n", buf,
sbin/hammer/cmd_info.c: fprintf(stdout, "PFS information\n");
sbin/hammer/cmd_info.c: fprintf(stdout, "\tPFS ID Mode Snaps Mounted on\n");
sbin/hammer/cmd_info.c: fprintf(stdout, "\t%6d %-6s",
sbin/hammer/cmd_info.c: fprintf(stdout, " %6s ", (pi->head.error && pi->snapcount == 0) ? "-" : buf);
sbin/hammer/cmd_info.c: fprintf(stdout, "%s", pi->mountedon);
sbin/hammer/cmd_info.c: fprintf(stdout, "not mounted");
sbin/hammer/cmd_info.c: fprintf(stdout, "\n");
Tomohiro Kusumi [Mon, 18 Apr 2016 09:57:10 +0000 (18:57 +0900)]
sbin/hammer: Add no hammer found message if not mounted
The local variable 'first' being non-zero after the loop means
none of them were hammer.
Tomohiro Kusumi [Sun, 17 Apr 2016 18:09:08 +0000 (03:09 +0900)]
sbin/mount_hammer: Remove duplicated MOPT_UPDATE macro definition
include/mntopts.h has this for getmntopts(3).
mount_dirfs(8) has this too probably because it's been copy-pasted
from mount_hammer(8) though this commit doesn't touch that.
(the one in mount_devfs(8) is if0'd)
# grep MOPT_UPDATE . -riI | grep define
./contrib/smbfs/mount_smbfs/mntopts.h:#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 }
./include/mntopts.h:#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 }
./sbin/mount_devfs/mount_devfs.c:#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 }
./sbin/mount_dirfs/mount_dirfs.c:#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 }
./sbin/mount_hammer/mount_hammer.c:#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 }
Imre Vadász [Sun, 21 Feb 2016 10:21:05 +0000 (11:21 +0100)]
efi/loader: Increase default staging area to 96MB. Retry with half of that.
* The default 48MB area is too small for loading additional kernel modules
beyond just acpi.ko, ehci.ko and xhci.ko.
* The 96MB allocation fails in qemu with 128MB memory configured.
François Tigeot [Sun, 17 Apr 2016 14:22:17 +0000 (16:22 +0200)]
drm/i915/gem: Update i915_gem_fault()
Reducing differences with Linux 4.2
François Tigeot [Sun, 17 Apr 2016 13:37:53 +0000 (15:37 +0200)]
drm/linux: Add dma_map_sg and dma_unmap_sg()
François Tigeot [Sun, 17 Apr 2016 12:40:42 +0000 (14:40 +0200)]
drm/i915: Import two fixes from Linux 4.2.8
* Always mark the object as dirty when used by the GPU
* Flush pipecontrol post-sync writes
In both cases, software didn't explicitely order cpu write buffers to be
flushed, leading to graphics corruption or a hung gpu after incoherent
reads on the gpu side.
Imre Vadász [Sat, 16 Apr 2016 10:59:37 +0000 (12:59 +0200)]
sys/boot/efi/boot1: Use NELEM.
Imre Vadász [Sat, 16 Apr 2016 10:50:08 +0000 (12:50 +0200)]
sys/boot/efi: Add boot1 to the build.
Imre Vadász [Sat, 16 Apr 2016 10:48:58 +0000 (12:48 +0200)]
sys/boot/efi/boot1: Port efi boot1 loader from FreeBSD to DragonFly.
* Add PATH_* #define-s to boot1.c instead of using a paths.h header.
* Remove ZFS related code.
* Some fixes for compile errors.
Imre Vadász [Sat, 16 Apr 2016 10:46:34 +0000 (12:46 +0200)]
sys/boot/efi/boot1: Port Makefile, comment out fatfs template stuff.
Imre Vadász [Sat, 27 Feb 2016 23:49:34 +0000 (00:49 +0100)]
sys/boot/common: Make ufsread.c build and work with efi boot1 from FreeBSD.
* Bring ufsread.c a bit closer to the FreeBSD code (mostly by adding
fs_read_size(), which is needed for the efi boot1.
* So far ufsread.c was only used in sys/boot/pc32/boot2, where it was
built with -DBOOT2 in CFLAGS. Nothing should change there, since all
changes in this commit are either #ifndef BOOT2, or obviously shouldn't
make a difference for the pc32/boot2 (like adding the
boot2_ufs_read_size() function).
Partly-Taken-From: FreeBSD
Imre Vadász [Sat, 16 Apr 2016 10:08:47 +0000 (12:08 +0200)]
sys/boot/efi: Import subset of FreeBSD's sys/boot/efi/boot1.
* This omits zfs_module.c and fat filesystem templates.
François Tigeot [Sun, 17 Apr 2016 07:04:50 +0000 (09:04 +0200)]
drm/linux: Add get_num_physpages()
François Tigeot [Sun, 17 Apr 2016 06:59:49 +0000 (08:59 +0200)]
drm/i915: Fix a bug in i915_gem_object_flush cpu/gpu write domains
Reported-by: zrj
François Tigeot [Sun, 17 Apr 2016 06:59:05 +0000 (08:59 +0200)]
drm/i915: Fix a bug in i915_gem_object_flush_gtt_write_domain()
Reported-by: zrj
Imre Vadász [Thu, 14 Apr 2016 22:02:18 +0000 (00:02 +0200)]
gpio_intel: Add workaround for concurrent GPIO register access erratum.
* This implements the suggested workaround, using a global lock for GPIO
register accesses for Cherry Trail erratum:
CHT34 Multiple Drivers That Access the GPIO Registers Concurrently May
Result in Unpredictable System Behaviour
zrj [Tue, 12 Apr 2016 10:16:05 +0000 (13:16 +0300)]
libc: Do not set errno when mmap(MAP_TRYFIXED) fails.
If this mmap call fails, we'll fall back to moving the allocation to
a different virtual address. Setting errno here might result in
functions further up the call stack misinterpreting an error condition.
Indeed, this surfaced in git's calling of getdelim() in a loop, where
getdelim() would return -1 at EOF, but the caller would find ENOMEM in
errno from a previous, successful, call and interpret that as an OOM.
Fix-to:
07a8ffeaab3fc830679c6836a6ee198ad1a3275f
Suggested-by: aggelos
Sascha Wildner [Fri, 15 Apr 2016 09:33:28 +0000 (11:33 +0200)]
Update the pciconf(8) database.
April 12, 2016 snapshot from http://pciids.sourceforge.net/
Sepherosa Ziehau [Thu, 14 Apr 2016 12:45:39 +0000 (20:45 +0800)]
kqueue: Use critical section for knote cache
So knote_free() can be triggered from interrupt threads safely.
Suggested-by: dillon@
zrj [Tue, 12 Apr 2016 13:18:27 +0000 (16:18 +0300)]
libc: Fix mdoc warnings on escaped characters.
zrj [Tue, 12 Apr 2016 12:46:23 +0000 (15:46 +0300)]
lib/libutil: Terminate quoted strings (mdoc).
zrj [Tue, 12 Apr 2016 12:32:30 +0000 (15:32 +0300)]
nls.7: Use Ta for tabs to fix mdoc warnings.
zrj [Tue, 12 Apr 2016 10:26:43 +0000 (13:26 +0300)]
cpucontrol(8): Sync with FreeBSD
No previous functional change intended.
Taken-from: FreeBSD
zrj [Tue, 12 Apr 2016 10:23:33 +0000 (13:23 +0300)]
cpuctl(4): Sync with FreeBSD
Intel Haswell ucode loading needs more work.
No previous functional change intended.
Taken-from: FreeBSD
Tomohiro Kusumi [Tue, 12 Apr 2016 17:20:26 +0000 (02:20 +0900)]
sys/vfs/hammer: Add missing unlock in the previous commit
Tomohiro Kusumi [Tue, 12 Apr 2016 15:25:42 +0000 (00:25 +0900)]
sys/vfs/hammer: Get volume lock first
Nothing critical but volume-add|del should get hmp->volume_lock
before the conditional.
Tomohiro Kusumi [Tue, 12 Apr 2016 05:23:37 +0000 (14:23 +0900)]
sbin/newfs_hammer: Check upper limit of volume size
In theory, a volume whose (vol_buf_end - vol_buf_beg) exceeds 52 bits is invalid.
Also do the same check (assertion) on hammer volume-add|del.
Tomohiro Kusumi [Mon, 11 Apr 2016 11:39:55 +0000 (20:39 +0900)]
sbin/hammer: Minor cleanup
(zone-2 offset of layer1's big-block never changes once initialized)
# grep "layer1_offset = " sys/vfs/hammer sbin/hammer -rI
sys/vfs/hammer/hammer_blockmap.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_blockmap.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_blockmap.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_blockmap.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_blockmap.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_blockmap.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_blockmap.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_blockmap.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_blockmap.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_volume.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_volume.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_volume.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_volume.c: layer1_offset = freemap->phys_offset +
sys/vfs/hammer/hammer_volume.c: layer1_offset = freemap->phys_offset +
sbin/hammer/blockmap.c: layer1_offset = freemap->phys_offset +
sbin/hammer/blockmap.c: layer1_offset = freemap->phys_offset +
sbin/hammer/blockmap.c: layer1_offset = freemap->phys_offset +
sbin/hammer/ondisk.c: layer1_offset = alloc_bigblock(root_vol, HAMMER_ZONE_FREEMAP_INDEX);
* sbin/hammer/ondisk.c: layer1_offset = layer1_base +
* sbin/hammer/ondisk.c: layer1_offset = layer1_base +
sbin/hammer/cmd_blockmap.c: layer1_offset = rootmap->phys_offset +
Tomohiro Kusumi [Mon, 11 Apr 2016 11:32:22 +0000 (20:32 +0900)]
sys/vfs/hammer: Remove unused local variable
added by de75bb2.
(only hammer_format_freemap() needs layer1 counter)
Add some comments.
François Tigeot [Tue, 12 Apr 2016 09:02:32 +0000 (11:02 +0200)]
drm/i915: Use iounmap() everywhere
François Tigeot [Tue, 12 Apr 2016 08:45:21 +0000 (10:45 +0200)]
drm/linux: Improve ioremap*/iounmap functions
* Properly track ioremap allocations
* Set address-space ranges to write back in iounmap() if and only
if they are backed by regular memory
François Tigeot [Tue, 12 Apr 2016 08:30:31 +0000 (10:30 +0200)]
drm/i915: Simplify i915_gem_fault() a bit
François Tigeot [Tue, 12 Apr 2016 08:26:44 +0000 (10:26 +0200)]
drm/linux: Add set_pages_wb()
François Tigeot [Tue, 12 Apr 2016 08:00:42 +0000 (10:00 +0200)]
drm/linux: Move M_DRM declaration to linux/slab.h
Imre Vadász [Sat, 9 Apr 2016 10:15:56 +0000 (12:15 +0200)]
gpio_intel: Handle level triggered interrupts more correctly.
* Clearing the interrupt status bit needs to be done after handling
the level-triggered gpio interrupt.
* This avoids duplicate interrupts for level-triggered GpioInt lines.
Imre Vadász [Tue, 5 Apr 2016 20:52:44 +0000 (22:52 +0200)]
gpio_intel: Change GPIOcfg bits when needed to enable RX for interrupt pins.
* On the HP x2 210 detachable the "windows-key" hardware button doesn't
have RX enabled in the Gpio pin configuration by default.
Imre Vadász [Sat, 9 Apr 2016 19:17:41 +0000 (21:17 +0200)]
gpio_intel: Fix CHV_GPIO_CTL1_INVRX constant, we need the RX Data bit.
* And accordingly rename it to CHV_GPIO_CTL1_INVRXDATA (RX Data is the
correct bit needed for configuring an ActiveLow level-triggered
interrupt).
Tomohiro Kusumi [Sat, 9 Apr 2016 05:49:07 +0000 (14:49 +0900)]
sbin/hammer: Fix hammer(8) manpage
See sbin/hammer/cmd_cleanup.c.
# newfs_hammer -L TEST /dev/da1 /dev/da2 /dev/da3 > /dev/null
# mount_hammer /dev/da1:/dev/da2:/dev/da3 /HAMMER
# hammer cleanup /HAMMER > /dev/null
# hammer config /HAMMER
snapshots 1d 60d
prune 1d 5m
rebalance 1d 5m
#dedup 1d 5m
reblock 1d 5m
recopy 30d 10m
# umount /HAMMER
# hammer -vvvf /dev/da1:/dev/da2:/dev/da3 show | grep config -A7
config text="
snapshots 1d 60d
prune 1d 5m
rebalance 1d 5m
#dedup 1d 5m
reblock 1d 5m
recopy 30d 10m
"
Tomohiro Kusumi [Sat, 9 Apr 2016 05:08:54 +0000 (14:08 +0900)]
sbin/hammer: Make hammer info print volumes
in blkdevs format, in addition to
56c2f4d6.
This code is exactly what hammer volume-blkdevs does.
# hammer info /HAMMER
Volume identification
Label TEST
No. Volumes 3
HAMMER Volumes /dev/da1:/dev/da2:/dev/da3
Root Volume /dev/da1
...
François Tigeot [Thu, 7 Apr 2016 19:28:48 +0000 (21:28 +0200)]
drm: Import asm/unaligned.h from NetBSD
François Tigeot [Thu, 7 Apr 2016 17:18:25 +0000 (19:18 +0200)]
drm/i915: Switch rps.client_lock to a lockmgr lock
Even though it was extremely improbable, there was a possibility for the
i915 driver to sleep while holding the rps.client_lock spinlock.
Tomohiro Kusumi [Thu, 7 Apr 2016 03:41:48 +0000 (12:41 +0900)]
sbin/newfs_msdos: Fix error message
595e3440 changed ioctl to DIOCGPART.
Tomohiro Kusumi [Thu, 7 Apr 2016 01:26:29 +0000 (10:26 +0900)]
sys/vfs/hammer: Rename ondisk vol_name to vol_label
Ondisk volume header having a field named vol_name for a label
(not a block device path) is confusing, especially when inmemory
volume structure has vol_name for a block device but not a label.
There is even a kprintf message wrongly using ondisk vol_name
as a block device path, as well as some comments saying vol_name
is a filesystem label but not a path, which implies the name was
misleading.
This commit changes ondisk vol_name to vol_label.
This commit also changes vol_name in struct hammer_ioc_info to
vol_label. Outbox userspace programs using these two will see
compile error after this commit (which I doubt there is any...).
This commit doesn't break binaries.
Note that vol_name in struct libhammer_fsinfo is unchanged.
Sascha Wildner [Wed, 6 Apr 2016 18:35:01 +0000 (20:35 +0200)]
libc/libutil: Some mdoc cleanup in various manual pages.
François Tigeot [Wed, 6 Apr 2016 18:05:35 +0000 (20:05 +0200)]
drm/linux: Add dma_unmap_page()
Tomohiro Kusumi [Wed, 6 Apr 2016 06:30:31 +0000 (15:30 +0900)]
sys/vfs/hammer: Cleanup hammer_format_volume_header() prototype
No functional changes, just remove some arguments that can be
dereferenced from other pointers since it has way too many args,
plus some refactoring to make it look more like newfs_hammer code
which basically does the same thing.
(It doesn't need to be a generic function by having these fileds
as different arguments. Formatting a volume within kernel space
is specific to this ioctl, and the original design was to format
volumes in userspace. It's also technically possible to implement
hammer volume-add|del mostly in userspace. In fact the current
kernel code which formats volumes looks pretty much identical to
what newfs_hammer does on formatting after below commits, which
is natural thing considering what these commands do.)
c7a9d2e sys/vfs/hammer: Remove hammer_iterate_l1l2_entries()
de75bb2 sys/vfs/hammer: Fix/rewrite hammer_free_freemap()
d8d6680 sys/vfs/hammer: Fix/rewrite hammer_format_freemap()
28cdb63 sys/vfs/hammer: Remove struct bigblock_stat
12d76ce sys/vfs/hammer: Remove hammer_test_free_freemap()
e2c5fb2 sys/vfs/hammer: Separate total/free big-block counting from formatting
François Tigeot [Wed, 6 Apr 2016 06:40:48 +0000 (08:40 +0200)]
drm/i915: Fix Baytrail hangs with deeper C-states
Submitted-by: Daniel Bilik
Sascha Wildner [Tue, 5 Apr 2016 17:41:41 +0000 (19:41 +0200)]
libc: mdoc cleanup in some system call manual pages.
Sepherosa Ziehau [Tue, 5 Apr 2016 13:04:23 +0000 (21:04 +0800)]
kqueue: Use lwkt_{get,rel}pooltoken
Sascha Wildner [Tue, 5 Apr 2016 12:34:34 +0000 (14:34 +0200)]
em.4: Mention i219 support.
Sascha Wildner [Tue, 5 Apr 2016 09:24:23 +0000 (11:24 +0200)]
gethostbyname.3: mdoc improvements.
Sascha Wildner [Tue, 5 Apr 2016 09:23:40 +0000 (11:23 +0200)]
bsd-family-tree: Sync with FreeBSD (OpenBSD 5.9, FreeBSD 10.3).
Tomohiro Kusumi [Mon, 4 Apr 2016 01:33:28 +0000 (10:33 +0900)]
sbin/hammer: Print volume list after volume-add|del
Print volume info equivalent of hammer volume-list.
Using -v on hammer volume-add|del will do the same as
using -v on hammer volume-list.
# newfs_hammer -L TEST /dev/da1 /dev/da2 /dev/da3 /dev/da4 > /dev/null
# mount_hammer /dev/da1:/dev/da2:/dev/da3:/dev/da4 /HAMMER
# hammer volume-list /HAMMER
/dev/da1
/dev/da2
/dev/da3
/dev/da4
# hammer volume-del /dev/da2 /HAMMER
/dev/da1
/dev/da3
/dev/da4
# hammer volume-del /dev/da3 /HAMMER
/dev/da1
/dev/da4
# hammer volume-del /dev/da4 /HAMMER
/dev/da1
# hammer volume-add /dev/da4 /HAMMER
/dev/da1
/dev/da4
# hammer volume-add /dev/da3 /HAMMER
/dev/da1
/dev/da4
/dev/da3
# hammer volume-add /dev/da2 /HAMMER
/dev/da1
/dev/da4
/dev/da3
/dev/da2
Tomohiro Kusumi [Sun, 3 Apr 2016 20:48:44 +0000 (05:48 +0900)]
sys/vfs/hammer: Ask before reblocking on volume-del
hammer volume-del finishes instantly if the volume doesn't need
reblocking, but it could take long depending on how much of the
big-blocks within the volume is used.
This commit makes hammer volume-del ask y/n whether to start
reblocking or not if the volume wasn't empty. Using force option
(-F) makes it reblock without asking.
Also note that reblocking doesn't guarantee anything on removing
a volume from filesystem. It just tries to move data to other
volume(s) so the volume may become empty. Thus users should have
choice.
# hammer volume-del /dev/da2 /HAMMER
/dev/da2 is not empty, do you want to reblock /dev/da2? [y/n]
n
hammer volume-del ioctl: Directory not empty
Tomohiro Kusumi [Sun, 3 Apr 2016 20:45:46 +0000 (05:45 +0900)]
sbin/hammer: Make getyn() non static
This can be used by other commands (needed in the next commit).
Also rename static function getyn() in sbin/hammer/cmd_mirror.c
to getyntty() to avoid symbol name conflict.
Tomohiro Kusumi [Sun, 3 Apr 2016 20:06:43 +0000 (05:06 +0900)]
sys/vfs/hammer: Remove extra filesystem syncing on volume-del
This isn't necessary after
2f1df9ce.
Having this before hammer_free_freemap() doesn't guarantee anything anyway.
Imre Vadász [Fri, 1 Apr 2016 08:27:52 +0000 (10:27 +0200)]
gpio_intel: Allow switching edge-trigger mode between falling/rising/both.
* At least this case is definitely harmless, and easy to implement.
Imre Vadász [Tue, 29 Mar 2016 19:13:18 +0000 (21:13 +0200)]
gpio_intel: Move Cherryview SoC specific code into gpio_cherryview.c
* This should allow easily adding GPIO support for other Intel SoC
versions (like Baytrail).
Sascha Wildner [Sun, 3 Apr 2016 09:22:54 +0000 (11:22 +0200)]
libc: Cleanup some manual pages (mainly .Dv usage).
Tomohiro Kusumi [Sat, 2 Apr 2016 23:34:44 +0000 (08:34 +0900)]
sbin/hammer: Make hammer commands print root volume path
Base on the change made by the previous commit, this commit adds
the root volume path information (not root volume#) to hammer info
and hammer volume-list commands. hammer volume-list shows the path
only on -v. This enables users to explicitly know the root volume.
[A] The existing /sbin/hammer
# hammer -v volume-list /HAMMER
/dev/da1
/dev/da2
/dev/da3
# hammer info /HAMMER | grep Root
Root Volume 0
[B] With this commit
# ./hammer -v volume-list /HAMMER
0 /dev/da1 (Root Volume)
1 /dev/da2
2 /dev/da3
# hammer info /HAMMER | grep Root
Root Volume /dev/da1
Tomohiro Kusumi [Sat, 2 Apr 2016 19:05:44 +0000 (04:05 +0900)]
sys/vfs/hammer: Add vol_no field to struct hammer_ioc_volume
The problem with interface/commands HAMMER provides is that there
is no way to know what the volume# is for each block device once
newfs_hammer is done, while error messages and manpages, etc talk
about the root volume without explaining what that really is.
In order to clearly show what the root volume is, userspace hammer
commands need to be able to retrieve relation between HAMMER
volume# and block device path, and then print the block device
with volume# 0.
e914c91d which added hammer volume-list command should have added
volume# field to the ioctl structure or at least assign reserved
space for future extension. This is basically the only ioctl that
can retrieve block device paths, but all it does is get the paths
without any other related information. This commit adds volume#
field to struct hammer_ioc_volume.
This commit affects HAMMERIOC_ADD_VOLUME, HAMMERIOC_DEL_VOLUME,
and HAMMERIOC_LIST_VOLUMES ioctls. These are only used by hammer
volume-add, volume-del, volume-list and volume-blkdevs commands.
This commit requires both /sbin/hammer and kernel rebuild.
Also see
7aee7a8b and
dae8f186.
Sascha Wildner [Sat, 2 Apr 2016 18:03:30 +0000 (20:03 +0200)]
Sync zoneinfo database with tzdata2016c from ftp://ftp.iana.org/tz/releases
* Azerbaijan no longer observes DST. (Thanks to Steffen Thorsen.)
* Chile reverts from permanent to seasonal DST. (Thanks to Juan
Correa for the heads-up, and to Tim Parenti for corrections.)
* Europe/Kaliningrad and Europe/Vilnius changed from +03/+04 to
+02/+03 on 1989-03-26, not 1991-03-31. Europe/Volgograd changed
from +04/+05 to +03/+04 on 1988-03-27, not 1989-03-26.
(Thanks to Stepan Golosunov.)
* Several updates and URLs for historical and proposed Russian changes.
(Thanks to Stepan Golosunov, Matt Johnson, and
Alexander Krivenyshev.)
Imre Vadász [Sat, 2 Apr 2016 10:33:30 +0000 (12:33 +0200)]
kernel/acpi: Add acpi_MatchUid function for matching against _UID.
* Remove private declaration of acpi_MatchUid from bus/gpio/gpio_intel.
François Tigeot [Fri, 1 Apr 2016 05:40:53 +0000 (07:40 +0200)]
drm: Improve drm_cache.c
Tomohiro Kusumi [Thu, 31 Mar 2016 17:12:54 +0000 (02:12 +0900)]
sbin/hammer: Make hammer info print \n between filesystems
(not PFSs, but different HAMMER mounts)
Tomohiro Kusumi [Thu, 31 Mar 2016 16:10:23 +0000 (01:10 +0900)]
sbin/hammer: Make hammer info print rootvol
The existence of "root volume" in HAMMER is mentioned in
error messages and dmesg as well as hammer(8) manpage,
but the problem is that no command really tells you which
one is the root volume. This is too obvious if you have
looked at the source, but no idea if otherwise.
Currently the only one explicitly tells you seems to be
a printf in newfs_hammer added by
dae8f186 in 2015.
This commit adds hammer info a printf for root volume #,
which is still not clear enough since it's just a number,
but not a block device path.
François Tigeot [Thu, 31 Mar 2016 17:34:47 +0000 (19:34 +0200)]
drm/i915: Simplify __i915_wait_request()
Making it more similar to the Linux 4.2 code
François Tigeot [Thu, 31 Mar 2016 11:22:13 +0000 (13:22 +0200)]
drm: Improve linux/scatterlist.h
François Tigeot [Thu, 31 Mar 2016 07:53:57 +0000 (09:53 +0200)]
drm/linux: Add nth_page()
Tomohiro Kusumi [Wed, 30 Mar 2016 12:07:46 +0000 (21:07 +0900)]
sys/vfs/hammer: Fix/add comments on volume header
Tomohiro Kusumi [Wed, 30 Mar 2016 11:47:27 +0000 (20:47 +0900)]
sys/vfs/hammer: Change ondisk vol0_stat_bytes to reserved
This was added in
fbc6e32a in 2007, but never used.
The filesystem design today doesn't need this.
Tomohiro Kusumi [Wed, 30 Mar 2016 11:41:03 +0000 (20:41 +0900)]
sys/vfs/hammer: Change ondisk vol_locked to reserved
This was added in the first commit of HAMMER
8750964d in 2007,
but was never used.
The filesystem design today doesn't need this.
Sepherosa Ziehau [Wed, 30 Mar 2016 13:58:17 +0000 (21:58 +0800)]
tools/kq_sendrecv: Implement kqueue(2) based TCP traffic generator
It is mainly used to genetate TCP traffic w/ large amount of TCP
connections, e.g. > 10K connections. netperf is no longer suitable
to generate this kind of TCP traffic, since 10K+ processes is not
desirable. iperf3 is also not suitable, since it is implemented
using select(2).
Sascha Wildner [Wed, 30 Mar 2016 08:56:22 +0000 (10:56 +0200)]
Remove loader.sym (internal program) via 'make upgrade'.
It was accidentally installed for a while.
Sascha Wildner [Sun, 27 Mar 2016 21:45:30 +0000 (23:45 +0200)]
crypto.4: Fix .Dv name.
Imre Vadász [Sun, 27 Mar 2016 14:09:35 +0000 (16:09 +0200)]
gpio_intel: Support integrated GPIO controllers of the Cherry Trail SoC.
* The gpio_acpi module takes care of probing and setting up the ACPI
GPIO-signaled events and the ACPI address space handler, utilizing the
gpio interface provided by gpio_intel for the actual GPIO accesses.
* So far gpio_intel can only be used for the ACPI-5.0 GPIO features.
* This makes ACPI gpio events (which replace GPE interrupts on many
current x86 SoC devices) work, and provides a handler for the
GeneralPurposeIo Opregions of each GPIO controller.
* With this the HP x2 210 detachable correctly recognizes unplugging
of the power supply, and opening/closing of the lid.
* Further work is still needed to refactor gpio_intel to make adding
support for other SoC/CPU versions easier.
* The gpio_if.m interface is still a prototype that only provides a
minimum of functionality that is needed to get gpio_acpi working.
Imre Vadász [Sat, 26 Mar 2016 15:45:15 +0000 (16:45 +0100)]
bsd.prog.mk: Add INTERNALPROG, for programs which are not installed.
* This avoids loader.sym being installed by sys/boot/efi/loader.
Taken-From: FreeBSD
zrj [Tue, 29 Mar 2016 16:09:01 +0000 (19:09 +0300)]
drm: Allow early kms with monitor EDID override.
While firmware_put(fw, FIRMWARE_UNLOAD) works great when
fw can be loaded multiple times through kernel fw module,
this functionality breaks when loading i915 and radeonkms
together with EDID override module from /boot/loader.conf
Since DRM reads EDID firmware multiple times, it is best
to delay FW_UNLOAD to at least when / is accessable.
Doing that allows to have an early kms with a monitor
reporting bad EDID information at a native resolution.
EDID fw is usually just 128 bytes and still can be unloaded
if it was autoloaded by loader.
Tested-on: early i915 with eDP and broken external LCD panels.
Tomohiro Kusumi [Mon, 28 Mar 2016 18:43:29 +0000 (03:43 +0900)]
sbin/hammer: Don't always print BC error on nodes with 0 count
B-Tree nodes having 0 count ("BC") isn't necessarily an error.
This is rare case, but hammer prune (or other operations that
delete nodes) could happen to leave B-Tree nodes with 0 count.
In the following hammer show result, there is repetition of
L14298648..
14298661 pattern (which includes "BC") for another
25 times after below three. This structure tells nodes with
"BC" aren't generated by node split, because node split always
results in having at least two nodes (original and new node)
at the same level under the parent node of the original node.
It was probably generated by something happened after split.
The following path [B] seems to be the case that could genearate
this structure. As shown in [A] it usually recursively calls
node remove path against its parent node until it first hits
a parent with >1 count. However, as shown in [B] if it fails
to get a lock while in the recursive path, the path ends there
before it hits >1 count node. This results in losing a chance
to erase a node element within the first >1 count node that
has a pointer to all the children so far including the 0 count
node prune ioctl was originally trying to delete, and leaves
the 0 count node along with (1 or more) parent 1 count node(s).
hammer show should recognize this and not mark it as an error
since this is intended behavior.
[A]
hammer_ioc_prune()
-> hammer_delete_at_cursor(HAMMER_DELETE_DESTROY)
-> hammer_btree_delete() /* --ondisk->count == 0 */
-> btree_remove() /* parent->ondisk->count == 1 */
-> hammer_cursor_up_locked() /* success */
-> btree_remove() /* parent->ondisk->count == 1 */
-> hammer_cursor_up_locked() /* success */
-> btree_remove() /* parent->ondisk->count == 1 */
-> hammer_cursor_up_locked() /* success */
-> btree_remove() /* parent->ondisk->count > 1 */
-> bcopy(&elm[1], &elm[0], newsize);
ondisk->count--;
...
...
...
...
[B]
hammer_ioc_prune()
-> hammer_delete_at_cursor(HAMMER_DELETE_DESTROY)
-> hammer_btree_delete() /* --ondisk->count == 0 */
-> btree_remove() /* parent->ondisk->count == 1 */
-> hammer_cursor_up_locked() /* failed */
/* recursive call ends here without erasing elm in parent */
---
...
14298558 NODE
8000003e99042000 cnt=43 p=
8000003e8d7f7000 type=I depth=1 mirror=
00000005127ef970 fill=z8:v0:0:32050:270336=70% {
14298559 G------ ELM 0 I lo=
00040002 obj=
0000000460f4fda4 rt=10 key=
000000000000a000 tid=
0000000460f8f990
14298560 del=
0000000000000000 ot=00 suboff=
8000003e99041000 mirror=
0000000466e4b890
14298561 G------ ELM 1 I lo=
00040002 obj=
00000004627d568b rt=10 key=
00000000000005d0 tid=
00000004627f52d0
14298562 del=
0000000000000000 ot=00 suboff=
8000003e99044000 mirror=
000000046b5c6600
14298563 G------ ELM 2 I lo=
00040002 obj=
0000000463ed92b1 rt=10 key=
00000000000b2000 tid=
0000000463f691c0
14298564 del=
0000000000000000 ot=00 suboff=
8000003e99046000 mirror=
000000046b5ce630
<snip>
...
14298639 G------ ELM 40 I lo=
00040002 obj=
000000050c1bac40 rt=10 key=
0000000000056000 tid=
000000050d52dad0
14298640 del=
0000000000000000 ot=00 suboff=
8000003e997f5000 mirror=
00000005127ef970
14298641 G------ ELM 41 I lo=
00040002 obj=
00000005107f5a71 rt=10 key=
0000000000004000 tid=
000000051083d600
14298642 del=
0000000000000000 ot=00 suboff=
8000003e99b0e000 mirror=
00000005127ef910
14298643 G------ ELM 42 I lo=
00040002 obj=
000000051158802f rt=10 key=
000000000000e000 tid=
00000005115c01a0
14298644 del=
0000000000000000 ot=00 suboff=
8000003e9ac72000 mirror=
00000005127ef970
14298645 G------ RBN 43 * lo=
ffffffff obj=
7fffffffffffffff rt=ffff key=
7fffffffffffffff tid=
ffffffffffffffff
14298646 < del=
0000000000000000 ot=00 suboff=
0000000000000000 mirror=
0000000000000000
14298647 }
14298648 NODE
8000003e99041000 cnt=01 p=
8000003e99042000 type=I depth=2 mirror=
0000000466e4b890 fill=z8:v0:0:32050:266240=70% {
14298649 G------ ELM 0 I lo=
00040002 obj=
00000004623f3e4f rt=10 key=
0000000000006000 tid=
00000004627cd020
14298650 del=
0000000000000000 ot=00 suboff=
8000003e99040000 mirror=
0000000466e4b890
14298651 G------ RBN 1 * lo=
00040002 obj=
00000004627d568b rt=10 key=
00000000000005d0 tid=
00000004627f52d0
14298652 del=
0000000000000000 ot=00 suboff=
0000000000000000 mirror=
0000000463507320
14298653 }
14298654 NODE
8000003e99040000 cnt=01 p=
8000003e99041000 type=I depth=3 mirror=
000000046347eff0 fill=z8:v0:0:32050:262144=70% {
14298655 G------ ELM 0 L lo=
00040002 obj=
00000004626043ca rt=10 key=
0000000000006000 tid=
00000004627d5070
14298656 del=
0000000000000000 ot=00 suboff=
800000395b96a000 mirror=
000000046347eff0
14298657 G------ RBN 1 * lo=
00040002 obj=
00000004627d568b rt=10 key=
00000000000005d0 tid=
00000004627f52d0
14298658 del=
0000000000000000 ot=00 suboff=
0000000000000000 mirror=
0000000000000000
14298659 }
*
14298660 BC NODE
800000395b96a000 cnt=00 p=
8000003e99040000 type=L depth=4 mirror=
000000046347eff0 fill=z8:v0:0:29367:1482752=1% {
14298661 }
14298662 NODE
8000003e99044000 cnt=01 p=
8000003e99042000 type=I depth=2 mirror=
000000046b5c6600 fill=z8:v0:0:32050:278528=70% {
14298663 G------ ELM 0 I lo=
00040002 obj=
0000000463b8866f rt=10 key=
000000000000e000 tid=
0000000463bc0550
14298664 del=
0000000000000000 ot=00 suboff=
8000003e99043000 mirror=
000000046b5c65e0
14298665 G------ RBN 1 * lo=
00040002 obj=
0000000463ed92b1 rt=10 key=
00000000000b2000 tid=
0000000463f691c0
14298666 del=
0000000000000000 ot=00 suboff=
0000000000000000 mirror=
0000000464009780
14298667 }
14298668 NODE
8000003e99043000 cnt=01 p=
8000003e99044000 type=I depth=3 mirror=
000000046b5b6540 fill=z8:v0:0:32050:274432=70% {
14298669 G------ ELM 0 L lo=
00040002 obj=
0000000463ba883a rt=10 key=
0000000000052000 tid=
0000000463bc0570
14298670 del=
0000000000000000 ot=00 suboff=
800000395c948000 mirror=
0000000467587c20
14298671 G------ RBN 1 * lo=
00040002 obj=
0000000463ed92b1 rt=10 key=
00000000000b2000 tid=
0000000463f691c0
14298672 del=
0000000000000000 ot=00 suboff=
0000000000000000 mirror=
0000000000000000
14298673 }
*
14298674 BC NODE
800000395c948000 cnt=00 p=
8000003e99043000 type=L depth=4 mirror=
0000000467587c20 fill=z8:v0:0:29369:1343488=1% {
14298675 }
14298676 NODE
8000003e99046000 cnt=01 p=
8000003e99042000 type=I depth=2 mirror=
000000046b5ce630 fill=z8:v0:0:32050:286720=70% {
14298677 G------ ELM 0 I lo=
00040002 obj=
0000000463f5167f rt=10 key=
0000000000d28000 tid=
0000000463f69160
14298678 del=
0000000000000000 ot=00 suboff=
8000003e99045000 mirror=
000000046b5c6600
14298679 G------ RBN 1 * lo=
00040002 obj=
0000000464a2c0bb rt=10 key=
0000000000000f60 tid=
0000000464a9c460
14298680 del=
0000000000000000 ot=00 suboff=
0000000000000000 mirror=
0000000466a39890
14298681 }
14298682 NODE
8000003e99045000 cnt=01 p=
8000003e99046000 type=I depth=3 mirror=
0000000467587fc0 fill=z8:v0:0:32050:282624=70% {
14298683 G------ ELM 0 L lo=
00040002 obj=
0000000463f5944f rt=10 key=
0000000000b18000 tid=
0000000463f691c0
14298684 del=
0000000000000000 ot=00 suboff=
800000395cb74000 mirror=
0000000467587dc0
14298685 G------ RBN 1 * lo=
00040002 obj=
0000000464a2c0bb rt=10 key=
0000000000000f60 tid=
0000000464a9c460
14298686 del=
0000000000000000 ot=00 suboff=
0000000000000000 mirror=
0000000000000000
14298687 }
*
14298688 BC NODE
800000395cb74000 cnt=00 p=
8000003e99045000 type=L depth=4 mirror=
0000000467587dc0 fill=z8:v0:0:29369:3620864=1% {
14298689 }
...
Sepherosa Ziehau [Tue, 29 Mar 2016 08:19:02 +0000 (16:19 +0800)]
socket/kqueue: Fix space calculation for PREALLOC sending buffer
Sepherosa Ziehau [Tue, 29 Mar 2016 08:17:55 +0000 (16:17 +0800)]
tcp: We never use preallocation on receiving buffer
François Tigeot [Tue, 29 Mar 2016 06:56:11 +0000 (08:56 +0200)]
drm/linux: Add asm/memory_model.h
Sascha Wildner [Tue, 29 Mar 2016 06:41:25 +0000 (08:41 +0200)]
kernel/acpi: Work around a "shift count exceeding the type width" issue.
Triggered when AccessWidth is 32, like when called from AcpiGetTimer()
via acpi_timer.
More information: https://bugs.acpica.org/show_bug.cgi?id=1270
Reported-by: arcade, mneumann
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2896>
Sascha Wildner [Tue, 29 Mar 2016 06:41:07 +0000 (08:41 +0200)]
Sync ACPICA with Intel's version
20160318.
* Arbitrary bit length and offset support for registers defined by the
Generic Address Structure.
* ASL's Concatenate operator now allows any ACPI object to be passed
as an operand.
* Added "const" across the source.
* Various fixes and additions.
For a more detailed list, please see sys/contrib/dev/acpica/changes.txt.
Tested-by: ivadasz, tkusumi
Tomohiro Kusumi [Mon, 28 Mar 2016 16:01:28 +0000 (01:01 +0900)]
sbin/newfs_hammer: Add missing buffer refcount--
All remaining buffers (buffers didn't get kicked out by cache
mechanism) when the program exits should have 0 for refs.
These were remaining ones with refs 1(btree) and 2(inode/pfsd).
Tomohiro Kusumi [Mon, 28 Mar 2016 14:52:43 +0000 (23:52 +0900)]
sbin/hammer: Remove unused buffer flag
Add assertion isnew!=-1 since the flag was originally used
to indicate the buffer was allocated by readahead.
Tomohiro Kusumi [Sun, 27 Mar 2016 11:56:14 +0000 (20:56 +0900)]
sbin/hammer: Fix/refactor check_data_crc()
Separate inode CRC from other CRC checks.
The only reason this function goes into while(data_len) loop is
because HAMMER userspace can only support upto 16KB buffer data
whereas inode is always 128 byte.
CRC check should look something similar to the kernel function
hammer_crc_test_leaf() in order to keep maintainability.
Also blockmap_lookup() doesn't need to be inside the while loop.
It only needs to verify zone offset once for each record data.
Also use return value of blockmap_lookup() which is zone2 offset
instead of using non-zone2 offset for get_buffer_data().
get_buffer() does extra blockmap lookup if offset is not zone-2.
Tomohiro Kusumi [Sat, 26 Mar 2016 05:03:55 +0000 (14:03 +0900)]
sys/vfs/hammer: Change ondisk vol_nblocks/blocksize to reserved
These were added in
fbc6e32a in 2007 in the early stage of HAMMER,
but vol_nblocks wasn't used after
9480ff55 in 2008. vol_blocksize
was never used.
HAMMER volumes have these set by newfs_hammer and hammer volume-add,
but today they are just there for nothing (with obvious values).
The existing HAMMER volumes will keep having vol_nblocks/blocksize
fields initially set by newfs_hammer or added by hammer volume-add,
but new volumes created or added from now on will have 0 for these.
It doesn't erase what's in the existing volume headers.
(There shouldn't be external userspace code that refers to these)