<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/include/exec/user, branch master</title>
<subtitle>Experimental fork of QEMU with video encoding patches</subtitle>
<id>https://git.openslx.org/bwlp/qemu.git/atom/include/exec/user?h=master</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/include/exec/user?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/'/>
<updated>2020-11-15T16:04:40+00:00</updated>
<entry>
<title>nomaintainer: Fix Lesser GPL version number</title>
<updated>2020-11-15T16:04:40+00:00</updated>
<author>
<name>Chetan Pant</name>
</author>
<published>2020-10-23T12:44:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=61f3c91a67c4695dee6904d841b393ea21003969'/>
<id>urn:sha1:61f3c91a67c4695dee6904d841b393ea21003969</id>
<content type='text'>
There is no "version 2" of the "Lesser" General Public License.
It is either "GPL version 2.0" or "Lesser GPL version 2.1".
This patch replaces all occurrences of "Lesser GPL version 2" with
"Lesser GPL version 2.1" in comment section.

This patch contains all the files, whose maintainer I could not get
from ‘get_maintainer.pl’ script.

Signed-off-by: Chetan Pant &lt;chetan4windows@gmail.com&gt;
Message-Id: &lt;20201023124424.20177-1-chetan4windows@gmail.com&gt;
Reviewed-by: Thomas Huth &lt;thuth@redhat.com&gt;
[thuth: Adapted exec.c and qdev-monitor.c to new location]
Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
</content>
</entry>
<entry>
<title>linux-user: fix implicit conversion from enumeration type error</title>
<updated>2020-09-02T23:09:31+00:00</updated>
<author>
<name>Laurent Vivier</name>
</author>
<published>2020-09-02T12:57:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=b119339610d752f799e44bc42f4fe8f9d2bf8072'/>
<id>urn:sha1:b119339610d752f799e44bc42f4fe8f9d2bf8072</id>
<content type='text'>
MK_ARRAY(type,size) is used to fill the field_types buffer, and if the
"size" parameter is an enum type, clang [-Werror,-Wenum-conversion] reports
an error when it is assigned to field_types which is also an enum, argtypes.

To avoid that, convert "size" to "int" in MK_ARRAY(). "int" is the type
used for the size evaluation in thunk_type_size().

Signed-off-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
Message-Id: &lt;20200902125752.1033524-1-laurent@vivier.eu&gt;
</content>
</entry>
<entry>
<title>linux-user: Add strace support for printing arguments for ioctls used for terminals and serial lines</title>
<updated>2020-08-27T10:29:50+00:00</updated>
<author>
<name>Filip Bozuta</name>
</author>
<published>2020-07-23T21:02:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=888468db949e8ea1641c33d97e70b70f57eb69e9'/>
<id>urn:sha1:888468db949e8ea1641c33d97e70b70f57eb69e9</id>
<content type='text'>
Functions "print_ioctl()" and "print_syscall_ret_ioctl()" are used
to print arguments of "ioctl()" with "-strace". These functions
use "thunk_print()", which is defined in "thunk.c", to print the
contents of ioctl's third arguments that are not basic types.

However, this function doesn't handle ioctls of group ioctl_tty which
are used for terminals and serial lines. These ioctls use a type
"struct termios" which thunk type is defined in a non standard
way using "STRUCT_SPECIAL()". This means that this type is not decoded
regularly using "thunk_convert()" and uses special converting functions
"target_to_host_termios()" and "host_to_target_termios()", which are defined
in "syscall.c" to decode it's values.

For simillar reasons, this type is also not printed regularly using
"thunk_print()". That is the reason why a separate printing function
"print_termios()" is defined in file "strace.c". This function decodes
and prints flag values of the "termios" structure.

Implementation notes:

    Function "print_termios()" was implemented in "strace.c" using
    an existing function "print_flags()" to print flag values of
    "struct termios" fields. Also, recently implemented function
    "print_enums()" was also used to print enumareted values which
    are contained in the fields of 'struct termios'.

    These flag values were defined using an existing macro "FLAG_TARGET()"
    that generates aproppriate target flag values and string representations
    of these flags. Also, the recently defined macro "ENUM_TARGET()" was
    used to generate aproppriate enumarated values and their respective
    string representations.

    Function "print_termios()" was declared in "qemu.h" so that it can
    be accessed in "syscall.c". Type "StructEntry" defined in
    "exec/user/thunk.h" contains information that is used to decode
    structure values. Field "void print(void *arg)" was added in this
    structure as a special print function. Also, function "thunk_print()"
    was changed a little so that it uses this special print function
    in case it is defined. This printing function was instantiated with
    the defined "print_termios()" in "syscall.c" in "struct_termios_def".

Signed-off-by: Filip Bozuta &lt;Filip.Bozuta@syrmia.com&gt;
Reviewed-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
Message-Id: &lt;20200723210233.349690-4-Filip.Bozuta@syrmia.com&gt;
Signed-off-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
</content>
</entry>
<entry>
<title>linux-user: Add strace support for printing arguments of ioctl()</title>
<updated>2020-07-04T16:08:51+00:00</updated>
<author>
<name>Filip Bozuta</name>
</author>
<published>2020-06-19T12:47:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=79482e5987c824086d8824ebcf95a0c8c9c16cd7'/>
<id>urn:sha1:79482e5987c824086d8824ebcf95a0c8c9c16cd7</id>
<content type='text'>
This patch implements functionality for strace argument printing for ioctls.
When running ioctls through qemu with "-strace", they get printed in format:

    "ioctl(fd_num,0x*,0x*) = ret_value"

where the request code an the ioctl's third argument get printed in a hexadicemal
format. This patch changes that by enabling strace to print both the request code
name and the contents of the third argument. For example, when running ioctl
RTC_SET_TIME with "-strace", with changes from this patch, it gets printed in
this way:

    "ioctl(3,RTC_SET_TIME,{12,13,15,20,10,119,0,0,0}) = 0"

In case of IOC_R type ioctls, the contents of the third argument get printed
after the return value, and the argument inside the ioctl call gets printed
as pointer in hexadecimal format. For example, when running RTC_RD_TIME with
"-strace", with changes from this patch, it gets printed in this way:

    "ioctl(3,RTC_RD_TIME,0x40800374) = 0 ({22,9,13,11,5,120,0,0,0})"

In case of IOC_RW type ioctls, the contents of the third argument get printed
both inside the ioctl call and after the return value.

Implementation notes:

    Functions "print_ioctl()" and "print_syscall_ret_ioctl()", that are defined
    in "strace.c", are listed in file "strace.list" as "call" and "result"
    value for ioctl. Structure definition "IOCTLEntry" as well as predefined
    values for IOC_R, IOC_W and IOC_RW were cut and pasted from file "syscall.c"
    to file "qemu.h" so that they can be used by these functions to print the
    contents of the third ioctl argument. Also, the "static" identifier for array
    "ioctl_entries[]" was removed and this array was declared as "extern" in "qemu.h"
    so that it can also be used by these functions. To decode the structure type
    of the ioctl third argument, function "thunk_print()" was defined in file
    "thunk.c" and its definition is somewhat simillar to that of function
    "thunk_convert()".

Signed-off-by: Filip Bozuta &lt;Filip.Bozuta@syrmia.com&gt;
Reviewed-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
Message-Id: &lt;20200619124727.18080-3-filip.bozuta@syrmia.com&gt;
[lv: fix close-bracket]
Signed-off-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
</content>
</entry>
<entry>
<title>include: Make headers more self-contained</title>
<updated>2019-08-16T11:31:51+00:00</updated>
<author>
<name>Markus Armbruster</name>
</author>
<published>2019-08-12T05:23:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=ec150c7e09071bcf51bfaa8071fe23efb6df69f7'/>
<id>urn:sha1:ec150c7e09071bcf51bfaa8071fe23efb6df69f7</id>
<content type='text'>
Back in 2016, we discussed[1] rules for headers, and these were
generally liked:

1. Have a carefully curated header that's included everywhere first.  We
   got that already thanks to Peter: osdep.h.

2. Headers should normally include everything they need beyond osdep.h.
   If exceptions are needed for some reason, they must be documented in
   the header.  If all that's needed from a header is typedefs, put
   those into qemu/typedefs.h instead of including the header.

3. Cyclic inclusion is forbidden.

This patch gets include/ closer to obeying 2.

It's actually extracted from my "[RFC] Baby steps towards saner
headers" series[2], which demonstrates a possible path towards
checking 2 automatically.  It passes the RFC test there.

[1] Message-ID: &lt;87h9g8j57d.fsf@blackfin.pond.sub.org&gt;
    https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
[2] Message-Id: &lt;20190711122827.18970-1-armbru@redhat.com&gt;
    https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg02715.html

Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Reviewed-by: Alistair Francis &lt;alistair.francis@wdc.com&gt;
Message-Id: &lt;20190812052359.30071-2-armbru@redhat.com&gt;
Tested-by: Philippe Mathieu-Daudé &lt;philmd@redhat.com&gt;
</content>
</entry>
<entry>
<title>linux-user: Assert on bad type in thunk_type_align() and thunk_type_size()</title>
<updated>2018-05-24T18:46:54+00:00</updated>
<author>
<name>Peter Maydell</name>
</author>
<published>2018-05-14T17:46:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=75578d6fcedc55b85b44dfc83f506b74c32b7395'/>
<id>urn:sha1:75578d6fcedc55b85b44dfc83f506b74c32b7395</id>
<content type='text'>
In thunk_type_align() and thunk_type_size() we currently return
-1 if the value at the type_ptr isn't one of the TYPE_* values
we understand. However, this should never happen, and if it does
then the calling code will go confusingly wrong because none
of the callsites try to handle an error return. Switch to an
assertion instead, so that if this does somehow happen we'll have
a nice clear backtrace of what happened rather than a weird crash
or misbehaviour.

This also silences various Coverity complaints about not handling
the negative return value (CID 1005735, 1005736, 1005738, 1390582).

Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Reviewed-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
Message-Id: &lt;20180514174616.19601-1-peter.maydell@linaro.org&gt;
Signed-off-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
</content>
</entry>
<entry>
<title>linux-user: correctly align types in thunking code</title>
<updated>2018-05-14T10:01:21+00:00</updated>
<author>
<name>Laurent Vivier</name>
</author>
<published>2018-05-10T20:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=f606e4d6258fa82c3f6c1cc762ebe483db5f5db6'/>
<id>urn:sha1:f606e4d6258fa82c3f6c1cc762ebe483db5f5db6</id>
<content type='text'>
This is a follow up
of patch:

        commit c2e3dee6e03527baf8698698cce76b1a3174969a
        Author: Laurent Vivier &lt;laurent@vivier.eu&gt;
        Date:   Sun Feb 13 23:37:34 2011 +0100

            linux-user: Define target alignment size

In my case m68k aligns "int" on 2 not 4. You can check this with the
following program:

int main(void)
{
        struct rtentry rt;
        printf("rt_pad1 %ld %zd\n", offsetof(struct rtentry, rt_pad1),
                sizeof(rt.rt_pad1));
        printf("rt_dst %ld %zd\n", offsetof(struct rtentry, rt_dst),
                sizeof(rt.rt_dst));
        printf("rt_gateway %ld %zd\n", offsetof(struct rtentry, rt_gateway),
                sizeof(rt.rt_gateway));
        printf("rt_genmask %ld %zd\n", offsetof(struct rtentry, rt_genmask),
                sizeof(rt.rt_genmask));
        printf("rt_flags %ld %zd\n", offsetof(struct rtentry, rt_flags),
                sizeof(rt.rt_flags));
        printf("rt_pad2 %ld %zd\n", offsetof(struct rtentry, rt_pad2),
                sizeof(rt.rt_pad2));
        printf("rt_pad3 %ld %zd\n", offsetof(struct rtentry, rt_pad3),
                sizeof(rt.rt_pad3));
        printf("rt_pad4 %ld %zd\n", offsetof(struct rtentry, rt_pad4),
                sizeof(rt.rt_pad4));
        printf("rt_metric %ld %zd\n", offsetof(struct rtentry, rt_metric),
                sizeof(rt.rt_metric));
        printf("rt_dev %ld %zd\n", offsetof(struct rtentry, rt_dev),
                sizeof(rt.rt_dev));
        printf("rt_mtu %ld %zd\n", offsetof(struct rtentry, rt_mtu),
                sizeof(rt.rt_mtu));
        printf("rt_window %ld %zd\n", offsetof(struct rtentry, rt_window),
                sizeof(rt.rt_window));
        printf("rt_irtt %ld %zd\n", offsetof(struct rtentry, rt_irtt),
                sizeof(rt.rt_irtt));
}

And result is :

i386

rt_pad1 0 4
rt_dst 4 16
rt_gateway 20 16
rt_genmask 36 16
rt_flags 52 2
rt_pad2 54 2
rt_pad3 56 4
rt_pad4 62 2
rt_metric 64 2
rt_dev 68 4
rt_mtu 72 4
rt_window 76 4
rt_irtt 80 2

m68k

rt_pad1 0 4
rt_dst 4 16
rt_gateway 20 16
rt_genmask 36 16
rt_flags 52 2
rt_pad2 54 2
rt_pad3 56 4
rt_pad4 62 2
rt_metric 64 2
rt_dev 66 4
rt_mtu 70 4
rt_window 74 4
rt_irtt 78 2

This affects the "route" command :

WITHOUT this patch:

$ sudo route add -net default gw 10.0.3.1 window 1024 irtt 2 eth0
$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.0.3.1        0.0.0.0         UG        0 67108866  32768 eth0
10.0.3.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0

WITH this patch:

$ sudo route add -net default gw 10.0.3.1 window 1024 irtt 2 eth0
$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.0.3.1        0.0.0.0         UG        0 1024       2 eth0
10.0.3.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0

Signed-off-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
Reviewed-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Message-Id: &lt;20180510205949.26455-1-laurent@vivier.eu&gt;
</content>
</entry>
<entry>
<title>linux-user: remove useless padding in flock64 structure</title>
<updated>2018-05-03T16:40:19+00:00</updated>
<author>
<name>Laurent Vivier</name>
</author>
<published>2018-05-02T21:57:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=7f254c5cb80bc478794a4c3d7fe5d503b033be13'/>
<id>urn:sha1:7f254c5cb80bc478794a4c3d7fe5d503b033be13</id>
<content type='text'>
Since commit 8efb2ed5ec ("linux-user: Correct signedness of
target_flock l_start and l_len fields"), flock64 structure uses
abi_llong for l_start and l_len in place of "unsigned long long"
this should force them to be aligned accordingly to the target
rules. So we can remove the padding field and the QEMU_PACKED
attribute.

I have compared the result of the following program before and
after the change:

    cat -&gt; flock64_dump  &lt;&lt;EOF
    p/d sizeof(struct target_flock64)
    p/d &amp;((struct target_flock64 *)0)-&gt;l_type
    p/d &amp;((struct target_flock64 *)0)-&gt;l_whence
    p/d &amp;((struct target_flock64 *)0)-&gt;l_start
    p/d &amp;((struct target_flock64 *)0)-&gt;l_len
    p/d &amp;((struct target_flock64 *)0)-&gt;l_pid
    quit
    EOF

    for file in build/all/*-linux-user/qemu-* ; do
    echo $file
    gdb -batch -nx -x flock64_dump $file 2&gt; /dev/null
    done

The sizeof() changes because we remove the QEMU_PACKED.
The new size is 32 (except for i386 and m68k) and this is
the real size of "struct flock64" on the target architecture.

The following architectures differ:
aarch64_be, aarch64, alpha, armeb, arm, cris, hppa, nios2, or1k,
riscv32, riscv64, s390x.

For a subset of these architectures, I have checked with the following
program the new structure is the correct one:

  #include &lt;stdio.h&gt;
  #define __USE_LARGEFILE64
  #include &lt;fcntl.h&gt;

  int main(void)
  {
	  printf("struct flock64 %d\n", sizeof(struct flock64));
	  printf("l_type %d\n", &amp;((struct flock64 *)0)-&gt;l_type);
	  printf("l_whence %d\n", &amp;((struct flock64 *)0)-&gt;l_whence);
	  printf("l_start %d\n", &amp;((struct flock64 *)0)-&gt;l_start);
	  printf("l_len %d\n", &amp;((struct flock64 *)0)-&gt;l_len);
	  printf("l_pid %d\n", &amp;((struct flock64 *)0)-&gt;l_pid);
  }

[I have checked aarch64, alpha, hppa, s390x]

For ARM, the target_flock64 becomes the EABI definition, so we need to
define the OABI one in place of the EABI one and use it when it is
needed.

I have also fixed the alignment value for sh4 (to align llong on 4 bytes)
(see c2e3dee6e0 "linux-user: Define target alignment size")
[We should check alignment properties for cris, nios2 and or1k]

Signed-off-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20180502215730.28162-1-laurent@vivier.eu&gt;
</content>
</entry>
<entry>
<title>linux-user: Use correct alignment for long long on i386 guests</title>
<updated>2016-08-04T13:34:59+00:00</updated>
<author>
<name>Peter Maydell</name>
</author>
<published>2016-07-28T11:57:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=d9fe91d8689b078acfd27bc7c4a4e1efd5bbcf65'/>
<id>urn:sha1:d9fe91d8689b078acfd27bc7c4a4e1efd5bbcf65</id>
<content type='text'>
For i386, the ABI specifies that 'long long' (8 byte values)
need only be 4 aligned, but we were requiring them to be
8-aligned. This meant we were laying out the target_epoll_event
structure wrongly. Add a suitable ifdef to abitypes.h to
specify the i386-specific alignment requirement.

Reported-by: Icenowy Zheng &lt;icenowy@aosc.xyz&gt;
Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Reviewed-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
Signed-off-by: Riku Voipio &lt;riku.voipio@linaro.org&gt;
</content>
</entry>
<entry>
<title>Clean up header guards that don't match their file name</title>
<updated>2016-07-12T14:19:16+00:00</updated>
<author>
<name>Markus Armbruster</name>
</author>
<published>2016-06-29T08:12:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=121d07125bb6d7079c7ebafdd3efe8c3a01cc440'/>
<id>urn:sha1:121d07125bb6d7079c7ebafdd3efe8c3a01cc440</id>
<content type='text'>
Header guard symbols should match their file name to make guard
collisions less likely.  Offenders found with
scripts/clean-header-guards.pl -vn.

Cleaned up with scripts/clean-header-guards.pl, followed by some
renaming of new guard symbols picked by the script to better ones.

Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Reviewed-by: Richard Henderson &lt;rth@twiddle.net&gt;
</content>
</entry>
</feed>
