<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/semihosting, branch master</title>
<subtitle>Experimental fork of QEMU with video encoding patches</subtitle>
<id>https://git.openslx.org/bwlp/qemu.git/atom/semihosting?h=master</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/semihosting?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/'/>
<updated>2022-10-31T20:37:58+00:00</updated>
<entry>
<title>semihosting/arm-compat-semi: Avoid using hardcoded /tmp</title>
<updated>2022-10-31T20:37:58+00:00</updated>
<author>
<name>Bin Meng</name>
</author>
<published>2022-10-27T18:36:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=3878d0c7d7de9fe201513b8ee31e38e53361a97d'/>
<id>urn:sha1:3878d0c7d7de9fe201513b8ee31e38e53361a97d</id>
<content type='text'>
Use g_get_tmp_dir() to get the directory to use for temporary files.

Signed-off-by: Bin Meng &lt;bin.meng@windriver.com&gt;
Reviewed-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20221006151927.2079583-2-bmeng.cn@gmail.com&gt;
Message-Id: &lt;20221027183637.2772968-11-alex.bennee@linaro.org&gt;
</content>
</entry>
<entry>
<title>semihosting: update link to spec</title>
<updated>2022-10-06T10:53:41+00:00</updated>
<author>
<name>Alex Bennée</name>
</author>
<published>2022-09-29T11:42:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=424d5ecf520621e9b9bd802995558f83bd0e37af'/>
<id>urn:sha1:424d5ecf520621e9b9bd802995558f83bd0e37af</id>
<content type='text'>
The old link has moved but it seems the document is now hosted on
Arm's github along with a license update to CC-BY-SA-4.0.

Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20220929114231.583801-42-alex.bennee@linaro.org&gt;
</content>
</entry>
<entry>
<title>semihosting: Allow optional use of semihosting from userspace</title>
<updated>2022-09-13T16:18:21+00:00</updated>
<author>
<name>Peter Maydell</name>
</author>
<published>2022-08-22T14:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=5202861b20d77b1d638da5f10af0f51ebcfc61bf'/>
<id>urn:sha1:5202861b20d77b1d638da5f10af0f51ebcfc61bf</id>
<content type='text'>
Currently our semihosting implementations generally prohibit use of
semihosting calls in system emulation from the guest userspace.  This
is a very long standing behaviour justified originally "to provide
some semblance of security" (since code with access to the
semihosting ABI can do things like read and write arbitrary files on
the host system).  However, it is sometimes useful to be able to run
trusted guest code which performs semihosting calls from guest
userspace, notably for test code.  Add a command line suboption to
the existing semihosting-config option group so that you can
explicitly opt in to semihosting from guest userspace with
 -semihosting-config userspace=on

(There is no equivalent option for the user-mode emulator, because
there by definition all code runs in userspace and has access to
semihosting already.)

This commit adds the infrastructure for the command line option and
adds a bool 'is_user' parameter to the function
semihosting_userspace_enabled() that target code can use to check
whether it should be permitting the semihosting call for userspace.
It mechanically makes all the callsites pass 'false', so they
continue checking "is semihosting enabled in general".  Subsequent
commits will make each target that implements semihosting honour the
userspace=on option by passing the correct value and removing
whatever "don't do this for userspace" checking they were doing by
hand.

Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Acked-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Reviewed-by: Alistair Francis &lt;alistair.francis@wdc.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;f4bug@amsat.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20220822141230.3658237-2-peter.maydell@linaro.org&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>semihosting: Fix handling of buffer in TARGET_SYS_TMPNAM</title>
<updated>2022-07-29T08:48:01+00:00</updated>
<author>
<name>Peter Maydell</name>
</author>
<published>2022-07-25T14:05:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=9b1268f55ceb0d9390a051cad299b3021dfa9896'/>
<id>urn:sha1:9b1268f55ceb0d9390a051cad299b3021dfa9896</id>
<content type='text'>
The TARGET_SYS_TMPNAM implementation has two bugs spotted by
Coverity:
 * confusion about whether 'len' has the length of the string
   including or excluding the terminating NUL means we
   lock_user() len bytes of memory but memcpy() len + 1 bytes
 * In the error-exit cases we forget to free() the buffer
   that asprintf() returned to us

Resolves: Coverity CID 1490285, 1490289
Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20220719121110.225657-5-peter.maydell@linaro.org&gt;
Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Message-Id: &lt;20220725140520.515340-10-alex.bennee@linaro.org&gt;
</content>
</entry>
<entry>
<title>semihosting: Check for errors on SET_ARG()</title>
<updated>2022-07-29T08:48:01+00:00</updated>
<author>
<name>Peter Maydell</name>
</author>
<published>2022-07-25T14:05:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=fed49cdf6a721d76f9ac1cf76fd05b3fbd8b4892'/>
<id>urn:sha1:fed49cdf6a721d76f9ac1cf76fd05b3fbd8b4892</id>
<content type='text'>
The SET_ARG() macro returns an error indication; we check this in the
TARGET_SYS_GET_CMDLINE case but not when we use it in implementing
TARGET_SYS_ELAPSED.  Check for and handle the errors via the do_fault
codepath, and update the comment documenting the SET_ARG() and
GET_ARG() macros to note how they handle memory access errors.

Resolves: Coverity CID 1490287
Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20220719121110.225657-4-peter.maydell@linaro.org&gt;
Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Message-Id: &lt;20220725140520.515340-9-alex.bennee@linaro.org&gt;
</content>
</entry>
<entry>
<title>semihosting: Don't copy buffer after console_write()</title>
<updated>2022-07-29T08:48:01+00:00</updated>
<author>
<name>Peter Maydell</name>
</author>
<published>2022-07-25T14:05:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=45704e89047fc0a151c5909f006d8757140f23d6'/>
<id>urn:sha1:45704e89047fc0a151c5909f006d8757140f23d6</id>
<content type='text'>
The console_write() semihosting function outputs guest data from a
buffer; it doesn't update that buffer.  It therefore doesn't need to
pass a length value to unlock_user(), but can pass 0, meaning "do not
copy any data back to the guest memory".

Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20220719121110.225657-3-peter.maydell@linaro.org&gt;
Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Message-Id: &lt;20220725140520.515340-8-alex.bennee@linaro.org&gt;
</content>
</entry>
<entry>
<title>semihosting: Don't return negative values on qemu_semihosting_console_write() failure</title>
<updated>2022-07-29T08:48:01+00:00</updated>
<author>
<name>Peter Maydell</name>
</author>
<published>2022-07-25T14:05:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=aed04e6357fa10735c43574ea67a9551580d6e82'/>
<id>urn:sha1:aed04e6357fa10735c43574ea67a9551580d6e82</id>
<content type='text'>
The documentation comment for qemu_semihosting_console_write() says
 * Returns: number of bytes written -- this should only ever be short
 * on some sort of i/o error.

and the callsites rely on this.  However, the implementation code
path which sends console output to a chardev doesn't honour this,
and will return negative values on error.  Bring it into line with
the other implementation codepaths and the documentation, so that
it returns 0 on error.

Spotted by Coverity, because console_write() passes the return value
to unlock_user(), which doesn't accept a negative length.

Resolves: Coverity CID 1490288
Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20220719121110.225657-2-peter.maydell@linaro.org&gt;
Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;f4bug@amsat.org&gt;
Message-Id: &lt;20220725140520.515340-7-alex.bennee@linaro.org&gt;
</content>
</entry>
<entry>
<title>semihosting: Remove qemu_semihosting_log_out</title>
<updated>2022-07-12T20:32:12+00:00</updated>
<author>
<name>Richard Henderson</name>
</author>
<published>2022-06-28T11:16:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=938fcd741ad656b2c4aeb1654bfc4ff221c26bbf'/>
<id>urn:sha1:938fcd741ad656b2c4aeb1654bfc4ff221c26bbf</id>
<content type='text'>
The function is no longer used.

Reviewed-by: Philippe Mathieu-Daudé &lt;f4bug@amsat.org&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20220628111701.677216-7-richard.henderson@linaro.org&gt;
Signed-off-by: Philippe Mathieu-Daudé &lt;f4bug@amsat.org&gt;
</content>
</entry>
<entry>
<title>semihosting: Create semihost_sys_poll_one</title>
<updated>2022-06-27T23:11:37+00:00</updated>
<author>
<name>Richard Henderson</name>
</author>
<published>2022-05-02T18:15:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=1b9177f7495086f1595d7c989c810013f1c9eb5a'/>
<id>urn:sha1:1b9177f7495086f1595d7c989c810013f1c9eb5a</id>
<content type='text'>
This will be used for implementing the xtensa select_one
system call.  Choose "poll" over "select" so that we can
reuse Glib's g_poll constants and to avoid struct timeval.

Reviewed-by: Luc Michel &lt;lmichel@kalray.eu&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>semihosting: Remove qemu_semihosting_console_outs</title>
<updated>2022-06-27T23:11:20+00:00</updated>
<author>
<name>Richard Henderson</name>
</author>
<published>2022-05-02T01:04:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=2d010c2719da360d44a5c44d279d49eca21c5de8'/>
<id>urn:sha1:2d010c2719da360d44a5c44d279d49eca21c5de8</id>
<content type='text'>
This function has been replaced by *_write.

Reviewed-by: Luc Michel &lt;lmichel@kalray.eu&gt;
Reviewed-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
</feed>
