Language Selection

English French German Italian Portuguese Spanish

GCC: OpenMP / OpenACC and Static Analysis Framework

Filed under
Development
GNU
  • The GCC 10 Compiler Lands OpenMP / OpenACC Offloading To AMD Radeon GPUs

    A few days ago I wrote about the OpenMP / OpenACC offloading patches for Radeon "GCN" GPUs being posted and seeking inclusion in the GCC 10 compiler that will be released in a few months. Those patches were successfully merged meaning this next annual update to the GNU Compiler Collection will feature initial OpenMP/OpenACC code offloading support to supported AMD GPU targets.

    After GCC 9 only had the initial AMD Radeon GCN target in place, GCC 10 in early 2020 will feature the initial offloading support using the modern OpenMP and OpenACC APIs, thanks to the merges this week. The libgomp port and associated bits for the AMD GCN back-end have landed thanks to the work done by Code Sourcery under contract with AMD.

  • RFC: Add a static analysis framework to GCC
    This patch kit introduces a static analysis pass for GCC that can diagnose
    various kinds of problems in C code at compile-time (e.g. double-free,
    use-after-free, etc).
    
    The analyzer runs as an IPA pass on the gimple SSA representation.
    It associates state machines with data, with transitions at certain
    statements and edges.  It finds "interesting" interprocedural paths
    through the user's code, in which bogus state transitions happen.
    
    For example, given:
    
       free (ptr);
       free (ptr);
    
    at the first call, "ptr" transitions to the "freed" state, and
    at the second call the analyzer complains, since "ptr" is already in
    the "freed" state (unless "ptr" is NULL, in which case it stays in
    the NULL state for both calls).
    
    Specific state machines include:
    - a checker for malloc/free, for detecting double-free, resource leaks,
      use-after-free, etc (sm-malloc.cc), and
    - a checker for stdio's FILE stream API (sm-file.cc)
    
    There are also two state-machine-based checkers that are just
    proof-of-concept at this stage:
    - a checker for tracking exposure of sensitive data (e.g.
      writing passwords to log files aka CWE-532), and
    - a checker for tracking "taint", where data potentially under an
      attacker's control is used without sanitization for things like
      array indices (CWE-129).
    
    There's a separation between the state machines and the analysis
    engine, so it ought to be relatively easy to add new warnings.
    
    For any given diagnostic emitted by a state machine, the analysis engine
    generates the simplest feasible interprocedural path of control flow for
    triggering the diagnostic.
    
  • GCC Might Finally Have A Static Analysis Framework Thanks To Red Hat

    Clang's static analyzer has become quite popular with developers for C/C++ static analysis of code while now the GNU Compiler Collection (GCC) might finally see a mainline option thanks to Red Hat.

    Red Hat's David Malcolm has proposed a set of 49 patches that appear to be fairly robust and the most we have seen out of GCC static analysis capabilities to date.

More in Tux Machines

today's howtos

Events: KVM Forum 2019 and "Bar Charts for Diversity"

  • A recap of KVM Forum 2019

    The 13th KVM Forum virtualization conference took place in Lyon, France in October 2019. One might think that development may have finished on the Kernel Virtual Machine (KVM) module that was merged in Linux 2.6.20 in 2007, but this year's conference underscored the amount of work still being done, particularly on side-channel attack mitigation, I/O device assignment with VFIO and mdev, footprint reduction with micro virtual machines (VMs), and with the ability to run VMs nested within VMs. Many talks also involved the virtual machine monitor (VMM) user-space programs that use the KVM kernel module—of which QEMU is the most widely used.

  • Enhancing KVM for guest protection and security

    A key tenet in KVM is to reuse as much Linux infrastructure as possible and focus specifically on processor virtualization. Back in 2007, this meant a smaller code base and less friction with the other kernel subsystems, especially when compared with other virtualization technologies such as Xen. This led to KVM being merged into the mainline with relative ease. But now, in the era of microarchitectural vulnerabilities, the priorities have shifted, and the KVM's reliance on other kernel subsystems can be a liability. For one thing, the host kernel widens the TCB (Trusted Computing Base) and makes for a larger attack surface. In addition, kernel data structures such as the direct memory map give Linux access to guest memory even when it is not strictly necessary and make it impossible to fully enforce the principle of least privilege. In his talk "Enhancing KVM for Guest Protection and Security" (slides [PDF]) presented at KVM Forum 2019, long-time KVM contributor Jun Nakajima explained this risk and suggested some strategies to mitigate it.

  • Bar charts for diversity

    At the Linux App Summit I gave an unconference talk titles Hey guys, this conference is for everyone. The “hey guys” part refers to excluding people from a talk or making them feel uncomfortable – you can do this unintentionally, and the take-away of the talk was that you, (yes, you) can be better. I illustrated this mostly with conversational distance, a favorite topic of mine that I can demonstrate easily on stage. There’s a lot of diversity in how far people stand away from strangers, while explaining something they care about. The talk wasn’t recorded, but I’ve put the slides up. Another side of diversity can be dealt with by statistics. Since I’m a mathematician, I have a big jar of peanuts and raisins in the kitchen. Late at night I head down to the kitchen and grab ten items from the jar. Darn, all of them are raisins. What are the odds!? Well, a lot depends on whether there are any peanuts in the jar at all; what percentage is peanuts; whether I’m actually picking things randomly or not. There’s a convenient tool that Katarina Behrens pointed me to, which can help figure this out. Even if there’s only a tiny fraction of peanuts in the jar, there’s an appreciable chance of getting one (e.g. change the percentage on that page to 5% and you’ll see).

Linux on the MAG1 8.9 inch mini-laptop (Ubuntu and Fedora)

The Magic Ben MAG1 mini-laptop is a 1.5 pound notebook computer that measures about 8.2″ x 5.8″ x 0.7″ and which features an 8.9 inch touchscreen display and an Intel Core m3-8100Y processor. As I noted in my MAG1 review, the little computer also has one of the best keyboards I’ve used on a laptop this small and a tiny, but responsive trackpad below the backlit keyboard. Available from GeekBuying for $630 and up, the MAG1 ships with Windows 10, but it’s also one of the most Linux-friendly mini-laptops I’ve tested to date. [...] I did not install either operating system to local storage, so I cannot comment on sleep, battery life, fingerprint authentication, or other features that you’d only be able to truly test by fully installing Ubuntu, Fedora, or another GNU/Linux-based operating system. But running from a liveUSB is a good way to kick the tires and see if there are any obvious pain points before installing an operating system, and for the most part the two operating systems I tested look good to go. Booting from a flash drive is also pretty easy. Once you’ve prepared a bootable drive using Rufus, UNetbootin, or a similar tool, just plug it into the computer’s USB port, hit the Esc key during startup to bring up the UEFI/SETUP utility. Read more Also: Top 10 technical skills that will get you hired in 2020

Android Leftovers