1. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  2. 23 Aug, 2017 1 commit
    • Janakarajan Natarajan's avatar
      KVM: SVM: Enable Virtual GIF feature · 640bd6e5
      Janakarajan Natarajan authored
      Enable the Virtual GIF feature. This is done by setting bit 25 at position
      60h in the vmcb.
      
      With this feature enabled, the processor uses bit 9 at position 60h as the
      virtual GIF when executing STGI/CLGI instructions.
      
      Since the execution of STGI by the L1 hypervisor does not cause a return to
      the outermost (L0) hypervisor, the enable_irq_window and enable_nmi_window
      are modified.
      
      The IRQ window will be opened even if GIF is not set, under the assumption
      that on resuming the L1 hypervisor the IRQ will be held pending until the
      processor executes the STGI instruction.
      
      For the NMI window, the STGI intercept is set. This will assist in opening
      the window only when GIF=1.
      Signed-off-by: default avatarJanakarajan Natarajan <Janakarajan.Natarajan@amd.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      640bd6e5
  3. 12 Jul, 2017 3 commits
  4. 15 Jun, 2016 1 commit
  5. 18 May, 2016 2 commits
  6. 14 Dec, 2012 1 commit
  7. 21 Sep, 2012 1 commit
  8. 12 Jan, 2011 7 commits
  9. 17 May, 2010 2 commits
    • Jan Kiszka's avatar
      KVM: x86: Push potential exception error code on task switches · e269fb21
      Jan Kiszka authored
      When a fault triggers a task switch, the error code, if existent, has to
      be pushed on the new task's stack. Implement the missing bits.
      Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      e269fb21
    • Andre Przywara's avatar
      KVM: SVM: implement NEXTRIPsave SVM feature · 6bc31bdc
      Andre Przywara authored
      On SVM we set the instruction length of skipped instructions
      to hard-coded, well known values, which could be wrong when (bogus,
      but valid) prefixes (REX, segment override) are used.
      Newer AMD processors (Fam10h 45nm and better, aka. PhenomII or
      AthlonII) have an explicit NEXTRIP field in the VMCB containing the
      desired information.
      Since it is cheap to do so, we use this field to override the guessed
      value on newer processors.
      A fix for older CPUs would be rather expensive, as it would require
      to fetch and partially decode the instruction. As the problem is not
      a security issue and needs special, handcrafted code to trigger
      (no compiler will ever generate such code), I omit a fix for older
      CPUs.
      If someone is interested, I have both a patch for these CPUs as well as
      demo code triggering this issue: It segfaults under KVM, but runs
      perfectly on native Linux.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@amd.com>
      Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      6bc31bdc
  10. 25 Apr, 2010 1 commit
  11. 01 Mar, 2010 1 commit
  12. 03 Dec, 2009 1 commit
    • Mark Langsdorf's avatar
      KVM: SVM: Support Pause Filter in AMD processors · 565d0998
      Mark Langsdorf authored
      New AMD processors (Family 0x10 models 8+) support the Pause
      Filter Feature.  This feature creates a new field in the VMCB
      called Pause Filter Count.  If Pause Filter Count is greater
      than 0 and intercepting PAUSEs is enabled, the processor will
      increment an internal counter when a PAUSE instruction occurs
      instead of intercepting.  When the internal counter reaches the
      Pause Filter Count value, a PAUSE intercept will occur.
      
      This feature can be used to detect contended spinlocks,
      especially when the lock holding VCPU is not scheduled.
      Rescheduling another VCPU prevents the VCPU seeking the
      lock from wasting its quantum by spinning idly.
      
      Experimental results show that most spinlocks are held
      for less than 1000 PAUSE cycles or more than a few
      thousand.  Default the Pause Filter Counter to 3000 to
      detect the contended spinlocks.
      
      Processor support for this feature is indicated by a CPUID
      bit.
      
      On a 24 core system running 4 guests each with 16 VCPUs,
      this patch improved overall performance of each guest's
      32 job kernbench by approximately 3-5% when combined
      with a scheduler algorithm thati caused the VCPU to
      sleep for a brief period. Further performance improvement
      may be possible with a more sophisticated yield algorithm.
      Signed-off-by: default avatarMark Langsdorf <mark.langsdorf@amd.com>
      Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      565d0998
  13. 10 Jun, 2009 1 commit
  14. 24 Mar, 2009 1 commit
  15. 31 Dec, 2008 1 commit
  16. 27 Apr, 2008 1 commit
  17. 30 Jan, 2008 3 commits
  18. 16 Jul, 2007 1 commit
  19. 03 May, 2007 1 commit
  20. 10 Dec, 2006 1 commit
    • Avi Kivity's avatar
      [PATCH] kvm: userspace interface · 6aa8b732
      Avi Kivity authored
      web site: http://kvm.sourceforge.net
      
      mailing list: kvm-devel@lists.sourceforge.net
        (http://lists.sourceforge.net/lists/listinfo/kvm-devel)
      
      The following patchset adds a driver for Intel's hardware virtualization
      extensions to the x86 architecture.  The driver adds a character device
      (/dev/kvm) that exposes the virtualization capabilities to userspace.  Using
      this driver, a process can run a virtual machine (a "guest") in a fully
      virtualized PC containing its own virtual hard disks, network adapters, and
      display.
      
      Using this driver, one can start multiple virtual machines on a host.
      
      Each virtual machine is a process on the host; a virtual cpu is a thread in
      that process.  kill(1), nice(1), top(1) work as expected.  In effect, the
      driver adds a third execution mode to the existing two: we now have kernel
      mode, user mode, and guest mode.  Guest mode has its own address space mapping
      guest physical memory (which is accessible to user mode by mmap()ing
      /dev/kvm).  Guest mode has no access to any I/O devices; any such access is
      intercepted and directed to user mode for emulation.
      
      The driver supports i386 and x86_64 hosts and guests.  All combinations are
      allowed except x86_64 guest on i386 host.  For i386 guests and hosts, both pae
      and non-pae paging modes are supported.
      
      SMP hosts and UP guests are supported.  At the moment only Intel
      hardware is supported, but AMD virtualization support is being worked on.
      
      Performance currently is non-stellar due to the naive implementation of the
      mmu virtualization, which throws away most of the shadow page table entries
      every context switch.  We plan to address this in two ways:
      
      - cache shadow page tables across tlb flushes
      - wait until AMD and Intel release processors with nested page tables
      
      Currently a virtual desktop is responsive but consumes a lot of CPU.  Under
      Windows I tried playing pinball and watching a few flash movies; with a recent
      CPU one can hardly feel the virtualization.  Linux/X is slower, probably due
      to X being in a separate process.
      
      In addition to the driver, you need a slightly modified qemu to provide I/O
      device emulation and the BIOS.
      
      Caveats (akpm: might no longer be true):
      
      - The Windows install currently bluescreens due to a problem with the
        virtual APIC.  We are working on a fix.  A temporary workaround is to
        use an existing image or install through qemu
      - Windows 64-bit does not work.  That's also true for qemu, so it's
        probably a problem with the device model.
      
      [bero@arklinux.org: build fix]
      [simon.kagstrom@bth.se: build fix, other fixes]
      [uril@qumranet.com: KVM: Expose interrupt bitmap]
      [akpm@osdl.org: i386 build fix]
      [mingo@elte.hu: i386 fixes]
      [rdreier@cisco.com: add log levels to all printks]
      [randy.dunlap@oracle.com: Fix sparse NULL and C99 struct init warnings]
      [anthony@codemonkey.ws: KVM: AMD SVM: 32-bit host support]
      Signed-off-by: default avatarYaniv Kamay <yaniv@qumranet.com>
      Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
      Cc: Simon Kagstrom <simon.kagstrom@bth.se>
      Cc: Bernhard Rosenkraenzer <bero@arklinux.org>
      Signed-off-by: default avatarUri Lublin <uril@qumranet.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Roland Dreier <rolandd@cisco.com>
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarAnthony Liguori <anthony@codemonkey.ws>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6aa8b732