FreeBSD on the POWER8: it’s alive!

A post to freebsd-ppc from a couple of months ago asked if we had support for POWER8 and offered to provide remote access to anyone interested in working on it. I was sufficiently intrigued that I approached the FreeBSD powerpc hackers to ask about it, and was informed that it'd be nice, but we didn't have hardware.

After a bit of wrangling of hardware logistics and with the FreeBSD Foundation purchasing a box, a Tyan POWER8 evaluation server appeared. Nathan Whitehorn started poking at it and managed to get a basic "hello world" going, but stalled on issues with the Linux KVM virtualisation environment.

Fast forward a few weeks - he's figured out the KVM issues, their lack of support for some mandated hypervisor APIs and other bugs - FreeBSD now boots inside of the hypervisor environment and seems stable enough to do development on.

He then found the existing powerpc pmap (physical memory management) code wasn't very SMP friendly - it works fine on one and two CPU powerpc machines, but this POWER8 evaluation board is a 4-core, 32-thread CPU. So a few days of development went by and he rewrote most of the pmap code to be much more fine grained locked and scale much, much better than the existing code. (He also found the PS3 hypervisor layer isn't thread-safe.)

What's been done thus far?

  • FreeBSD boots inside the hypervisor environment;
  • Virtualised console, networking and storage all work;
  • (in progress) new, scalable pmap implementation;
  • Initial support for the Vector-Scalar Extension (VSX) that's found on POWER7 and POWER8.
So, I'm impressed. Nathan's done a fantastic job bringing the whole thing up. There's some further work on the new powerpc technology that needs doing (things like the new vector processing units, performance counter support and such) and I'm sure Justin and Nathan will poke powerpc dtrace support into further good shape. I'm going to see if we can fix a chelsio 40G NIC into one of these and work with their developers to fix any endian/busdma issues that creep up, and then do some network stack scaling testing with it. There's also the missing hardware/hypervisor support to run FreeBSD on the bare metal, which would be a fantastic achievement.

Now I kind of want some larger POWER8 hardware.

Lumina Desktop 0.8.2 Released!

The next version of the Lumina desktop environment has just been released! Version 0.8.2 is mainly a “spit-and-polish” release: focusing on bugfixes, overall appearances, and interface layout/design. The FreeBSD port has already been updated to the new version, and the PC-BSD “Edge” repository will be making the new version available within the next day or two (packages building now). If you are creating/distributing your own packages, you can find the source code for this release in the “qt5/0.8.2″ branch in the Lumina repository on GitHub.

The major difference that people will notice is that the themes/colors distributed with the desktop have been greatly improved, and I have included a few examples below. The full details about the changes in this release are listed at the bottom of the announcement.

Reminder: The Lumina desktop environment is still considered to be “beta-quality”, so if you find things that either don’t work or don’t work well, please report them on the PC-BSD bug tracker so that they can get fixed as soon as possible.

 

Click to view slideshow.

 

Changes from 0.8.1 -> 0.8.2:

New Utility: “lumina-info”
  • This utility provides basic information about the current version of the Lumina desktop as well as link to various information online (source repository, list of contributors, bug tracker, etc…).
Theming:
  • New Color Scheme: PCBSD10-Default (the default for new PC-BSD users)
  • Lumina-[Red/Green/Gold/Purple] color schemes updated.
  • “Lumina-Default” and “None” theme templates updated significantly.
  • Make it easier for a distributor to set a default theme/color by just supplying the name instead of the full path (since paths can be different on different OS’s)
  • Fix issue with some fonts not loading properly.
  • Distinguish between “Save” and “Apply” in the theme template editor (“Save” to update the file but keep the editor open, “Apply” to update the file and close the editor). This makes it much easier to test changes to the current theme template as you don’t need to close/re-open the editor to try it out.
  • Add the ability to distinguish between transparent/opaque desktop plugins in the theme template.
Configuration Utility Changes:
  • Add a new dialog for selecting plugins of all kinds. This makes it easier to browse through and read the descriptions of the plugins before actually selecting one.
  • Re-arrange the interface quite a bit. Now the general page arrangements make much more sense (Appearance [wallpaper/theme], Interface [desktop/panels], Applications [auto-start/file defaults], Shortcuts, Session [general options/window system] )
  • Add the ability to set your preferred time/date format(s) in the general session options.
  • Add the ability to reset your preferred file manager/terminal/web browser/email client back to defaults.
Insight File Manager Changes:
  • Make all the file operations happen in a separate thread (does not lock the UI any more).
  • Clean up the detection routine for Qt-editable files (for rotating images in the slideshow in particular).
  • When removing a file in the slideshow, make it simply go to the next/previous image instead of the beginning of the list.
  • Make the ZFS snapshot search functionality a lot faster if just refreshing the current directory.
Desktop Session Changes:
  • For vertical panels, have the clock plugin try to use vertical space instead of horizontal.
  • Clean up a few desktop plugin stability issues.
  • Streamline the session cleanup functionality.
  • Fix some issues with 2nd panel functionality.
  • Reduce the number of backend filesystem watchers (only one per session instead of one per screen now).
Lumina Search Changes:
  • When searching for files/directories, make the initial starting point user-configurable as well as add the ability to exclude directories from the search routine (also configurable by the user).

PC-BSD at SCALE

There will be a FreeBSD booth during SCALE, to be held at the Hilton LAX in Los Angeles from Friday, February 19 to Sunday, February 22. This event has a small entrance fee and registration is required. The FreeBSD booth will be next to the OpenBSD booth. As usual, we’ll be giving away cool swag, PC-BSD DVDs, FreeNAS CDs, and brochures and accepting donations for the FreeBSD Foundation.

There will be several BSD-related talks at this event. Dru Lavigne will present “What’s New in FreeNAS 9.3″ at 13:30 on Saturday, Brooks Davis will present “Booting FreeBSD on BERI” at 14:30 on Saturday, and Michael Dexter will present “FreeBSD Virtualization Options” at 16:30 on Saturday.

The BSDA certification exam will be available at noon on Sunday. You can register and pay for the exam here.

Testing the DRM update

The DRM update patch is now ready for review and testing.

As you can see, the patch is huge and I don’t expect a deep review of it. When I started to work on this, I tried to import some bits here and there. But I ended up porting every DRM files from Linux 3.8 from scratch. Many symbols were renamed (structure names, members, variables, etc.), functions were reordered or moved between files, new helpers and macros were added. The end-result is that the diff with Linux is greatly reduced.

Changes are mostly under-the-hood; the most important ones are described below. Beside a couple Radeon PCI IDs, drivers are largely untouched. Don’t expect Haswell support or Radeon power management in this patch for instance.

I think the two changes which could cause stability issues are:

  • A new lock, global to the DRM subsystem, was introduced. This one exists in Linux for a long time, but was not used in the original port of DRM: it was replaced by the lock protecting accesses to the structure representing a device. This incompatible change required us to sometimes unlock/relock the device lock to avoid recursion. Now that the global DRM lock is restored, we may have issues in some places where the device is now missing.
  • Return values were hopefully sanitized. On Linux, they return negative integers to indicate an error code. In FreeBSD, we do the opposite. The original DRM port modified many places to use positive integers. I restored negative integers to reduce the diff. Now, integers are converted from/to positive integers only when they come from a FreeBSD API or when they are returned to other FreeBSD subsystems. I reviewed every return values to make sure we use the proper sign, but I’m sure there are bugs in this area.

Now, the new things! First, support for the setmaster/dropmaster ioctls was introduced. A master is the application controlling the video device. The most common master is the X.Org server. Those ioctls allows masters to tell when they no longer use the video device so another master can use it. This can be used to run two X.Org servers for instance: when a user vt-switch, the currently displayed X.Org server drops its master privilege, allowing the second server to become the master.

The other new feature is the support for minor devices. Historically, a video device is accessed through /dev/dri/card0 for instance. As shown in the previous paragraph, if two masters compete for the same device, only one is allowed to execute commands on the video device. It could make sense for two X.Org servers. It is less than ideal if you want to run multiple OpenCL programs. Minor devices where introduced to present several /dev entries for a given video device. With this patch, you will see /dev/dri/card0 and /dev/dri/controlD64. The second dev entry is not used currently. When we update the drivers to a more recent Linux version and gain support for render nodes, another minor device will appear: /dev/dri/renderD128. Render nodes are used to grant applications such as computation programs a limited access to the video device. The X.Org server remains the master application, and an OpenCL program can use the video card without having to ask anything to the server. It doesn’t even need a running server. But this feature is not for now: we need to update the drivers first.

TDMA (somewhat) working on AR9380 chips

(Wow, I have a lot of posts to write to catch up on things.)

I've just brought up FreeBSD's TDMA support on the AR9380 chipset. Specifically, the AR9331, since I have a Carambola 2 on me today.

It was pretty simple to bring up - I was missing the beacon configuration HAL call that the TDMA code expected. It's only used by the TDMA code - the STA and AP modes rely on the normal HAL beacon methods that date back to the Atheros HAL.

The only problem - it seems something is up with ANI (noise immunity) and sensitivity on at least the AR9331. It doesn't seem to behave well on slightly loaded channels and thus the beacons don't always go out when they're supposed to.

But, if you've been wanting to play with TDMA on the later Atheros chips, now you can!

PC-BSD 11.0-CURRENT Images Now Available!

Kris just announced on the mailing list that new current images are now available! Check out the info below!

The PC-BSD project is pleased to announce the availability of our first
images based upon FreeBSD 11.0-CURRENT!

WARNING: These images are considered “bleeding-edge” and should be
treated as such.

The DVD/USB ISO files can now be downloaded from the following URL:

http://download.pcbsd.org/iso/11.0-CURRENTFEB2015/amd64/

We hope to continue rolling these –CURRENT images as a way for testers
and developers to tryout both FreeBSD and PC-BSD bleeding edge features,
often months before a planned release. These images include a full PKG
repository compiled for that months image. Users of this system will
also be able to “upgrade” when the next monthly image is published.

– Reporting Bugs –

This is a great way to test features and report bugs well before the
release cycle begins for the next major .0 release.

For bugs in PC-BSD, please report to:

https://bugs.pcbsd.org

For FreeBSD / Port / Kernel / World bugs, please report to:

https://bugs.freebsd.org/bugzilla/enter_bug.cgi

On the OpenCL front

Koop Mast, Johannes Dieterich and Oliver Hartmann made a lot of progress on OpenCL lately! A new “opencl” branch was created on GitHub, with several new ports:
  • lang/ocl-icd is an OpenCL ICD loader implementation. It is a libOpenCL.so wrapper who can manage several vendor-specific OpenCL implementations.
  • Four OpenCL implementations are being worked on:
    • Beignet (lang/beignet) is for Intel GPUs.
    • Clover (lang/clover) is for Radeon GPUs; it is part of Mesa.
    • Freeocl (devel/freeocl) and POCL rely on the CPU.
  • lang/clinfo is a simple tool (like glxinfo) who prints information about the OpenCL platform and device.
This is still experimental and can be considered of “alpha” quality. OpenCL headers are provided by several implementations, we need to handle this. Port categories are not even decided yet. But it is promising nonetheless! You can find a more detailed status on the wiki.

Status of the DRM update

The i915 kernel video driver refresh, committed two weeks ago, was enough to finally make Intel GPUs to start working with the update to the DRM device-independent code being prepared.

More than its age, the problem of our DRM kernel subsystem is its inconsistency:

  • The i915 driver matches Linux 3.5.
  • The Radeon driver comes from Linux 3.8.
  • The device-independent code is a mix of the legacy FreeBSD DRM code (sys/dev/drm) and some bits taken from an unknown version of Linux.

This makes updates very difficult to do because none of the drivers are on the same page.

The goal of this project is to bring the DRM device-independent code to Linux 3.8, the same version than the Radeon driver. It’s working well for more than a year, but couldn’t be committed because the i915 driver wouldn’t work with a newer DRM.

Thanks to the i915 update, it is working now, even if the driver only matches Linux 3.5. However, there are still some issues to review and fix:

  • In Linux, there’s a global DRM lock, mostly used during device attach/detach. In FreeBSD, the device lock was used instead. This caused many functions to be changed to avoid recursive locking (because they used the device lock). With the DRM update, I’m restoring the global DRM lock but there are still places where the locking is wrong: I need to review all of them.
  • Another problem is returned error codes. In Linux, they use negative integers. In FreeBSD, functions were modified to use positive integers. To reduce the diff, I’m restoring the negative integers inside the DRM subsystem. I just convert them to positive ones at the last moment, when the DRM subsystem interacts with other FreeBSD components. Again, this needs a thorough review.

This work is happenning in my “kms-drm-update-38″ branch on GitHub (branched from 11-CURRENT, frequently updated). Only the kernel is relevant, no need to rebuild world. Please test it as much as you can and report back to the freebsd-x11@ mailing-list!

Update to the i915 kernel driver

On Wednesday January 21th, Konstantin Belousov committed a first batch of updates to the i915 kernel video driver. Several fixes followed the initial commit.

His work brings the driver more closer to Linux 3.5 and thus includes several bug fixes and improvements to the support of generations up-to Ivy Bridge. However, Haswell and later generations are not supported yet: this will come at a later time.

Among the bugs fixed, the most annoying for users were:

  • Broken OpenGL applications (crashes, garbaged display) after one or more suspend/resume cycles. This regression appeared after the addition of hardware contexts support.
  • Backlight support which was non-functional for some people. The feedback seems positive now.

Furthermore, this driver refresh allows Jean-Sébastien Pédron to move forward with the DRM update work-in-progress. Another article will be posted on that topic.

pkg(8) passes coverity scans

At FOSDEM phk@ reminded me to always on regular basis make static analysis of the code via all possible tools available.

We did but on unregular basis and only paid attention to very critical reports And not all reports.

That is now fixed, I relaunched a few scan via coverity and I'm happy to say that the latest scan on master claims 0 defects!

Meaning that all known defects have been fixed.

I was also planning to use lint(1) as well, unfortunatly on FreeBSD lint is not supporting C99...

If I'm brave enough I may synchronise lint(1) with NetBSD which seems to have added C99 support to that tool. Or maybe someone will volunteer to do it? :)

PC-BSD 10.1.1-Release

Hey Everyone! The new version of PC-BSD is out. There are lots of improved features so check out the release notes below!

The PC-BSD team is pleased to announce the availability of 10.1.1-RELEASE!

Changes since RC2
———————————————

* Fixed an issue using auto-login in PCDM and setting incorrect locale
* Fixed a bug in user-manager allowing the deletion of the current user
* Updated GRUB to include i18n files
* Fixed an issue with invalid GPT options being displayed when
installing to a specific partition
* Updated GRUB to better auto-detect other disk-drives to chainload via
the boot menu
* Fixed various bugs in external media mounting

Changes since RC1
———————————————

* Disabled some diskid / gptid labels from installer
* Updated HandBook with additions for 10.1.1
* Fixes to Lumina desktop default settings
* Disabled the lock functionality in AppCafe
* Fixed an issue with VirtualBox modules not being loaded after install
* Updated some man pages for pbi_* commands
* Fixes to how ISO / memory disks are mounted via Mount Tray
* Fixes to Mount Tray for mounting exFAT partitions with write access
* Fixed an issue with UEFI USB media not loading GRUB correctly
* Removed pc-soundconfig utility, functionality has been merged into
pc-mixer

PC-BSD 10.1.1 notable Changes
———————————————

* Brand new system updater which supports automatic background updating
of the system
* Many improvements to boot-environments and GRUB support for a wider
variety of setups
* Support for installation to a specific GPT partition and GPT
dual-booting improvements
* Conversion to Qt5 for all desktop utilities
* Fixes to using dtrace when booted from GRUB
* Re-write of Mount Tray utility, improves mounting of external media
* Support for full-disk encryption (without an unencrypted /boot) using
GELI v7
* More packages available for installation from DVD/USB/CD images via
“PC-BSD roles“
* New OVA files for virtual machines
* Misc bugfixes and improvements to utilities
* GNOME 3.14.1
* Cinnamon 2.4.2
* Lumina desktop 0.8.1
* Chromium 39.0.2171.95
* Firefox 35.0
* NVIDIA Driver 340.65
* Pkg 1.4.4

Getting media
———————————————

10.1.1-RELEASE DVD/USB media can be downloaded from the following URL via
HTTP or Torrent.

http://www.pcbsd.org/en/download.html

Updating
———————————————

Users running on 10.1-RELEASE can now update to 10.1.1 via the normal
package updating mechanisms.

If the update cannot complete, such as when excessive pkg conflicts
exist, it is possible to grab the new PC-BSD updater from git and use
it. To do so, use the following instructions.

(As root)

# pkg update –f
# pkg upgrade –f ports-mgmt/pkg
# pkg update –f
# pkg install –f grub2-pcbsd

# git clone –depth=1 –b releng/10.1.1 https://github.com/pcbsd/pcbsd.git
# cd pcbsd/src-sh/libsh
# make install
# cd ../pcbsd-utils/pc-updatemanager
# make install
# pc-updatemanager pkgupdate

Reporting Bugs
———————————————
Found a bug in 10.1.1? Please report it (with as much detail as
possible) to our bugs database.

https://bugs.pcbsd.org

PC-BSD 10.1.1-RC2 Now Available

The PC-BSD team is pleased to announce the availability of RC2 images for the upcoming quarterly 10.1.1 release.

Please test these images out and report any issues found on our bug tracker.

Changes since RC1

* Disabled some diskid / gptid labels from installer
* Updated HandBook with additions for 10.1.1
* Fixes to Lumina desktop default settings
* Disabled the lock functionality in AppCafe
* Fixed an issue with VirtualBox modules not being loaded after install
* Updated some man pages for pbi_* commands
* Fixes to how ISO / memory disks are mounted via Mount Tray
* Fixes to Mount Tray for mounting exFAT partitions with write access
* Fixed an issue with UEFI USB media not loading GRUB correctly
* Removed pc-soundmixer utility, functionality has been merged into tray app

PC-BSD 10.1.1 notable Changes
* Brand new system updater which supports automatic background updating of the system
* Many improvements to boot-environments and GRUB support for a wider variety of setups
* Support for installation to a specific GPT partition and GPT dual-booting improvements
* Conversion to Qt5 for all desktop utilities
* Fixes to using dtrace when booted from GRUB
* Re-write of Mount Tray utility, improves mounting of external media
* Support for full-disk encryption (without an unencrypted /boot) using GELI v7
* More packages available for installation from DVD/USB/CD images via “PC-BSD roles“
* New OVA files for virtual machines
* Misc bugfixes and improvements to utilities
* GNOME 3.14.1
* Cinnamon 2.4.2
* Lumina desktop 0.8.0
* Chromium 39.0.2171.95
* Firefox 35.0
* NVIDIA Driver 340.65
* Pkg 1.4.4

Updating

Users currently running the EDGE package repo can now update their packages via the updater GUI or “pc-updatemanager” utility to be brought up to date with RC1.

Updates for users on the 10.1-RELEASE / PRODUCTION repo will be available once 10.1.1-RELEASE is announced.

Getting media

10.1.1-RC2 DVD/USB media can be downloaded from here via HTTP or Torrent.

Reporting Bugs

Found a bug in 10.1.1? Please report it (with as much detail as possible) to our bugs database.