qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 0/6] relicense QEMU softfloat from 2b to to 2a


From: Peter Maydell
Subject: [Qemu-devel] [PATCH 0/6] relicense QEMU softfloat from 2b to to 2a
Date: Tue, 25 Nov 2014 14:17:31 +0000

[If you're not a regular QEMU contributor: you are CC'd on this
just for your information and because you provided an Acked-by for
the previous version of this patch back in 2013; thanks! No action
is required from you. Regular contributors are invited to review
the patchset.]

Hi; as you may be aware, we discovered some time back that
the license of SoftFloat-2b is claimed to be GPLv2 incompatible by
the FSF due to an indemnification clause.  The previous release,
SoftFloat-2a, did not contain this clause. We're therefore switching
to the -2a release and relicensing (or reverting and reimplementing)
all subsequent commits by QEMU contributors.

Last time around we were able to collect acks for the relicensing
from almost all contributors, so thanks to all of you. This patchset
aims to complete the process by applying the relicensing patch and
providing reimplemented code for the handful of commits that had to
be reverted.

The patch switching from upstream's SoftFloat-2b to -2a is
constructed in the same way Anthony Liguori used in 2013:
 * diff commit 158142c2 against SoftFloat-2b to separate out the
   changes made by Fabrice as part of the import
 * copy over the SoftFloat-2a versions of the files instead
 * apply some mechanical transformations (line endings, block comment style)
 * re-apply Fabrice's patches
 * diff this endpoint against 158142c2 to give a 2b-to-2a relicensing patch
 * apply that to current master

Conceptually I would have preferred to replay all of our QEMU
commits after 158142c2 on top of the SoftFloat-2a equivalent
(giving a sort of alternate-history master rebased on 2a) and then
diffed that against the real-world master. However git cherry-pick
chokes on merge commits. If anybody has better git skills than me
and thinks this can be done then I'd be interested to see it.
In any case the patch is I think equivalent -- it's just a matter of
which two sides of a square you go round to reach the far corner.

Following this change are a set of patches which revert the only four
commits in the tree which are still relevant and for which we could not
get acks for relicensing. I present them in this series as separate
"revert" and "reimplement" patches, since this more clearly shows the
intent. Obviously this will break bisection...

Finally there's a patch which adds comments to the top of each
affected file clarifying the new licensing status (where the files
contain portions under variously SoftFloat-2a, BSD and GPLv2+
licenses) and specifying the default license for new contributions (so
we don't have to keep asking patch submitters to specify it). I've
applied the Acked-by tags from the 2013 round to this patch as it
seemed the most appropriate place. (Those acks should thus be taken to
indicate approval for the relicensing rather than necessarily
specifically for the wording choice.)

Questions for review:
 * can we do the git cherry-pick thing I mention above?
 * should we squash the revert and reimplement patches together?
   (avoids bisection break but makes the revert-and-reimplement less clear)
 * would anybody like to cross-check my examination of the commit logs
   to confirm I didn't miss any patches we need to revert?
 * are there any bugs in my reimplementations?
 * are people happy with my attempt to clarify the licensing status of
   the source files in patch 6, and my choice of GPLv2+ for future
   contributions to them?

I've put the full details of how I constructed this patchset after the
diffstat. References in that text to "this archive" are to 
http://people.linaro.org/~peter.maydell/softfloat-relicensing-proposed.tar.gz
which is a complete archive of everything needed to reproduce the
patchset, including copies of upstream's pristine 2a and 2b tarballs.
If/when this patchset is applied I plan to upload it to the QEMU webserver
as a permanent archive of what happened here (since the commit diffs
themselves don't tell the full story).

thanks
-- PMM

Peter Maydell (6):
  softfloat: Apply patch corresponding to rebasing to softfloat-2a
  softfloat: Revert remaining portions of commits 75d62a5856 and
    3430b0be36f
  softfloat: Revert remaining parts of commits b645bb4885 and 5a6932d51d
  softfloat: Implement uint64_to_float64() and uint64_to_float32()
  softfloat: reimplement SNAN_BIT_IS_ONE support
  softfloat: Clarify license status

 fpu/softfloat-macros.h     |  86 +++++++++++++++++++++-------
 fpu/softfloat-specialize.h | 139 ++++++++++++++++++++++++++++++---------------
 fpu/softfloat.c            | 136 +++++++++++++++++++++++++++++++-------------
 include/fpu/softfloat.h    |  82 +++++++++++++++++++-------
 4 files changed, 316 insertions(+), 127 deletions(-)

-- 
1.9.1

QEMU relicensing from SoftFloat-2b to SoftFloat-2a
==================================================

This archive contains binaries, patches and documentation regarding the
process of relicensing QEMU's softfloat code from 2b to 2a.

The process followed is in two parts: replace the upstream
SoftFloat code with the equivalent files from the upstream 2a release;
and then revert and rewrite some later commits by QEMU contributors who
could not be contacted to agree to a relicensing of their work.

Replacement of upstream code
----------------------------

This archive includes SoftFloat-2a.zip and SoftFloat-2b.zip, which
are the original upstream source releases downloaded from:

http://web.archive.org/web/19991004171915/http://http.cs.berkeley.edu/%7Ejhauser/arithmetic/SoftFloat-2a.zip
http://www.jhauser.us/arithmetic/SoftFloat-2b.zip

The differences between the two are minimal, consisting mostly of
the license change and a change in the style used for block comments.

Starting from the commit immediately before the original softfloat import
(4f716dc681d1b) we can construct a series of commits which import the
version 2a sources instead.

First separate out the changes Fabrice wrote as part of the initial
import from the upstream 2b changes, and save the patch for later:

    cp SoftFloat-2b/softfloat/bits64/softfloat.c 2b-rearranged/fpu
    cp SoftFloat-2b/softfloat/bits64/386-Win32-GCC/softfloat.h 
2b-rearranged/fpu/
    cp SoftFloat-2b/softfloat/bits64/softfloat-macros 
2b-rearranged/fpu/softfloat-macros.h
    cp SoftFloat-2b/softfloat/bits64/386-Win32-GCC/softfloat-specialize 
2b-rearranged/fpu/
softfloat-specialize.h
    dos2unix 2b-rearranged/fpu/*.[ch]
    cd qemu
    git checkout 158142c2c2df728cfa3b5320c65534921a764f26
    cd ..
    diff -uN 2b-rearranged/fpu qemu/fpu > fabrice-initial-changes.patch

Now we can create the patchseries which is the equivalent 2a import:

    cd qemu
    git checkout 4f716dc681d1b

Copy the 2a files and fix their line endings to Unix style:

    cp ../SoftFloat-2a/softfloat/bits64/softfloat.c fpu
    cp ../SoftFloat-2a/softfloat/bits64/386-Win32-gcc/softfloat.h fpu
    cp ../SoftFloat-2a/softfloat/bits64/softfloat-macros fpu/softfloat-macros.h
    cp ../SoftFloat-2a/softfloat/bits64/386-Win32-gcc/softfloat-specialize 
fpu/softfloat-specialize.h
    dos2unix fpu/*.[ch]

Add the new files and configure/makefile changes from 158142c2c2df
    
    git checkout 158142c2c2df7 fpu/softfloat-native.c fpu/softfloat-native.h
    git show 158142c2c2df7 Makefile.target configure | patch -p1

Mechanically update comment style (the perl script used is provided in this 
archive)
    
    for f in fpu/softfloat-specialize.h fpu/softfloat-macros.h fpu/softfloat.c 
fpu/softfloat.h; do fix-softfloat-comments $f > $f.new && mv $f.new $f; done

Delete a handful of blank lines to avoid spurious patch rejects.

Apply the "Fabrice initial changes" patch created earlier:
This requires a bunch of fuzzing but it does not fail on any hunks.
    
     patch -N -p1 --fuzz 5 -i ../fabrice-initial-changes.patch
    
The five commits that result from this process are archived in
the reimport/ subdirectory.

We can now create a patch by diffing the endpoint of this set of commits
against the original upstream import commit 158142c2c2df7:
     diff -u 158142c2c2df import-sf-2a > ../relicense-patch.txt

That patch is also included in this archive. It consists entirely
of changes to version numbers, licence text and a trivial comment
reformat (as expected, since the upstream 2a to 2b changes were just this).

We can then apply that patch to current QEMU master:
     patch  -p1 --fuzz 10 <../relicense-patch.txt
to produce a modern QEMU effectively rebased on version 2a of upstream
SoftFloat.

Reverting and rewriting of later QEMU commits
---------------------------------------------

Since contributions to these softfloat files in QEMU after their
initial import have to be assumed to have been provided by their
authors under the SoftFloat-2b license, we needed to get permission
from those authors to relicense their contributions under either
the SoftFloat-2a license or some other GPLv2 compatible license.
Most of these were collected in an email thread on qemu-devel
in 2013 where we requested permission for relicensing changes which
had been made up to that point. For all changes to these files after
that date we confirmed with the patch submitter that they were willing
to dual-license their change before applying the commit.

The affected commits can be listed with:
  git log -- fpu/softfloat.h fpu/softfloat.c fpu/softfloat-specialize.h 
fpu/softfloat-macros.h include/fpu/softfloat.h

The file fpu-logs.txt lists these commits, annotated to either
to indicate that it's ok for relicensing, or to indicate that the
commit must be reverted. Only four commits need reversion:
 5a6932d51d1b, b645bb4885, 3430b0be36fb7 and 75d62a585629c

The interesting cases (both the SFNOs and a handful of SFOK that
were not trivially obviously OK) have been copied into 'sfno.txt'
(to save you having to wade through the long list).

Copies of all the emails where people provided Acks are in the ackmails/
directory.

The patches in the reverts/ directory:
 * apply the relicense-patch
 * revert those parts of commits 5a6932d51d1b, b645bb4885, 3430b0be36fb7 and
   75d62a585629c which change the softfloat files and are still in the
   QEMU tree
 * independently reimplement the two functions and one bit of minor
   functionality which those commits provided
 * update the source files to indicate the now complicated licensing
   that applies since some relicensing was to BSD or GPLv2+ rather than
   softfloat-2a

---end of README---



reply via email to

[Prev in Thread] Current Thread [Next in Thread]