Kevin Wolf [Mon, 24 Feb 2020 14:29:55 +0000 (15:29 +0100)]
qapi: Flatten object-add
Mapping object-add to the command line as is doesn't result in nice
syntax because of the nesting introduced with 'props'. This becomes
nicer and more consistent with device_add and netdev_add when we accept
properties for the object on the top level instead.
'props' is still accepted after this patch, but marked as deprecated.
Kevin Wolf [Mon, 24 Feb 2020 14:29:54 +0000 (15:29 +0100)]
qemu-storage-daemon: Add --blockdev option
This adds a --blockdev option to the storage daemon that works the same
as the -blockdev option of the system emulator.
In order to be able to link with blockdev.o, we also need to change
stream.o from common-obj to block-obj, which is where all other block
jobs already are.
In contrast to the system emulator, qemu-storage-daemon options will be
processed in the order they are given. The user needs to take care to
refer to other objects only after defining them.
Kevin Wolf [Mon, 24 Feb 2020 14:29:53 +0000 (15:29 +0100)]
block: Move sysemu QMP commands to QAPI block module
QMP commands that are related to the system emulator and don't make
sense in the context of tools such as qemu-storage-daemon should live in
qapi/block.json rather than qapi/block-core.json. Move them there.
The associated data types are actually also used in code shared with the
tools, so they stay in block-core.json.
Kevin Wolf [Mon, 24 Feb 2020 14:29:52 +0000 (15:29 +0100)]
block: Move common QMP commands to block-core QAPI module
block-core is for everything that isn't related to the system emulator.
Internal snapshots, the NBD server and quorum events make sense in the
tools, too, so move them to block-core.
Kevin Wolf [Mon, 24 Feb 2020 14:29:51 +0000 (15:29 +0100)]
block: Move system emulator QMP commands to block/qapi-sysemu.c
These commands make only sense for system emulators and their
implementations call functions that don't exist in tools (e.g. to
resolve qdev IDs). Move them out so that blockdev.c can be linked to
qemu-storage-daemon.
Kevin Wolf [Mon, 24 Feb 2020 14:29:50 +0000 (15:29 +0100)]
stubs: Add arch_type
blockdev.c uses the arch_type constant, so before we can use the file in
tools (i.e. outside of the system emulator), we need to add a stub for
it. A new QEMU_ARCH_NONE is introduced for this case.
Kevin Wolf [Mon, 24 Feb 2020 14:29:49 +0000 (15:29 +0100)]
qemu-storage-daemon: Add barebone tool
This adds a new binary qemu-storage-daemon that doesn't yet do more than
some typical initialisation for tools and parsing the basic command
options --version, --help and --trace.
Even though this doesn't add any options yet that create things (like
--object or --blockdev), already document that we're planning to process
them in the order they are given on the command line rather than trying
(and failing, like vl.c) to resolve dependencies between options
automatically.
Peter Krempa [Fri, 28 Feb 2020 12:44:47 +0000 (13:44 +0100)]
block/qcow2: Move bitmap reopen into bdrv_reopen_commit_post
The bitmap code requires writing the 'file' child when the qcow2 driver
is reopened in read-write mode.
If the 'file' child is being reopened due to a permissions change, the
modification is commited yet when qcow2_reopen_commit is called. This
means that any attempt to write the 'file' child will end with EBADFD
as the original fd was already closed.
Moving bitmap reopening to the new callback which is called after
permission modifications are commited fixes this as the file descriptor
will be replaced with the correct one.
The above problem manifests itself when reopening 'qcow2' format layer
which uses a 'file-posix' file child which was opened with the
'auto-read-only' property set.
Max Reitz [Tue, 25 Feb 2020 15:56:18 +0000 (16:56 +0100)]
block: Fix leak in bdrv_create_file_fallback()
@options is leaked by the first two return statements in this function.
Note that blk_new_open() takes the reference to @options even on
failure, so all we need to do to fix the leak is to move the QDict
allocation down to where we actually need it.
Reported-by: Coverity (CID 1419884) Fixes: fd17146cd93d1704cd96d7c2757b325fc7aac6fd
("block: Generic file creation fallback") Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200225155618[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
Max Reitz [Tue, 25 Feb 2020 14:31:28 +0000 (15:31 +0100)]
qcow2: Fix alloc_cluster_abort() for pre-existing clusters
handle_alloc() reuses preallocated zero clusters. If anything goes
wrong during the data write, we do not change their L2 entry, so we
must not let qcow2_alloc_cluster_abort() free them.
* remotes/pmaydell/tags/pull-docs-20200306: (33 commits)
*.hx: Remove all the STEXI/ETEXI blocks
docs: Remove old texinfo sources
docs: Stop building qemu-doc
ui/cocoa.m: Update documentation file and pathname
docs: Generate qemu.1 manpage with Sphinx
docs: Split out sections for the manpage into .rst.inc files
qemu-options.hx: Fix up the autogenerated rST
qemu-options.hx: Add rST documentation fragments
scripts/hxtool-conv: Archive script used in qemu-options.hx conversion
docs: Roll -prom-env and -g target-specific info into qemu-options.hx
docs: Roll semihosting option information into qemu-options.hx
doc/scripts/hxtool.py: Strip trailing ':' from DEFHEADING/ARCHHEADING
hmp-commands-info.hx: Add rST documentation fragments
hmp-commands.hx: Add rST documentation fragments
docs/system: convert Texinfo documentation to rST
docs/system: convert the documentation of deprecated features to rST.
docs/system: convert managed startup to rST.
docs/system: Convert security.texi to rST format
docs/system: Convert qemu-cpu-models.texi to rST
docs: Create defs.rst.inc as a place to define substitutions
...
Peter Maydell [Fri, 6 Mar 2020 10:25:47 +0000 (10:25 +0000)]
*.hx: Remove all the STEXI/ETEXI blocks
We no longer generate texinfo from the hxtool input files,
so delete all the STEXI/ETEXI blocks.
This commit was created using the following Perl one-liner:
perl -i -n -e '$suppress = 1,next if /^STEXI/;$suppress=0,next if /^ETEXI/; print if !$suppress;' *.hx
Peter Maydell [Fri, 28 Feb 2020 15:36:18 +0000 (15:36 +0000)]
docs: Remove old texinfo sources
We can now delete the old .texi files, which we have been keeping in
the tree as a parallel set of documentation to the new rST sources.
The only remaining use of Texinfo is the autogenerated manuals
and HTML documents created from the QAPI JSON doc comments.
Peter Maydell [Fri, 28 Feb 2020 15:36:16 +0000 (15:36 +0000)]
ui/cocoa.m: Update documentation file and pathname
We want to stop generating the old qemu-doc.html; first we
must update places that refer to it so they instead go to
our top level index.html documentation landing page.
The Cocoa UI has a menu option to bring up the documentation;
make it point to the new top level index.html instead.
Peter Maydell [Fri, 28 Feb 2020 15:36:15 +0000 (15:36 +0000)]
docs: Generate qemu.1 manpage with Sphinx
Generate the qemu.1 manpage using Sphinx; we do this with a new
top-level rst source file which is just the skeleton of the manpage
and which includes .rst.inc fragments where it needs to incorporate
sections from the larger HTML manuals.
Peter Maydell [Fri, 28 Feb 2020 15:36:14 +0000 (15:36 +0000)]
docs: Split out sections for the manpage into .rst.inc files
Sphinx doesn't have very good facilities for marking chunks
of documentation as "put this in the manpage only". So instead
we move the parts we want to put into both the HTML manuals
and the manpage into their own .rst.inc files, which we can
include from both the main manual rst files and a new toplevel
rst file that will be the skeleton of the qemu.1 manpage.
In this commit, just split out the parts of the documentation
that go in the manpage.
Peter Maydell [Fri, 28 Feb 2020 15:36:13 +0000 (15:36 +0000)]
qemu-options.hx: Fix up the autogenerated rST
This commit contains hand-written fixes for some issues with the
autogenerated rST fragments in qemu-options.hx:
* Sphinx complains about the UTF-8 art table in the documentation of
the -drive option. Replace it with a proper rST format table.
* rST does not like definition list entries with no actual
definition, but it is possible to work around this by putting a
single escaped literal space as the definition line.
* The "-g widthxheight" option documentation suffers particularly
badly from losing the distinction between italics and fixed-width
as a result of the auto conversion, so put it back in again.
* The script missed some places that use the |qemu_system| etc
macros and need to be marked up as parsed-literal blocks.
* The script autogenerated an expanded out version of the
contents of qemu-option-trace.texi; replace it with an
qemu-option-trace.rst.inc include.
This is sufficient that we can enable inclusion of the
option documentation from invocation.rst.
Peter Maydell [Fri, 6 Mar 2020 10:07:14 +0000 (10:07 +0000)]
qemu-options.hx: Add rST documentation fragments
Add the rST versions of the documentation fragments to qemu-options.hx.
This is entirely autogenerated using scripts/hxtool-conv.pl.
The result is not quite valid rST in all places; the following
commit will have the manual adjustments needed.
Peter Maydell [Fri, 28 Feb 2020 15:36:11 +0000 (15:36 +0000)]
scripts/hxtool-conv: Archive script used in qemu-options.hx conversion
This commit archives the perl script used to do conversion of the
STEXI/ETEXI blocks in qemu-options.hx. (The other .hx files were
manually converted, but qemu-options.hx is complicated enough that
I felt I needed some scripting.)
Peter Maydell [Fri, 28 Feb 2020 15:36:10 +0000 (15:36 +0000)]
docs: Roll -prom-env and -g target-specific info into qemu-options.hx
The SPARC and PPC targets currently have a fragment of target-specific
information about the -g and -prom options which would be better placed
as part of the general documentation of those options in qemu-options.hx.
Move the relevant information to those locations.
SPARC also has a bit of text about the -M option which is out of
date and provides no useful information over the generic documentation
of that option, so just delete it.
The motivation here is again to avoid having to awkwardly include
this text into the rST version of the qemu.1 manpage.
Peter Maydell [Fri, 28 Feb 2020 15:36:09 +0000 (15:36 +0000)]
docs: Roll semihosting option information into qemu-options.hx
Currently the per-target documentation for those targets that
implement semihosting includes a bit of text that goes into both the
manual and the manpage about options specific to the target. This
text is redundant with the earlier generic option description of the
semihosting option produced from qemu-options.hx. To avoid having
to create a lot of stub include files to include into the rST
generated qemu.1 manpage, roll target-specific bits of information
into the qemu-options.hx text, so the user doesn't have to look
in two places for this information.
Peter Maydell [Fri, 28 Feb 2020 15:36:08 +0000 (15:36 +0000)]
doc/scripts/hxtool.py: Strip trailing ':' from DEFHEADING/ARCHHEADING
In hxtool files, section headings defined with the DEFHEADING
and ARCHHEADING macros have a trailing ':'
DEFHEADING(Standard options:)
This is for the benefit of the --help output. For consistency
with the rest of the rST documentation, strip any trailing ':'
when we construct headings with the Sphinx hxtool extension.
This makes the table of contents look neater.
This only affects generation of documentation from qemu-options.hx,
which we will start doing in a later commit.
Add the rST versions of the documentation fragments. Once we've
converted fully from Texinfo to rST we can remove the ETEXI
fragments; for the moment we need both.
Note that most of the SRST fragments are 2-space indented so that the
'info foo' documentation entries appear as a sublist under the 'info'
entry in the top level list.
Again, all we need to do to put the documentation in the Sphinx manual
is a one-line hxtool-doc invocation.
Peter Maydell [Fri, 28 Feb 2020 15:36:06 +0000 (15:36 +0000)]
hmp-commands.hx: Add rST documentation fragments
Add the rST versions of the documentation fragments. Once we've
converted fully from Texinfo to rST we can remove the ETEXI
fragments; for the moment we need both.
Since the only consumer of the hmp-commands hxtool documentation
is the HTML manual, all we need to do for the monitor command
documentation to appear in the Sphinx system manual is add the
one line that invokes the hxtool extension on the .hx file.
In addition, the following changes were made manually:
- target-i386.rst and target-mips.rst: replace CPU model documentation with
an include directive
- monitor.rst: replace the command section with a comment
- images.rst: add toctree
- target-arm.rst: Replace use of :math: (which Sphinx complains
about) with :sup:, and hide it behind |I2C| and |I2C| substitutions.
Content that is not @included remains exclusive to qemu-doc.texi.
Signed-off-by: Paolo Bonzini <[email protected]> Reviewed-by: Peter Maydell <[email protected]> Reviewed-by: Alex Bennée <[email protected]> Tested-by: Alex Bennée <[email protected]> Signed-off-by: Peter Maydell <[email protected]>
Message-id: 20200228153619[email protected]
Message-id: 20200226113034[email protected]
[PMM: Fixed target-arm.rst use of :math:; remove out of date
note about images.rst from commit message; fixed expansion
of |qemu_system_x86|; use parsed-literal in invocation.rst
when we want to use |qemu_system_x86|; fix incorrect subsection
level for "OS requirements" in target-i386.rst; fix incorrect
syntax for making links to other sections of the manual] Reviewed-by: Peter Maydell <[email protected]> Signed-off-by: Peter Maydell <[email protected]>
Peter Maydell [Fri, 28 Feb 2020 15:36:04 +0000 (15:36 +0000)]
docs/system: convert the documentation of deprecated features to rST.
We put the whole of this document into the system manual, though
technically a few parts of it apply to qemu-img or qemu-nbd which are
otherwise documented in tools/.
We only make formatting fixes, except for one use of 'appendix' which
we change to 'section' because this isn't an appendix in the Sphinx
manual.
Peter Maydell [Fri, 28 Feb 2020 15:36:02 +0000 (15:36 +0000)]
docs/system: Convert security.texi to rST format
security.texi is included from qemu-doc.texi but is not used
in the qemu.1 manpage. So we can do a straightforward conversion
of the contents, which go into the system manual.
This doc was originally written by Daniel P. Berrangé
<[email protected]>, introduced via commit[1]: 2544e9e4aa (docs: add
guidance on configuring CPU models for x86, 2018-06-27).
In this patch:
- 1-1 conversion of Texinfo to rST, besides a couple of minor
tweaks that are too trivial to mention. (Thanks to Stephen
Finucane on IRC for the suggestion to use rST "definition lists"
instead of bullets in some places.)
Further modifications will be done via a separate patch.
- rST and related infra changes: manual page generation, Makefile
fixes, clean up references to qemu-cpu-models.texi, update year in
the copyright notice, etc.
As part of the conversion, we use a more generic 'author' attribution
for the manpage than we previously had, as agreed with the original
author Dan Berrange.
Signed-off-by: Kashyap Chamarthy <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> Reviewed-by: Alex Bennée <[email protected]> Tested-by: Alex Bennée <[email protected]> Signed-off-by: Peter Maydell <[email protected]>
Message-id: 20200228153619[email protected]
Message-id: 20200226113034[email protected]
[Move macros to defs.rst.inc, split in x86 and MIPS parts,
make qemu-cpu-models.rst a standalone document. - Paolo] Signed-off-by: Paolo Bonzini <[email protected]>
[PMM: Move defs.rst.inc setup to its own commit;
fix minor issues with MAINTAINERS file updates;
drop copyright date change; keep capitalization of
"QEMU Project developers" consistent with other uses;
minor Makefile fixups] Signed-off-by: Peter Maydell <[email protected]>
Peter Maydell [Fri, 28 Feb 2020 15:36:00 +0000 (15:36 +0000)]
docs: Create defs.rst.inc as a place to define substitutions
Rather than accumulating generally useful rST substitution
definitions in individual rST files, create a defs.rst.inc where we
can define these. To start with it has the |qemu_system| definition
from qemu-block-drivers.rst.
Add a comment noting a pitfall where putting literal markup in the
definition of |qemu_system| makes it misrender manpage output; this
means the point-of-use must handle the literal markup (which is
almost always done by having it inside a parsed-literal block).
Paolo Bonzini [Fri, 28 Feb 2020 15:35:59 +0000 (15:35 +0000)]
docs/system: put qemu-block-drivers body in an included file
This removes the "only" directives, and lets us use the conventional
"DESCRIPTION" section in the manpage.
This temporarily drops the qemu-block-drivers documentation
from the system manual, but it will be put back (in the
right place in the toctree) in a later commit.
Paolo Bonzini [Fri, 28 Feb 2020 15:35:56 +0000 (15:35 +0000)]
qemu-doc: move qemu-tech.texi into main section
The only remaining content in qemu-tech.texi is a few paragraphs
about managed start up options. Move them in the main section
about full system emulation.
Peter Maydell [Fri, 28 Feb 2020 15:35:55 +0000 (15:35 +0000)]
qemu-doc: Remove the "CPU emulation" part of the "Implementation notes"
The "CPU emulation" part of the "Implementation notes" in
qemu-tech.texi looks like it is documenting what features of various
CPUs we do or don't emulate. However:
* it covers only six of our 21 guest architectures
* the last time anybody updated it for actual content was in
2011/2012 for Xtensa; the content for the other five
architectures is even older, being from 2008 or before!
What we have is out of date, misleading and incomplete.
Just delete this part of the document rather than trying to
convert it to rST.
(It would be nice eventually to have documentation of the
scope and limitations of our emulation; but we will want to
separate out the generic "system emulation" information from
the parts that are specific to linux-user anyway, as they will
be in different manuals.)
Paolo Bonzini [Fri, 28 Feb 2020 15:35:52 +0000 (15:35 +0000)]
qemu-doc: extract common system emulator documentation from the PC section
Move the section on PC peripherals together with other targets.
While some x86-specific information remains in the main system
emulation chapter, it can be tackled more easily a section at a
time.
Paolo Bonzini [Fri, 28 Feb 2020 15:35:51 +0000 (15:35 +0000)]
qemu-doc: split qemu-doc.texi in multiple files
In order to facilitate the reorganization of qemu-doc.texi content,
as well as the conversion to rST/Sphinx, split it in multiple .texi
files that are included from docs/system.
The "other devices" section is renamed to ivshmem and placed last.
This enables splitting the huge qemu-doc.texi file and keeping parallel
Texinfo and rST versions of the documentation. texi2pod is not going to
live much longer and hardly anyone cares about its upstream status,
so the temporary fork should be acceptable.
Paolo Bonzini [Fri, 28 Feb 2020 15:35:47 +0000 (15:35 +0000)]
qemu-doc: convert user-mode emulation to a separate Sphinx manual
The final addition to the set of QEMU manuals is the user-mode emulation
manual, which right now is included in qemu-doc.texi. Extract it and
convert it to rST, so that qemu-doc.texi covers only full system emulation.
Palmer Dabbelt [Thu, 5 Mar 2020 16:46:20 +0000 (08:46 -0800)]
RISC-V: Add a missing "," in riscv_excp_names
This would almost certainly cause the exception names to be reported
incorrectly. Coverity found the issue (CID 1420223). As per Peter's
suggestion, I've also added a comma at the end of the list to avoid the issue
reappearing in the future.
Fixes: ab67a1d07a ("target/riscv: Add support for the new execption numbers") Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
Peter Maydell [Thu, 5 Mar 2020 19:39:47 +0000 (19:39 +0000)]
Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-03-04-2' into staging
Merge tpm 2020/03/04 v2
# gpg: Signature made Thu 05 Mar 2020 17:21:05 GMT
# gpg: using RSA key B818B9CADF9089C2D5CEC66B75AD65802A0B4211
# gpg: Good signature from "Stefan Berger <[email protected]>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: B818 B9CA DF90 89C2 D5CE C66B 75AD 6580 2A0B 4211
* remotes/stefanberger/tags/pull-tpm-2020-03-04-2:
test: tpm-tis: Add Sysbus TPM-TIS device test
test: tpm-tis: Get prepared to share tests between ISA and sysbus devices
test: tpm: pass optional machine options to swtpm test functions
docs/specs/tpm: Document TPM_TIS sysbus device for ARM
hw/arm/virt: vTPM support
tpm: Add the SysBus TPM TIS device
tpm: Separate TPM_TIS and TPM_TIS_ISA configs
tpm: Separate tpm_tis common functions from isa code
tpm: Use TPMState as a common struct
tpm: rename TPM_TIS into TPM_TIS_ISA
Eric Auger [Thu, 5 Mar 2020 16:51:49 +0000 (17:51 +0100)]
test: tpm-tis: Add Sysbus TPM-TIS device test
The tests themselves are the same as the ISA device ones.
Only the main() changes as the "tpm-tis-device" device gets
instantiated. Also the base address of the device is not
0xFED40000 anymore but matches the base address of the
ARM virt platform bus.
Eric Auger [Thu, 5 Mar 2020 16:51:48 +0000 (17:51 +0100)]
test: tpm-tis: Get prepared to share tests between ISA and sysbus devices
ISA and sysbus TPM-TIS devices will share their tests. Only
the main() will change (instantiation option is different).
Also the base address of the TPM-TIS device is going to be
different. on x86 it is located at 0xFED40000 while on ARM
it can be located at any location, discovered through the
device tree description.
So we put shared test functions in a new object module.
Each test needs to set tpm_tis_base_addr global variable.
Also take benefit of this move to fix "block comments using
a leading */ on a separate line" checkpatch warnings.
Eric Auger [Thu, 5 Mar 2020 16:51:47 +0000 (17:51 +0100)]
test: tpm: pass optional machine options to swtpm test functions
We plan to use swtpm test functions on ARM for testing the
sysbus TPM-TIS device. However on ARM there is no default machine
type. So we need to explictly pass some machine options on startup.
Let's allow this by adding a new parameter to both swtpm test
functions and update all call sites.
Eric Auger [Thu, 5 Mar 2020 16:51:41 +0000 (17:51 +0100)]
tpm: Use TPMState as a common struct
As we plan to introduce a SysBus TPM TIS device, let's
make the TPMState a common struct usable by both the
ISADevice and the SysBusDevice. TPMStateISA embeds the
struct and inherits from the ISADevice.
The prototype of functions bound to be used by both
the ISA and SysBus devices is changed to take TPMState
handle.
A bunch of structs also are renamed to be specialized
for the ISA device. Besides those transformations, no
functional change is expected.
Peter Maydell [Thu, 5 Mar 2020 16:47:37 +0000 (16:47 +0000)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200305' into staging
* versal: Implement ADMA
* Implement (trivially) ARMv8.2-TTCNP
* hw/arm/smmu-common: a fix to smmu_find_smmu_pcibus
* Remove unnecessary endianness-handling on some boards
* Avoid minor memory leaks from timer_new in some devices
* Honour more of the HCR_EL2 trap bits
* Complain rather than ignoring bad command line options for cubieboard
* Honour TBI for DC ZVA and exception return
* remotes/pmaydell/tags/pull-target-arm-20200305: (37 commits)
target/arm: Clean address for DC ZVA
target/arm: Use DEF_HELPER_FLAGS for helper_dc_zva
target/arm: Move helper_dc_zva to helper-a64.c
target/arm: Apply TBI to ESR_ELx in helper_exception_return
target/arm: Introduce core_to_aa64_mmu_idx
target/arm: Optimize cpu_mmu_index
target/arm: Replicate TBI/TBID bits for single range regimes
hw/arm/cubieboard: report error when using unsupported -bios argument
hw/arm/cubieboard: restrict allowed RAM size to 512MiB and 1GiB
hw/arm/cubieboard: restrict allowed CPU type to ARM Cortex-A8
hw/arm/cubieboard: use ARM Cortex-A8 as the default CPU in machine definition
tests/tcg/aarch64: Add newline in pauth-1 printf
target/arm: Honor the HCR_EL2.TTLB bit
target/arm: Honor the HCR_EL2.TPU bit
target/arm: Honor the HCR_EL2.TPCP bit
target/arm: Honor the HCR_EL2.TACR bit
target/arm: Honor the HCR_EL2.TSW bit
target/arm: Honor the HCR_EL2.{TVM,TRVM} bits
target/arm: Improve masking in arm_hcr_el2_eff
target/arm: Remove EL2 and EL3 setup from user-only
...
We now cache the core mmu_idx in env->hflags. Rather than recompute
from scratch, extract the field. All of the uses of cpu_mmu_index
within target/arm are within helpers, and env->hflags is always stable
within a translation block from whence helpers are called.
Niek Linnenbank [Thu, 5 Mar 2020 16:09:19 +0000 (16:09 +0000)]
hw/arm/cubieboard: restrict allowed CPU type to ARM Cortex-A8
The Cubieboard has an ARM Cortex-A8. Instead of simply ignoring a
bogus -cpu option provided by the user, give them an error message so
they know their command line is wrong.
Niek Linnenbank [Thu, 5 Mar 2020 16:09:19 +0000 (16:09 +0000)]
hw/arm/cubieboard: use ARM Cortex-A8 as the default CPU in machine definition
The Cubieboard is a singleboard computer with an Allwinner A10 System-on-Chip [1].
As documented in the Allwinner A10 User Manual V1.5 [2], the SoC has an ARM
Cortex-A8 processor. Currently the Cubieboard machine definition specifies the
ARM Cortex-A9 in its description and as the default CPU.
This patch corrects the Cubieboard machine definition to use the ARM Cortex-A8.
The only user-visible effect is that our textual description of the
machine was wrong, because hw/arm/allwinner-a10.c always creates a
Cortex-A8 CPU regardless of the default value in the MachineClass struct.
This bit traps EL1 access to cache maintenance insns that operate
to the point of unification. There are no longer any references to
plain aa64_cacheop_access, so remove it.
target/arm: Disable has_el2 and has_el3 for user-only
In arm_cpu_reset, we configure many system registers so that user-only
behaves as it should with a minimum of ifdefs. However, we do not set
all of the system registers as required for a cpu with EL2 and EL3.
Disabling EL2 and EL3 mean that we will not look at those registers,
which means that we don't have to worry about configuring them.
Don't merely start with v8.0, handle v7VE as well. Ensure that writes
from aarch32 mode do not change bits in the other half of the register.
Protect reads of aa64 id registers with ARM_FEATURE_AARCH64.
The smmu_find_smmu_pcibus() function was introduced (in commit cac994ef43b) in a code format that could return an incorrect
pointer, which was then fixed by the previous commit.
We could have avoided this by writing the if() statement
differently. Do it now, in case this function is re-used.
The code is easier to review (harder to miss bugs).
Peter Maydell [Thu, 5 Mar 2020 16:09:14 +0000 (16:09 +0000)]
target/arm: Implement (trivially) ARMv8.2-TTCNP
The ARMv8.2-TTCNP extension allows an implementation to optimize by
sharing TLB entries between multiple cores, provided that software
declares that it's ready to deal with this by setting a CnP bit in
the TTBRn_ELx. It is mandatory from ARMv8.2 onward.
For QEMU's TLB implementation, sharing TLB entries between different
cores would not really benefit us and would be a lot of work to
implement. So we implement this extension in the "trivial" manner:
we allow the guest to set and read back the CnP bit, but don't change
our behaviour (this is an architecturally valid implementation
choice).
The only code path which looks at the TTBRn_ELx values for the
long-descriptor format where the CnP bit is defined is already doing
enough masking to not get confused when the CnP bit at the bottom of
the register is set, so we can simply add a comment noting why we're
relying on that mask.
* remotes/armbru/tags/pull-qapi-2020-03-05:
qapi: Brush off some (py)lint
qapi: Use super() now we have Python 3
qapi: Drop conditionals for Python 2
qapi: Inheriting from object is pointless with Python 3, drop