Compare commits
	
		
			46 Commits
		
	
	
		
			qemu-9.0.5
			...
			v0.15.1-qe
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					36f5bc4fdb | ||
| 
						 | 
					82b2b32a32 | ||
| 
						 | 
					4a81ab81e4 | ||
| 
						 | 
					68e3508eaf | ||
| 
						 | 
					fb524042db | ||
| 
						 | 
					336398391a | ||
| 
						 | 
					672aefeb5e | ||
| 
						 | 
					6a10ccca80 | ||
| 
						 | 
					7095e71576 | ||
| 
						 | 
					91b31d6158 | ||
| 
						 | 
					b89f4a7d2a | ||
| 
						 | 
					fbdd7c8bd5 | ||
| 
						 | 
					e19a4e89ae | ||
| 
						 | 
					ff5acedd8f | ||
| 
						 | 
					2af86a2ff7 | ||
| 
						 | 
					e62ad8314a | ||
| 
						 | 
					76e4e1d237 | ||
| 
						 | 
					4fbe5233fd | ||
| 
						 | 
					4bea41dbaa | ||
| 
						 | 
					e2f775205a | ||
| 
						 | 
					51dd7a94c7 | ||
| 
						 | 
					9096de69ff | ||
| 
						 | 
					09afeef1ab | ||
| 
						 | 
					01825a8ddf | ||
| 
						 | 
					ae2dd33693 | ||
| 
						 | 
					a80f53aee3 | ||
| 
						 | 
					88ca9f047b | ||
| 
						 | 
					898517b0bc | ||
| 
						 | 
					9dc9f2b820 | ||
| 
						 | 
					ef942b795a | ||
| 
						 | 
					868aa386b8 | ||
| 
						 | 
					7e10be8c74 | ||
| 
						 | 
					9843621e3b | ||
| 
						 | 
					ab640dbfc0 | ||
| 
						 | 
					eaa8b2778c | ||
| 
						 | 
					7ec7f28019 | ||
| 
						 | 
					31b1308046 | ||
| 
						 | 
					4ec648dd6e | ||
| 
						 | 
					e961d129e1 | ||
| 
						 | 
					8959459386 | ||
| 
						 | 
					e2b40e003a | ||
| 
						 | 
					1a39b0fcff | ||
| 
						 | 
					4a97e18b87 | ||
| 
						 | 
					f1ee0a0ebd | ||
| 
						 | 
					3583bc031e | ||
| 
						 | 
					2798b5e174 | 
@@ -1,2 +0,0 @@
 | 
			
		||||
((c-mode . ((c-file-style . "stroustrup")
 | 
			
		||||
	    (indent-tabs-mode . nil))))
 | 
			
		||||
@@ -1,49 +0,0 @@
 | 
			
		||||
# EditorConfig is a file format and collection of text editor plugins
 | 
			
		||||
# for maintaining consistent coding styles between different editors
 | 
			
		||||
# and IDEs. Most popular editors support this either natively or via
 | 
			
		||||
# plugin.
 | 
			
		||||
#
 | 
			
		||||
# Check https://editorconfig.org for details.
 | 
			
		||||
#
 | 
			
		||||
# Emacs: you need https://github.com/10sr/editorconfig-custom-majormode-el
 | 
			
		||||
# to automatically enable the appropriate major-mode for your files
 | 
			
		||||
# that aren't already caught by your existing config.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
root = true
 | 
			
		||||
 | 
			
		||||
[*]
 | 
			
		||||
end_of_line = lf
 | 
			
		||||
insert_final_newline = true
 | 
			
		||||
charset = utf-8
 | 
			
		||||
 | 
			
		||||
[*.mak]
 | 
			
		||||
indent_style = tab
 | 
			
		||||
indent_size = 8
 | 
			
		||||
emacs_mode = makefile
 | 
			
		||||
 | 
			
		||||
[Makefile*]
 | 
			
		||||
indent_style = tab
 | 
			
		||||
indent_size = 8
 | 
			
		||||
emacs_mode = makefile
 | 
			
		||||
 | 
			
		||||
[*.{c,h,c.inc,h.inc}]
 | 
			
		||||
indent_style = space
 | 
			
		||||
indent_size = 4
 | 
			
		||||
emacs_mode = c
 | 
			
		||||
 | 
			
		||||
[*.sh]
 | 
			
		||||
indent_style = space
 | 
			
		||||
indent_size = 4
 | 
			
		||||
 | 
			
		||||
[*.{s,S}]
 | 
			
		||||
indent_style = tab
 | 
			
		||||
indent_size = 8
 | 
			
		||||
emacs_mode = asm
 | 
			
		||||
 | 
			
		||||
[*.{vert,frag}]
 | 
			
		||||
emacs_mode = glsl
 | 
			
		||||
 | 
			
		||||
[*.json]
 | 
			
		||||
indent_style = space
 | 
			
		||||
emacs_mode = python
 | 
			
		||||
							
								
								
									
										7
									
								
								.exrc
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								.exrc
									
									
									
									
									
								
							@@ -1,7 +0,0 @@
 | 
			
		||||
"VIM settings to match QEMU coding style.  They are activated by adding the
 | 
			
		||||
"following settings (without the " symbol) as last two lines in $HOME/.vimrc:
 | 
			
		||||
"set secure
 | 
			
		||||
"set exrc
 | 
			
		||||
set expandtab
 | 
			
		||||
set shiftwidth=4
 | 
			
		||||
set smarttab
 | 
			
		||||
							
								
								
									
										8
									
								
								.gdbinit
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								.gdbinit
									
									
									
									
									
								
							@@ -1,8 +0,0 @@
 | 
			
		||||
# GDB may have ./.gdbinit loading disabled by default.  In that case you can
 | 
			
		||||
# follow the instructions it prints.  They boil down to adding the following to
 | 
			
		||||
# your home directory's ~/.gdbinit file:
 | 
			
		||||
#
 | 
			
		||||
#   add-auto-load-safe-path /path/to/qemu/.gdbinit
 | 
			
		||||
 | 
			
		||||
# Load QEMU-specific sub-commands and settings
 | 
			
		||||
source scripts/qemu-gdb.py
 | 
			
		||||
@@ -1,21 +0,0 @@
 | 
			
		||||
#
 | 
			
		||||
# List of code-formatting clean ups the git blame can ignore
 | 
			
		||||
#
 | 
			
		||||
#   git blame --ignore-revs-file .git-blame-ignore-revs
 | 
			
		||||
#
 | 
			
		||||
# or
 | 
			
		||||
#
 | 
			
		||||
#   git config blame.ignoreRevsFile .git-blame-ignore-revs
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# gdbstub: clean-up indents
 | 
			
		||||
ad9e4585b3c7425759d3eea697afbca71d2c2082
 | 
			
		||||
 | 
			
		||||
# e1000e: fix code style
 | 
			
		||||
0eadd56bf53ab196a16d492d7dd31c62e1c24c32
 | 
			
		||||
 | 
			
		||||
# target/riscv: coding style fixes
 | 
			
		||||
8c7feddddd9218b407792120bcfda0347ed16205
 | 
			
		||||
 | 
			
		||||
# replace TABs with spaces
 | 
			
		||||
48805df9c22a0700fba4b3b548fafaa21726ca68
 | 
			
		||||
							
								
								
									
										4
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							@@ -1,4 +0,0 @@
 | 
			
		||||
*.c.inc         diff=c
 | 
			
		||||
*.h.inc         diff=c
 | 
			
		||||
*.m             diff=objc
 | 
			
		||||
*.py            diff=python
 | 
			
		||||
							
								
								
									
										30
									
								
								.github/workflows/lockdown.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										30
									
								
								.github/workflows/lockdown.yml
									
									
									
									
										vendored
									
									
								
							@@ -1,30 +0,0 @@
 | 
			
		||||
# Configuration for Repo Lockdown - https://github.com/dessant/repo-lockdown
 | 
			
		||||
 | 
			
		||||
name: 'Repo Lockdown'
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  pull_request_target:
 | 
			
		||||
    types: opened
 | 
			
		||||
 | 
			
		||||
permissions:
 | 
			
		||||
  pull-requests: write
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  action:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      - uses: dessant/repo-lockdown@v2
 | 
			
		||||
        with:
 | 
			
		||||
          pr-comment: |
 | 
			
		||||
            Thank you for your interest in the QEMU project.
 | 
			
		||||
 | 
			
		||||
            This repository is a read-only mirror of the project's repostories hosted
 | 
			
		||||
            on https://gitlab.com/qemu-project/qemu.git.
 | 
			
		||||
            The project does not process merge requests filed on GitHub.
 | 
			
		||||
 | 
			
		||||
            QEMU welcomes contributions of code (either fixing bugs or adding new
 | 
			
		||||
            functionality). However, we get a lot of patches, and so we have some
 | 
			
		||||
            guidelines about contributing on the project website:
 | 
			
		||||
            https://www.qemu.org/contribute/
 | 
			
		||||
          lock-pr: true
 | 
			
		||||
          close-pr: true
 | 
			
		||||
							
								
								
									
										84
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										84
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,22 +1,74 @@
 | 
			
		||||
/GNUmakefile
 | 
			
		||||
/build/
 | 
			
		||||
/.cache/
 | 
			
		||||
/.vscode/
 | 
			
		||||
config-devices.*
 | 
			
		||||
config-all-devices.*
 | 
			
		||||
config-host.*
 | 
			
		||||
config-target.*
 | 
			
		||||
trace.h
 | 
			
		||||
trace.c
 | 
			
		||||
trace-dtrace.h
 | 
			
		||||
trace-dtrace.dtrace
 | 
			
		||||
*-timestamp
 | 
			
		||||
*-softmmu
 | 
			
		||||
*-darwin-user
 | 
			
		||||
*-linux-user
 | 
			
		||||
*-bsd-user
 | 
			
		||||
libdis*
 | 
			
		||||
libhw32
 | 
			
		||||
libhw64
 | 
			
		||||
libuser
 | 
			
		||||
qapi-generated
 | 
			
		||||
qemu-doc.html
 | 
			
		||||
qemu-tech.html
 | 
			
		||||
qemu-doc.info
 | 
			
		||||
qemu-tech.info
 | 
			
		||||
qemu.1
 | 
			
		||||
qemu.pod
 | 
			
		||||
qemu-img.1
 | 
			
		||||
qemu-img.pod
 | 
			
		||||
qemu-img
 | 
			
		||||
qemu-nbd
 | 
			
		||||
qemu-nbd.8
 | 
			
		||||
qemu-nbd.pod
 | 
			
		||||
qemu-options.def
 | 
			
		||||
qemu-options.texi
 | 
			
		||||
qemu-img-cmds.texi
 | 
			
		||||
qemu-img-cmds.h
 | 
			
		||||
qemu-io
 | 
			
		||||
qemu-ga
 | 
			
		||||
qemu-monitor.texi
 | 
			
		||||
QMP/qmp-commands.txt
 | 
			
		||||
.gdbinit
 | 
			
		||||
*.a
 | 
			
		||||
*.aux
 | 
			
		||||
*.cp
 | 
			
		||||
*.dvi
 | 
			
		||||
*.exe
 | 
			
		||||
*.fn
 | 
			
		||||
*.ky
 | 
			
		||||
*.log
 | 
			
		||||
*.pdf
 | 
			
		||||
*.cps
 | 
			
		||||
*.fns
 | 
			
		||||
*.kys
 | 
			
		||||
*.pg
 | 
			
		||||
*.pyc
 | 
			
		||||
.sdk
 | 
			
		||||
*.toc
 | 
			
		||||
*.tp
 | 
			
		||||
*.vr
 | 
			
		||||
*.d
 | 
			
		||||
*.o
 | 
			
		||||
*.swp
 | 
			
		||||
*.orig
 | 
			
		||||
.pc
 | 
			
		||||
patches
 | 
			
		||||
pc-bios/bios-pq/status
 | 
			
		||||
pc-bios/vgabios-pq/status
 | 
			
		||||
pc-bios/optionrom/linuxboot.bin
 | 
			
		||||
pc-bios/optionrom/multiboot.bin
 | 
			
		||||
pc-bios/optionrom/multiboot.raw
 | 
			
		||||
pc-bios/optionrom/extboot.bin
 | 
			
		||||
pc-bios/optionrom/vapic.bin
 | 
			
		||||
.stgit-*
 | 
			
		||||
.git-submodule-status
 | 
			
		||||
.clang-format
 | 
			
		||||
.gdb_history
 | 
			
		||||
cscope.*
 | 
			
		||||
tags
 | 
			
		||||
TAGS
 | 
			
		||||
GPATH
 | 
			
		||||
GRTAGS
 | 
			
		||||
GTAGS
 | 
			
		||||
*~
 | 
			
		||||
*.ast_raw
 | 
			
		||||
*.depend_raw
 | 
			
		||||
*.swp
 | 
			
		||||
*.patch
 | 
			
		||||
*.gcov
 | 
			
		||||
 
 | 
			
		||||
@@ -1,136 +0,0 @@
 | 
			
		||||
 | 
			
		||||
variables:
 | 
			
		||||
  # On stable branches this is changed by later rules. Should also
 | 
			
		||||
  # be overridden per pipeline if running pipelines concurrently
 | 
			
		||||
  # for different branches in contributor forks.
 | 
			
		||||
  QEMU_CI_CONTAINER_TAG: latest
 | 
			
		||||
 | 
			
		||||
  # For purposes of CI rules, upstream is the gitlab.com/qemu-project
 | 
			
		||||
  # namespace. When testing CI, it might be usefult to override this
 | 
			
		||||
  # to point to a fork repo
 | 
			
		||||
  QEMU_CI_UPSTREAM: qemu-project
 | 
			
		||||
 | 
			
		||||
# The order of rules defined here is critically important.
 | 
			
		||||
# They are evaluated in order and first match wins.
 | 
			
		||||
#
 | 
			
		||||
# Thus we group them into a number of stages, ordered from
 | 
			
		||||
# most restrictive to least restrictive
 | 
			
		||||
#
 | 
			
		||||
# For pipelines running for stable "staging-X.Y" branches
 | 
			
		||||
# we must override QEMU_CI_CONTAINER_TAG
 | 
			
		||||
#
 | 
			
		||||
.base_job_template:
 | 
			
		||||
  variables:
 | 
			
		||||
    # Each script line from will be in a collapsible section in the job output
 | 
			
		||||
    # and show the duration of each line.
 | 
			
		||||
    FF_SCRIPT_SECTIONS: 1
 | 
			
		||||
    # The project has a fairly fat GIT repo so we try and avoid bringing in things
 | 
			
		||||
    # we don't need. The --filter options avoid blobs and tree references we aren't going to use
 | 
			
		||||
    # and we also avoid fetching tags.
 | 
			
		||||
    GIT_FETCH_EXTRA_FLAGS: --filter=blob:none --filter=tree:0 --no-tags --prune --quiet
 | 
			
		||||
 | 
			
		||||
  interruptible: true
 | 
			
		||||
 | 
			
		||||
  rules:
 | 
			
		||||
    #############################################################
 | 
			
		||||
    # Stage 1: exclude scenarios where we definitely don't
 | 
			
		||||
    # want jobs to run
 | 
			
		||||
    #############################################################
 | 
			
		||||
 | 
			
		||||
    # Never run jobs upstream on stable branch, staging branch jobs already ran
 | 
			
		||||
    - if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_BRANCH =~ /^stable-/'
 | 
			
		||||
      when: never
 | 
			
		||||
 | 
			
		||||
    # Never run jobs upstream on tags, staging branch jobs already ran
 | 
			
		||||
    - if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_TAG'
 | 
			
		||||
      when: never
 | 
			
		||||
 | 
			
		||||
    # Scheduled runs on mainline don't get pipelines except for the special Coverity job
 | 
			
		||||
    - if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_PIPELINE_SOURCE == "schedule"'
 | 
			
		||||
      when: never
 | 
			
		||||
 | 
			
		||||
    # Cirrus jobs can't run unless the creds / target repo are set
 | 
			
		||||
    - if: '$QEMU_JOB_CIRRUS && ($CIRRUS_GITHUB_REPO == null || $CIRRUS_API_TOKEN == null)'
 | 
			
		||||
      when: never
 | 
			
		||||
 | 
			
		||||
    # Publishing jobs should only run on the default branch in upstream
 | 
			
		||||
    - if: '$QEMU_JOB_PUBLISH == "1" && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
 | 
			
		||||
      when: never
 | 
			
		||||
 | 
			
		||||
    # Non-publishing jobs should only run on staging branches in upstream
 | 
			
		||||
    - if: '$QEMU_JOB_PUBLISH != "1" && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_BRANCH !~ /staging/'
 | 
			
		||||
      when: never
 | 
			
		||||
 | 
			
		||||
    # Jobs only intended for forks should always be skipped on upstream
 | 
			
		||||
    - if: '$QEMU_JOB_ONLY_FORKS == "1" && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM'
 | 
			
		||||
      when: never
 | 
			
		||||
 | 
			
		||||
    # Forks don't get pipelines unless QEMU_CI=1 or QEMU_CI=2 is set
 | 
			
		||||
    - if: '$QEMU_CI != "1" && $QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM'
 | 
			
		||||
      when: never
 | 
			
		||||
 | 
			
		||||
    # Avocado jobs don't run in forks unless $QEMU_CI_AVOCADO_TESTING is set
 | 
			
		||||
    - if: '$QEMU_JOB_AVOCADO && $QEMU_CI_AVOCADO_TESTING != "1" && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM'
 | 
			
		||||
      when: never
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    #############################################################
 | 
			
		||||
    # Stage 2: fine tune execution of jobs in specific scenarios
 | 
			
		||||
    # where the catch all logic is inappropriate
 | 
			
		||||
    #############################################################
 | 
			
		||||
 | 
			
		||||
    # Optional jobs should not be run unless manually triggered
 | 
			
		||||
    - if: '$QEMU_JOB_OPTIONAL && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_BRANCH =~ /staging-[[:digit:]]+\.[[:digit:]]/'
 | 
			
		||||
      when: manual
 | 
			
		||||
      allow_failure: true
 | 
			
		||||
      variables:
 | 
			
		||||
        QEMU_CI_CONTAINER_TAG: $CI_COMMIT_REF_SLUG
 | 
			
		||||
 | 
			
		||||
    - if: '$QEMU_JOB_OPTIONAL'
 | 
			
		||||
      when: manual
 | 
			
		||||
      allow_failure: true
 | 
			
		||||
 | 
			
		||||
    # Skipped jobs should not be run unless manually triggered
 | 
			
		||||
    - if: '$QEMU_JOB_SKIPPED && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_BRANCH =~ /staging-[[:digit:]]+\.[[:digit:]]/'
 | 
			
		||||
      when: manual
 | 
			
		||||
      allow_failure: true
 | 
			
		||||
      variables:
 | 
			
		||||
        QEMU_CI_CONTAINER_TAG: $CI_COMMIT_REF_SLUG
 | 
			
		||||
 | 
			
		||||
    - if: '$QEMU_JOB_SKIPPED'
 | 
			
		||||
      when: manual
 | 
			
		||||
      allow_failure: true
 | 
			
		||||
 | 
			
		||||
    # Avocado jobs can be manually start in forks if $QEMU_CI_AVOCADO_TESTING is unset
 | 
			
		||||
    - if: '$QEMU_JOB_AVOCADO && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM'
 | 
			
		||||
      when: manual
 | 
			
		||||
      allow_failure: true
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    #############################################################
 | 
			
		||||
    # Stage 3: catch all logic applying to any job not matching
 | 
			
		||||
    # an earlier criteria
 | 
			
		||||
    #############################################################
 | 
			
		||||
 | 
			
		||||
    # Forks pipeline jobs don't start automatically unless
 | 
			
		||||
    # QEMU_CI=2 is set
 | 
			
		||||
    - if: '$QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM'
 | 
			
		||||
      when: manual
 | 
			
		||||
 | 
			
		||||
    # Upstream pipeline jobs start automatically unless told not to
 | 
			
		||||
    # by setting QEMU_CI=1
 | 
			
		||||
    - if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_BRANCH =~ /staging-[[:digit:]]+\.[[:digit:]]/'
 | 
			
		||||
      when: manual
 | 
			
		||||
      variables:
 | 
			
		||||
        QEMU_CI_CONTAINER_TAG: $CI_COMMIT_REF_SLUG
 | 
			
		||||
 | 
			
		||||
    - if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM'
 | 
			
		||||
      when: manual
 | 
			
		||||
 | 
			
		||||
    # Jobs can run if any jobs they depend on were successful
 | 
			
		||||
    - if: '$QEMU_JOB_SKIPPED && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_BRANCH =~ /staging-[[:digit:]]+\.[[:digit:]]/'
 | 
			
		||||
      when: on_success
 | 
			
		||||
      variables:
 | 
			
		||||
        QEMU_CI_CONTAINER_TAG: $CI_COMMIT_REF_SLUG
 | 
			
		||||
 | 
			
		||||
    - when: on_success
 | 
			
		||||
@@ -1,105 +0,0 @@
 | 
			
		||||
.native_build_job_template:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  stage: build
 | 
			
		||||
  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
 | 
			
		||||
  cache:
 | 
			
		||||
    paths:
 | 
			
		||||
      - ccache
 | 
			
		||||
    key: "$CI_JOB_NAME"
 | 
			
		||||
    when: always
 | 
			
		||||
  before_script:
 | 
			
		||||
    - JOBS=$(expr $(nproc) + 1)
 | 
			
		||||
  script:
 | 
			
		||||
    - export CCACHE_BASEDIR="$(pwd)"
 | 
			
		||||
    - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
 | 
			
		||||
    - export CCACHE_MAXSIZE="500M"
 | 
			
		||||
    - export PATH="$CCACHE_WRAPPERSDIR:$PATH"
 | 
			
		||||
    - du -sh .git
 | 
			
		||||
    - mkdir build
 | 
			
		||||
    - cd build
 | 
			
		||||
    - ccache --zero-stats
 | 
			
		||||
    - ../configure --enable-werror --disable-docs --enable-fdt=system
 | 
			
		||||
          ${TARGETS:+--target-list="$TARGETS"}
 | 
			
		||||
          $CONFIGURE_ARGS ||
 | 
			
		||||
      { cat config.log meson-logs/meson-log.txt && exit 1; }
 | 
			
		||||
    - if test -n "$LD_JOBS";
 | 
			
		||||
      then
 | 
			
		||||
        pyvenv/bin/meson configure . -Dbackend_max_links="$LD_JOBS" ;
 | 
			
		||||
      fi || exit 1;
 | 
			
		||||
    - $MAKE -j"$JOBS"
 | 
			
		||||
    - if test -n "$MAKE_CHECK_ARGS";
 | 
			
		||||
      then
 | 
			
		||||
        $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
 | 
			
		||||
      fi
 | 
			
		||||
    - ccache --show-stats
 | 
			
		||||
 | 
			
		||||
# We jump some hoops in common_test_job_template to avoid
 | 
			
		||||
# rebuilding all the object files we skip in the artifacts
 | 
			
		||||
.native_build_artifact_template:
 | 
			
		||||
  artifacts:
 | 
			
		||||
    when: on_success
 | 
			
		||||
    expire_in: 2 days
 | 
			
		||||
    paths:
 | 
			
		||||
      - build
 | 
			
		||||
      - .git-submodule-status
 | 
			
		||||
    exclude:
 | 
			
		||||
      - build/**/*.p
 | 
			
		||||
      - build/**/*.a.p
 | 
			
		||||
      - build/**/*.c.o
 | 
			
		||||
      - build/**/*.c.o.d
 | 
			
		||||
 | 
			
		||||
.common_test_job_template:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  stage: test
 | 
			
		||||
  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
 | 
			
		||||
  script:
 | 
			
		||||
    - scripts/git-submodule.sh update roms/SLOF
 | 
			
		||||
    - meson subprojects download $(cd build/subprojects && echo *)
 | 
			
		||||
    - cd build
 | 
			
		||||
    - find . -type f -exec touch {} +
 | 
			
		||||
    # Avoid recompiling by hiding ninja with NINJA=":"
 | 
			
		||||
    - $MAKE NINJA=":" $MAKE_CHECK_ARGS
 | 
			
		||||
 | 
			
		||||
.native_test_job_template:
 | 
			
		||||
  extends: .common_test_job_template
 | 
			
		||||
  artifacts:
 | 
			
		||||
    name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
 | 
			
		||||
    when: always
 | 
			
		||||
    expire_in: 7 days
 | 
			
		||||
    paths:
 | 
			
		||||
      - build/meson-logs/testlog.txt
 | 
			
		||||
    reports:
 | 
			
		||||
      junit: build/meson-logs/testlog.junit.xml
 | 
			
		||||
 | 
			
		||||
.avocado_test_job_template:
 | 
			
		||||
  extends: .common_test_job_template
 | 
			
		||||
  cache:
 | 
			
		||||
    key: "${CI_JOB_NAME}-cache"
 | 
			
		||||
    paths:
 | 
			
		||||
      - ${CI_PROJECT_DIR}/avocado-cache
 | 
			
		||||
    policy: pull-push
 | 
			
		||||
  artifacts:
 | 
			
		||||
    name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
 | 
			
		||||
    when: always
 | 
			
		||||
    expire_in: 7 days
 | 
			
		||||
    paths:
 | 
			
		||||
      - build/tests/results/latest/results.xml
 | 
			
		||||
      - build/tests/results/latest/test-results
 | 
			
		||||
    reports:
 | 
			
		||||
      junit: build/tests/results/latest/results.xml
 | 
			
		||||
  before_script:
 | 
			
		||||
    - mkdir -p ~/.config/avocado
 | 
			
		||||
    - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
 | 
			
		||||
    - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
 | 
			
		||||
           >> ~/.config/avocado/avocado.conf
 | 
			
		||||
    - echo -e '[job.output.testlogs]\nstatuses = ["FAIL", "INTERRUPT"]'
 | 
			
		||||
           >> ~/.config/avocado/avocado.conf
 | 
			
		||||
    - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
 | 
			
		||||
        du -chs ${CI_PROJECT_DIR}/avocado-cache ;
 | 
			
		||||
      fi
 | 
			
		||||
    - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
 | 
			
		||||
  after_script:
 | 
			
		||||
    - cd build
 | 
			
		||||
    - du -chs ${CI_PROJECT_DIR}/avocado-cache
 | 
			
		||||
  variables:
 | 
			
		||||
    QEMU_JOB_AVOCADO: 1
 | 
			
		||||
@@ -1,778 +0,0 @@
 | 
			
		||||
include:
 | 
			
		||||
  - local: '/.gitlab-ci.d/buildtest-template.yml'
 | 
			
		||||
 | 
			
		||||
build-system-alpine:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .native_build_job_template
 | 
			
		||||
    - .native_build_artifact_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: amd64-alpine-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: alpine
 | 
			
		||||
    TARGETS: avr-softmmu loongarch64-softmmu mips64-softmmu mipsel-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-build
 | 
			
		||||
    CONFIGURE_ARGS: --enable-docs --enable-trace-backends=log,simple,syslog
 | 
			
		||||
 | 
			
		||||
check-system-alpine:
 | 
			
		||||
  extends: .native_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-alpine
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: alpine
 | 
			
		||||
    MAKE_CHECK_ARGS: check-unit check-qtest
 | 
			
		||||
 | 
			
		||||
avocado-system-alpine:
 | 
			
		||||
  extends: .avocado_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-alpine
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: alpine
 | 
			
		||||
    MAKE_CHECK_ARGS: check-avocado
 | 
			
		||||
    AVOCADO_TAGS: arch:avr arch:loongarch64 arch:mips64 arch:mipsel
 | 
			
		||||
 | 
			
		||||
build-system-ubuntu:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .native_build_job_template
 | 
			
		||||
    - .native_build_artifact_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-ubuntu2204-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: ubuntu2204
 | 
			
		||||
    CONFIGURE_ARGS: --enable-docs
 | 
			
		||||
    TARGETS: alpha-softmmu microblazeel-softmmu mips64el-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-build
 | 
			
		||||
 | 
			
		||||
check-system-ubuntu:
 | 
			
		||||
  extends: .native_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-ubuntu
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: ubuntu2204
 | 
			
		||||
    MAKE_CHECK_ARGS: check
 | 
			
		||||
 | 
			
		||||
avocado-system-ubuntu:
 | 
			
		||||
  extends: .avocado_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-ubuntu
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: ubuntu2204
 | 
			
		||||
    MAKE_CHECK_ARGS: check-avocado
 | 
			
		||||
    AVOCADO_TAGS: arch:alpha arch:microblazeel arch:mips64el
 | 
			
		||||
 | 
			
		||||
build-system-debian:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .native_build_job_template
 | 
			
		||||
    - .native_build_artifact_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-debian-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian
 | 
			
		||||
    CONFIGURE_ARGS: --with-coroutine=sigaltstack
 | 
			
		||||
    TARGETS: arm-softmmu i386-softmmu riscv64-softmmu sh4eb-softmmu
 | 
			
		||||
      sparc-softmmu xtensa-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-build
 | 
			
		||||
 | 
			
		||||
check-system-debian:
 | 
			
		||||
  extends: .native_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-debian
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian
 | 
			
		||||
    MAKE_CHECK_ARGS: check
 | 
			
		||||
 | 
			
		||||
avocado-system-debian:
 | 
			
		||||
  extends: .avocado_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-debian
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian
 | 
			
		||||
    MAKE_CHECK_ARGS: check-avocado
 | 
			
		||||
    AVOCADO_TAGS: arch:arm arch:i386 arch:riscv64 arch:sh4 arch:sparc arch:xtensa
 | 
			
		||||
 | 
			
		||||
crash-test-debian:
 | 
			
		||||
  extends: .native_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-debian
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian
 | 
			
		||||
  script:
 | 
			
		||||
    - cd build
 | 
			
		||||
    - make NINJA=":" check-venv
 | 
			
		||||
    - pyvenv/bin/python3 scripts/device-crash-test -q --tcg-only ./qemu-system-i386
 | 
			
		||||
 | 
			
		||||
build-system-fedora:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .native_build_job_template
 | 
			
		||||
    - .native_build_artifact_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-fedora-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
 | 
			
		||||
    TARGETS: microblaze-softmmu mips-softmmu
 | 
			
		||||
      xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-build
 | 
			
		||||
 | 
			
		||||
check-system-fedora:
 | 
			
		||||
  extends: .native_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-fedora
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    MAKE_CHECK_ARGS: check
 | 
			
		||||
 | 
			
		||||
avocado-system-fedora:
 | 
			
		||||
  extends: .avocado_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-fedora
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    MAKE_CHECK_ARGS: check-avocado
 | 
			
		||||
    AVOCADO_TAGS: arch:microblaze arch:mips arch:xtensa arch:m68k
 | 
			
		||||
      arch:riscv32 arch:ppc arch:sparc64
 | 
			
		||||
 | 
			
		||||
crash-test-fedora:
 | 
			
		||||
  extends: .native_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-fedora
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
  script:
 | 
			
		||||
    - cd build
 | 
			
		||||
    - make NINJA=":" check-venv
 | 
			
		||||
    - pyvenv/bin/python3 scripts/device-crash-test -q ./qemu-system-ppc
 | 
			
		||||
    - pyvenv/bin/python3 scripts/device-crash-test -q ./qemu-system-riscv32
 | 
			
		||||
 | 
			
		||||
build-system-centos:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .native_build_job_template
 | 
			
		||||
    - .native_build_artifact_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-centos9-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: centos9
 | 
			
		||||
    CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-vfio-user-server
 | 
			
		||||
      --enable-modules --enable-trace-backends=dtrace --enable-docs
 | 
			
		||||
    TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
 | 
			
		||||
      x86_64-softmmu rx-softmmu sh4-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-build
 | 
			
		||||
 | 
			
		||||
# Previous QEMU release. Used for cross-version migration tests.
 | 
			
		||||
build-previous-qemu:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  artifacts:
 | 
			
		||||
    when: on_success
 | 
			
		||||
    expire_in: 2 days
 | 
			
		||||
    paths:
 | 
			
		||||
      - build-previous
 | 
			
		||||
    exclude:
 | 
			
		||||
      - build-previous/**/*.p
 | 
			
		||||
      - build-previous/**/*.a.p
 | 
			
		||||
      - build-previous/**/*.c.o
 | 
			
		||||
      - build-previous/**/*.c.o.d
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-opensuse-leap-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: opensuse-leap
 | 
			
		||||
    TARGETS: x86_64-softmmu aarch64-softmmu
 | 
			
		||||
    # Override the default flags as we need more to grab the old version
 | 
			
		||||
    GIT_FETCH_EXTRA_FLAGS: --prune --quiet
 | 
			
		||||
  before_script:
 | 
			
		||||
    - export QEMU_PREV_VERSION="$(sed 's/\([0-9.]*\)\.[0-9]*/v\1.0/' VERSION)"
 | 
			
		||||
    - git remote add upstream https://gitlab.com/qemu-project/qemu
 | 
			
		||||
    - git fetch upstream refs/tags/$QEMU_PREV_VERSION:refs/tags/$QEMU_PREV_VERSION
 | 
			
		||||
    - git checkout $QEMU_PREV_VERSION
 | 
			
		||||
  after_script:
 | 
			
		||||
    - mv build build-previous
 | 
			
		||||
 | 
			
		||||
.migration-compat-common:
 | 
			
		||||
  extends: .common_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-previous-qemu
 | 
			
		||||
    - job: build-system-opensuse
 | 
			
		||||
  # The old QEMU could have bugs unrelated to migration that are
 | 
			
		||||
  # already fixed in the current development branch, so this test
 | 
			
		||||
  # might fail.
 | 
			
		||||
  allow_failure: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: opensuse-leap
 | 
			
		||||
    MAKE_CHECK_ARGS: check-build
 | 
			
		||||
  script:
 | 
			
		||||
    # Use the migration-tests from the older QEMU tree. This avoids
 | 
			
		||||
    # testing an old QEMU against new features/tests that it is not
 | 
			
		||||
    # compatible with.
 | 
			
		||||
    - cd build-previous
 | 
			
		||||
    # old to new
 | 
			
		||||
    - QTEST_QEMU_BINARY_SRC=./qemu-system-${TARGET}
 | 
			
		||||
          QTEST_QEMU_BINARY=../build/qemu-system-${TARGET} ./tests/qtest/migration-test
 | 
			
		||||
    # new to old
 | 
			
		||||
    - QTEST_QEMU_BINARY_DST=./qemu-system-${TARGET}
 | 
			
		||||
          QTEST_QEMU_BINARY=../build/qemu-system-${TARGET} ./tests/qtest/migration-test
 | 
			
		||||
 | 
			
		||||
# This job needs to be disabled until we can have an aarch64 CPU model that
 | 
			
		||||
# will both (1) support both KVM and TCG, and (2) provide a stable ABI.
 | 
			
		||||
# Currently only "-cpu max" can provide (1), however it doesn't guarantee
 | 
			
		||||
# (2).  Mark this test skipped until later.
 | 
			
		||||
migration-compat-aarch64:
 | 
			
		||||
  extends: .migration-compat-common
 | 
			
		||||
  variables:
 | 
			
		||||
    TARGET: aarch64
 | 
			
		||||
    QEMU_JOB_SKIPPED: 1
 | 
			
		||||
 | 
			
		||||
migration-compat-x86_64:
 | 
			
		||||
  extends: .migration-compat-common
 | 
			
		||||
  variables:
 | 
			
		||||
    TARGET: x86_64
 | 
			
		||||
 | 
			
		||||
check-system-centos:
 | 
			
		||||
  extends: .native_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-centos
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: centos9
 | 
			
		||||
    MAKE_CHECK_ARGS: check
 | 
			
		||||
 | 
			
		||||
avocado-system-centos:
 | 
			
		||||
  extends: .avocado_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-centos
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: centos9
 | 
			
		||||
    MAKE_CHECK_ARGS: check-avocado
 | 
			
		||||
    AVOCADO_TAGS: arch:ppc64 arch:or1k arch:s390x arch:x86_64 arch:rx
 | 
			
		||||
      arch:sh4
 | 
			
		||||
 | 
			
		||||
build-system-opensuse:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .native_build_job_template
 | 
			
		||||
    - .native_build_artifact_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-opensuse-leap-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: opensuse-leap
 | 
			
		||||
    TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-build
 | 
			
		||||
 | 
			
		||||
check-system-opensuse:
 | 
			
		||||
  extends: .native_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-opensuse
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: opensuse-leap
 | 
			
		||||
    MAKE_CHECK_ARGS: check
 | 
			
		||||
 | 
			
		||||
avocado-system-opensuse:
 | 
			
		||||
  extends: .avocado_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-opensuse
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: opensuse-leap
 | 
			
		||||
    MAKE_CHECK_ARGS: check-avocado
 | 
			
		||||
    AVOCADO_TAGS: arch:s390x arch:x86_64 arch:aarch64
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Flaky tests. We don't run these by default and they are allow fail
 | 
			
		||||
# but often the CI system is the only way to trigger the failures.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
build-system-flaky:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .native_build_job_template
 | 
			
		||||
    - .native_build_artifact_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-debian-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian
 | 
			
		||||
    QEMU_JOB_OPTIONAL: 1
 | 
			
		||||
    TARGETS: aarch64-softmmu arm-softmmu mips64el-softmmu
 | 
			
		||||
      ppc64-softmmu rx-softmmu s390x-softmmu sh4-softmmu x86_64-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-build
 | 
			
		||||
 | 
			
		||||
avocado-system-flaky:
 | 
			
		||||
  extends: .avocado_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-system-flaky
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  allow_failure: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian
 | 
			
		||||
    MAKE_CHECK_ARGS: check-avocado
 | 
			
		||||
    QEMU_JOB_OPTIONAL: 1
 | 
			
		||||
    QEMU_TEST_FLAKY_TESTS: 1
 | 
			
		||||
    AVOCADO_TAGS: flaky
 | 
			
		||||
 | 
			
		||||
# This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
 | 
			
		||||
# the configure script. The container doesn't contain Xen headers so
 | 
			
		||||
# Xen accelerator is not detected / selected. As result it build the
 | 
			
		||||
# i386-softmmu and x86_64-softmmu with KVM being the single accelerator
 | 
			
		||||
# available.
 | 
			
		||||
# Also use a different coroutine implementation (which is only really of
 | 
			
		||||
# interest to KVM users, i.e. with TCG disabled)
 | 
			
		||||
build-tcg-disabled:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-centos9-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: centos9
 | 
			
		||||
  script:
 | 
			
		||||
    - mkdir build
 | 
			
		||||
    - cd build
 | 
			
		||||
    - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
 | 
			
		||||
                   --disable-docs --disable-sdl --disable-gtk --disable-vnc
 | 
			
		||||
      || { cat config.log meson-logs/meson-log.txt && exit 1; }
 | 
			
		||||
    - make -j"$JOBS"
 | 
			
		||||
    - make check-unit
 | 
			
		||||
    - make check-qapi-schema
 | 
			
		||||
    - cd tests/qemu-iotests/
 | 
			
		||||
    - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
 | 
			
		||||
            052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
 | 
			
		||||
            170 171 184 192 194 208 221 226 227 236 253 277 image-fleecing
 | 
			
		||||
    - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
 | 
			
		||||
            124 132 139 142 144 145 151 152 155 157 165 194 196 200 202
 | 
			
		||||
            208 209 216 218 227 234 246 247 248 250 254 255 257 258
 | 
			
		||||
            260 261 262 263 264 270 272 273 277 279 image-fleecing
 | 
			
		||||
 | 
			
		||||
build-user:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-debian-user-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-all-test-cross
 | 
			
		||||
    CONFIGURE_ARGS: --disable-tools --disable-system
 | 
			
		||||
      --target-list-exclude=alpha-linux-user,sh4-linux-user
 | 
			
		||||
    MAKE_CHECK_ARGS: check-tcg
 | 
			
		||||
 | 
			
		||||
build-user-static:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-debian-user-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-all-test-cross
 | 
			
		||||
    CONFIGURE_ARGS: --disable-tools --disable-system --static
 | 
			
		||||
      --target-list-exclude=alpha-linux-user,sh4-linux-user
 | 
			
		||||
    MAKE_CHECK_ARGS: check-tcg
 | 
			
		||||
 | 
			
		||||
# targets stuck on older compilers
 | 
			
		||||
build-legacy:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-debian-legacy-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-legacy-test-cross
 | 
			
		||||
    TARGETS: alpha-linux-user alpha-softmmu sh4-linux-user
 | 
			
		||||
    CONFIGURE_ARGS: --disable-tools
 | 
			
		||||
    MAKE_CHECK_ARGS: check-tcg
 | 
			
		||||
 | 
			
		||||
build-user-hexagon:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: hexagon-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-hexagon-cross
 | 
			
		||||
    TARGETS: hexagon-linux-user
 | 
			
		||||
    CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
 | 
			
		||||
    MAKE_CHECK_ARGS: check-tcg
 | 
			
		||||
 | 
			
		||||
# Build the softmmu targets we have check-tcg tests and compilers in
 | 
			
		||||
# our omnibus all-test-cross container. Those targets that haven't got
 | 
			
		||||
# Debian cross compiler support need to use special containers.
 | 
			
		||||
build-some-softmmu:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-debian-user-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-all-test-cross
 | 
			
		||||
    CONFIGURE_ARGS: --disable-tools --enable-debug
 | 
			
		||||
    TARGETS: arm-softmmu aarch64-softmmu i386-softmmu riscv64-softmmu
 | 
			
		||||
      s390x-softmmu x86_64-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-tcg
 | 
			
		||||
 | 
			
		||||
build-loongarch64:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: loongarch-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-loongarch-cross
 | 
			
		||||
    CONFIGURE_ARGS: --disable-tools --enable-debug
 | 
			
		||||
    TARGETS: loongarch64-linux-user loongarch64-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-tcg
 | 
			
		||||
 | 
			
		||||
# We build tricore in a very minimal tricore only container
 | 
			
		||||
build-tricore-softmmu:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: tricore-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-tricore-cross
 | 
			
		||||
    CONFIGURE_ARGS: --disable-tools --disable-fdt --enable-debug
 | 
			
		||||
    TARGETS: tricore-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-tcg
 | 
			
		||||
 | 
			
		||||
clang-system:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-fedora-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    CONFIGURE_ARGS: --cc=clang --cxx=clang++
 | 
			
		||||
      --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
 | 
			
		||||
      --extra-cflags=-fno-sanitize=function
 | 
			
		||||
    TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu s390x-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-qtest check-tcg
 | 
			
		||||
 | 
			
		||||
clang-user:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-debian-user-cross-container
 | 
			
		||||
  timeout: 70m
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-all-test-cross
 | 
			
		||||
    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
 | 
			
		||||
      --target-list-exclude=alpha-linux-user,microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
 | 
			
		||||
      --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
 | 
			
		||||
    MAKE_CHECK_ARGS: check-unit check-tcg
 | 
			
		||||
 | 
			
		||||
# Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
 | 
			
		||||
# On gitlab runners, default value sometimes end up calling 2 lds concurrently and
 | 
			
		||||
# triggers an Out-Of-Memory error
 | 
			
		||||
#
 | 
			
		||||
# Since slirp callbacks are used in QEMU Timers, we cannot use libslirp with
 | 
			
		||||
# CFI builds, and thus have to disable it here.
 | 
			
		||||
#
 | 
			
		||||
# Split in three sets of build/check/avocado to limit the execution time of each
 | 
			
		||||
# job
 | 
			
		||||
build-cfi-aarch64:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .native_build_job_template
 | 
			
		||||
    - .native_build_artifact_template
 | 
			
		||||
  needs:
 | 
			
		||||
  - job: amd64-fedora-container
 | 
			
		||||
  variables:
 | 
			
		||||
    LD_JOBS: 1
 | 
			
		||||
    AR: llvm-ar
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
 | 
			
		||||
      --enable-safe-stack --disable-slirp
 | 
			
		||||
    TARGETS: aarch64-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-build
 | 
			
		||||
    # FIXME: This job is often failing, likely due to out-of-memory problems in
 | 
			
		||||
    # the constrained containers of the shared runners. Thus this is marked as
 | 
			
		||||
    # skipped until the situation has been solved.
 | 
			
		||||
    QEMU_JOB_SKIPPED: 1
 | 
			
		||||
  timeout: 90m
 | 
			
		||||
 | 
			
		||||
check-cfi-aarch64:
 | 
			
		||||
  extends: .native_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-cfi-aarch64
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    MAKE_CHECK_ARGS: check
 | 
			
		||||
 | 
			
		||||
avocado-cfi-aarch64:
 | 
			
		||||
  extends: .avocado_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-cfi-aarch64
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    MAKE_CHECK_ARGS: check-avocado
 | 
			
		||||
 | 
			
		||||
build-cfi-ppc64-s390x:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .native_build_job_template
 | 
			
		||||
    - .native_build_artifact_template
 | 
			
		||||
  needs:
 | 
			
		||||
  - job: amd64-fedora-container
 | 
			
		||||
  variables:
 | 
			
		||||
    LD_JOBS: 1
 | 
			
		||||
    AR: llvm-ar
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
 | 
			
		||||
      --enable-safe-stack --disable-slirp
 | 
			
		||||
    TARGETS: ppc64-softmmu s390x-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-build
 | 
			
		||||
    # FIXME: This job is often failing, likely due to out-of-memory problems in
 | 
			
		||||
    # the constrained containers of the shared runners. Thus this is marked as
 | 
			
		||||
    # skipped until the situation has been solved.
 | 
			
		||||
    QEMU_JOB_SKIPPED: 1
 | 
			
		||||
  timeout: 80m
 | 
			
		||||
 | 
			
		||||
check-cfi-ppc64-s390x:
 | 
			
		||||
  extends: .native_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-cfi-ppc64-s390x
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    MAKE_CHECK_ARGS: check
 | 
			
		||||
 | 
			
		||||
avocado-cfi-ppc64-s390x:
 | 
			
		||||
  extends: .avocado_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-cfi-ppc64-s390x
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    MAKE_CHECK_ARGS: check-avocado
 | 
			
		||||
 | 
			
		||||
build-cfi-x86_64:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .native_build_job_template
 | 
			
		||||
    - .native_build_artifact_template
 | 
			
		||||
  needs:
 | 
			
		||||
  - job: amd64-fedora-container
 | 
			
		||||
  variables:
 | 
			
		||||
    LD_JOBS: 1
 | 
			
		||||
    AR: llvm-ar
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
 | 
			
		||||
      --enable-safe-stack --disable-slirp
 | 
			
		||||
    TARGETS: x86_64-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-build
 | 
			
		||||
  timeout: 70m
 | 
			
		||||
 | 
			
		||||
check-cfi-x86_64:
 | 
			
		||||
  extends: .native_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-cfi-x86_64
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    MAKE_CHECK_ARGS: check
 | 
			
		||||
 | 
			
		||||
avocado-cfi-x86_64:
 | 
			
		||||
  extends: .avocado_test_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-cfi-x86_64
 | 
			
		||||
      artifacts: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
    MAKE_CHECK_ARGS: check-avocado
 | 
			
		||||
 | 
			
		||||
tsan-build:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-ubuntu2204-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: ubuntu2204
 | 
			
		||||
    CONFIGURE_ARGS: --enable-tsan --cc=clang --cxx=clang++
 | 
			
		||||
          --enable-trace-backends=ust --disable-slirp
 | 
			
		||||
    TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
 | 
			
		||||
    # Remove when we switch to a distro with clang >= 18
 | 
			
		||||
    # https://github.com/google/sanitizers/issues/1716
 | 
			
		||||
    MAKE: setarch -R make
 | 
			
		||||
 | 
			
		||||
# gcov is a GCC features
 | 
			
		||||
gcov:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-ubuntu2204-container
 | 
			
		||||
  timeout: 80m
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: ubuntu2204
 | 
			
		||||
    CONFIGURE_ARGS: --enable-gcov
 | 
			
		||||
    TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
 | 
			
		||||
    MAKE_CHECK_ARGS: check-unit check-softfloat
 | 
			
		||||
  after_script:
 | 
			
		||||
    - cd build
 | 
			
		||||
    - gcovr --xml-pretty --exclude-unreachable-branches --print-summary
 | 
			
		||||
        -o coverage.xml --root ${CI_PROJECT_DIR} . *.p
 | 
			
		||||
  coverage: /^\s*lines:\s*\d+.\d+\%/
 | 
			
		||||
  artifacts:
 | 
			
		||||
    name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
 | 
			
		||||
    when: always
 | 
			
		||||
    expire_in: 2 days
 | 
			
		||||
    paths:
 | 
			
		||||
      - build/meson-logs/testlog.txt
 | 
			
		||||
    reports:
 | 
			
		||||
      junit: build/meson-logs/testlog.junit.xml
 | 
			
		||||
      coverage_report:
 | 
			
		||||
        coverage_format: cobertura
 | 
			
		||||
        path: build/coverage.xml
 | 
			
		||||
 | 
			
		||||
build-oss-fuzz:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-fedora-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora
 | 
			
		||||
  script:
 | 
			
		||||
    - mkdir build-oss-fuzz
 | 
			
		||||
    - export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt
 | 
			
		||||
    - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
 | 
			
		||||
      ./scripts/oss-fuzz/build.sh
 | 
			
		||||
    - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
 | 
			
		||||
    - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
 | 
			
		||||
                      | grep -v slirp); do
 | 
			
		||||
        grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
 | 
			
		||||
        echo Testing ${fuzzer} ... ;
 | 
			
		||||
        "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
 | 
			
		||||
      done
 | 
			
		||||
 | 
			
		||||
build-tci:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-debian-user-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-all-test-cross
 | 
			
		||||
  script:
 | 
			
		||||
    - TARGETS="aarch64 arm hppa m68k microblaze ppc64 s390x x86_64"
 | 
			
		||||
    - mkdir build
 | 
			
		||||
    - cd build
 | 
			
		||||
    - ../configure --enable-tcg-interpreter --disable-kvm --disable-docs --disable-gtk --disable-vnc
 | 
			
		||||
        --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
 | 
			
		||||
        || { cat config.log meson-logs/meson-log.txt && exit 1; }
 | 
			
		||||
    - make -j"$JOBS"
 | 
			
		||||
    - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
 | 
			
		||||
    - for tg in $TARGETS ; do
 | 
			
		||||
        export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
 | 
			
		||||
        ./tests/qtest/boot-serial-test || exit 1 ;
 | 
			
		||||
        ./tests/qtest/cdrom-test || exit 1 ;
 | 
			
		||||
      done
 | 
			
		||||
    - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
 | 
			
		||||
    - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
 | 
			
		||||
    - make check-tcg
 | 
			
		||||
 | 
			
		||||
# Check our reduced build configurations
 | 
			
		||||
# requires libfdt: aarch64, arm, loongarch64, microblaze, microblazeel,
 | 
			
		||||
#   or1k, ppc64, riscv32, riscv64, rx
 | 
			
		||||
# fails qtest without boards: i386, x86_64
 | 
			
		||||
build-without-defaults:
 | 
			
		||||
  extends: .native_build_job_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-centos9-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: centos9
 | 
			
		||||
    CONFIGURE_ARGS:
 | 
			
		||||
      --without-default-devices
 | 
			
		||||
      --without-default-features
 | 
			
		||||
      --disable-fdt
 | 
			
		||||
      --disable-pie
 | 
			
		||||
      --disable-qom-cast-debug
 | 
			
		||||
      --disable-strip
 | 
			
		||||
    TARGETS: alpha-softmmu avr-softmmu cris-softmmu hppa-softmmu m68k-softmmu
 | 
			
		||||
      mips-softmmu mips64-softmmu mipsel-softmmu mips64el-softmmu
 | 
			
		||||
      ppc-softmmu s390x-softmmu sh4-softmmu sh4eb-softmmu sparc-softmmu
 | 
			
		||||
      sparc64-softmmu tricore-softmmu xtensa-softmmu xtensaeb-softmmu
 | 
			
		||||
      hexagon-linux-user i386-linux-user s390x-linux-user
 | 
			
		||||
    MAKE_CHECK_ARGS: check
 | 
			
		||||
 | 
			
		||||
build-libvhost-user:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  stage: build
 | 
			
		||||
  image: $CI_REGISTRY_IMAGE/qemu/fedora:$QEMU_CI_CONTAINER_TAG
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-fedora-container
 | 
			
		||||
  script:
 | 
			
		||||
    - mkdir subprojects/libvhost-user/build
 | 
			
		||||
    - cd subprojects/libvhost-user/build
 | 
			
		||||
    - meson
 | 
			
		||||
    - ninja
 | 
			
		||||
 | 
			
		||||
# No targets are built here, just tools, docs, and unit tests. This
 | 
			
		||||
# also feeds into the eventual documentation deployment steps later
 | 
			
		||||
build-tools-and-docs-debian:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .native_build_job_template
 | 
			
		||||
    - .native_build_artifact_template
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-debian-container
 | 
			
		||||
    # when running on 'master' we use pre-existing container
 | 
			
		||||
    optional: true
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian
 | 
			
		||||
    MAKE_CHECK_ARGS: check-unit ctags TAGS cscope
 | 
			
		||||
    CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
 | 
			
		||||
    QEMU_JOB_PUBLISH: 1
 | 
			
		||||
 | 
			
		||||
# Prepare for GitLab pages deployment. Anything copied into the
 | 
			
		||||
# "public" directory will be deployed to $USER.gitlab.io/$PROJECT
 | 
			
		||||
#
 | 
			
		||||
# GitLab publishes from any branch that triggers a CI pipeline
 | 
			
		||||
#
 | 
			
		||||
# For the main repo we don't want to publish from 'staging'
 | 
			
		||||
# since that content may not be pushed, nor do we wish to
 | 
			
		||||
# publish from 'stable-NNN' branches as that content is outdated.
 | 
			
		||||
# Thus we restrict to just the default branch
 | 
			
		||||
#
 | 
			
		||||
# For contributor forks we want to publish from any repo so
 | 
			
		||||
# that users can see the results of their commits, regardless
 | 
			
		||||
# of what topic branch they're currently using
 | 
			
		||||
pages:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  image: $CI_REGISTRY_IMAGE/qemu/debian:$QEMU_CI_CONTAINER_TAG
 | 
			
		||||
  stage: test
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: build-tools-and-docs-debian
 | 
			
		||||
  script:
 | 
			
		||||
    - mkdir -p public
 | 
			
		||||
    # HTML-ised source tree
 | 
			
		||||
    - make gtags
 | 
			
		||||
    # We unset variables to work around a bug in some htags versions
 | 
			
		||||
    # which causes it to fail when the environment is large
 | 
			
		||||
    - CI_COMMIT_MESSAGE= CI_COMMIT_TAG_MESSAGE= htags
 | 
			
		||||
        -anT --tree-view=filetree -m qemu_init
 | 
			
		||||
        -t "Welcome to the QEMU sourcecode"
 | 
			
		||||
    - mv HTML public/src
 | 
			
		||||
    # Project documentation
 | 
			
		||||
    - make -C build install DESTDIR=$(pwd)/temp-install
 | 
			
		||||
    - mv temp-install/usr/local/share/doc/qemu/* public/
 | 
			
		||||
  artifacts:
 | 
			
		||||
    when: on_success
 | 
			
		||||
    paths:
 | 
			
		||||
      - public
 | 
			
		||||
  variables:
 | 
			
		||||
    QEMU_JOB_PUBLISH: 1
 | 
			
		||||
 | 
			
		||||
coverity:
 | 
			
		||||
  image: $CI_REGISTRY_IMAGE/qemu/fedora:$QEMU_CI_CONTAINER_TAG
 | 
			
		||||
  stage: build
 | 
			
		||||
  allow_failure: true
 | 
			
		||||
  timeout: 3h
 | 
			
		||||
  needs:
 | 
			
		||||
    - job: amd64-fedora-container
 | 
			
		||||
      optional: true
 | 
			
		||||
  before_script:
 | 
			
		||||
    - dnf install -y curl wget
 | 
			
		||||
  script:
 | 
			
		||||
    # would be nice to cancel the job if over quota (https://gitlab.com/gitlab-org/gitlab/-/issues/256089)
 | 
			
		||||
    # for example:
 | 
			
		||||
    #   curl --request POST --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/cancel
 | 
			
		||||
    - 'scripts/coverity-scan/run-coverity-scan --check-upload-only || { exitcode=$?; if test $exitcode = 1; then
 | 
			
		||||
        exit 0;
 | 
			
		||||
      else
 | 
			
		||||
        exit $exitcode;
 | 
			
		||||
      fi; };
 | 
			
		||||
      scripts/coverity-scan/run-coverity-scan --update-tools-only > update-tools.log 2>&1 || { cat update-tools.log; exit 1; };
 | 
			
		||||
      scripts/coverity-scan/run-coverity-scan --no-update-tools'
 | 
			
		||||
  rules:
 | 
			
		||||
    - if: '$COVERITY_TOKEN == null'
 | 
			
		||||
      when: never
 | 
			
		||||
    - if: '$COVERITY_EMAIL == null'
 | 
			
		||||
      when: never
 | 
			
		||||
    # Never included on upstream pipelines, except for schedules
 | 
			
		||||
    - if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_PIPELINE_SOURCE == "schedule"'
 | 
			
		||||
      when: on_success
 | 
			
		||||
    - if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM'
 | 
			
		||||
      when: never
 | 
			
		||||
    # Forks don't get any pipeline unless QEMU_CI=1 or QEMU_CI=2 is set
 | 
			
		||||
    - if: '$QEMU_CI != "1" && $QEMU_CI != "2"'
 | 
			
		||||
      when: never
 | 
			
		||||
    # Always manual on forks even if $QEMU_CI == "2"
 | 
			
		||||
    - when: manual
 | 
			
		||||
@@ -1,94 +0,0 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
#
 | 
			
		||||
# check-dco.py: validate all commits are signed off
 | 
			
		||||
#
 | 
			
		||||
# Copyright (C) 2020 Red Hat, Inc.
 | 
			
		||||
#
 | 
			
		||||
# SPDX-License-Identifier: GPL-2.0-or-later
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
import os.path
 | 
			
		||||
import sys
 | 
			
		||||
import subprocess
 | 
			
		||||
 | 
			
		||||
namespace = "qemu-project"
 | 
			
		||||
if len(sys.argv) >= 2:
 | 
			
		||||
    namespace = sys.argv[1]
 | 
			
		||||
 | 
			
		||||
cwd = os.getcwd()
 | 
			
		||||
reponame = os.path.basename(cwd)
 | 
			
		||||
repourl = "https://gitlab.com/%s/%s.git" % (namespace, reponame)
 | 
			
		||||
 | 
			
		||||
subprocess.check_call(["git", "remote", "add", "check-dco", repourl])
 | 
			
		||||
subprocess.check_call(["git", "fetch", "check-dco", "master"],
 | 
			
		||||
                      stdout=subprocess.DEVNULL,
 | 
			
		||||
                      stderr=subprocess.DEVNULL)
 | 
			
		||||
 | 
			
		||||
ancestor = subprocess.check_output(["git", "merge-base",
 | 
			
		||||
                                    "check-dco/master", "HEAD"],
 | 
			
		||||
                                   universal_newlines=True)
 | 
			
		||||
 | 
			
		||||
ancestor = ancestor.strip()
 | 
			
		||||
 | 
			
		||||
subprocess.check_call(["git", "remote", "rm", "check-dco"])
 | 
			
		||||
 | 
			
		||||
errors = False
 | 
			
		||||
 | 
			
		||||
print("\nChecking for 'Signed-off-by: NAME <EMAIL>' " +
 | 
			
		||||
      "on all commits since %s...\n" % ancestor)
 | 
			
		||||
 | 
			
		||||
log = subprocess.check_output(["git", "log", "--format=%H %s",
 | 
			
		||||
                               ancestor + "..."],
 | 
			
		||||
                              universal_newlines=True)
 | 
			
		||||
 | 
			
		||||
if log == "":
 | 
			
		||||
    commits = []
 | 
			
		||||
else:
 | 
			
		||||
    commits = [[c[0:40], c[41:]] for c in log.strip().split("\n")]
 | 
			
		||||
 | 
			
		||||
for sha, subject in commits:
 | 
			
		||||
 | 
			
		||||
    msg = subprocess.check_output(["git", "show", "-s", sha],
 | 
			
		||||
                                  universal_newlines=True)
 | 
			
		||||
    lines = msg.strip().split("\n")
 | 
			
		||||
 | 
			
		||||
    print("🔍 %s %s" % (sha, subject))
 | 
			
		||||
    sob = False
 | 
			
		||||
    for line in lines:
 | 
			
		||||
        if "Signed-off-by:" in line:
 | 
			
		||||
            sob = True
 | 
			
		||||
            if "localhost" in line:
 | 
			
		||||
                print("    ❌ FAIL: bad email in %s" % line)
 | 
			
		||||
                errors = True
 | 
			
		||||
 | 
			
		||||
    if not sob:
 | 
			
		||||
        print("    ❌ FAIL missing Signed-off-by tag")
 | 
			
		||||
        errors = True
 | 
			
		||||
 | 
			
		||||
if errors:
 | 
			
		||||
    print("""
 | 
			
		||||
 | 
			
		||||
❌ ERROR: One or more commits are missing a valid Signed-off-By tag.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
This project requires all contributors to assert that their contributions
 | 
			
		||||
are provided in compliance with the terms of the Developer's Certificate
 | 
			
		||||
of Origin 1.1 (DCO):
 | 
			
		||||
 | 
			
		||||
  https://developercertificate.org/
 | 
			
		||||
 | 
			
		||||
To indicate acceptance of the DCO every commit must have a tag
 | 
			
		||||
 | 
			
		||||
  Signed-off-by: REAL NAME <EMAIL>
 | 
			
		||||
 | 
			
		||||
This can be achieved by passing the "-s" flag to the "git commit" command.
 | 
			
		||||
 | 
			
		||||
To bulk update all commits on current branch "git rebase" can be used:
 | 
			
		||||
 | 
			
		||||
  git rebase -i master -x 'git commit --amend --no-edit -s'
 | 
			
		||||
 | 
			
		||||
""")
 | 
			
		||||
 | 
			
		||||
    sys.exit(1)
 | 
			
		||||
 | 
			
		||||
sys.exit(0)
 | 
			
		||||
@@ -1,56 +0,0 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
#
 | 
			
		||||
# check-patch.py: run checkpatch.pl across all commits in a branch
 | 
			
		||||
#
 | 
			
		||||
# Copyright (C) 2020 Red Hat, Inc.
 | 
			
		||||
#
 | 
			
		||||
# SPDX-License-Identifier: GPL-2.0-or-later
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
import os.path
 | 
			
		||||
import sys
 | 
			
		||||
import subprocess
 | 
			
		||||
 | 
			
		||||
namespace = "qemu-project"
 | 
			
		||||
if len(sys.argv) >= 2:
 | 
			
		||||
    namespace = sys.argv[1]
 | 
			
		||||
 | 
			
		||||
cwd = os.getcwd()
 | 
			
		||||
reponame = os.path.basename(cwd)
 | 
			
		||||
repourl = "https://gitlab.com/%s/%s.git" % (namespace, reponame)
 | 
			
		||||
 | 
			
		||||
# GitLab CI environment does not give us any direct info about the
 | 
			
		||||
# base for the user's branch. We thus need to figure out a common
 | 
			
		||||
# ancestor between the user's branch and current git master.
 | 
			
		||||
subprocess.check_call(["git", "remote", "add", "check-patch", repourl])
 | 
			
		||||
subprocess.check_call(["git", "fetch", "check-patch", "master"],
 | 
			
		||||
                      stdout=subprocess.DEVNULL,
 | 
			
		||||
                      stderr=subprocess.DEVNULL)
 | 
			
		||||
 | 
			
		||||
ancestor = subprocess.check_output(["git", "merge-base",
 | 
			
		||||
                                    "check-patch/master", "HEAD"],
 | 
			
		||||
                                   universal_newlines=True)
 | 
			
		||||
 | 
			
		||||
ancestor = ancestor.strip()
 | 
			
		||||
 | 
			
		||||
log = subprocess.check_output(["git", "log", "--format=%H %s",
 | 
			
		||||
                               ancestor + "..."],
 | 
			
		||||
                              universal_newlines=True)
 | 
			
		||||
 | 
			
		||||
subprocess.check_call(["git", "remote", "rm", "check-patch"])
 | 
			
		||||
 | 
			
		||||
if log == "":
 | 
			
		||||
    print("\nNo commits since %s, skipping checks\n" % ancestor)
 | 
			
		||||
    sys.exit(0)
 | 
			
		||||
 | 
			
		||||
errors = False
 | 
			
		||||
 | 
			
		||||
print("\nChecking all commits since %s...\n" % ancestor, flush=True)
 | 
			
		||||
 | 
			
		||||
ret = subprocess.run(["scripts/checkpatch.pl", "--terse", ancestor + "..."])
 | 
			
		||||
 | 
			
		||||
if ret.returncode != 0:
 | 
			
		||||
    print("    ❌ FAIL one or more commits failed scripts/checkpatch.pl")
 | 
			
		||||
    sys.exit(1)
 | 
			
		||||
 | 
			
		||||
sys.exit(0)
 | 
			
		||||
@@ -1,93 +0,0 @@
 | 
			
		||||
# Jobs that we delegate to Cirrus CI because they require an operating
 | 
			
		||||
# system other than Linux. These jobs will only run if the required
 | 
			
		||||
# setup has been performed on the GitLab account.
 | 
			
		||||
#
 | 
			
		||||
# The Cirrus CI configuration is generated by replacing target-specific
 | 
			
		||||
# variables in a generic template: some of these variables are provided
 | 
			
		||||
# when the GitLab CI job is defined, others are taken from a shell
 | 
			
		||||
# snippet generated using lcitool.
 | 
			
		||||
#
 | 
			
		||||
# Note that the $PATH environment variable has to be treated with
 | 
			
		||||
# special care, because we can't just override it at the GitLab CI job
 | 
			
		||||
# definition level or we risk breaking it completely.
 | 
			
		||||
.cirrus_build_job:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  stage: build
 | 
			
		||||
  image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:latest
 | 
			
		||||
  needs: []
 | 
			
		||||
  # 20 mins larger than "timeout_in" in cirrus/build.yml
 | 
			
		||||
  # as there's often a 5-10 minute delay before Cirrus CI
 | 
			
		||||
  # actually starts the task
 | 
			
		||||
  timeout: 80m
 | 
			
		||||
  script:
 | 
			
		||||
    - source .gitlab-ci.d/cirrus/$NAME.vars
 | 
			
		||||
    - sed -e "s|[@]CI_REPOSITORY_URL@|$CI_REPOSITORY_URL|g"
 | 
			
		||||
          -e "s|[@]CI_COMMIT_REF_NAME@|$CI_COMMIT_REF_NAME|g"
 | 
			
		||||
          -e "s|[@]CI_COMMIT_SHA@|$CI_COMMIT_SHA|g"
 | 
			
		||||
          -e "s|[@]CIRRUS_VM_INSTANCE_TYPE@|$CIRRUS_VM_INSTANCE_TYPE|g"
 | 
			
		||||
          -e "s|[@]CIRRUS_VM_IMAGE_SELECTOR@|$CIRRUS_VM_IMAGE_SELECTOR|g"
 | 
			
		||||
          -e "s|[@]CIRRUS_VM_IMAGE_NAME@|$CIRRUS_VM_IMAGE_NAME|g"
 | 
			
		||||
          -e "s|[@]CIRRUS_VM_CPUS@|$CIRRUS_VM_CPUS|g"
 | 
			
		||||
          -e "s|[@]CIRRUS_VM_RAM@|$CIRRUS_VM_RAM|g"
 | 
			
		||||
          -e "s|[@]UPDATE_COMMAND@|$UPDATE_COMMAND|g"
 | 
			
		||||
          -e "s|[@]INSTALL_COMMAND@|$INSTALL_COMMAND|g"
 | 
			
		||||
          -e "s|[@]PATH@|$PATH_EXTRA${PATH_EXTRA:+:}\$PATH|g"
 | 
			
		||||
          -e "s|[@]PKG_CONFIG_PATH@|$PKG_CONFIG_PATH|g"
 | 
			
		||||
          -e "s|[@]PKGS@|$PKGS|g"
 | 
			
		||||
          -e "s|[@]MAKE@|$MAKE|g"
 | 
			
		||||
          -e "s|[@]PYTHON@|$PYTHON|g"
 | 
			
		||||
          -e "s|[@]PIP3@|$PIP3|g"
 | 
			
		||||
          -e "s|[@]PYPI_PKGS@|$PYPI_PKGS|g"
 | 
			
		||||
          -e "s|[@]CONFIGURE_ARGS@|$CONFIGURE_ARGS|g"
 | 
			
		||||
          -e "s|[@]TEST_TARGETS@|$TEST_TARGETS|g"
 | 
			
		||||
      <.gitlab-ci.d/cirrus/build.yml >.gitlab-ci.d/cirrus/$NAME.yml
 | 
			
		||||
    - cat .gitlab-ci.d/cirrus/$NAME.yml
 | 
			
		||||
    - cirrus-run -v --show-build-log always .gitlab-ci.d/cirrus/$NAME.yml
 | 
			
		||||
  variables:
 | 
			
		||||
    QEMU_JOB_CIRRUS: 1
 | 
			
		||||
 | 
			
		||||
x64-freebsd-13-build:
 | 
			
		||||
  extends: .cirrus_build_job
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: freebsd-13
 | 
			
		||||
    CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
 | 
			
		||||
    CIRRUS_VM_IMAGE_SELECTOR: image_family
 | 
			
		||||
    CIRRUS_VM_IMAGE_NAME: freebsd-13-3
 | 
			
		||||
    CIRRUS_VM_CPUS: 8
 | 
			
		||||
    CIRRUS_VM_RAM: 8G
 | 
			
		||||
    UPDATE_COMMAND: pkg update; pkg upgrade -y
 | 
			
		||||
    INSTALL_COMMAND: pkg install -y
 | 
			
		||||
    CONFIGURE_ARGS: --target-list-exclude=arm-softmmu,i386-softmmu,microblaze-softmmu,mips64el-softmmu,mipsel-softmmu,mips-softmmu,ppc-softmmu,sh4eb-softmmu,xtensa-softmmu
 | 
			
		||||
    TEST_TARGETS: check
 | 
			
		||||
 | 
			
		||||
aarch64-macos-13-base-build:
 | 
			
		||||
  extends: .cirrus_build_job
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: macos-13
 | 
			
		||||
    CIRRUS_VM_INSTANCE_TYPE: macos_instance
 | 
			
		||||
    CIRRUS_VM_IMAGE_SELECTOR: image
 | 
			
		||||
    CIRRUS_VM_IMAGE_NAME: ghcr.io/cirruslabs/macos-ventura-base:latest
 | 
			
		||||
    CIRRUS_VM_CPUS: 12
 | 
			
		||||
    CIRRUS_VM_RAM: 24G
 | 
			
		||||
    UPDATE_COMMAND: brew update
 | 
			
		||||
    INSTALL_COMMAND: brew install
 | 
			
		||||
    PATH_EXTRA: /opt/homebrew/ccache/libexec:/opt/homebrew/gettext/bin
 | 
			
		||||
    PKG_CONFIG_PATH: /opt/homebrew/curl/lib/pkgconfig:/opt/homebrew/ncurses/lib/pkgconfig:/opt/homebrew/readline/lib/pkgconfig
 | 
			
		||||
    CONFIGURE_ARGS: --target-list-exclude=arm-softmmu,i386-softmmu,microblazeel-softmmu,mips64-softmmu,mipsel-softmmu,mips-softmmu,ppc-softmmu,sh4-softmmu,xtensaeb-softmmu
 | 
			
		||||
    TEST_TARGETS: check-unit check-block check-qapi-schema check-softfloat check-qtest-x86_64
 | 
			
		||||
 | 
			
		||||
aarch64-macos-14-base-build:
 | 
			
		||||
  extends: .cirrus_build_job
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: macos-14
 | 
			
		||||
    CIRRUS_VM_INSTANCE_TYPE: macos_instance
 | 
			
		||||
    CIRRUS_VM_IMAGE_SELECTOR: image
 | 
			
		||||
    CIRRUS_VM_IMAGE_NAME: ghcr.io/cirruslabs/macos-sonoma-base:latest
 | 
			
		||||
    CIRRUS_VM_CPUS: 12
 | 
			
		||||
    CIRRUS_VM_RAM: 24G
 | 
			
		||||
    UPDATE_COMMAND: brew update
 | 
			
		||||
    INSTALL_COMMAND: brew install
 | 
			
		||||
    PATH_EXTRA: /opt/homebrew/ccache/libexec:/opt/homebrew/gettext/bin
 | 
			
		||||
    PKG_CONFIG_PATH: /opt/homebrew/curl/lib/pkgconfig:/opt/homebrew/ncurses/lib/pkgconfig:/opt/homebrew/readline/lib/pkgconfig
 | 
			
		||||
    TEST_TARGETS: check-unit check-block check-qapi-schema check-softfloat check-qtest-x86_64
 | 
			
		||||
    QEMU_JOB_OPTIONAL: 1
 | 
			
		||||
@@ -1,54 +0,0 @@
 | 
			
		||||
Cirrus CI integration
 | 
			
		||||
=====================
 | 
			
		||||
 | 
			
		||||
GitLab CI shared runners only provide a docker environment running on Linux.
 | 
			
		||||
While it is possible to provide private runners for non-Linux platforms this
 | 
			
		||||
is not something most contributors/maintainers will wish to do.
 | 
			
		||||
 | 
			
		||||
To work around this limitation, we take advantage of `Cirrus CI`_'s free
 | 
			
		||||
offering: more specifically, we use the `cirrus-run`_ script to trigger Cirrus
 | 
			
		||||
CI jobs from GitLab CI jobs so that Cirrus CI job output is integrated into
 | 
			
		||||
the main GitLab CI pipeline dashboard.
 | 
			
		||||
 | 
			
		||||
There is, however, some one-time setup required. If you want FreeBSD and macOS
 | 
			
		||||
builds to happen when you push to your GitLab repository, you need to
 | 
			
		||||
 | 
			
		||||
* set up a GitHub repository for the project, eg. ``yourusername/qemu``.
 | 
			
		||||
  This repository needs to exist for cirrus-run to work, but it doesn't need to
 | 
			
		||||
  be kept up to date, so you can create it and then forget about it;
 | 
			
		||||
 | 
			
		||||
* enable the `Cirrus CI GitHub app`_  for your GitHub account;
 | 
			
		||||
 | 
			
		||||
* sign up for Cirrus CI. It's enough to log into the website using your GitHub
 | 
			
		||||
  account;
 | 
			
		||||
 | 
			
		||||
* grab an API token from the `Cirrus CI settings`_ page;
 | 
			
		||||
 | 
			
		||||
* it may be necessary to push an empty ``.cirrus.yml`` file to your github fork
 | 
			
		||||
  for Cirrus CI to properly recognize the project. You can check whether
 | 
			
		||||
  Cirrus CI knows about your project by navigating to:
 | 
			
		||||
 | 
			
		||||
  ``https://cirrus-ci.com/yourusername/qemu``
 | 
			
		||||
 | 
			
		||||
* in the *CI/CD / Variables* section of the settings page for your GitLab
 | 
			
		||||
  repository, create two new variables:
 | 
			
		||||
 | 
			
		||||
  * ``CIRRUS_GITHUB_REPO``, containing the name of the GitHub repository
 | 
			
		||||
    created earlier, eg. ``yourusername/qemu``;
 | 
			
		||||
 | 
			
		||||
  * ``CIRRUS_API_TOKEN``, containing the Cirrus CI API token generated earlier.
 | 
			
		||||
    This variable **must** be marked as *Masked*, because anyone with knowledge
 | 
			
		||||
    of it can impersonate you as far as Cirrus CI is concerned.
 | 
			
		||||
 | 
			
		||||
  Neither of these variables should be marked as *Protected*, because in
 | 
			
		||||
  general you'll want to be able to trigger Cirrus CI builds from non-protected
 | 
			
		||||
  branches.
 | 
			
		||||
 | 
			
		||||
Once this one-time setup is complete, you can just keep pushing to your GitLab
 | 
			
		||||
repository as usual and you'll automatically get the additional CI coverage.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.. _Cirrus CI GitHub app: https://github.com/marketplace/cirrus-ci
 | 
			
		||||
.. _Cirrus CI settings: https://cirrus-ci.com/settings/profile/
 | 
			
		||||
.. _Cirrus CI: https://cirrus-ci.com/
 | 
			
		||||
.. _cirrus-run: https://github.com/sio/cirrus-run/
 | 
			
		||||
@@ -1,42 +0,0 @@
 | 
			
		||||
@CIRRUS_VM_INSTANCE_TYPE@:
 | 
			
		||||
  @CIRRUS_VM_IMAGE_SELECTOR@: @CIRRUS_VM_IMAGE_NAME@
 | 
			
		||||
  cpu: @CIRRUS_VM_CPUS@
 | 
			
		||||
  memory: @CIRRUS_VM_RAM@
 | 
			
		||||
 | 
			
		||||
env:
 | 
			
		||||
  CIRRUS_CLONE_DEPTH: 1
 | 
			
		||||
  CI_REPOSITORY_URL: "@CI_REPOSITORY_URL@"
 | 
			
		||||
  CI_COMMIT_REF_NAME: "@CI_COMMIT_REF_NAME@"
 | 
			
		||||
  CI_COMMIT_SHA: "@CI_COMMIT_SHA@"
 | 
			
		||||
  PATH: "@PATH@"
 | 
			
		||||
  PKG_CONFIG_PATH: "@PKG_CONFIG_PATH@"
 | 
			
		||||
  PYTHON: "@PYTHON@"
 | 
			
		||||
  MAKE: "@MAKE@"
 | 
			
		||||
  CONFIGURE_ARGS: "@CONFIGURE_ARGS@"
 | 
			
		||||
  TEST_TARGETS: "@TEST_TARGETS@"
 | 
			
		||||
 | 
			
		||||
build_task:
 | 
			
		||||
  # A little shorter than GitLab timeout in ../cirrus.yml
 | 
			
		||||
  timeout_in: 60m
 | 
			
		||||
  install_script:
 | 
			
		||||
    - @UPDATE_COMMAND@
 | 
			
		||||
    - @INSTALL_COMMAND@ @PKGS@
 | 
			
		||||
    - if test -n "@PYPI_PKGS@" ; then PYLIB=$(@PYTHON@ -c 'import sysconfig; print(sysconfig.get_path("stdlib"))'); rm -f $PYLIB/EXTERNALLY-MANAGED; @PIP3@ install @PYPI_PKGS@ ; fi
 | 
			
		||||
  clone_script:
 | 
			
		||||
    - git clone --depth 100 "$CI_REPOSITORY_URL" .
 | 
			
		||||
    - git fetch origin "$CI_COMMIT_REF_NAME"
 | 
			
		||||
    - git reset --hard "$CI_COMMIT_SHA"
 | 
			
		||||
  build_script:
 | 
			
		||||
    - mkdir build
 | 
			
		||||
    - cd build
 | 
			
		||||
    - ../configure --enable-werror $CONFIGURE_ARGS
 | 
			
		||||
      || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
    - $MAKE -j$(sysctl -n hw.ncpu)
 | 
			
		||||
    - for TARGET in $TEST_TARGETS ;
 | 
			
		||||
      do
 | 
			
		||||
        $MAKE -j$(sysctl -n hw.ncpu) $TARGET V=1 ;
 | 
			
		||||
      done
 | 
			
		||||
  always:
 | 
			
		||||
    build_result_artifacts:
 | 
			
		||||
      path: build/meson-logs/*log.txt
 | 
			
		||||
      type: text/plain
 | 
			
		||||
@@ -1,16 +0,0 @@
 | 
			
		||||
# THIS FILE WAS AUTO-GENERATED
 | 
			
		||||
#
 | 
			
		||||
#  $ lcitool variables freebsd-13 qemu
 | 
			
		||||
#
 | 
			
		||||
# https://gitlab.com/libvirt/libvirt-ci
 | 
			
		||||
 | 
			
		||||
CCACHE='/usr/local/bin/ccache'
 | 
			
		||||
CPAN_PKGS=''
 | 
			
		||||
CROSS_PKGS=''
 | 
			
		||||
MAKE='/usr/local/bin/gmake'
 | 
			
		||||
NINJA='/usr/local/bin/ninja'
 | 
			
		||||
PACKAGING_COMMAND='pkg'
 | 
			
		||||
PIP3='/usr/local/bin/pip-3.8'
 | 
			
		||||
PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cmocka ctags curl cyrus-sasl dbus diffutils dtc flex fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 json-c libepoxy libffi libgcrypt libjpeg-turbo libnfs libslirp libspice-server libssh libtasn1 llvm lzo2 meson mtools ncurses nettle ninja opencv pixman pkgconf png py39-numpy py39-pillow py39-pip py39-sphinx py39-sphinx_rtd_theme py39-tomli py39-yaml python3 rpm2cpio sdl2 sdl2_image snappy sndio socat spice-protocol tesseract usbredir virglrenderer vte3 xorriso zstd'
 | 
			
		||||
PYPI_PKGS=''
 | 
			
		||||
PYTHON='/usr/local/bin/python3'
 | 
			
		||||
@@ -1,16 +0,0 @@
 | 
			
		||||
# THIS FILE WAS AUTO-GENERATED
 | 
			
		||||
#
 | 
			
		||||
#  $ lcitool variables macos-13 qemu
 | 
			
		||||
#
 | 
			
		||||
# https://gitlab.com/libvirt/libvirt-ci
 | 
			
		||||
 | 
			
		||||
CCACHE='/opt/homebrew/bin/ccache'
 | 
			
		||||
CPAN_PKGS=''
 | 
			
		||||
CROSS_PKGS=''
 | 
			
		||||
MAKE='/opt/homebrew/bin/gmake'
 | 
			
		||||
NINJA='/opt/homebrew/bin/ninja'
 | 
			
		||||
PACKAGING_COMMAND='brew'
 | 
			
		||||
PIP3='/opt/homebrew/bin/pip3'
 | 
			
		||||
PKGS='bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson mtools ncurses nettle ninja pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy socat sparse spice-protocol swtpm tesseract usbredir vde vte3 xorriso zlib zstd'
 | 
			
		||||
PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme tomli'
 | 
			
		||||
PYTHON='/opt/homebrew/bin/python3'
 | 
			
		||||
@@ -1,16 +0,0 @@
 | 
			
		||||
# THIS FILE WAS AUTO-GENERATED
 | 
			
		||||
#
 | 
			
		||||
#  $ lcitool variables macos-14 qemu
 | 
			
		||||
#
 | 
			
		||||
# https://gitlab.com/libvirt/libvirt-ci
 | 
			
		||||
 | 
			
		||||
CCACHE='/opt/homebrew/bin/ccache'
 | 
			
		||||
CPAN_PKGS=''
 | 
			
		||||
CROSS_PKGS=''
 | 
			
		||||
MAKE='/opt/homebrew/bin/gmake'
 | 
			
		||||
NINJA='/opt/homebrew/bin/ninja'
 | 
			
		||||
PACKAGING_COMMAND='brew'
 | 
			
		||||
PIP3='/opt/homebrew/bin/pip3'
 | 
			
		||||
PKGS='bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson mtools ncurses nettle ninja pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy socat sparse spice-protocol swtpm tesseract usbredir vde vte3 xorriso zlib zstd'
 | 
			
		||||
PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme tomli'
 | 
			
		||||
PYTHON='/opt/homebrew/bin/python3'
 | 
			
		||||
@@ -1,12 +0,0 @@
 | 
			
		||||
include:
 | 
			
		||||
  - local: '/.gitlab-ci.d/container-template.yml'
 | 
			
		||||
 | 
			
		||||
amd64-centos9-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: centos9
 | 
			
		||||
 | 
			
		||||
amd64-fedora-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: fedora
 | 
			
		||||
@@ -1,107 +0,0 @@
 | 
			
		||||
amd64-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-amd64-cross
 | 
			
		||||
 | 
			
		||||
amd64-debian-user-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-all-test-cross
 | 
			
		||||
 | 
			
		||||
amd64-debian-legacy-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-legacy-test-cross
 | 
			
		||||
 | 
			
		||||
arm64-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-arm64-cross
 | 
			
		||||
 | 
			
		||||
armel-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-armel-cross
 | 
			
		||||
 | 
			
		||||
armhf-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-armhf-cross
 | 
			
		||||
 | 
			
		||||
hexagon-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-hexagon-cross
 | 
			
		||||
 | 
			
		||||
loongarch-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-loongarch-cross
 | 
			
		||||
 | 
			
		||||
i686-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-i686-cross
 | 
			
		||||
 | 
			
		||||
mips64el-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-mips64el-cross
 | 
			
		||||
 | 
			
		||||
mipsel-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-mipsel-cross
 | 
			
		||||
 | 
			
		||||
ppc64el-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-ppc64el-cross
 | 
			
		||||
 | 
			
		||||
riscv64-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  # as we are currently based on 'sid/unstable' we may break so...
 | 
			
		||||
  allow_failure: true
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-riscv64-cross
 | 
			
		||||
    QEMU_JOB_OPTIONAL: 1
 | 
			
		||||
 | 
			
		||||
s390x-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-s390x-cross
 | 
			
		||||
 | 
			
		||||
tricore-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-tricore-cross
 | 
			
		||||
 | 
			
		||||
xtensa-debian-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian-xtensa-cross
 | 
			
		||||
 | 
			
		||||
cris-fedora-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: fedora-cris-cross
 | 
			
		||||
 | 
			
		||||
win64-fedora-cross-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: fedora-win64-cross
 | 
			
		||||
@@ -1,21 +0,0 @@
 | 
			
		||||
.container_job_template:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  image: docker:latest
 | 
			
		||||
  stage: containers
 | 
			
		||||
  services:
 | 
			
		||||
    - docker:dind
 | 
			
		||||
  before_script:
 | 
			
		||||
    - export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:$QEMU_CI_CONTAINER_TAG"
 | 
			
		||||
    # Always ':latest' because we always use upstream as a common cache source
 | 
			
		||||
    - export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/qemu/$NAME:latest"
 | 
			
		||||
    - docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
 | 
			
		||||
    - until docker info; do sleep 1; done
 | 
			
		||||
  script:
 | 
			
		||||
    - echo "TAG:$TAG"
 | 
			
		||||
    - echo "COMMON_TAG:$COMMON_TAG"
 | 
			
		||||
    - docker build --tag "$TAG" --cache-from "$TAG" --cache-from "$COMMON_TAG"
 | 
			
		||||
      --build-arg BUILDKIT_INLINE_CACHE=1
 | 
			
		||||
      -f "tests/docker/dockerfiles/$NAME.docker" "."
 | 
			
		||||
    - docker push "$TAG"
 | 
			
		||||
  after_script:
 | 
			
		||||
    - docker logout
 | 
			
		||||
@@ -1,29 +0,0 @@
 | 
			
		||||
include:
 | 
			
		||||
  - local: '/.gitlab-ci.d/container-core.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/container-cross.yml'
 | 
			
		||||
 | 
			
		||||
amd64-alpine-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: alpine
 | 
			
		||||
 | 
			
		||||
amd64-debian-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  stage: containers
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: debian
 | 
			
		||||
 | 
			
		||||
amd64-ubuntu2204-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: ubuntu2204
 | 
			
		||||
 | 
			
		||||
amd64-opensuse-leap-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: opensuse-leap
 | 
			
		||||
 | 
			
		||||
python-container:
 | 
			
		||||
  extends: .container_job_template
 | 
			
		||||
  variables:
 | 
			
		||||
    NAME: python
 | 
			
		||||
@@ -1,89 +0,0 @@
 | 
			
		||||
.cross_system_build_job:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  stage: build
 | 
			
		||||
  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
 | 
			
		||||
  cache:
 | 
			
		||||
    paths:
 | 
			
		||||
      - ccache
 | 
			
		||||
    key: "$CI_JOB_NAME"
 | 
			
		||||
    when: always
 | 
			
		||||
  timeout: 80m
 | 
			
		||||
  script:
 | 
			
		||||
    - export CCACHE_BASEDIR="$(pwd)"
 | 
			
		||||
    - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
 | 
			
		||||
    - export CCACHE_MAXSIZE="500M"
 | 
			
		||||
    - export PATH="$CCACHE_WRAPPERSDIR:$PATH"
 | 
			
		||||
    - mkdir build
 | 
			
		||||
    - cd build
 | 
			
		||||
    - ccache --zero-stats
 | 
			
		||||
    - ../configure --enable-werror --disable-docs --enable-fdt=system
 | 
			
		||||
        --disable-user $QEMU_CONFIGURE_OPTS $EXTRA_CONFIGURE_OPTS
 | 
			
		||||
        --target-list-exclude="arm-softmmu cris-softmmu
 | 
			
		||||
          i386-softmmu microblaze-softmmu mips-softmmu mipsel-softmmu
 | 
			
		||||
          mips64-softmmu ppc-softmmu riscv32-softmmu sh4-softmmu
 | 
			
		||||
          sparc-softmmu xtensa-softmmu $CROSS_SKIP_TARGETS"
 | 
			
		||||
    - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
 | 
			
		||||
    - if grep -q "EXESUF=.exe" config-host.mak;
 | 
			
		||||
      then make installer;
 | 
			
		||||
      version="$(git describe --match v[0-9]* 2>/dev/null || git rev-parse --short HEAD)";
 | 
			
		||||
      mv -v qemu-setup*.exe qemu-setup-${version}.exe;
 | 
			
		||||
      fi
 | 
			
		||||
    - ccache --show-stats
 | 
			
		||||
 | 
			
		||||
# Job to cross-build specific accelerators.
 | 
			
		||||
#
 | 
			
		||||
# Set the $ACCEL variable to select the specific accelerator (default to
 | 
			
		||||
# KVM), and set extra options (such disabling other accelerators) via the
 | 
			
		||||
# $EXTRA_CONFIGURE_OPTS variable.
 | 
			
		||||
.cross_accel_build_job:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  stage: build
 | 
			
		||||
  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
 | 
			
		||||
  timeout: 30m
 | 
			
		||||
  cache:
 | 
			
		||||
    paths:
 | 
			
		||||
      - ccache/
 | 
			
		||||
    key: "$CI_JOB_NAME"
 | 
			
		||||
  script:
 | 
			
		||||
    - export CCACHE_BASEDIR="$(pwd)"
 | 
			
		||||
    - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
 | 
			
		||||
    - export CCACHE_MAXSIZE="500M"
 | 
			
		||||
    - export PATH="$CCACHE_WRAPPERSDIR:$PATH"
 | 
			
		||||
    - mkdir build
 | 
			
		||||
    - cd build
 | 
			
		||||
    - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS
 | 
			
		||||
        --disable-tools --enable-${ACCEL:-kvm} $EXTRA_CONFIGURE_OPTS
 | 
			
		||||
    - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
 | 
			
		||||
 | 
			
		||||
.cross_user_build_job:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  stage: build
 | 
			
		||||
  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
 | 
			
		||||
  cache:
 | 
			
		||||
    paths:
 | 
			
		||||
      - ccache/
 | 
			
		||||
    key: "$CI_JOB_NAME"
 | 
			
		||||
  script:
 | 
			
		||||
    - export CCACHE_BASEDIR="$(pwd)"
 | 
			
		||||
    - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
 | 
			
		||||
    - export CCACHE_MAXSIZE="500M"
 | 
			
		||||
    - mkdir build
 | 
			
		||||
    - cd build
 | 
			
		||||
    - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS
 | 
			
		||||
        --disable-system --target-list-exclude="aarch64_be-linux-user
 | 
			
		||||
          alpha-linux-user cris-linux-user m68k-linux-user microblazeel-linux-user
 | 
			
		||||
          or1k-linux-user ppc-linux-user sparc-linux-user
 | 
			
		||||
          xtensa-linux-user $CROSS_SKIP_TARGETS"
 | 
			
		||||
    - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
 | 
			
		||||
 | 
			
		||||
# We can still run some tests on some of our cross build jobs. They can add this
 | 
			
		||||
# template to their extends to save the build logs and test results
 | 
			
		||||
.cross_test_artifacts:
 | 
			
		||||
  artifacts:
 | 
			
		||||
    name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
 | 
			
		||||
    when: always
 | 
			
		||||
    expire_in: 7 days
 | 
			
		||||
    paths:
 | 
			
		||||
      - build/meson-logs/testlog.txt
 | 
			
		||||
    reports:
 | 
			
		||||
      junit: build/meson-logs/testlog.junit.xml
 | 
			
		||||
@@ -1,205 +0,0 @@
 | 
			
		||||
include:
 | 
			
		||||
  - local: '/.gitlab-ci.d/crossbuild-template.yml'
 | 
			
		||||
 | 
			
		||||
cross-armel-user:
 | 
			
		||||
  extends: .cross_user_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: armel-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-armel-cross
 | 
			
		||||
 | 
			
		||||
cross-armhf-user:
 | 
			
		||||
  extends: .cross_user_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: armhf-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-armhf-cross
 | 
			
		||||
 | 
			
		||||
cross-arm64-system:
 | 
			
		||||
  extends: .cross_system_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: arm64-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-arm64-cross
 | 
			
		||||
 | 
			
		||||
cross-arm64-user:
 | 
			
		||||
  extends: .cross_user_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: arm64-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-arm64-cross
 | 
			
		||||
 | 
			
		||||
cross-arm64-kvm-only:
 | 
			
		||||
  extends: .cross_accel_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: arm64-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-arm64-cross
 | 
			
		||||
    EXTRA_CONFIGURE_OPTS: --disable-tcg --without-default-features
 | 
			
		||||
 | 
			
		||||
cross-i686-system:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .cross_system_build_job
 | 
			
		||||
    - .cross_test_artifacts
 | 
			
		||||
  needs:
 | 
			
		||||
    job: i686-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-i686-cross
 | 
			
		||||
    EXTRA_CONFIGURE_OPTS: --disable-kvm
 | 
			
		||||
    MAKE_CHECK_ARGS: check-qtest
 | 
			
		||||
 | 
			
		||||
cross-i686-user:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .cross_user_build_job
 | 
			
		||||
    - .cross_test_artifacts
 | 
			
		||||
  needs:
 | 
			
		||||
    job: i686-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-i686-cross
 | 
			
		||||
    MAKE_CHECK_ARGS: check
 | 
			
		||||
 | 
			
		||||
cross-i686-tci:
 | 
			
		||||
  extends:
 | 
			
		||||
    - .cross_accel_build_job
 | 
			
		||||
    - .cross_test_artifacts
 | 
			
		||||
  timeout: 60m
 | 
			
		||||
  needs:
 | 
			
		||||
    job: i686-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-i686-cross
 | 
			
		||||
    ACCEL: tcg-interpreter
 | 
			
		||||
    EXTRA_CONFIGURE_OPTS: --target-list=i386-softmmu,i386-linux-user,aarch64-softmmu,aarch64-linux-user,ppc-softmmu,ppc-linux-user --disable-plugins --disable-kvm
 | 
			
		||||
    MAKE_CHECK_ARGS: check check-tcg
 | 
			
		||||
 | 
			
		||||
cross-mipsel-system:
 | 
			
		||||
  extends: .cross_system_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: mipsel-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-mipsel-cross
 | 
			
		||||
 | 
			
		||||
cross-mipsel-user:
 | 
			
		||||
  extends: .cross_user_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: mipsel-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-mipsel-cross
 | 
			
		||||
 | 
			
		||||
cross-mips64el-system:
 | 
			
		||||
  extends: .cross_system_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: mips64el-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-mips64el-cross
 | 
			
		||||
 | 
			
		||||
cross-mips64el-user:
 | 
			
		||||
  extends: .cross_user_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: mips64el-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-mips64el-cross
 | 
			
		||||
 | 
			
		||||
cross-ppc64el-system:
 | 
			
		||||
  extends: .cross_system_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: ppc64el-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-ppc64el-cross
 | 
			
		||||
 | 
			
		||||
cross-ppc64el-user:
 | 
			
		||||
  extends: .cross_user_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: ppc64el-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-ppc64el-cross
 | 
			
		||||
 | 
			
		||||
cross-ppc64el-kvm-only:
 | 
			
		||||
  extends: .cross_accel_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: ppc64el-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-ppc64el-cross
 | 
			
		||||
    EXTRA_CONFIGURE_OPTS: --disable-tcg --without-default-devices
 | 
			
		||||
 | 
			
		||||
# The riscv64 cross-builds currently use a 'sid' container to get
 | 
			
		||||
# compilers and libraries. Until something more stable is found we
 | 
			
		||||
# allow_failure so as not to block CI.
 | 
			
		||||
cross-riscv64-system:
 | 
			
		||||
  extends: .cross_system_build_job
 | 
			
		||||
  allow_failure: true
 | 
			
		||||
  needs:
 | 
			
		||||
    job: riscv64-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-riscv64-cross
 | 
			
		||||
 | 
			
		||||
cross-riscv64-user:
 | 
			
		||||
  extends: .cross_user_build_job
 | 
			
		||||
  allow_failure: true
 | 
			
		||||
  needs:
 | 
			
		||||
    job: riscv64-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-riscv64-cross
 | 
			
		||||
 | 
			
		||||
cross-s390x-system:
 | 
			
		||||
  extends: .cross_system_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: s390x-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-s390x-cross
 | 
			
		||||
 | 
			
		||||
cross-s390x-user:
 | 
			
		||||
  extends: .cross_user_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: s390x-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-s390x-cross
 | 
			
		||||
 | 
			
		||||
cross-s390x-kvm-only:
 | 
			
		||||
  extends: .cross_accel_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: s390x-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-s390x-cross
 | 
			
		||||
    EXTRA_CONFIGURE_OPTS: --disable-tcg --enable-trace-backends=ftrace
 | 
			
		||||
 | 
			
		||||
cross-mips64el-kvm-only:
 | 
			
		||||
  extends: .cross_accel_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: mips64el-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-mips64el-cross
 | 
			
		||||
    EXTRA_CONFIGURE_OPTS: --disable-tcg --target-list=mips64el-softmmu
 | 
			
		||||
 | 
			
		||||
cross-win64-system:
 | 
			
		||||
  extends: .cross_system_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: win64-fedora-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: fedora-win64-cross
 | 
			
		||||
    EXTRA_CONFIGURE_OPTS: --enable-fdt=internal --disable-plugins
 | 
			
		||||
    CROSS_SKIP_TARGETS: alpha-softmmu avr-softmmu hppa-softmmu
 | 
			
		||||
                        m68k-softmmu microblazeel-softmmu
 | 
			
		||||
                        or1k-softmmu rx-softmmu sh4eb-softmmu sparc64-softmmu
 | 
			
		||||
                        tricore-softmmu xtensaeb-softmmu
 | 
			
		||||
  artifacts:
 | 
			
		||||
    when: on_success
 | 
			
		||||
    paths:
 | 
			
		||||
      - build/qemu-setup*.exe
 | 
			
		||||
 | 
			
		||||
cross-amd64-xen-only:
 | 
			
		||||
  extends: .cross_accel_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: amd64-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-amd64-cross
 | 
			
		||||
    ACCEL: xen
 | 
			
		||||
    EXTRA_CONFIGURE_OPTS: --disable-tcg --disable-kvm
 | 
			
		||||
 | 
			
		||||
cross-arm64-xen-only:
 | 
			
		||||
  extends: .cross_accel_build_job
 | 
			
		||||
  needs:
 | 
			
		||||
    job: arm64-debian-cross-container
 | 
			
		||||
  variables:
 | 
			
		||||
    IMAGE: debian-arm64-cross
 | 
			
		||||
    ACCEL: xen
 | 
			
		||||
    EXTRA_CONFIGURE_OPTS: --disable-tcg --disable-kvm
 | 
			
		||||
@@ -1,34 +0,0 @@
 | 
			
		||||
# The CI jobs defined here require GitLab runners installed and
 | 
			
		||||
# registered on machines that match their operating system names,
 | 
			
		||||
# versions and architectures.  This is in contrast to the other CI
 | 
			
		||||
# jobs that are intended to run on GitLab's "shared" runners.
 | 
			
		||||
 | 
			
		||||
# Different than the default approach on "shared" runners, based on
 | 
			
		||||
# containers, the custom runners have no such *requirement*, as those
 | 
			
		||||
# jobs should be capable of running on operating systems with no
 | 
			
		||||
# compatible container implementation, or no support from
 | 
			
		||||
# gitlab-runner.  To avoid problems that gitlab-runner can cause while
 | 
			
		||||
# reusing the GIT repository, let's enable the clone strategy, which
 | 
			
		||||
# guarantees a fresh repository on each job run.
 | 
			
		||||
 | 
			
		||||
# All custom runners can extend this template to upload the testlog
 | 
			
		||||
# data as an artifact and also feed the junit report
 | 
			
		||||
.custom_runner_template:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  variables:
 | 
			
		||||
    GIT_STRATEGY: clone
 | 
			
		||||
    GIT_FETCH_EXTRA_FLAGS: --no-tags --prune --quiet
 | 
			
		||||
  artifacts:
 | 
			
		||||
    name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
 | 
			
		||||
    expire_in: 7 days
 | 
			
		||||
    when: always
 | 
			
		||||
    paths:
 | 
			
		||||
      - build/build.ninja
 | 
			
		||||
      - build/meson-logs
 | 
			
		||||
    reports:
 | 
			
		||||
      junit: build/meson-logs/testlog.junit.xml
 | 
			
		||||
 | 
			
		||||
include:
 | 
			
		||||
  - local: '/.gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch32.yml'
 | 
			
		||||
@@ -1,25 +0,0 @@
 | 
			
		||||
# All ubuntu-22.04 jobs should run successfully in an environment
 | 
			
		||||
# setup by the scripts/ci/setup/ubuntu/build-environment.yml task
 | 
			
		||||
# "Install basic packages to build QEMU on Ubuntu 22.04"
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-aarch32-all:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - aarch32
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 - if: "$AARCH32_RUNNER_AVAILABLE"
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --cross-prefix=arm-linux-gnueabihf-
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40`
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40` check
 | 
			
		||||
@@ -1,151 +0,0 @@
 | 
			
		||||
# All ubuntu-22.04 jobs should run successfully in an environment
 | 
			
		||||
# setup by the scripts/ci/setup/ubuntu/build-environment.yml task
 | 
			
		||||
# "Install basic packages to build QEMU on Ubuntu 22.04"
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-aarch64-all-linux-static:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - aarch64
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
 - if: "$AARCH64_RUNNER_AVAILABLE"
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 # Disable -static-pie due to build error with system libc:
 | 
			
		||||
 # https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1987438
 | 
			
		||||
 - ../configure --enable-debug --static --disable-system --disable-pie
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40`
 | 
			
		||||
 - make check-tcg
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40` check
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-aarch64-all:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - aarch64
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 - if: "$AARCH64_RUNNER_AVAILABLE"
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40`
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40` check
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-aarch64-without-defaults:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - aarch64
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 - if: "$AARCH64_RUNNER_AVAILABLE"
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --disable-user --without-default-devices --without-default-features
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40`
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40` check
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-aarch64-alldbg:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - aarch64
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
 - if: "$AARCH64_RUNNER_AVAILABLE"
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --enable-debug
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make clean
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40`
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40` check
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-aarch64-clang:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - aarch64
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 - if: "$AARCH64_RUNNER_AVAILABLE"
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --disable-libssh --cc=clang --cxx=clang++ --enable-sanitizers
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40`
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40` check
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-aarch64-tci:
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - aarch64
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 - if: "$AARCH64_RUNNER_AVAILABLE"
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --enable-tcg-interpreter
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40`
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-aarch64-notcg:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - aarch64
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 - if: "$AARCH64_RUNNER_AVAILABLE"
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --disable-tcg --with-devices-aarch64=minimal
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40`
 | 
			
		||||
 - make --output-sync -j`nproc --ignore=40` check
 | 
			
		||||
@@ -1,128 +0,0 @@
 | 
			
		||||
# All ubuntu-22.04 jobs should run successfully in an environment
 | 
			
		||||
# setup by the scripts/ci/setup/ubuntu/build-environment.yml task
 | 
			
		||||
# "Install basic packages to build QEMU on Ubuntu 22.04"
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-s390x-all-linux:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - s390x
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
 - if: "$S390X_RUNNER_AVAILABLE"
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --enable-debug --disable-system --disable-tools --disable-docs
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc`
 | 
			
		||||
 - make --output-sync check-tcg
 | 
			
		||||
 - make --output-sync -j`nproc` check
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-s390x-all-system:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - s390x
 | 
			
		||||
 timeout: 75m
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
 - if: "$S390X_RUNNER_AVAILABLE"
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --disable-user
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc`
 | 
			
		||||
 - make --output-sync -j`nproc` check
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-s390x-alldbg:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - s390x
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 - if: "$S390X_RUNNER_AVAILABLE"
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --enable-debug
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make clean
 | 
			
		||||
 - make --output-sync -j`nproc`
 | 
			
		||||
 - make --output-sync -j`nproc` check
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-s390x-clang:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - s390x
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 - if: "$S390X_RUNNER_AVAILABLE"
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --cc=clang --cxx=clang++ --enable-sanitizers
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc`
 | 
			
		||||
 - make --output-sync -j`nproc` check
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-s390x-tci:
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - s390x
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 - if: "$S390X_RUNNER_AVAILABLE"
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --enable-tcg-interpreter
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc`
 | 
			
		||||
 | 
			
		||||
ubuntu-22.04-s390x-notcg:
 | 
			
		||||
 extends: .custom_runner_template
 | 
			
		||||
 needs: []
 | 
			
		||||
 stage: build
 | 
			
		||||
 tags:
 | 
			
		||||
 - ubuntu_22.04
 | 
			
		||||
 - s390x
 | 
			
		||||
 rules:
 | 
			
		||||
 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 - if: "$S390X_RUNNER_AVAILABLE"
 | 
			
		||||
   when: manual
 | 
			
		||||
   allow_failure: true
 | 
			
		||||
 script:
 | 
			
		||||
 - mkdir build
 | 
			
		||||
 - cd build
 | 
			
		||||
 - ../configure --disable-tcg
 | 
			
		||||
   || { cat config.log meson-logs/meson-log.txt; exit 1; }
 | 
			
		||||
 - make --output-sync -j`nproc`
 | 
			
		||||
 - make --output-sync -j`nproc` check
 | 
			
		||||
@@ -1,88 +0,0 @@
 | 
			
		||||
# All jobs needing docker-opensbi must use the same rules it uses.
 | 
			
		||||
.opensbi_job_rules:
 | 
			
		||||
  rules:
 | 
			
		||||
    # Forks don't get pipelines unless QEMU_CI=1 or QEMU_CI=2 is set
 | 
			
		||||
    - if: '$QEMU_CI != "1" && $QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != "qemu-project"'
 | 
			
		||||
      when: never
 | 
			
		||||
 | 
			
		||||
    # In forks, if QEMU_CI=1 is set, then create manual job
 | 
			
		||||
    # if any files affecting the build output are touched
 | 
			
		||||
    - if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project"'
 | 
			
		||||
      changes:
 | 
			
		||||
        - .gitlab-ci.d/opensbi.yml
 | 
			
		||||
        - .gitlab-ci.d/opensbi/Dockerfile
 | 
			
		||||
        - roms/opensbi/*
 | 
			
		||||
      when: manual
 | 
			
		||||
 | 
			
		||||
    # In forks, if QEMU_CI=1 is set, then create manual job
 | 
			
		||||
    # if the branch/tag starts with 'opensbi'
 | 
			
		||||
    - if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project" && $CI_COMMIT_REF_NAME =~ /^opensbi/'
 | 
			
		||||
      when: manual
 | 
			
		||||
 | 
			
		||||
    # In forks, if QEMU_CI=1 is set, then create manual job
 | 
			
		||||
    # if the last commit msg contains 'OpenSBI' (case insensitive)
 | 
			
		||||
    - if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project" && $CI_COMMIT_MESSAGE =~ /opensbi/i'
 | 
			
		||||
      when: manual
 | 
			
		||||
 | 
			
		||||
    # Scheduled runs on mainline don't get pipelines except for the special Coverity job
 | 
			
		||||
    - if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_PIPELINE_SOURCE == "schedule"'
 | 
			
		||||
      when: never
 | 
			
		||||
 | 
			
		||||
    # Run if any files affecting the build output are touched
 | 
			
		||||
    - changes:
 | 
			
		||||
        - .gitlab-ci.d/opensbi.yml
 | 
			
		||||
        - .gitlab-ci.d/opensbi/Dockerfile
 | 
			
		||||
        - roms/opensbi/*
 | 
			
		||||
      when: on_success
 | 
			
		||||
 | 
			
		||||
    # Run if the branch/tag starts with 'opensbi'
 | 
			
		||||
    - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/'
 | 
			
		||||
      when: on_success
 | 
			
		||||
 | 
			
		||||
    # Run if the last commit msg contains 'OpenSBI' (case insensitive)
 | 
			
		||||
    - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i'
 | 
			
		||||
      when: on_success
 | 
			
		||||
 | 
			
		||||
docker-opensbi:
 | 
			
		||||
  extends: .opensbi_job_rules
 | 
			
		||||
  stage: containers
 | 
			
		||||
  image: docker:latest
 | 
			
		||||
  services:
 | 
			
		||||
    - docker:dind
 | 
			
		||||
  variables:
 | 
			
		||||
    GIT_DEPTH: 3
 | 
			
		||||
    IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
 | 
			
		||||
  before_script:
 | 
			
		||||
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
 | 
			
		||||
    - until docker info; do sleep 1; done
 | 
			
		||||
  script:
 | 
			
		||||
    - docker pull $IMAGE_TAG || true
 | 
			
		||||
    - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
 | 
			
		||||
                                           --tag $IMAGE_TAG .gitlab-ci.d/opensbi
 | 
			
		||||
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
 | 
			
		||||
    - docker push $IMAGE_TAG
 | 
			
		||||
 | 
			
		||||
build-opensbi:
 | 
			
		||||
  extends: .opensbi_job_rules
 | 
			
		||||
  stage: build
 | 
			
		||||
  needs: ['docker-opensbi']
 | 
			
		||||
  artifacts:
 | 
			
		||||
    when: on_success
 | 
			
		||||
    paths: # 'artifacts.zip' will contains the following files:
 | 
			
		||||
      - pc-bios/opensbi-riscv32-generic-fw_dynamic.bin
 | 
			
		||||
      - pc-bios/opensbi-riscv64-generic-fw_dynamic.bin
 | 
			
		||||
      - opensbi32-generic-stdout.log
 | 
			
		||||
      - opensbi32-generic-stderr.log
 | 
			
		||||
      - opensbi64-generic-stdout.log
 | 
			
		||||
      - opensbi64-generic-stderr.log
 | 
			
		||||
  image: $CI_REGISTRY_IMAGE:opensbi-cross-build
 | 
			
		||||
  variables:
 | 
			
		||||
    GIT_DEPTH: 3
 | 
			
		||||
  script: # Clone the required submodules and build OpenSBI
 | 
			
		||||
    - git submodule update --init roms/opensbi
 | 
			
		||||
    - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
 | 
			
		||||
    - echo "=== Using ${JOBS} simultaneous jobs ==="
 | 
			
		||||
    - make -j${JOBS} -C roms/opensbi clean
 | 
			
		||||
    - make -j${JOBS} -C roms opensbi32-generic 2>&1 1>opensbi32-generic-stdout.log | tee -a opensbi32-generic-stderr.log >&2
 | 
			
		||||
    - make -j${JOBS} -C roms/opensbi clean
 | 
			
		||||
    - make -j${JOBS} -C roms opensbi64-generic 2>&1 1>opensbi64-generic-stdout.log | tee -a opensbi64-generic-stderr.log >&2
 | 
			
		||||
@@ -1,34 +0,0 @@
 | 
			
		||||
#
 | 
			
		||||
# Docker image to cross-compile OpenSBI firmware binaries
 | 
			
		||||
#
 | 
			
		||||
FROM ubuntu:18.04
 | 
			
		||||
 | 
			
		||||
MAINTAINER Bin Meng <bmeng.cn@gmail.com>
 | 
			
		||||
 | 
			
		||||
# Install packages required to build OpenSBI
 | 
			
		||||
RUN apt update \
 | 
			
		||||
    && \
 | 
			
		||||
    \
 | 
			
		||||
    DEBIAN_FRONTEND=noninteractive \
 | 
			
		||||
    apt install --assume-yes --no-install-recommends \
 | 
			
		||||
        build-essential \
 | 
			
		||||
        ca-certificates \
 | 
			
		||||
        git \
 | 
			
		||||
        make \
 | 
			
		||||
	python3 \
 | 
			
		||||
        wget \
 | 
			
		||||
    && \
 | 
			
		||||
    \
 | 
			
		||||
    rm -rf /var/lib/apt/lists/*
 | 
			
		||||
 | 
			
		||||
# Manually install the kernel.org "Crosstool" based toolchains for gcc-8.3
 | 
			
		||||
RUN wget -O - \
 | 
			
		||||
    https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.3.0/x86_64-gcc-8.3.0-nolibc-riscv32-linux.tar.xz \
 | 
			
		||||
    | tar -C /opt -xJ
 | 
			
		||||
RUN wget -O - \
 | 
			
		||||
    https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.3.0/x86_64-gcc-8.3.0-nolibc-riscv64-linux.tar.xz \
 | 
			
		||||
    | tar -C /opt -xJ
 | 
			
		||||
 | 
			
		||||
# Export the toolchains to the system path
 | 
			
		||||
ENV PATH="/opt/gcc-8.3.0-nolibc/riscv32-linux/bin:${PATH}"
 | 
			
		||||
ENV PATH="/opt/gcc-8.3.0-nolibc/riscv64-linux/bin:${PATH}"
 | 
			
		||||
@@ -1,21 +0,0 @@
 | 
			
		||||
# This file contains the set of jobs run by the QEMU project:
 | 
			
		||||
# https://gitlab.com/qemu-project/qemu/-/pipelines
 | 
			
		||||
 | 
			
		||||
variables:
 | 
			
		||||
  RUNNER_TAG: ""
 | 
			
		||||
 | 
			
		||||
default:
 | 
			
		||||
  tags:
 | 
			
		||||
    - $RUNNER_TAG
 | 
			
		||||
 | 
			
		||||
include:
 | 
			
		||||
  - local: '/.gitlab-ci.d/base.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/stages.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/opensbi.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/containers.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/crossbuilds.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/buildtest.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/static_checks.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/custom-runners.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/cirrus.yml'
 | 
			
		||||
  - local: '/.gitlab-ci.d/windows.yml'
 | 
			
		||||
@@ -1,7 +0,0 @@
 | 
			
		||||
# Currently we have two build stages after our containers are built:
 | 
			
		||||
#  - build (for traditional build and test or first stage build)
 | 
			
		||||
#  - test (for test stages, using build artefacts from a build stage)
 | 
			
		||||
stages:
 | 
			
		||||
  - containers
 | 
			
		||||
  - build
 | 
			
		||||
  - test
 | 
			
		||||
@@ -1,48 +0,0 @@
 | 
			
		||||
check-patch:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  stage: build
 | 
			
		||||
  image: python:3.10-alpine
 | 
			
		||||
  needs: []
 | 
			
		||||
  script:
 | 
			
		||||
    - .gitlab-ci.d/check-patch.py
 | 
			
		||||
  variables:
 | 
			
		||||
    GIT_DEPTH: 1000
 | 
			
		||||
    QEMU_JOB_ONLY_FORKS: 1
 | 
			
		||||
  before_script:
 | 
			
		||||
    - apk -U add git perl
 | 
			
		||||
  allow_failure: true
 | 
			
		||||
 | 
			
		||||
check-dco:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  stage: build
 | 
			
		||||
  image: python:3.10-alpine
 | 
			
		||||
  needs: []
 | 
			
		||||
  script: .gitlab-ci.d/check-dco.py
 | 
			
		||||
  variables:
 | 
			
		||||
    GIT_DEPTH: 1000
 | 
			
		||||
  before_script:
 | 
			
		||||
    - apk -U add git
 | 
			
		||||
 | 
			
		||||
check-python-minreqs:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  stage: test
 | 
			
		||||
  image: $CI_REGISTRY_IMAGE/qemu/python:$QEMU_CI_CONTAINER_TAG
 | 
			
		||||
  script:
 | 
			
		||||
    - make -C python check-minreqs
 | 
			
		||||
  variables:
 | 
			
		||||
    GIT_DEPTH: 1
 | 
			
		||||
  needs:
 | 
			
		||||
    job: python-container
 | 
			
		||||
 | 
			
		||||
check-python-tox:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  stage: test
 | 
			
		||||
  image: $CI_REGISTRY_IMAGE/qemu/python:$QEMU_CI_CONTAINER_TAG
 | 
			
		||||
  script:
 | 
			
		||||
    - make -C python check-tox
 | 
			
		||||
  variables:
 | 
			
		||||
    GIT_DEPTH: 1
 | 
			
		||||
    QEMU_TOX_EXTRA_ARGS: --skip-missing-interpreters=false
 | 
			
		||||
    QEMU_JOB_OPTIONAL: 1
 | 
			
		||||
  needs:
 | 
			
		||||
    job: python-container
 | 
			
		||||
@@ -1,127 +0,0 @@
 | 
			
		||||
msys2-64bit:
 | 
			
		||||
  extends: .base_job_template
 | 
			
		||||
  tags:
 | 
			
		||||
  - saas-windows-medium-amd64
 | 
			
		||||
  cache:
 | 
			
		||||
    key: "$CI_JOB_NAME"
 | 
			
		||||
    paths:
 | 
			
		||||
      - msys64/var/cache
 | 
			
		||||
      - ccache
 | 
			
		||||
    when: always
 | 
			
		||||
  needs: []
 | 
			
		||||
  stage: build
 | 
			
		||||
  timeout: 100m
 | 
			
		||||
  variables:
 | 
			
		||||
    # Select the "64 bit, gcc and MSVCRT" MSYS2 environment
 | 
			
		||||
    MSYSTEM: MINGW64
 | 
			
		||||
    # This feature doesn't (currently) work with PowerShell, it stops
 | 
			
		||||
    # the echo'ing of commands being run and doesn't show any timing
 | 
			
		||||
    FF_SCRIPT_SECTIONS: 0
 | 
			
		||||
    # do not remove "--without-default-devices"!
 | 
			
		||||
    # commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using --without-default-devices"
 | 
			
		||||
    # changed to compile QEMU with the --without-default-devices switch
 | 
			
		||||
    # for this job, because otherwise the build could not complete within
 | 
			
		||||
    # the project timeout.
 | 
			
		||||
    CONFIGURE_ARGS:  --target-list=sparc-softmmu --without-default-devices -Ddebug=false -Doptimization=0
 | 
			
		||||
    # The Windows git is a bit older so override the default
 | 
			
		||||
    GIT_FETCH_EXTRA_FLAGS: --no-tags --prune --quiet
 | 
			
		||||
  artifacts:
 | 
			
		||||
    name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
 | 
			
		||||
    expire_in: 7 days
 | 
			
		||||
    paths:
 | 
			
		||||
      - build/meson-logs/testlog.txt
 | 
			
		||||
    reports:
 | 
			
		||||
      junit: "build/meson-logs/testlog.junit.xml"
 | 
			
		||||
  before_script:
 | 
			
		||||
  - Write-Output "Acquiring msys2.exe installer at $(Get-Date -Format u)"
 | 
			
		||||
  - If ( !(Test-Path -Path msys64\var\cache ) ) {
 | 
			
		||||
      mkdir msys64\var\cache
 | 
			
		||||
    }
 | 
			
		||||
  - Invoke-WebRequest
 | 
			
		||||
    "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe.sig"
 | 
			
		||||
    -outfile "msys2.exe.sig"
 | 
			
		||||
  - if ( Test-Path -Path msys64\var\cache\msys2.exe.sig ) {
 | 
			
		||||
      Write-Output "Cached installer sig" ;
 | 
			
		||||
      if ( ((Get-FileHash msys2.exe.sig).Hash -ne (Get-FileHash msys64\var\cache\msys2.exe.sig).Hash) ) {
 | 
			
		||||
        Write-Output "Mis-matched installer sig, new installer download required" ;
 | 
			
		||||
        Remove-Item -Path msys64\var\cache\msys2.exe.sig ;
 | 
			
		||||
        if ( Test-Path -Path msys64\var\cache\msys2.exe ) {
 | 
			
		||||
          Remove-Item -Path msys64\var\cache\msys2.exe
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        Write-Output "Matched installer sig, cached installer still valid"
 | 
			
		||||
      }
 | 
			
		||||
    } else {
 | 
			
		||||
      Write-Output "No cached installer sig, new installer download required" ;
 | 
			
		||||
      if ( Test-Path -Path msys64\var\cache\msys2.exe ) {
 | 
			
		||||
        Remove-Item -Path msys64\var\cache\msys2.exe
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  - if ( !(Test-Path -Path msys64\var\cache\msys2.exe ) ) {
 | 
			
		||||
      Write-Output "Fetching latest installer" ;
 | 
			
		||||
      Invoke-WebRequest
 | 
			
		||||
      "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe"
 | 
			
		||||
      -outfile "msys64\var\cache\msys2.exe" ;
 | 
			
		||||
      Copy-Item -Path msys2.exe.sig -Destination msys64\var\cache\msys2.exe.sig
 | 
			
		||||
    } else {
 | 
			
		||||
      Write-Output "Using cached installer"
 | 
			
		||||
    }
 | 
			
		||||
  - Write-Output "Invoking msys2.exe installer at $(Get-Date -Format u)"
 | 
			
		||||
  - msys64\var\cache\msys2.exe -y
 | 
			
		||||
  - ((Get-Content -path .\msys64\etc\\post-install\\07-pacman-key.post -Raw)
 | 
			
		||||
      -replace '--refresh-keys', '--version') |
 | 
			
		||||
     Set-Content -Path ${CI_PROJECT_DIR}\msys64\etc\\post-install\\07-pacman-key.post
 | 
			
		||||
  - .\msys64\usr\bin\bash -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
 | 
			
		||||
  - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu'  # Core update
 | 
			
		||||
  - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu'  # Normal update
 | 
			
		||||
  - taskkill /F /FI "MODULES eq msys-2.0.dll"
 | 
			
		||||
  script:
 | 
			
		||||
  - Write-Output "Installing mingw packages at $(Get-Date -Format u)"
 | 
			
		||||
  - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed
 | 
			
		||||
      bison diffutils flex
 | 
			
		||||
      git grep make sed
 | 
			
		||||
      mingw-w64-x86_64-binutils
 | 
			
		||||
      mingw-w64-x86_64-capstone
 | 
			
		||||
      mingw-w64-x86_64-ccache
 | 
			
		||||
      mingw-w64-x86_64-curl
 | 
			
		||||
      mingw-w64-x86_64-cyrus-sasl
 | 
			
		||||
      mingw-w64-x86_64-dtc
 | 
			
		||||
      mingw-w64-x86_64-gcc
 | 
			
		||||
      mingw-w64-x86_64-glib2
 | 
			
		||||
      mingw-w64-x86_64-gnutls
 | 
			
		||||
      mingw-w64-x86_64-gtk3
 | 
			
		||||
      mingw-w64-x86_64-libgcrypt
 | 
			
		||||
      mingw-w64-x86_64-libjpeg-turbo
 | 
			
		||||
      mingw-w64-x86_64-libnfs
 | 
			
		||||
      mingw-w64-x86_64-libpng
 | 
			
		||||
      mingw-w64-x86_64-libssh
 | 
			
		||||
      mingw-w64-x86_64-libtasn1
 | 
			
		||||
      mingw-w64-x86_64-libusb
 | 
			
		||||
      mingw-w64-x86_64-lzo2
 | 
			
		||||
      mingw-w64-x86_64-nettle
 | 
			
		||||
      mingw-w64-x86_64-ninja
 | 
			
		||||
      mingw-w64-x86_64-pixman
 | 
			
		||||
      mingw-w64-x86_64-pkgconf
 | 
			
		||||
      mingw-w64-x86_64-python
 | 
			
		||||
      mingw-w64-x86_64-SDL2
 | 
			
		||||
      mingw-w64-x86_64-SDL2_image
 | 
			
		||||
      mingw-w64-x86_64-snappy
 | 
			
		||||
      mingw-w64-x86_64-spice
 | 
			
		||||
      mingw-w64-x86_64-usbredir
 | 
			
		||||
      mingw-w64-x86_64-zstd"
 | 
			
		||||
  - Write-Output "Running build at $(Get-Date -Format u)"
 | 
			
		||||
  - $env:CHERE_INVOKING = 'yes'  # Preserve the current working directory
 | 
			
		||||
  - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink
 | 
			
		||||
  - $env:CCACHE_BASEDIR = "$env:CI_PROJECT_DIR"
 | 
			
		||||
  - $env:CCACHE_DIR = "$env:CCACHE_BASEDIR/ccache"
 | 
			
		||||
  - $env:CCACHE_MAXSIZE = "500M"
 | 
			
		||||
  - $env:CCACHE_DEPEND = 1 # cache misses are too expensive with preprocessor mode
 | 
			
		||||
  - $env:CC = "ccache gcc"
 | 
			
		||||
  - mkdir build
 | 
			
		||||
  - cd build
 | 
			
		||||
  - ..\msys64\usr\bin\bash -lc "ccache --zero-stats"
 | 
			
		||||
  - ..\msys64\usr\bin\bash -lc "../configure --enable-fdt=system $CONFIGURE_ARGS"
 | 
			
		||||
  - ..\msys64\usr\bin\bash -lc "make"
 | 
			
		||||
  - ..\msys64\usr\bin\bash -lc "make check MTESTARGS='$TEST_ARGS' || { cat meson-logs/testlog.txt; exit 1; } ;"
 | 
			
		||||
  - ..\msys64\usr\bin\bash -lc "ccache --show-stats"
 | 
			
		||||
  - Write-Output "Finished build at $(Get-Date -Format u)"
 | 
			
		||||
@@ -1,24 +0,0 @@
 | 
			
		||||
#
 | 
			
		||||
# This is the GitLab CI configuration file for the mainstream QEMU
 | 
			
		||||
# project: https://gitlab.com/qemu-project/qemu/-/pipelines
 | 
			
		||||
#
 | 
			
		||||
# !!! DO NOT ADD ANY NEW CONFIGURATION TO THIS FILE !!!
 | 
			
		||||
#
 | 
			
		||||
# Only documentation or comments is accepted.
 | 
			
		||||
#
 | 
			
		||||
# To use a different set of jobs than the mainstream QEMU project,
 | 
			
		||||
# you need to set the location of your custom yml file at "custom CI/CD
 | 
			
		||||
# configuration path", on your GitLab CI namespace:
 | 
			
		||||
# https://docs.gitlab.com/ee/ci/pipelines/settings.html#custom-cicd-configuration-path
 | 
			
		||||
#
 | 
			
		||||
# ----------------------------------------------------------------------
 | 
			
		||||
#
 | 
			
		||||
# QEMU CI jobs are based on templates. Some templates provide
 | 
			
		||||
# user-configurable options, modifiable via configuration variables.
 | 
			
		||||
#
 | 
			
		||||
# See https://qemu-project.gitlab.io/qemu/devel/ci.html#custom-ci-cd-variables
 | 
			
		||||
# for more information.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
include:
 | 
			
		||||
  - local: '/.gitlab-ci.d/qemu-project.yml'
 | 
			
		||||
@@ -1,64 +0,0 @@
 | 
			
		||||
<!--
 | 
			
		||||
This is the upstream QEMU issue tracker.
 | 
			
		||||
 | 
			
		||||
If you are able to, it will greatly facilitate bug triage if you attempt
 | 
			
		||||
to reproduce the problem with the latest qemu.git master built from
 | 
			
		||||
source. See https://www.qemu.org/download/#source for instructions on
 | 
			
		||||
how to do this.
 | 
			
		||||
 | 
			
		||||
QEMU generally supports the last two releases advertised on
 | 
			
		||||
https://www.qemu.org/. Problems with distro-packaged versions of QEMU
 | 
			
		||||
older than this should be reported to the distribution instead.
 | 
			
		||||
 | 
			
		||||
See https://www.qemu.org/contribute/report-a-bug/ for additional
 | 
			
		||||
guidance.
 | 
			
		||||
 | 
			
		||||
If this is a security issue, please consult
 | 
			
		||||
https://www.qemu.org/contribute/security-process/
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
## Host environment
 | 
			
		||||
 - Operating system:            <!-- Windows 10 21H1, Fedora 37, etc. -->
 | 
			
		||||
 - OS/kernel version:           <!-- For POSIX hosts, use `uname -a` -->
 | 
			
		||||
 - Architecture:                <!-- x86, ARM, s390x, etc. -->
 | 
			
		||||
 - QEMU flavor:                 <!-- qemu-system-x86_64, qemu-aarch64, qemu-img, etc. -->
 | 
			
		||||
 - QEMU version:                <!-- e.g. `qemu-system-x86_64 --version` -->
 | 
			
		||||
 - QEMU command line:
 | 
			
		||||
   <!--
 | 
			
		||||
   Give the smallest, complete command line that exhibits the problem.
 | 
			
		||||
 | 
			
		||||
   If you are using libvirt, virsh, or vmm, you can likely find the QEMU
 | 
			
		||||
   command line arguments in /var/log/libvirt/qemu/$GUEST.log.
 | 
			
		||||
   -->
 | 
			
		||||
   ```
 | 
			
		||||
   ./qemu-system-x86_64 -M q35 -m 4096 -enable-kvm -hda fedora32.qcow2
 | 
			
		||||
   ```
 | 
			
		||||
 | 
			
		||||
## Emulated/Virtualized environment
 | 
			
		||||
 - Operating system:            <!-- Windows 10 21H1, Fedora 37, etc. -->
 | 
			
		||||
 - OS/kernel version:           <!-- For POSIX guests, use `uname -a`. -->
 | 
			
		||||
 - Architecture:                <!-- x86, ARM, s390x, etc. -->
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Description of problem
 | 
			
		||||
<!-- Describe the problem, including any error/crash messages seen. -->
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Steps to reproduce
 | 
			
		||||
1.
 | 
			
		||||
2.
 | 
			
		||||
3.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Additional information
 | 
			
		||||
 | 
			
		||||
<!--
 | 
			
		||||
Attach logs, stack traces, screenshots, etc. Compress the files if necessary.
 | 
			
		||||
If using libvirt, libvirt logs and XML domain information may be relevant.
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<!--
 | 
			
		||||
The line below ensures that proper tags are added to the issue.
 | 
			
		||||
Please do not remove it.
 | 
			
		||||
-->
 | 
			
		||||
/label ~"kind::Bug"
 | 
			
		||||
@@ -1,32 +0,0 @@
 | 
			
		||||
<!--
 | 
			
		||||
This is the upstream QEMU issue tracker.
 | 
			
		||||
 | 
			
		||||
Please note that QEMU, like most open source projects, relies on
 | 
			
		||||
contributors who have motivation, skills and available time to work on
 | 
			
		||||
implementing particular features.
 | 
			
		||||
 | 
			
		||||
Feature requests can be helpful for determining demand and interest, but
 | 
			
		||||
they are not a guarantee that a contributor will volunteer to implement
 | 
			
		||||
it. We welcome and encourage even draft patches to implement a feature
 | 
			
		||||
be sent to the mailing list where it can be discussed and developed
 | 
			
		||||
further by the community.
 | 
			
		||||
 | 
			
		||||
Thank you for your interest in helping us to make QEMU better!
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
## Goal
 | 
			
		||||
<!-- Describe the final result you want to achieve. Avoid design specifics. -->
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Technical details
 | 
			
		||||
<!-- Describe technical details, design specifics, suggestions, versions, etc. -->
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Additional information
 | 
			
		||||
<!-- Patch or branch references, any other useful information -->
 | 
			
		||||
 | 
			
		||||
<!--
 | 
			
		||||
The line below ensures that proper tags are added to the issue.
 | 
			
		||||
Please do not remove it.
 | 
			
		||||
-->
 | 
			
		||||
/label ~"kind::Feature Request"
 | 
			
		||||
							
								
								
									
										45
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										45
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							@@ -1,45 +1,12 @@
 | 
			
		||||
[submodule "roms/vgabios"]
 | 
			
		||||
	path = roms/vgabios
 | 
			
		||||
	url = git://git.kernel.org/pub/scm/virt/kvm/vgabios.git/
 | 
			
		||||
[submodule "roms/seabios"]
 | 
			
		||||
	path = roms/seabios
 | 
			
		||||
	url = https://gitlab.com/qemu-project/seabios.git/
 | 
			
		||||
	url = git://git.qemu.org/seabios.git/
 | 
			
		||||
[submodule "roms/SLOF"]
 | 
			
		||||
	path = roms/SLOF
 | 
			
		||||
	url = https://gitlab.com/qemu-project/SLOF.git
 | 
			
		||||
	url = git://git.qemu.org/SLOF.git
 | 
			
		||||
[submodule "roms/ipxe"]
 | 
			
		||||
	path = roms/ipxe
 | 
			
		||||
	url = https://gitlab.com/qemu-project/ipxe.git
 | 
			
		||||
[submodule "roms/openbios"]
 | 
			
		||||
	path = roms/openbios
 | 
			
		||||
	url = https://gitlab.com/qemu-project/openbios.git
 | 
			
		||||
[submodule "roms/qemu-palcode"]
 | 
			
		||||
	path = roms/qemu-palcode
 | 
			
		||||
	url = https://gitlab.com/qemu-project/qemu-palcode.git
 | 
			
		||||
[submodule "roms/u-boot"]
 | 
			
		||||
	path = roms/u-boot
 | 
			
		||||
	url = https://gitlab.com/qemu-project/u-boot.git
 | 
			
		||||
[submodule "roms/skiboot"]
 | 
			
		||||
	path = roms/skiboot
 | 
			
		||||
	url = https://gitlab.com/qemu-project/skiboot.git
 | 
			
		||||
[submodule "roms/QemuMacDrivers"]
 | 
			
		||||
	path = roms/QemuMacDrivers
 | 
			
		||||
	url = https://gitlab.com/qemu-project/QemuMacDrivers.git
 | 
			
		||||
[submodule "roms/seabios-hppa"]
 | 
			
		||||
	path = roms/seabios-hppa
 | 
			
		||||
	url = https://gitlab.com/qemu-project/seabios-hppa.git
 | 
			
		||||
[submodule "roms/u-boot-sam460ex"]
 | 
			
		||||
	path = roms/u-boot-sam460ex
 | 
			
		||||
	url = https://gitlab.com/qemu-project/u-boot-sam460ex.git
 | 
			
		||||
[submodule "roms/edk2"]
 | 
			
		||||
	path = roms/edk2
 | 
			
		||||
	url = https://gitlab.com/qemu-project/edk2.git
 | 
			
		||||
[submodule "roms/opensbi"]
 | 
			
		||||
	path = roms/opensbi
 | 
			
		||||
	url = 	https://gitlab.com/qemu-project/opensbi.git
 | 
			
		||||
[submodule "roms/qboot"]
 | 
			
		||||
	path = roms/qboot
 | 
			
		||||
	url = https://gitlab.com/qemu-project/qboot.git
 | 
			
		||||
[submodule "roms/vbootrom"]
 | 
			
		||||
	path = roms/vbootrom
 | 
			
		||||
	url = https://gitlab.com/qemu-project/vbootrom.git
 | 
			
		||||
[submodule "tests/lcitool/libvirt-ci"]
 | 
			
		||||
	path = tests/lcitool/libvirt-ci
 | 
			
		||||
	url = https://gitlab.com/libvirt/libvirt-ci.git
 | 
			
		||||
	url = git://git.qemu.org/ipxe.git
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										51
									
								
								.gitpublish
									
									
									
									
									
								
							
							
						
						
									
										51
									
								
								.gitpublish
									
									
									
									
									
								
							@@ -1,51 +0,0 @@
 | 
			
		||||
#
 | 
			
		||||
# Common git-publish profiles that can be used to send patches to QEMU upstream.
 | 
			
		||||
#
 | 
			
		||||
# See https://github.com/stefanha/git-publish for more information
 | 
			
		||||
#
 | 
			
		||||
[gitpublishprofile "default"]
 | 
			
		||||
base = master
 | 
			
		||||
to = qemu-devel@nongnu.org
 | 
			
		||||
cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null
 | 
			
		||||
 | 
			
		||||
[gitpublishprofile "rfc"]
 | 
			
		||||
base = master
 | 
			
		||||
prefix = RFC PATCH
 | 
			
		||||
to = qemu-devel@nongnu.org
 | 
			
		||||
cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null
 | 
			
		||||
 | 
			
		||||
[gitpublishprofile "stable"]
 | 
			
		||||
base = master
 | 
			
		||||
to = qemu-devel@nongnu.org
 | 
			
		||||
cc = qemu-stable@nongnu.org
 | 
			
		||||
cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null
 | 
			
		||||
 | 
			
		||||
[gitpublishprofile "trivial"]
 | 
			
		||||
base = master
 | 
			
		||||
to = qemu-devel@nongnu.org
 | 
			
		||||
cc = qemu-trivial@nongnu.org
 | 
			
		||||
cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null
 | 
			
		||||
 | 
			
		||||
[gitpublishprofile "block"]
 | 
			
		||||
base = master
 | 
			
		||||
to = qemu-devel@nongnu.org
 | 
			
		||||
cc = qemu-block@nongnu.org
 | 
			
		||||
cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null
 | 
			
		||||
 | 
			
		||||
[gitpublishprofile "arm"]
 | 
			
		||||
base = master
 | 
			
		||||
to = qemu-devel@nongnu.org
 | 
			
		||||
cc = qemu-arm@nongnu.org
 | 
			
		||||
cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null
 | 
			
		||||
 | 
			
		||||
[gitpublishprofile "s390"]
 | 
			
		||||
base = master
 | 
			
		||||
to = qemu-devel@nongnu.org
 | 
			
		||||
cc = qemu-s390@nongnu.org
 | 
			
		||||
cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null
 | 
			
		||||
 | 
			
		||||
[gitpublishprofile "ppc"]
 | 
			
		||||
base = master
 | 
			
		||||
to = qemu-devel@nongnu.org
 | 
			
		||||
cc = qemu-ppc@nongnu.org
 | 
			
		||||
cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null
 | 
			
		||||
							
								
								
									
										227
									
								
								.mailmap
									
									
									
									
									
								
							
							
						
						
									
										227
									
								
								.mailmap
									
									
									
									
									
								
							@@ -1,227 +0,0 @@
 | 
			
		||||
# This mailmap fixes up author names/addresses.
 | 
			
		||||
#
 | 
			
		||||
# If you are adding to this file consider if a similar change needs to
 | 
			
		||||
# be made to contrib/gitdm/aliases. They are not however completely
 | 
			
		||||
# analogous. .mailmap is concerned with fixing up damaged author
 | 
			
		||||
# fields where as the gitdm equivalent is more concerned with making
 | 
			
		||||
# sure multiple email addresses get mapped onto the same author.
 | 
			
		||||
#
 | 
			
		||||
# From man git-shortlog the forms are:
 | 
			
		||||
#
 | 
			
		||||
#  Proper Name <commit@email.xx>
 | 
			
		||||
#  <proper@email.xx> <commit@email.xx>
 | 
			
		||||
#  Proper Name <proper@email.xx> <commit@email.xx>
 | 
			
		||||
#  Proper Name <proper@email.xx> Commit Name <commit@email.xx>
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# The first section translates weird addresses from the original git import
 | 
			
		||||
# into proper addresses so that they are counted properly by git shortlog.
 | 
			
		||||
Andrzej Zaborowski <balrogg@gmail.com> balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
 | 
			
		||||
Anthony Liguori <anthony@codemonkey.ws> aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
 | 
			
		||||
Aurelien Jarno <aurelien@aurel32.net> aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
 | 
			
		||||
Blue Swirl <blauwirbel@gmail.com> blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
 | 
			
		||||
Edgar E. Iglesias <edgar.iglesias@gmail.com> edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>
 | 
			
		||||
Fabrice Bellard <fabrice@bellard.org> bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
 | 
			
		||||
Jocelyn Mayer <l_indien@magic.fr> j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>
 | 
			
		||||
Paul Brook <paul@codesourcery.com> pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
 | 
			
		||||
Thiemo Seufer <ths@networkno.de> ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
 | 
			
		||||
malc <av1474@comtv.ru> malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
 | 
			
		||||
 | 
			
		||||
# Corrupted Author fields
 | 
			
		||||
Aaron Larson <alarson@ddci.com> alarson@ddci.com
 | 
			
		||||
Andreas Färber <andreas.faerber@web.de> Andreas Färber <andreas.faerber>
 | 
			
		||||
fanwenjie <fanwj@mail.ustc.edu.cn> fanwj@mail.ustc.edu.cn <fanwj@mail.ustc.edu.cn>
 | 
			
		||||
Jason Wang <jasowang@redhat.com> Jason Wang <jasowang>
 | 
			
		||||
Marek Dolata <mkdolata@us.ibm.com> mkdolata@us.ibm.com <mkdolata@us.ibm.com>
 | 
			
		||||
Michael Ellerman <mpe@ellerman.id.au> michael@ozlabs.org <michael@ozlabs.org>
 | 
			
		||||
Nick Hudson <hnick@vmware.com> hnick@vmware.com <hnick@vmware.com>
 | 
			
		||||
Timothée Cocault <timothee.cocault@gmail.com> timothee.cocault@gmail.com <timothee.cocault@gmail.com>
 | 
			
		||||
Stefan Weil <sw@weilnetz.de> <weil@mail.berlios.de>
 | 
			
		||||
Stefan Weil <sw@weilnetz.de> Stefan Weil <stefan@kiwi.(none)>
 | 
			
		||||
 | 
			
		||||
# There is also a:
 | 
			
		||||
#    (no author) <(no author)@c046a42c-6fe2-441c-8c8c-71466251a162>
 | 
			
		||||
# for the cvs2svn initialization commit e63c3dc74bf.
 | 
			
		||||
 | 
			
		||||
# Next, translate a few commits where mailman rewrote the From: line due
 | 
			
		||||
# to strict SPF and DMARC.  Usually, our build process should be flagging
 | 
			
		||||
# commits like these before maintainer merges; if you find the need to add
 | 
			
		||||
# a line here, please also report a bug against the part of the build
 | 
			
		||||
# process that let the mis-attribution slip through in the first place.
 | 
			
		||||
#
 | 
			
		||||
# If the mailing list munges your emails, use:
 | 
			
		||||
#   git config sendemail.from '"Your Name" <your.email@example.com>'
 | 
			
		||||
# the use of "" in that line will differ from the typically unquoted
 | 
			
		||||
# 'git config user.name', which in turn is sufficient for 'git send-email'
 | 
			
		||||
# to add an extra From: line in the body of your email that takes
 | 
			
		||||
# precedence over any munged From: in the mail's headers.
 | 
			
		||||
# See https://lists.openembedded.org/g/openembedded-core/message/166515
 | 
			
		||||
# and https://lists.gnu.org/archive/html/qemu-devel/2023-09/msg06784.html
 | 
			
		||||
Ed Swierk <eswierk@skyportsystems.com> Ed Swierk via Qemu-devel <qemu-devel@nongnu.org>
 | 
			
		||||
Ian McKellar <ianloic@google.com> Ian McKellar via Qemu-devel <qemu-devel@nongnu.org>
 | 
			
		||||
Julia Suvorova <jusual@mail.ru> Julia Suvorova via Qemu-devel <qemu-devel@nongnu.org>
 | 
			
		||||
Justin Terry (VM) <juterry@microsoft.com> Justin Terry (VM) via Qemu-devel <qemu-devel@nongnu.org>
 | 
			
		||||
Stefan Weil <sw@weilnetz.de> Stefan Weil via <qemu-devel@nongnu.org>
 | 
			
		||||
Stefan Weil <sw@weilnetz.de> Stefan Weil via <qemu-trivial@nongnu.org>
 | 
			
		||||
Andrey Drobyshev <andrey.drobyshev@virtuozzo.com> Andrey Drobyshev via <qemu-block@nongnu.org>
 | 
			
		||||
BALATON Zoltan <balaton@eik.bme.hu> BALATON Zoltan via <qemu-ppc@nongnu.org>
 | 
			
		||||
 | 
			
		||||
# Next, replace old addresses by a more recent one.
 | 
			
		||||
Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <aleksandar.markovic@mips.com>
 | 
			
		||||
Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <aleksandar.markovic@imgtec.com>
 | 
			
		||||
Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <amarkovic@wavecomp.com>
 | 
			
		||||
Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> <arikalo@wavecomp.com>
 | 
			
		||||
Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> <aleksandar.rikalo@rt-rk.com>
 | 
			
		||||
Alexander Graf <agraf@csgraf.de> <agraf@suse.de>
 | 
			
		||||
Ani Sinha <anisinha@redhat.com> <ani@anisinha.ca>
 | 
			
		||||
Anthony Liguori <anthony@codemonkey.ws> Anthony Liguori <aliguori@us.ibm.com>
 | 
			
		||||
Christian Borntraeger <borntraeger@linux.ibm.com> <borntraeger@de.ibm.com>
 | 
			
		||||
Damien Hedde <damien.hedde@dahe.fr> <damien.hedde@greensocs.com>
 | 
			
		||||
Filip Bozuta <filip.bozuta@syrmia.com> <filip.bozuta@rt-rk.com.com>
 | 
			
		||||
Frederic Konrad <konrad.frederic@yahoo.fr> <fred.konrad@greensocs.com>
 | 
			
		||||
Frederic Konrad <konrad.frederic@yahoo.fr> <konrad@adacore.com>
 | 
			
		||||
Greg Kurz <groug@kaod.org> <gkurz@linux.vnet.ibm.com>
 | 
			
		||||
Huacai Chen <chenhuacai@kernel.org> <chenhc@lemote.com>
 | 
			
		||||
Huacai Chen <chenhuacai@kernel.org> <chenhuacai@loongson.cn>
 | 
			
		||||
James Hogan <jhogan@kernel.org> <james.hogan@imgtec.com>
 | 
			
		||||
Juan Quintela <quintela@trasno.org> <quintela@redhat.com>
 | 
			
		||||
Leif Lindholm <quic_llindhol@quicinc.com> <leif.lindholm@linaro.org>
 | 
			
		||||
Leif Lindholm <quic_llindhol@quicinc.com> <leif@nuviainc.com>
 | 
			
		||||
Luc Michel <luc@lmichel.fr> <luc.michel@git.antfield.fr>
 | 
			
		||||
Luc Michel <luc@lmichel.fr> <luc.michel@greensocs.com>
 | 
			
		||||
Luc Michel <luc@lmichel.fr> <lmichel@kalray.eu>
 | 
			
		||||
Radoslaw Biernacki <rad@semihalf.com> <radoslaw.biernacki@linaro.org>
 | 
			
		||||
Paul Brook <paul@nowt.org> <paul@codesourcery.com>
 | 
			
		||||
Paul Burton <paulburton@kernel.org> <paul.burton@mips.com>
 | 
			
		||||
Paul Burton <paulburton@kernel.org> <paul.burton@imgtec.com>
 | 
			
		||||
Paul Burton <paulburton@kernel.org> <paul@archlinuxmips.org>
 | 
			
		||||
Paul Burton <paulburton@kernel.org> <pburton@wavecomp.com>
 | 
			
		||||
Philippe Mathieu-Daudé <philmd@linaro.org> <f4bug@amsat.org>
 | 
			
		||||
Philippe Mathieu-Daudé <philmd@linaro.org> <philmd@redhat.com>
 | 
			
		||||
Philippe Mathieu-Daudé <philmd@linaro.org> <philmd@fungible.com>
 | 
			
		||||
Roman Bolshakov <rbolshakov@ddn.com> <r.bolshakov@yadro.com>
 | 
			
		||||
Sriram Yagnaraman <sriram.yagnaraman@ericsson.com> <sriram.yagnaraman@est.tech>
 | 
			
		||||
Stefan Brankovic <stefan.brankovic@syrmia.com> <stefan.brankovic@rt-rk.com.com>
 | 
			
		||||
Stefan Weil <sw@weilnetz.de> Stefan Weil <stefan@weilnetz.de>
 | 
			
		||||
Taylor Simpson <ltaylorsimpson@gmail.com> <tsimpson@quicinc.com>
 | 
			
		||||
Yongbok Kim <yongbok.kim@mips.com> <yongbok.kim@imgtec.com>
 | 
			
		||||
 | 
			
		||||
# Also list preferred name forms where people have changed their
 | 
			
		||||
# git author config, or had utf8/latin1 encoding issues.
 | 
			
		||||
Aaron Lindsay <aaron@os.amperecomputing.com>
 | 
			
		||||
Aaron Larson <alarson@ddci.com>
 | 
			
		||||
Alexey Gerasimenko <x1917x@gmail.com>
 | 
			
		||||
Alex Chen <alex.chen@huawei.com>
 | 
			
		||||
Alex Ivanov <void@aleksoft.net>
 | 
			
		||||
Andreas Färber <afaerber@suse.de>
 | 
			
		||||
Bandan Das <bsd@redhat.com>
 | 
			
		||||
Benjamin MARSILI <mlspirat42@gmail.com>
 | 
			
		||||
Benoît Canet <benoit.canet@gmail.com>
 | 
			
		||||
Benoît Canet <benoit.canet@irqsave.net>
 | 
			
		||||
Benoît Canet <benoit.canet@nodalink.com>
 | 
			
		||||
Boqun Feng <boqun.feng@gmail.com>
 | 
			
		||||
Boqun Feng <boqun.feng@intel.com>
 | 
			
		||||
Brad Smith <brad@comstyle.com>
 | 
			
		||||
Brijesh Singh <brijesh.singh@amd.com>
 | 
			
		||||
Brilly Wu <brillywu@viatech.com.cn>
 | 
			
		||||
Cédric Vincent <cedric.vincent@st.com>
 | 
			
		||||
CheneyLin <linzc@zju.edu.cn>
 | 
			
		||||
Chen Gang <chengang@emindsoft.com.cn>
 | 
			
		||||
Chen Gang <gang.chen.5i5j@gmail.com>
 | 
			
		||||
Chen Gang <gang.chen@sunrus.com.cn>
 | 
			
		||||
Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
 | 
			
		||||
Christophe Lyon <christophe.lyon@st.com>
 | 
			
		||||
Collin L. Walling <walling@linux.ibm.com>
 | 
			
		||||
Daniel P. Berrangé <berrange@redhat.com>
 | 
			
		||||
Eduardo Otubo <otubo@redhat.com>
 | 
			
		||||
Erik Smit <erik.lucas.smit@gmail.com>
 | 
			
		||||
Fabrice Desclaux <fabrice.desclaux@cea.fr>
 | 
			
		||||
Fernando Luis Vázquez Cao <fernando_b1@lab.ntt.co.jp>
 | 
			
		||||
Fernando Luis Vázquez Cao <fernando@oss.ntt.co.jp>
 | 
			
		||||
Gautham R. Shenoy <ego@in.ibm.com>
 | 
			
		||||
Gautham R. Shenoy <ego@linux.vnet.ibm.com>
 | 
			
		||||
Gonglei (Arei) <arei.gonglei@huawei.com>
 | 
			
		||||
Guang Wang <wang.guang55@zte.com.cn>
 | 
			
		||||
Haibin Zhang <haibinzhang@tencent.com>
 | 
			
		||||
Hailiang Zhang <zhang.zhanghailiang@huawei.com>
 | 
			
		||||
Hanna Reitz <hreitz@redhat.com> <mreitz@redhat.com>
 | 
			
		||||
Hervé Poussineau <hpoussin@reactos.org>
 | 
			
		||||
Hyman Huang <huangy81@chinatelecom.cn>
 | 
			
		||||
Jakub Jermář <jakub@jermar.eu>
 | 
			
		||||
Jakub Jermář <jakub.jermar@kernkonzept.com>
 | 
			
		||||
Jean-Christophe Dubois <jcd@tribudubois.net>
 | 
			
		||||
Jindřich Makovička <makovick@gmail.com>
 | 
			
		||||
John Arbuckle <programmingkidx@gmail.com>
 | 
			
		||||
Juha Riihimäki <juha.riihimaki@nokia.com>
 | 
			
		||||
Juha Riihimäki <Juha.Riihimaki@nokia.com>
 | 
			
		||||
Jun Li <junmuzi@gmail.com>
 | 
			
		||||
Laurent Vivier <Laurent@lvivier.info>
 | 
			
		||||
Leandro Lupori <leandro.lupori@gmail.com>
 | 
			
		||||
Li Guang <lig.fnst@cn.fujitsu.com>
 | 
			
		||||
Liming Wang <walimisdev@gmail.com>
 | 
			
		||||
linzhecheng <linzc@zju.edu.cn>
 | 
			
		||||
Liran Schour <lirans@il.ibm.com>
 | 
			
		||||
Liu Yu <yu.liu@freescale.com>
 | 
			
		||||
Liu Yu <Yu.Liu@freescale.com>
 | 
			
		||||
Li Zhang <zhlcindy@gmail.com>
 | 
			
		||||
Li Zhang <zhlcindy@linux.vnet.ibm.com>
 | 
			
		||||
Lluís Vilanova <vilanova@ac.upc.edu>
 | 
			
		||||
Lluís Vilanova <xscript@gmx.net>
 | 
			
		||||
Longpeng (Mike) <longpeng2@huawei.com>
 | 
			
		||||
Luc Michel <luc.michel@git.antfield.fr>
 | 
			
		||||
Luc Michel <luc.michel@greensocs.com>
 | 
			
		||||
Marc Marí <marc.mari.barcelo@gmail.com>
 | 
			
		||||
Marc Marí <markmb@redhat.com>
 | 
			
		||||
Michael Avdienko <whitearchey@gmail.com>
 | 
			
		||||
Michael S. Tsirkin <mst@redhat.com>
 | 
			
		||||
Munkyu Im <munkyu.im@samsung.com>
 | 
			
		||||
Nicholas Bellinger <nab@linux-iscsi.org>
 | 
			
		||||
Nicholas Thomas <nick@bytemark.co.uk>
 | 
			
		||||
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
 | 
			
		||||
Orit Wasserman <owasserm@redhat.com>
 | 
			
		||||
Paolo Bonzini <pbonzini@redhat.com>
 | 
			
		||||
Pan Nengyuan <pannengyuan@huawei.com>
 | 
			
		||||
Pavel Dovgaluk <dovgaluk@ispras.ru>
 | 
			
		||||
Pavel Dovgaluk <pavel.dovgaluk@gmail.com>
 | 
			
		||||
Pavel Dovgaluk <Pavel.Dovgaluk@ispras.ru>
 | 
			
		||||
Peter Chubb <peter.chubb@nicta.com.au>
 | 
			
		||||
Peter Crosthwaite <crosthwaite.peter@gmail.com>
 | 
			
		||||
Peter Crosthwaite <peter.crosthwaite@petalogix.com>
 | 
			
		||||
Peter Crosthwaite <peter.crosthwaite@xilinx.com>
 | 
			
		||||
Prasad J Pandit <pjp@fedoraproject.org>
 | 
			
		||||
Prasad J Pandit <ppandit@redhat.com>
 | 
			
		||||
Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
 | 
			
		||||
Reimar Döffinger <Reimar.Doeffinger@gmx.de>
 | 
			
		||||
Remy Noel <remy.noel@blade-group.com>
 | 
			
		||||
Roger Pau Monné <roger.pau@citrix.com>
 | 
			
		||||
Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
 | 
			
		||||
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
 | 
			
		||||
Sochin Jiang <sochin.jiang@huawei.com>
 | 
			
		||||
Stefan Berger <stefanb@linux.vnet.ibm.com> <stefanb@linux.ibm.com>
 | 
			
		||||
Takashi Yoshii <takasi-y@ops.dti.ne.jp>
 | 
			
		||||
Thomas Huth <thuth@redhat.com>
 | 
			
		||||
Thomas Knych <thomaswk@google.com>
 | 
			
		||||
Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
 | 
			
		||||
Tony Nguyen <tony.nguyen@bt.com>
 | 
			
		||||
Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
 | 
			
		||||
Vibi Sreenivasan <vibi_sreenivasan@cms.com>
 | 
			
		||||
Vijaya Kumar K <vijayak@cavium.com>
 | 
			
		||||
Vijaya Kumar K <Vijaya.Kumar@cavium.com>
 | 
			
		||||
Vijay Kumar <vijaykumar@bravegnu.org>
 | 
			
		||||
Vijay Kumar <vijaykumar@zilogic.com>
 | 
			
		||||
Wang Guang <wang.guang55@zte.com.cn>
 | 
			
		||||
Wenchao Xia <xiawenc@linux.vnet.ibm.com>
 | 
			
		||||
Wenshuang Ma <kevinnma@tencent.com>
 | 
			
		||||
Xiaoqiang Zhao <zxq_yx_007@163.com>
 | 
			
		||||
Xinhua Cao <caoxinhua@huawei.com>
 | 
			
		||||
Xiong Zhang <xiong.y.zhang@intel.com>
 | 
			
		||||
Yin Yin <yin.yin@cs2c.com.cn>
 | 
			
		||||
Yu-Chen Lin <npes87184@gmail.com>
 | 
			
		||||
Yu-Chen Lin <npes87184@gmail.com> <yuchenlin@synology.com>
 | 
			
		||||
YunQiang Su <syq@debian.org>
 | 
			
		||||
YunQiang Su <ysu@wavecomp.com>
 | 
			
		||||
Yuri Pudgorodskiy <yur@virtuozzo.com>
 | 
			
		||||
Zhengui Li <lizhengui@huawei.com>
 | 
			
		||||
Zhenwei Pi <pizhenwei@bytedance.com>
 | 
			
		||||
Zhenwei Pi <zhenwei.pi@youruncloud.com>
 | 
			
		||||
Zhuang Yanying <ann.zhuangyanying@huawei.com>
 | 
			
		||||
							
								
								
									
										299
									
								
								.patchew.yml
									
									
									
									
									
								
							
							
						
						
									
										299
									
								
								.patchew.yml
									
									
									
									
									
								
							@@ -1,299 +0,0 @@
 | 
			
		||||
---
 | 
			
		||||
# Note: this file is still unused.  It serves as a documentation for the
 | 
			
		||||
# Patchew configuration in case patchew.org disappears or has to be
 | 
			
		||||
# reinstalled.
 | 
			
		||||
#
 | 
			
		||||
# Patchew configuration is available to project administrators at
 | 
			
		||||
# https://patchew.org/api/v1/projects/1/config/ and can be configured
 | 
			
		||||
# to YAML using the following Python script:
 | 
			
		||||
#
 | 
			
		||||
#     import json
 | 
			
		||||
#     import sys
 | 
			
		||||
#     import ruamel.yaml
 | 
			
		||||
#
 | 
			
		||||
#     json_str = sys.stdin.read()
 | 
			
		||||
#     yaml = ruamel.yaml.YAML()
 | 
			
		||||
#     yaml.explicit_start = True
 | 
			
		||||
#     data = json.loads(json_str, object_pairs_hook=ruamel.yaml.comments.CommentedMap)
 | 
			
		||||
#     ruamel.yaml.scalarstring.walk_tree(data)
 | 
			
		||||
#     yaml.dump(data, sys.stdout)
 | 
			
		||||
 | 
			
		||||
email:
 | 
			
		||||
  notifications:
 | 
			
		||||
    timeouts:
 | 
			
		||||
      event: TestingReport
 | 
			
		||||
      enabled: true
 | 
			
		||||
      to_user: false
 | 
			
		||||
      reply_subject: true
 | 
			
		||||
      set_reply_to: true
 | 
			
		||||
      in_reply_to: true
 | 
			
		||||
      reply_to_all: false
 | 
			
		||||
      subject_template: none
 | 
			
		||||
      to: fam@euphon.net
 | 
			
		||||
      cc: ''
 | 
			
		||||
      body_template: |
 | 
			
		||||
        {% if not is_timeout %} {{ cancel }} {% endif %}
 | 
			
		||||
 | 
			
		||||
        Test '{{ test }}' timeout, log:
 | 
			
		||||
 | 
			
		||||
        {{ log }}
 | 
			
		||||
    ENOSPC:
 | 
			
		||||
      event: TestingReport
 | 
			
		||||
      enabled: true
 | 
			
		||||
      to_user: false
 | 
			
		||||
      reply_subject: false
 | 
			
		||||
      set_reply_to: false
 | 
			
		||||
      in_reply_to: true
 | 
			
		||||
      reply_to_all: false
 | 
			
		||||
      subject_template: Out of space error
 | 
			
		||||
      to: fam@euphon.net
 | 
			
		||||
      cc: ''
 | 
			
		||||
      body_template: |
 | 
			
		||||
        {% if passed %}
 | 
			
		||||
          {{ cancel }}
 | 
			
		||||
        {% endif %}
 | 
			
		||||
 | 
			
		||||
        {% if 'No space left on device' in log %}
 | 
			
		||||
        Tester {{ tester }} out of space when running {{ test }}
 | 
			
		||||
 | 
			
		||||
          {{ log }}
 | 
			
		||||
        {% else %}
 | 
			
		||||
          {{ cancel }}
 | 
			
		||||
        {% endif %}
 | 
			
		||||
    FailureShort:
 | 
			
		||||
      event: TestingReport
 | 
			
		||||
      enabled: true
 | 
			
		||||
      to_user: false
 | 
			
		||||
      reply_subject: true
 | 
			
		||||
      set_reply_to: true
 | 
			
		||||
      in_reply_to: true
 | 
			
		||||
      reply_to_all: true
 | 
			
		||||
      subject_template: Testing failed
 | 
			
		||||
      to: ''
 | 
			
		||||
      cc: ''
 | 
			
		||||
      body_template: |
 | 
			
		||||
        {% if passed or not obj.message_id or is_timeout %}
 | 
			
		||||
          {{ cancel }}
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        {% if 'No space left on device' in log %}
 | 
			
		||||
          {{ cancel }}
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        Patchew URL: https://patchew.org/QEMU/{{ obj.message_id }}/
 | 
			
		||||
 | 
			
		||||
        {% ansi2text log as logtext %}
 | 
			
		||||
        {% if test == "checkpatch" %}
 | 
			
		||||
        Hi,
 | 
			
		||||
 | 
			
		||||
        This series seems to have some coding style problems. See output below for
 | 
			
		||||
        more information:
 | 
			
		||||
 | 
			
		||||
        {{ logtext }}
 | 
			
		||||
        {% elif test == "docker-mingw@fedora" or test == "docker-quick@centos8" or test == "asan" %}
 | 
			
		||||
        Hi,
 | 
			
		||||
 | 
			
		||||
        This series failed the {{ test }} build test. Please find the testing commands and
 | 
			
		||||
        their output below. If you have Docker installed, you can probably reproduce it
 | 
			
		||||
        locally.
 | 
			
		||||
 | 
			
		||||
        {% lines_between logtext start="^=== TEST SCRIPT BEGIN ===$" stop="^=== TEST SCRIPT END ===$" %}
 | 
			
		||||
        {% lines_between logtext start="^=== OUTPUT BEGIN ===$" stop="=== OUTPUT END ===$" as output %}
 | 
			
		||||
        {% grep_C output regex="\b(FAIL|XPASS|ERROR|WARN|error:|warning:)" n=3 %}
 | 
			
		||||
        {% elif test == "s390x" or test == "FreeBSD" or test == "ppcle" or test == "ppcbe" %}
 | 
			
		||||
        Hi,
 | 
			
		||||
 | 
			
		||||
        This series failed build test on {{test}} host. Please find the details below.
 | 
			
		||||
 | 
			
		||||
        {% lines_between logtext start="^=== TEST SCRIPT BEGIN ===$" stop="^=== TEST SCRIPT END ===$" %}
 | 
			
		||||
        {% lines_between logtext start="^=== OUTPUT BEGIN ===$" stop="=== OUTPUT END ===$" as output %}
 | 
			
		||||
        {% grep_C output regex="\b(FAIL|XPASS|ERROR|WARN|error:|warning:)" n=3 %}
 | 
			
		||||
        {% else %}
 | 
			
		||||
        {{ cancel }}
 | 
			
		||||
        {% endif %}
 | 
			
		||||
 | 
			
		||||
        The full log is available at
 | 
			
		||||
        {{ log_url }}.
 | 
			
		||||
        ---
 | 
			
		||||
        Email generated automatically by Patchew [https://patchew.org/].
 | 
			
		||||
        Please send your feedback to patchew-devel@redhat.com
 | 
			
		||||
testing:
 | 
			
		||||
  tests:
 | 
			
		||||
    asan:
 | 
			
		||||
      enabled: true
 | 
			
		||||
      requirements: docker
 | 
			
		||||
      timeout: 3600
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
 | 
			
		||||
    docker-quick@centos8:
 | 
			
		||||
      enabled: false
 | 
			
		||||
      requirements: docker,x86_64
 | 
			
		||||
      timeout: 3600
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        time make docker-test-quick@centos8 SHOW_ENV=1 J=14 NETWORK=1
 | 
			
		||||
    checkpatch:
 | 
			
		||||
      enabled: true
 | 
			
		||||
      requirements: ''
 | 
			
		||||
      timeout: 600
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        git rev-parse base > /dev/null || exit 0
 | 
			
		||||
        ./scripts/checkpatch.pl --mailback base..
 | 
			
		||||
    docker-mingw@fedora:
 | 
			
		||||
      enabled: true
 | 
			
		||||
      requirements: docker,x86_64
 | 
			
		||||
      timeout: 3600
 | 
			
		||||
      script: |
 | 
			
		||||
        #! /bin/bash
 | 
			
		||||
        test "$(uname -m)" = "x86_64"
 | 
			
		||||
    ppcle:
 | 
			
		||||
      enabled: false
 | 
			
		||||
      requirements: ppcle
 | 
			
		||||
      timeout: 3600
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        # Testing script will be invoked under the git checkout with
 | 
			
		||||
        # HEAD pointing to a commit that has the patches applied on top of "base"
 | 
			
		||||
        # branch
 | 
			
		||||
        set -e
 | 
			
		||||
        CC=$HOME/bin/cc
 | 
			
		||||
        INSTALL=$PWD/install
 | 
			
		||||
        BUILD=$PWD/build
 | 
			
		||||
        mkdir -p $BUILD $INSTALL
 | 
			
		||||
        SRC=$PWD
 | 
			
		||||
        cd $BUILD
 | 
			
		||||
        $SRC/configure --cc=$CC --prefix=$INSTALL
 | 
			
		||||
        make -j4
 | 
			
		||||
        # XXX: we need reliable clean up
 | 
			
		||||
        # make check -j4 V=1
 | 
			
		||||
        make install
 | 
			
		||||
 | 
			
		||||
        echo
 | 
			
		||||
        echo "=== ENV ==="
 | 
			
		||||
        env
 | 
			
		||||
 | 
			
		||||
        echo
 | 
			
		||||
        echo "=== PACKAGES ==="
 | 
			
		||||
        rpm -qa
 | 
			
		||||
    ppcbe:
 | 
			
		||||
      enabled: false
 | 
			
		||||
      requirements: ppcbe
 | 
			
		||||
      timeout: 3600
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        # Testing script will be invoked under the git checkout with
 | 
			
		||||
        # HEAD pointing to a commit that has the patches applied on top of "base"
 | 
			
		||||
        # branch
 | 
			
		||||
        set -e
 | 
			
		||||
        CC=$HOME/bin/cc
 | 
			
		||||
        INSTALL=$PWD/install
 | 
			
		||||
        BUILD=$PWD/build
 | 
			
		||||
        mkdir -p $BUILD $INSTALL
 | 
			
		||||
        SRC=$PWD
 | 
			
		||||
        cd $BUILD
 | 
			
		||||
        $SRC/configure --cc=$CC --prefix=$INSTALL
 | 
			
		||||
        make -j4
 | 
			
		||||
        # XXX: we need reliable clean up
 | 
			
		||||
        # make check -j4 V=1
 | 
			
		||||
        make install
 | 
			
		||||
 | 
			
		||||
        echo
 | 
			
		||||
        echo "=== ENV ==="
 | 
			
		||||
        env
 | 
			
		||||
 | 
			
		||||
        echo
 | 
			
		||||
        echo "=== PACKAGES ==="
 | 
			
		||||
        rpm -qa
 | 
			
		||||
    FreeBSD:
 | 
			
		||||
      enabled: true
 | 
			
		||||
      requirements: qemu-x86,x86_64,git
 | 
			
		||||
      timeout: 3600
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        # Testing script will be invoked under the git checkout with
 | 
			
		||||
        # HEAD pointing to a commit that has the patches applied on top of "base"
 | 
			
		||||
        # branch
 | 
			
		||||
        if qemu-system-x86_64 --help >/dev/null 2>&1; then
 | 
			
		||||
          QEMU=qemu-system-x86_64
 | 
			
		||||
        elif /usr/libexec/qemu-kvm --help >/dev/null 2>&1; then
 | 
			
		||||
          QEMU=/usr/libexec/qemu-kvm
 | 
			
		||||
        else
 | 
			
		||||
          exit 1
 | 
			
		||||
        fi
 | 
			
		||||
        make vm-build-freebsd J=21 QEMU=$QEMU
 | 
			
		||||
        exit 0
 | 
			
		||||
    docker-clang@ubuntu:
 | 
			
		||||
      enabled: true
 | 
			
		||||
      requirements: docker,x86_64
 | 
			
		||||
      timeout: 3600
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        time make docker-test-clang@ubuntu SHOW_ENV=1 J=14 NETWORK=1
 | 
			
		||||
    s390x:
 | 
			
		||||
      enabled: true
 | 
			
		||||
      requirements: s390x
 | 
			
		||||
      timeout: 3600
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        # Testing script will be invoked under the git checkout with
 | 
			
		||||
        # HEAD pointing to a commit that has the patches applied on top of "base"
 | 
			
		||||
        # branch
 | 
			
		||||
        set -e
 | 
			
		||||
        CC=$HOME/bin/cc
 | 
			
		||||
        INSTALL=$PWD/install
 | 
			
		||||
        BUILD=$PWD/build
 | 
			
		||||
        mkdir -p $BUILD $INSTALL
 | 
			
		||||
        SRC=$PWD
 | 
			
		||||
        cd $BUILD
 | 
			
		||||
        $SRC/configure --cc=$CC --prefix=$INSTALL
 | 
			
		||||
        make -j4
 | 
			
		||||
        # XXX: we need reliable clean up
 | 
			
		||||
        # make check -j4 V=1
 | 
			
		||||
        make install
 | 
			
		||||
 | 
			
		||||
        echo
 | 
			
		||||
        echo "=== ENV ==="
 | 
			
		||||
        env
 | 
			
		||||
 | 
			
		||||
        echo
 | 
			
		||||
        echo "=== PACKAGES ==="
 | 
			
		||||
        rpm -qa
 | 
			
		||||
  requirements:
 | 
			
		||||
    x86_64:
 | 
			
		||||
      script: |
 | 
			
		||||
        #! /bin/bash
 | 
			
		||||
        test "$(uname -m)" = "x86_64"
 | 
			
		||||
    qemu-x86:
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        if qemu-system-x86_64 --help >/dev/null 2>&1; then
 | 
			
		||||
          :
 | 
			
		||||
        elif /usr/libexec/qemu-kvm --help >/dev/null 2>&1; then
 | 
			
		||||
          :
 | 
			
		||||
        else
 | 
			
		||||
          exit 1
 | 
			
		||||
        fi
 | 
			
		||||
    ppcle:
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        test "$(uname -m)" = "ppc64le"
 | 
			
		||||
    ppcbe:
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        test "$(uname -m)" = "ppc64"
 | 
			
		||||
    git:
 | 
			
		||||
      script: |
 | 
			
		||||
        #! /bin/bash
 | 
			
		||||
        git config user.name > /dev/null 2>&1
 | 
			
		||||
    docker:
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        docker ps || sudo -n docker ps
 | 
			
		||||
    s390x:
 | 
			
		||||
      script: |
 | 
			
		||||
        #!/bin/bash
 | 
			
		||||
        test "$(uname -m)" = "s390x"
 | 
			
		||||
git:
 | 
			
		||||
  push_to: git@github.com:patchew-project/qemu
 | 
			
		||||
  public_repo: https://github.com/patchew-project/qemu
 | 
			
		||||
  url_template: https://github.com/patchew-project/qemu/tree/%t
 | 
			
		||||
@@ -1,25 +0,0 @@
 | 
			
		||||
# .readthedocs.yml
 | 
			
		||||
# Read the Docs configuration file
 | 
			
		||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
 | 
			
		||||
 | 
			
		||||
# Required
 | 
			
		||||
version: 2
 | 
			
		||||
 | 
			
		||||
# Set the version of Python and other tools you might need
 | 
			
		||||
build:
 | 
			
		||||
  os: ubuntu-22.04
 | 
			
		||||
  tools:
 | 
			
		||||
    python: "3.11"
 | 
			
		||||
 | 
			
		||||
# Build documentation in the docs/ directory with Sphinx
 | 
			
		||||
sphinx:
 | 
			
		||||
  configuration: docs/conf.py
 | 
			
		||||
 | 
			
		||||
# We recommend specifying your dependencies to enable reproducible builds:
 | 
			
		||||
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
 | 
			
		||||
python:
 | 
			
		||||
  install:
 | 
			
		||||
    - requirements: docs/requirements.txt
 | 
			
		||||
 | 
			
		||||
# We want all the document formats
 | 
			
		||||
formats: all
 | 
			
		||||
							
								
								
									
										275
									
								
								.travis.yml
									
									
									
									
									
								
							
							
						
						
									
										275
									
								
								.travis.yml
									
									
									
									
									
								
							@@ -1,275 +0,0 @@
 | 
			
		||||
os: linux
 | 
			
		||||
dist: jammy
 | 
			
		||||
language: c
 | 
			
		||||
compiler:
 | 
			
		||||
  - gcc
 | 
			
		||||
cache:
 | 
			
		||||
  # There is one cache per branch and compiler version.
 | 
			
		||||
  # characteristics of each job are used to identify the cache:
 | 
			
		||||
  # - OS name (currently only linux)
 | 
			
		||||
  # - OS distribution (e.g. "jammy" for Linux)
 | 
			
		||||
  # - Names and values of visible environment variables set in .travis.yml or Settings panel
 | 
			
		||||
  timeout: 1200
 | 
			
		||||
  ccache: true
 | 
			
		||||
  pip: true
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu
 | 
			
		||||
# to prevent IRC notifications from forks. This was created using:
 | 
			
		||||
# $ travis encrypt -r "qemu/qemu" "irc.oftc.net#qemu"
 | 
			
		||||
notifications:
 | 
			
		||||
  irc:
 | 
			
		||||
    channels:
 | 
			
		||||
      - secure: "F7GDRgjuOo5IUyRLqSkmDL7kvdU4UcH3Lm/W2db2JnDHTGCqgEdaYEYKciyCLZ57vOTsTsOgesN8iUT7hNHBd1KWKjZe9KDTZWppWRYVwAwQMzVeSOsbbU4tRoJ6Pp+3qhH1Z0eGYR9ZgKYAoTumDFgSAYRp4IscKS8jkoedOqM="
 | 
			
		||||
    on_success: change
 | 
			
		||||
    on_failure: always
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
env:
 | 
			
		||||
  global:
 | 
			
		||||
    - SRC_DIR=".."
 | 
			
		||||
    - BUILD_DIR="build"
 | 
			
		||||
    - BASE_CONFIG="--disable-docs --disable-tools"
 | 
			
		||||
    - TEST_BUILD_CMD=""
 | 
			
		||||
    - TEST_CMD="make check V=1"
 | 
			
		||||
    # This is broadly a list of "mainline" system targets which have support across the major distros
 | 
			
		||||
    - MAIN_SYSTEM_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"
 | 
			
		||||
    - CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime"
 | 
			
		||||
    - CCACHE_MAXSIZE=1G
 | 
			
		||||
    - G_MESSAGES_DEBUG=error
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
git:
 | 
			
		||||
  # we want to do this ourselves
 | 
			
		||||
  submodules: false
 | 
			
		||||
 | 
			
		||||
# Common first phase for all steps
 | 
			
		||||
# We no longer use nproc to calculate jobs:
 | 
			
		||||
# https://travis-ci.community/t/nproc-reports-32-cores-on-arm64/5851
 | 
			
		||||
before_install:
 | 
			
		||||
  - if command -v ccache ; then ccache --zero-stats ; fi
 | 
			
		||||
  - export JOBS=3
 | 
			
		||||
  - echo "=== Using ${JOBS} simultaneous jobs ==="
 | 
			
		||||
 | 
			
		||||
# Configure step - may be overridden
 | 
			
		||||
before_script:
 | 
			
		||||
  - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
 | 
			
		||||
  - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
 | 
			
		||||
 | 
			
		||||
# Main build & test - rarely overridden - controlled by TEST_CMD
 | 
			
		||||
script:
 | 
			
		||||
  - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
 | 
			
		||||
  - |
 | 
			
		||||
    if [ "$BUILD_RC" -eq 0 ] && [ -n "$TEST_BUILD_CMD" ]; then
 | 
			
		||||
        ${TEST_BUILD_CMD} || BUILD_RC=$?
 | 
			
		||||
    else
 | 
			
		||||
        $(exit $BUILD_RC);
 | 
			
		||||
    fi
 | 
			
		||||
  - |
 | 
			
		||||
    if [ "$BUILD_RC" -eq 0 ] ; then
 | 
			
		||||
        ${TEST_CMD} ;
 | 
			
		||||
    else
 | 
			
		||||
        $(exit $BUILD_RC);
 | 
			
		||||
    fi
 | 
			
		||||
after_script:
 | 
			
		||||
  - df -h
 | 
			
		||||
  - if command -v ccache ; then ccache --show-stats ; fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  include:
 | 
			
		||||
 | 
			
		||||
    - name: "[aarch64] GCC check-tcg"
 | 
			
		||||
      arch: arm64
 | 
			
		||||
      addons:
 | 
			
		||||
        apt_packages:
 | 
			
		||||
          - libaio-dev
 | 
			
		||||
          - libattr1-dev
 | 
			
		||||
          - libbrlapi-dev
 | 
			
		||||
          - libcacard-dev
 | 
			
		||||
          - libcap-ng-dev
 | 
			
		||||
          - libfdt-dev
 | 
			
		||||
          - libgcrypt20-dev
 | 
			
		||||
          - libgnutls28-dev
 | 
			
		||||
          - libgtk-3-dev
 | 
			
		||||
          - libiscsi-dev
 | 
			
		||||
          - liblttng-ust-dev
 | 
			
		||||
          - libncurses5-dev
 | 
			
		||||
          - libnfs-dev
 | 
			
		||||
          - libpixman-1-dev
 | 
			
		||||
          - libpng-dev
 | 
			
		||||
          - librados-dev
 | 
			
		||||
          - libsdl2-dev
 | 
			
		||||
          - libseccomp-dev
 | 
			
		||||
          - liburcu-dev
 | 
			
		||||
          - libusb-1.0-0-dev
 | 
			
		||||
          - libvdeplug-dev
 | 
			
		||||
          - libvte-2.91-dev
 | 
			
		||||
          - ninja-build
 | 
			
		||||
          - python3-tomli
 | 
			
		||||
          # Tests dependencies
 | 
			
		||||
          - genisoimage
 | 
			
		||||
      env:
 | 
			
		||||
        - TEST_CMD="make check check-tcg V=1"
 | 
			
		||||
        - CONFIG="--disable-containers --enable-fdt=system
 | 
			
		||||
                  --target-list=${MAIN_SYSTEM_TARGETS} --cxx=/bin/false"
 | 
			
		||||
 | 
			
		||||
    - name: "[ppc64] Clang check-tcg"
 | 
			
		||||
      arch: ppc64le
 | 
			
		||||
      compiler: clang
 | 
			
		||||
      addons:
 | 
			
		||||
        apt_packages:
 | 
			
		||||
          - libaio-dev
 | 
			
		||||
          - libattr1-dev
 | 
			
		||||
          - libbrlapi-dev
 | 
			
		||||
          - libcacard-dev
 | 
			
		||||
          - libcap-ng-dev
 | 
			
		||||
          - libfdt-dev
 | 
			
		||||
          - libgcrypt20-dev
 | 
			
		||||
          - libgnutls28-dev
 | 
			
		||||
          - libgtk-3-dev
 | 
			
		||||
          - libiscsi-dev
 | 
			
		||||
          - liblttng-ust-dev
 | 
			
		||||
          - libncurses5-dev
 | 
			
		||||
          - libnfs-dev
 | 
			
		||||
          - libpixman-1-dev
 | 
			
		||||
          - libpng-dev
 | 
			
		||||
          - librados-dev
 | 
			
		||||
          - libsdl2-dev
 | 
			
		||||
          - libseccomp-dev
 | 
			
		||||
          - liburcu-dev
 | 
			
		||||
          - libusb-1.0-0-dev
 | 
			
		||||
          - libvdeplug-dev
 | 
			
		||||
          - libvte-2.91-dev
 | 
			
		||||
          - ninja-build
 | 
			
		||||
          - python3-tomli
 | 
			
		||||
          # Tests dependencies
 | 
			
		||||
          - genisoimage
 | 
			
		||||
      env:
 | 
			
		||||
        - TEST_CMD="make check check-tcg V=1"
 | 
			
		||||
        - CONFIG="--disable-containers --enable-fdt=system
 | 
			
		||||
                  --target-list=ppc64-softmmu,ppc64le-linux-user"
 | 
			
		||||
 | 
			
		||||
    - name: "[s390x] GCC check-tcg"
 | 
			
		||||
      arch: s390x
 | 
			
		||||
      addons:
 | 
			
		||||
        apt_packages:
 | 
			
		||||
          - libaio-dev
 | 
			
		||||
          - libattr1-dev
 | 
			
		||||
          - libbrlapi-dev
 | 
			
		||||
          - libcacard-dev
 | 
			
		||||
          - libcap-ng-dev
 | 
			
		||||
          - libfdt-dev
 | 
			
		||||
          - libgcrypt20-dev
 | 
			
		||||
          - libgnutls28-dev
 | 
			
		||||
          - libgtk-3-dev
 | 
			
		||||
          - libiscsi-dev
 | 
			
		||||
          - liblttng-ust-dev
 | 
			
		||||
          - libncurses5-dev
 | 
			
		||||
          - libnfs-dev
 | 
			
		||||
          - libpixman-1-dev
 | 
			
		||||
          - libpng-dev
 | 
			
		||||
          - librados-dev
 | 
			
		||||
          - libsdl2-dev
 | 
			
		||||
          - libseccomp-dev
 | 
			
		||||
          - liburcu-dev
 | 
			
		||||
          - libusb-1.0-0-dev
 | 
			
		||||
          - libvdeplug-dev
 | 
			
		||||
          - libvte-2.91-dev
 | 
			
		||||
          - ninja-build
 | 
			
		||||
          - python3-tomli
 | 
			
		||||
          # Tests dependencies
 | 
			
		||||
          - genisoimage
 | 
			
		||||
      env:
 | 
			
		||||
        - TEST_CMD="make check check-tcg V=1"
 | 
			
		||||
        - CONFIG="--disable-containers
 | 
			
		||||
            --target-list=hppa-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"
 | 
			
		||||
      script:
 | 
			
		||||
        - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
 | 
			
		||||
        - |
 | 
			
		||||
          if [ "$BUILD_RC" -eq 0 ] ; then
 | 
			
		||||
              mv pc-bios/s390-ccw/*.img qemu-bundle/usr/local/share/qemu ;
 | 
			
		||||
              ${TEST_CMD} ;
 | 
			
		||||
          else
 | 
			
		||||
              $(exit $BUILD_RC);
 | 
			
		||||
          fi
 | 
			
		||||
 | 
			
		||||
    - name: "[s390x] Clang (other-system)"
 | 
			
		||||
      arch: s390x
 | 
			
		||||
      compiler: clang
 | 
			
		||||
      addons:
 | 
			
		||||
        apt_packages:
 | 
			
		||||
          - libaio-dev
 | 
			
		||||
          - libattr1-dev
 | 
			
		||||
          - libcacard-dev
 | 
			
		||||
          - libcap-ng-dev
 | 
			
		||||
          - libfdt-dev
 | 
			
		||||
          - libgnutls28-dev
 | 
			
		||||
          - libiscsi-dev
 | 
			
		||||
          - liblttng-ust-dev
 | 
			
		||||
          - liblzo2-dev
 | 
			
		||||
          - libncurses-dev
 | 
			
		||||
          - libnfs-dev
 | 
			
		||||
          - libpixman-1-dev
 | 
			
		||||
          - libsdl2-dev
 | 
			
		||||
          - libsdl2-image-dev
 | 
			
		||||
          - libseccomp-dev
 | 
			
		||||
          - libsnappy-dev
 | 
			
		||||
          - libzstd-dev
 | 
			
		||||
          - nettle-dev
 | 
			
		||||
          - ninja-build
 | 
			
		||||
          - python3-tomli
 | 
			
		||||
          # Tests dependencies
 | 
			
		||||
          - genisoimage
 | 
			
		||||
      env:
 | 
			
		||||
        - CONFIG="--disable-containers --audio-drv-list=sdl --disable-user
 | 
			
		||||
            --target-list=arm-softmmu,avr-softmmu,microblaze-softmmu,sh4eb-softmmu,sparc64-softmmu,xtensaeb-softmmu"
 | 
			
		||||
 | 
			
		||||
    - name: "[s390x] GCC (user)"
 | 
			
		||||
      arch: s390x
 | 
			
		||||
      addons:
 | 
			
		||||
        apt_packages:
 | 
			
		||||
          - libgcrypt20-dev
 | 
			
		||||
          - libglib2.0-dev
 | 
			
		||||
          - libgnutls28-dev
 | 
			
		||||
          - ninja-build
 | 
			
		||||
          - flex
 | 
			
		||||
          - bison
 | 
			
		||||
          - python3-tomli
 | 
			
		||||
      env:
 | 
			
		||||
        - TEST_CMD="make check check-tcg V=1"
 | 
			
		||||
        - CONFIG="--disable-containers --disable-system"
 | 
			
		||||
 | 
			
		||||
    - name: "[s390x] Clang (disable-tcg)"
 | 
			
		||||
      arch: s390x
 | 
			
		||||
      compiler: clang
 | 
			
		||||
      addons:
 | 
			
		||||
        apt_packages:
 | 
			
		||||
          - libaio-dev
 | 
			
		||||
          - libattr1-dev
 | 
			
		||||
          - libbrlapi-dev
 | 
			
		||||
          - libcacard-dev
 | 
			
		||||
          - libcap-ng-dev
 | 
			
		||||
          - libfdt-dev
 | 
			
		||||
          - libgcrypt20-dev
 | 
			
		||||
          - libgnutls28-dev
 | 
			
		||||
          - libgtk-3-dev
 | 
			
		||||
          - libiscsi-dev
 | 
			
		||||
          - liblttng-ust-dev
 | 
			
		||||
          - libncurses5-dev
 | 
			
		||||
          - libnfs-dev
 | 
			
		||||
          - libpixman-1-dev
 | 
			
		||||
          - libpng-dev
 | 
			
		||||
          - librados-dev
 | 
			
		||||
          - libsdl2-dev
 | 
			
		||||
          - libseccomp-dev
 | 
			
		||||
          - liburcu-dev
 | 
			
		||||
          - libusb-1.0-0-dev
 | 
			
		||||
          - libvdeplug-dev
 | 
			
		||||
          - libvte-2.91-dev
 | 
			
		||||
          - ninja-build
 | 
			
		||||
          - python3-tomli
 | 
			
		||||
      env:
 | 
			
		||||
        - TEST_CMD="make check-unit"
 | 
			
		||||
        - CONFIG="--disable-containers --disable-tcg --enable-kvm --disable-tools
 | 
			
		||||
                  --enable-fdt=system --host-cc=clang --cxx=clang++"
 | 
			
		||||
							
								
								
									
										81
									
								
								CODING_STYLE
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								CODING_STYLE
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,81 @@
 | 
			
		||||
Qemu Coding Style
 | 
			
		||||
=================
 | 
			
		||||
 | 
			
		||||
Please use the script checkpatch.pl in the scripts directory to check
 | 
			
		||||
patches before submitting.
 | 
			
		||||
 | 
			
		||||
1. Whitespace
 | 
			
		||||
 | 
			
		||||
Of course, the most important aspect in any coding style is whitespace.
 | 
			
		||||
Crusty old coders who have trouble spotting the glasses on their noses
 | 
			
		||||
can tell the difference between a tab and eight spaces from a distance
 | 
			
		||||
of approximately fifteen parsecs.  Many a flamewar have been fought and
 | 
			
		||||
lost on this issue.
 | 
			
		||||
 | 
			
		||||
QEMU indents are four spaces.  Tabs are never used, except in Makefiles
 | 
			
		||||
where they have been irreversibly coded into the syntax.
 | 
			
		||||
Spaces of course are superior to tabs because:
 | 
			
		||||
 | 
			
		||||
 - You have just one way to specify whitespace, not two.  Ambiguity breeds
 | 
			
		||||
   mistakes.
 | 
			
		||||
 - The confusion surrounding 'use tabs to indent, spaces to justify' is gone.
 | 
			
		||||
 - Tab indents push your code to the right, making your screen seriously
 | 
			
		||||
   unbalanced.
 | 
			
		||||
 - Tabs will be rendered incorrectly on editors who are misconfigured not
 | 
			
		||||
   to use tab stops of eight positions.
 | 
			
		||||
 - Tabs are rendered badly in patches, causing off-by-one errors in almost
 | 
			
		||||
   every line.
 | 
			
		||||
 - It is the QEMU coding style.
 | 
			
		||||
 | 
			
		||||
Do not leave whitespace dangling off the ends of lines.
 | 
			
		||||
 | 
			
		||||
2. Line width
 | 
			
		||||
 | 
			
		||||
Lines are 80 characters; not longer.
 | 
			
		||||
 | 
			
		||||
Rationale:
 | 
			
		||||
 - Some people like to tile their 24" screens with a 6x4 matrix of 80x24
 | 
			
		||||
   xterms and use vi in all of them.  The best way to punish them is to
 | 
			
		||||
   let them keep doing it.
 | 
			
		||||
 - Code and especially patches is much more readable if limited to a sane
 | 
			
		||||
   line length.  Eighty is traditional.
 | 
			
		||||
 - It is the QEMU coding style.
 | 
			
		||||
 | 
			
		||||
3. Naming
 | 
			
		||||
 | 
			
		||||
Variables are lower_case_with_underscores; easy to type and read.  Structured
 | 
			
		||||
type names are in CamelCase; harder to type but standing out.  Scalar type
 | 
			
		||||
names are lower_case_with_underscores_ending_with_a_t, like the POSIX
 | 
			
		||||
uint64_t and family.  Note that this last convention contradicts POSIX
 | 
			
		||||
and is therefore likely to be changed.
 | 
			
		||||
 | 
			
		||||
When wrapping standard library functions, use the prefix qemu_ to alert
 | 
			
		||||
readers that they are seeing a wrapped version; otherwise avoid this prefix.
 | 
			
		||||
 | 
			
		||||
4. Block structure
 | 
			
		||||
 | 
			
		||||
Every indented statement is braced; even if the block contains just one
 | 
			
		||||
statement.  The opening brace is on the line that contains the control
 | 
			
		||||
flow statement that introduces the new block; the closing brace is on the
 | 
			
		||||
same line as the else keyword, or on a line by itself if there is no else
 | 
			
		||||
keyword.  Example:
 | 
			
		||||
 | 
			
		||||
    if (a == 5) {
 | 
			
		||||
        printf("a was 5.\n");
 | 
			
		||||
    } else if (a == 6) {
 | 
			
		||||
        printf("a was 6.\n");
 | 
			
		||||
    } else {
 | 
			
		||||
        printf("a was something else entirely.\n");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
An exception is the opening brace for a function; for reasons of tradition
 | 
			
		||||
and clarity it comes on a line by itself:
 | 
			
		||||
 | 
			
		||||
    void a_function(void)
 | 
			
		||||
    {
 | 
			
		||||
        do_something();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
Rationale: a consistent (except for functions...) bracing style reduces
 | 
			
		||||
ambiguity and avoids needless churn when lines are added or removed.
 | 
			
		||||
Furthermore, it is the QEMU coding style.
 | 
			
		||||
							
								
								
									
										22
									
								
								COPYING.LIB
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								COPYING.LIB
									
									
									
									
									
								
							@@ -1,8 +1,8 @@
 | 
			
		||||
                  GNU LESSER GENERAL PUBLIC LICENSE
 | 
			
		||||
                       Version 2.1, February 1999
 | 
			
		||||
		  GNU LESSER GENERAL PUBLIC LICENSE
 | 
			
		||||
		       Version 2.1, February 1999
 | 
			
		||||
 | 
			
		||||
 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
 | 
			
		||||
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
	51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
 Everyone is permitted to copy and distribute verbatim copies
 | 
			
		||||
 of this license document, but changing it is not allowed.
 | 
			
		||||
 | 
			
		||||
@@ -10,7 +10,7 @@
 | 
			
		||||
 as the successor of the GNU Library Public License, version 2, hence
 | 
			
		||||
 the version number 2.1.]
 | 
			
		||||
 | 
			
		||||
                            Preamble
 | 
			
		||||
			    Preamble
 | 
			
		||||
 | 
			
		||||
  The licenses for most software are designed to take away your
 | 
			
		||||
freedom to share and change it.  By contrast, the GNU General Public
 | 
			
		||||
@@ -112,7 +112,7 @@ modification follow.  Pay close attention to the difference between a
 | 
			
		||||
former contains code derived from the library, whereas the latter must
 | 
			
		||||
be combined with the library in order to run.
 | 
			
		||||
 | 
			
		||||
                  GNU LESSER GENERAL PUBLIC LICENSE
 | 
			
		||||
		  GNU LESSER GENERAL PUBLIC LICENSE
 | 
			
		||||
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 | 
			
		||||
 | 
			
		||||
  0. This License Agreement applies to any software library or other
 | 
			
		||||
@@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based
 | 
			
		||||
on the Library (independent of the use of the Library in a tool for
 | 
			
		||||
writing it).  Whether that is true depends on what the Library does
 | 
			
		||||
and what the program that uses the Library does.
 | 
			
		||||
 | 
			
		||||
  
 | 
			
		||||
  1. You may copy and distribute verbatim copies of the Library's
 | 
			
		||||
complete source code as you receive it, in any medium, provided that
 | 
			
		||||
you conspicuously and appropriately publish on each copy an
 | 
			
		||||
@@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status
 | 
			
		||||
of all derivatives of our free software and of promoting the sharing
 | 
			
		||||
and reuse of software generally.
 | 
			
		||||
 | 
			
		||||
                            NO WARRANTY
 | 
			
		||||
			    NO WARRANTY
 | 
			
		||||
 | 
			
		||||
  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
 | 
			
		||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
 | 
			
		||||
@@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
 | 
			
		||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 | 
			
		||||
DAMAGES.
 | 
			
		||||
 | 
			
		||||
                     END OF TERMS AND CONDITIONS
 | 
			
		||||
		     END OF TERMS AND CONDITIONS
 | 
			
		||||
 | 
			
		||||
           How to Apply These Terms to Your New Libraries
 | 
			
		||||
 | 
			
		||||
@@ -476,7 +476,7 @@ convey the exclusion of warranty; and each file should have at least the
 | 
			
		||||
    This library is free software; you can redistribute it and/or
 | 
			
		||||
    modify it under the terms of the GNU Lesser General Public
 | 
			
		||||
    License as published by the Free Software Foundation; either
 | 
			
		||||
    version 2.1 of the License, or (at your option) any later version.
 | 
			
		||||
    version 2 of the License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
    This library is distributed in the hope that it will be useful,
 | 
			
		||||
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
@@ -485,7 +485,7 @@ convey the exclusion of warranty; and each file should have at least the
 | 
			
		||||
 | 
			
		||||
    You should have received a copy of the GNU Lesser General Public
 | 
			
		||||
    License along with this library; if not, write to the Free Software
 | 
			
		||||
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
 | 
			
		||||
Also add information on how to contact you by electronic and paper mail.
 | 
			
		||||
 | 
			
		||||
@@ -500,3 +500,5 @@ necessary.  Here is a sample; alter the names:
 | 
			
		||||
  Ty Coon, President of Vice
 | 
			
		||||
 | 
			
		||||
That's all there is to it!
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										580
									
								
								Changelog
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										580
									
								
								Changelog
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,580 @@
 | 
			
		||||
This file documents changes for QEMU releases 0.12 and earlier.
 | 
			
		||||
For changelog information for later releases, see
 | 
			
		||||
http://wiki.qemu.org/ChangeLog or look at the git history for
 | 
			
		||||
more detailed information.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.12.0:
 | 
			
		||||
 | 
			
		||||
  - Update to SeaBIOS 0.5.0
 | 
			
		||||
  - e1000: fix device link status in Linux (Anthony Liguori)
 | 
			
		||||
  - monitor: fix QMP for balloon command (Luiz Capitulino)
 | 
			
		||||
  - QMP: Return an empty dict by default (Luiz Capitulino)
 | 
			
		||||
  - QMP: Only handle converted commands (Luiz Capitulino)
 | 
			
		||||
  - pci: support PCI based option rom loading (Gerd Hoffman/Anthony Liguori)
 | 
			
		||||
  - Fix backcompat for hotplug of SCSI controllers (Daniel P. Berrange)
 | 
			
		||||
  - fdc: fix migration from 0.11 (Juan Quintela)
 | 
			
		||||
  - vmware-vga: fix segv on cursor resize. (Dave Airlie)
 | 
			
		||||
  - vmware-vga: various fixes (Dave Airlie/Anthony Liguori)
 | 
			
		||||
  - qdev: improve property error reporting. (Gerd Hoffmann)
 | 
			
		||||
  - fix vga names in default_list (Gerd Hoffmann)
 | 
			
		||||
  - usb-host: check mon before using it. (Gerd Hoffmann)
 | 
			
		||||
  - usb-net: use qdev for -usbdevice (Gerd Hoffmann)
 | 
			
		||||
  - monitor: Catch printing to non-existent monitor (Luiz Capitulino)
 | 
			
		||||
  - Avoid permanently disabled QEMU monitor when UNIX migration fails (Daniel P. Berrange)
 | 
			
		||||
  - Fix loading of ELF multiboot kernels (Kevin Wolf)
 | 
			
		||||
  - qemu-io: Fix memory leak (Kevin Wolf)
 | 
			
		||||
  - Fix thinko in linuxboot.S (Paolo Bonzini)
 | 
			
		||||
  - target-i386: Fix evaluation of DR7 register (Jan Kiszka)
 | 
			
		||||
  - vnc: hextile: do not generate ForegroundSpecified and SubrectsColoured tiles (Anthony Liguori)
 | 
			
		||||
  - S390: Bail out without KVM (Alexander Graf)
 | 
			
		||||
  - S390: Don't tell guest we're updating config space (Alexander Graf)
 | 
			
		||||
  - target-s390: Fail on unknown instructions (Alexander Graf)
 | 
			
		||||
  - osdep: Fix runtime failure on older Linux kernels (Andre Przywara)
 | 
			
		||||
  - Fix a make -j race (Juergen Lock)
 | 
			
		||||
  - target-alpha: Fix generic ctz64. (Richard Henderson)
 | 
			
		||||
  - s390: Fix buggy assignment (Stefan Weil)
 | 
			
		||||
  - target-mips: fix user-mode emulation startup (Nathan Froyd)
 | 
			
		||||
  - target-i386: Update CPUID feature set for TCG (Andre Przywara)
 | 
			
		||||
  - s390: fix build on 32 bit host (Michael S. Tsirkin)
 | 
			
		||||
	
 | 
			
		||||
version 0.12.0-rc2:
 | 
			
		||||
 | 
			
		||||
  - v2: properly save kvm system time msr registers (Glauber Costa)
 | 
			
		||||
  - convert more monitor commands to qmp (Luiz Capitulino)
 | 
			
		||||
  - vnc: fix capslock tracking logic. (Gerd Hoffmann)
 | 
			
		||||
  - QemuOpts: allow larger option values. (Gerd Hoffmann)
 | 
			
		||||
  - scsi: fix drive hotplug. (Gerd Hoffmann)
 | 
			
		||||
  - pci: don't hw_error() when no slot is available. (Gerd Hoffmann)
 | 
			
		||||
  - pci: don't abort() when trying to hotplug with acpi off. (Gerd Hoffmann)
 | 
			
		||||
  - allow default devices to be implemented in config file (Gerd Hoffman)
 | 
			
		||||
  - vc: colorize chardev title line with blue background. (Gerd Hoffmann)
 | 
			
		||||
  - chardev: make chardevs specified in config file work. (Gerd Hoffmann)
 | 
			
		||||
  - qdev: also match bus name for global properties (Gerd Hoffmann)
 | 
			
		||||
  - qdev: add command line option to set global defaults for properties. (Gerd Hoffmann)
 | 
			
		||||
  - kvm: x86: Save/restore exception_index (Jan Kiszka)
 | 
			
		||||
  - qdev: Replace device names containing whitespace (Markus Armbruster)
 | 
			
		||||
  - fix rtc-td-hack on host without high-res timers (Gleb Natapov)
 | 
			
		||||
  - virtio: verify features on load (Michael S. Tsirkin)
 | 
			
		||||
  - vmware_vga: add rom file so that it boots. (Dave Airlie)
 | 
			
		||||
  - Do not abort on qemu_malloc(0) in production builds (Anthony Liguori)
 | 
			
		||||
  - Fix ARM userspace strex implementation. (Paul Brook)
 | 
			
		||||
  - qemu: delete rule target on error (Michael S. Tsirkin)
 | 
			
		||||
  - QMP: add human-readable description to error response (Markus Armbruster)
 | 
			
		||||
  - convert more monitor commands to QError (Markus Armbruster)
 | 
			
		||||
  - monitor: Fix double-prompt after "change vnc passwd BLA" (Markus Armbruster)
 | 
			
		||||
  - monitor: do_cont(): Don't ask for passwords (Luiz Capitulino)
 | 
			
		||||
  - monitor: Introduce 'block_passwd' command (Luiz Capitulino)
 | 
			
		||||
  - pci: interrupt disable bit support (Michael S. Tsirkin)
 | 
			
		||||
  - pci: interrupt status bit implementation (Michael S. Tsirkin)
 | 
			
		||||
  - pci: prepare irq code for interrupt state (Michael S. Tsirkin)
 | 
			
		||||
  - msix: function mask support (Michael S. Tsirkin)
 | 
			
		||||
  - msix: macro rename for function mask support (Michael S. Tsirkin)
 | 
			
		||||
  - cpuid: Fix multicore setup on Intel (Andre Przywara)
 | 
			
		||||
  - kvm: x86: Fix initial kvm_has_msr_star (Jan Kiszka)
 | 
			
		||||
  - Update OpenBIOS images to r640 (Aurelien Jarno)	
 | 
			
		||||
 | 
			
		||||
version 0.10.2:
 | 
			
		||||
 | 
			
		||||
  - fix savevm/loadvm (Anthony Liguori)
 | 
			
		||||
  - live migration: fix dirty tracking windows (Glauber Costa)
 | 
			
		||||
  - live migration: improve error propogation (Glauber Costa)
 | 
			
		||||
  - qcow2: fix image creation for > ~2TB images (Chris Wright)
 | 
			
		||||
  - hotplug: fix error handling for if= parameter (Eduardo Habkost)
 | 
			
		||||
  - qcow2: fix data corruption (Nolan Leake)
 | 
			
		||||
  - virtio: fix guest oops with 2.6.25 kernels (Rusty Russell)
 | 
			
		||||
  - SH4: add support for -kernel (Takashi Yoshii, Aurelien Jarno)
 | 
			
		||||
  - hotplug: fix closing of char devices (Jan Kiszka)
 | 
			
		||||
  - hotplug: remove incorrect check for device name (Eduardo Habkost)
 | 
			
		||||
  - enable -k on win32 (Herve Poussineau)
 | 
			
		||||
  - configure: use LANG=C for grep (Andreas Faerber)
 | 
			
		||||
  - fix VGA regression (malc)
 | 
			
		||||
	
 | 
			
		||||
version 0.10.1:
 | 
			
		||||
 | 
			
		||||
  - virtio-net: check right return size on sg list (Alex Williamson)
 | 
			
		||||
  - Make qemu_announce_self handle holes (live migration after hotplug)
 | 
			
		||||
    (Marcelo Tosatti)
 | 
			
		||||
  - Revert r6804-r6808 (qcow2 allocation info).  This series of changes added
 | 
			
		||||
    a high cost to startup for large qcow2 images (Anthony Liguori)
 | 
			
		||||
  - qemu-img: fix help message (Aurelien Jarno)
 | 
			
		||||
  - Fix build for non-default installs of SDL (Anthony Liguori)
 | 
			
		||||
  - Fix race condition in env->interrupt_request.  When using TCG and a dynticks
 | 
			
		||||
    host timer, this condition could cause TCG to get stuck in an infinite
 | 
			
		||||
    loop (Aurelien Jarno)
 | 
			
		||||
  - Fix reading encrypted hard disk passwords during early startup (Jan Kiszka)
 | 
			
		||||
  - Fix encrypted disk reporting in 'info block' (Jan Kiszka)
 | 
			
		||||
  - Fix console size with tiny displays (MusicPal) (Jan Kiszka)
 | 
			
		||||
  - Improve error handling in bdrv_open2 (Jan Kiszka)
 | 
			
		||||
  - Avoid leaking data in mux'ed character devices (Jan Kiszka)
 | 
			
		||||
  - Fix initial character device reset (no banner in monitor) (Jan Kiszka)
 | 
			
		||||
  - Fix cpuid KVM crash on i386 host (Lubomir Rintel)
 | 
			
		||||
  - Fix SLES10sp2 installation by adding ISTAT1 register to LSI SCSI emulation
 | 
			
		||||
    (Ryan Harper)
 | 
			
		||||
 | 
			
		||||
version 0.10.0:
 | 
			
		||||
 | 
			
		||||
  - TCG support (No longer requires GCC 3.x)
 | 
			
		||||
  - Kernel Virtual Machine acceleration support
 | 
			
		||||
  - BSD userspace emulation
 | 
			
		||||
  - Bluetooth emulation and host passthrough support
 | 
			
		||||
  - GDB XML register description support
 | 
			
		||||
  - Intel e1000 emulation
 | 
			
		||||
  - HPET emulation
 | 
			
		||||
  - VirtIO paravirtual device support
 | 
			
		||||
  - Marvell 88w8618 / MusicPal emulation
 | 
			
		||||
  - Nokia N-series tablet emulation / OMAP2 processor emulation
 | 
			
		||||
  - PCI hotplug support
 | 
			
		||||
  - Live migration and new save/restore formats
 | 
			
		||||
  - Curses display support
 | 
			
		||||
  - qemu-nbd utility to mount supported block formats
 | 
			
		||||
  - Altivec support in PPC emulation and new firmware (OpenBIOS)
 | 
			
		||||
  - Multiple VNC clients are now supported
 | 
			
		||||
  - TLS encryption is now supported in VNC
 | 
			
		||||
  - MIPS Magnum R4000 machine (Hervé Poussineau)
 | 
			
		||||
  - Braille support (Samuel Thibault)
 | 
			
		||||
  - Freecom MusicPal system emulation (Jan Kiszka)
 | 
			
		||||
  - OMAP242x and Nokia N800, N810 machines (Andrzej Zaborowski)
 | 
			
		||||
  - EsounD audio driver (Frederick Reeve)
 | 
			
		||||
  - Gravis Ultrasound GF1 sound card (Tibor "TS" Schütz)
 | 
			
		||||
  - Many, many, bug fixes and new features
 | 
			
		||||
 | 
			
		||||
version 0.9.1:
 | 
			
		||||
 | 
			
		||||
  - TFTP booting from host directory (Anthony Liguori, Erwan Velu)
 | 
			
		||||
  - Tap device emulation for Solaris (Sittichai Palanisong)
 | 
			
		||||
  - Monitor multiplexing to several I/O channels (Jason Wessel)
 | 
			
		||||
  - ds1225y nvram support (Herve Poussineau)
 | 
			
		||||
  - CPU model selection support (J. Mayer, Paul Brook, Herve Poussineau)
 | 
			
		||||
  - Several Sparc fixes (Aurelien Jarno, Blue Swirl, Robert Reif)
 | 
			
		||||
  - MIPS 64-bit FPU support (Thiemo Seufer)
 | 
			
		||||
  - Xscale PDA emulation (Andrzej Zaborowski)
 | 
			
		||||
  - ColdFire system emulation (Paul Brook)
 | 
			
		||||
  - Improved SH4 support (Magnus Damm)
 | 
			
		||||
  - MIPS64 support (Aurelien Jarno, Thiemo Seufer)
 | 
			
		||||
  - Preliminary Alpha guest support (J. Mayer)
 | 
			
		||||
  - Read-only support for Parallels disk images (Alex Beregszaszi)
 | 
			
		||||
  - SVM (x86 virtualization) support (Alexander Graf)
 | 
			
		||||
  - CRIS emulation (Edgar E. Iglesias)
 | 
			
		||||
  - SPARC32PLUS execution support (Blue Swirl)
 | 
			
		||||
  - MIPS mipssim pseudo machine (Thiemo Seufer)
 | 
			
		||||
  - Strace for Linux userland emulation (Stuart Anderson, Thayne Harbaugh)
 | 
			
		||||
  - OMAP310 MPU emulation plus Palm T|E machine (Andrzej Zaborowski)
 | 
			
		||||
  - ARM v6, v7, NEON SIMD and SMP emulation (Paul Brook/CodeSourcery)
 | 
			
		||||
  - Gumstix boards: connex and verdex emulation (Thorsten Zitterell)
 | 
			
		||||
  - Intel mainstone II board emulation (Armin Kuster)
 | 
			
		||||
  - VMware SVGA II graphics card support (Andrzej Zaborowski)
 | 
			
		||||
 | 
			
		||||
version 0.9.0:
 | 
			
		||||
 | 
			
		||||
  - Support for relative paths in backing files for disk images
 | 
			
		||||
  - Async file I/O API
 | 
			
		||||
  - New qcow2 disk image format
 | 
			
		||||
  - Support of multiple VM snapshots
 | 
			
		||||
  - Linux: specific host CDROM and floppy support
 | 
			
		||||
  - SMM support
 | 
			
		||||
  - Moved PCI init, MP table init and ACPI table init to Bochs BIOS
 | 
			
		||||
  - Support for MIPS32 Release 2 instruction set (Thiemo Seufer)
 | 
			
		||||
  - MIPS Malta system emulation (Aurelien Jarno, Stefan Weil)
 | 
			
		||||
  - Darwin userspace emulation (Pierre d'Herbemont)
 | 
			
		||||
  - m68k user support (Paul Brook)
 | 
			
		||||
  - several x86 and x86_64 emulation fixes
 | 
			
		||||
  - Mouse relative offset VNC extension (Anthony Liguori)
 | 
			
		||||
  - PXE boot support (Anthony Liguori)
 | 
			
		||||
  - '-daemonize' option (Anthony Liguori)
 | 
			
		||||
 | 
			
		||||
version 0.8.2:
 | 
			
		||||
 | 
			
		||||
  - ACPI support
 | 
			
		||||
  - PC VGA BIOS fixes
 | 
			
		||||
  - switch to OpenBios for SPARC targets (Blue Swirl)
 | 
			
		||||
  - VNC server fixes
 | 
			
		||||
  - MIPS FPU support (Marius Groeger)
 | 
			
		||||
  - Solaris/SPARC host support (Juergen Keil)
 | 
			
		||||
  - PPC breakpoints and single stepping (Jason Wessel)
 | 
			
		||||
  - USB updates (Paul Brook)
 | 
			
		||||
  - UDP/TCP/telnet character devices (Jason Wessel)
 | 
			
		||||
  - Windows sparse file support (Frediano Ziglio)
 | 
			
		||||
  - RTL8139 NIC TCP segmentation offloading (Igor Kovalenko)
 | 
			
		||||
  - PCNET NIC support (Antony T Curtis)
 | 
			
		||||
  - Support for variable frequency host CPUs
 | 
			
		||||
  - Workaround for win32 SMP hosts
 | 
			
		||||
  - Support for AMD Flash memories (Jocelyn Mayer)
 | 
			
		||||
  - Audio capture to WAV files support (malc)
 | 
			
		||||
 | 
			
		||||
version 0.8.1:
 | 
			
		||||
 | 
			
		||||
  - USB tablet support (Brad Campbell, Anthony Liguori)
 | 
			
		||||
  - win32 host serial support (Kazu)
 | 
			
		||||
  - PC speaker support (Joachim Henke)
 | 
			
		||||
  - IDE LBA48 support (Jens Axboe)
 | 
			
		||||
  - SSE3 support
 | 
			
		||||
  - Solaris port (Juergen Keil)
 | 
			
		||||
  - Preliminary SH4 target (Samuel Tardieu)
 | 
			
		||||
  - VNC server (Anthony Liguori)
 | 
			
		||||
  - slirp fixes (Ed Swierk et al.)
 | 
			
		||||
  - USB fixes
 | 
			
		||||
  - ARM Versatile Platform Baseboard emulation (Paul Brook)
 | 
			
		||||
 | 
			
		||||
version 0.8.0:
 | 
			
		||||
 | 
			
		||||
  - ARM system emulation: Arm Integrator/CP board with an arm1026ej-s
 | 
			
		||||
    cpu (Paul Brook)
 | 
			
		||||
  - SMP support
 | 
			
		||||
  - Mac OS X cocoa improvements (Mike Kronenberg)
 | 
			
		||||
  - Mac OS X CoreAudio driver (Mike Kronenberg)
 | 
			
		||||
  - DirectSound driver (malc)
 | 
			
		||||
  - ALSA audio driver (malc)
 | 
			
		||||
  - new audio options: '-soundhw' and '-audio-help' (malc)
 | 
			
		||||
  - ES1370 PCI audio device (malc)
 | 
			
		||||
  - Initial USB support
 | 
			
		||||
  - Linux host serial port access
 | 
			
		||||
  - Linux host low level parallel port access
 | 
			
		||||
  - New network emulation code supporting VLANs.
 | 
			
		||||
  - MIPS and MIPSel User Linux emulation
 | 
			
		||||
  - MIPS fixes to boot Linux (Daniel Jacobowitz)
 | 
			
		||||
  - NX bit support
 | 
			
		||||
  - Initial SPARC SMP support (Blue Swirl)
 | 
			
		||||
  - Major overhaul of the virtual FAT driver for read/write support
 | 
			
		||||
    (Johannes Schindelin)
 | 
			
		||||
 | 
			
		||||
version 0.7.2:
 | 
			
		||||
 | 
			
		||||
  - x86_64 fixes (Win2000 and Linux 2.6 boot in 32 bit)
 | 
			
		||||
  - merge self modifying code handling in dirty ram page mecanism.
 | 
			
		||||
  - MIPS fixes (Ralf Baechle)
 | 
			
		||||
  - better user net performances
 | 
			
		||||
 | 
			
		||||
version 0.7.1:
 | 
			
		||||
 | 
			
		||||
  - read-only Virtual FAT support (Johannes Schindelin)
 | 
			
		||||
  - Windows 2000 install disk full hack (original idea from Vladimir
 | 
			
		||||
    N. Oleynik)
 | 
			
		||||
  - VMDK disk image creation (Filip Navara)
 | 
			
		||||
  - SPARC64 progress (Blue Swirl)
 | 
			
		||||
  - initial MIPS support (Jocelyn mayer)
 | 
			
		||||
  - MIPS improvements (Ralf Baechle)
 | 
			
		||||
  - 64 bit fixes in user networking (initial patch by Gwenole Beauchesne)
 | 
			
		||||
  - IOAPIC support (Filip Navara)
 | 
			
		||||
 | 
			
		||||
version 0.7.0:
 | 
			
		||||
 | 
			
		||||
  - better BIOS translation and HDD geometry auto-detection
 | 
			
		||||
  - user mode networking bug fix
 | 
			
		||||
  - undocumented FPU ops support
 | 
			
		||||
  - Cirrus VGA: support for 1280x1024x[8,15,16] modes
 | 
			
		||||
  - 'pidfile' option
 | 
			
		||||
  - .dmg disk image format support (Johannes Schindelin)
 | 
			
		||||
  - keymaps support (initial patch by Johannes Schindelin)
 | 
			
		||||
  - big endian ARM support (Lennert Buytenhek)
 | 
			
		||||
  - added generic 64 bit target support
 | 
			
		||||
  - x86_64 target support
 | 
			
		||||
  - initial APIC support
 | 
			
		||||
  - MMX/SSE/SSE2/PNI support
 | 
			
		||||
  - PC parallel port support (Mark Jonckheere)
 | 
			
		||||
  - initial SPARC64 support (Blue Swirl)
 | 
			
		||||
  - SPARC target boots Linux (Blue Swirl)
 | 
			
		||||
  - armv5te user mode support (Paul Brook)
 | 
			
		||||
  - ARM VFP support (Paul Brook)
 | 
			
		||||
  - ARM "Angel" semihosting syscalls (Paul Brook)
 | 
			
		||||
  - user mode gdb stub support (Paul Brook)
 | 
			
		||||
  - Samba 3 support
 | 
			
		||||
  - initial Cocoa support (Pierre d'Herbemont)
 | 
			
		||||
  - generic FPU emulation code
 | 
			
		||||
  - Virtual PC read-only disk image support (Alex Beregszaszi)
 | 
			
		||||
 | 
			
		||||
version 0.6.1:
 | 
			
		||||
 | 
			
		||||
  - Mac OS X port (Pierre d'Herbemont)
 | 
			
		||||
  - Virtual console support
 | 
			
		||||
  - Better monitor line edition
 | 
			
		||||
  - New block device layer
 | 
			
		||||
  - New 'qcow' growable disk image support with AES encryption and
 | 
			
		||||
    transparent decompression
 | 
			
		||||
  - VMware 3 and 4 read-only disk image support (untested)
 | 
			
		||||
  - Support for up to 4 serial ports
 | 
			
		||||
  - TFTP server support (Magnus Damm)
 | 
			
		||||
  - Port redirection support in user mode networking
 | 
			
		||||
  - Support for not executable data sections
 | 
			
		||||
  - Compressed loop disk image support (Johannes Schindelin)
 | 
			
		||||
  - Level triggered IRQ fix (aka NE2000 PCI performance fix) (Steve
 | 
			
		||||
    Wormley)
 | 
			
		||||
  - Fixed Fedora Core 2 problems (now you can run qemu without any
 | 
			
		||||
    LD_ASSUME_KERNEL tricks on FC2)
 | 
			
		||||
  - DHCP fix for Windows (accept DHCPREQUEST alone)
 | 
			
		||||
  - SPARC system emulation (Blue Swirl)
 | 
			
		||||
  - Automatic Samba configuration for host file access from Windows.
 | 
			
		||||
  - '-loadvm' and '-full-screen' options
 | 
			
		||||
  - ne2000 savevm support (Johannes Schindelin)
 | 
			
		||||
  - Ctrl-Alt is now the default grab key. Ctrl-Alt-[0-9] switches to
 | 
			
		||||
    the virtual consoles.
 | 
			
		||||
  - BIOS floppy fix for NT4 (Mike Nordell, Derek Fawcus, Volker Ruppert)
 | 
			
		||||
  - Floppy fixes for NT4 and NT5 (Mike Nordell)
 | 
			
		||||
  - NT4 IDE fixes (Ben Pfaf, Mike Nordell)
 | 
			
		||||
  - SDL Audio support and SB16 fixes (malc)
 | 
			
		||||
  - ENTER instruction bug fix (initial patch by Stefan Kisdaroczi)
 | 
			
		||||
  - VGA font change fix
 | 
			
		||||
  - VGA read-only CRTC register fix
 | 
			
		||||
 | 
			
		||||
version 0.6.0:
 | 
			
		||||
 | 
			
		||||
  - minimalist FPU exception support (NetBSD FPU probe fix)
 | 
			
		||||
  - cr0.ET fix (Win95 boot)
 | 
			
		||||
  - *BSD port (Markus Niemisto)
 | 
			
		||||
  - I/O access fix (signaled by Mark Jonckheere)
 | 
			
		||||
  - IDE drives serial number fix (Mike Nordell)
 | 
			
		||||
  - int13 CDROM BIOS fix (aka Solaris x86 install CD fix)
 | 
			
		||||
  - int15, ah=86 BIOS fix (aka Solaris x86 hardware probe hang up fix)
 | 
			
		||||
  - BSR/BSF "undefined behaviour" fix
 | 
			
		||||
  - vmdk2raw: convert VMware disk images to raw images
 | 
			
		||||
  - PCI support
 | 
			
		||||
  - NE2K PCI support
 | 
			
		||||
  - dummy VGA PCI support
 | 
			
		||||
  - VGA font selection fix (Daniel Serpell)
 | 
			
		||||
  - PIC reset fix (Hidemi KAWAI)
 | 
			
		||||
  - PIC spurious irq support (aka Solaris install bug)
 | 
			
		||||
  - added '-localtime' option
 | 
			
		||||
  - Cirrus CL-GD54xx VGA support (initial patch by Makoto Suzuki (suzu))
 | 
			
		||||
  - APM and system shutdown support
 | 
			
		||||
  - Fixed system reset
 | 
			
		||||
  - Support for other PC BIOSes
 | 
			
		||||
  - Initial PowerMac hardware emulation
 | 
			
		||||
  - PowerMac/PREP OpenFirmware compatible BIOS (Jocelyn Mayer)
 | 
			
		||||
  - initial IDE BMDMA support (needed for Darwin x86)
 | 
			
		||||
  - Set the default memory size for PC emulation to 128 MB
 | 
			
		||||
 | 
			
		||||
version 0.5.5:
 | 
			
		||||
 | 
			
		||||
  - SDL full screen support (initial patch by malc)
 | 
			
		||||
  - VGA support on PowerPC PREP
 | 
			
		||||
  - VBE fixes (Matthew Mastracci)
 | 
			
		||||
  - PIT fixes (aka Win98 hardware probe and "VGA slowness" bug)
 | 
			
		||||
  - IDE master only fixes (aka Win98 CD-ROM probe bug)
 | 
			
		||||
  - ARM load/store half word fix (Ulrich Hecht)
 | 
			
		||||
  - FDC fixes for Win98
 | 
			
		||||
 | 
			
		||||
version 0.5.4:
 | 
			
		||||
 | 
			
		||||
  - qemu-fast fixes
 | 
			
		||||
  - BIOS area protection fix (aka EMM386.EXE fix) (Mike Nordell)
 | 
			
		||||
  - keyboard/mouse fix (Mike Nordell)
 | 
			
		||||
  - IDE fixes (Linux did not recognized slave drivers)
 | 
			
		||||
  - VM86 EIP masking fix (aka NT5 install fix) (Mike Nordell)
 | 
			
		||||
  - QEMU can now boot a PowerPC Linux kernel (Jocelyn Mayer)
 | 
			
		||||
  - User mode network stack
 | 
			
		||||
  - imul imm8 fix + 0x82 opcode support (Hidemi KAWAI)
 | 
			
		||||
  - precise self modifying code (aka BeOS install bug)
 | 
			
		||||
 | 
			
		||||
version 0.5.3:
 | 
			
		||||
 | 
			
		||||
  - added Bochs VESA VBE support
 | 
			
		||||
  - VGA memory map mode 3 access fix (OS/2 install fix)
 | 
			
		||||
  - IDE fixes (Jens Axboe)
 | 
			
		||||
  - CPU interrupt fixes
 | 
			
		||||
  - fixed various TLB invalidation cases (NT install)
 | 
			
		||||
  - fixed cr0.WP semantics (XP install)
 | 
			
		||||
  - direct chaining support for SPARC and PowerPC (faster)
 | 
			
		||||
  - ARM NWFPE support (initial patch by Ulrich Hecht)
 | 
			
		||||
  - added specific x86 to x86 translator (close to native performance
 | 
			
		||||
    in qemu-i386 and qemu-fast)
 | 
			
		||||
  - shm syscalls support (Paul McKerras)
 | 
			
		||||
  - added accurate CR0.MP/ME/TS emulation
 | 
			
		||||
  - fixed DMA memory write access (Win95 boot floppy fix)
 | 
			
		||||
  - graphical x86 linux loader
 | 
			
		||||
  - command line monitor
 | 
			
		||||
  - generic removable device support
 | 
			
		||||
  - support of CD-ROM change
 | 
			
		||||
  - multiple network interface support
 | 
			
		||||
  - initial x86-64 host support (Gwenole Beauchesne)
 | 
			
		||||
  - lret to outer priviledge fix (OS/2 install fix)
 | 
			
		||||
  - task switch fixes (SkyOS boot)
 | 
			
		||||
  - VM save/restore commands
 | 
			
		||||
  - new timer API
 | 
			
		||||
  - more precise RTC emulation (periodic timers + time updates)
 | 
			
		||||
  - Win32 port (initial patch by Kazu)
 | 
			
		||||
 | 
			
		||||
version 0.5.2:
 | 
			
		||||
 | 
			
		||||
  - improved soft MMU speed (assembly functions and specializing)
 | 
			
		||||
  - improved multitasking speed by avoiding flushing TBs when
 | 
			
		||||
    switching tasks
 | 
			
		||||
  - improved qemu-fast speed
 | 
			
		||||
  - improved self modifying code handling (big performance gain in
 | 
			
		||||
    softmmu mode).
 | 
			
		||||
  - fixed IO checking
 | 
			
		||||
  - fixed CD-ROM detection (win98 install CD)
 | 
			
		||||
  - fixed addseg real mode bug (GRUB boot fix)
 | 
			
		||||
  - added ROM memory support (win98 boot)
 | 
			
		||||
  - fixed 'call Ev' in case of paging exception
 | 
			
		||||
  - updated the script 'qemu-binfmt-conf.sh' to use QEMU automagically
 | 
			
		||||
    when launching executables for the supported target CPUs.
 | 
			
		||||
  - PowerPC system emulation update (Jocelyn Mayer)
 | 
			
		||||
  - PC floppy emulation and DMA fixes (Jocelyn Mayer)
 | 
			
		||||
  - polled mode for PIC (Jocelyn Mayer)
 | 
			
		||||
  - fixed PTE dirty bit handling
 | 
			
		||||
  - fixed xadd same reg bug
 | 
			
		||||
  - fixed cmpxchg exception safeness
 | 
			
		||||
  - access to virtual memory in gdb stub
 | 
			
		||||
  - task gate and NT flag fixes
 | 
			
		||||
  - eflags optimisation fix for string operations
 | 
			
		||||
 | 
			
		||||
version 0.5.1:
 | 
			
		||||
 | 
			
		||||
  - float access fixes when using soft mmu
 | 
			
		||||
  - PC emulation support on PowerPC
 | 
			
		||||
  - A20 support
 | 
			
		||||
  - IDE CD-ROM emulation
 | 
			
		||||
  - ARM fixes (Ulrich Hecht)
 | 
			
		||||
  - SB16 emulation (malc)
 | 
			
		||||
  - IRET and INT fixes in VM86 mode with IOPL=3
 | 
			
		||||
  - Port I/Os use TSS io map
 | 
			
		||||
  - Full task switching/task gate support
 | 
			
		||||
  - added verr, verw, arpl, fcmovxx
 | 
			
		||||
  - PowerPC target support (Jocelyn Mayer)
 | 
			
		||||
  - Major SPARC target fixes (dynamically linked programs begin to work)
 | 
			
		||||
 | 
			
		||||
version 0.5.0:
 | 
			
		||||
 | 
			
		||||
  - full hardware level VGA emulation
 | 
			
		||||
  - graphical display with SDL
 | 
			
		||||
  - added PS/2 mouse and keyboard emulation
 | 
			
		||||
  - popw (%esp) fix
 | 
			
		||||
  - mov to/from segment data width fix
 | 
			
		||||
  - added real mode support
 | 
			
		||||
  - added Bochs BIOS and LGPL'ed VGA BIOS loader in qemu
 | 
			
		||||
  - m68k host port (Richard Zidlicky)
 | 
			
		||||
  - partial soft MMU support for memory mapped I/Os
 | 
			
		||||
  - multi-target build
 | 
			
		||||
  - fixed: no error code in hardware interrupts
 | 
			
		||||
  - fixed: pop ss, mov ss, x and sti disable hardware irqs for the next insn
 | 
			
		||||
  - correct single stepping thru string operations
 | 
			
		||||
  - preliminary SPARC target support (Thomas M. Ogrisegg)
 | 
			
		||||
  - tun-fd option (Rusty Russell)
 | 
			
		||||
  - automatic IDE geometry detection
 | 
			
		||||
  - renamed 'vl' to qemu[-fast] and user qemu to qemu-{cpu}.
 | 
			
		||||
  - added man page
 | 
			
		||||
  - added full soft mmu mode to launch unpatched OSes.
 | 
			
		||||
 | 
			
		||||
version 0.4.3:
 | 
			
		||||
 | 
			
		||||
  - x86 exception fix in case of nop instruction.
 | 
			
		||||
  - gcc 3.2.2 bug workaround (RedHat 9 fix)
 | 
			
		||||
  - sparc and Alpha host fixes
 | 
			
		||||
  - many ARM target fixes: 'ls' and 'bash' can be launched.
 | 
			
		||||
 | 
			
		||||
version 0.4.2:
 | 
			
		||||
 | 
			
		||||
 - many exception handling fixes (can compile a Linux kernel inside vl)
 | 
			
		||||
 - IDE emulation support
 | 
			
		||||
 - initial GDB stub support
 | 
			
		||||
 - deferred update support for disk images (Rusty Russell)
 | 
			
		||||
 - accept User Mode Linux Copy On Write disk images
 | 
			
		||||
 - SMP kernels can at least be booted
 | 
			
		||||
 | 
			
		||||
version 0.4.1:
 | 
			
		||||
 | 
			
		||||
 - more accurate timer support in vl.
 | 
			
		||||
 - more reliable NE2000 probe in vl.
 | 
			
		||||
 - added 2.5.66 kernel in vl-test.
 | 
			
		||||
 - added VLTMPDIR environment variable in vl.
 | 
			
		||||
 | 
			
		||||
version 0.4:
 | 
			
		||||
 | 
			
		||||
 - initial support for ring 0 x86 processor emulation
 | 
			
		||||
 - fixed signal handling for correct dosemu DPMI emulation
 | 
			
		||||
 - fast x86 MMU emulation with mmap()
 | 
			
		||||
 - fixed popl (%esp) case
 | 
			
		||||
 - Linux kernel can be executed by QEMU with the 'vl' command.
 | 
			
		||||
 | 
			
		||||
version 0.3:
 | 
			
		||||
 | 
			
		||||
 - initial support for ARM emulation
 | 
			
		||||
 - added fnsave, frstor, fnstenv, fldenv FPU instructions
 | 
			
		||||
 - added FPU register save in signal emulation
 | 
			
		||||
 - initial ARM port
 | 
			
		||||
 - Sparc and Alpha ports work on the regression test
 | 
			
		||||
 - generic ioctl number conversion
 | 
			
		||||
 - fixed ioctl type conversion
 | 
			
		||||
 | 
			
		||||
version 0.2:
 | 
			
		||||
 | 
			
		||||
 - PowerPC disassembly and ELF symbols output (Rusty Russell)
 | 
			
		||||
 - flock support (Rusty Russell)
 | 
			
		||||
 - ugetrlimit support (Rusty Russell)
 | 
			
		||||
 - fstat64 fix (Rusty Russell)
 | 
			
		||||
 - initial Alpha port (Falk Hueffner)
 | 
			
		||||
 - initial IA64 port (Matt Wilson)
 | 
			
		||||
 - initial Sparc and Sparc64 port (David S. Miller)
 | 
			
		||||
 - added HLT instruction
 | 
			
		||||
 - LRET instruction fix.
 | 
			
		||||
 - added GPF generation for I/Os.
 | 
			
		||||
 - added INT3 and TF flag support.
 | 
			
		||||
 - SHL instruction C flag fix.
 | 
			
		||||
 - mmap emulation for host page size > 4KB
 | 
			
		||||
 - self-modifying code support
 | 
			
		||||
 - better VM86 support (dosemu works on non trivial programs)
 | 
			
		||||
 - precise exception support (EIP is computed correctly in most cases)
 | 
			
		||||
 - more precise LDT/GDT/IDT emulation
 | 
			
		||||
 - faster segment load in vm86 mode
 | 
			
		||||
 - direct chaining of basic blocks (faster emulation)
 | 
			
		||||
 | 
			
		||||
version 0.1.6:
 | 
			
		||||
 | 
			
		||||
 - automatic library search system. QEMU can now work with unpatched
 | 
			
		||||
   ELF dynamic loader and libc (Rusty Russell).
 | 
			
		||||
 - ISO C warning fixes (Alistair Strachan)
 | 
			
		||||
 - first self-virtualizable version (works only as long as the
 | 
			
		||||
   translation cache is not flushed)
 | 
			
		||||
 - RH9 fixes
 | 
			
		||||
 | 
			
		||||
version 0.1.5:
 | 
			
		||||
 | 
			
		||||
 - ppc64 support + personality() patch (Rusty Russell)
 | 
			
		||||
 - first Alpha CPU patches (Falk Hueffner)
 | 
			
		||||
 - removed bfd.h dependency
 | 
			
		||||
 - fixed shrd, shld, idivl and divl on PowerPC.
 | 
			
		||||
 - fixed buggy glibc PowerPC rint() function (test-i386 passes now on PowerPC).
 | 
			
		||||
 | 
			
		||||
version 0.1.4:
 | 
			
		||||
 | 
			
		||||
 - more accurate VM86 emulation (can launch small DOS 16 bit
 | 
			
		||||
   executables in wine).
 | 
			
		||||
 - fixed push/pop fs/gs
 | 
			
		||||
 - added iret instruction.
 | 
			
		||||
 - added times() syscall and SIOCATMARK ioctl.
 | 
			
		||||
 | 
			
		||||
version 0.1.3:
 | 
			
		||||
 | 
			
		||||
 - S390 support (Ulrich Weigand)
 | 
			
		||||
 - glibc 2.3.x compile fix (Ulrich Weigand)
 | 
			
		||||
 - socketcall endian fix (Ulrich Weigand)
 | 
			
		||||
 - struct sockaddr endian fix (Ulrich Weigand)
 | 
			
		||||
 - sendmsg/recvmsg endian fix (Ulrich Weigand)
 | 
			
		||||
 - execve endian fix (Ulrich Weigand)
 | 
			
		||||
 - fdset endian fix (Ulrich Weigand)
 | 
			
		||||
 - partial setsockopt syscall support (Ulrich Weigand)
 | 
			
		||||
 - more accurate pushf/popf emulation
 | 
			
		||||
 - first partial vm86() syscall support (can be used with runcom example).
 | 
			
		||||
 - added bound, cmpxchg8b, cpuid instructions
 | 
			
		||||
 - added 16 bit addressing support/override for string operations
 | 
			
		||||
 - poll() fix
 | 
			
		||||
 | 
			
		||||
version 0.1.2:
 | 
			
		||||
 | 
			
		||||
 - compile fixes
 | 
			
		||||
 - xlat instruction
 | 
			
		||||
 - xchg instruction memory lock
 | 
			
		||||
 - added simple vm86 example (not working with QEMU yet). The 54 byte
 | 
			
		||||
   DOS executable 'pi_10.com' program was released by Bertram
 | 
			
		||||
   Felgenhauer (more information at http://www.boo.net/~jasonp/pipage.html).
 | 
			
		||||
 | 
			
		||||
version 0.1.1:
 | 
			
		||||
 | 
			
		||||
 - glibc 2.2 compilation fixes
 | 
			
		||||
 - added -s and -L options
 | 
			
		||||
 - binary distribution of x86 glibc and wine
 | 
			
		||||
 - big endian fixes in ELF loader and getdents.
 | 
			
		||||
 | 
			
		||||
version 0.1:
 | 
			
		||||
 | 
			
		||||
 - initial public release.
 | 
			
		||||
							
								
								
									
										122
									
								
								HACKING
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										122
									
								
								HACKING
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,122 @@
 | 
			
		||||
1. Preprocessor
 | 
			
		||||
 | 
			
		||||
For variadic macros, stick with this C99-like syntax:
 | 
			
		||||
 | 
			
		||||
#define DPRINTF(fmt, ...)                                       \
 | 
			
		||||
    do { printf("IRQ: " fmt, ## __VA_ARGS__); } while (0)
 | 
			
		||||
 | 
			
		||||
2. C types
 | 
			
		||||
 | 
			
		||||
It should be common sense to use the right type, but we have collected
 | 
			
		||||
a few useful guidelines here.
 | 
			
		||||
 | 
			
		||||
2.1. Scalars
 | 
			
		||||
 | 
			
		||||
If you're using "int" or "long", odds are good that there's a better type.
 | 
			
		||||
If a variable is counting something, it should be declared with an
 | 
			
		||||
unsigned type.
 | 
			
		||||
 | 
			
		||||
If it's host memory-size related, size_t should be a good choice (use
 | 
			
		||||
ssize_t only if required). Guest RAM memory offsets must use ram_addr_t,
 | 
			
		||||
but only for RAM, it may not cover whole guest address space.
 | 
			
		||||
 | 
			
		||||
If it's file-size related, use off_t.
 | 
			
		||||
If it's file-offset related (i.e., signed), use off_t.
 | 
			
		||||
If it's just counting small numbers use "unsigned int";
 | 
			
		||||
(on all but oddball embedded systems, you can assume that that
 | 
			
		||||
type is at least four bytes wide).
 | 
			
		||||
 | 
			
		||||
In the event that you require a specific width, use a standard type
 | 
			
		||||
like int32_t, uint32_t, uint64_t, etc.  The specific types are
 | 
			
		||||
mandatory for VMState fields.
 | 
			
		||||
 | 
			
		||||
Don't use Linux kernel internal types like u32, __u32 or __le32.
 | 
			
		||||
 | 
			
		||||
Use target_phys_addr_t for guest physical addresses except pcibus_t
 | 
			
		||||
for PCI addresses.  In addition, ram_addr_t is a QEMU internal address
 | 
			
		||||
space that maps guest RAM physical addresses into an intermediate
 | 
			
		||||
address space that can map to host virtual address spaces.  Generally
 | 
			
		||||
speaking, the size of guest memory can always fit into ram_addr_t but
 | 
			
		||||
it would not be correct to store an actual guest physical address in a
 | 
			
		||||
ram_addr_t.
 | 
			
		||||
 | 
			
		||||
Use target_ulong (or abi_ulong) for CPU virtual addresses, however
 | 
			
		||||
devices should not need to use target_ulong.
 | 
			
		||||
 | 
			
		||||
Of course, take all of the above with a grain of salt.  If you're about
 | 
			
		||||
to use some system interface that requires a type like size_t, pid_t or
 | 
			
		||||
off_t, use matching types for any corresponding variables.
 | 
			
		||||
 | 
			
		||||
Also, if you try to use e.g., "unsigned int" as a type, and that
 | 
			
		||||
conflicts with the signedness of a related variable, sometimes
 | 
			
		||||
it's best just to use the *wrong* type, if "pulling the thread"
 | 
			
		||||
and fixing all related variables would be too invasive.
 | 
			
		||||
 | 
			
		||||
Finally, while using descriptive types is important, be careful not to
 | 
			
		||||
go overboard.  If whatever you're doing causes warnings, or requires
 | 
			
		||||
casts, then reconsider or ask for help.
 | 
			
		||||
 | 
			
		||||
2.2. Pointers
 | 
			
		||||
 | 
			
		||||
Ensure that all of your pointers are "const-correct".
 | 
			
		||||
Unless a pointer is used to modify the pointed-to storage,
 | 
			
		||||
give it the "const" attribute.  That way, the reader knows
 | 
			
		||||
up-front that this is a read-only pointer.  Perhaps more
 | 
			
		||||
importantly, if we're diligent about this, when you see a non-const
 | 
			
		||||
pointer, you're guaranteed that it is used to modify the storage
 | 
			
		||||
it points to, or it is aliased to another pointer that is.
 | 
			
		||||
 | 
			
		||||
2.3. Typedefs
 | 
			
		||||
Typedefs are used to eliminate the redundant 'struct' keyword.
 | 
			
		||||
 | 
			
		||||
2.4. Reserved namespaces in C and POSIX
 | 
			
		||||
Underscore capital, double underscore, and underscore 't' suffixes should be
 | 
			
		||||
avoided.
 | 
			
		||||
 | 
			
		||||
3. Low level memory management
 | 
			
		||||
 | 
			
		||||
Use of the malloc/free/realloc/calloc/valloc/memalign/posix_memalign
 | 
			
		||||
APIs is not allowed in the QEMU codebase. Instead of these routines,
 | 
			
		||||
use the replacement qemu_malloc/qemu_mallocz/qemu_realloc/qemu_free or
 | 
			
		||||
qemu_vmalloc/qemu_memalign/qemu_vfree APIs.
 | 
			
		||||
 | 
			
		||||
Please note that NULL check for the qemu_malloc result is redundant and
 | 
			
		||||
that qemu_malloc() call with zero size is not allowed.
 | 
			
		||||
 | 
			
		||||
Memory allocated by qemu_vmalloc or qemu_memalign must be freed with
 | 
			
		||||
qemu_vfree, since breaking this will cause problems on Win32 and user
 | 
			
		||||
emulators.
 | 
			
		||||
 | 
			
		||||
4. String manipulation
 | 
			
		||||
 | 
			
		||||
Do not use the strncpy function.  According to the man page, it does
 | 
			
		||||
*not* guarantee a NULL-terminated buffer, which makes it extremely dangerous
 | 
			
		||||
to use.  Instead, use functionally equivalent function:
 | 
			
		||||
void pstrcpy(char *buf, int buf_size, const char *str)
 | 
			
		||||
 | 
			
		||||
Don't use strcat because it can't check for buffer overflows, but:
 | 
			
		||||
char *pstrcat(char *buf, int buf_size, const char *s)
 | 
			
		||||
 | 
			
		||||
The same limitation exists with sprintf and vsprintf, so use snprintf and
 | 
			
		||||
vsnprintf.
 | 
			
		||||
 | 
			
		||||
QEMU provides other useful string functions:
 | 
			
		||||
int strstart(const char *str, const char *val, const char **ptr)
 | 
			
		||||
int stristart(const char *str, const char *val, const char **ptr)
 | 
			
		||||
int qemu_strnlen(const char *s, int max_len)
 | 
			
		||||
 | 
			
		||||
There are also replacement character processing macros for isxyz and toxyz,
 | 
			
		||||
so instead of e.g. isalnum you should use qemu_isalnum.
 | 
			
		||||
 | 
			
		||||
Because of the memory management rules, you must use qemu_strdup/qemu_strndup
 | 
			
		||||
instead of plain strdup/strndup.
 | 
			
		||||
 | 
			
		||||
5. Printf-style functions
 | 
			
		||||
 | 
			
		||||
Whenever you add a new printf-style function, i.e., one with a format
 | 
			
		||||
string argument and following "..." in its prototype, be sure to use
 | 
			
		||||
gcc's printf attribute directive in the prototype.
 | 
			
		||||
 | 
			
		||||
This makes it so gcc's -Wformat and -Wformat-security options can do
 | 
			
		||||
their jobs and cross-check format strings with the number and types
 | 
			
		||||
of arguments.
 | 
			
		||||
							
								
								
									
										6
									
								
								Kconfig
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								Kconfig
									
									
									
									
									
								
							@@ -1,6 +0,0 @@
 | 
			
		||||
source Kconfig.host
 | 
			
		||||
source backends/Kconfig
 | 
			
		||||
source accel/Kconfig
 | 
			
		||||
source target/Kconfig
 | 
			
		||||
source hw/Kconfig
 | 
			
		||||
source semihosting/Kconfig
 | 
			
		||||
							
								
								
									
										54
									
								
								Kconfig.host
									
									
									
									
									
								
							
							
						
						
									
										54
									
								
								Kconfig.host
									
									
									
									
									
								
							@@ -1,54 +0,0 @@
 | 
			
		||||
# These are "proxy" symbols used to pass config-host.mak values
 | 
			
		||||
# down to Kconfig.  See also kconfig_external_symbols in
 | 
			
		||||
# meson.build: these two need to be kept in sync.
 | 
			
		||||
 | 
			
		||||
config LINUX
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config OPENGL
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config X11
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config PIXMAN
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config SPICE
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config IVSHMEM
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config TPM
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config FDT
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config VHOST_USER
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config VHOST_VDPA
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config VHOST_KERNEL
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config VIRTFS
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config MULTIPROCESS_ALLOWED
 | 
			
		||||
    bool
 | 
			
		||||
    imply MULTIPROCESS
 | 
			
		||||
 | 
			
		||||
config FUZZ
 | 
			
		||||
    bool
 | 
			
		||||
    select SPARSE_MEM
 | 
			
		||||
 | 
			
		||||
config VFIO_USER_SERVER_ALLOWED
 | 
			
		||||
    bool
 | 
			
		||||
    imply VFIO_USER_SERVER
 | 
			
		||||
 | 
			
		||||
config HV_BALLOON_POSSIBLE
 | 
			
		||||
    bool
 | 
			
		||||
							
								
								
									
										31
									
								
								LICENSE
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								LICENSE
									
									
									
									
									
								
							@@ -1,27 +1,18 @@
 | 
			
		||||
The QEMU distribution includes both the QEMU emulator and
 | 
			
		||||
various firmware files.  These are separate programs that are
 | 
			
		||||
distributed together for our users' convenience, and they have
 | 
			
		||||
separate licenses.
 | 
			
		||||
The following points clarify the QEMU license:
 | 
			
		||||
 | 
			
		||||
The following points clarify the license of the QEMU emulator:
 | 
			
		||||
1) QEMU as a whole is released under the GNU General Public License
 | 
			
		||||
 | 
			
		||||
1) The QEMU emulator as a whole is released under the GNU General
 | 
			
		||||
Public License, version 2.
 | 
			
		||||
2) Parts of QEMU have specific licenses which are compatible with the
 | 
			
		||||
GNU General Public License. Hence each source file contains its own
 | 
			
		||||
licensing information.
 | 
			
		||||
 | 
			
		||||
2) Parts of the QEMU emulator have specific licenses which are compatible
 | 
			
		||||
with the GNU General Public License, version 2. Hence each source file
 | 
			
		||||
contains its own licensing information.  Source files with no licensing
 | 
			
		||||
information are released under the GNU General Public License, version
 | 
			
		||||
2 or (at your option) any later version.
 | 
			
		||||
In particular, the QEMU virtual CPU core library (libqemu.a) is
 | 
			
		||||
released under the GNU Lesser General Public License. Many hardware
 | 
			
		||||
device emulation sources are released under the BSD license.
 | 
			
		||||
 | 
			
		||||
As of July 2013, contributions under version 2 of the GNU General Public
 | 
			
		||||
License (and no later version) are only accepted for the following files
 | 
			
		||||
or directories: bsd-user/, linux-user/, hw/vfio/, hw/xen/xen_pt*.
 | 
			
		||||
 | 
			
		||||
3) The Tiny Code Generator (TCG) is mostly under the BSD or MIT licenses;
 | 
			
		||||
   but some parts may be GPLv2 or other licenses. Again, see the
 | 
			
		||||
   specific licensing information in each source file.
 | 
			
		||||
3) The Tiny Code Generator (TCG) is released under the BSD license
 | 
			
		||||
   (see license headers in files).
 | 
			
		||||
 | 
			
		||||
4) QEMU is a trademark of Fabrice Bellard.
 | 
			
		||||
 | 
			
		||||
Fabrice Bellard and the QEMU team
 | 
			
		||||
Fabrice Bellard.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4238
									
								
								MAINTAINERS
									
									
									
									
									
								
							
							
						
						
									
										4238
									
								
								MAINTAINERS
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										664
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										664
									
								
								Makefile
									
									
									
									
									
								
							@@ -1,345 +1,411 @@
 | 
			
		||||
# Makefile for QEMU.
 | 
			
		||||
 | 
			
		||||
ifneq ($(words $(subst :, ,$(CURDIR))), 1)
 | 
			
		||||
  $(error main directory cannot contain spaces nor colons)
 | 
			
		||||
GENERATED_HEADERS = config-host.h trace.h qemu-options.def
 | 
			
		||||
ifeq ($(TRACE_BACKEND),dtrace)
 | 
			
		||||
GENERATED_HEADERS += trace-dtrace.h
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
# Always point to the root of the build tree (needs GNU make).
 | 
			
		||||
BUILD_DIR=$(CURDIR)
 | 
			
		||||
 | 
			
		||||
# Before including a proper config-host.mak, assume we are in the source tree
 | 
			
		||||
SRC_PATH=.
 | 
			
		||||
 | 
			
		||||
# Don't use implicit rules or variables
 | 
			
		||||
# we have explicit rules for everything
 | 
			
		||||
MAKEFLAGS += -rR
 | 
			
		||||
 | 
			
		||||
SHELL = bash -o pipefail
 | 
			
		||||
 | 
			
		||||
# Usage: $(call quiet-command,command and args,"NAME","args to print")
 | 
			
		||||
# This will run "command and args", and either:
 | 
			
		||||
#  if V=1 just print the whole command and args
 | 
			
		||||
#  otherwise print the 'quiet' output in the format "  NAME     args to print"
 | 
			
		||||
# NAME should be a short name of the command, 7 letters or fewer.
 | 
			
		||||
# If called with only a single argument, will print nothing in quiet mode.
 | 
			
		||||
quiet-command-run = $(if $(V),,$(if $2,printf "  %-7s %s\n" $2 $3 && ))$1
 | 
			
		||||
quiet-@ = $(if $(V),,@)
 | 
			
		||||
quiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3)
 | 
			
		||||
 | 
			
		||||
UNCHECKED_GOALS := TAGS gtags cscope ctags dist \
 | 
			
		||||
    help check-help print-% \
 | 
			
		||||
    docker docker-% lcitool-refresh vm-help vm-test vm-build-%
 | 
			
		||||
 | 
			
		||||
all:
 | 
			
		||||
.PHONY: all clean distclean recurse-all dist msi FORCE
 | 
			
		||||
ifneq ($(wildcard config-host.mak),)
 | 
			
		||||
# Put the all: rule here so that config-host.mak can contain dependencies.
 | 
			
		||||
all: build-all
 | 
			
		||||
include config-host.mak
 | 
			
		||||
include $(SRC_PATH)/rules.mak
 | 
			
		||||
config-host.mak: $(SRC_PATH)/configure
 | 
			
		||||
	@echo $@ is out-of-date, running configure
 | 
			
		||||
	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
 | 
			
		||||
else
 | 
			
		||||
config-host.mak:
 | 
			
		||||
	@echo "Please call configure before running make!"
 | 
			
		||||
	@exit 1
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
# Don't try to regenerate Makefile or configure
 | 
			
		||||
# We don't generate any of them
 | 
			
		||||
Makefile: ;
 | 
			
		||||
configure: ;
 | 
			
		||||
 | 
			
		||||
# All following code might depend on configuration variables
 | 
			
		||||
ifneq ($(wildcard config-host.mak),)
 | 
			
		||||
include config-host.mak
 | 
			
		||||
.PHONY: all clean cscope distclean dvi html info install install-doc \
 | 
			
		||||
	pdf recurse-all speed tar tarbin test build-all
 | 
			
		||||
 | 
			
		||||
include Makefile.prereqs
 | 
			
		||||
Makefile.prereqs: config-host.mak
 | 
			
		||||
$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
 | 
			
		||||
 | 
			
		||||
# 0. ensure the build tree is okay
 | 
			
		||||
LIBS+=-lz $(LIBS_TOOLS)
 | 
			
		||||
 | 
			
		||||
# Check that we're not trying to do an out-of-tree build from
 | 
			
		||||
# a tree that's been used for an in-tree build.
 | 
			
		||||
ifneq ($(realpath $(SRC_PATH)),$(realpath .))
 | 
			
		||||
ifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
 | 
			
		||||
$(error This is an out of tree build but your source tree ($(SRC_PATH)) \
 | 
			
		||||
seems to have been used for an in-tree build. You can fix this by running \
 | 
			
		||||
"$(MAKE) distclean && rm -rf *-linux-user *-softmmu" in your source tree)
 | 
			
		||||
endif
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
# force a rerun of configure if config-host.mak is too old or corrupted
 | 
			
		||||
ifeq ($(MESON),)
 | 
			
		||||
.PHONY: config-host.mak
 | 
			
		||||
x := $(shell rm -rf meson-private meson-info meson-logs)
 | 
			
		||||
endif
 | 
			
		||||
ifeq ($(NINJA),)
 | 
			
		||||
.PHONY: config-host.mak
 | 
			
		||||
x := $(shell rm -rf meson-private meson-info meson-logs)
 | 
			
		||||
ifdef BUILD_DOCS
 | 
			
		||||
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
 | 
			
		||||
else
 | 
			
		||||
export NINJA
 | 
			
		||||
endif
 | 
			
		||||
ifeq ($(wildcard build.ninja),)
 | 
			
		||||
.PHONY: config-host.mak
 | 
			
		||||
x := $(shell rm -rf meson-private meson-info meson-logs)
 | 
			
		||||
endif
 | 
			
		||||
ifeq ($(origin prefix),file)
 | 
			
		||||
.PHONY: config-host.mak
 | 
			
		||||
x := $(shell rm -rf meson-private meson-info meson-logs)
 | 
			
		||||
DOCS=
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
# 1. ensure config-host.mak is up-to-date
 | 
			
		||||
config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/scripts/meson-buildoptions.sh $(SRC_PATH)/VERSION
 | 
			
		||||
	@echo config-host.mak is out-of-date, running configure
 | 
			
		||||
	@if test -f meson-private/coredata.dat; then \
 | 
			
		||||
	  ./config.status --skip-meson; \
 | 
			
		||||
	else \
 | 
			
		||||
	  ./config.status; \
 | 
			
		||||
	fi
 | 
			
		||||
SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
 | 
			
		||||
SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
 | 
			
		||||
SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
 | 
			
		||||
 | 
			
		||||
# 2. meson.stamp exists if meson has run at least once (so ninja reconfigure
 | 
			
		||||
# works), but otherwise never needs to be updated
 | 
			
		||||
config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
 | 
			
		||||
	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
 | 
			
		||||
 | 
			
		||||
meson-private/coredata.dat: meson.stamp
 | 
			
		||||
meson.stamp: config-host.mak
 | 
			
		||||
	@touch meson.stamp
 | 
			
		||||
-include $(SUBDIR_DEVICES_MAK_DEP)
 | 
			
		||||
 | 
			
		||||
# 3. ensure meson-generated build files are up-to-date
 | 
			
		||||
%/config-devices.mak: default-configs/%.mak
 | 
			
		||||
	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
 | 
			
		||||
	@if test -f $@; then \
 | 
			
		||||
	  if cmp -s $@.old $@; then \
 | 
			
		||||
	    mv $@.tmp $@; \
 | 
			
		||||
	    cp -p $@ $@.old; \
 | 
			
		||||
	  else \
 | 
			
		||||
	    if test -f $@.old; then \
 | 
			
		||||
	      echo "WARNING: $@ (user modified) out of date.";\
 | 
			
		||||
	    else \
 | 
			
		||||
	      echo "WARNING: $@ out of date.";\
 | 
			
		||||
	    fi; \
 | 
			
		||||
	    echo "Run \"make defconfig\" to regenerate."; \
 | 
			
		||||
	    rm $@.tmp; \
 | 
			
		||||
	  fi; \
 | 
			
		||||
	 else \
 | 
			
		||||
	  mv $@.tmp $@; \
 | 
			
		||||
	  cp -p $@ $@.old; \
 | 
			
		||||
	 fi
 | 
			
		||||
 | 
			
		||||
ifneq ($(NINJA),)
 | 
			
		||||
Makefile.ninja: build.ninja
 | 
			
		||||
	$(quiet-@){ \
 | 
			
		||||
	  echo 'ninja-targets = \'; \
 | 
			
		||||
	  $(NINJA) -t targets all | sed 's/:.*//; $$!s/$$/ \\/'; \
 | 
			
		||||
	  echo 'build-files = \'; \
 | 
			
		||||
	  $(NINJA) -t query build.ninja | sed -n '1,/^  input:/d; /^  outputs:/q; s/$$/ \\/p'; \
 | 
			
		||||
	} > $@.tmp && mv $@.tmp $@
 | 
			
		||||
-include Makefile.ninja
 | 
			
		||||
defconfig:
 | 
			
		||||
	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
 | 
			
		||||
 | 
			
		||||
-include config-all-devices.mak
 | 
			
		||||
 | 
			
		||||
build-all: $(DOCS) $(TOOLS) recurse-all
 | 
			
		||||
 | 
			
		||||
config-host.h: config-host.h-timestamp
 | 
			
		||||
config-host.h-timestamp: config-host.mak
 | 
			
		||||
qemu-options.def: $(SRC_PATH)/qemu-options.hx
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
 | 
			
		||||
 | 
			
		||||
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
 | 
			
		||||
 | 
			
		||||
subdir-%: $(GENERATED_HEADERS)
 | 
			
		||||
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
 | 
			
		||||
 | 
			
		||||
ifneq ($(wildcard config-host.mak),)
 | 
			
		||||
include $(SRC_PATH)/Makefile.objs
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifneq ($(MESON),)
 | 
			
		||||
# The path to meson always points to pyvenv/bin/meson, but the absolute
 | 
			
		||||
# paths could change.  In that case, force a regeneration of build.ninja.
 | 
			
		||||
# Note that this invocation of $(NINJA), just like when Make rebuilds
 | 
			
		||||
# Makefiles, does not include -n.
 | 
			
		||||
build.ninja: build.ninja.stamp
 | 
			
		||||
$(build-files):
 | 
			
		||||
build.ninja.stamp: meson.stamp $(build-files)
 | 
			
		||||
	@if test "$$(cat build.ninja.stamp)" = "$(MESON)" && test -n "$(NINJA)"; then \
 | 
			
		||||
	  $(NINJA) build.ninja; \
 | 
			
		||||
	else \
 | 
			
		||||
	  echo "$(MESON) setup --reconfigure $(SRC_PATH)"; \
 | 
			
		||||
	  $(MESON) setup --reconfigure $(SRC_PATH); \
 | 
			
		||||
	fi && echo "$(MESON)" > $@
 | 
			
		||||
$(common-obj-y): $(GENERATED_HEADERS)
 | 
			
		||||
subdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-malloc.o qemu-timer-common.o
 | 
			
		||||
 | 
			
		||||
Makefile.mtest: build.ninja scripts/mtest2make.py
 | 
			
		||||
	$(MESON) introspect --targets --tests --benchmarks | $(PYTHON) scripts/mtest2make.py > $@
 | 
			
		||||
-include Makefile.mtest
 | 
			
		||||
$(filter %-softmmu,$(SUBDIR_RULES)): $(trace-obj-y) $(common-obj-y) subdir-libdis
 | 
			
		||||
 | 
			
		||||
.PHONY: update-buildoptions
 | 
			
		||||
all update-buildoptions: $(SRC_PATH)/scripts/meson-buildoptions.sh
 | 
			
		||||
$(SRC_PATH)/scripts/meson-buildoptions.sh: $(SRC_PATH)/meson_options.txt
 | 
			
		||||
	$(MESON) introspect --buildoptions $(SRC_PATH)/meson.build | $(PYTHON) \
 | 
			
		||||
	  scripts/meson-buildoptions.py > $@.tmp && mv $@.tmp $@
 | 
			
		||||
$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-libdis-user subdir-libuser
 | 
			
		||||
 | 
			
		||||
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
 | 
			
		||||
romsubdir-%:
 | 
			
		||||
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
 | 
			
		||||
 | 
			
		||||
ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
 | 
			
		||||
 | 
			
		||||
recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
 | 
			
		||||
 | 
			
		||||
audio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
 | 
			
		||||
 | 
			
		||||
QEMU_CFLAGS+=$(CURL_CFLAGS)
 | 
			
		||||
 | 
			
		||||
QEMU_CFLAGS+=$(GLIB_CFLAGS)
 | 
			
		||||
 | 
			
		||||
ui/cocoa.o: ui/cocoa.m
 | 
			
		||||
 | 
			
		||||
ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
 | 
			
		||||
 | 
			
		||||
ui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
 | 
			
		||||
 | 
			
		||||
bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
 | 
			
		||||
 | 
			
		||||
version.o: $(SRC_PATH)/version.rc config-host.mak
 | 
			
		||||
	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")
 | 
			
		||||
 | 
			
		||||
version-obj-$(CONFIG_WIN32) += version.o
 | 
			
		||||
######################################################################
 | 
			
		||||
# Support building shared library libcacard
 | 
			
		||||
 | 
			
		||||
.PHONY: libcacard.la install-libcacard
 | 
			
		||||
ifeq ($(LIBTOOL),)
 | 
			
		||||
libcacard.la:
 | 
			
		||||
	@echo "libtool is missing, please install and rerun configure"; exit 1
 | 
			
		||||
 | 
			
		||||
install-libcacard:
 | 
			
		||||
	@echo "libtool is missing, please install and rerun configure"; exit 1
 | 
			
		||||
else
 | 
			
		||||
libcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-malloc.o qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
 | 
			
		||||
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
 | 
			
		||||
 | 
			
		||||
install-libcacard: libcacard.la
 | 
			
		||||
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
# 4. Rules to bridge to other makefiles
 | 
			
		||||
 | 
			
		||||
ifneq ($(NINJA),)
 | 
			
		||||
# Filter out long options to avoid flags like --no-print-directory which
 | 
			
		||||
# may result in false positive match for MAKE.n
 | 
			
		||||
MAKE.n = $(findstring n,$(firstword $(filter-out --%,$(MAKEFLAGS))))
 | 
			
		||||
MAKE.k = $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS))))
 | 
			
		||||
MAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS))))
 | 
			
		||||
MAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq)
 | 
			
		||||
NINJAFLAGS = \
 | 
			
		||||
        $(if $V,-v) \
 | 
			
		||||
        $(if $(MAKE.n), -n) \
 | 
			
		||||
        $(if $(MAKE.k), -k0) \
 | 
			
		||||
        $(filter-out -j, \
 | 
			
		||||
          $(or $(filter -l% -j%, $(MAKEFLAGS)), \
 | 
			
		||||
               $(if $(filter --jobserver-auth=%, $(MAKEFLAGS)),, -j1))) \
 | 
			
		||||
        -d keepdepfile
 | 
			
		||||
ninja-cmd-goals = $(or $(MAKECMDGOALS), all)
 | 
			
		||||
ninja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g))
 | 
			
		||||
 | 
			
		||||
makefile-targets := build.ninja ctags TAGS cscope dist clean
 | 
			
		||||
# "ninja -t targets" also lists all prerequisites.  If build system
 | 
			
		||||
# files are marked as PHONY, however, Make will always try to execute
 | 
			
		||||
# "ninja build.ninja".
 | 
			
		||||
ninja-targets := $(filter-out $(build-files) $(makefile-targets), $(ninja-targets))
 | 
			
		||||
.PHONY: $(ninja-targets) run-ninja
 | 
			
		||||
$(ninja-targets): run-ninja
 | 
			
		||||
 | 
			
		||||
# Use "| cat" to give Ninja a more "make-y" output.  Use "+" to bypass the
 | 
			
		||||
# --output-sync line.
 | 
			
		||||
run-ninja: config-host.mak
 | 
			
		||||
ifneq ($(filter $(ninja-targets), $(ninja-cmd-goals)),)
 | 
			
		||||
	+$(if $(MAKE.nq),@:,$(quiet-@)$(NINJA) $(NINJAFLAGS) \
 | 
			
		||||
	   $(sort $(filter $(ninja-targets), $(ninja-cmd-goals))) | cat)
 | 
			
		||||
endif
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
else # config-host.mak does not exist
 | 
			
		||||
ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
 | 
			
		||||
$(error Please call configure before running make)
 | 
			
		||||
endif
 | 
			
		||||
endif # config-host.mak does not exist
 | 
			
		||||
 | 
			
		||||
SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet)
 | 
			
		||||
 | 
			
		||||
include $(SRC_PATH)/tests/Makefile.include
 | 
			
		||||
 | 
			
		||||
all: recurse-all
 | 
			
		||||
 | 
			
		||||
SUBDIR_RULES=$(foreach t, all clean distclean, $(addsuffix /$(t), $(SUBDIRS)))
 | 
			
		||||
.PHONY: $(SUBDIR_RULES)
 | 
			
		||||
$(SUBDIR_RULES):
 | 
			
		||||
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
 | 
			
		||||
 | 
			
		||||
ifneq ($(filter contrib/plugins, $(SUBDIRS)),)
 | 
			
		||||
.PHONY: plugins
 | 
			
		||||
plugins: contrib/plugins/all
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
.PHONY: recurse-all recurse-clean
 | 
			
		||||
recurse-all: $(addsuffix /all, $(SUBDIRS))
 | 
			
		||||
recurse-clean: $(addsuffix /clean, $(SUBDIRS))
 | 
			
		||||
recurse-distclean: $(addsuffix /distclean, $(SUBDIRS))
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
 | 
			
		||||
clean: recurse-clean
 | 
			
		||||
	-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean || :
 | 
			
		||||
	-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) clean-ctlist || :
 | 
			
		||||
	find . \( -name '*.so' -o -name '*.dll' -o \
 | 
			
		||||
		  -name '*.[oda]' -o -name '*.gcno' \) -type f \
 | 
			
		||||
		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
 | 
			
		||||
		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
 | 
			
		||||
		-exec rm {} +
 | 
			
		||||
	rm -f TAGS cscope.* *~ */*~
 | 
			
		||||
	@$(MAKE) -Ctests/qemu-iotests clean
 | 
			
		||||
qemu-img.o: qemu-img-cmds.h
 | 
			
		||||
qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o qemu-ga.o: $(GENERATED_HEADERS)
 | 
			
		||||
 | 
			
		||||
VERSION = $(shell cat $(SRC_PATH)/VERSION)
 | 
			
		||||
qemu-img$(EXESUF): qemu-img.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o
 | 
			
		||||
 | 
			
		||||
dist: qemu-$(VERSION).tar.bz2
 | 
			
		||||
qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o
 | 
			
		||||
 | 
			
		||||
qemu-%.tar.bz2:
 | 
			
		||||
	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
 | 
			
		||||
qemu-io$(EXESUF): qemu-io.o cmd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o
 | 
			
		||||
 | 
			
		||||
distclean: clean recurse-distclean
 | 
			
		||||
	-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean -g || :
 | 
			
		||||
	rm -f config-host.mak Makefile.prereqs
 | 
			
		||||
	rm -f tests/tcg/*/config-target.mak tests/tcg/config-host.mak
 | 
			
		||||
	rm -f config.status
 | 
			
		||||
	rm -f roms/seabios/config.mak
 | 
			
		||||
	rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
 | 
			
		||||
	rm -f *-config-target.h *-config-devices.mak *-config-devices.h
 | 
			
		||||
	rm -rf meson-private meson-logs meson-info compile_commands.json
 | 
			
		||||
	rm -f Makefile.ninja Makefile.mtest build.ninja.stamp meson.stamp
 | 
			
		||||
	rm -f config.log
 | 
			
		||||
	rm -f linux-headers/asm
 | 
			
		||||
	rm -Rf .sdk qemu-bundle
 | 
			
		||||
qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
 | 
			
		||||
 | 
			
		||||
find-src-path = find "$(SRC_PATH)" -path "$(SRC_PATH)/meson" -prune -o \
 | 
			
		||||
	-type l -prune -o \( -name "*.[chsS]" -o -name "*.[ch].inc" \)
 | 
			
		||||
check-qint.o check-qstring.o check-qdict.o check-qlist.o check-qfloat.o check-qjson.o: $(GENERATED_HEADERS)
 | 
			
		||||
 | 
			
		||||
.PHONY: ctags
 | 
			
		||||
ctags:
 | 
			
		||||
	$(call quiet-command, 			\
 | 
			
		||||
		rm -f "$(SRC_PATH)/"tags, 	\
 | 
			
		||||
		"CTAGS", "Remove old tags")
 | 
			
		||||
	$(call quiet-command, \
 | 
			
		||||
		$(find-src-path) -exec ctags 		\
 | 
			
		||||
		-f "$(SRC_PATH)/"tags --append {} +,	\
 | 
			
		||||
		"CTAGS", "Re-index $(SRC_PATH)")
 | 
			
		||||
CHECK_PROG_DEPS = qemu-malloc.o $(oslib-obj-y) $(trace-obj-y) qemu-tool.o
 | 
			
		||||
 | 
			
		||||
.PHONY: gtags
 | 
			
		||||
gtags:
 | 
			
		||||
	$(call quiet-command, 			\
 | 
			
		||||
		rm -f "$(SRC_PATH)/"GTAGS; 	\
 | 
			
		||||
		rm -f "$(SRC_PATH)/"GRTAGS; 	\
 | 
			
		||||
		rm -f "$(SRC_PATH)/"GPATH, 	\
 | 
			
		||||
		"GTAGS", "Remove old $@ files")
 | 
			
		||||
	$(call quiet-command, 				\
 | 
			
		||||
	        (cd $(SRC_PATH) && 			\
 | 
			
		||||
		 $(find-src-path) -print | gtags -f -),	\
 | 
			
		||||
		"GTAGS", "Re-index $(SRC_PATH)")
 | 
			
		||||
check-qint: check-qint.o qint.o $(CHECK_PROG_DEPS)
 | 
			
		||||
check-qstring: check-qstring.o qstring.o $(CHECK_PROG_DEPS)
 | 
			
		||||
check-qdict: check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o $(CHECK_PROG_DEPS)
 | 
			
		||||
check-qlist: check-qlist.o qlist.o qint.o $(CHECK_PROG_DEPS)
 | 
			
		||||
check-qfloat: check-qfloat.o qfloat.o $(CHECK_PROG_DEPS)
 | 
			
		||||
check-qjson: check-qjson.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o qjson.o json-streamer.o json-lexer.o json-parser.o error.o qerror.o qemu-error.o $(CHECK_PROG_DEPS)
 | 
			
		||||
 | 
			
		||||
$(qapi-obj-y): $(GENERATED_HEADERS)
 | 
			
		||||
qapi-dir := qapi-generated
 | 
			
		||||
test-visitor.o test-qmp-commands.o qemu-ga$(EXESUF): QEMU_CFLAGS += -I $(qapi-dir)
 | 
			
		||||
 | 
			
		||||
$(qapi-dir)/test-qapi-types.c: $(qapi-dir)/test-qapi-types.h
 | 
			
		||||
$(qapi-dir)/test-qapi-types.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
 | 
			
		||||
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
 | 
			
		||||
$(qapi-dir)/test-qapi-visit.c: $(qapi-dir)/test-qapi-visit.h
 | 
			
		||||
$(qapi-dir)/test-qapi-visit.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
 | 
			
		||||
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
 | 
			
		||||
$(qapi-dir)/test-qmp-commands.h: $(qapi-dir)/test-qmp-marshal.c
 | 
			
		||||
$(qapi-dir)/test-qmp-marshal.c: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
 | 
			
		||||
	    $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
 | 
			
		||||
 | 
			
		||||
$(qapi-dir)/qga-qapi-types.c: $(qapi-dir)/qga-qapi-types.h
 | 
			
		||||
$(qapi-dir)/qga-qapi-types.h: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py
 | 
			
		||||
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
 | 
			
		||||
$(qapi-dir)/qga-qapi-visit.c: $(qapi-dir)/qga-qapi-visit.h
 | 
			
		||||
$(qapi-dir)/qga-qapi-visit.h: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py
 | 
			
		||||
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
 | 
			
		||||
$(qapi-dir)/qga-qmp-marshal.c: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py
 | 
			
		||||
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
 | 
			
		||||
 | 
			
		||||
test-visitor.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h) $(qapi-obj-y)
 | 
			
		||||
test-visitor: test-visitor.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o $(qapi-obj-y) error.o osdep.o qemu-malloc.o $(oslib-obj-y) qjson.o json-streamer.o json-lexer.o json-parser.o qerror.o qemu-error.o qemu-tool.o $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
 | 
			
		||||
 | 
			
		||||
test-qmp-commands.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h test-qmp-marshal.c test-qmp-commands.h) $(qapi-obj-y)
 | 
			
		||||
test-qmp-commands: test-qmp-commands.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o $(qapi-obj-y) error.o osdep.o qemu-malloc.o $(oslib-obj-y) qjson.o json-streamer.o json-lexer.o json-parser.o qerror.o qemu-error.o qemu-tool.o $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o
 | 
			
		||||
 | 
			
		||||
QGALIB=qga/guest-agent-command-state.o qga/guest-agent-commands.o
 | 
			
		||||
QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-visit.c qga-qmp-marshal.c)
 | 
			
		||||
 | 
			
		||||
$(QGALIB_GEN): $(GENERATED_HEADERS)
 | 
			
		||||
$(QGALIB) qemu-ga.o: $(QGALIB_GEN) $(qapi-obj-y)
 | 
			
		||||
qemu-ga$(EXESUF): qemu-ga.o $(QGALIB) qemu-tool.o qemu-error.o error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) $(qapi-obj-y) qemu-timer-common.o qemu-sockets.o module.o qapi/qmp-dispatch.o qapi/qmp-registry.o $(qapi-dir)/qga-qapi-visit.o $(qapi-dir)/qga-qapi-types.o $(qapi-dir)/qga-qmp-marshal.o
 | 
			
		||||
 | 
			
		||||
QEMULIBS=libhw32 libhw64 libuser libdis libdis-user
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
# avoid old build problems by removing potentially incorrect old files
 | 
			
		||||
	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
 | 
			
		||||
	rm -f qemu-options.def
 | 
			
		||||
	rm -f *.o *.d *.a *.lo $(TOOLS) qemu-ga TAGS cscope.* *.pod *~ */*~
 | 
			
		||||
	rm -Rf .libs
 | 
			
		||||
	rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d qapi/*.o qapi/*.d qga/*.o qga/*.d
 | 
			
		||||
	rm -f qemu-img-cmds.h
 | 
			
		||||
	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
 | 
			
		||||
	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
 | 
			
		||||
	rm -f trace-dtrace.h trace-dtrace.h-timestamp
 | 
			
		||||
	rm -rf $(qapi-dir)
 | 
			
		||||
	$(MAKE) -C tests clean
 | 
			
		||||
	for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \
 | 
			
		||||
	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
 | 
			
		||||
	rm -f $$d/qemu-options.def; \
 | 
			
		||||
        done
 | 
			
		||||
 | 
			
		||||
distclean: clean
 | 
			
		||||
	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
 | 
			
		||||
	rm -f config-all-devices.mak
 | 
			
		||||
	rm -f roms/seabios/config.mak roms/vgabios/config.mak
 | 
			
		||||
	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
 | 
			
		||||
	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
 | 
			
		||||
	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
 | 
			
		||||
	rm -f qemu-doc.vr
 | 
			
		||||
	rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr
 | 
			
		||||
	for d in $(TARGET_DIRS) $(QEMULIBS); do \
 | 
			
		||||
	rm -rf $$d || exit 1 ; \
 | 
			
		||||
        done
 | 
			
		||||
 | 
			
		||||
KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
 | 
			
		||||
ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
 | 
			
		||||
common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr
 | 
			
		||||
 | 
			
		||||
ifdef INSTALL_BLOBS
 | 
			
		||||
BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin \
 | 
			
		||||
vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
 | 
			
		||||
ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
 | 
			
		||||
pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
 | 
			
		||||
pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
 | 
			
		||||
bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
 | 
			
		||||
mpc8544ds.dtb \
 | 
			
		||||
multiboot.bin linuxboot.bin \
 | 
			
		||||
s390-zipl.rom \
 | 
			
		||||
spapr-rtas.bin slof.bin
 | 
			
		||||
BLOBS += extboot.bin
 | 
			
		||||
BLOBS += vapic.bin
 | 
			
		||||
else
 | 
			
		||||
BLOBS=
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
install-doc: $(DOCS)
 | 
			
		||||
	$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
 | 
			
		||||
	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
 | 
			
		||||
ifdef CONFIG_POSIX
 | 
			
		||||
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
 | 
			
		||||
	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
 | 
			
		||||
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
 | 
			
		||||
	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
install-sysconfig:
 | 
			
		||||
	$(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
 | 
			
		||||
	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
 | 
			
		||||
 | 
			
		||||
install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
 | 
			
		||||
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
 | 
			
		||||
ifneq ($(TOOLS),)
 | 
			
		||||
	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
 | 
			
		||||
endif
 | 
			
		||||
ifneq ($(BLOBS),)
 | 
			
		||||
	$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
 | 
			
		||||
	set -e; for x in $(BLOBS); do \
 | 
			
		||||
	    if [ -f $(SRC_PATH)/pc-bios/$$x ];then \
 | 
			
		||||
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
 | 
			
		||||
	    fi \
 | 
			
		||||
	    ; if [ -f pc-bios/optionrom/$$x ];then \
 | 
			
		||||
		$(INSTALL_DATA) pc-bios/optionrom/$$x "$(DESTDIR)$(datadir)"; \
 | 
			
		||||
	    fi \
 | 
			
		||||
	done
 | 
			
		||||
endif
 | 
			
		||||
	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
 | 
			
		||||
	set -e; for x in $(KEYMAPS); do \
 | 
			
		||||
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
 | 
			
		||||
	done
 | 
			
		||||
	for d in $(TARGET_DIRS); do \
 | 
			
		||||
	$(MAKE) -C $$d $@ || exit 1 ; \
 | 
			
		||||
        done
 | 
			
		||||
 | 
			
		||||
# various test targets
 | 
			
		||||
test speed: all
 | 
			
		||||
	$(MAKE) -C tests $@
 | 
			
		||||
 | 
			
		||||
.PHONY: TAGS
 | 
			
		||||
TAGS:
 | 
			
		||||
	$(call quiet-command, 			\
 | 
			
		||||
		rm -f "$(SRC_PATH)/"TAGS,	\
 | 
			
		||||
		"TAGS", "Remove old $@")
 | 
			
		||||
	$(call quiet-command, 				\
 | 
			
		||||
		$(find-src-path) -exec etags 		\
 | 
			
		||||
		-f "$(SRC_PATH)/"TAGS --append {} +, 	\
 | 
			
		||||
		"TAGS", "Re-index $(SRC_PATH)")
 | 
			
		||||
	find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
 | 
			
		||||
 | 
			
		||||
.PHONY: cscope
 | 
			
		||||
cscope:
 | 
			
		||||
	$(call quiet-command,			\
 | 
			
		||||
		rm -f "$(SRC_PATH)/"cscope.* ,	\
 | 
			
		||||
		"cscope", "Remove old $@ files")
 | 
			
		||||
	$(call quiet-command, 					\
 | 
			
		||||
		($(find-src-path) -print | sed -e 's,^\./,,'    \
 | 
			
		||||
		> "$(SRC_PATH)/cscope.files"), 			\
 | 
			
		||||
		"cscope", "Create file list")
 | 
			
		||||
	$(call quiet-command, 				\
 | 
			
		||||
		cscope -b -i"$(SRC_PATH)/cscope.files" 	\
 | 
			
		||||
		-f"$(SRC_PATH)"/cscope.out, 		\
 | 
			
		||||
		"cscope", "Re-index $(SRC_PATH)")
 | 
			
		||||
	rm -f ./cscope.*
 | 
			
		||||
	find . -name "*.[ch]" -print | sed 's,^\./,,' > ./cscope.files
 | 
			
		||||
	cscope -b
 | 
			
		||||
 | 
			
		||||
# Needed by "meson install"
 | 
			
		||||
export DESTDIR
 | 
			
		||||
# documentation
 | 
			
		||||
MAKEINFO=makeinfo
 | 
			
		||||
MAKEINFOFLAGS=--no-headers --no-split --number-sections
 | 
			
		||||
TEXIFLAG=$(if $(V),,--quiet)
 | 
			
		||||
%.dvi: %.texi
 | 
			
		||||
	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
 | 
			
		||||
 | 
			
		||||
include $(SRC_PATH)/tests/lcitool/Makefile.include
 | 
			
		||||
include $(SRC_PATH)/tests/docker/Makefile.include
 | 
			
		||||
include $(SRC_PATH)/tests/vm/Makefile.include
 | 
			
		||||
%.html: %.texi
 | 
			
		||||
	$(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
 | 
			
		||||
	"  GEN   $@")
 | 
			
		||||
 | 
			
		||||
print-help-run = printf "  %-30s - %s\\n" "$1" "$2"
 | 
			
		||||
print-help = @$(call print-help-run,$1,$2)
 | 
			
		||||
%.info: %.texi
 | 
			
		||||
	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
 | 
			
		||||
 | 
			
		||||
.PHONY: update-linux-vdso
 | 
			
		||||
update-linux-vdso:
 | 
			
		||||
	@for m in $(SRC_PATH)/linux-user/*/Makefile.vdso; do \
 | 
			
		||||
	  $(MAKE) $(SUBDIR_MAKEFLAGS) -C $$(dirname $$m) -f Makefile.vdso \
 | 
			
		||||
		SRC_PATH=$(SRC_PATH) BUILD_DIR=$(BUILD_DIR); \
 | 
			
		||||
	done
 | 
			
		||||
%.pdf: %.texi
 | 
			
		||||
	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
 | 
			
		||||
 | 
			
		||||
.PHONY: help
 | 
			
		||||
help:
 | 
			
		||||
	@echo  'Generic targets:'
 | 
			
		||||
	$(call print-help,all,Build all)
 | 
			
		||||
	$(call print-help,dir/file.o,Build specified target only)
 | 
			
		||||
	$(call print-help,install,Install QEMU, documentation and tools)
 | 
			
		||||
	$(call print-help,ctags/gtags/TAGS,Generate tags file for editors)
 | 
			
		||||
	$(call print-help,cscope,Generate cscope index)
 | 
			
		||||
	$(call print-help,sparse,Run sparse on the QEMU source)
 | 
			
		||||
	@echo  ''
 | 
			
		||||
ifneq ($(filter contrib/plugins, $(SUBDIRS)),)
 | 
			
		||||
	@echo  'Plugin targets:'
 | 
			
		||||
	$(call print-help,plugins,Build the example TCG plugins)
 | 
			
		||||
	@echo  ''
 | 
			
		||||
endif
 | 
			
		||||
	@echo  'Cleaning targets:'
 | 
			
		||||
	$(call print-help,clean,Remove most generated files but keep the config)
 | 
			
		||||
	$(call print-help,distclean,Remove all generated files)
 | 
			
		||||
	$(call print-help,dist,Build a distributable tarball)
 | 
			
		||||
	@echo  ''
 | 
			
		||||
	@echo  'Linux-user targets:'
 | 
			
		||||
	$(call print-help,update-linux-vdso,Build linux-user vdso images)
 | 
			
		||||
	@echo  ''
 | 
			
		||||
	@echo  'Test targets:'
 | 
			
		||||
	$(call print-help,check,Run all tests (check-help for details))
 | 
			
		||||
	$(call print-help,bench,Run all benchmarks)
 | 
			
		||||
	$(call print-help,lcitool-help,Help about targets for managing build environment manifests)
 | 
			
		||||
	$(call print-help,docker-help,Help about targets running tests inside containers)
 | 
			
		||||
	$(call print-help,vm-help,Help about targets running tests inside VM)
 | 
			
		||||
	@echo  ''
 | 
			
		||||
	@echo  'Documentation targets:'
 | 
			
		||||
	$(call print-help,html man,Build documentation in specified format)
 | 
			
		||||
	@echo  ''
 | 
			
		||||
ifneq ($(filter msi, $(ninja-targets)),)
 | 
			
		||||
	@echo  'Windows targets:'
 | 
			
		||||
	$(call print-help,installer,Build NSIS-based installer for QEMU)
 | 
			
		||||
	$(call print-help,msi,Build MSI-based installer for qemu-ga)
 | 
			
		||||
	@echo  ''
 | 
			
		||||
endif
 | 
			
		||||
	$(call print-help,$(MAKE) [targets],(quiet build, default))
 | 
			
		||||
	$(call print-help,$(MAKE) V=1 [targets],(verbose build))
 | 
			
		||||
qemu-options.texi: $(SRC_PATH)/qemu-options.hx
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
 | 
			
		||||
 | 
			
		||||
# will delete the target of a rule if commands exit with a nonzero exit status
 | 
			
		||||
.DELETE_ON_ERROR:
 | 
			
		||||
qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
 | 
			
		||||
 | 
			
		||||
print-%:
 | 
			
		||||
	@echo '$*=$($*)'
 | 
			
		||||
QMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
 | 
			
		||||
 | 
			
		||||
qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
 | 
			
		||||
 | 
			
		||||
qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
 | 
			
		||||
	$(call quiet-command, \
 | 
			
		||||
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
 | 
			
		||||
	  pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
 | 
			
		||||
	  "  GEN   $@")
 | 
			
		||||
 | 
			
		||||
qemu-img.1: qemu-img.texi qemu-img-cmds.texi
 | 
			
		||||
	$(call quiet-command, \
 | 
			
		||||
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
 | 
			
		||||
	  pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
 | 
			
		||||
	  "  GEN   $@")
 | 
			
		||||
 | 
			
		||||
qemu-nbd.8: qemu-nbd.texi
 | 
			
		||||
	$(call quiet-command, \
 | 
			
		||||
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
 | 
			
		||||
	  pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
 | 
			
		||||
	  "  GEN   $@")
 | 
			
		||||
 | 
			
		||||
dvi: qemu-doc.dvi qemu-tech.dvi
 | 
			
		||||
html: qemu-doc.html qemu-tech.html
 | 
			
		||||
info: qemu-doc.info qemu-tech.info
 | 
			
		||||
pdf: qemu-doc.pdf qemu-tech.pdf
 | 
			
		||||
 | 
			
		||||
qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
 | 
			
		||||
	qemu-img.texi qemu-nbd.texi qemu-options.texi \
 | 
			
		||||
	qemu-monitor.texi qemu-img-cmds.texi
 | 
			
		||||
 | 
			
		||||
VERSION ?= $(shell cat VERSION)
 | 
			
		||||
FILE = qemu-$(VERSION)
 | 
			
		||||
 | 
			
		||||
# tar release (use 'make -k tar' on a checkouted tree)
 | 
			
		||||
tar:
 | 
			
		||||
	rm -rf /tmp/$(FILE)
 | 
			
		||||
	cp -r . /tmp/$(FILE)
 | 
			
		||||
	cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
 | 
			
		||||
	rm -rf /tmp/$(FILE)
 | 
			
		||||
 | 
			
		||||
SYSTEM_TARGETS=$(filter %-softmmu,$(TARGET_DIRS))
 | 
			
		||||
SYSTEM_PROGS=$(patsubst qemu-system-i386,qemu, \
 | 
			
		||||
             $(patsubst %-softmmu,qemu-system-%, \
 | 
			
		||||
             $(SYSTEM_TARGETS)))
 | 
			
		||||
 | 
			
		||||
USER_TARGETS=$(filter %-user,$(TARGET_DIRS))
 | 
			
		||||
USER_PROGS=$(patsubst %-bsd-user,qemu-%, \
 | 
			
		||||
           $(patsubst %-darwin-user,qemu-%, \
 | 
			
		||||
           $(patsubst %-linux-user,qemu-%, \
 | 
			
		||||
           $(USER_TARGETS))))
 | 
			
		||||
 | 
			
		||||
# generate a binary distribution
 | 
			
		||||
tarbin:
 | 
			
		||||
	cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
 | 
			
		||||
	$(patsubst %,$(bindir)/%, $(SYSTEM_PROGS)) \
 | 
			
		||||
	$(patsubst %,$(bindir)/%, $(USER_PROGS)) \
 | 
			
		||||
	$(bindir)/qemu-img \
 | 
			
		||||
	$(bindir)/qemu-nbd \
 | 
			
		||||
	$(datadir)/bios.bin \
 | 
			
		||||
	$(datadir)/vgabios.bin \
 | 
			
		||||
	$(datadir)/vgabios-cirrus.bin \
 | 
			
		||||
	$(datadir)/ppc_rom.bin \
 | 
			
		||||
	$(datadir)/openbios-sparc32 \
 | 
			
		||||
	$(datadir)/openbios-sparc64 \
 | 
			
		||||
	$(datadir)/openbios-ppc \
 | 
			
		||||
	$(datadir)/pxe-e1000.rom \
 | 
			
		||||
	$(datadir)/pxe-eepro100.rom \
 | 
			
		||||
	$(datadir)/pxe-ne2k_pci.rom \
 | 
			
		||||
	$(datadir)/pxe-pcnet.rom \
 | 
			
		||||
	$(datadir)/pxe-rtl8139.rom \
 | 
			
		||||
	$(datadir)/pxe-virtio.rom \
 | 
			
		||||
	$(datadir)/extboot.bin \
 | 
			
		||||
	$(docdir)/qemu-doc.html \
 | 
			
		||||
	$(docdir)/qemu-tech.html \
 | 
			
		||||
	$(mandir)/man1/qemu.1 \
 | 
			
		||||
	$(mandir)/man1/qemu-img.1 \
 | 
			
		||||
	$(mandir)/man8/qemu-nbd.8
 | 
			
		||||
 | 
			
		||||
# Include automatically generated dependency files
 | 
			
		||||
-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										23
									
								
								Makefile.dis
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								Makefile.dis
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
# Makefile for disassemblers.
 | 
			
		||||
 | 
			
		||||
include ../config-host.mak
 | 
			
		||||
include config.mak
 | 
			
		||||
include $(SRC_PATH)/rules.mak
 | 
			
		||||
 | 
			
		||||
.PHONY: all
 | 
			
		||||
 | 
			
		||||
$(call set-vpath, $(SRC_PATH))
 | 
			
		||||
 | 
			
		||||
QEMU_CFLAGS+=-I..
 | 
			
		||||
 | 
			
		||||
include $(SRC_PATH)/Makefile.objs
 | 
			
		||||
 | 
			
		||||
all: $(libdis-y)
 | 
			
		||||
# Dummy command so that make thinks it has done something
 | 
			
		||||
	@true
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f *.o *.d *.a *~
 | 
			
		||||
 | 
			
		||||
# Include automatically generated dependency files
 | 
			
		||||
-include $(wildcard *.d */*.d)
 | 
			
		||||
							
								
								
									
										24
									
								
								Makefile.hw
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								Makefile.hw
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
# Makefile for qemu target independent devices.
 | 
			
		||||
 | 
			
		||||
include ../config-host.mak
 | 
			
		||||
include ../config-all-devices.mak
 | 
			
		||||
include config.mak
 | 
			
		||||
include $(SRC_PATH)/rules.mak
 | 
			
		||||
 | 
			
		||||
.PHONY: all
 | 
			
		||||
 | 
			
		||||
$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
 | 
			
		||||
 | 
			
		||||
QEMU_CFLAGS+=-I.. -I$(SRC_PATH)/fpu
 | 
			
		||||
 | 
			
		||||
include $(SRC_PATH)/Makefile.objs
 | 
			
		||||
 | 
			
		||||
all: $(hw-obj-y)
 | 
			
		||||
# Dummy command so that make thinks it has done something
 | 
			
		||||
	@true
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~
 | 
			
		||||
 | 
			
		||||
# Include automatically generated dependency files
 | 
			
		||||
-include $(wildcard *.d */*.d)
 | 
			
		||||
							
								
								
									
										390
									
								
								Makefile.objs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										390
									
								
								Makefile.objs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,390 @@
 | 
			
		||||
#######################################################################
 | 
			
		||||
# QObject
 | 
			
		||||
qobject-obj-y = qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o
 | 
			
		||||
qobject-obj-y += qjson.o json-lexer.o json-streamer.o json-parser.o
 | 
			
		||||
qobject-obj-y += qerror.o error.o
 | 
			
		||||
 | 
			
		||||
#######################################################################
 | 
			
		||||
# oslib-obj-y is code depending on the OS (win32 vs posix)
 | 
			
		||||
oslib-obj-y = osdep.o
 | 
			
		||||
oslib-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o
 | 
			
		||||
oslib-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o
 | 
			
		||||
 | 
			
		||||
#######################################################################
 | 
			
		||||
# block-obj-y is code used by both qemu system emulation and qemu-img
 | 
			
		||||
 | 
			
		||||
block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o async.o
 | 
			
		||||
block-obj-y += nbd.o block.o aio.o aes.o qemu-config.o qemu-progress.o qemu-sockets.o
 | 
			
		||||
block-obj-$(CONFIG_POSIX) += posix-aio-compat.o
 | 
			
		||||
block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
 | 
			
		||||
block-obj-$(CONFIG_POSIX) += compatfd.o
 | 
			
		||||
 | 
			
		||||
block-nested-y += raw.o cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
 | 
			
		||||
block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o qcow2-cache.o
 | 
			
		||||
block-nested-y += qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-cluster.o
 | 
			
		||||
block-nested-y += qed-check.o
 | 
			
		||||
block-nested-y += parallels.o nbd.o blkdebug.o sheepdog.o blkverify.o
 | 
			
		||||
block-nested-$(CONFIG_WIN32) += raw-win32.o
 | 
			
		||||
block-nested-$(CONFIG_POSIX) += raw-posix.o
 | 
			
		||||
block-nested-$(CONFIG_CURL) += curl.o
 | 
			
		||||
block-nested-$(CONFIG_RBD) += rbd.o
 | 
			
		||||
 | 
			
		||||
block-obj-y +=  $(addprefix block/, $(block-nested-y))
 | 
			
		||||
 | 
			
		||||
net-obj-y = net.o
 | 
			
		||||
net-nested-y = queue.o checksum.o util.o
 | 
			
		||||
net-nested-y += socket.o
 | 
			
		||||
net-nested-y += dump.o
 | 
			
		||||
net-nested-$(CONFIG_POSIX) += tap.o
 | 
			
		||||
net-nested-$(CONFIG_LINUX) += tap-linux.o
 | 
			
		||||
net-nested-$(CONFIG_WIN32) += tap-win32.o
 | 
			
		||||
net-nested-$(CONFIG_BSD) += tap-bsd.o
 | 
			
		||||
net-nested-$(CONFIG_SOLARIS) += tap-solaris.o
 | 
			
		||||
net-nested-$(CONFIG_AIX) += tap-aix.o
 | 
			
		||||
net-nested-$(CONFIG_HAIKU) += tap-haiku.o
 | 
			
		||||
net-nested-$(CONFIG_SLIRP) += slirp.o
 | 
			
		||||
net-nested-$(CONFIG_VDE) += vde.o
 | 
			
		||||
net-obj-y += $(addprefix net/, $(net-nested-y))
 | 
			
		||||
 | 
			
		||||
ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
 | 
			
		||||
# Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
 | 
			
		||||
# only pull in the actual virtio-9p device if we also enabled virtio.
 | 
			
		||||
CONFIG_REALLY_VIRTFS=y
 | 
			
		||||
fsdev-nested-y = qemu-fsdev.o
 | 
			
		||||
else
 | 
			
		||||
fsdev-nested-y = qemu-fsdev-dummy.o
 | 
			
		||||
endif
 | 
			
		||||
fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y))
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
# libqemu_common.a: Target independent part of system emulation. The
 | 
			
		||||
# long term path is to suppress *all* target specific code in case of
 | 
			
		||||
# system emulation, i.e. a single QEMU executable should support all
 | 
			
		||||
# CPUs and machines.
 | 
			
		||||
 | 
			
		||||
common-obj-y = $(block-obj-y) blockdev.o
 | 
			
		||||
common-obj-y += $(net-obj-y)
 | 
			
		||||
common-obj-y += $(qobject-obj-y)
 | 
			
		||||
common-obj-$(CONFIG_LINUX) += $(fsdev-obj-$(CONFIG_LINUX))
 | 
			
		||||
common-obj-y += readline.o console.o cursor.o qemu-error.o
 | 
			
		||||
common-obj-y += $(oslib-obj-y)
 | 
			
		||||
common-obj-$(CONFIG_WIN32) += os-win32.o
 | 
			
		||||
common-obj-$(CONFIG_POSIX) += os-posix.o
 | 
			
		||||
 | 
			
		||||
common-obj-y += tcg-runtime.o host-utils.o
 | 
			
		||||
common-obj-y += irq.o ioport.o input.o
 | 
			
		||||
common-obj-$(CONFIG_PTIMER) += ptimer.o
 | 
			
		||||
common-obj-$(CONFIG_MAX7310) += max7310.o
 | 
			
		||||
common-obj-$(CONFIG_WM8750) += wm8750.o
 | 
			
		||||
common-obj-$(CONFIG_TWL92230) += twl92230.o
 | 
			
		||||
common-obj-$(CONFIG_TSC2005) += tsc2005.o
 | 
			
		||||
common-obj-$(CONFIG_LM832X) += lm832x.o
 | 
			
		||||
common-obj-$(CONFIG_TMP105) += tmp105.o
 | 
			
		||||
common-obj-$(CONFIG_STELLARIS_INPUT) += stellaris_input.o
 | 
			
		||||
common-obj-$(CONFIG_SSD0303) += ssd0303.o
 | 
			
		||||
common-obj-$(CONFIG_SSD0323) += ssd0323.o
 | 
			
		||||
common-obj-$(CONFIG_ADS7846) += ads7846.o
 | 
			
		||||
common-obj-$(CONFIG_MAX111X) += max111x.o
 | 
			
		||||
common-obj-$(CONFIG_DS1338) += ds1338.o
 | 
			
		||||
common-obj-y += i2c.o smbus.o smbus_eeprom.o
 | 
			
		||||
common-obj-y += eeprom93xx.o
 | 
			
		||||
common-obj-y += scsi-disk.o cdrom.o
 | 
			
		||||
common-obj-y += scsi-generic.o scsi-bus.o
 | 
			
		||||
common-obj-y += usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o
 | 
			
		||||
common-obj-y += usb-serial.o usb-net.o usb-bus.o usb-desc.o
 | 
			
		||||
common-obj-$(CONFIG_SSI) += ssi.o
 | 
			
		||||
common-obj-$(CONFIG_SSI_SD) += ssi-sd.o
 | 
			
		||||
common-obj-$(CONFIG_SD) += sd.o
 | 
			
		||||
common-obj-y += bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
 | 
			
		||||
common-obj-y += bt-hci-csr.o
 | 
			
		||||
common-obj-y += buffered_file.o migration.o migration-tcp.o
 | 
			
		||||
common-obj-y += qemu-char.o savevm.o #aio.o
 | 
			
		||||
common-obj-y += msmouse.o ps2.o
 | 
			
		||||
common-obj-y += qdev.o qdev-properties.o
 | 
			
		||||
common-obj-y += block-migration.o iohandler.o
 | 
			
		||||
common-obj-y += pflib.o
 | 
			
		||||
common-obj-y += bitmap.o bitops.o
 | 
			
		||||
 | 
			
		||||
common-obj-$(CONFIG_BRLAPI) += baum.o
 | 
			
		||||
common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
 | 
			
		||||
common-obj-$(CONFIG_WIN32) += version.o
 | 
			
		||||
 | 
			
		||||
common-obj-$(CONFIG_SPICE) += ui/spice-core.o ui/spice-input.o ui/spice-display.o spice-qemu-char.o
 | 
			
		||||
 | 
			
		||||
audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
 | 
			
		||||
audio-obj-$(CONFIG_SDL) += sdlaudio.o
 | 
			
		||||
audio-obj-$(CONFIG_OSS) += ossaudio.o
 | 
			
		||||
audio-obj-$(CONFIG_SPICE) += spiceaudio.o
 | 
			
		||||
audio-obj-$(CONFIG_COREAUDIO) += coreaudio.o
 | 
			
		||||
audio-obj-$(CONFIG_ALSA) += alsaaudio.o
 | 
			
		||||
audio-obj-$(CONFIG_DSOUND) += dsoundaudio.o
 | 
			
		||||
audio-obj-$(CONFIG_FMOD) += fmodaudio.o
 | 
			
		||||
audio-obj-$(CONFIG_ESD) += esdaudio.o
 | 
			
		||||
audio-obj-$(CONFIG_PA) += paaudio.o
 | 
			
		||||
audio-obj-$(CONFIG_WINWAVE) += winwaveaudio.o
 | 
			
		||||
audio-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
 | 
			
		||||
audio-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
 | 
			
		||||
audio-obj-y += wavcapture.o
 | 
			
		||||
common-obj-y += $(addprefix audio/, $(audio-obj-y))
 | 
			
		||||
 | 
			
		||||
ui-obj-y += keymaps.o
 | 
			
		||||
ui-obj-$(CONFIG_SDL) += sdl.o sdl_zoom.o x_keymap.o
 | 
			
		||||
ui-obj-$(CONFIG_COCOA) += cocoa.o
 | 
			
		||||
ui-obj-$(CONFIG_CURSES) += curses.o
 | 
			
		||||
vnc-obj-y += vnc.o d3des.o
 | 
			
		||||
vnc-obj-y += vnc-enc-zlib.o vnc-enc-hextile.o
 | 
			
		||||
vnc-obj-y += vnc-enc-tight.o vnc-palette.o
 | 
			
		||||
vnc-obj-y += vnc-enc-zrle.o
 | 
			
		||||
vnc-obj-$(CONFIG_VNC_TLS) += vnc-tls.o vnc-auth-vencrypt.o
 | 
			
		||||
vnc-obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
 | 
			
		||||
ifdef CONFIG_VNC_THREAD
 | 
			
		||||
vnc-obj-y += vnc-jobs-async.o
 | 
			
		||||
else
 | 
			
		||||
vnc-obj-y += vnc-jobs-sync.o
 | 
			
		||||
endif
 | 
			
		||||
common-obj-y += $(addprefix ui/, $(ui-obj-y))
 | 
			
		||||
common-obj-$(CONFIG_VNC) += $(addprefix ui/, $(vnc-obj-y))
 | 
			
		||||
 | 
			
		||||
common-obj-y += iov.o acl.o
 | 
			
		||||
#common-obj-$(CONFIG_POSIX) += compatfd.o
 | 
			
		||||
common-obj-y += notify.o event_notifier.o
 | 
			
		||||
common-obj-y += qemu-timer.o qemu-timer-common.o
 | 
			
		||||
 | 
			
		||||
slirp-obj-y = cksum.o if.o ip_icmp.o ip_input.o ip_output.o
 | 
			
		||||
slirp-obj-y += slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o
 | 
			
		||||
slirp-obj-y += tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o
 | 
			
		||||
common-obj-$(CONFIG_SLIRP) += $(addprefix slirp/, $(slirp-obj-y))
 | 
			
		||||
 | 
			
		||||
# xen backend driver support
 | 
			
		||||
common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
 | 
			
		||||
common-obj-$(CONFIG_XEN_BACKEND) += xen_console.o xenfb.o xen_disk.o xen_nic.o
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
# libuser
 | 
			
		||||
 | 
			
		||||
user-obj-y =
 | 
			
		||||
user-obj-y += envlist.o path.o
 | 
			
		||||
user-obj-y += tcg-runtime.o host-utils.o
 | 
			
		||||
user-obj-y += cutils.o cache-utils.o
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
# libhw
 | 
			
		||||
 | 
			
		||||
hw-obj-y =
 | 
			
		||||
hw-obj-y += loader.o
 | 
			
		||||
hw-obj-$(CONFIG_VIRTIO) += virtio-console.o
 | 
			
		||||
hw-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o
 | 
			
		||||
hw-obj-y += fw_cfg.o
 | 
			
		||||
hw-obj-$(CONFIG_PCI) += pci_bridge.o
 | 
			
		||||
hw-obj-$(CONFIG_PCI) += msix.o msi.o
 | 
			
		||||
hw-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o
 | 
			
		||||
hw-obj-$(CONFIG_PCI) += ioh3420.o xio3130_upstream.o xio3130_downstream.o
 | 
			
		||||
hw-obj-y += watchdog.o
 | 
			
		||||
hw-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
 | 
			
		||||
hw-obj-$(CONFIG_ECC) += ecc.o
 | 
			
		||||
hw-obj-$(CONFIG_NAND) += nand.o
 | 
			
		||||
hw-obj-$(CONFIG_PFLASH_CFI01) += pflash_cfi01.o
 | 
			
		||||
hw-obj-$(CONFIG_PFLASH_CFI02) += pflash_cfi02.o
 | 
			
		||||
 | 
			
		||||
hw-obj-$(CONFIG_M48T59) += m48t59.o
 | 
			
		||||
hw-obj-$(CONFIG_ESCC) += escc.o
 | 
			
		||||
hw-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
 | 
			
		||||
 | 
			
		||||
hw-obj-$(CONFIG_SERIAL) += serial.o
 | 
			
		||||
hw-obj-$(CONFIG_PARALLEL) += parallel.o
 | 
			
		||||
# Moved back to Makefile.target due to #include qemu-kvm.h:
 | 
			
		||||
#hw-obj-$(CONFIG_I8254) += i8254.o
 | 
			
		||||
#hw-obj-$(CONFIG_PCSPK) += pcspk.o
 | 
			
		||||
hw-obj-$(CONFIG_PCKBD) += pckbd.o
 | 
			
		||||
hw-obj-$(CONFIG_USB_UHCI) += usb-uhci.o
 | 
			
		||||
hw-obj-$(CONFIG_USB_OHCI) += usb-ohci.o
 | 
			
		||||
hw-obj-$(CONFIG_USB_EHCI) += usb-ehci.o
 | 
			
		||||
hw-obj-$(CONFIG_FDC) += fdc.o
 | 
			
		||||
# needs fixes for cpu hotplug, so moved to Makefile.target:
 | 
			
		||||
# hw-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o
 | 
			
		||||
hw-obj-$(CONFIG_APM) += pm_smbus.o apm.o
 | 
			
		||||
hw-obj-$(CONFIG_DMA) += dma.o
 | 
			
		||||
hw-obj-$(CONFIG_HPET) += hpet.o
 | 
			
		||||
hw-obj-$(CONFIG_APPLESMC) += applesmc.o
 | 
			
		||||
hw-obj-$(CONFIG_SMARTCARD) += usb-ccid.o ccid-card-passthru.o
 | 
			
		||||
hw-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o
 | 
			
		||||
hw-obj-$(CONFIG_USB_REDIR) += usb-redir.o
 | 
			
		||||
 | 
			
		||||
# PPC devices
 | 
			
		||||
hw-obj-$(CONFIG_OPENPIC) += openpic.o
 | 
			
		||||
hw-obj-$(CONFIG_PREP_PCI) += prep_pci.o
 | 
			
		||||
# Mac shared devices
 | 
			
		||||
hw-obj-$(CONFIG_MACIO) += macio.o
 | 
			
		||||
hw-obj-$(CONFIG_CUDA) += cuda.o
 | 
			
		||||
hw-obj-$(CONFIG_ADB) += adb.o
 | 
			
		||||
hw-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o
 | 
			
		||||
hw-obj-$(CONFIG_MAC_DBDMA) += mac_dbdma.o
 | 
			
		||||
# OldWorld PowerMac
 | 
			
		||||
hw-obj-$(CONFIG_HEATHROW_PIC) += heathrow_pic.o
 | 
			
		||||
hw-obj-$(CONFIG_GRACKLE_PCI) += grackle_pci.o
 | 
			
		||||
# NewWorld PowerMac
 | 
			
		||||
hw-obj-$(CONFIG_UNIN_PCI) += unin_pci.o
 | 
			
		||||
hw-obj-$(CONFIG_DEC_PCI) += dec_pci.o
 | 
			
		||||
# PowerPC E500 boards
 | 
			
		||||
hw-obj-$(CONFIG_PPCE500_PCI) += ppce500_pci.o
 | 
			
		||||
 | 
			
		||||
# MIPS devices
 | 
			
		||||
hw-obj-$(CONFIG_PIIX4) += piix4.o
 | 
			
		||||
 | 
			
		||||
# PCI watchdog devices
 | 
			
		||||
hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o
 | 
			
		||||
 | 
			
		||||
hw-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
 | 
			
		||||
 | 
			
		||||
# PCI network cards
 | 
			
		||||
hw-obj-$(CONFIG_NE2000_PCI) += ne2000.o
 | 
			
		||||
hw-obj-$(CONFIG_EEPRO100_PCI) += eepro100.o
 | 
			
		||||
hw-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o
 | 
			
		||||
hw-obj-$(CONFIG_PCNET_COMMON) += pcnet.o
 | 
			
		||||
hw-obj-$(CONFIG_E1000_PCI) += e1000.o
 | 
			
		||||
hw-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o
 | 
			
		||||
 | 
			
		||||
hw-obj-$(CONFIG_SMC91C111) += smc91c111.o
 | 
			
		||||
hw-obj-$(CONFIG_LAN9118) += lan9118.o
 | 
			
		||||
hw-obj-$(CONFIG_NE2000_ISA) += ne2000-isa.o
 | 
			
		||||
 | 
			
		||||
# IDE
 | 
			
		||||
hw-obj-$(CONFIG_IDE_CORE) += ide/core.o ide/atapi.o
 | 
			
		||||
hw-obj-$(CONFIG_IDE_QDEV) += ide/qdev.o
 | 
			
		||||
hw-obj-$(CONFIG_IDE_PCI) += ide/pci.o
 | 
			
		||||
hw-obj-$(CONFIG_IDE_ISA) += ide/isa.o
 | 
			
		||||
hw-obj-$(CONFIG_IDE_PIIX) += ide/piix.o
 | 
			
		||||
hw-obj-$(CONFIG_IDE_CMD646) += ide/cmd646.o
 | 
			
		||||
hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o
 | 
			
		||||
hw-obj-$(CONFIG_IDE_VIA) += ide/via.o
 | 
			
		||||
hw-obj-$(CONFIG_AHCI) += ide/ahci.o
 | 
			
		||||
hw-obj-$(CONFIG_AHCI) += ide/ich.o
 | 
			
		||||
 | 
			
		||||
# SCSI layer
 | 
			
		||||
hw-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o
 | 
			
		||||
hw-obj-$(CONFIG_ESP) += esp.o
 | 
			
		||||
 | 
			
		||||
hw-obj-y += dma-helpers.o sysbus.o isa-bus.o
 | 
			
		||||
hw-obj-y += qdev-addr.o
 | 
			
		||||
 | 
			
		||||
# VGA
 | 
			
		||||
hw-obj-$(CONFIG_VGA_PCI) += vga-pci.o
 | 
			
		||||
hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o
 | 
			
		||||
hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
 | 
			
		||||
hw-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
 | 
			
		||||
hw-obj-$(CONFIG_VMMOUSE) += vmmouse.o
 | 
			
		||||
 | 
			
		||||
hw-obj-$(CONFIG_RC4030) += rc4030.o
 | 
			
		||||
hw-obj-$(CONFIG_DP8393X) += dp8393x.o
 | 
			
		||||
hw-obj-$(CONFIG_DS1225Y) += ds1225y.o
 | 
			
		||||
hw-obj-$(CONFIG_MIPSNET) += mipsnet.o
 | 
			
		||||
 | 
			
		||||
# Sound
 | 
			
		||||
sound-obj-y =
 | 
			
		||||
sound-obj-$(CONFIG_SB16) += sb16.o
 | 
			
		||||
sound-obj-$(CONFIG_ES1370) += es1370.o
 | 
			
		||||
sound-obj-$(CONFIG_AC97) += ac97.o
 | 
			
		||||
sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
 | 
			
		||||
sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
 | 
			
		||||
sound-obj-$(CONFIG_CS4231A) += cs4231a.o
 | 
			
		||||
sound-obj-$(CONFIG_HDA) += intel-hda.o hda-audio.o
 | 
			
		||||
 | 
			
		||||
adlib.o fmopl.o: QEMU_CFLAGS += -DBUILD_Y8950=0
 | 
			
		||||
hw-obj-$(CONFIG_SOUND) += $(sound-obj-y)
 | 
			
		||||
 | 
			
		||||
9pfs-nested-$(CONFIG_VIRTFS) = virtio-9p.o virtio-9p-debug.o
 | 
			
		||||
9pfs-nested-$(CONFIG_VIRTFS) +=  virtio-9p-local.o virtio-9p-xattr.o
 | 
			
		||||
9pfs-nested-$(CONFIG_VIRTFS) +=   virtio-9p-xattr-user.o virtio-9p-posix-acl.o
 | 
			
		||||
 | 
			
		||||
hw-obj-$(CONFIG_REALLY_VIRTFS) += $(addprefix 9pfs/, $(9pfs-nested-y))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
# libdis
 | 
			
		||||
# NOTE: the disassembler code is only needed for debugging
 | 
			
		||||
 | 
			
		||||
libdis-y =
 | 
			
		||||
libdis-$(CONFIG_ALPHA_DIS) += alpha-dis.o
 | 
			
		||||
libdis-$(CONFIG_ARM_DIS) += arm-dis.o
 | 
			
		||||
libdis-$(CONFIG_CRIS_DIS) += cris-dis.o
 | 
			
		||||
libdis-$(CONFIG_HPPA_DIS) += hppa-dis.o
 | 
			
		||||
libdis-$(CONFIG_I386_DIS) += i386-dis.o
 | 
			
		||||
libdis-$(CONFIG_IA64_DIS) += ia64-dis.o
 | 
			
		||||
libdis-$(CONFIG_M68K_DIS) += m68k-dis.o
 | 
			
		||||
libdis-$(CONFIG_MICROBLAZE_DIS) += microblaze-dis.o
 | 
			
		||||
libdis-$(CONFIG_MIPS_DIS) += mips-dis.o
 | 
			
		||||
libdis-$(CONFIG_PPC_DIS) += ppc-dis.o
 | 
			
		||||
libdis-$(CONFIG_S390_DIS) += s390-dis.o
 | 
			
		||||
libdis-$(CONFIG_SH4_DIS) += sh4-dis.o
 | 
			
		||||
libdis-$(CONFIG_SPARC_DIS) += sparc-dis.o
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
# trace
 | 
			
		||||
 | 
			
		||||
ifeq ($(TRACE_BACKEND),dtrace)
 | 
			
		||||
trace.h: trace.h-timestamp trace-dtrace.h
 | 
			
		||||
else
 | 
			
		||||
trace.h: trace.h-timestamp
 | 
			
		||||
endif
 | 
			
		||||
trace.h-timestamp: $(SRC_PATH)/trace-events config-host.mak
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -h < $< > $@,"  GEN   trace.h")
 | 
			
		||||
	@cmp -s $@ trace.h || cp $@ trace.h
 | 
			
		||||
 | 
			
		||||
trace.c: trace.c-timestamp
 | 
			
		||||
trace.c-timestamp: $(SRC_PATH)/trace-events config-host.mak
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -c < $< > $@,"  GEN   trace.c")
 | 
			
		||||
	@cmp -s $@ trace.c || cp $@ trace.c
 | 
			
		||||
 | 
			
		||||
trace.o: trace.c $(GENERATED_HEADERS)
 | 
			
		||||
 | 
			
		||||
trace-dtrace.h: trace-dtrace.dtrace
 | 
			
		||||
	$(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   trace-dtrace.h")
 | 
			
		||||
 | 
			
		||||
# Normal practice is to name DTrace probe file with a '.d' extension
 | 
			
		||||
# but that gets picked up by QEMU's Makefile as an external dependency
 | 
			
		||||
# rule file. So we use '.dtrace' instead
 | 
			
		||||
trace-dtrace.dtrace: trace-dtrace.dtrace-timestamp
 | 
			
		||||
trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events config-host.mak
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -d < $< > $@,"  GEN   trace-dtrace.dtrace")
 | 
			
		||||
	@cmp -s $@ trace-dtrace.dtrace || cp $@ trace-dtrace.dtrace
 | 
			
		||||
 | 
			
		||||
trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
 | 
			
		||||
	$(call quiet-command,dtrace -o $@ -G -s $<, "  GEN trace-dtrace.o")
 | 
			
		||||
 | 
			
		||||
ifeq ($(LIBTOOL),)
 | 
			
		||||
trace-dtrace.lo: trace-dtrace.dtrace
 | 
			
		||||
	@echo "missing libtool. please install and rerun configure."; exit 1
 | 
			
		||||
else
 | 
			
		||||
trace-dtrace.lo: trace-dtrace.dtrace
 | 
			
		||||
	$(call quiet-command,libtool --mode=compile --tag=CC dtrace -o $@ -G -s $<, "  lt GEN trace-dtrace.o")
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
simpletrace.o: simpletrace.c $(GENERATED_HEADERS)
 | 
			
		||||
 | 
			
		||||
ifeq ($(TRACE_BACKEND),dtrace)
 | 
			
		||||
trace-obj-y = trace-dtrace.o
 | 
			
		||||
else
 | 
			
		||||
trace-obj-y = trace.o
 | 
			
		||||
ifeq ($(TRACE_BACKEND),simple)
 | 
			
		||||
trace-obj-y += simpletrace.o
 | 
			
		||||
user-obj-y += qemu-timer-common.o
 | 
			
		||||
endif
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
# smartcard
 | 
			
		||||
 | 
			
		||||
libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o card_7816.o
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
# qapi
 | 
			
		||||
 | 
			
		||||
qapi-nested-y = qapi-visit-core.o qmp-input-visitor.o qmp-output-visitor.o qapi-dealloc-visitor.o
 | 
			
		||||
qapi-nested-y += qmp-registry.o qmp-dispatch.o
 | 
			
		||||
qapi-obj-y = $(addprefix qapi/, $(qapi-nested-y))
 | 
			
		||||
 | 
			
		||||
vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
 | 
			
		||||
 | 
			
		||||
vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
 | 
			
		||||
 | 
			
		||||
vl.o: QEMU_CFLAGS+=$(GLIB_CFLAGS)
 | 
			
		||||
							
								
								
									
										458
									
								
								Makefile.target
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										458
									
								
								Makefile.target
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,458 @@
 | 
			
		||||
# -*- Mode: makefile -*-
 | 
			
		||||
 | 
			
		||||
GENERATED_HEADERS = config-target.h
 | 
			
		||||
CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
 | 
			
		||||
CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
 | 
			
		||||
CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
 | 
			
		||||
 | 
			
		||||
include ../config-host.mak
 | 
			
		||||
include config-devices.mak
 | 
			
		||||
include config-target.mak
 | 
			
		||||
include $(SRC_PATH)/rules.mak
 | 
			
		||||
ifneq ($(HWDIR),)
 | 
			
		||||
include $(HWDIR)/config.mak
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
 | 
			
		||||
$(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw)
 | 
			
		||||
ifdef CONFIG_LINUX
 | 
			
		||||
QEMU_CFLAGS += -I../linux-headers
 | 
			
		||||
endif
 | 
			
		||||
QEMU_CFLAGS += -I.. -I$(TARGET_PATH) -DNEED_CPU_H
 | 
			
		||||
 | 
			
		||||
include $(SRC_PATH)/Makefile.objs
 | 
			
		||||
 | 
			
		||||
ifdef CONFIG_USER_ONLY
 | 
			
		||||
# user emulator name
 | 
			
		||||
QEMU_PROG=qemu-$(TARGET_ARCH2)
 | 
			
		||||
else
 | 
			
		||||
# system emulator name
 | 
			
		||||
ifeq ($(TARGET_ARCH), i386)
 | 
			
		||||
QEMU_PROG=qemu$(EXESUF)
 | 
			
		||||
else
 | 
			
		||||
QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
 | 
			
		||||
endif
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
PROGS=$(QEMU_PROG)
 | 
			
		||||
STPFILES=
 | 
			
		||||
 | 
			
		||||
ifndef CONFIG_HAIKU
 | 
			
		||||
LIBS+=-lm
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
config-target.h: config-target.h-timestamp
 | 
			
		||||
config-target.h-timestamp: config-target.mak
 | 
			
		||||
 | 
			
		||||
ifdef CONFIG_SYSTEMTAP_TRACE
 | 
			
		||||
stap: $(QEMU_PROG).stp
 | 
			
		||||
 | 
			
		||||
ifdef CONFIG_USER_ONLY
 | 
			
		||||
TARGET_TYPE=user
 | 
			
		||||
else
 | 
			
		||||
TARGET_TYPE=system
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
$(QEMU_PROG).stp:
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/tracetool \
 | 
			
		||||
		--$(TRACE_BACKEND) \
 | 
			
		||||
		--binary $(bindir)/$(QEMU_PROG) \
 | 
			
		||||
		--target-arch $(TARGET_ARCH) \
 | 
			
		||||
		--target-type $(TARGET_TYPE) \
 | 
			
		||||
		--stap < $(SRC_PATH)/trace-events > $(QEMU_PROG).stp,"  GEN   $(QEMU_PROG).stp")
 | 
			
		||||
else
 | 
			
		||||
stap:
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
all: $(PROGS) stap
 | 
			
		||||
 | 
			
		||||
# Dummy command so that make thinks it has done something
 | 
			
		||||
	@true
 | 
			
		||||
 | 
			
		||||
#########################################################
 | 
			
		||||
# cpu emulator library
 | 
			
		||||
libobj-y = exec.o cpu-exec.o
 | 
			
		||||
libobj-$(CONFIG_NO_CPU_EMULATION) += fake-exec.o
 | 
			
		||||
libobj-$(CONFIG_CPU_EMULATION) += translate-all.o translate.o
 | 
			
		||||
libobj-$(CONFIG_CPU_EMULATION) += tcg/tcg.o
 | 
			
		||||
libobj-y += fpu/softfloat.o
 | 
			
		||||
libobj-y += op_helper.o helper.o
 | 
			
		||||
ifeq ($(TARGET_BASE_ARCH), i386)
 | 
			
		||||
libobj-y += cpuid.o
 | 
			
		||||
endif
 | 
			
		||||
libobj-$(CONFIG_NEED_MMU) += mmu.o
 | 
			
		||||
 | 
			
		||||
libobj-$(CONFIG_KVM) += kvm-tpr-opt.o
 | 
			
		||||
 | 
			
		||||
libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o
 | 
			
		||||
 | 
			
		||||
libobj-y += disas.o
 | 
			
		||||
 | 
			
		||||
$(libobj-y): $(GENERATED_HEADERS)
 | 
			
		||||
 | 
			
		||||
# libqemu
 | 
			
		||||
 | 
			
		||||
translate.o: translate.c cpu.h
 | 
			
		||||
 | 
			
		||||
translate-all.o: translate-all.c cpu.h
 | 
			
		||||
 | 
			
		||||
tcg/tcg.o: cpu.h
 | 
			
		||||
 | 
			
		||||
# HELPER_CFLAGS is used for all the code compiled with static register
 | 
			
		||||
# variables
 | 
			
		||||
op_helper.o user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
 | 
			
		||||
 | 
			
		||||
# Note: this is a workaround. The real fix is to avoid compiling
 | 
			
		||||
# cpu_signal_handler() in user-exec.c.
 | 
			
		||||
signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
 | 
			
		||||
 | 
			
		||||
#########################################################
 | 
			
		||||
# Linux user emulator target
 | 
			
		||||
 | 
			
		||||
ifdef CONFIG_LINUX_USER
 | 
			
		||||
 | 
			
		||||
$(call set-vpath, $(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR))
 | 
			
		||||
 | 
			
		||||
QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
 | 
			
		||||
obj-y = main.o syscall.o strace.o mmap.o signal.o thunk.o \
 | 
			
		||||
      elfload.o linuxload.o uaccess.o gdbstub.o cpu-uname.o \
 | 
			
		||||
      qemu-malloc.o user-exec.o $(oslib-obj-y)
 | 
			
		||||
 | 
			
		||||
obj-$(TARGET_HAS_BFLT) += flatload.o
 | 
			
		||||
 | 
			
		||||
obj-$(TARGET_I386) += vm86.o
 | 
			
		||||
 | 
			
		||||
obj-i386-y += ioport-user.o
 | 
			
		||||
 | 
			
		||||
nwfpe-obj-y = fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
 | 
			
		||||
nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
 | 
			
		||||
obj-arm-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
 | 
			
		||||
obj-arm-y += arm-semi.o
 | 
			
		||||
 | 
			
		||||
obj-m68k-y += m68k-sim.o m68k-semi.o
 | 
			
		||||
 | 
			
		||||
$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
 | 
			
		||||
 | 
			
		||||
obj-y += $(addprefix ../libuser/, $(user-obj-y))
 | 
			
		||||
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
 | 
			
		||||
obj-y += $(libobj-y)
 | 
			
		||||
 | 
			
		||||
endif #CONFIG_LINUX_USER
 | 
			
		||||
 | 
			
		||||
#########################################################
 | 
			
		||||
# Darwin user emulator target
 | 
			
		||||
 | 
			
		||||
ifdef CONFIG_DARWIN_USER
 | 
			
		||||
 | 
			
		||||
$(call set-vpath, $(SRC_PATH)/darwin-user)
 | 
			
		||||
 | 
			
		||||
QEMU_CFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
 | 
			
		||||
 | 
			
		||||
# Leave some space for the regular program loading zone
 | 
			
		||||
LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
 | 
			
		||||
 | 
			
		||||
LIBS+=-lmx
 | 
			
		||||
 | 
			
		||||
obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
 | 
			
		||||
        gdbstub.o user-exec.o
 | 
			
		||||
 | 
			
		||||
obj-i386-y += ioport-user.o
 | 
			
		||||
 | 
			
		||||
$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
 | 
			
		||||
 | 
			
		||||
obj-y += $(addprefix ../libuser/, $(user-obj-y))
 | 
			
		||||
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
 | 
			
		||||
obj-y += $(libobj-y)
 | 
			
		||||
 | 
			
		||||
endif #CONFIG_DARWIN_USER
 | 
			
		||||
 | 
			
		||||
#########################################################
 | 
			
		||||
# BSD user emulator target
 | 
			
		||||
 | 
			
		||||
ifdef CONFIG_BSD_USER
 | 
			
		||||
 | 
			
		||||
$(call set-vpath, $(SRC_PATH)/bsd-user)
 | 
			
		||||
 | 
			
		||||
QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
 | 
			
		||||
 | 
			
		||||
obj-y = main.o bsdload.o elfload.o mmap.o signal.o strace.o syscall.o \
 | 
			
		||||
        gdbstub.o uaccess.o user-exec.o
 | 
			
		||||
 | 
			
		||||
obj-i386-y += ioport-user.o
 | 
			
		||||
 | 
			
		||||
$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
 | 
			
		||||
 | 
			
		||||
obj-y += $(addprefix ../libuser/, $(user-obj-y))
 | 
			
		||||
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
 | 
			
		||||
obj-y += $(libobj-y)
 | 
			
		||||
 | 
			
		||||
endif #CONFIG_BSD_USER
 | 
			
		||||
 | 
			
		||||
#########################################################
 | 
			
		||||
# System emulator target
 | 
			
		||||
ifdef CONFIG_SOFTMMU
 | 
			
		||||
 | 
			
		||||
obj-y = arch_init.o cpus.o monitor.o machine.o gdbstub.o vl.o balloon.o
 | 
			
		||||
# virtio has to be here due to weird dependency between PCI and virtio-net.
 | 
			
		||||
# need to fix this properly
 | 
			
		||||
obj-$(CONFIG_NO_PCI) += pci-stub.o
 | 
			
		||||
obj-$(CONFIG_PCI) += pci.o
 | 
			
		||||
obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virtio-serial-bus.o
 | 
			
		||||
obj-y += vhost_net.o
 | 
			
		||||
obj-$(CONFIG_VHOST_NET) += vhost.o
 | 
			
		||||
obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p-device.o
 | 
			
		||||
obj-y += rwhandler.o
 | 
			
		||||
obj-$(CONFIG_KVM) += kvm.o kvm-all.o
 | 
			
		||||
obj-$(CONFIG_NO_KVM) += kvm-stub.o
 | 
			
		||||
LIBS+=-lz
 | 
			
		||||
 | 
			
		||||
QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
 | 
			
		||||
QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
 | 
			
		||||
QEMU_CFLAGS += $(VNC_JPEG_CFLAGS)
 | 
			
		||||
QEMU_CFLAGS += $(VNC_PNG_CFLAGS)
 | 
			
		||||
QEMU_CFLAGS += $(GLIB_CFLAGS)
 | 
			
		||||
 | 
			
		||||
# xen support
 | 
			
		||||
obj-$(CONFIG_XEN) += xen-all.o xen_machine_pv.o xen_domainbuild.o xen-mapcache.o
 | 
			
		||||
obj-$(CONFIG_NO_XEN) += xen-stub.o
 | 
			
		||||
 | 
			
		||||
obj-i386-$(CONFIG_XEN) += xen_platform.o
 | 
			
		||||
 | 
			
		||||
# Inter-VM PCI shared memory
 | 
			
		||||
CONFIG_IVSHMEM =
 | 
			
		||||
ifeq ($(CONFIG_KVM), y)
 | 
			
		||||
  ifeq ($(CONFIG_PCI), y)
 | 
			
		||||
    CONFIG_IVSHMEM = y
 | 
			
		||||
  endif
 | 
			
		||||
endif
 | 
			
		||||
obj-$(CONFIG_IVSHMEM) += ivshmem.o
 | 
			
		||||
 | 
			
		||||
# Hardware support
 | 
			
		||||
obj-i386-y += vga.o
 | 
			
		||||
obj-i386-y += mc146818rtc.o i8259.o pc.o
 | 
			
		||||
obj-i386-y += cirrus_vga.o sga.o apic.o ioapic.o piix_pci.o
 | 
			
		||||
obj-i386-y += vmport.o
 | 
			
		||||
obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o wdt_ib700.o
 | 
			
		||||
obj-i386-y += extboot.o
 | 
			
		||||
obj-i386-y += debugcon.o multiboot.o
 | 
			
		||||
obj-i386-y += pc_piix.o
 | 
			
		||||
obj-i386-$(CONFIG_KVM) += kvmclock.o
 | 
			
		||||
obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
 | 
			
		||||
obj-i386-y += testdev.o
 | 
			
		||||
obj-i386-y += acpi.o acpi_piix4.o
 | 
			
		||||
 | 
			
		||||
obj-i386-y += pcspk.o i8254.o
 | 
			
		||||
obj-i386-$(CONFIG_KVM_PIT) += i8254-kvm.o
 | 
			
		||||
obj-i386-$(CONFIG_KVM_DEVICE_ASSIGNMENT) += device-assignment.o
 | 
			
		||||
 | 
			
		||||
# Hardware support
 | 
			
		||||
obj-ia64-y += ide.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
 | 
			
		||||
obj-ia64-y += fdc.o mc146818rtc.o serial.o i8259.o ipf.o
 | 
			
		||||
obj-ia64-y += cirrus_vga.o parallel.o acpi.o piix_pci.o
 | 
			
		||||
obj-ia64-y += usb-uhci.o
 | 
			
		||||
obj-ia64-$(CONFIG_KVM_DEVICE_ASSIGNMENT) += device-assignment.o
 | 
			
		||||
 | 
			
		||||
# shared objects
 | 
			
		||||
obj-ppc-y = ppc.o
 | 
			
		||||
obj-ppc-y += vga.o
 | 
			
		||||
# PREP target
 | 
			
		||||
obj-ppc-y += i8259.o mc146818rtc.o
 | 
			
		||||
obj-ppc-y += ppc_prep.o
 | 
			
		||||
# OldWorld PowerMac
 | 
			
		||||
obj-ppc-y += ppc_oldworld.o
 | 
			
		||||
# NewWorld PowerMac
 | 
			
		||||
obj-ppc-y += ppc_newworld.o
 | 
			
		||||
# IBM pSeries (sPAPR)
 | 
			
		||||
ifeq ($(CONFIG_FDT)$(TARGET_PPC64),yy)
 | 
			
		||||
obj-ppc-y += spapr.o spapr_hcall.o spapr_rtas.o spapr_vio.o
 | 
			
		||||
obj-ppc-y += xics.o spapr_vty.o spapr_llan.o spapr_vscsi.o
 | 
			
		||||
endif
 | 
			
		||||
# PowerPC 4xx boards
 | 
			
		||||
obj-ppc-y += ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
 | 
			
		||||
obj-ppc-y += ppc440.o ppc440_bamboo.o
 | 
			
		||||
# PowerPC E500 boards
 | 
			
		||||
obj-ppc-y += ppce500_mpc8544ds.o mpc8544_guts.o
 | 
			
		||||
# PowerPC 440 Xilinx ML507 reference board.
 | 
			
		||||
obj-ppc-y += virtex_ml507.o
 | 
			
		||||
obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
 | 
			
		||||
obj-ppc-$(CONFIG_FDT) += device_tree.o
 | 
			
		||||
 | 
			
		||||
# Xilinx PPC peripherals
 | 
			
		||||
obj-ppc-y += xilinx_intc.o
 | 
			
		||||
obj-ppc-y += xilinx_timer.o
 | 
			
		||||
obj-ppc-y += xilinx_uartlite.o
 | 
			
		||||
obj-ppc-y += xilinx_ethlite.o
 | 
			
		||||
 | 
			
		||||
# LM32 boards
 | 
			
		||||
obj-lm32-y += lm32_boards.o
 | 
			
		||||
obj-lm32-y += milkymist.o
 | 
			
		||||
 | 
			
		||||
# LM32 peripherals
 | 
			
		||||
obj-lm32-y += lm32_pic.o
 | 
			
		||||
obj-lm32-y += lm32_juart.o
 | 
			
		||||
obj-lm32-y += lm32_timer.o
 | 
			
		||||
obj-lm32-y += lm32_uart.o
 | 
			
		||||
obj-lm32-y += lm32_sys.o
 | 
			
		||||
obj-lm32-y += milkymist-ac97.o
 | 
			
		||||
obj-lm32-y += milkymist-hpdmc.o
 | 
			
		||||
obj-lm32-y += milkymist-memcard.o
 | 
			
		||||
obj-lm32-y += milkymist-minimac2.o
 | 
			
		||||
obj-lm32-y += milkymist-pfpu.o
 | 
			
		||||
obj-lm32-y += milkymist-softusb.o
 | 
			
		||||
obj-lm32-y += milkymist-sysctl.o
 | 
			
		||||
obj-lm32-$(CONFIG_OPENGL) += milkymist-tmu2.o
 | 
			
		||||
obj-lm32-y += milkymist-uart.o
 | 
			
		||||
obj-lm32-y += milkymist-vgafb.o
 | 
			
		||||
obj-lm32-y += framebuffer.o
 | 
			
		||||
 | 
			
		||||
obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
 | 
			
		||||
obj-mips-y += pcspk.o i8254.o
 | 
			
		||||
obj-mips-y += acpi.o acpi_piix4.o
 | 
			
		||||
obj-mips-y += mips_addr.o mips_timer.o mips_int.o
 | 
			
		||||
obj-mips-y += vga.o i8259.o
 | 
			
		||||
obj-mips-y += g364fb.o jazz_led.o
 | 
			
		||||
obj-mips-y += gt64xxx.o mc146818rtc.o
 | 
			
		||||
obj-mips-y += cirrus_vga.o
 | 
			
		||||
obj-mips-$(CONFIG_FULONG) += bonito.o vt82c686.o mips_fulong2e.o
 | 
			
		||||
 | 
			
		||||
obj-microblaze-y = petalogix_s3adsp1800_mmu.o
 | 
			
		||||
obj-microblaze-y += petalogix_ml605_mmu.o
 | 
			
		||||
 | 
			
		||||
obj-microblaze-y += microblaze_pic_cpu.o
 | 
			
		||||
obj-microblaze-y += xilinx_intc.o
 | 
			
		||||
obj-microblaze-y += xilinx_timer.o
 | 
			
		||||
obj-microblaze-y += xilinx_uartlite.o
 | 
			
		||||
obj-microblaze-y += xilinx_ethlite.o
 | 
			
		||||
obj-microblaze-y += xilinx_axidma.o
 | 
			
		||||
obj-microblaze-y += xilinx_axienet.o
 | 
			
		||||
 | 
			
		||||
obj-microblaze-$(CONFIG_FDT) += device_tree.o
 | 
			
		||||
 | 
			
		||||
# Boards
 | 
			
		||||
obj-cris-y = cris_pic_cpu.o
 | 
			
		||||
obj-cris-y += cris-boot.o
 | 
			
		||||
obj-cris-y += etraxfs.o axis_dev88.o
 | 
			
		||||
obj-cris-y += axis_dev88.o
 | 
			
		||||
 | 
			
		||||
# IO blocks
 | 
			
		||||
obj-cris-y += etraxfs_dma.o
 | 
			
		||||
obj-cris-y += etraxfs_pic.o
 | 
			
		||||
obj-cris-y += etraxfs_eth.o
 | 
			
		||||
obj-cris-y += etraxfs_timer.o
 | 
			
		||||
obj-cris-y += etraxfs_ser.o
 | 
			
		||||
 | 
			
		||||
ifeq ($(TARGET_ARCH), sparc64)
 | 
			
		||||
obj-sparc-y = sun4u.o apb_pci.o
 | 
			
		||||
obj-sparc-y += vga.o
 | 
			
		||||
obj-sparc-y += mc146818rtc.o
 | 
			
		||||
obj-sparc-y += cirrus_vga.o
 | 
			
		||||
else
 | 
			
		||||
obj-sparc-y = sun4m.o lance.o tcx.o sun4m_iommu.o slavio_intctl.o
 | 
			
		||||
obj-sparc-y += slavio_timer.o slavio_misc.o sparc32_dma.o
 | 
			
		||||
obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o leon3.o
 | 
			
		||||
 | 
			
		||||
# GRLIB
 | 
			
		||||
obj-sparc-y += grlib_gptimer.o grlib_irqmp.o grlib_apbuart.o
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
obj-arm-y = integratorcp.o versatilepb.o arm_pic.o arm_timer.o
 | 
			
		||||
obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
 | 
			
		||||
obj-arm-y += versatile_pci.o
 | 
			
		||||
obj-arm-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
 | 
			
		||||
obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
 | 
			
		||||
obj-arm-y += pl061.o
 | 
			
		||||
obj-arm-y += arm-semi.o
 | 
			
		||||
obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
 | 
			
		||||
obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 | 
			
		||||
obj-arm-y += gumstix.o
 | 
			
		||||
obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
 | 
			
		||||
obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o \
 | 
			
		||||
		omap_gpio.o omap_intc.o omap_uart.o
 | 
			
		||||
obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o \
 | 
			
		||||
		omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o omap_l4.o
 | 
			
		||||
obj-arm-y += omap_sx1.o palm.o tsc210x.o
 | 
			
		||||
obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
 | 
			
		||||
obj-arm-y += mst_fpga.o mainstone.o
 | 
			
		||||
obj-arm-y += musicpal.o bitbang_i2c.o marvell_88w8618_audio.o
 | 
			
		||||
obj-arm-y += framebuffer.o
 | 
			
		||||
obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
 | 
			
		||||
obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
 | 
			
		||||
obj-arm-y += syborg_virtio.o
 | 
			
		||||
obj-arm-y += vexpress.o
 | 
			
		||||
obj-arm-y += strongarm.o
 | 
			
		||||
obj-arm-y += collie.o
 | 
			
		||||
 | 
			
		||||
obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
 | 
			
		||||
obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o
 | 
			
		||||
obj-sh4-y += ide/mmio.o
 | 
			
		||||
 | 
			
		||||
obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
 | 
			
		||||
obj-m68k-y += m68k-semi.o dummy_m68k.o
 | 
			
		||||
 | 
			
		||||
obj-s390x-y = s390-virtio-bus.o s390-virtio.o
 | 
			
		||||
 | 
			
		||||
obj-alpha-y = i8259.o mc146818rtc.o
 | 
			
		||||
obj-alpha-y += vga.o cirrus_vga.o
 | 
			
		||||
 | 
			
		||||
ifeq ($(TARGET_ARCH), ia64)
 | 
			
		||||
firmware.o: firmware.c
 | 
			
		||||
	$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
 | 
			
		||||
 | 
			
		||||
monitor.o: hmp-commands.h qmp-commands.h
 | 
			
		||||
 | 
			
		||||
$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
 | 
			
		||||
 | 
			
		||||
obj-y += $(addprefix ../, $(common-obj-y))
 | 
			
		||||
obj-y += $(addprefix ../libdis/, $(libdis-y))
 | 
			
		||||
obj-y += $(libobj-y)
 | 
			
		||||
obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
 | 
			
		||||
 | 
			
		||||
endif # CONFIG_SOFTMMU
 | 
			
		||||
 | 
			
		||||
ifndef CONFIG_LINUX_USER
 | 
			
		||||
# libcacard needs qemu-thread support, and besides is only needed by devices
 | 
			
		||||
# so not requires with linux-user targets
 | 
			
		||||
obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
 | 
			
		||||
endif # CONFIG_LINUX_USER
 | 
			
		||||
 | 
			
		||||
obj-y += $(addprefix ../, $(trace-obj-y))
 | 
			
		||||
obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
 | 
			
		||||
 | 
			
		||||
$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)
 | 
			
		||||
	$(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
 | 
			
		||||
	$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
 | 
			
		||||
 | 
			
		||||
hmp-commands.h: $(SRC_PATH)/hmp-commands.hx
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
 | 
			
		||||
 | 
			
		||||
qmp-commands.h: $(SRC_PATH)/qmp-commands.hx
 | 
			
		||||
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
 | 
			
		||||
	rm -f *.d */*.d tcg/*.o ide/*.o 9pfs/*.o
 | 
			
		||||
	rm -f hmp-commands.h qmp-commands.h gdbstub-xml.c
 | 
			
		||||
ifdef CONFIG_SYSTEMTAP_TRACE
 | 
			
		||||
	rm -f *.stp
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
install: all
 | 
			
		||||
ifneq ($(PROGS),)
 | 
			
		||||
	$(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
 | 
			
		||||
ifneq ($(STRIP),)
 | 
			
		||||
	$(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS))
 | 
			
		||||
endif
 | 
			
		||||
endif
 | 
			
		||||
ifdef CONFIG_SYSTEMTAP_TRACE
 | 
			
		||||
	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/../systemtap/tapset"
 | 
			
		||||
	$(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(datadir)/../systemtap/tapset"
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
# Include automatically generated dependency files
 | 
			
		||||
-include $(wildcard *.d */*.d)
 | 
			
		||||
							
								
								
									
										23
									
								
								Makefile.user
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								Makefile.user
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
# Makefile for qemu target independent user files.
 | 
			
		||||
 | 
			
		||||
include ../config-host.mak
 | 
			
		||||
include $(SRC_PATH)/rules.mak
 | 
			
		||||
-include config.mak
 | 
			
		||||
 | 
			
		||||
.PHONY: all
 | 
			
		||||
 | 
			
		||||
$(call set-vpath, $(SRC_PATH))
 | 
			
		||||
 | 
			
		||||
QEMU_CFLAGS+=-I..
 | 
			
		||||
 | 
			
		||||
include $(SRC_PATH)/Makefile.objs
 | 
			
		||||
 | 
			
		||||
all: $(user-obj-y)
 | 
			
		||||
# Dummy command so that make thinks it has done something
 | 
			
		||||
	@true
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f *.o *.d *.a *~
 | 
			
		||||
 | 
			
		||||
# Include automatically generated dependency files
 | 
			
		||||
-include $(wildcard *.d */*.d)
 | 
			
		||||
							
								
								
									
										88
									
								
								QMP/README
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								QMP/README
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,88 @@
 | 
			
		||||
                          QEMU Monitor Protocol
 | 
			
		||||
                          =====================
 | 
			
		||||
 | 
			
		||||
Introduction
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
The QEMU Monitor Protocol (QMP) allows applications to communicate with
 | 
			
		||||
QEMU's Monitor.
 | 
			
		||||
 | 
			
		||||
QMP is JSON[1] based and currently has the following features:
 | 
			
		||||
 | 
			
		||||
- Lightweight, text-based, easy to parse data format
 | 
			
		||||
- Asynchronous messages support (ie. events)
 | 
			
		||||
- Capabilities Negotiation
 | 
			
		||||
 | 
			
		||||
For detailed information on QMP's usage, please, refer to the following files:
 | 
			
		||||
 | 
			
		||||
o qmp-spec.txt      QEMU Monitor Protocol current specification
 | 
			
		||||
o qmp-commands.txt  QMP supported commands (auto-generated at build-time)
 | 
			
		||||
o qmp-events.txt    List of available asynchronous events
 | 
			
		||||
 | 
			
		||||
There is also a simple Python script called 'qmp-shell' available.
 | 
			
		||||
 | 
			
		||||
IMPORTANT: It's strongly recommended to read the 'Stability Considerations'
 | 
			
		||||
section in the qmp-commands.txt file before making any serious use of QMP.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
[1] http://www.json.org
 | 
			
		||||
 | 
			
		||||
Usage
 | 
			
		||||
-----
 | 
			
		||||
 | 
			
		||||
To enable QMP, you need a QEMU monitor instance in "control mode". There are
 | 
			
		||||
two ways of doing this.
 | 
			
		||||
 | 
			
		||||
The simplest one is using the '-qmp' command-line option. The following
 | 
			
		||||
example makes QMP available on localhost port 4444:
 | 
			
		||||
 | 
			
		||||
  $ qemu [...] -qmp tcp:localhost:4444,server
 | 
			
		||||
 | 
			
		||||
However, in order to have more complex combinations, like multiple monitors,
 | 
			
		||||
the '-mon' command-line option should be used along with the '-chardev' one.
 | 
			
		||||
For instance, the following example creates one user monitor on stdio and one
 | 
			
		||||
QMP monitor on localhost port 4444.
 | 
			
		||||
 | 
			
		||||
   $ qemu [...] -chardev stdio,id=mon0 -mon chardev=mon0,mode=readline \
 | 
			
		||||
                -chardev socket,id=mon1,host=localhost,port=4444,server \
 | 
			
		||||
                -mon chardev=mon1,mode=control
 | 
			
		||||
 | 
			
		||||
Please, refer to QEMU's manpage for more information.
 | 
			
		||||
 | 
			
		||||
Simple Testing
 | 
			
		||||
--------------
 | 
			
		||||
 | 
			
		||||
To manually test QMP one can connect with telnet and issue commands by hand:
 | 
			
		||||
 | 
			
		||||
$ telnet localhost 4444
 | 
			
		||||
Trying 127.0.0.1...
 | 
			
		||||
Connected to localhost.
 | 
			
		||||
Escape character is '^]'.
 | 
			
		||||
{"QMP": {"version": {"qemu": {"micro": 50, "minor": 13, "major": 0}, "package": ""}, "capabilities": []}}
 | 
			
		||||
{ "execute": "qmp_capabilities" }
 | 
			
		||||
{"return": {}}
 | 
			
		||||
{ "execute": "query-version" }
 | 
			
		||||
{"return": {"qemu": {"micro": 50, "minor": 13, "major": 0}, "package": ""}}
 | 
			
		||||
 | 
			
		||||
Development Process
 | 
			
		||||
-------------------
 | 
			
		||||
 | 
			
		||||
When changing QMP's interface (by adding new commands, events or modifying
 | 
			
		||||
existing ones) it's mandatory to update the relevant documentation, which is
 | 
			
		||||
one (or more) of the files listed in the 'Introduction' section*.
 | 
			
		||||
 | 
			
		||||
Also, it's strongly recommended to send the documentation patch first, before
 | 
			
		||||
doing any code change. This is so because:
 | 
			
		||||
 | 
			
		||||
  1. Avoids the code dictating the interface
 | 
			
		||||
 | 
			
		||||
  2. Review can improve your interface.  Letting that happen before
 | 
			
		||||
     you implement it can save you work.
 | 
			
		||||
 | 
			
		||||
* The qmp-commands.txt file is generated from the qmp-commands.hx one, which
 | 
			
		||||
  is the file that should be edited.
 | 
			
		||||
 | 
			
		||||
Homepage
 | 
			
		||||
--------
 | 
			
		||||
 | 
			
		||||
http://wiki.qemu.org/QMP
 | 
			
		||||
							
								
								
									
										266
									
								
								QMP/qmp-events.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										266
									
								
								QMP/qmp-events.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,266 @@
 | 
			
		||||
                   QEMU Monitor Protocol Events
 | 
			
		||||
                   ============================
 | 
			
		||||
 | 
			
		||||
BLOCK_IO_ERROR
 | 
			
		||||
--------------
 | 
			
		||||
 | 
			
		||||
Emitted when a disk I/O error occurs.
 | 
			
		||||
 | 
			
		||||
Data:
 | 
			
		||||
 | 
			
		||||
- "device": device name (json-string)
 | 
			
		||||
- "operation": I/O operation (json-string, "read" or "write")
 | 
			
		||||
- "action": action that has been taken, it's one of the following (json-string):
 | 
			
		||||
    "ignore": error has been ignored
 | 
			
		||||
    "report": error has been reported to the device
 | 
			
		||||
    "stop": error caused VM to be stopped
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "event": "BLOCK_IO_ERROR",
 | 
			
		||||
    "data": { "device": "ide0-hd1",
 | 
			
		||||
              "operation": "write",
 | 
			
		||||
              "action": "stop" },
 | 
			
		||||
    "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
 | 
			
		||||
 | 
			
		||||
Note: If action is "stop", a STOP event will eventually follow the
 | 
			
		||||
BLOCK_IO_ERROR event.
 | 
			
		||||
 | 
			
		||||
RESET
 | 
			
		||||
-----
 | 
			
		||||
 | 
			
		||||
Emitted when the Virtual Machine is reseted.
 | 
			
		||||
 | 
			
		||||
Data: None.
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "event": "RESET",
 | 
			
		||||
    "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
 | 
			
		||||
 | 
			
		||||
RESUME
 | 
			
		||||
------
 | 
			
		||||
 | 
			
		||||
Emitted when the Virtual Machine resumes execution.
 | 
			
		||||
 | 
			
		||||
Data: None.
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "event": "RESUME",
 | 
			
		||||
    "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
 | 
			
		||||
 | 
			
		||||
RTC_CHANGE
 | 
			
		||||
----------
 | 
			
		||||
 | 
			
		||||
Emitted when the guest changes the RTC time.
 | 
			
		||||
 | 
			
		||||
Data:
 | 
			
		||||
 | 
			
		||||
- "offset": delta against the host UTC in seconds (json-number)
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "event": "RTC_CHANGE",
 | 
			
		||||
    "data": { "offset": 78 },
 | 
			
		||||
    "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
 | 
			
		||||
 | 
			
		||||
SHUTDOWN
 | 
			
		||||
--------
 | 
			
		||||
 | 
			
		||||
Emitted when the Virtual Machine is powered down.
 | 
			
		||||
 | 
			
		||||
Data: None.
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "event": "SHUTDOWN",
 | 
			
		||||
    "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
 | 
			
		||||
 | 
			
		||||
Note: If the command-line option "-no-shutdown" has been specified, a STOP
 | 
			
		||||
event will eventually follow the SHUTDOWN event.
 | 
			
		||||
 | 
			
		||||
STOP
 | 
			
		||||
----
 | 
			
		||||
 | 
			
		||||
Emitted when the Virtual Machine is stopped.
 | 
			
		||||
 | 
			
		||||
Data: None.
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "event": "STOP",
 | 
			
		||||
    "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
 | 
			
		||||
 | 
			
		||||
VNC_CONNECTED
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
Emitted when a VNC client establishes a connection.
 | 
			
		||||
 | 
			
		||||
Data:
 | 
			
		||||
 | 
			
		||||
- "server": Server information (json-object)
 | 
			
		||||
  - "host": IP address (json-string)
 | 
			
		||||
  - "service": port number (json-string)
 | 
			
		||||
  - "family": address family (json-string, "ipv4" or "ipv6")
 | 
			
		||||
  - "auth": authentication method (json-string, optional)
 | 
			
		||||
- "client": Client information (json-object)
 | 
			
		||||
  - "host": IP address (json-string)
 | 
			
		||||
  - "service": port number (json-string)
 | 
			
		||||
  - "family": address family (json-string, "ipv4" or "ipv6")
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "event": "VNC_CONNECTED",
 | 
			
		||||
    "data": {
 | 
			
		||||
        "server": { "auth": "sasl", "family": "ipv4",
 | 
			
		||||
                    "service": "5901", "host": "0.0.0.0" },
 | 
			
		||||
        "client": { "family": "ipv4", "service": "58425",
 | 
			
		||||
                    "host": "127.0.0.1" } },
 | 
			
		||||
    "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Note: This event is emitted before any authentication takes place, thus
 | 
			
		||||
the authentication ID is not provided.
 | 
			
		||||
 | 
			
		||||
VNC_DISCONNECTED
 | 
			
		||||
----------------
 | 
			
		||||
 | 
			
		||||
Emitted when the conection is closed.
 | 
			
		||||
 | 
			
		||||
Data:
 | 
			
		||||
 | 
			
		||||
- "server": Server information (json-object)
 | 
			
		||||
  - "host": IP address (json-string)
 | 
			
		||||
  - "service": port number (json-string)
 | 
			
		||||
  - "family": address family (json-string, "ipv4" or "ipv6")
 | 
			
		||||
  - "auth": authentication method (json-string, optional)
 | 
			
		||||
- "client": Client information (json-object)
 | 
			
		||||
  - "host": IP address (json-string)
 | 
			
		||||
  - "service": port number (json-string)
 | 
			
		||||
  - "family": address family (json-string, "ipv4" or "ipv6")
 | 
			
		||||
  - "x509_dname": TLS dname (json-string, optional)
 | 
			
		||||
  - "sasl_username": SASL username (json-string, optional)
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "event": "VNC_DISCONNECTED",
 | 
			
		||||
    "data": {
 | 
			
		||||
        "server": { "auth": "sasl", "family": "ipv4",
 | 
			
		||||
                    "service": "5901", "host": "0.0.0.0" },
 | 
			
		||||
        "client": { "family": "ipv4", "service": "58425",
 | 
			
		||||
                    "host": "127.0.0.1", "sasl_username": "luiz" } },
 | 
			
		||||
    "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
 | 
			
		||||
 | 
			
		||||
VNC_INITIALIZED
 | 
			
		||||
---------------
 | 
			
		||||
 | 
			
		||||
Emitted after authentication takes place (if any) and the VNC session is
 | 
			
		||||
made active.
 | 
			
		||||
 | 
			
		||||
Data:
 | 
			
		||||
 | 
			
		||||
- "server": Server information (json-object)
 | 
			
		||||
  - "host": IP address (json-string)
 | 
			
		||||
  - "service": port number (json-string)
 | 
			
		||||
  - "family": address family (json-string, "ipv4" or "ipv6")
 | 
			
		||||
  - "auth": authentication method (json-string, optional)
 | 
			
		||||
- "client": Client information (json-object)
 | 
			
		||||
  - "host": IP address (json-string)
 | 
			
		||||
  - "service": port number (json-string)
 | 
			
		||||
  - "family": address family (json-string, "ipv4" or "ipv6")
 | 
			
		||||
  - "x509_dname": TLS dname (json-string, optional)
 | 
			
		||||
  - "sasl_username": SASL username (json-string, optional)
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "event": "VNC_INITIALIZED",
 | 
			
		||||
    "data": {
 | 
			
		||||
        "server": { "auth": "sasl", "family": "ipv4",
 | 
			
		||||
                    "service": "5901", "host": "0.0.0.0"},
 | 
			
		||||
        "client": { "family": "ipv4", "service": "46089",
 | 
			
		||||
                    "host": "127.0.0.1", "sasl_username": "luiz" } },
 | 
			
		||||
        "timestamp": { "seconds": 1263475302, "microseconds": 150772 } }
 | 
			
		||||
 | 
			
		||||
SPICE_CONNECTED, SPICE_DISCONNECTED
 | 
			
		||||
-----------------------------------
 | 
			
		||||
 | 
			
		||||
Emitted when a SPICE client connects or disconnects.
 | 
			
		||||
 | 
			
		||||
Data:
 | 
			
		||||
 | 
			
		||||
- "server": Server information (json-object)
 | 
			
		||||
  - "host": IP address (json-string)
 | 
			
		||||
  - "port": port number (json-string)
 | 
			
		||||
  - "family": address family (json-string, "ipv4" or "ipv6")
 | 
			
		||||
- "client": Client information (json-object)
 | 
			
		||||
  - "host": IP address (json-string)
 | 
			
		||||
  - "port": port number (json-string)
 | 
			
		||||
  - "family": address family (json-string, "ipv4" or "ipv6")
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "timestamp": {"seconds": 1290688046, "microseconds": 388707},
 | 
			
		||||
  "event": "SPICE_CONNECTED",
 | 
			
		||||
  "data": {
 | 
			
		||||
    "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
 | 
			
		||||
    "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
 | 
			
		||||
}}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
SPICE_INITIALIZED
 | 
			
		||||
-----------------
 | 
			
		||||
 | 
			
		||||
Emitted after initial handshake and authentication takes place (if any)
 | 
			
		||||
and the SPICE channel is up'n'running
 | 
			
		||||
 | 
			
		||||
Data:
 | 
			
		||||
 | 
			
		||||
- "server": Server information (json-object)
 | 
			
		||||
  - "host": IP address (json-string)
 | 
			
		||||
  - "port": port number (json-string)
 | 
			
		||||
  - "family": address family (json-string, "ipv4" or "ipv6")
 | 
			
		||||
  - "auth": authentication method (json-string, optional)
 | 
			
		||||
- "client": Client information (json-object)
 | 
			
		||||
  - "host": IP address (json-string)
 | 
			
		||||
  - "port": port number (json-string)
 | 
			
		||||
  - "family": address family (json-string, "ipv4" or "ipv6")
 | 
			
		||||
  - "connection-id": spice connection id.  All channels with the same id
 | 
			
		||||
                     belong to the same spice session (json-int)
 | 
			
		||||
  - "channel-type": channel type.  "1" is the main control channel, filter for
 | 
			
		||||
                    this one if you want track spice sessions only (json-int)
 | 
			
		||||
  - "channel-id": channel id.  Usually "0", might be different needed when
 | 
			
		||||
                  multiple channels of the same type exist, such as multiple
 | 
			
		||||
                  display channels in a multihead setup (json-int)
 | 
			
		||||
  - "tls": whevener the channel is encrypted (json-bool)
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "timestamp": {"seconds": 1290688046, "microseconds": 417172},
 | 
			
		||||
  "event": "SPICE_INITIALIZED",
 | 
			
		||||
  "data": {"server": {"auth": "spice", "port": "5921",
 | 
			
		||||
                      "family": "ipv4", "host": "127.0.0.1"},
 | 
			
		||||
           "client": {"port": "49004", "family": "ipv4", "channel-type": 3,
 | 
			
		||||
                      "connection-id": 1804289383, "host": "127.0.0.1",
 | 
			
		||||
                      "channel-id": 0, "tls": true}
 | 
			
		||||
}}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
WATCHDOG
 | 
			
		||||
--------
 | 
			
		||||
 | 
			
		||||
Emitted when the watchdog device's timer is expired.
 | 
			
		||||
 | 
			
		||||
Data:
 | 
			
		||||
 | 
			
		||||
- "action": Action that has been taken, it's one of the following (json-string):
 | 
			
		||||
            "reset", "shutdown", "poweroff", "pause", "debug", or "none"
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
 | 
			
		||||
{ "event": "WATCHDOG",
 | 
			
		||||
     "data": { "action": "reset" },
 | 
			
		||||
     "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
 | 
			
		||||
 | 
			
		||||
Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
 | 
			
		||||
followed respectively by the RESET, SHUTDOWN, or STOP events.
 | 
			
		||||
							
								
								
									
										259
									
								
								QMP/qmp-shell
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										259
									
								
								QMP/qmp-shell
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,259 @@
 | 
			
		||||
#!/usr/bin/python
 | 
			
		||||
#
 | 
			
		||||
# Low-level QEMU shell on top of QMP.
 | 
			
		||||
#
 | 
			
		||||
# Copyright (C) 2009, 2010 Red Hat Inc.
 | 
			
		||||
#
 | 
			
		||||
# Authors:
 | 
			
		||||
#  Luiz Capitulino <lcapitulino@redhat.com>
 | 
			
		||||
#
 | 
			
		||||
# This work is licensed under the terms of the GNU GPL, version 2.  See
 | 
			
		||||
# the COPYING file in the top-level directory.
 | 
			
		||||
#
 | 
			
		||||
# Usage:
 | 
			
		||||
#
 | 
			
		||||
# Start QEMU with:
 | 
			
		||||
#
 | 
			
		||||
# # qemu [...] -qmp unix:./qmp-sock,server
 | 
			
		||||
#
 | 
			
		||||
# Run the shell:
 | 
			
		||||
#
 | 
			
		||||
# $ qmp-shell ./qmp-sock
 | 
			
		||||
#
 | 
			
		||||
# Commands have the following format:
 | 
			
		||||
#
 | 
			
		||||
#    < command-name > [ arg-name1=arg1 ] ... [ arg-nameN=argN ]
 | 
			
		||||
#
 | 
			
		||||
# For example:
 | 
			
		||||
#
 | 
			
		||||
# (QEMU) device_add driver=e1000 id=net1
 | 
			
		||||
# {u'return': {}}
 | 
			
		||||
# (QEMU)
 | 
			
		||||
 | 
			
		||||
import qmp
 | 
			
		||||
import readline
 | 
			
		||||
import sys
 | 
			
		||||
 | 
			
		||||
class QMPCompleter(list):
 | 
			
		||||
    def complete(self, text, state):
 | 
			
		||||
        for cmd in self:
 | 
			
		||||
            if cmd.startswith(text):
 | 
			
		||||
                if not state:
 | 
			
		||||
                    return cmd
 | 
			
		||||
                else:
 | 
			
		||||
                    state -= 1
 | 
			
		||||
 | 
			
		||||
class QMPShellError(Exception):
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
class QMPShellBadPort(QMPShellError):
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
# TODO: QMPShell's interface is a bit ugly (eg. _fill_completion() and
 | 
			
		||||
#       _execute_cmd()). Let's design a better one.
 | 
			
		||||
class QMPShell(qmp.QEMUMonitorProtocol):
 | 
			
		||||
    def __init__(self, address):
 | 
			
		||||
        qmp.QEMUMonitorProtocol.__init__(self, self.__get_address(address))
 | 
			
		||||
        self._greeting = None
 | 
			
		||||
        self._completer = None
 | 
			
		||||
 | 
			
		||||
    def __get_address(self, arg):
 | 
			
		||||
        """
 | 
			
		||||
        Figure out if the argument is in the port:host form, if it's not it's
 | 
			
		||||
        probably a file path.
 | 
			
		||||
        """
 | 
			
		||||
        addr = arg.split(':')
 | 
			
		||||
        if len(addr) == 2:
 | 
			
		||||
            try:
 | 
			
		||||
                port = int(addr[1])
 | 
			
		||||
            except ValueError:
 | 
			
		||||
                raise QMPShellBadPort
 | 
			
		||||
            return ( addr[0], port )
 | 
			
		||||
        # socket path
 | 
			
		||||
        return arg
 | 
			
		||||
 | 
			
		||||
    def _fill_completion(self):
 | 
			
		||||
        for cmd in self.cmd('query-commands')['return']:
 | 
			
		||||
            self._completer.append(cmd['name'])
 | 
			
		||||
 | 
			
		||||
    def __completer_setup(self):
 | 
			
		||||
        self._completer = QMPCompleter()
 | 
			
		||||
        self._fill_completion()
 | 
			
		||||
        readline.set_completer(self._completer.complete)
 | 
			
		||||
        readline.parse_and_bind("tab: complete")
 | 
			
		||||
        # XXX: default delimiters conflict with some command names (eg. query-),
 | 
			
		||||
        # clearing everything as it doesn't seem to matter
 | 
			
		||||
        readline.set_completer_delims('')
 | 
			
		||||
 | 
			
		||||
    def __build_cmd(self, cmdline):
 | 
			
		||||
        """
 | 
			
		||||
        Build a QMP input object from a user provided command-line in the
 | 
			
		||||
        following format:
 | 
			
		||||
    
 | 
			
		||||
            < command-name > [ arg-name1=arg1 ] ... [ arg-nameN=argN ]
 | 
			
		||||
        """
 | 
			
		||||
        cmdargs = cmdline.split()
 | 
			
		||||
        qmpcmd = { 'execute': cmdargs[0], 'arguments': {} }
 | 
			
		||||
        for arg in cmdargs[1:]:
 | 
			
		||||
            opt = arg.split('=')
 | 
			
		||||
            try:
 | 
			
		||||
                value = int(opt[1])
 | 
			
		||||
            except ValueError:
 | 
			
		||||
                value = opt[1]
 | 
			
		||||
            qmpcmd['arguments'][opt[0]] = value
 | 
			
		||||
        return qmpcmd
 | 
			
		||||
 | 
			
		||||
    def _execute_cmd(self, cmdline):
 | 
			
		||||
        try:
 | 
			
		||||
            qmpcmd = self.__build_cmd(cmdline)
 | 
			
		||||
        except:
 | 
			
		||||
            print 'command format: <command-name> ',
 | 
			
		||||
            print '[arg-name1=arg1] ... [arg-nameN=argN]'
 | 
			
		||||
            return True
 | 
			
		||||
        resp = self.cmd_obj(qmpcmd)
 | 
			
		||||
        if resp is None:
 | 
			
		||||
            print 'Disconnected'
 | 
			
		||||
            return False
 | 
			
		||||
        print resp
 | 
			
		||||
        return True
 | 
			
		||||
 | 
			
		||||
    def connect(self):
 | 
			
		||||
        self._greeting = qmp.QEMUMonitorProtocol.connect(self)
 | 
			
		||||
        self.__completer_setup()
 | 
			
		||||
 | 
			
		||||
    def show_banner(self, msg='Welcome to the QMP low-level shell!'):
 | 
			
		||||
        print msg
 | 
			
		||||
        version = self._greeting['QMP']['version']['qemu']
 | 
			
		||||
        print 'Connected to QEMU %d.%d.%d\n' % (version['major'],version['minor'],version['micro'])
 | 
			
		||||
 | 
			
		||||
    def read_exec_command(self, prompt):
 | 
			
		||||
        """
 | 
			
		||||
        Read and execute a command.
 | 
			
		||||
 | 
			
		||||
        @return True if execution was ok, return False if disconnected.
 | 
			
		||||
        """
 | 
			
		||||
        try:
 | 
			
		||||
            cmdline = raw_input(prompt)
 | 
			
		||||
        except EOFError:
 | 
			
		||||
            print
 | 
			
		||||
            return False
 | 
			
		||||
        if cmdline == '':
 | 
			
		||||
            for ev in self.get_events():
 | 
			
		||||
                print ev
 | 
			
		||||
            self.clear_events()
 | 
			
		||||
            return True
 | 
			
		||||
        else:
 | 
			
		||||
            return self._execute_cmd(cmdline)
 | 
			
		||||
 | 
			
		||||
class HMPShell(QMPShell):
 | 
			
		||||
    def __init__(self, address):
 | 
			
		||||
        QMPShell.__init__(self, address)
 | 
			
		||||
        self.__cpu_index = 0
 | 
			
		||||
 | 
			
		||||
    def __cmd_completion(self):
 | 
			
		||||
        for cmd in self.__cmd_passthrough('help')['return'].split('\r\n'):
 | 
			
		||||
            if cmd and cmd[0] != '[' and cmd[0] != '\t':
 | 
			
		||||
                name = cmd.split()[0] # drop help text
 | 
			
		||||
                if name == 'info':
 | 
			
		||||
                    continue
 | 
			
		||||
                if name.find('|') != -1:
 | 
			
		||||
                    # Command in the form 'foobar|f' or 'f|foobar', take the
 | 
			
		||||
                    # full name
 | 
			
		||||
                    opt = name.split('|')
 | 
			
		||||
                    if len(opt[0]) == 1:
 | 
			
		||||
                        name = opt[1]
 | 
			
		||||
                    else:
 | 
			
		||||
                        name = opt[0]
 | 
			
		||||
                self._completer.append(name)
 | 
			
		||||
                self._completer.append('help ' + name) # help completion
 | 
			
		||||
 | 
			
		||||
    def __info_completion(self):
 | 
			
		||||
        for cmd in self.__cmd_passthrough('info')['return'].split('\r\n'):
 | 
			
		||||
            if cmd:
 | 
			
		||||
                self._completer.append('info ' + cmd.split()[1])
 | 
			
		||||
 | 
			
		||||
    def __other_completion(self):
 | 
			
		||||
        # special cases
 | 
			
		||||
        self._completer.append('help info')
 | 
			
		||||
 | 
			
		||||
    def _fill_completion(self):
 | 
			
		||||
        self.__cmd_completion()
 | 
			
		||||
        self.__info_completion()
 | 
			
		||||
        self.__other_completion()
 | 
			
		||||
 | 
			
		||||
    def __cmd_passthrough(self, cmdline, cpu_index = 0):
 | 
			
		||||
        return self.cmd_obj({ 'execute': 'human-monitor-command', 'arguments':
 | 
			
		||||
                              { 'command-line': cmdline,
 | 
			
		||||
                                'cpu-index': cpu_index } })
 | 
			
		||||
 | 
			
		||||
    def _execute_cmd(self, cmdline):
 | 
			
		||||
        if cmdline.split()[0] == "cpu":
 | 
			
		||||
            # trap the cpu command, it requires special setting
 | 
			
		||||
            try:
 | 
			
		||||
                idx = int(cmdline.split()[1])
 | 
			
		||||
                if not 'return' in self.__cmd_passthrough('info version', idx):
 | 
			
		||||
                    print 'bad CPU index'
 | 
			
		||||
                    return True
 | 
			
		||||
                self.__cpu_index = idx
 | 
			
		||||
            except ValueError:
 | 
			
		||||
                print 'cpu command takes an integer argument'
 | 
			
		||||
                return True
 | 
			
		||||
        resp = self.__cmd_passthrough(cmdline, self.__cpu_index)
 | 
			
		||||
        if resp is None:
 | 
			
		||||
            print 'Disconnected'
 | 
			
		||||
            return False
 | 
			
		||||
        assert 'return' in resp or 'error' in resp
 | 
			
		||||
        if 'return' in resp:
 | 
			
		||||
            # Success
 | 
			
		||||
            if len(resp['return']) > 0:
 | 
			
		||||
                print resp['return'],
 | 
			
		||||
        else:
 | 
			
		||||
            # Error
 | 
			
		||||
            print '%s: %s' % (resp['error']['class'], resp['error']['desc'])
 | 
			
		||||
        return True
 | 
			
		||||
 | 
			
		||||
    def show_banner(self):
 | 
			
		||||
        QMPShell.show_banner(self, msg='Welcome to the HMP shell!')
 | 
			
		||||
 | 
			
		||||
def die(msg):
 | 
			
		||||
    sys.stderr.write('ERROR: %s\n' % msg)
 | 
			
		||||
    sys.exit(1)
 | 
			
		||||
 | 
			
		||||
def fail_cmdline(option=None):
 | 
			
		||||
    if option:
 | 
			
		||||
        sys.stderr.write('ERROR: bad command-line option \'%s\'\n' % option)
 | 
			
		||||
    sys.stderr.write('qemu-shell [ -H ] < UNIX socket path> | < TCP address:port >\n')
 | 
			
		||||
    sys.exit(1)
 | 
			
		||||
 | 
			
		||||
def main():
 | 
			
		||||
    addr = ''
 | 
			
		||||
    try:
 | 
			
		||||
        if len(sys.argv) == 2:
 | 
			
		||||
            qemu = QMPShell(sys.argv[1])
 | 
			
		||||
            addr = sys.argv[1]
 | 
			
		||||
        elif len(sys.argv) == 3:
 | 
			
		||||
            if sys.argv[1] != '-H':
 | 
			
		||||
                fail_cmdline(sys.argv[1])
 | 
			
		||||
            qemu = HMPShell(sys.argv[2])
 | 
			
		||||
            addr = sys.argv[2]
 | 
			
		||||
        else:
 | 
			
		||||
                fail_cmdline()
 | 
			
		||||
    except QMPShellBadPort:
 | 
			
		||||
        die('bad port number in command-line')
 | 
			
		||||
 | 
			
		||||
    try:
 | 
			
		||||
        qemu.connect()
 | 
			
		||||
    except qmp.QMPConnectError:
 | 
			
		||||
        die('Didn\'t get QMP greeting message')
 | 
			
		||||
    except qmp.QMPCapabilitiesError:
 | 
			
		||||
        die('Could not negotiate capabilities')
 | 
			
		||||
    except qemu.error:
 | 
			
		||||
        die('Could not connect to %s' % addr)
 | 
			
		||||
 | 
			
		||||
    qemu.show_banner()
 | 
			
		||||
    while qemu.read_exec_command('(QEMU) '):
 | 
			
		||||
        pass
 | 
			
		||||
    qemu.close()
 | 
			
		||||
 | 
			
		||||
if __name__ == '__main__':
 | 
			
		||||
    main()
 | 
			
		||||
							
								
								
									
										272
									
								
								QMP/qmp-spec.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										272
									
								
								QMP/qmp-spec.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,272 @@
 | 
			
		||||
           QEMU Monitor Protocol Specification - Version 0.1
 | 
			
		||||
 | 
			
		||||
1. Introduction
 | 
			
		||||
===============
 | 
			
		||||
 | 
			
		||||
This document specifies the QEMU Monitor Protocol (QMP), a JSON-based protocol
 | 
			
		||||
which is available for applications to control QEMU at the machine-level.
 | 
			
		||||
 | 
			
		||||
To enable QMP support, QEMU has to be run in "control mode". This is done by
 | 
			
		||||
starting QEMU with the appropriate command-line options. Please, refer to the
 | 
			
		||||
QEMU manual page for more information.
 | 
			
		||||
 | 
			
		||||
2. Protocol Specification
 | 
			
		||||
=========================
 | 
			
		||||
 | 
			
		||||
This section details the protocol format. For the purpose of this document
 | 
			
		||||
"Client" is any application which is communicating with QEMU in control mode,
 | 
			
		||||
and "Server" is QEMU itself.
 | 
			
		||||
 | 
			
		||||
JSON data structures, when mentioned in this document, are always in the
 | 
			
		||||
following format:
 | 
			
		||||
 | 
			
		||||
    json-DATA-STRUCTURE-NAME
 | 
			
		||||
 | 
			
		||||
Where DATA-STRUCTURE-NAME is any valid JSON data structure, as defined by
 | 
			
		||||
the JSON standard:
 | 
			
		||||
 | 
			
		||||
http://www.ietf.org/rfc/rfc4627.txt
 | 
			
		||||
 | 
			
		||||
For convenience, json-object members and json-array elements mentioned in
 | 
			
		||||
this document will be in a certain order. However, in real protocol usage
 | 
			
		||||
they can be in ANY order, thus no particular order should be assumed.
 | 
			
		||||
 | 
			
		||||
2.1 General Definitions
 | 
			
		||||
-----------------------
 | 
			
		||||
 | 
			
		||||
2.1.1 All interactions transmitted by the Server are json-objects, always
 | 
			
		||||
      terminating with CRLF
 | 
			
		||||
 | 
			
		||||
2.1.2 All json-objects members are mandatory when not specified otherwise
 | 
			
		||||
 | 
			
		||||
2.2 Server Greeting
 | 
			
		||||
-------------------
 | 
			
		||||
 | 
			
		||||
Right when connected the Server will issue a greeting message, which signals
 | 
			
		||||
that the connection has been successfully established and that the Server is
 | 
			
		||||
ready for capabilities negotiation (for more information refer to section
 | 
			
		||||
'4. Capabilities Negotiation').
 | 
			
		||||
 | 
			
		||||
The format is:
 | 
			
		||||
 | 
			
		||||
{ "QMP": { "version": json-object, "capabilities": json-array } }
 | 
			
		||||
 | 
			
		||||
 Where,
 | 
			
		||||
 | 
			
		||||
- The "version" member contains the Server's version information (the format
 | 
			
		||||
  is the same of the 'query-version' command)
 | 
			
		||||
- The "capabilities" member specify the availability of features beyond the
 | 
			
		||||
  baseline specification
 | 
			
		||||
 | 
			
		||||
2.3 Issuing Commands
 | 
			
		||||
--------------------
 | 
			
		||||
 | 
			
		||||
The format for command execution is:
 | 
			
		||||
 | 
			
		||||
{ "execute": json-string, "arguments": json-object, "id": json-value }
 | 
			
		||||
 | 
			
		||||
 Where,
 | 
			
		||||
 | 
			
		||||
- The "execute" member identifies the command to be executed by the Server
 | 
			
		||||
- The "arguments" member is used to pass any arguments required for the
 | 
			
		||||
  execution of the command, it is optional when no arguments are required
 | 
			
		||||
- The "id" member is a transaction identification associated with the
 | 
			
		||||
  command execution, it is optional and will be part of the response if
 | 
			
		||||
  provided
 | 
			
		||||
 | 
			
		||||
2.4 Commands Responses
 | 
			
		||||
----------------------
 | 
			
		||||
 | 
			
		||||
There are two possible responses which the Server will issue as the result
 | 
			
		||||
of a command execution: success or error.
 | 
			
		||||
 | 
			
		||||
2.4.1 success
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
The success response is issued when the command execution has finished
 | 
			
		||||
without errors.
 | 
			
		||||
 | 
			
		||||
The format is:
 | 
			
		||||
 | 
			
		||||
{ "return": json-object, "id": json-value }
 | 
			
		||||
 | 
			
		||||
 Where,
 | 
			
		||||
 | 
			
		||||
- The "return" member contains the command returned data, which is defined
 | 
			
		||||
  in a per-command basis or an empty json-object if the command does not
 | 
			
		||||
  return data
 | 
			
		||||
- The "id" member contains the transaction identification associated
 | 
			
		||||
  with the command execution (if issued by the Client)
 | 
			
		||||
 | 
			
		||||
2.4.2 error
 | 
			
		||||
-----------
 | 
			
		||||
 | 
			
		||||
The error response is issued when the command execution could not be
 | 
			
		||||
completed because of an error condition.
 | 
			
		||||
 | 
			
		||||
The format is:
 | 
			
		||||
 | 
			
		||||
{ "error": { "class": json-string, "data": json-object, "desc": json-string },
 | 
			
		||||
  "id": json-value }
 | 
			
		||||
 | 
			
		||||
 Where,
 | 
			
		||||
 | 
			
		||||
- The "class" member contains the error class name (eg. "ServiceUnavailable")
 | 
			
		||||
- The "data" member contains specific error data and is defined in a
 | 
			
		||||
  per-command basis, it will be an empty json-object if the error has no data
 | 
			
		||||
- The "desc" member is a human-readable error message. Clients should
 | 
			
		||||
  not attempt to parse this message.
 | 
			
		||||
- The "id" member contains the transaction identification associated with
 | 
			
		||||
  the command execution (if issued by the Client)
 | 
			
		||||
 | 
			
		||||
NOTE: Some errors can occur before the Server is able to read the "id" member,
 | 
			
		||||
in these cases the "id" member will not be part of the error response, even
 | 
			
		||||
if provided by the client.
 | 
			
		||||
 | 
			
		||||
2.5 Asynchronous events
 | 
			
		||||
-----------------------
 | 
			
		||||
 | 
			
		||||
As a result of state changes, the Server may send messages unilaterally
 | 
			
		||||
to the Client at any time. They are called 'asynchronous events'.
 | 
			
		||||
 | 
			
		||||
The format is:
 | 
			
		||||
 | 
			
		||||
{ "event": json-string, "data": json-object,
 | 
			
		||||
  "timestamp": { "seconds": json-number, "microseconds": json-number } }
 | 
			
		||||
 | 
			
		||||
 Where,
 | 
			
		||||
 | 
			
		||||
- The "event" member contains the event's name
 | 
			
		||||
- The "data" member contains event specific data, which is defined in a
 | 
			
		||||
  per-event basis, it is optional
 | 
			
		||||
- The "timestamp" member contains the exact time of when the event occurred
 | 
			
		||||
  in the Server. It is a fixed json-object with time in seconds and
 | 
			
		||||
  microseconds
 | 
			
		||||
 | 
			
		||||
For a listing of supported asynchronous events, please, refer to the
 | 
			
		||||
qmp-events.txt file.
 | 
			
		||||
 | 
			
		||||
3. QMP Examples
 | 
			
		||||
===============
 | 
			
		||||
 | 
			
		||||
This section provides some examples of real QMP usage, in all of them
 | 
			
		||||
'C' stands for 'Client' and 'S' stands for 'Server'.
 | 
			
		||||
 | 
			
		||||
3.1 Server greeting
 | 
			
		||||
-------------------
 | 
			
		||||
 | 
			
		||||
S: {"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": []}}
 | 
			
		||||
 | 
			
		||||
3.2 Simple 'stop' execution
 | 
			
		||||
---------------------------
 | 
			
		||||
 | 
			
		||||
C: { "execute": "stop" }
 | 
			
		||||
S: {"return": {}}
 | 
			
		||||
 | 
			
		||||
3.3 KVM information
 | 
			
		||||
-------------------
 | 
			
		||||
 | 
			
		||||
C: { "execute": "query-kvm", "id": "example" }
 | 
			
		||||
S: {"return": {"enabled": true, "present": true}, "id": "example"}
 | 
			
		||||
 | 
			
		||||
3.4 Parsing error
 | 
			
		||||
------------------
 | 
			
		||||
 | 
			
		||||
C: { "execute": }
 | 
			
		||||
S: {"error": {"class": "JSONParsing", "desc": "Invalid JSON syntax", "data":
 | 
			
		||||
{}}}
 | 
			
		||||
 | 
			
		||||
3.5 Powerdown event
 | 
			
		||||
-------------------
 | 
			
		||||
 | 
			
		||||
S: {"timestamp": {"seconds": 1258551470, "microseconds": 802384}, "event":
 | 
			
		||||
"POWERDOWN"}
 | 
			
		||||
 | 
			
		||||
4. Capabilities Negotiation
 | 
			
		||||
----------------------------
 | 
			
		||||
 | 
			
		||||
When a Client successfully establishes a connection, the Server is in
 | 
			
		||||
Capabilities Negotiation mode.
 | 
			
		||||
 | 
			
		||||
In this mode only the 'qmp_capabilities' command is allowed to run, all
 | 
			
		||||
other commands will return the CommandNotFound error. Asynchronous messages
 | 
			
		||||
are not delivered either.
 | 
			
		||||
 | 
			
		||||
Clients should use the 'qmp_capabilities' command to enable capabilities
 | 
			
		||||
advertised in the Server's greeting (section '2.2 Server Greeting') they
 | 
			
		||||
support.
 | 
			
		||||
 | 
			
		||||
When the 'qmp_capabilities' command is issued, and if it does not return an
 | 
			
		||||
error, the Server enters in Command mode where capabilities changes take
 | 
			
		||||
effect, all commands (except 'qmp_capabilities') are allowed and asynchronous
 | 
			
		||||
messages are delivered.
 | 
			
		||||
 | 
			
		||||
5 Compatibility Considerations
 | 
			
		||||
------------------------------
 | 
			
		||||
 | 
			
		||||
All protocol changes or new features which modify the protocol format in an
 | 
			
		||||
incompatible way are disabled by default and will be advertised by the
 | 
			
		||||
capabilities array (section '2.2 Server Greeting'). Thus, Clients can check
 | 
			
		||||
that array and enable the capabilities they support.
 | 
			
		||||
 | 
			
		||||
Additionally, Clients must not assume any particular:
 | 
			
		||||
 | 
			
		||||
- Size of json-objects or length of json-arrays
 | 
			
		||||
- Order of json-object members or json-array elements
 | 
			
		||||
- Amount of errors generated by a command, that is, new errors can be added
 | 
			
		||||
  to any existing command in newer versions of the Server
 | 
			
		||||
 | 
			
		||||
6. Downstream extension of QMP
 | 
			
		||||
------------------------------
 | 
			
		||||
 | 
			
		||||
We recommend that downstream consumers of QEMU do *not* modify QMP.
 | 
			
		||||
Management tools should be able to support both upstream and downstream
 | 
			
		||||
versions of QMP without special logic, and downstream extensions are
 | 
			
		||||
inherently at odds with that.
 | 
			
		||||
 | 
			
		||||
However, we recognize that it is sometimes impossible for downstreams to
 | 
			
		||||
avoid modifying QMP.  Both upstream and downstream need to take care to
 | 
			
		||||
preserve long-term compatibility and interoperability.
 | 
			
		||||
 | 
			
		||||
To help with that, QMP reserves JSON object member names beginning with
 | 
			
		||||
'__' (double underscore) for downstream use ("downstream names").  This
 | 
			
		||||
means upstream will never use any downstream names for its commands,
 | 
			
		||||
arguments, errors, asynchronous events, and so forth.
 | 
			
		||||
 | 
			
		||||
Any new names downstream wishes to add must begin with '__'.  To
 | 
			
		||||
ensure compatibility with other downstreams, it is strongly
 | 
			
		||||
recommended that you prefix your downstram names with '__RFQDN_' where
 | 
			
		||||
RFQDN is a valid, reverse fully qualified domain name which you
 | 
			
		||||
control.  For example, a qemu-kvm specific monitor command would be:
 | 
			
		||||
 | 
			
		||||
    (qemu) __org.linux-kvm_enable_irqchip
 | 
			
		||||
 | 
			
		||||
Downstream must not change the server greeting (section 2.2) other than
 | 
			
		||||
to offer additional capabilities.  But see below for why even that is
 | 
			
		||||
discouraged.
 | 
			
		||||
 | 
			
		||||
Section '5 Compatibility Considerations' applies to downstream as well
 | 
			
		||||
as to upstream, obviously.  It follows that downstream must behave
 | 
			
		||||
exactly like upstream for any input not containing members with
 | 
			
		||||
downstream names ("downstream members"), except it may add members
 | 
			
		||||
with downstream names to its output.
 | 
			
		||||
 | 
			
		||||
Thus, a client should not be able to distinguish downstream from
 | 
			
		||||
upstream as long as it doesn't send input with downstream members, and
 | 
			
		||||
properly ignores any downstream members in the output it receives.
 | 
			
		||||
 | 
			
		||||
Advice on downstream modifications:
 | 
			
		||||
 | 
			
		||||
1. Introducing new commands is okay.  If you want to extend an existing
 | 
			
		||||
   command, consider introducing a new one with the new behaviour
 | 
			
		||||
   instead.
 | 
			
		||||
 | 
			
		||||
2. Introducing new asynchronous messages is okay.  If you want to extend
 | 
			
		||||
   an existing message, consider adding a new one instead.
 | 
			
		||||
 | 
			
		||||
3. Introducing new errors for use in new commands is okay.  Adding new
 | 
			
		||||
   errors to existing commands counts as extension, so 1. applies.
 | 
			
		||||
 | 
			
		||||
4. New capabilities are strongly discouraged.  Capabilities are for
 | 
			
		||||
   evolving the basic protocol, and multiple diverging basic protocol
 | 
			
		||||
   dialects are most undesirable.
 | 
			
		||||
							
								
								
									
										157
									
								
								QMP/qmp.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										157
									
								
								QMP/qmp.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,157 @@
 | 
			
		||||
# QEMU Monitor Protocol Python class
 | 
			
		||||
# 
 | 
			
		||||
# Copyright (C) 2009, 2010 Red Hat Inc.
 | 
			
		||||
#
 | 
			
		||||
# Authors:
 | 
			
		||||
#  Luiz Capitulino <lcapitulino@redhat.com>
 | 
			
		||||
#
 | 
			
		||||
# This work is licensed under the terms of the GNU GPL, version 2.  See
 | 
			
		||||
# the COPYING file in the top-level directory.
 | 
			
		||||
 | 
			
		||||
import json
 | 
			
		||||
import errno
 | 
			
		||||
import socket
 | 
			
		||||
 | 
			
		||||
class QMPError(Exception):
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
class QMPConnectError(QMPError):
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
class QMPCapabilitiesError(QMPError):
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
class QEMUMonitorProtocol:
 | 
			
		||||
    def __init__(self, address, server=False):
 | 
			
		||||
        """
 | 
			
		||||
        Create a QEMUMonitorProtocol class.
 | 
			
		||||
 | 
			
		||||
        @param address: QEMU address, can be either a unix socket path (string)
 | 
			
		||||
                        or a tuple in the form ( address, port ) for a TCP
 | 
			
		||||
                        connection
 | 
			
		||||
        @param server: server mode listens on the socket (bool)
 | 
			
		||||
        @raise socket.error on socket connection errors
 | 
			
		||||
        @note No connection is established, this is done by the connect() or
 | 
			
		||||
              accept() methods
 | 
			
		||||
        """
 | 
			
		||||
        self.__events = []
 | 
			
		||||
        self.__address = address
 | 
			
		||||
        self.__sock = self.__get_sock()
 | 
			
		||||
        if server:
 | 
			
		||||
            self.__sock.bind(self.__address)
 | 
			
		||||
            self.__sock.listen(1)
 | 
			
		||||
 | 
			
		||||
    def __get_sock(self):
 | 
			
		||||
        if isinstance(self.__address, tuple):
 | 
			
		||||
            family = socket.AF_INET
 | 
			
		||||
        else:
 | 
			
		||||
            family = socket.AF_UNIX
 | 
			
		||||
        return socket.socket(family, socket.SOCK_STREAM)
 | 
			
		||||
 | 
			
		||||
    def __negotiate_capabilities(self):
 | 
			
		||||
        self.__sockfile = self.__sock.makefile()
 | 
			
		||||
        greeting = self.__json_read()
 | 
			
		||||
        if greeting is None or not greeting.has_key('QMP'):
 | 
			
		||||
            raise QMPConnectError
 | 
			
		||||
        # Greeting seems ok, negotiate capabilities
 | 
			
		||||
        resp = self.cmd('qmp_capabilities')
 | 
			
		||||
        if "return" in resp:
 | 
			
		||||
            return greeting
 | 
			
		||||
        raise QMPCapabilitiesError
 | 
			
		||||
 | 
			
		||||
    def __json_read(self, only_event=False):
 | 
			
		||||
        while True:
 | 
			
		||||
            data = self.__sockfile.readline()
 | 
			
		||||
            if not data:
 | 
			
		||||
                return
 | 
			
		||||
            resp = json.loads(data)
 | 
			
		||||
            if 'event' in resp:
 | 
			
		||||
                self.__events.append(resp)
 | 
			
		||||
                if not only_event:
 | 
			
		||||
                    continue
 | 
			
		||||
            return resp
 | 
			
		||||
 | 
			
		||||
    error = socket.error
 | 
			
		||||
 | 
			
		||||
    def connect(self):
 | 
			
		||||
        """
 | 
			
		||||
        Connect to the QMP Monitor and perform capabilities negotiation.
 | 
			
		||||
 | 
			
		||||
        @return QMP greeting dict
 | 
			
		||||
        @raise socket.error on socket connection errors
 | 
			
		||||
        @raise QMPConnectError if the greeting is not received
 | 
			
		||||
        @raise QMPCapabilitiesError if fails to negotiate capabilities
 | 
			
		||||
        """
 | 
			
		||||
        self.__sock.connect(self.__address)
 | 
			
		||||
        return self.__negotiate_capabilities()
 | 
			
		||||
 | 
			
		||||
    def accept(self):
 | 
			
		||||
        """
 | 
			
		||||
        Await connection from QMP Monitor and perform capabilities negotiation.
 | 
			
		||||
 | 
			
		||||
        @return QMP greeting dict
 | 
			
		||||
        @raise socket.error on socket connection errors
 | 
			
		||||
        @raise QMPConnectError if the greeting is not received
 | 
			
		||||
        @raise QMPCapabilitiesError if fails to negotiate capabilities
 | 
			
		||||
        """
 | 
			
		||||
        self.__sock, _ = self.__sock.accept()
 | 
			
		||||
        return self.__negotiate_capabilities()
 | 
			
		||||
 | 
			
		||||
    def cmd_obj(self, qmp_cmd):
 | 
			
		||||
        """
 | 
			
		||||
        Send a QMP command to the QMP Monitor.
 | 
			
		||||
 | 
			
		||||
        @param qmp_cmd: QMP command to be sent as a Python dict
 | 
			
		||||
        @return QMP response as a Python dict or None if the connection has
 | 
			
		||||
                been closed
 | 
			
		||||
        """
 | 
			
		||||
        try:
 | 
			
		||||
            self.__sock.sendall(json.dumps(qmp_cmd))
 | 
			
		||||
        except socket.error, err:
 | 
			
		||||
            if err[0] == errno.EPIPE:
 | 
			
		||||
                return
 | 
			
		||||
            raise socket.error(err)
 | 
			
		||||
        return self.__json_read()
 | 
			
		||||
 | 
			
		||||
    def cmd(self, name, args=None, id=None):
 | 
			
		||||
        """
 | 
			
		||||
        Build a QMP command and send it to the QMP Monitor.
 | 
			
		||||
 | 
			
		||||
        @param name: command name (string)
 | 
			
		||||
        @param args: command arguments (dict)
 | 
			
		||||
        @param id: command id (dict, list, string or int)
 | 
			
		||||
        """
 | 
			
		||||
        qmp_cmd = { 'execute': name }
 | 
			
		||||
        if args:
 | 
			
		||||
            qmp_cmd['arguments'] = args
 | 
			
		||||
        if id:
 | 
			
		||||
            qmp_cmd['id'] = id
 | 
			
		||||
        return self.cmd_obj(qmp_cmd)
 | 
			
		||||
 | 
			
		||||
    def get_events(self, wait=False):
 | 
			
		||||
        """
 | 
			
		||||
        Get a list of available QMP events.
 | 
			
		||||
 | 
			
		||||
        @param wait: block until an event is available (bool)
 | 
			
		||||
        """
 | 
			
		||||
        self.__sock.setblocking(0)
 | 
			
		||||
        try:
 | 
			
		||||
            self.__json_read()
 | 
			
		||||
        except socket.error, err:
 | 
			
		||||
            if err[0] == errno.EAGAIN:
 | 
			
		||||
                # No data available
 | 
			
		||||
                pass
 | 
			
		||||
        self.__sock.setblocking(1)
 | 
			
		||||
        if not self.__events and wait:
 | 
			
		||||
            self.__json_read(only_event=True)
 | 
			
		||||
        return self.__events
 | 
			
		||||
 | 
			
		||||
    def clear_events(self):
 | 
			
		||||
        """
 | 
			
		||||
        Clear current list of pending events.
 | 
			
		||||
        """
 | 
			
		||||
        self.__events = []
 | 
			
		||||
 | 
			
		||||
    def close(self):
 | 
			
		||||
        self.__sock.close()
 | 
			
		||||
        self.__sockfile.close()
 | 
			
		||||
							
								
								
									
										3
									
								
								README
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								README
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
Read the documentation in qemu-doc.html.
 | 
			
		||||
 | 
			
		||||
Fabrice Bellard.
 | 
			
		||||
							
								
								
									
										171
									
								
								README.rst
									
									
									
									
									
								
							
							
						
						
									
										171
									
								
								README.rst
									
									
									
									
									
								
							@@ -1,171 +0,0 @@
 | 
			
		||||
===========
 | 
			
		||||
QEMU README
 | 
			
		||||
===========
 | 
			
		||||
 | 
			
		||||
QEMU is a generic and open source machine & userspace emulator and
 | 
			
		||||
virtualizer.
 | 
			
		||||
 | 
			
		||||
QEMU is capable of emulating a complete machine in software without any
 | 
			
		||||
need for hardware virtualization support. By using dynamic translation,
 | 
			
		||||
it achieves very good performance. QEMU can also integrate with the Xen
 | 
			
		||||
and KVM hypervisors to provide emulated hardware while allowing the
 | 
			
		||||
hypervisor to manage the CPU. With hypervisor support, QEMU can achieve
 | 
			
		||||
near native performance for CPUs. When QEMU emulates CPUs directly it is
 | 
			
		||||
capable of running operating systems made for one machine (e.g. an ARMv7
 | 
			
		||||
board) on a different machine (e.g. an x86_64 PC board).
 | 
			
		||||
 | 
			
		||||
QEMU is also capable of providing userspace API virtualization for Linux
 | 
			
		||||
and BSD kernel interfaces. This allows binaries compiled against one
 | 
			
		||||
architecture ABI (e.g. the Linux PPC64 ABI) to be run on a host using a
 | 
			
		||||
different architecture ABI (e.g. the Linux x86_64 ABI). This does not
 | 
			
		||||
involve any hardware emulation, simply CPU and syscall emulation.
 | 
			
		||||
 | 
			
		||||
QEMU aims to fit into a variety of use cases. It can be invoked directly
 | 
			
		||||
by users wishing to have full control over its behaviour and settings.
 | 
			
		||||
It also aims to facilitate integration into higher level management
 | 
			
		||||
layers, by providing a stable command line interface and monitor API.
 | 
			
		||||
It is commonly invoked indirectly via the libvirt library when using
 | 
			
		||||
open source applications such as oVirt, OpenStack and virt-manager.
 | 
			
		||||
 | 
			
		||||
QEMU as a whole is released under the GNU General Public License,
 | 
			
		||||
version 2. For full licensing details, consult the LICENSE file.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Documentation
 | 
			
		||||
=============
 | 
			
		||||
 | 
			
		||||
Documentation can be found hosted online at
 | 
			
		||||
`<https://www.qemu.org/documentation/>`_. The documentation for the
 | 
			
		||||
current development version that is available at
 | 
			
		||||
`<https://www.qemu.org/docs/master/>`_ is generated from the ``docs/``
 | 
			
		||||
folder in the source tree, and is built by `Sphinx
 | 
			
		||||
<https://www.sphinx-doc.org/en/master/>`_.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Building
 | 
			
		||||
========
 | 
			
		||||
 | 
			
		||||
QEMU is multi-platform software intended to be buildable on all modern
 | 
			
		||||
Linux platforms, OS-X, Win32 (via the Mingw64 toolchain) and a variety
 | 
			
		||||
of other UNIX targets. The simple steps to build QEMU are:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.. code-block:: shell
 | 
			
		||||
 | 
			
		||||
  mkdir build
 | 
			
		||||
  cd build
 | 
			
		||||
  ../configure
 | 
			
		||||
  make
 | 
			
		||||
 | 
			
		||||
Additional information can also be found online via the QEMU website:
 | 
			
		||||
 | 
			
		||||
* `<https://wiki.qemu.org/Hosts/Linux>`_
 | 
			
		||||
* `<https://wiki.qemu.org/Hosts/Mac>`_
 | 
			
		||||
* `<https://wiki.qemu.org/Hosts/W32>`_
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Submitting patches
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
The QEMU source code is maintained under the GIT version control system.
 | 
			
		||||
 | 
			
		||||
.. code-block:: shell
 | 
			
		||||
 | 
			
		||||
   git clone https://gitlab.com/qemu-project/qemu.git
 | 
			
		||||
 | 
			
		||||
When submitting patches, one common approach is to use 'git
 | 
			
		||||
format-patch' and/or 'git send-email' to format & send the mail to the
 | 
			
		||||
qemu-devel@nongnu.org mailing list. All patches submitted must contain
 | 
			
		||||
a 'Signed-off-by' line from the author. Patches should follow the
 | 
			
		||||
guidelines set out in the `style section
 | 
			
		||||
<https://www.qemu.org/docs/master/devel/style.html>`_ of
 | 
			
		||||
the Developers Guide.
 | 
			
		||||
 | 
			
		||||
Additional information on submitting patches can be found online via
 | 
			
		||||
the QEMU website
 | 
			
		||||
 | 
			
		||||
* `<https://wiki.qemu.org/Contribute/SubmitAPatch>`_
 | 
			
		||||
* `<https://wiki.qemu.org/Contribute/TrivialPatches>`_
 | 
			
		||||
 | 
			
		||||
The QEMU website is also maintained under source control.
 | 
			
		||||
 | 
			
		||||
.. code-block:: shell
 | 
			
		||||
 | 
			
		||||
  git clone https://gitlab.com/qemu-project/qemu-web.git
 | 
			
		||||
 | 
			
		||||
* `<https://www.qemu.org/2017/02/04/the-new-qemu-website-is-up/>`_
 | 
			
		||||
 | 
			
		||||
A 'git-publish' utility was created to make above process less
 | 
			
		||||
cumbersome, and is highly recommended for making regular contributions,
 | 
			
		||||
or even just for sending consecutive patch series revisions. It also
 | 
			
		||||
requires a working 'git send-email' setup, and by default doesn't
 | 
			
		||||
automate everything, so you may want to go through the above steps
 | 
			
		||||
manually for once.
 | 
			
		||||
 | 
			
		||||
For installation instructions, please go to
 | 
			
		||||
 | 
			
		||||
*  `<https://github.com/stefanha/git-publish>`_
 | 
			
		||||
 | 
			
		||||
The workflow with 'git-publish' is:
 | 
			
		||||
 | 
			
		||||
.. code-block:: shell
 | 
			
		||||
 | 
			
		||||
  $ git checkout master -b my-feature
 | 
			
		||||
  $ # work on new commits, add your 'Signed-off-by' lines to each
 | 
			
		||||
  $ git publish
 | 
			
		||||
 | 
			
		||||
Your patch series will be sent and tagged as my-feature-v1 if you need to refer
 | 
			
		||||
back to it in the future.
 | 
			
		||||
 | 
			
		||||
Sending v2:
 | 
			
		||||
 | 
			
		||||
.. code-block:: shell
 | 
			
		||||
 | 
			
		||||
  $ git checkout my-feature # same topic branch
 | 
			
		||||
  $ # making changes to the commits (using 'git rebase', for example)
 | 
			
		||||
  $ git publish
 | 
			
		||||
 | 
			
		||||
Your patch series will be sent with 'v2' tag in the subject and the git tip
 | 
			
		||||
will be tagged as my-feature-v2.
 | 
			
		||||
 | 
			
		||||
Bug reporting
 | 
			
		||||
=============
 | 
			
		||||
 | 
			
		||||
The QEMU project uses GitLab issues to track bugs. Bugs
 | 
			
		||||
found when running code built from QEMU git or upstream released sources
 | 
			
		||||
should be reported via:
 | 
			
		||||
 | 
			
		||||
* `<https://gitlab.com/qemu-project/qemu/-/issues>`_
 | 
			
		||||
 | 
			
		||||
If using QEMU via an operating system vendor pre-built binary package, it
 | 
			
		||||
is preferable to report bugs to the vendor's own bug tracker first. If
 | 
			
		||||
the bug is also known to affect latest upstream code, it can also be
 | 
			
		||||
reported via GitLab.
 | 
			
		||||
 | 
			
		||||
For additional information on bug reporting consult:
 | 
			
		||||
 | 
			
		||||
* `<https://wiki.qemu.org/Contribute/ReportABug>`_
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ChangeLog
 | 
			
		||||
=========
 | 
			
		||||
 | 
			
		||||
For version history and release notes, please visit
 | 
			
		||||
`<https://wiki.qemu.org/ChangeLog/>`_ or look at the git history for
 | 
			
		||||
more detailed information.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Contact
 | 
			
		||||
=======
 | 
			
		||||
 | 
			
		||||
The QEMU community can be contacted in a number of ways, with the two
 | 
			
		||||
main methods being email and IRC
 | 
			
		||||
 | 
			
		||||
* `<mailto:qemu-devel@nongnu.org>`_
 | 
			
		||||
* `<https://lists.nongnu.org/mailman/listinfo/qemu-devel>`_
 | 
			
		||||
* #qemu on irc.oftc.net
 | 
			
		||||
 | 
			
		||||
Information on additional methods of contacting the community can be
 | 
			
		||||
found online via the QEMU website:
 | 
			
		||||
 | 
			
		||||
* `<https://wiki.qemu.org/Contribute/StartHere>`_
 | 
			
		||||
							
								
								
									
										37
									
								
								TODO
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								TODO
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
General:
 | 
			
		||||
-------
 | 
			
		||||
- cycle counter for all archs
 | 
			
		||||
- cpu_interrupt() win32/SMP fix
 | 
			
		||||
- merge PIC spurious interrupt patch
 | 
			
		||||
- warning for OS/2: must not use 128 MB memory (merge bochs cmos patch ?)
 | 
			
		||||
- config file (at least for windows/Mac OS X)
 | 
			
		||||
- update doc: PCI infos.
 | 
			
		||||
- basic VGA optimizations
 | 
			
		||||
- better code fetch
 | 
			
		||||
- do not resize vga if invalid size.
 | 
			
		||||
- TLB code protection support for PPC
 | 
			
		||||
- disable SMC handling for ARM/SPARC/PPC (not finished)
 | 
			
		||||
- see undefined flags for BTx insn
 | 
			
		||||
- keyboard output buffer filling timing emulation
 | 
			
		||||
- tests for each target CPU
 | 
			
		||||
- fix all remaining thread lock issues (must put TBs in a specific invalid
 | 
			
		||||
  state, find a solution for tb_flush()).
 | 
			
		||||
 | 
			
		||||
ppc specific:
 | 
			
		||||
------------
 | 
			
		||||
- TLB invalidate not needed if msr_pr changes
 | 
			
		||||
- enable shift optimizations ?
 | 
			
		||||
 | 
			
		||||
linux-user specific:
 | 
			
		||||
-------------------
 | 
			
		||||
- remove threading support as it cannot work at this point
 | 
			
		||||
- improve IPC syscalls
 | 
			
		||||
- more syscalls (in particular all 64 bit ones, IPCs, fix 64 bit
 | 
			
		||||
  issues, fix 16 bit uid issues)
 | 
			
		||||
- use kernel traps for unaligned accesses on ARM ?
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
lower priority:
 | 
			
		||||
--------------
 | 
			
		||||
- int15 ah=86: use better timing
 | 
			
		||||
- use -msoft-float on ARM
 | 
			
		||||
							
								
								
									
										430
									
								
								a.out.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										430
									
								
								a.out.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,430 @@
 | 
			
		||||
/* a.out.h
 | 
			
		||||
 | 
			
		||||
   Copyright 1997, 1998, 1999, 2001 Red Hat, Inc.
 | 
			
		||||
 | 
			
		||||
This file is part of Cygwin.
 | 
			
		||||
 | 
			
		||||
This software is a copyrighted work licensed under the terms of the
 | 
			
		||||
Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 | 
			
		||||
details. */
 | 
			
		||||
 | 
			
		||||
#ifndef _A_OUT_H_
 | 
			
		||||
#define _A_OUT_H_
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
#define COFF_IMAGE_WITH_PE
 | 
			
		||||
#define COFF_LONG_SECTION_NAMES
 | 
			
		||||
 | 
			
		||||
/*** coff information for Intel 386/486.  */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/********************** FILE HEADER **********************/
 | 
			
		||||
 | 
			
		||||
struct external_filehdr {
 | 
			
		||||
  short f_magic;	/* magic number			*/
 | 
			
		||||
  short f_nscns;	/* number of sections		*/
 | 
			
		||||
  host_ulong f_timdat;	/* time & date stamp		*/
 | 
			
		||||
  host_ulong f_symptr;	/* file pointer to symtab	*/
 | 
			
		||||
  host_ulong f_nsyms;	/* number of symtab entries	*/
 | 
			
		||||
  short f_opthdr;	/* sizeof(optional hdr)		*/
 | 
			
		||||
  short f_flags;	/* flags			*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Bits for f_flags:
 | 
			
		||||
 *	F_RELFLG	relocation info stripped from file
 | 
			
		||||
 *	F_EXEC		file is executable (no unresolved external references)
 | 
			
		||||
 *	F_LNNO		line numbers stripped from file
 | 
			
		||||
 *	F_LSYMS		local symbols stripped from file
 | 
			
		||||
 *	F_AR32WR	file has byte ordering of an AR32WR machine (e.g. vax)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define F_RELFLG	(0x0001)
 | 
			
		||||
#define F_EXEC		(0x0002)
 | 
			
		||||
#define F_LNNO		(0x0004)
 | 
			
		||||
#define F_LSYMS		(0x0008)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define	I386MAGIC	0x14c
 | 
			
		||||
#define I386PTXMAGIC	0x154
 | 
			
		||||
#define I386AIXMAGIC	0x175
 | 
			
		||||
 | 
			
		||||
/* This is Lynx's all-platform magic number for executables. */
 | 
			
		||||
 | 
			
		||||
#define LYNXCOFFMAGIC	0415
 | 
			
		||||
 | 
			
		||||
#define I386BADMAG(x) (((x).f_magic != I386MAGIC) \
 | 
			
		||||
		       && (x).f_magic != I386AIXMAGIC \
 | 
			
		||||
		       && (x).f_magic != I386PTXMAGIC \
 | 
			
		||||
		       && (x).f_magic != LYNXCOFFMAGIC)
 | 
			
		||||
 | 
			
		||||
#define	FILHDR	struct external_filehdr
 | 
			
		||||
#define	FILHSZ	20
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/********************** AOUT "OPTIONAL HEADER"=
 | 
			
		||||
 **********************/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  unsigned short magic;		/* type of file				*/
 | 
			
		||||
  unsigned short vstamp;	/* version stamp			*/
 | 
			
		||||
  host_ulong	tsize;		/* text size in bytes, padded to FW bdry*/
 | 
			
		||||
  host_ulong	dsize;		/* initialized data "  "		*/
 | 
			
		||||
  host_ulong	bsize;		/* uninitialized data "   "		*/
 | 
			
		||||
  host_ulong	entry;		/* entry pt.				*/
 | 
			
		||||
  host_ulong text_start;	/* base of text used for this file */
 | 
			
		||||
  host_ulong data_start;	/* base of data used for this file=
 | 
			
		||||
 */
 | 
			
		||||
}
 | 
			
		||||
AOUTHDR;
 | 
			
		||||
 | 
			
		||||
#define AOUTSZ 28
 | 
			
		||||
#define AOUTHDRSZ 28
 | 
			
		||||
 | 
			
		||||
#define OMAGIC          0404    /* object files, eg as output */
 | 
			
		||||
#define ZMAGIC          0413    /* demand load format, eg normal ld output */
 | 
			
		||||
#define STMAGIC		0401	/* target shlib */
 | 
			
		||||
#define SHMAGIC		0443	/* host   shlib */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* define some NT default values */
 | 
			
		||||
/*  #define NT_IMAGE_BASE        0x400000 moved to internal.h */
 | 
			
		||||
#define NT_SECTION_ALIGNMENT 0x1000
 | 
			
		||||
#define NT_FILE_ALIGNMENT    0x200
 | 
			
		||||
#define NT_DEF_RESERVE       0x100000
 | 
			
		||||
#define NT_DEF_COMMIT        0x1000
 | 
			
		||||
 | 
			
		||||
/********************** SECTION HEADER **********************/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct external_scnhdr {
 | 
			
		||||
  char		s_name[8];	/* section name			*/
 | 
			
		||||
  host_ulong	s_paddr;	/* physical address, offset
 | 
			
		||||
				   of last addr in scn */
 | 
			
		||||
  host_ulong	s_vaddr;	/* virtual address		*/
 | 
			
		||||
  host_ulong	s_size;		/* section size			*/
 | 
			
		||||
  host_ulong	s_scnptr;	/* file ptr to raw data for section */
 | 
			
		||||
  host_ulong	s_relptr;	/* file ptr to relocation	*/
 | 
			
		||||
  host_ulong	s_lnnoptr;	/* file ptr to line numbers	*/
 | 
			
		||||
  unsigned short s_nreloc;	/* number of relocation entries	*/
 | 
			
		||||
  unsigned short s_nlnno;	/* number of line number entries*/
 | 
			
		||||
  host_ulong	s_flags;	/* flags			*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define	SCNHDR	struct external_scnhdr
 | 
			
		||||
#define	SCNHSZ	40
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * names of "special" sections
 | 
			
		||||
 */
 | 
			
		||||
#define _TEXT	".text"
 | 
			
		||||
#define _DATA	".data"
 | 
			
		||||
#define _BSS	".bss"
 | 
			
		||||
#define _COMMENT ".comment"
 | 
			
		||||
#define _LIB ".lib"
 | 
			
		||||
 | 
			
		||||
/********************** LINE NUMBERS **********************/
 | 
			
		||||
 | 
			
		||||
/* 1 line number entry for every "breakpointable" source line in a section.
 | 
			
		||||
 * Line numbers are grouped on a per function basis; first entry in a function
 | 
			
		||||
 * grouping will have l_lnno = 0 and in place of physical address will be the
 | 
			
		||||
 * symbol table index of the function name.
 | 
			
		||||
 */
 | 
			
		||||
struct external_lineno {
 | 
			
		||||
  union {
 | 
			
		||||
    host_ulong l_symndx; /* function name symbol index, iff l_lnno 0 */
 | 
			
		||||
    host_ulong l_paddr;	/* (physical) address of line number	*/
 | 
			
		||||
  } l_addr;
 | 
			
		||||
  unsigned short l_lnno;	/* line number		*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define	LINENO	struct external_lineno
 | 
			
		||||
#define	LINESZ	6
 | 
			
		||||
 | 
			
		||||
/********************** SYMBOLS **********************/
 | 
			
		||||
 | 
			
		||||
#define E_SYMNMLEN	8	/* # characters in a symbol name	*/
 | 
			
		||||
#define E_FILNMLEN	14	/* # characters in a file name		*/
 | 
			
		||||
#define E_DIMNUM	4	/* # array dimensions in auxiliary entry */
 | 
			
		||||
 | 
			
		||||
struct __attribute__((packed)) external_syment
 | 
			
		||||
{
 | 
			
		||||
  union {
 | 
			
		||||
    char e_name[E_SYMNMLEN];
 | 
			
		||||
    struct {
 | 
			
		||||
      host_ulong e_zeroes;
 | 
			
		||||
      host_ulong e_offset;
 | 
			
		||||
    } e;
 | 
			
		||||
  } e;
 | 
			
		||||
  host_ulong e_value;
 | 
			
		||||
  unsigned short e_scnum;
 | 
			
		||||
  unsigned short e_type;
 | 
			
		||||
  char e_sclass[1];
 | 
			
		||||
  char e_numaux[1];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define N_BTMASK	(0xf)
 | 
			
		||||
#define N_TMASK		(0x30)
 | 
			
		||||
#define N_BTSHFT	(4)
 | 
			
		||||
#define N_TSHIFT	(2)
 | 
			
		||||
 | 
			
		||||
union external_auxent {
 | 
			
		||||
  struct {
 | 
			
		||||
    host_ulong x_tagndx;	/* str, un, or enum tag indx */
 | 
			
		||||
    union {
 | 
			
		||||
      struct {
 | 
			
		||||
	unsigned short  x_lnno; /* declaration line number */
 | 
			
		||||
	unsigned short  x_size; /* str/union/array size */
 | 
			
		||||
      } x_lnsz;
 | 
			
		||||
      host_ulong x_fsize;	/* size of function */
 | 
			
		||||
    } x_misc;
 | 
			
		||||
    union {
 | 
			
		||||
      struct {			/* if ISFCN, tag, or .bb */
 | 
			
		||||
	host_ulong x_lnnoptr;/* ptr to fcn line # */
 | 
			
		||||
	host_ulong x_endndx;	/* entry ndx past block end */
 | 
			
		||||
      } x_fcn;
 | 
			
		||||
      struct {			/* if ISARY, up to 4 dimen. */
 | 
			
		||||
	char x_dimen[E_DIMNUM][2];
 | 
			
		||||
      } x_ary;
 | 
			
		||||
    } x_fcnary;
 | 
			
		||||
    unsigned short x_tvndx;	/* tv index */
 | 
			
		||||
  } x_sym;
 | 
			
		||||
 | 
			
		||||
  union {
 | 
			
		||||
    char x_fname[E_FILNMLEN];
 | 
			
		||||
    struct {
 | 
			
		||||
      host_ulong x_zeroes;
 | 
			
		||||
      host_ulong x_offset;
 | 
			
		||||
    } x_n;
 | 
			
		||||
  } x_file;
 | 
			
		||||
 | 
			
		||||
  struct {
 | 
			
		||||
    host_ulong x_scnlen;	/* section length */
 | 
			
		||||
    unsigned short x_nreloc;	/* # relocation entries */
 | 
			
		||||
    unsigned short x_nlinno;	/* # line numbers */
 | 
			
		||||
    host_ulong x_checksum;	/* section COMDAT checksum */
 | 
			
		||||
    unsigned short x_associated;/* COMDAT associated section index */
 | 
			
		||||
    char x_comdat[1];		/* COMDAT selection number */
 | 
			
		||||
  } x_scn;
 | 
			
		||||
 | 
			
		||||
  struct {
 | 
			
		||||
    host_ulong x_tvfill;	/* tv fill value */
 | 
			
		||||
    unsigned short x_tvlen;	/* length of .tv */
 | 
			
		||||
    char x_tvran[2][2];		/* tv range */
 | 
			
		||||
  } x_tv;	/* info about .tv section (in auxent of symbol .tv)) */
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define	SYMENT	struct external_syment
 | 
			
		||||
#define	SYMESZ	18
 | 
			
		||||
#define	AUXENT	union external_auxent
 | 
			
		||||
#define	AUXESZ	18
 | 
			
		||||
 | 
			
		||||
#define _ETEXT	"etext"
 | 
			
		||||
 | 
			
		||||
/********************** RELOCATION DIRECTIVES **********************/
 | 
			
		||||
 | 
			
		||||
struct external_reloc {
 | 
			
		||||
  char r_vaddr[4];
 | 
			
		||||
  char r_symndx[4];
 | 
			
		||||
  char r_type[2];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define RELOC struct external_reloc
 | 
			
		||||
#define RELSZ 10
 | 
			
		||||
 | 
			
		||||
/* end of coff/i386.h */
 | 
			
		||||
 | 
			
		||||
/* PE COFF header information */
 | 
			
		||||
 | 
			
		||||
#ifndef _PE_H
 | 
			
		||||
#define _PE_H
 | 
			
		||||
 | 
			
		||||
/* NT specific file attributes */
 | 
			
		||||
#define IMAGE_FILE_RELOCS_STRIPPED           0x0001
 | 
			
		||||
#define IMAGE_FILE_EXECUTABLE_IMAGE          0x0002
 | 
			
		||||
#define IMAGE_FILE_LINE_NUMS_STRIPPED        0x0004
 | 
			
		||||
#define IMAGE_FILE_LOCAL_SYMS_STRIPPED       0x0008
 | 
			
		||||
#define IMAGE_FILE_BYTES_REVERSED_LO         0x0080
 | 
			
		||||
#define IMAGE_FILE_32BIT_MACHINE             0x0100
 | 
			
		||||
#define IMAGE_FILE_DEBUG_STRIPPED            0x0200
 | 
			
		||||
#define IMAGE_FILE_SYSTEM                    0x1000
 | 
			
		||||
#define IMAGE_FILE_DLL                       0x2000
 | 
			
		||||
#define IMAGE_FILE_BYTES_REVERSED_HI         0x8000
 | 
			
		||||
 | 
			
		||||
/* additional flags to be set for section headers to allow the NT loader to
 | 
			
		||||
   read and write to the section data (to replace the addresses of data in
 | 
			
		||||
   dlls for one thing); also to execute the section in .text's case=
 | 
			
		||||
 */
 | 
			
		||||
#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000
 | 
			
		||||
#define IMAGE_SCN_MEM_EXECUTE     0x20000000
 | 
			
		||||
#define IMAGE_SCN_MEM_READ        0x40000000
 | 
			
		||||
#define IMAGE_SCN_MEM_WRITE       0x80000000
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Section characteristics added for ppc-nt
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define IMAGE_SCN_TYPE_NO_PAD                0x00000008  /* Reserved.  */
 | 
			
		||||
 | 
			
		||||
#define IMAGE_SCN_CNT_CODE                   0x00000020  /* Section contains code. */
 | 
			
		||||
#define IMAGE_SCN_CNT_INITIALIZED_DATA       0x00000040  /* Section contains initialized data. */
 | 
			
		||||
#define IMAGE_SCN_CNT_UNINITIALIZED_DATA     0x00000080  /* Section contains uninitialized data. */
 | 
			
		||||
 | 
			
		||||
#define IMAGE_SCN_LNK_OTHER                  0x00000100  /* Reserved.  */
 | 
			
		||||
#define IMAGE_SCN_LNK_INFO                   0x00000200  /* Section contains comments or some other type of information. */
 | 
			
		||||
#define IMAGE_SCN_LNK_REMOVE                 0x00000800  /* Section contents will not become part of image. */
 | 
			
		||||
#define IMAGE_SCN_LNK_COMDAT                 0x00001000  /* Section contents comdat. */
 | 
			
		||||
 | 
			
		||||
#define IMAGE_SCN_MEM_FARDATA                0x00008000
 | 
			
		||||
 | 
			
		||||
#define IMAGE_SCN_MEM_PURGEABLE              0x00020000
 | 
			
		||||
#define IMAGE_SCN_MEM_16BIT                  0x00020000
 | 
			
		||||
#define IMAGE_SCN_MEM_LOCKED                 0x00040000
 | 
			
		||||
#define IMAGE_SCN_MEM_PRELOAD                0x00080000
 | 
			
		||||
 | 
			
		||||
#define IMAGE_SCN_ALIGN_1BYTES               0x00100000
 | 
			
		||||
#define IMAGE_SCN_ALIGN_2BYTES               0x00200000
 | 
			
		||||
#define IMAGE_SCN_ALIGN_4BYTES               0x00300000
 | 
			
		||||
#define IMAGE_SCN_ALIGN_8BYTES               0x00400000
 | 
			
		||||
#define IMAGE_SCN_ALIGN_16BYTES              0x00500000  /* Default alignment if no others are specified. */
 | 
			
		||||
#define IMAGE_SCN_ALIGN_32BYTES              0x00600000
 | 
			
		||||
#define IMAGE_SCN_ALIGN_64BYTES              0x00700000
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define IMAGE_SCN_LNK_NRELOC_OVFL            0x01000000  /* Section contains extended relocations. */
 | 
			
		||||
#define IMAGE_SCN_MEM_NOT_CACHED             0x04000000  /* Section is not cachable.               */
 | 
			
		||||
#define IMAGE_SCN_MEM_NOT_PAGED              0x08000000  /* Section is not pageable.               */
 | 
			
		||||
#define IMAGE_SCN_MEM_SHARED                 0x10000000  /* Section is shareable.                  */
 | 
			
		||||
 | 
			
		||||
/* COMDAT selection codes.  */
 | 
			
		||||
 | 
			
		||||
#define IMAGE_COMDAT_SELECT_NODUPLICATES     (1) /* Warn if duplicates.  */
 | 
			
		||||
#define IMAGE_COMDAT_SELECT_ANY		     (2) /* No warning.  */
 | 
			
		||||
#define IMAGE_COMDAT_SELECT_SAME_SIZE	     (3) /* Warn if different size.  */
 | 
			
		||||
#define IMAGE_COMDAT_SELECT_EXACT_MATCH	     (4) /* Warn if different.  */
 | 
			
		||||
#define IMAGE_COMDAT_SELECT_ASSOCIATIVE	     (5) /* Base on other section.  */
 | 
			
		||||
 | 
			
		||||
/* Magic values that are true for all dos/nt implementations */
 | 
			
		||||
#define DOSMAGIC       0x5a4d
 | 
			
		||||
#define NT_SIGNATURE   0x00004550
 | 
			
		||||
 | 
			
		||||
/* NT allows long filenames, we want to accommodate this.  This may break
 | 
			
		||||
     some of the bfd functions */
 | 
			
		||||
#undef  FILNMLEN
 | 
			
		||||
#define FILNMLEN	18	/* # characters in a file name		*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef COFF_IMAGE_WITH_PE
 | 
			
		||||
/* The filehdr is only weired in images */
 | 
			
		||||
 | 
			
		||||
#undef FILHDR
 | 
			
		||||
struct external_PE_filehdr
 | 
			
		||||
{
 | 
			
		||||
  /* DOS header fields */
 | 
			
		||||
  unsigned short e_magic;	/* Magic number, 0x5a4d */
 | 
			
		||||
  unsigned short e_cblp;	/* Bytes on last page of file, 0x90 */
 | 
			
		||||
  unsigned short e_cp;		/* Pages in file, 0x3 */
 | 
			
		||||
  unsigned short e_crlc;	/* Relocations, 0x0 */
 | 
			
		||||
  unsigned short e_cparhdr;	/* Size of header in paragraphs, 0x4 */
 | 
			
		||||
  unsigned short e_minalloc;	/* Minimum extra paragraphs needed, 0x0 */
 | 
			
		||||
  unsigned short e_maxalloc;	/* Maximum extra paragraphs needed, 0xFFFF */
 | 
			
		||||
  unsigned short e_ss;		/* Initial (relative) SS value, 0x0 */
 | 
			
		||||
  unsigned short e_sp;		/* Initial SP value, 0xb8 */
 | 
			
		||||
  unsigned short e_csum;	/* Checksum, 0x0 */
 | 
			
		||||
  unsigned short e_ip;		/* Initial IP value, 0x0 */
 | 
			
		||||
  unsigned short e_cs;		/* Initial (relative) CS value, 0x0 */
 | 
			
		||||
  unsigned short e_lfarlc;	/* File address of relocation table, 0x40 */
 | 
			
		||||
  unsigned short e_ovno;	/* Overlay number, 0x0 */
 | 
			
		||||
  char e_res[4][2];		/* Reserved words, all 0x0 */
 | 
			
		||||
  unsigned short e_oemid;	/* OEM identifier (for e_oeminfo), 0x0 */
 | 
			
		||||
  unsigned short e_oeminfo;	/* OEM information; e_oemid specific, 0x0 */
 | 
			
		||||
  char e_res2[10][2];		/* Reserved words, all 0x0 */
 | 
			
		||||
  host_ulong e_lfanew;	/* File address of new exe header, 0x80 */
 | 
			
		||||
  char dos_message[16][4];	/* other stuff, always follow DOS header */
 | 
			
		||||
  unsigned int nt_signature;	/* required NT signature, 0x4550 */
 | 
			
		||||
 | 
			
		||||
  /* From standard header */
 | 
			
		||||
 | 
			
		||||
  unsigned short f_magic;	/* magic number			*/
 | 
			
		||||
  unsigned short f_nscns;	/* number of sections		*/
 | 
			
		||||
  host_ulong f_timdat;	/* time & date stamp		*/
 | 
			
		||||
  host_ulong f_symptr;	/* file pointer to symtab	*/
 | 
			
		||||
  host_ulong f_nsyms;	/* number of symtab entries	*/
 | 
			
		||||
  unsigned short f_opthdr;	/* sizeof(optional hdr)		*/
 | 
			
		||||
  unsigned short f_flags;	/* flags			*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define FILHDR struct external_PE_filehdr
 | 
			
		||||
#undef FILHSZ
 | 
			
		||||
#define FILHSZ 152
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  unsigned short magic;		/* type of file				*/
 | 
			
		||||
  unsigned short vstamp;	/* version stamp			*/
 | 
			
		||||
  host_ulong	tsize;		/* text size in bytes, padded to FW bdry*/
 | 
			
		||||
  host_ulong	dsize;		/* initialized data "  "		*/
 | 
			
		||||
  host_ulong	bsize;		/* uninitialized data "   "		*/
 | 
			
		||||
  host_ulong	entry;		/* entry pt.				*/
 | 
			
		||||
  host_ulong text_start;	/* base of text used for this file */
 | 
			
		||||
  host_ulong data_start;	/* base of all data used for this file */
 | 
			
		||||
 | 
			
		||||
  /* NT extra fields; see internal.h for descriptions */
 | 
			
		||||
  host_ulong  ImageBase;
 | 
			
		||||
  host_ulong  SectionAlignment;
 | 
			
		||||
  host_ulong  FileAlignment;
 | 
			
		||||
  unsigned short  MajorOperatingSystemVersion;
 | 
			
		||||
  unsigned short  MinorOperatingSystemVersion;
 | 
			
		||||
  unsigned short  MajorImageVersion;
 | 
			
		||||
  unsigned short  MinorImageVersion;
 | 
			
		||||
  unsigned short  MajorSubsystemVersion;
 | 
			
		||||
  unsigned short  MinorSubsystemVersion;
 | 
			
		||||
  char  Reserved1[4];
 | 
			
		||||
  host_ulong  SizeOfImage;
 | 
			
		||||
  host_ulong  SizeOfHeaders;
 | 
			
		||||
  host_ulong  CheckSum;
 | 
			
		||||
  unsigned short Subsystem;
 | 
			
		||||
  unsigned short DllCharacteristics;
 | 
			
		||||
  host_ulong  SizeOfStackReserve;
 | 
			
		||||
  host_ulong  SizeOfStackCommit;
 | 
			
		||||
  host_ulong  SizeOfHeapReserve;
 | 
			
		||||
  host_ulong  SizeOfHeapCommit;
 | 
			
		||||
  host_ulong  LoaderFlags;
 | 
			
		||||
  host_ulong  NumberOfRvaAndSizes;
 | 
			
		||||
  /* IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; */
 | 
			
		||||
  char  DataDirectory[16][2][4]; /* 16 entries, 2 elements/entry, 4 chars */
 | 
			
		||||
 | 
			
		||||
} PEAOUTHDR;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#undef AOUTSZ
 | 
			
		||||
#define AOUTSZ (AOUTHDRSZ + 196)
 | 
			
		||||
 | 
			
		||||
#undef  E_FILNMLEN
 | 
			
		||||
#define E_FILNMLEN	18	/* # characters in a file name		*/
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* end of coff/pe.h */
 | 
			
		||||
 | 
			
		||||
#define DT_NON		(0)	/* no derived type */
 | 
			
		||||
#define DT_PTR		(1)	/* pointer */
 | 
			
		||||
#define DT_FCN		(2)	/* function */
 | 
			
		||||
#define DT_ARY		(3)	/* array */
 | 
			
		||||
 | 
			
		||||
#define ISPTR(x)	(((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
 | 
			
		||||
#define ISFCN(x)	(((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
 | 
			
		||||
#define ISARY(x)	(((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* _A_OUT_H_ */
 | 
			
		||||
@@ -1,19 +0,0 @@
 | 
			
		||||
config WHPX
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config NVMM
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config HVF
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config TCG
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config KVM
 | 
			
		||||
    bool
 | 
			
		||||
 | 
			
		||||
config XEN
 | 
			
		||||
    bool
 | 
			
		||||
    select FSDEV_9P if VIRTFS
 | 
			
		||||
    select XEN_BUS
 | 
			
		||||
@@ -1,154 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Lock to inhibit accelerator ioctls
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 2022 Red Hat Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Emanuele Giuseppe Esposito       <eesposit@redhat.com>
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
 * in the Software without restriction, including without limitation the rights
 | 
			
		||||
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
 * copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
 * furnished to do so, subject to the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * The above copyright notice and this permission notice shall be included in
 | 
			
		||||
 * all copies or substantial portions of the Software.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 | 
			
		||||
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
 * THE SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "qemu/thread.h"
 | 
			
		||||
#include "qemu/main-loop.h"
 | 
			
		||||
#include "hw/core/cpu.h"
 | 
			
		||||
#include "sysemu/accel-blocker.h"
 | 
			
		||||
 | 
			
		||||
static QemuLockCnt accel_in_ioctl_lock;
 | 
			
		||||
static QemuEvent accel_in_ioctl_event;
 | 
			
		||||
 | 
			
		||||
void accel_blocker_init(void)
 | 
			
		||||
{
 | 
			
		||||
    qemu_lockcnt_init(&accel_in_ioctl_lock);
 | 
			
		||||
    qemu_event_init(&accel_in_ioctl_event, false);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void accel_ioctl_begin(void)
 | 
			
		||||
{
 | 
			
		||||
    if (likely(bql_locked())) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* block if lock is taken in kvm_ioctl_inhibit_begin() */
 | 
			
		||||
    qemu_lockcnt_inc(&accel_in_ioctl_lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void accel_ioctl_end(void)
 | 
			
		||||
{
 | 
			
		||||
    if (likely(bql_locked())) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    qemu_lockcnt_dec(&accel_in_ioctl_lock);
 | 
			
		||||
    /* change event to SET. If event was BUSY, wake up all waiters */
 | 
			
		||||
    qemu_event_set(&accel_in_ioctl_event);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void accel_cpu_ioctl_begin(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    if (unlikely(bql_locked())) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* block if lock is taken in kvm_ioctl_inhibit_begin() */
 | 
			
		||||
    qemu_lockcnt_inc(&cpu->in_ioctl_lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void accel_cpu_ioctl_end(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    if (unlikely(bql_locked())) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    qemu_lockcnt_dec(&cpu->in_ioctl_lock);
 | 
			
		||||
    /* change event to SET. If event was BUSY, wake up all waiters */
 | 
			
		||||
    qemu_event_set(&accel_in_ioctl_event);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool accel_has_to_wait(void)
 | 
			
		||||
{
 | 
			
		||||
    CPUState *cpu;
 | 
			
		||||
    bool needs_to_wait = false;
 | 
			
		||||
 | 
			
		||||
    CPU_FOREACH(cpu) {
 | 
			
		||||
        if (qemu_lockcnt_count(&cpu->in_ioctl_lock)) {
 | 
			
		||||
            /* exit the ioctl, if vcpu is running it */
 | 
			
		||||
            qemu_cpu_kick(cpu);
 | 
			
		||||
            needs_to_wait = true;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return needs_to_wait || qemu_lockcnt_count(&accel_in_ioctl_lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void accel_ioctl_inhibit_begin(void)
 | 
			
		||||
{
 | 
			
		||||
    CPUState *cpu;
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * We allow to inhibit only when holding the BQL, so we can identify
 | 
			
		||||
     * when an inhibitor wants to issue an ioctl easily.
 | 
			
		||||
     */
 | 
			
		||||
    g_assert(bql_locked());
 | 
			
		||||
 | 
			
		||||
    /* Block further invocations of the ioctls outside the BQL.  */
 | 
			
		||||
    CPU_FOREACH(cpu) {
 | 
			
		||||
        qemu_lockcnt_lock(&cpu->in_ioctl_lock);
 | 
			
		||||
    }
 | 
			
		||||
    qemu_lockcnt_lock(&accel_in_ioctl_lock);
 | 
			
		||||
 | 
			
		||||
    /* Keep waiting until there are running ioctls */
 | 
			
		||||
    while (true) {
 | 
			
		||||
 | 
			
		||||
        /* Reset event to FREE. */
 | 
			
		||||
        qemu_event_reset(&accel_in_ioctl_event);
 | 
			
		||||
 | 
			
		||||
        if (accel_has_to_wait()) {
 | 
			
		||||
            /*
 | 
			
		||||
             * If event is still FREE, and there are ioctls still in progress,
 | 
			
		||||
             * wait.
 | 
			
		||||
             *
 | 
			
		||||
             *  If an ioctl finishes before qemu_event_wait(), it will change
 | 
			
		||||
             * the event state to SET. This will prevent qemu_event_wait() from
 | 
			
		||||
             * blocking, but it's not a problem because if other ioctls are
 | 
			
		||||
             * still running the loop will iterate once more and reset the event
 | 
			
		||||
             * status to FREE so that it can wait properly.
 | 
			
		||||
             *
 | 
			
		||||
             * If an ioctls finishes while qemu_event_wait() is blocking, then
 | 
			
		||||
             * it will be waken up, but also here the while loop makes sure
 | 
			
		||||
             * to re-enter the wait if there are other running ioctls.
 | 
			
		||||
             */
 | 
			
		||||
            qemu_event_wait(&accel_in_ioctl_event);
 | 
			
		||||
        } else {
 | 
			
		||||
            /* No ioctl is running */
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void accel_ioctl_inhibit_end(void)
 | 
			
		||||
{
 | 
			
		||||
    CPUState *cpu;
 | 
			
		||||
 | 
			
		||||
    qemu_lockcnt_unlock(&accel_in_ioctl_lock);
 | 
			
		||||
    CPU_FOREACH(cpu) {
 | 
			
		||||
        qemu_lockcnt_unlock(&cpu->in_ioctl_lock);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1,106 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * QEMU accel class, system emulation components
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 2003-2008 Fabrice Bellard
 | 
			
		||||
 * Copyright (c) 2014 Red Hat Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
 * in the Software without restriction, including without limitation the rights
 | 
			
		||||
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
 * copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
 * furnished to do so, subject to the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * The above copyright notice and this permission notice shall be included in
 | 
			
		||||
 * all copies or substantial portions of the Software.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 | 
			
		||||
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
 * THE SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "qemu/accel.h"
 | 
			
		||||
#include "hw/boards.h"
 | 
			
		||||
#include "sysemu/cpus.h"
 | 
			
		||||
#include "qemu/error-report.h"
 | 
			
		||||
#include "accel-system.h"
 | 
			
		||||
 | 
			
		||||
int accel_init_machine(AccelState *accel, MachineState *ms)
 | 
			
		||||
{
 | 
			
		||||
    AccelClass *acc = ACCEL_GET_CLASS(accel);
 | 
			
		||||
    int ret;
 | 
			
		||||
    ms->accelerator = accel;
 | 
			
		||||
    *(acc->allowed) = true;
 | 
			
		||||
    ret = acc->init_machine(ms);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        ms->accelerator = NULL;
 | 
			
		||||
        *(acc->allowed) = false;
 | 
			
		||||
        object_unref(OBJECT(accel));
 | 
			
		||||
    } else {
 | 
			
		||||
        object_set_accelerator_compat_props(acc->compat_props);
 | 
			
		||||
    }
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
AccelState *current_accel(void)
 | 
			
		||||
{
 | 
			
		||||
    return current_machine->accelerator;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void accel_setup_post(MachineState *ms)
 | 
			
		||||
{
 | 
			
		||||
    AccelState *accel = ms->accelerator;
 | 
			
		||||
    AccelClass *acc = ACCEL_GET_CLASS(accel);
 | 
			
		||||
    if (acc->setup_post) {
 | 
			
		||||
        acc->setup_post(ms, accel);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* initialize the arch-independent accel operation interfaces */
 | 
			
		||||
void accel_system_init_ops_interfaces(AccelClass *ac)
 | 
			
		||||
{
 | 
			
		||||
    const char *ac_name;
 | 
			
		||||
    char *ops_name;
 | 
			
		||||
    ObjectClass *oc;
 | 
			
		||||
    AccelOpsClass *ops;
 | 
			
		||||
 | 
			
		||||
    ac_name = object_class_get_name(OBJECT_CLASS(ac));
 | 
			
		||||
    g_assert(ac_name != NULL);
 | 
			
		||||
 | 
			
		||||
    ops_name = g_strdup_printf("%s" ACCEL_OPS_SUFFIX, ac_name);
 | 
			
		||||
    ops = ACCEL_OPS_CLASS(module_object_class_by_name(ops_name));
 | 
			
		||||
    oc = module_object_class_by_name(ops_name);
 | 
			
		||||
    if (!oc) {
 | 
			
		||||
        error_report("fatal: could not load module for type '%s'", ops_name);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
    g_free(ops_name);
 | 
			
		||||
    ops = ACCEL_OPS_CLASS(oc);
 | 
			
		||||
    /*
 | 
			
		||||
     * all accelerators need to define ops, providing at least a mandatory
 | 
			
		||||
     * non-NULL create_vcpu_thread operation.
 | 
			
		||||
     */
 | 
			
		||||
    g_assert(ops != NULL);
 | 
			
		||||
    if (ops->ops_init) {
 | 
			
		||||
        ops->ops_init(ops);
 | 
			
		||||
    }
 | 
			
		||||
    cpus_register_accel(ops);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const TypeInfo accel_ops_type_info = {
 | 
			
		||||
    .name = TYPE_ACCEL_OPS,
 | 
			
		||||
    .parent = TYPE_OBJECT,
 | 
			
		||||
    .abstract = true,
 | 
			
		||||
    .class_size = sizeof(AccelOpsClass),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void accel_system_register_types(void)
 | 
			
		||||
{
 | 
			
		||||
    type_register_static(&accel_ops_type_info);
 | 
			
		||||
}
 | 
			
		||||
type_init(accel_system_register_types);
 | 
			
		||||
@@ -1,15 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * QEMU System Emulation accel internal functions
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright 2021 SUSE LLC
 | 
			
		||||
 *
 | 
			
		||||
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
			
		||||
 * See the COPYING file in the top-level directory.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef ACCEL_SYSTEM_H
 | 
			
		||||
#define ACCEL_SYSTEM_H
 | 
			
		||||
 | 
			
		||||
void accel_system_init_ops_interfaces(AccelClass *ac);
 | 
			
		||||
 | 
			
		||||
#endif /* ACCEL_SYSTEM_H */
 | 
			
		||||
@@ -1,176 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * QEMU accel class, components common to system emulation and user mode
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 2003-2008 Fabrice Bellard
 | 
			
		||||
 * Copyright (c) 2014 Red Hat Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
 * in the Software without restriction, including without limitation the rights
 | 
			
		||||
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
 * copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
 * furnished to do so, subject to the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * The above copyright notice and this permission notice shall be included in
 | 
			
		||||
 * all copies or substantial portions of the Software.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 | 
			
		||||
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
 * THE SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "qemu/accel.h"
 | 
			
		||||
 | 
			
		||||
#include "cpu.h"
 | 
			
		||||
#include "hw/core/accel-cpu.h"
 | 
			
		||||
 | 
			
		||||
#ifndef CONFIG_USER_ONLY
 | 
			
		||||
#include "accel-system.h"
 | 
			
		||||
#endif /* !CONFIG_USER_ONLY */
 | 
			
		||||
 | 
			
		||||
static const TypeInfo accel_type = {
 | 
			
		||||
    .name = TYPE_ACCEL,
 | 
			
		||||
    .parent = TYPE_OBJECT,
 | 
			
		||||
    .class_size = sizeof(AccelClass),
 | 
			
		||||
    .instance_size = sizeof(AccelState),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Lookup AccelClass from opt_name. Returns NULL if not found */
 | 
			
		||||
AccelClass *accel_find(const char *opt_name)
 | 
			
		||||
{
 | 
			
		||||
    char *class_name = g_strdup_printf(ACCEL_CLASS_NAME("%s"), opt_name);
 | 
			
		||||
    AccelClass *ac = ACCEL_CLASS(module_object_class_by_name(class_name));
 | 
			
		||||
    g_free(class_name);
 | 
			
		||||
    return ac;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Return the name of the current accelerator */
 | 
			
		||||
const char *current_accel_name(void)
 | 
			
		||||
{
 | 
			
		||||
    AccelClass *ac = ACCEL_GET_CLASS(current_accel());
 | 
			
		||||
 | 
			
		||||
    return ac->name;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void accel_init_cpu_int_aux(ObjectClass *klass, void *opaque)
 | 
			
		||||
{
 | 
			
		||||
    CPUClass *cc = CPU_CLASS(klass);
 | 
			
		||||
    AccelCPUClass *accel_cpu = opaque;
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * The first callback allows accel-cpu to run initializations
 | 
			
		||||
     * for the CPU, customizing CPU behavior according to the accelerator.
 | 
			
		||||
     *
 | 
			
		||||
     * The second one allows the CPU to customize the accel-cpu
 | 
			
		||||
     * behavior according to the CPU.
 | 
			
		||||
     *
 | 
			
		||||
     * The second is currently only used by TCG, to specialize the
 | 
			
		||||
     * TCGCPUOps depending on the CPU type.
 | 
			
		||||
     */
 | 
			
		||||
    cc->accel_cpu = accel_cpu;
 | 
			
		||||
    if (accel_cpu->cpu_class_init) {
 | 
			
		||||
        accel_cpu->cpu_class_init(cc);
 | 
			
		||||
    }
 | 
			
		||||
    if (cc->init_accel_cpu) {
 | 
			
		||||
        cc->init_accel_cpu(accel_cpu, cc);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* initialize the arch-specific accel CpuClass interfaces */
 | 
			
		||||
static void accel_init_cpu_interfaces(AccelClass *ac)
 | 
			
		||||
{
 | 
			
		||||
    const char *ac_name; /* AccelClass name */
 | 
			
		||||
    char *acc_name;      /* AccelCPUClass name */
 | 
			
		||||
    ObjectClass *acc;    /* AccelCPUClass */
 | 
			
		||||
 | 
			
		||||
    ac_name = object_class_get_name(OBJECT_CLASS(ac));
 | 
			
		||||
    g_assert(ac_name != NULL);
 | 
			
		||||
 | 
			
		||||
    acc_name = g_strdup_printf("%s-%s", ac_name, CPU_RESOLVING_TYPE);
 | 
			
		||||
    acc = object_class_by_name(acc_name);
 | 
			
		||||
    g_free(acc_name);
 | 
			
		||||
 | 
			
		||||
    if (acc) {
 | 
			
		||||
        object_class_foreach(accel_init_cpu_int_aux,
 | 
			
		||||
                             CPU_RESOLVING_TYPE, false, acc);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void accel_init_interfaces(AccelClass *ac)
 | 
			
		||||
{
 | 
			
		||||
#ifndef CONFIG_USER_ONLY
 | 
			
		||||
    accel_system_init_ops_interfaces(ac);
 | 
			
		||||
#endif /* !CONFIG_USER_ONLY */
 | 
			
		||||
 | 
			
		||||
    accel_init_cpu_interfaces(ac);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void accel_cpu_instance_init(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    CPUClass *cc = CPU_GET_CLASS(cpu);
 | 
			
		||||
 | 
			
		||||
    if (cc->accel_cpu && cc->accel_cpu->cpu_instance_init) {
 | 
			
		||||
        cc->accel_cpu->cpu_instance_init(cpu);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool accel_cpu_common_realize(CPUState *cpu, Error **errp)
 | 
			
		||||
{
 | 
			
		||||
    CPUClass *cc = CPU_GET_CLASS(cpu);
 | 
			
		||||
    AccelState *accel = current_accel();
 | 
			
		||||
    AccelClass *acc = ACCEL_GET_CLASS(accel);
 | 
			
		||||
 | 
			
		||||
    /* target specific realization */
 | 
			
		||||
    if (cc->accel_cpu && cc->accel_cpu->cpu_target_realize
 | 
			
		||||
        && !cc->accel_cpu->cpu_target_realize(cpu, errp)) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* generic realization */
 | 
			
		||||
    if (acc->cpu_common_realize && !acc->cpu_common_realize(cpu, errp)) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void accel_cpu_common_unrealize(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    AccelState *accel = current_accel();
 | 
			
		||||
    AccelClass *acc = ACCEL_GET_CLASS(accel);
 | 
			
		||||
 | 
			
		||||
    /* generic unrealization */
 | 
			
		||||
    if (acc->cpu_common_unrealize) {
 | 
			
		||||
        acc->cpu_common_unrealize(cpu);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int accel_supported_gdbstub_sstep_flags(void)
 | 
			
		||||
{
 | 
			
		||||
    AccelState *accel = current_accel();
 | 
			
		||||
    AccelClass *acc = ACCEL_GET_CLASS(accel);
 | 
			
		||||
    if (acc->gdbstub_supported_sstep_flags) {
 | 
			
		||||
        return acc->gdbstub_supported_sstep_flags();
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const TypeInfo accel_cpu_type = {
 | 
			
		||||
    .name = TYPE_ACCEL_CPU,
 | 
			
		||||
    .parent = TYPE_OBJECT,
 | 
			
		||||
    .abstract = true,
 | 
			
		||||
    .class_size = sizeof(AccelCPUClass),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void register_accel_types(void)
 | 
			
		||||
{
 | 
			
		||||
    type_register_static(&accel_type);
 | 
			
		||||
    type_register_static(&accel_cpu_type);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type_init(register_accel_types);
 | 
			
		||||
@@ -1,24 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * QEMU accel class, user-mode components
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright 2021 SUSE LLC
 | 
			
		||||
 *
 | 
			
		||||
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
			
		||||
 * See the COPYING file in the top-level directory.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "qemu/accel.h"
 | 
			
		||||
 | 
			
		||||
AccelState *current_accel(void)
 | 
			
		||||
{
 | 
			
		||||
    static AccelState *accel;
 | 
			
		||||
 | 
			
		||||
    if (!accel) {
 | 
			
		||||
        AccelClass *ac = accel_find("tcg");
 | 
			
		||||
 | 
			
		||||
        g_assert(ac != NULL);
 | 
			
		||||
        accel = ACCEL(object_new_with_class(OBJECT_CLASS(ac)));
 | 
			
		||||
    }
 | 
			
		||||
    return accel;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,78 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Dummy cpu thread code
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright IBM, Corp. 2011
 | 
			
		||||
 *
 | 
			
		||||
 * Authors:
 | 
			
		||||
 *  Anthony Liguori   <aliguori@us.ibm.com>
 | 
			
		||||
 *
 | 
			
		||||
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
			
		||||
 * See the COPYING file in the top-level directory.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "qemu/rcu.h"
 | 
			
		||||
#include "sysemu/cpus.h"
 | 
			
		||||
#include "qemu/guest-random.h"
 | 
			
		||||
#include "qemu/main-loop.h"
 | 
			
		||||
#include "hw/core/cpu.h"
 | 
			
		||||
 | 
			
		||||
static void *dummy_cpu_thread_fn(void *arg)
 | 
			
		||||
{
 | 
			
		||||
    CPUState *cpu = arg;
 | 
			
		||||
 | 
			
		||||
    rcu_register_thread();
 | 
			
		||||
 | 
			
		||||
    bql_lock();
 | 
			
		||||
    qemu_thread_get_self(cpu->thread);
 | 
			
		||||
    cpu->thread_id = qemu_get_thread_id();
 | 
			
		||||
    current_cpu = cpu;
 | 
			
		||||
 | 
			
		||||
#ifndef _WIN32
 | 
			
		||||
    sigset_t waitset;
 | 
			
		||||
    int r;
 | 
			
		||||
 | 
			
		||||
    sigemptyset(&waitset);
 | 
			
		||||
    sigaddset(&waitset, SIG_IPI);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    /* signal CPU creation */
 | 
			
		||||
    cpu_thread_signal_created(cpu);
 | 
			
		||||
    qemu_guest_random_seed_thread_part2(cpu->random_seed);
 | 
			
		||||
 | 
			
		||||
    do {
 | 
			
		||||
        bql_unlock();
 | 
			
		||||
#ifndef _WIN32
 | 
			
		||||
        do {
 | 
			
		||||
            int sig;
 | 
			
		||||
            r = sigwait(&waitset, &sig);
 | 
			
		||||
        } while (r == -1 && (errno == EAGAIN || errno == EINTR));
 | 
			
		||||
        if (r == -1) {
 | 
			
		||||
            perror("sigwait");
 | 
			
		||||
            exit(1);
 | 
			
		||||
        }
 | 
			
		||||
#else
 | 
			
		||||
        qemu_sem_wait(&cpu->sem);
 | 
			
		||||
#endif
 | 
			
		||||
        bql_lock();
 | 
			
		||||
        qemu_wait_io_event(cpu);
 | 
			
		||||
    } while (!cpu->unplug);
 | 
			
		||||
 | 
			
		||||
    bql_unlock();
 | 
			
		||||
    rcu_unregister_thread();
 | 
			
		||||
    return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void dummy_start_vcpu_thread(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    char thread_name[VCPU_THREAD_NAME_SIZE];
 | 
			
		||||
 | 
			
		||||
    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/DUMMY",
 | 
			
		||||
             cpu->cpu_index);
 | 
			
		||||
    qemu_thread_create(cpu->thread, thread_name, dummy_cpu_thread_fn, cpu,
 | 
			
		||||
                       QEMU_THREAD_JOINABLE);
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
    qemu_sem_init(&cpu->sem, 0);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
@@ -1,8 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 | 
			
		||||
<plist version="1.0">
 | 
			
		||||
<dict>
 | 
			
		||||
    <key>com.apple.security.hypervisor</key>
 | 
			
		||||
    <true/>
 | 
			
		||||
</dict>
 | 
			
		||||
</plist>
 | 
			
		||||
@@ -1,603 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2008 IBM Corporation
 | 
			
		||||
 *           2008 Red Hat, Inc.
 | 
			
		||||
 * Copyright 2011 Intel Corporation
 | 
			
		||||
 * Copyright 2016 Veertu, Inc.
 | 
			
		||||
 * Copyright 2017 The Android Open Source Project
 | 
			
		||||
 *
 | 
			
		||||
 * QEMU Hypervisor.framework support
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of version 2 of the GNU General Public
 | 
			
		||||
 * License as published by the Free Software Foundation.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 *
 | 
			
		||||
 * This file contain code under public domain from the hvdos project:
 | 
			
		||||
 * https://github.com/mist64/hvdos
 | 
			
		||||
 *
 | 
			
		||||
 * Parts Copyright (c) 2011 NetApp, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "qemu/error-report.h"
 | 
			
		||||
#include "qemu/main-loop.h"
 | 
			
		||||
#include "exec/address-spaces.h"
 | 
			
		||||
#include "exec/exec-all.h"
 | 
			
		||||
#include "gdbstub/enums.h"
 | 
			
		||||
#include "sysemu/cpus.h"
 | 
			
		||||
#include "sysemu/hvf.h"
 | 
			
		||||
#include "sysemu/hvf_int.h"
 | 
			
		||||
#include "sysemu/runstate.h"
 | 
			
		||||
#include "qemu/guest-random.h"
 | 
			
		||||
 | 
			
		||||
HVFState *hvf_state;
 | 
			
		||||
 | 
			
		||||
#ifdef __aarch64__
 | 
			
		||||
#define HV_VM_DEFAULT NULL
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Memory slots */
 | 
			
		||||
 | 
			
		||||
hvf_slot *hvf_find_overlap_slot(uint64_t start, uint64_t size)
 | 
			
		||||
{
 | 
			
		||||
    hvf_slot *slot;
 | 
			
		||||
    int x;
 | 
			
		||||
    for (x = 0; x < hvf_state->num_slots; ++x) {
 | 
			
		||||
        slot = &hvf_state->slots[x];
 | 
			
		||||
        if (slot->size && start < (slot->start + slot->size) &&
 | 
			
		||||
            (start + size) > slot->start) {
 | 
			
		||||
            return slot;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct mac_slot {
 | 
			
		||||
    int present;
 | 
			
		||||
    uint64_t size;
 | 
			
		||||
    uint64_t gpa_start;
 | 
			
		||||
    uint64_t gva;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct mac_slot mac_slots[32];
 | 
			
		||||
 | 
			
		||||
static int do_hvf_set_memory(hvf_slot *slot, hv_memory_flags_t flags)
 | 
			
		||||
{
 | 
			
		||||
    struct mac_slot *macslot;
 | 
			
		||||
    hv_return_t ret;
 | 
			
		||||
 | 
			
		||||
    macslot = &mac_slots[slot->slot_id];
 | 
			
		||||
 | 
			
		||||
    if (macslot->present) {
 | 
			
		||||
        if (macslot->size != slot->size) {
 | 
			
		||||
            macslot->present = 0;
 | 
			
		||||
            ret = hv_vm_unmap(macslot->gpa_start, macslot->size);
 | 
			
		||||
            assert_hvf_ok(ret);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!slot->size) {
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    macslot->present = 1;
 | 
			
		||||
    macslot->gpa_start = slot->start;
 | 
			
		||||
    macslot->size = slot->size;
 | 
			
		||||
    ret = hv_vm_map(slot->mem, slot->start, slot->size, flags);
 | 
			
		||||
    assert_hvf_ok(ret);
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_set_phys_mem(MemoryRegionSection *section, bool add)
 | 
			
		||||
{
 | 
			
		||||
    hvf_slot *mem;
 | 
			
		||||
    MemoryRegion *area = section->mr;
 | 
			
		||||
    bool writable = !area->readonly && !area->rom_device;
 | 
			
		||||
    hv_memory_flags_t flags;
 | 
			
		||||
    uint64_t page_size = qemu_real_host_page_size();
 | 
			
		||||
 | 
			
		||||
    if (!memory_region_is_ram(area)) {
 | 
			
		||||
        if (writable) {
 | 
			
		||||
            return;
 | 
			
		||||
        } else if (!memory_region_is_romd(area)) {
 | 
			
		||||
            /*
 | 
			
		||||
             * If the memory device is not in romd_mode, then we actually want
 | 
			
		||||
             * to remove the hvf memory slot so all accesses will trap.
 | 
			
		||||
             */
 | 
			
		||||
             add = false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!QEMU_IS_ALIGNED(int128_get64(section->size), page_size) ||
 | 
			
		||||
        !QEMU_IS_ALIGNED(section->offset_within_address_space, page_size)) {
 | 
			
		||||
        /* Not page aligned, so we can not map as RAM */
 | 
			
		||||
        add = false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    mem = hvf_find_overlap_slot(
 | 
			
		||||
            section->offset_within_address_space,
 | 
			
		||||
            int128_get64(section->size));
 | 
			
		||||
 | 
			
		||||
    if (mem && add) {
 | 
			
		||||
        if (mem->size == int128_get64(section->size) &&
 | 
			
		||||
            mem->start == section->offset_within_address_space &&
 | 
			
		||||
            mem->mem == (memory_region_get_ram_ptr(area) +
 | 
			
		||||
            section->offset_within_region)) {
 | 
			
		||||
            return; /* Same region was attempted to register, go away. */
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Region needs to be reset. set the size to 0 and remap it. */
 | 
			
		||||
    if (mem) {
 | 
			
		||||
        mem->size = 0;
 | 
			
		||||
        if (do_hvf_set_memory(mem, 0)) {
 | 
			
		||||
            error_report("Failed to reset overlapping slot");
 | 
			
		||||
            abort();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!add) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (area->readonly ||
 | 
			
		||||
        (!memory_region_is_ram(area) && memory_region_is_romd(area))) {
 | 
			
		||||
        flags = HV_MEMORY_READ | HV_MEMORY_EXEC;
 | 
			
		||||
    } else {
 | 
			
		||||
        flags = HV_MEMORY_READ | HV_MEMORY_WRITE | HV_MEMORY_EXEC;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Now make a new slot. */
 | 
			
		||||
    int x;
 | 
			
		||||
 | 
			
		||||
    for (x = 0; x < hvf_state->num_slots; ++x) {
 | 
			
		||||
        mem = &hvf_state->slots[x];
 | 
			
		||||
        if (!mem->size) {
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (x == hvf_state->num_slots) {
 | 
			
		||||
        error_report("No free slots");
 | 
			
		||||
        abort();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    mem->size = int128_get64(section->size);
 | 
			
		||||
    mem->mem = memory_region_get_ram_ptr(area) + section->offset_within_region;
 | 
			
		||||
    mem->start = section->offset_within_address_space;
 | 
			
		||||
    mem->region = area;
 | 
			
		||||
 | 
			
		||||
    if (do_hvf_set_memory(mem, flags)) {
 | 
			
		||||
        error_report("Error registering new memory slot");
 | 
			
		||||
        abort();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void do_hvf_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data arg)
 | 
			
		||||
{
 | 
			
		||||
    if (!cpu->accel->dirty) {
 | 
			
		||||
        hvf_get_registers(cpu);
 | 
			
		||||
        cpu->accel->dirty = true;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_cpu_synchronize_state(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    if (!cpu->accel->dirty) {
 | 
			
		||||
        run_on_cpu(cpu, do_hvf_cpu_synchronize_state, RUN_ON_CPU_NULL);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void do_hvf_cpu_synchronize_set_dirty(CPUState *cpu,
 | 
			
		||||
                                             run_on_cpu_data arg)
 | 
			
		||||
{
 | 
			
		||||
    /* QEMU state is the reference, push it to HVF now and on next entry */
 | 
			
		||||
    cpu->accel->dirty = true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_cpu_synchronize_post_reset(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    run_on_cpu(cpu, do_hvf_cpu_synchronize_set_dirty, RUN_ON_CPU_NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_cpu_synchronize_post_init(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    run_on_cpu(cpu, do_hvf_cpu_synchronize_set_dirty, RUN_ON_CPU_NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_cpu_synchronize_pre_loadvm(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    run_on_cpu(cpu, do_hvf_cpu_synchronize_set_dirty, RUN_ON_CPU_NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_set_dirty_tracking(MemoryRegionSection *section, bool on)
 | 
			
		||||
{
 | 
			
		||||
    hvf_slot *slot;
 | 
			
		||||
 | 
			
		||||
    slot = hvf_find_overlap_slot(
 | 
			
		||||
            section->offset_within_address_space,
 | 
			
		||||
            int128_get64(section->size));
 | 
			
		||||
 | 
			
		||||
    /* protect region against writes; begin tracking it */
 | 
			
		||||
    if (on) {
 | 
			
		||||
        slot->flags |= HVF_SLOT_LOG;
 | 
			
		||||
        hv_vm_protect((uintptr_t)slot->start, (size_t)slot->size,
 | 
			
		||||
                      HV_MEMORY_READ | HV_MEMORY_EXEC);
 | 
			
		||||
    /* stop tracking region*/
 | 
			
		||||
    } else {
 | 
			
		||||
        slot->flags &= ~HVF_SLOT_LOG;
 | 
			
		||||
        hv_vm_protect((uintptr_t)slot->start, (size_t)slot->size,
 | 
			
		||||
                      HV_MEMORY_READ | HV_MEMORY_WRITE | HV_MEMORY_EXEC);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_log_start(MemoryListener *listener,
 | 
			
		||||
                          MemoryRegionSection *section, int old, int new)
 | 
			
		||||
{
 | 
			
		||||
    if (old != 0) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    hvf_set_dirty_tracking(section, 1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_log_stop(MemoryListener *listener,
 | 
			
		||||
                         MemoryRegionSection *section, int old, int new)
 | 
			
		||||
{
 | 
			
		||||
    if (new != 0) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    hvf_set_dirty_tracking(section, 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_log_sync(MemoryListener *listener,
 | 
			
		||||
                         MemoryRegionSection *section)
 | 
			
		||||
{
 | 
			
		||||
    /*
 | 
			
		||||
     * sync of dirty pages is handled elsewhere; just make sure we keep
 | 
			
		||||
     * tracking the region.
 | 
			
		||||
     */
 | 
			
		||||
    hvf_set_dirty_tracking(section, 1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_region_add(MemoryListener *listener,
 | 
			
		||||
                           MemoryRegionSection *section)
 | 
			
		||||
{
 | 
			
		||||
    hvf_set_phys_mem(section, true);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_region_del(MemoryListener *listener,
 | 
			
		||||
                           MemoryRegionSection *section)
 | 
			
		||||
{
 | 
			
		||||
    hvf_set_phys_mem(section, false);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MemoryListener hvf_memory_listener = {
 | 
			
		||||
    .name = "hvf",
 | 
			
		||||
    .priority = MEMORY_LISTENER_PRIORITY_ACCEL,
 | 
			
		||||
    .region_add = hvf_region_add,
 | 
			
		||||
    .region_del = hvf_region_del,
 | 
			
		||||
    .log_start = hvf_log_start,
 | 
			
		||||
    .log_stop = hvf_log_stop,
 | 
			
		||||
    .log_sync = hvf_log_sync,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void dummy_signal(int sig)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool hvf_allowed;
 | 
			
		||||
 | 
			
		||||
static int hvf_accel_init(MachineState *ms)
 | 
			
		||||
{
 | 
			
		||||
    int x;
 | 
			
		||||
    hv_return_t ret;
 | 
			
		||||
    HVFState *s;
 | 
			
		||||
 | 
			
		||||
    ret = hv_vm_create(HV_VM_DEFAULT);
 | 
			
		||||
    assert_hvf_ok(ret);
 | 
			
		||||
 | 
			
		||||
    s = g_new0(HVFState, 1);
 | 
			
		||||
 | 
			
		||||
    s->num_slots = ARRAY_SIZE(s->slots);
 | 
			
		||||
    for (x = 0; x < s->num_slots; ++x) {
 | 
			
		||||
        s->slots[x].size = 0;
 | 
			
		||||
        s->slots[x].slot_id = x;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    QTAILQ_INIT(&s->hvf_sw_breakpoints);
 | 
			
		||||
 | 
			
		||||
    hvf_state = s;
 | 
			
		||||
    memory_listener_register(&hvf_memory_listener, &address_space_memory);
 | 
			
		||||
 | 
			
		||||
    return hvf_arch_init();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline int hvf_gdbstub_sstep_flags(void)
 | 
			
		||||
{
 | 
			
		||||
    return SSTEP_ENABLE | SSTEP_NOIRQ;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_accel_class_init(ObjectClass *oc, void *data)
 | 
			
		||||
{
 | 
			
		||||
    AccelClass *ac = ACCEL_CLASS(oc);
 | 
			
		||||
    ac->name = "HVF";
 | 
			
		||||
    ac->init_machine = hvf_accel_init;
 | 
			
		||||
    ac->allowed = &hvf_allowed;
 | 
			
		||||
    ac->gdbstub_supported_sstep_flags = hvf_gdbstub_sstep_flags;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const TypeInfo hvf_accel_type = {
 | 
			
		||||
    .name = TYPE_HVF_ACCEL,
 | 
			
		||||
    .parent = TYPE_ACCEL,
 | 
			
		||||
    .class_init = hvf_accel_class_init,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void hvf_type_init(void)
 | 
			
		||||
{
 | 
			
		||||
    type_register_static(&hvf_accel_type);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type_init(hvf_type_init);
 | 
			
		||||
 | 
			
		||||
static void hvf_vcpu_destroy(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    hv_return_t ret = hv_vcpu_destroy(cpu->accel->fd);
 | 
			
		||||
    assert_hvf_ok(ret);
 | 
			
		||||
 | 
			
		||||
    hvf_arch_vcpu_destroy(cpu);
 | 
			
		||||
    g_free(cpu->accel);
 | 
			
		||||
    cpu->accel = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int hvf_init_vcpu(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    int r;
 | 
			
		||||
 | 
			
		||||
    cpu->accel = g_new0(AccelCPUState, 1);
 | 
			
		||||
 | 
			
		||||
    /* init cpu signals */
 | 
			
		||||
    struct sigaction sigact;
 | 
			
		||||
 | 
			
		||||
    memset(&sigact, 0, sizeof(sigact));
 | 
			
		||||
    sigact.sa_handler = dummy_signal;
 | 
			
		||||
    sigaction(SIG_IPI, &sigact, NULL);
 | 
			
		||||
 | 
			
		||||
    pthread_sigmask(SIG_BLOCK, NULL, &cpu->accel->unblock_ipi_mask);
 | 
			
		||||
    sigdelset(&cpu->accel->unblock_ipi_mask, SIG_IPI);
 | 
			
		||||
 | 
			
		||||
#ifdef __aarch64__
 | 
			
		||||
    r = hv_vcpu_create(&cpu->accel->fd,
 | 
			
		||||
                       (hv_vcpu_exit_t **)&cpu->accel->exit, NULL);
 | 
			
		||||
#else
 | 
			
		||||
    r = hv_vcpu_create(&cpu->accel->fd, HV_VCPU_DEFAULT);
 | 
			
		||||
#endif
 | 
			
		||||
    cpu->accel->dirty = true;
 | 
			
		||||
    assert_hvf_ok(r);
 | 
			
		||||
 | 
			
		||||
    cpu->accel->guest_debug_enabled = false;
 | 
			
		||||
 | 
			
		||||
    return hvf_arch_init_vcpu(cpu);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The HVF-specific vCPU thread function. This one should only run when the host
 | 
			
		||||
 * CPU supports the VMX "unrestricted guest" feature.
 | 
			
		||||
 */
 | 
			
		||||
static void *hvf_cpu_thread_fn(void *arg)
 | 
			
		||||
{
 | 
			
		||||
    CPUState *cpu = arg;
 | 
			
		||||
 | 
			
		||||
    int r;
 | 
			
		||||
 | 
			
		||||
    assert(hvf_enabled());
 | 
			
		||||
 | 
			
		||||
    rcu_register_thread();
 | 
			
		||||
 | 
			
		||||
    bql_lock();
 | 
			
		||||
    qemu_thread_get_self(cpu->thread);
 | 
			
		||||
 | 
			
		||||
    cpu->thread_id = qemu_get_thread_id();
 | 
			
		||||
    current_cpu = cpu;
 | 
			
		||||
 | 
			
		||||
    hvf_init_vcpu(cpu);
 | 
			
		||||
 | 
			
		||||
    /* signal CPU creation */
 | 
			
		||||
    cpu_thread_signal_created(cpu);
 | 
			
		||||
    qemu_guest_random_seed_thread_part2(cpu->random_seed);
 | 
			
		||||
 | 
			
		||||
    do {
 | 
			
		||||
        if (cpu_can_run(cpu)) {
 | 
			
		||||
            r = hvf_vcpu_exec(cpu);
 | 
			
		||||
            if (r == EXCP_DEBUG) {
 | 
			
		||||
                cpu_handle_guest_debug(cpu);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        qemu_wait_io_event(cpu);
 | 
			
		||||
    } while (!cpu->unplug || cpu_can_run(cpu));
 | 
			
		||||
 | 
			
		||||
    hvf_vcpu_destroy(cpu);
 | 
			
		||||
    cpu_thread_signal_destroyed(cpu);
 | 
			
		||||
    bql_unlock();
 | 
			
		||||
    rcu_unregister_thread();
 | 
			
		||||
    return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_start_vcpu_thread(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    char thread_name[VCPU_THREAD_NAME_SIZE];
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * HVF currently does not support TCG, and only runs in
 | 
			
		||||
     * unrestricted-guest mode.
 | 
			
		||||
     */
 | 
			
		||||
    assert(hvf_enabled());
 | 
			
		||||
 | 
			
		||||
    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/HVF",
 | 
			
		||||
             cpu->cpu_index);
 | 
			
		||||
    qemu_thread_create(cpu->thread, thread_name, hvf_cpu_thread_fn,
 | 
			
		||||
                       cpu, QEMU_THREAD_JOINABLE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int hvf_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
 | 
			
		||||
{
 | 
			
		||||
    struct hvf_sw_breakpoint *bp;
 | 
			
		||||
    int err;
 | 
			
		||||
 | 
			
		||||
    if (type == GDB_BREAKPOINT_SW) {
 | 
			
		||||
        bp = hvf_find_sw_breakpoint(cpu, addr);
 | 
			
		||||
        if (bp) {
 | 
			
		||||
            bp->use_count++;
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        bp = g_new(struct hvf_sw_breakpoint, 1);
 | 
			
		||||
        bp->pc = addr;
 | 
			
		||||
        bp->use_count = 1;
 | 
			
		||||
        err = hvf_arch_insert_sw_breakpoint(cpu, bp);
 | 
			
		||||
        if (err) {
 | 
			
		||||
            g_free(bp);
 | 
			
		||||
            return err;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        QTAILQ_INSERT_HEAD(&hvf_state->hvf_sw_breakpoints, bp, entry);
 | 
			
		||||
    } else {
 | 
			
		||||
        err = hvf_arch_insert_hw_breakpoint(addr, len, type);
 | 
			
		||||
        if (err) {
 | 
			
		||||
            return err;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CPU_FOREACH(cpu) {
 | 
			
		||||
        err = hvf_update_guest_debug(cpu);
 | 
			
		||||
        if (err) {
 | 
			
		||||
            return err;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int hvf_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
 | 
			
		||||
{
 | 
			
		||||
    struct hvf_sw_breakpoint *bp;
 | 
			
		||||
    int err;
 | 
			
		||||
 | 
			
		||||
    if (type == GDB_BREAKPOINT_SW) {
 | 
			
		||||
        bp = hvf_find_sw_breakpoint(cpu, addr);
 | 
			
		||||
        if (!bp) {
 | 
			
		||||
            return -ENOENT;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (bp->use_count > 1) {
 | 
			
		||||
            bp->use_count--;
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        err = hvf_arch_remove_sw_breakpoint(cpu, bp);
 | 
			
		||||
        if (err) {
 | 
			
		||||
            return err;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        QTAILQ_REMOVE(&hvf_state->hvf_sw_breakpoints, bp, entry);
 | 
			
		||||
        g_free(bp);
 | 
			
		||||
    } else {
 | 
			
		||||
        err = hvf_arch_remove_hw_breakpoint(addr, len, type);
 | 
			
		||||
        if (err) {
 | 
			
		||||
            return err;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CPU_FOREACH(cpu) {
 | 
			
		||||
        err = hvf_update_guest_debug(cpu);
 | 
			
		||||
        if (err) {
 | 
			
		||||
            return err;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_remove_all_breakpoints(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    struct hvf_sw_breakpoint *bp, *next;
 | 
			
		||||
    CPUState *tmpcpu;
 | 
			
		||||
 | 
			
		||||
    QTAILQ_FOREACH_SAFE(bp, &hvf_state->hvf_sw_breakpoints, entry, next) {
 | 
			
		||||
        if (hvf_arch_remove_sw_breakpoint(cpu, bp) != 0) {
 | 
			
		||||
            /* Try harder to find a CPU that currently sees the breakpoint. */
 | 
			
		||||
            CPU_FOREACH(tmpcpu)
 | 
			
		||||
            {
 | 
			
		||||
                if (hvf_arch_remove_sw_breakpoint(tmpcpu, bp) == 0) {
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        QTAILQ_REMOVE(&hvf_state->hvf_sw_breakpoints, bp, entry);
 | 
			
		||||
        g_free(bp);
 | 
			
		||||
    }
 | 
			
		||||
    hvf_arch_remove_all_hw_breakpoints();
 | 
			
		||||
 | 
			
		||||
    CPU_FOREACH(cpu) {
 | 
			
		||||
        hvf_update_guest_debug(cpu);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void hvf_accel_ops_class_init(ObjectClass *oc, void *data)
 | 
			
		||||
{
 | 
			
		||||
    AccelOpsClass *ops = ACCEL_OPS_CLASS(oc);
 | 
			
		||||
 | 
			
		||||
    ops->create_vcpu_thread = hvf_start_vcpu_thread;
 | 
			
		||||
    ops->kick_vcpu_thread = hvf_kick_vcpu_thread;
 | 
			
		||||
 | 
			
		||||
    ops->synchronize_post_reset = hvf_cpu_synchronize_post_reset;
 | 
			
		||||
    ops->synchronize_post_init = hvf_cpu_synchronize_post_init;
 | 
			
		||||
    ops->synchronize_state = hvf_cpu_synchronize_state;
 | 
			
		||||
    ops->synchronize_pre_loadvm = hvf_cpu_synchronize_pre_loadvm;
 | 
			
		||||
 | 
			
		||||
    ops->insert_breakpoint = hvf_insert_breakpoint;
 | 
			
		||||
    ops->remove_breakpoint = hvf_remove_breakpoint;
 | 
			
		||||
    ops->remove_all_breakpoints = hvf_remove_all_breakpoints;
 | 
			
		||||
    ops->update_guest_debug = hvf_update_guest_debug;
 | 
			
		||||
    ops->supports_guest_debug = hvf_arch_supports_guest_debug;
 | 
			
		||||
};
 | 
			
		||||
static const TypeInfo hvf_accel_ops_type = {
 | 
			
		||||
    .name = ACCEL_OPS_NAME("hvf"),
 | 
			
		||||
 | 
			
		||||
    .parent = TYPE_ACCEL_OPS,
 | 
			
		||||
    .class_init = hvf_accel_ops_class_init,
 | 
			
		||||
    .abstract = true,
 | 
			
		||||
};
 | 
			
		||||
static void hvf_accel_ops_register_types(void)
 | 
			
		||||
{
 | 
			
		||||
    type_register_static(&hvf_accel_ops_type);
 | 
			
		||||
}
 | 
			
		||||
type_init(hvf_accel_ops_register_types);
 | 
			
		||||
@@ -1,65 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * QEMU Hypervisor.framework support
 | 
			
		||||
 *
 | 
			
		||||
 * This work is licensed under the terms of the GNU GPL, version 2.  See
 | 
			
		||||
 * the COPYING file in the top-level directory.
 | 
			
		||||
 *
 | 
			
		||||
 * Contributions after 2012-01-13 are licensed under the terms of the
 | 
			
		||||
 * GNU GPL, version 2 or (at your option) any later version.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "qemu/error-report.h"
 | 
			
		||||
#include "sysemu/hvf.h"
 | 
			
		||||
#include "sysemu/hvf_int.h"
 | 
			
		||||
 | 
			
		||||
const char *hvf_return_string(hv_return_t ret)
 | 
			
		||||
{
 | 
			
		||||
    switch (ret) {
 | 
			
		||||
    case HV_SUCCESS:      return "HV_SUCCESS";
 | 
			
		||||
    case HV_ERROR:        return "HV_ERROR";
 | 
			
		||||
    case HV_BUSY:         return "HV_BUSY";
 | 
			
		||||
    case HV_BAD_ARGUMENT: return "HV_BAD_ARGUMENT";
 | 
			
		||||
    case HV_NO_RESOURCES: return "HV_NO_RESOURCES";
 | 
			
		||||
    case HV_NO_DEVICE:    return "HV_NO_DEVICE";
 | 
			
		||||
    case HV_UNSUPPORTED:  return "HV_UNSUPPORTED";
 | 
			
		||||
    case HV_DENIED:       return "HV_DENIED";
 | 
			
		||||
    default:              return "[unknown hv_return value]";
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void assert_hvf_ok_impl(hv_return_t ret, const char *file, unsigned int line,
 | 
			
		||||
                        const char *exp)
 | 
			
		||||
{
 | 
			
		||||
    if (ret == HV_SUCCESS) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    error_report("Error: %s = %s (0x%x, at %s:%u)",
 | 
			
		||||
        exp, hvf_return_string(ret), ret, file, line);
 | 
			
		||||
 | 
			
		||||
    abort();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, vaddr pc)
 | 
			
		||||
{
 | 
			
		||||
    struct hvf_sw_breakpoint *bp;
 | 
			
		||||
 | 
			
		||||
    QTAILQ_FOREACH(bp, &hvf_state->hvf_sw_breakpoints, entry) {
 | 
			
		||||
        if (bp->pc == pc) {
 | 
			
		||||
            return bp;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int hvf_sw_breakpoints_active(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    return !QTAILQ_EMPTY(&hvf_state->hvf_sw_breakpoints);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int hvf_update_guest_debug(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    hvf_arch_update_guest_debug(cpu);
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,7 +0,0 @@
 | 
			
		||||
hvf_ss = ss.source_set()
 | 
			
		||||
hvf_ss.add(files(
 | 
			
		||||
  'hvf-all.c',
 | 
			
		||||
  'hvf-accel-ops.c',
 | 
			
		||||
))
 | 
			
		||||
 | 
			
		||||
specific_ss.add_all(when: 'CONFIG_HVF', if_true: hvf_ss)
 | 
			
		||||
@@ -1,125 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * QEMU KVM support
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright IBM, Corp. 2008
 | 
			
		||||
 *           Red Hat, Inc. 2008
 | 
			
		||||
 *
 | 
			
		||||
 * Authors:
 | 
			
		||||
 *  Anthony Liguori   <aliguori@us.ibm.com>
 | 
			
		||||
 *  Glauber Costa     <gcosta@redhat.com>
 | 
			
		||||
 *
 | 
			
		||||
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
			
		||||
 * See the COPYING file in the top-level directory.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "qemu/error-report.h"
 | 
			
		||||
#include "qemu/main-loop.h"
 | 
			
		||||
#include "sysemu/kvm.h"
 | 
			
		||||
#include "sysemu/kvm_int.h"
 | 
			
		||||
#include "sysemu/runstate.h"
 | 
			
		||||
#include "sysemu/cpus.h"
 | 
			
		||||
#include "qemu/guest-random.h"
 | 
			
		||||
#include "qapi/error.h"
 | 
			
		||||
 | 
			
		||||
#include <linux/kvm.h>
 | 
			
		||||
#include "kvm-cpus.h"
 | 
			
		||||
 | 
			
		||||
static void *kvm_vcpu_thread_fn(void *arg)
 | 
			
		||||
{
 | 
			
		||||
    CPUState *cpu = arg;
 | 
			
		||||
    int r;
 | 
			
		||||
 | 
			
		||||
    rcu_register_thread();
 | 
			
		||||
 | 
			
		||||
    bql_lock();
 | 
			
		||||
    qemu_thread_get_self(cpu->thread);
 | 
			
		||||
    cpu->thread_id = qemu_get_thread_id();
 | 
			
		||||
    current_cpu = cpu;
 | 
			
		||||
 | 
			
		||||
    r = kvm_init_vcpu(cpu, &error_fatal);
 | 
			
		||||
    kvm_init_cpu_signals(cpu);
 | 
			
		||||
 | 
			
		||||
    /* signal CPU creation */
 | 
			
		||||
    cpu_thread_signal_created(cpu);
 | 
			
		||||
    qemu_guest_random_seed_thread_part2(cpu->random_seed);
 | 
			
		||||
 | 
			
		||||
    do {
 | 
			
		||||
        if (cpu_can_run(cpu)) {
 | 
			
		||||
            r = kvm_cpu_exec(cpu);
 | 
			
		||||
            if (r == EXCP_DEBUG) {
 | 
			
		||||
                cpu_handle_guest_debug(cpu);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        qemu_wait_io_event(cpu);
 | 
			
		||||
    } while (!cpu->unplug || cpu_can_run(cpu));
 | 
			
		||||
 | 
			
		||||
    kvm_destroy_vcpu(cpu);
 | 
			
		||||
    cpu_thread_signal_destroyed(cpu);
 | 
			
		||||
    bql_unlock();
 | 
			
		||||
    rcu_unregister_thread();
 | 
			
		||||
    return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void kvm_start_vcpu_thread(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    char thread_name[VCPU_THREAD_NAME_SIZE];
 | 
			
		||||
 | 
			
		||||
    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/KVM",
 | 
			
		||||
             cpu->cpu_index);
 | 
			
		||||
    qemu_thread_create(cpu->thread, thread_name, kvm_vcpu_thread_fn,
 | 
			
		||||
                       cpu, QEMU_THREAD_JOINABLE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool kvm_vcpu_thread_is_idle(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    return !kvm_halt_in_kernel();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool kvm_cpus_are_resettable(void)
 | 
			
		||||
{
 | 
			
		||||
    return !kvm_enabled() || !kvm_state->guest_state_protected;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef TARGET_KVM_HAVE_GUEST_DEBUG
 | 
			
		||||
static int kvm_update_guest_debug_ops(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    return kvm_update_guest_debug(cpu, 0);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static void kvm_accel_ops_class_init(ObjectClass *oc, void *data)
 | 
			
		||||
{
 | 
			
		||||
    AccelOpsClass *ops = ACCEL_OPS_CLASS(oc);
 | 
			
		||||
 | 
			
		||||
    ops->create_vcpu_thread = kvm_start_vcpu_thread;
 | 
			
		||||
    ops->cpu_thread_is_idle = kvm_vcpu_thread_is_idle;
 | 
			
		||||
    ops->cpus_are_resettable = kvm_cpus_are_resettable;
 | 
			
		||||
    ops->synchronize_post_reset = kvm_cpu_synchronize_post_reset;
 | 
			
		||||
    ops->synchronize_post_init = kvm_cpu_synchronize_post_init;
 | 
			
		||||
    ops->synchronize_state = kvm_cpu_synchronize_state;
 | 
			
		||||
    ops->synchronize_pre_loadvm = kvm_cpu_synchronize_pre_loadvm;
 | 
			
		||||
 | 
			
		||||
#ifdef TARGET_KVM_HAVE_GUEST_DEBUG
 | 
			
		||||
    ops->update_guest_debug = kvm_update_guest_debug_ops;
 | 
			
		||||
    ops->supports_guest_debug = kvm_supports_guest_debug;
 | 
			
		||||
    ops->insert_breakpoint = kvm_insert_breakpoint;
 | 
			
		||||
    ops->remove_breakpoint = kvm_remove_breakpoint;
 | 
			
		||||
    ops->remove_all_breakpoints = kvm_remove_all_breakpoints;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const TypeInfo kvm_accel_ops_type = {
 | 
			
		||||
    .name = ACCEL_OPS_NAME("kvm"),
 | 
			
		||||
 | 
			
		||||
    .parent = TYPE_ACCEL_OPS,
 | 
			
		||||
    .class_init = kvm_accel_ops_class_init,
 | 
			
		||||
    .abstract = true,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void kvm_accel_ops_register_types(void)
 | 
			
		||||
{
 | 
			
		||||
    type_register_static(&kvm_accel_ops_type);
 | 
			
		||||
}
 | 
			
		||||
type_init(kvm_accel_ops_register_types);
 | 
			
		||||
							
								
								
									
										4255
									
								
								accel/kvm/kvm-all.c
									
									
									
									
									
								
							
							
						
						
									
										4255
									
								
								accel/kvm/kvm-all.c
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,26 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Accelerator CPUS Interface
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright 2020 SUSE LLC
 | 
			
		||||
 *
 | 
			
		||||
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
			
		||||
 * See the COPYING file in the top-level directory.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef KVM_CPUS_H
 | 
			
		||||
#define KVM_CPUS_H
 | 
			
		||||
 | 
			
		||||
#include "sysemu/cpus.h"
 | 
			
		||||
 | 
			
		||||
int kvm_init_vcpu(CPUState *cpu, Error **errp);
 | 
			
		||||
int kvm_cpu_exec(CPUState *cpu);
 | 
			
		||||
void kvm_destroy_vcpu(CPUState *cpu);
 | 
			
		||||
void kvm_cpu_synchronize_post_reset(CPUState *cpu);
 | 
			
		||||
void kvm_cpu_synchronize_post_init(CPUState *cpu);
 | 
			
		||||
void kvm_cpu_synchronize_pre_loadvm(CPUState *cpu);
 | 
			
		||||
bool kvm_supports_guest_debug(void);
 | 
			
		||||
int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len);
 | 
			
		||||
int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len);
 | 
			
		||||
void kvm_remove_all_breakpoints(CPUState *cpu);
 | 
			
		||||
 | 
			
		||||
#endif /* KVM_CPUS_H */
 | 
			
		||||
@@ -1,7 +0,0 @@
 | 
			
		||||
kvm_ss = ss.source_set()
 | 
			
		||||
kvm_ss.add(files(
 | 
			
		||||
  'kvm-all.c',
 | 
			
		||||
  'kvm-accel-ops.c',
 | 
			
		||||
))
 | 
			
		||||
 | 
			
		||||
specific_ss.add_all(when: 'CONFIG_KVM', if_true: kvm_ss)
 | 
			
		||||
@@ -1,35 +0,0 @@
 | 
			
		||||
# See docs/devel/tracing.rst for syntax documentation.
 | 
			
		||||
 | 
			
		||||
# kvm-all.c
 | 
			
		||||
kvm_ioctl(int type, void *arg) "type 0x%x, arg %p"
 | 
			
		||||
kvm_vm_ioctl(int type, void *arg) "type 0x%x, arg %p"
 | 
			
		||||
kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type 0x%x, arg %p"
 | 
			
		||||
kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d"
 | 
			
		||||
kvm_device_ioctl(int fd, int type, void *arg) "dev fd %d, type 0x%x, arg %p"
 | 
			
		||||
kvm_failed_reg_get(uint64_t id, const char *msg) "Warning: Unable to retrieve ONEREG %" PRIu64 " from KVM: %s"
 | 
			
		||||
kvm_failed_reg_set(uint64_t id, const char *msg) "Warning: Unable to set ONEREG %" PRIu64 " to KVM: %s"
 | 
			
		||||
kvm_init_vcpu(int cpu_index, unsigned long arch_cpu_id) "index: %d id: %lu"
 | 
			
		||||
kvm_irqchip_commit_routes(void) ""
 | 
			
		||||
kvm_irqchip_add_msi_route(char *name, int vector, int virq) "dev %s vector %d virq %d"
 | 
			
		||||
kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=%d"
 | 
			
		||||
kvm_irqchip_release_virq(int virq) "virq %d"
 | 
			
		||||
kvm_set_ioeventfd_mmio(int fd, uint64_t addr, uint32_t val, bool assign, uint32_t size, bool datamatch) "fd: %d @0x%" PRIx64 " val=0x%x assign: %d size: %d match: %d"
 | 
			
		||||
kvm_set_ioeventfd_pio(int fd, uint16_t addr, uint32_t val, bool assign, uint32_t size, bool datamatch) "fd: %d @0x%x val=0x%x assign: %d size: %d match: %d"
 | 
			
		||||
kvm_set_user_memory(uint16_t as, uint16_t slot, uint32_t flags, uint64_t guest_phys_addr, uint64_t memory_size, uint64_t userspace_addr, uint32_t fd, uint64_t fd_offset, int ret) "AddrSpace#%d Slot#%d flags=0x%x gpa=0x%"PRIx64 " size=0x%"PRIx64 " ua=0x%"PRIx64 " guest_memfd=%d" " guest_memfd_offset=0x%" PRIx64 " ret=%d"
 | 
			
		||||
kvm_clear_dirty_log(uint32_t slot, uint64_t start, uint32_t size) "slot#%"PRId32" start 0x%"PRIx64" size 0x%"PRIx32
 | 
			
		||||
kvm_resample_fd_notify(int gsi) "gsi %d"
 | 
			
		||||
kvm_dirty_ring_full(int id) "vcpu %d"
 | 
			
		||||
kvm_dirty_ring_reap_vcpu(int id) "vcpu %d"
 | 
			
		||||
kvm_dirty_ring_page(int vcpu, uint32_t slot, uint64_t offset) "vcpu %d fetch %"PRIu32" offset 0x%"PRIx64
 | 
			
		||||
kvm_dirty_ring_reaper(const char *s) "%s"
 | 
			
		||||
kvm_dirty_ring_reap(uint64_t count, int64_t t) "reaped %"PRIu64" pages (took %"PRIi64" us)"
 | 
			
		||||
kvm_dirty_ring_reaper_kick(const char *reason) "%s"
 | 
			
		||||
kvm_dirty_ring_flush(int finished) "%d"
 | 
			
		||||
kvm_destroy_vcpu(void) ""
 | 
			
		||||
kvm_failed_get_vcpu_mmap_size(void) ""
 | 
			
		||||
kvm_cpu_exec(void) ""
 | 
			
		||||
kvm_interrupt_exit_request(void) ""
 | 
			
		||||
kvm_io_window_exit(void) ""
 | 
			
		||||
kvm_run_exit_system_event(int cpu_index, uint32_t event_type) "cpu_index %d, system_even_type %"PRIu32
 | 
			
		||||
kvm_convert_memory(uint64_t start, uint64_t size, const char *msg) "start 0x%" PRIx64 " size 0x%" PRIx64 " %s"
 | 
			
		||||
kvm_memory_fault(uint64_t start, uint64_t size, uint64_t flags) "start 0x%" PRIx64 " size 0x%" PRIx64 " flags 0x%" PRIx64
 | 
			
		||||
@@ -1 +0,0 @@
 | 
			
		||||
#include "trace/trace-accel_kvm.h"
 | 
			
		||||
@@ -1,15 +0,0 @@
 | 
			
		||||
specific_ss.add(files('accel-target.c'))
 | 
			
		||||
system_ss.add(files('accel-system.c', 'accel-blocker.c'))
 | 
			
		||||
user_ss.add(files('accel-user.c'))
 | 
			
		||||
 | 
			
		||||
subdir('tcg')
 | 
			
		||||
if have_system
 | 
			
		||||
  subdir('hvf')
 | 
			
		||||
  subdir('qtest')
 | 
			
		||||
  subdir('kvm')
 | 
			
		||||
  subdir('xen')
 | 
			
		||||
  subdir('stubs')
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
# qtest
 | 
			
		||||
system_ss.add(files('dummy-cpus.c'))
 | 
			
		||||
@@ -1 +0,0 @@
 | 
			
		||||
qtest_module_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: files('qtest.c'))
 | 
			
		||||
@@ -1,85 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * QTest accelerator code
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright IBM, Corp. 2011
 | 
			
		||||
 *
 | 
			
		||||
 * Authors:
 | 
			
		||||
 *  Anthony Liguori   <aliguori@us.ibm.com>
 | 
			
		||||
 *
 | 
			
		||||
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
			
		||||
 * See the COPYING file in the top-level directory.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "qemu/rcu.h"
 | 
			
		||||
#include "qapi/error.h"
 | 
			
		||||
#include "qemu/module.h"
 | 
			
		||||
#include "qemu/option.h"
 | 
			
		||||
#include "qemu/config-file.h"
 | 
			
		||||
#include "qemu/accel.h"
 | 
			
		||||
#include "sysemu/qtest.h"
 | 
			
		||||
#include "sysemu/cpus.h"
 | 
			
		||||
#include "qemu/guest-random.h"
 | 
			
		||||
#include "qemu/main-loop.h"
 | 
			
		||||
#include "hw/core/cpu.h"
 | 
			
		||||
 | 
			
		||||
static int64_t qtest_clock_counter;
 | 
			
		||||
 | 
			
		||||
static int64_t qtest_get_virtual_clock(void)
 | 
			
		||||
{
 | 
			
		||||
    return qatomic_read_i64(&qtest_clock_counter);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void qtest_set_virtual_clock(int64_t count)
 | 
			
		||||
{
 | 
			
		||||
    qatomic_set_i64(&qtest_clock_counter, count);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int qtest_init_accel(MachineState *ms)
 | 
			
		||||
{
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void qtest_accel_class_init(ObjectClass *oc, void *data)
 | 
			
		||||
{
 | 
			
		||||
    AccelClass *ac = ACCEL_CLASS(oc);
 | 
			
		||||
    ac->name = "QTest";
 | 
			
		||||
    ac->init_machine = qtest_init_accel;
 | 
			
		||||
    ac->allowed = &qtest_allowed;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define TYPE_QTEST_ACCEL ACCEL_CLASS_NAME("qtest")
 | 
			
		||||
 | 
			
		||||
static const TypeInfo qtest_accel_type = {
 | 
			
		||||
    .name = TYPE_QTEST_ACCEL,
 | 
			
		||||
    .parent = TYPE_ACCEL,
 | 
			
		||||
    .class_init = qtest_accel_class_init,
 | 
			
		||||
};
 | 
			
		||||
module_obj(TYPE_QTEST_ACCEL);
 | 
			
		||||
 | 
			
		||||
static void qtest_accel_ops_class_init(ObjectClass *oc, void *data)
 | 
			
		||||
{
 | 
			
		||||
    AccelOpsClass *ops = ACCEL_OPS_CLASS(oc);
 | 
			
		||||
 | 
			
		||||
    ops->create_vcpu_thread = dummy_start_vcpu_thread;
 | 
			
		||||
    ops->get_virtual_clock = qtest_get_virtual_clock;
 | 
			
		||||
    ops->set_virtual_clock = qtest_set_virtual_clock;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const TypeInfo qtest_accel_ops_type = {
 | 
			
		||||
    .name = ACCEL_OPS_NAME("qtest"),
 | 
			
		||||
 | 
			
		||||
    .parent = TYPE_ACCEL_OPS,
 | 
			
		||||
    .class_init = qtest_accel_ops_class_init,
 | 
			
		||||
    .abstract = true,
 | 
			
		||||
};
 | 
			
		||||
module_obj(ACCEL_OPS_NAME("qtest"));
 | 
			
		||||
 | 
			
		||||
static void qtest_type_init(void)
 | 
			
		||||
{
 | 
			
		||||
    type_register_static(&qtest_accel_type);
 | 
			
		||||
    type_register_static(&qtest_accel_ops_type);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type_init(qtest_type_init);
 | 
			
		||||
@@ -1,136 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * QEMU KVM stub
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright Red Hat, Inc. 2010
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Paolo Bonzini     <pbonzini@redhat.com>
 | 
			
		||||
 *
 | 
			
		||||
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
			
		||||
 * See the COPYING file in the top-level directory.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "sysemu/kvm.h"
 | 
			
		||||
#include "hw/pci/msi.h"
 | 
			
		||||
 | 
			
		||||
KVMState *kvm_state;
 | 
			
		||||
bool kvm_kernel_irqchip;
 | 
			
		||||
bool kvm_async_interrupts_allowed;
 | 
			
		||||
bool kvm_resamplefds_allowed;
 | 
			
		||||
bool kvm_msi_via_irqfd_allowed;
 | 
			
		||||
bool kvm_gsi_routing_allowed;
 | 
			
		||||
bool kvm_gsi_direct_mapping;
 | 
			
		||||
bool kvm_allowed;
 | 
			
		||||
bool kvm_readonly_mem_allowed;
 | 
			
		||||
bool kvm_msi_use_devid;
 | 
			
		||||
 | 
			
		||||
void kvm_flush_coalesced_mmio_buffer(void)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void kvm_cpu_synchronize_state(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool kvm_has_sync_mmu(void)
 | 
			
		||||
{
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr)
 | 
			
		||||
{
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int kvm_on_sigbus(int code, void *addr)
 | 
			
		||||
{
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int kvm_irqchip_add_msi_route(KVMRouteChange *c, int vector, PCIDevice *dev)
 | 
			
		||||
{
 | 
			
		||||
    return -ENOSYS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void kvm_init_irq_routing(KVMState *s)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void kvm_irqchip_release_virq(KVMState *s, int virq)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg,
 | 
			
		||||
                                 PCIDevice *dev)
 | 
			
		||||
{
 | 
			
		||||
    return -ENOSYS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void kvm_irqchip_commit_routes(KVMState *s)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void kvm_irqchip_add_change_notifier(Notifier *n)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void kvm_irqchip_remove_change_notifier(Notifier *n)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void kvm_irqchip_change_notify(void)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
 | 
			
		||||
                                       EventNotifier *rn, int virq)
 | 
			
		||||
{
 | 
			
		||||
    return -ENOSYS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int kvm_irqchip_remove_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
 | 
			
		||||
                                          int virq)
 | 
			
		||||
{
 | 
			
		||||
    return -ENOSYS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
unsigned int kvm_get_max_memslots(void)
 | 
			
		||||
{
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
unsigned int kvm_get_free_memslots(void)
 | 
			
		||||
{
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void kvm_init_cpu_signals(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    abort();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool kvm_arm_supports_user_irq(void)
 | 
			
		||||
{
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool kvm_dirty_ring_enabled(void)
 | 
			
		||||
{
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t kvm_dirty_ring_size(void)
 | 
			
		||||
{
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool kvm_hwpoisoned_mem(void)
 | 
			
		||||
{
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int kvm_create_guest_memfd(uint64_t size, uint64_t flags, Error **errp)
 | 
			
		||||
{
 | 
			
		||||
    return -ENOSYS;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +0,0 @@
 | 
			
		||||
system_stubs_ss = ss.source_set()
 | 
			
		||||
system_stubs_ss.add(when: 'CONFIG_XEN', if_false: files('xen-stub.c'))
 | 
			
		||||
system_stubs_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c'))
 | 
			
		||||
system_stubs_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c'))
 | 
			
		||||
 | 
			
		||||
specific_ss.add_all(when: ['CONFIG_SYSTEM_ONLY'], if_true: system_stubs_ss)
 | 
			
		||||
@@ -1,43 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * QEMU TCG accelerator stub
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright Red Hat, Inc. 2013
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Paolo Bonzini     <pbonzini@redhat.com>
 | 
			
		||||
 *
 | 
			
		||||
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
			
		||||
 * See the COPYING file in the top-level directory.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "exec/tb-flush.h"
 | 
			
		||||
#include "exec/exec-all.h"
 | 
			
		||||
 | 
			
		||||
void tb_flush(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int probe_access_flags(CPUArchState *env, vaddr addr, int size,
 | 
			
		||||
                       MMUAccessType access_type, int mmu_idx,
 | 
			
		||||
                       bool nonfault, void **phost, uintptr_t retaddr)
 | 
			
		||||
{
 | 
			
		||||
     g_assert_not_reached();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void *probe_access(CPUArchState *env, vaddr addr, int size,
 | 
			
		||||
                   MMUAccessType access_type, int mmu_idx, uintptr_t retaddr)
 | 
			
		||||
{
 | 
			
		||||
     /* Handled by hardware accelerator. */
 | 
			
		||||
     g_assert_not_reached();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
G_NORETURN void cpu_loop_exit(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    g_assert_not_reached();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc)
 | 
			
		||||
{
 | 
			
		||||
    g_assert_not_reached();
 | 
			
		||||
}
 | 
			
		||||
@@ -1,16 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (C) 2014       Citrix Systems UK Ltd.
 | 
			
		||||
 *
 | 
			
		||||
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
			
		||||
 * See the COPYING file in the top-level directory.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "sysemu/xen.h"
 | 
			
		||||
#include "qapi/qapi-commands-migration.h"
 | 
			
		||||
 | 
			
		||||
bool xen_allowed;
 | 
			
		||||
 | 
			
		||||
void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
@@ -1,115 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Common Atomic Helper Functions
 | 
			
		||||
 *
 | 
			
		||||
 * This file should be included before the various instantiations of
 | 
			
		||||
 * the atomic_template.h helpers.
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 2019 Linaro
 | 
			
		||||
 * Written by Alex Bennée <alex.bennee@linaro.org>
 | 
			
		||||
 *
 | 
			
		||||
 * SPDX-License-Identifier: GPL-2.0-or-later
 | 
			
		||||
 *
 | 
			
		||||
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
			
		||||
 * See the COPYING file in the top-level directory.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static void atomic_trace_rmw_post(CPUArchState *env, uint64_t addr,
 | 
			
		||||
                                  MemOpIdx oi)
 | 
			
		||||
{
 | 
			
		||||
    qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, oi, QEMU_PLUGIN_MEM_RW);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Atomic helpers callable from TCG.
 | 
			
		||||
 * These have a common interface and all defer to cpu_atomic_*
 | 
			
		||||
 * using the host return address from GETPC().
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define CMPXCHG_HELPER(OP, TYPE) \
 | 
			
		||||
    TYPE HELPER(atomic_##OP)(CPUArchState *env, uint64_t addr,      \
 | 
			
		||||
                             TYPE oldv, TYPE newv, uint32_t oi)     \
 | 
			
		||||
    { return cpu_atomic_##OP##_mmu(env, addr, oldv, newv, oi, GETPC()); }
 | 
			
		||||
 | 
			
		||||
CMPXCHG_HELPER(cmpxchgb, uint32_t)
 | 
			
		||||
CMPXCHG_HELPER(cmpxchgw_be, uint32_t)
 | 
			
		||||
CMPXCHG_HELPER(cmpxchgw_le, uint32_t)
 | 
			
		||||
CMPXCHG_HELPER(cmpxchgl_be, uint32_t)
 | 
			
		||||
CMPXCHG_HELPER(cmpxchgl_le, uint32_t)
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_ATOMIC64
 | 
			
		||||
CMPXCHG_HELPER(cmpxchgq_be, uint64_t)
 | 
			
		||||
CMPXCHG_HELPER(cmpxchgq_le, uint64_t)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if HAVE_CMPXCHG128
 | 
			
		||||
CMPXCHG_HELPER(cmpxchgo_be, Int128)
 | 
			
		||||
CMPXCHG_HELPER(cmpxchgo_le, Int128)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#undef CMPXCHG_HELPER
 | 
			
		||||
 | 
			
		||||
Int128 HELPER(nonatomic_cmpxchgo)(CPUArchState *env, uint64_t addr,
 | 
			
		||||
                                  Int128 cmpv, Int128 newv, uint32_t oi)
 | 
			
		||||
{
 | 
			
		||||
#if TCG_TARGET_REG_BITS == 32
 | 
			
		||||
    uintptr_t ra = GETPC();
 | 
			
		||||
    Int128 oldv;
 | 
			
		||||
 | 
			
		||||
    oldv = cpu_ld16_mmu(env, addr, oi, ra);
 | 
			
		||||
    if (int128_eq(oldv, cmpv)) {
 | 
			
		||||
        cpu_st16_mmu(env, addr, newv, oi, ra);
 | 
			
		||||
    } else {
 | 
			
		||||
        /* Even with comparison failure, still need a write cycle. */
 | 
			
		||||
        probe_write(env, addr, 16, get_mmuidx(oi), ra);
 | 
			
		||||
    }
 | 
			
		||||
    return oldv;
 | 
			
		||||
#else
 | 
			
		||||
    g_assert_not_reached();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define ATOMIC_HELPER(OP, TYPE) \
 | 
			
		||||
    TYPE HELPER(glue(atomic_,OP))(CPUArchState *env, uint64_t addr,  \
 | 
			
		||||
                                  TYPE val, uint32_t oi)                 \
 | 
			
		||||
    { return glue(glue(cpu_atomic_,OP),_mmu)(env, addr, val, oi, GETPC()); }
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_ATOMIC64
 | 
			
		||||
#define GEN_ATOMIC_HELPERS(OP)              \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,b), uint32_t)     \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,w_be), uint32_t)  \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,w_le), uint32_t)  \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,l_be), uint32_t)  \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,l_le), uint32_t)  \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,q_be), uint64_t)  \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,q_le), uint64_t)
 | 
			
		||||
#else
 | 
			
		||||
#define GEN_ATOMIC_HELPERS(OP)              \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,b), uint32_t)     \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,w_be), uint32_t)  \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,w_le), uint32_t)  \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,l_be), uint32_t)  \
 | 
			
		||||
    ATOMIC_HELPER(glue(OP,l_le), uint32_t)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
GEN_ATOMIC_HELPERS(fetch_add)
 | 
			
		||||
GEN_ATOMIC_HELPERS(fetch_and)
 | 
			
		||||
GEN_ATOMIC_HELPERS(fetch_or)
 | 
			
		||||
GEN_ATOMIC_HELPERS(fetch_xor)
 | 
			
		||||
GEN_ATOMIC_HELPERS(fetch_smin)
 | 
			
		||||
GEN_ATOMIC_HELPERS(fetch_umin)
 | 
			
		||||
GEN_ATOMIC_HELPERS(fetch_smax)
 | 
			
		||||
GEN_ATOMIC_HELPERS(fetch_umax)
 | 
			
		||||
 | 
			
		||||
GEN_ATOMIC_HELPERS(add_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPERS(and_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPERS(or_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPERS(xor_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPERS(smin_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPERS(umin_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPERS(smax_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPERS(umax_fetch)
 | 
			
		||||
 | 
			
		||||
GEN_ATOMIC_HELPERS(xchg)
 | 
			
		||||
 | 
			
		||||
#undef ATOMIC_HELPER
 | 
			
		||||
#undef GEN_ATOMIC_HELPERS
 | 
			
		||||
@@ -1,283 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Atomic helper templates
 | 
			
		||||
 * Included from tcg-runtime.c and cputlb.c.
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 2016 Red Hat, Inc
 | 
			
		||||
 *
 | 
			
		||||
 * This library is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU Lesser General Public
 | 
			
		||||
 * License as published by the Free Software Foundation; either
 | 
			
		||||
 * version 2.1 of the License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This library is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * Lesser General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Lesser General Public
 | 
			
		||||
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/plugin.h"
 | 
			
		||||
 | 
			
		||||
#if DATA_SIZE == 16
 | 
			
		||||
# define SUFFIX     o
 | 
			
		||||
# define DATA_TYPE  Int128
 | 
			
		||||
# define BSWAP      bswap128
 | 
			
		||||
# define SHIFT      4
 | 
			
		||||
#elif DATA_SIZE == 8
 | 
			
		||||
# define SUFFIX     q
 | 
			
		||||
# define DATA_TYPE  aligned_uint64_t
 | 
			
		||||
# define SDATA_TYPE aligned_int64_t
 | 
			
		||||
# define BSWAP      bswap64
 | 
			
		||||
# define SHIFT      3
 | 
			
		||||
#elif DATA_SIZE == 4
 | 
			
		||||
# define SUFFIX     l
 | 
			
		||||
# define DATA_TYPE  uint32_t
 | 
			
		||||
# define SDATA_TYPE int32_t
 | 
			
		||||
# define BSWAP      bswap32
 | 
			
		||||
# define SHIFT      2
 | 
			
		||||
#elif DATA_SIZE == 2
 | 
			
		||||
# define SUFFIX     w
 | 
			
		||||
# define DATA_TYPE  uint16_t
 | 
			
		||||
# define SDATA_TYPE int16_t
 | 
			
		||||
# define BSWAP      bswap16
 | 
			
		||||
# define SHIFT      1
 | 
			
		||||
#elif DATA_SIZE == 1
 | 
			
		||||
# define SUFFIX     b
 | 
			
		||||
# define DATA_TYPE  uint8_t
 | 
			
		||||
# define SDATA_TYPE int8_t
 | 
			
		||||
# define BSWAP
 | 
			
		||||
# define SHIFT      0
 | 
			
		||||
#else
 | 
			
		||||
# error unsupported data size
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if DATA_SIZE >= 4
 | 
			
		||||
# define ABI_TYPE  DATA_TYPE
 | 
			
		||||
#else
 | 
			
		||||
# define ABI_TYPE  uint32_t
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Define host-endian atomic operations.  Note that END is used within
 | 
			
		||||
   the ATOMIC_NAME macro, and redefined below.  */
 | 
			
		||||
#if DATA_SIZE == 1
 | 
			
		||||
# define END
 | 
			
		||||
#elif HOST_BIG_ENDIAN
 | 
			
		||||
# define END  _be
 | 
			
		||||
#else
 | 
			
		||||
# define END  _le
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, abi_ptr addr,
 | 
			
		||||
                              ABI_TYPE cmpv, ABI_TYPE newv,
 | 
			
		||||
                              MemOpIdx oi, uintptr_t retaddr)
 | 
			
		||||
{
 | 
			
		||||
    DATA_TYPE *haddr = atomic_mmu_lookup(env_cpu(env), addr, oi,
 | 
			
		||||
                                         DATA_SIZE, retaddr);
 | 
			
		||||
    DATA_TYPE ret;
 | 
			
		||||
 | 
			
		||||
#if DATA_SIZE == 16
 | 
			
		||||
    ret = atomic16_cmpxchg(haddr, cmpv, newv);
 | 
			
		||||
#else
 | 
			
		||||
    ret = qatomic_cmpxchg__nocheck(haddr, cmpv, newv);
 | 
			
		||||
#endif
 | 
			
		||||
    ATOMIC_MMU_CLEANUP;
 | 
			
		||||
    atomic_trace_rmw_post(env, addr, oi);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if DATA_SIZE < 16
 | 
			
		||||
ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, abi_ptr addr, ABI_TYPE val,
 | 
			
		||||
                           MemOpIdx oi, uintptr_t retaddr)
 | 
			
		||||
{
 | 
			
		||||
    DATA_TYPE *haddr = atomic_mmu_lookup(env_cpu(env), addr, oi,
 | 
			
		||||
                                         DATA_SIZE, retaddr);
 | 
			
		||||
    DATA_TYPE ret;
 | 
			
		||||
 | 
			
		||||
    ret = qatomic_xchg__nocheck(haddr, val);
 | 
			
		||||
    ATOMIC_MMU_CLEANUP;
 | 
			
		||||
    atomic_trace_rmw_post(env, addr, oi);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define GEN_ATOMIC_HELPER(X)                                        \
 | 
			
		||||
ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr,            \
 | 
			
		||||
                        ABI_TYPE val, MemOpIdx oi, uintptr_t retaddr) \
 | 
			
		||||
{                                                                   \
 | 
			
		||||
    DATA_TYPE *haddr, ret;                                          \
 | 
			
		||||
    haddr = atomic_mmu_lookup(env_cpu(env), addr, oi, DATA_SIZE, retaddr);   \
 | 
			
		||||
    ret = qatomic_##X(haddr, val);                                  \
 | 
			
		||||
    ATOMIC_MMU_CLEANUP;                                             \
 | 
			
		||||
    atomic_trace_rmw_post(env, addr, oi);                           \
 | 
			
		||||
    return ret;                                                     \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GEN_ATOMIC_HELPER(fetch_add)
 | 
			
		||||
GEN_ATOMIC_HELPER(fetch_and)
 | 
			
		||||
GEN_ATOMIC_HELPER(fetch_or)
 | 
			
		||||
GEN_ATOMIC_HELPER(fetch_xor)
 | 
			
		||||
GEN_ATOMIC_HELPER(add_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPER(and_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPER(or_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPER(xor_fetch)
 | 
			
		||||
 | 
			
		||||
#undef GEN_ATOMIC_HELPER
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * These helpers are, as a whole, full barriers.  Within the helper,
 | 
			
		||||
 * the leading barrier is explicit and the trailing barrier is within
 | 
			
		||||
 * cmpxchg primitive.
 | 
			
		||||
 *
 | 
			
		||||
 * Trace this load + RMW loop as a single RMW op. This way, regardless
 | 
			
		||||
 * of CF_PARALLEL's value, we'll trace just a read and a write.
 | 
			
		||||
 */
 | 
			
		||||
#define GEN_ATOMIC_HELPER_FN(X, FN, XDATA_TYPE, RET)                \
 | 
			
		||||
ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr,            \
 | 
			
		||||
                        ABI_TYPE xval, MemOpIdx oi, uintptr_t retaddr) \
 | 
			
		||||
{                                                                   \
 | 
			
		||||
    XDATA_TYPE *haddr, cmp, old, new, val = xval;                   \
 | 
			
		||||
    haddr = atomic_mmu_lookup(env_cpu(env), addr, oi, DATA_SIZE, retaddr);   \
 | 
			
		||||
    smp_mb();                                                       \
 | 
			
		||||
    cmp = qatomic_read__nocheck(haddr);                             \
 | 
			
		||||
    do {                                                            \
 | 
			
		||||
        old = cmp; new = FN(old, val);                              \
 | 
			
		||||
        cmp = qatomic_cmpxchg__nocheck(haddr, old, new);            \
 | 
			
		||||
    } while (cmp != old);                                           \
 | 
			
		||||
    ATOMIC_MMU_CLEANUP;                                             \
 | 
			
		||||
    atomic_trace_rmw_post(env, addr, oi);                           \
 | 
			
		||||
    return RET;                                                     \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(fetch_smin, MIN, SDATA_TYPE, old)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(fetch_umin, MIN,  DATA_TYPE, old)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(fetch_smax, MAX, SDATA_TYPE, old)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(fetch_umax, MAX,  DATA_TYPE, old)
 | 
			
		||||
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(smin_fetch, MIN, SDATA_TYPE, new)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(umin_fetch, MIN,  DATA_TYPE, new)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(smax_fetch, MAX, SDATA_TYPE, new)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(umax_fetch, MAX,  DATA_TYPE, new)
 | 
			
		||||
 | 
			
		||||
#undef GEN_ATOMIC_HELPER_FN
 | 
			
		||||
#endif /* DATA SIZE < 16 */
 | 
			
		||||
 | 
			
		||||
#undef END
 | 
			
		||||
 | 
			
		||||
#if DATA_SIZE > 1
 | 
			
		||||
 | 
			
		||||
/* Define reverse-host-endian atomic operations.  Note that END is used
 | 
			
		||||
   within the ATOMIC_NAME macro.  */
 | 
			
		||||
#if HOST_BIG_ENDIAN
 | 
			
		||||
# define END  _le
 | 
			
		||||
#else
 | 
			
		||||
# define END  _be
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, abi_ptr addr,
 | 
			
		||||
                              ABI_TYPE cmpv, ABI_TYPE newv,
 | 
			
		||||
                              MemOpIdx oi, uintptr_t retaddr)
 | 
			
		||||
{
 | 
			
		||||
    DATA_TYPE *haddr = atomic_mmu_lookup(env_cpu(env), addr, oi,
 | 
			
		||||
                                         DATA_SIZE, retaddr);
 | 
			
		||||
    DATA_TYPE ret;
 | 
			
		||||
 | 
			
		||||
#if DATA_SIZE == 16
 | 
			
		||||
    ret = atomic16_cmpxchg(haddr, BSWAP(cmpv), BSWAP(newv));
 | 
			
		||||
#else
 | 
			
		||||
    ret = qatomic_cmpxchg__nocheck(haddr, BSWAP(cmpv), BSWAP(newv));
 | 
			
		||||
#endif
 | 
			
		||||
    ATOMIC_MMU_CLEANUP;
 | 
			
		||||
    atomic_trace_rmw_post(env, addr, oi);
 | 
			
		||||
    return BSWAP(ret);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if DATA_SIZE < 16
 | 
			
		||||
ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, abi_ptr addr, ABI_TYPE val,
 | 
			
		||||
                           MemOpIdx oi, uintptr_t retaddr)
 | 
			
		||||
{
 | 
			
		||||
    DATA_TYPE *haddr = atomic_mmu_lookup(env_cpu(env), addr, oi,
 | 
			
		||||
                                         DATA_SIZE, retaddr);
 | 
			
		||||
    ABI_TYPE ret;
 | 
			
		||||
 | 
			
		||||
    ret = qatomic_xchg__nocheck(haddr, BSWAP(val));
 | 
			
		||||
    ATOMIC_MMU_CLEANUP;
 | 
			
		||||
    atomic_trace_rmw_post(env, addr, oi);
 | 
			
		||||
    return BSWAP(ret);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define GEN_ATOMIC_HELPER(X)                                        \
 | 
			
		||||
ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr,            \
 | 
			
		||||
                        ABI_TYPE val, MemOpIdx oi, uintptr_t retaddr) \
 | 
			
		||||
{                                                                   \
 | 
			
		||||
    DATA_TYPE *haddr, ret;                                          \
 | 
			
		||||
    haddr = atomic_mmu_lookup(env_cpu(env), addr, oi, DATA_SIZE, retaddr);   \
 | 
			
		||||
    ret = qatomic_##X(haddr, BSWAP(val));                           \
 | 
			
		||||
    ATOMIC_MMU_CLEANUP;                                             \
 | 
			
		||||
    atomic_trace_rmw_post(env, addr, oi);                           \
 | 
			
		||||
    return BSWAP(ret);                                              \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GEN_ATOMIC_HELPER(fetch_and)
 | 
			
		||||
GEN_ATOMIC_HELPER(fetch_or)
 | 
			
		||||
GEN_ATOMIC_HELPER(fetch_xor)
 | 
			
		||||
GEN_ATOMIC_HELPER(and_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPER(or_fetch)
 | 
			
		||||
GEN_ATOMIC_HELPER(xor_fetch)
 | 
			
		||||
 | 
			
		||||
#undef GEN_ATOMIC_HELPER
 | 
			
		||||
 | 
			
		||||
/* These helpers are, as a whole, full barriers.  Within the helper,
 | 
			
		||||
 * the leading barrier is explicit and the trailing barrier is within
 | 
			
		||||
 * cmpxchg primitive.
 | 
			
		||||
 *
 | 
			
		||||
 * Trace this load + RMW loop as a single RMW op. This way, regardless
 | 
			
		||||
 * of CF_PARALLEL's value, we'll trace just a read and a write.
 | 
			
		||||
 */
 | 
			
		||||
#define GEN_ATOMIC_HELPER_FN(X, FN, XDATA_TYPE, RET)                \
 | 
			
		||||
ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr,            \
 | 
			
		||||
                        ABI_TYPE xval, MemOpIdx oi, uintptr_t retaddr) \
 | 
			
		||||
{                                                                   \
 | 
			
		||||
    XDATA_TYPE *haddr, ldo, ldn, old, new, val = xval;              \
 | 
			
		||||
    haddr = atomic_mmu_lookup(env_cpu(env), addr, oi, DATA_SIZE, retaddr);   \
 | 
			
		||||
    smp_mb();                                                       \
 | 
			
		||||
    ldn = qatomic_read__nocheck(haddr);                             \
 | 
			
		||||
    do {                                                            \
 | 
			
		||||
        ldo = ldn; old = BSWAP(ldo); new = FN(old, val);            \
 | 
			
		||||
        ldn = qatomic_cmpxchg__nocheck(haddr, ldo, BSWAP(new));     \
 | 
			
		||||
    } while (ldo != ldn);                                           \
 | 
			
		||||
    ATOMIC_MMU_CLEANUP;                                             \
 | 
			
		||||
    atomic_trace_rmw_post(env, addr, oi);                           \
 | 
			
		||||
    return RET;                                                     \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(fetch_smin, MIN, SDATA_TYPE, old)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(fetch_umin, MIN,  DATA_TYPE, old)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(fetch_smax, MAX, SDATA_TYPE, old)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(fetch_umax, MAX,  DATA_TYPE, old)
 | 
			
		||||
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(smin_fetch, MIN, SDATA_TYPE, new)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(umin_fetch, MIN,  DATA_TYPE, new)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(smax_fetch, MAX, SDATA_TYPE, new)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(umax_fetch, MAX,  DATA_TYPE, new)
 | 
			
		||||
 | 
			
		||||
/* Note that for addition, we need to use a separate cmpxchg loop instead
 | 
			
		||||
   of bswaps for the reverse-host-endian helpers.  */
 | 
			
		||||
#define ADD(X, Y)   (X + Y)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(fetch_add, ADD, DATA_TYPE, old)
 | 
			
		||||
GEN_ATOMIC_HELPER_FN(add_fetch, ADD, DATA_TYPE, new)
 | 
			
		||||
#undef ADD
 | 
			
		||||
 | 
			
		||||
#undef GEN_ATOMIC_HELPER_FN
 | 
			
		||||
#endif /* DATA_SIZE < 16 */
 | 
			
		||||
 | 
			
		||||
#undef END
 | 
			
		||||
#endif /* DATA_SIZE > 1 */
 | 
			
		||||
 | 
			
		||||
#undef BSWAP
 | 
			
		||||
#undef ABI_TYPE
 | 
			
		||||
#undef DATA_TYPE
 | 
			
		||||
#undef SDATA_TYPE
 | 
			
		||||
#undef SUFFIX
 | 
			
		||||
#undef DATA_SIZE
 | 
			
		||||
#undef SHIFT
 | 
			
		||||
@@ -1,58 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  emulator main execution loop
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2003-2005 Fabrice Bellard
 | 
			
		||||
 *
 | 
			
		||||
 * This library is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU Lesser General Public
 | 
			
		||||
 * License as published by the Free Software Foundation; either
 | 
			
		||||
 * version 2.1 of the License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This library is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * Lesser General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Lesser General Public
 | 
			
		||||
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "sysemu/cpus.h"
 | 
			
		||||
#include "sysemu/tcg.h"
 | 
			
		||||
#include "qemu/plugin.h"
 | 
			
		||||
#include "internal-common.h"
 | 
			
		||||
 | 
			
		||||
bool tcg_allowed;
 | 
			
		||||
 | 
			
		||||
/* exit the current TB, but without causing any exception to be raised */
 | 
			
		||||
void cpu_loop_exit_noexc(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    cpu->exception_index = -1;
 | 
			
		||||
    cpu_loop_exit(cpu);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cpu_loop_exit(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    /* Undo the setting in cpu_tb_exec.  */
 | 
			
		||||
    cpu->neg.can_do_io = true;
 | 
			
		||||
    /* Undo any setting in generated code.  */
 | 
			
		||||
    qemu_plugin_disable_mem_helpers(cpu);
 | 
			
		||||
    siglongjmp(cpu->jmp_env, 1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc)
 | 
			
		||||
{
 | 
			
		||||
    if (pc) {
 | 
			
		||||
        cpu_restore_state(cpu, pc);
 | 
			
		||||
    }
 | 
			
		||||
    cpu_loop_exit(cpu);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc)
 | 
			
		||||
{
 | 
			
		||||
    /* Prevent looping if already executing in a serial context. */
 | 
			
		||||
    g_assert(!cpu_in_serial_context(cpu));
 | 
			
		||||
    cpu->exception_index = EXCP_ATOMIC;
 | 
			
		||||
    cpu_loop_exit_restore(cpu, pc);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1108
									
								
								accel/tcg/cpu-exec.c
									
									
									
									
									
								
							
							
						
						
									
										1108
									
								
								accel/tcg/cpu-exec.c
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										2942
									
								
								accel/tcg/cputlb.c
									
									
									
									
									
								
							
							
						
						
									
										2942
									
								
								accel/tcg/cputlb.c
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,502 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * QEMU System Emulator
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 2003-2008 Fabrice Bellard
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
 * in the Software without restriction, including without limitation the rights
 | 
			
		||||
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
 * copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
 * furnished to do so, subject to the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * The above copyright notice and this permission notice shall be included in
 | 
			
		||||
 * all copies or substantial portions of the Software.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 | 
			
		||||
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
 * THE SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "qemu/osdep.h"
 | 
			
		||||
#include "qemu/cutils.h"
 | 
			
		||||
#include "migration/vmstate.h"
 | 
			
		||||
#include "qapi/error.h"
 | 
			
		||||
#include "qemu/error-report.h"
 | 
			
		||||
#include "sysemu/cpus.h"
 | 
			
		||||
#include "sysemu/qtest.h"
 | 
			
		||||
#include "qemu/main-loop.h"
 | 
			
		||||
#include "qemu/option.h"
 | 
			
		||||
#include "qemu/seqlock.h"
 | 
			
		||||
#include "sysemu/replay.h"
 | 
			
		||||
#include "sysemu/runstate.h"
 | 
			
		||||
#include "hw/core/cpu.h"
 | 
			
		||||
#include "sysemu/cpu-timers.h"
 | 
			
		||||
#include "sysemu/cpu-throttle.h"
 | 
			
		||||
#include "sysemu/cpu-timers-internal.h"
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * ICOUNT: Instruction Counter
 | 
			
		||||
 *
 | 
			
		||||
 * this module is split off from cpu-timers because the icount part
 | 
			
		||||
 * is TCG-specific, and does not need to be built for other accels.
 | 
			
		||||
 */
 | 
			
		||||
static bool icount_sleep = true;
 | 
			
		||||
/* Arbitrarily pick 1MIPS as the minimum allowable speed.  */
 | 
			
		||||
#define MAX_ICOUNT_SHIFT 10
 | 
			
		||||
 | 
			
		||||
/* Do not count executed instructions */
 | 
			
		||||
ICountMode use_icount = ICOUNT_DISABLED;
 | 
			
		||||
 | 
			
		||||
static void icount_enable_precise(void)
 | 
			
		||||
{
 | 
			
		||||
    /* Fixed conversion of insn to ns via "shift" option */
 | 
			
		||||
    use_icount = ICOUNT_PRECISE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void icount_enable_adaptive(void)
 | 
			
		||||
{
 | 
			
		||||
    /* Runtime adaptive algorithm to compute shift */
 | 
			
		||||
    use_icount = ICOUNT_ADAPTATIVE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The current number of executed instructions is based on what we
 | 
			
		||||
 * originally budgeted minus the current state of the decrementing
 | 
			
		||||
 * icount counters in extra/u16.low.
 | 
			
		||||
 */
 | 
			
		||||
static int64_t icount_get_executed(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    return (cpu->icount_budget -
 | 
			
		||||
            (cpu->neg.icount_decr.u16.low + cpu->icount_extra));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Update the global shared timer_state.qemu_icount to take into
 | 
			
		||||
 * account executed instructions. This is done by the TCG vCPU
 | 
			
		||||
 * thread so the main-loop can see time has moved forward.
 | 
			
		||||
 */
 | 
			
		||||
static void icount_update_locked(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    int64_t executed = icount_get_executed(cpu);
 | 
			
		||||
    cpu->icount_budget -= executed;
 | 
			
		||||
 | 
			
		||||
    qatomic_set_i64(&timers_state.qemu_icount,
 | 
			
		||||
                    timers_state.qemu_icount + executed);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Update the global shared timer_state.qemu_icount to take into
 | 
			
		||||
 * account executed instructions. This is done by the TCG vCPU
 | 
			
		||||
 * thread so the main-loop can see time has moved forward.
 | 
			
		||||
 */
 | 
			
		||||
void icount_update(CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
    seqlock_write_lock(&timers_state.vm_clock_seqlock,
 | 
			
		||||
                       &timers_state.vm_clock_lock);
 | 
			
		||||
    icount_update_locked(cpu);
 | 
			
		||||
    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
 | 
			
		||||
                         &timers_state.vm_clock_lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int64_t icount_get_raw_locked(void)
 | 
			
		||||
{
 | 
			
		||||
    CPUState *cpu = current_cpu;
 | 
			
		||||
 | 
			
		||||
    if (cpu && cpu->running) {
 | 
			
		||||
        if (!cpu->neg.can_do_io) {
 | 
			
		||||
            error_report("Bad icount read");
 | 
			
		||||
            exit(1);
 | 
			
		||||
        }
 | 
			
		||||
        /* Take into account what has run */
 | 
			
		||||
        icount_update_locked(cpu);
 | 
			
		||||
    }
 | 
			
		||||
    /* The read is protected by the seqlock, but needs atomic64 to avoid UB */
 | 
			
		||||
    return qatomic_read_i64(&timers_state.qemu_icount);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int64_t icount_get_locked(void)
 | 
			
		||||
{
 | 
			
		||||
    int64_t icount = icount_get_raw_locked();
 | 
			
		||||
    return qatomic_read_i64(&timers_state.qemu_icount_bias) +
 | 
			
		||||
        icount_to_ns(icount);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int64_t icount_get_raw(void)
 | 
			
		||||
{
 | 
			
		||||
    int64_t icount;
 | 
			
		||||
    unsigned start;
 | 
			
		||||
 | 
			
		||||
    do {
 | 
			
		||||
        start = seqlock_read_begin(&timers_state.vm_clock_seqlock);
 | 
			
		||||
        icount = icount_get_raw_locked();
 | 
			
		||||
    } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, start));
 | 
			
		||||
 | 
			
		||||
    return icount;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Return the virtual CPU time, based on the instruction counter.  */
 | 
			
		||||
int64_t icount_get(void)
 | 
			
		||||
{
 | 
			
		||||
    int64_t icount;
 | 
			
		||||
    unsigned start;
 | 
			
		||||
 | 
			
		||||
    do {
 | 
			
		||||
        start = seqlock_read_begin(&timers_state.vm_clock_seqlock);
 | 
			
		||||
        icount = icount_get_locked();
 | 
			
		||||
    } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, start));
 | 
			
		||||
 | 
			
		||||
    return icount;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int64_t icount_to_ns(int64_t icount)
 | 
			
		||||
{
 | 
			
		||||
    return icount << qatomic_read(&timers_state.icount_time_shift);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Correlation between real and virtual time is always going to be
 | 
			
		||||
 * fairly approximate, so ignore small variation.
 | 
			
		||||
 * When the guest is idle real and virtual time will be aligned in
 | 
			
		||||
 * the IO wait loop.
 | 
			
		||||
 */
 | 
			
		||||
#define ICOUNT_WOBBLE (NANOSECONDS_PER_SECOND / 10)
 | 
			
		||||
 | 
			
		||||
static void icount_adjust(void)
 | 
			
		||||
{
 | 
			
		||||
    int64_t cur_time;
 | 
			
		||||
    int64_t cur_icount;
 | 
			
		||||
    int64_t delta;
 | 
			
		||||
 | 
			
		||||
    /* If the VM is not running, then do nothing.  */
 | 
			
		||||
    if (!runstate_is_running()) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    seqlock_write_lock(&timers_state.vm_clock_seqlock,
 | 
			
		||||
                       &timers_state.vm_clock_lock);
 | 
			
		||||
    cur_time = REPLAY_CLOCK_LOCKED(REPLAY_CLOCK_VIRTUAL_RT,
 | 
			
		||||
                                   cpu_get_clock_locked());
 | 
			
		||||
    cur_icount = icount_get_locked();
 | 
			
		||||
 | 
			
		||||
    delta = cur_icount - cur_time;
 | 
			
		||||
    /* FIXME: This is a very crude algorithm, somewhat prone to oscillation.  */
 | 
			
		||||
    if (delta > 0
 | 
			
		||||
        && timers_state.last_delta + ICOUNT_WOBBLE < delta * 2
 | 
			
		||||
        && timers_state.icount_time_shift > 0) {
 | 
			
		||||
        /* The guest is getting too far ahead.  Slow time down.  */
 | 
			
		||||
        qatomic_set(&timers_state.icount_time_shift,
 | 
			
		||||
                    timers_state.icount_time_shift - 1);
 | 
			
		||||
    }
 | 
			
		||||
    if (delta < 0
 | 
			
		||||
        && timers_state.last_delta - ICOUNT_WOBBLE > delta * 2
 | 
			
		||||
        && timers_state.icount_time_shift < MAX_ICOUNT_SHIFT) {
 | 
			
		||||
        /* The guest is getting too far behind.  Speed time up.  */
 | 
			
		||||
        qatomic_set(&timers_state.icount_time_shift,
 | 
			
		||||
                    timers_state.icount_time_shift + 1);
 | 
			
		||||
    }
 | 
			
		||||
    timers_state.last_delta = delta;
 | 
			
		||||
    qatomic_set_i64(&timers_state.qemu_icount_bias,
 | 
			
		||||
                    cur_icount - (timers_state.qemu_icount
 | 
			
		||||
                                  << timers_state.icount_time_shift));
 | 
			
		||||
    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
 | 
			
		||||
                         &timers_state.vm_clock_lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void icount_adjust_rt(void *opaque)
 | 
			
		||||
{
 | 
			
		||||
    timer_mod(timers_state.icount_rt_timer,
 | 
			
		||||
              qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL_RT) + 1000);
 | 
			
		||||
    icount_adjust();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void icount_adjust_vm(void *opaque)
 | 
			
		||||
{
 | 
			
		||||
    timer_mod(timers_state.icount_vm_timer,
 | 
			
		||||
                   qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
 | 
			
		||||
                   NANOSECONDS_PER_SECOND / 10);
 | 
			
		||||
    icount_adjust();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int64_t icount_round(int64_t count)
 | 
			
		||||
{
 | 
			
		||||
    int shift = qatomic_read(&timers_state.icount_time_shift);
 | 
			
		||||
    return (count + (1 << shift) - 1) >> shift;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void icount_warp_rt(void)
 | 
			
		||||
{
 | 
			
		||||
    unsigned seq;
 | 
			
		||||
    int64_t warp_start;
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * The icount_warp_timer is rescheduled soon after vm_clock_warp_start
 | 
			
		||||
     * changes from -1 to another value, so the race here is okay.
 | 
			
		||||
     */
 | 
			
		||||
    do {
 | 
			
		||||
        seq = seqlock_read_begin(&timers_state.vm_clock_seqlock);
 | 
			
		||||
        warp_start = timers_state.vm_clock_warp_start;
 | 
			
		||||
    } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, seq));
 | 
			
		||||
 | 
			
		||||
    if (warp_start == -1) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    seqlock_write_lock(&timers_state.vm_clock_seqlock,
 | 
			
		||||
                       &timers_state.vm_clock_lock);
 | 
			
		||||
    if (runstate_is_running()) {
 | 
			
		||||
        int64_t clock = REPLAY_CLOCK_LOCKED(REPLAY_CLOCK_VIRTUAL_RT,
 | 
			
		||||
                                            cpu_get_clock_locked());
 | 
			
		||||
        int64_t warp_delta;
 | 
			
		||||
 | 
			
		||||
        warp_delta = clock - timers_state.vm_clock_warp_start;
 | 
			
		||||
        if (icount_enabled() == ICOUNT_ADAPTATIVE) {
 | 
			
		||||
            /*
 | 
			
		||||
             * In adaptive mode, do not let QEMU_CLOCK_VIRTUAL run too far
 | 
			
		||||
             * ahead of real time (it might already be ahead so careful not
 | 
			
		||||
             * to go backwards).
 | 
			
		||||
             */
 | 
			
		||||
            int64_t cur_icount = icount_get_locked();
 | 
			
		||||
            int64_t delta = clock - cur_icount;
 | 
			
		||||
 | 
			
		||||
            if (delta < 0) {
 | 
			
		||||
                delta = 0;
 | 
			
		||||
            }
 | 
			
		||||
            warp_delta = MIN(warp_delta, delta);
 | 
			
		||||
        }
 | 
			
		||||
        qatomic_set_i64(&timers_state.qemu_icount_bias,
 | 
			
		||||
                        timers_state.qemu_icount_bias + warp_delta);
 | 
			
		||||
    }
 | 
			
		||||
    timers_state.vm_clock_warp_start = -1;
 | 
			
		||||
    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
 | 
			
		||||
                       &timers_state.vm_clock_lock);
 | 
			
		||||
 | 
			
		||||
    if (qemu_clock_expired(QEMU_CLOCK_VIRTUAL)) {
 | 
			
		||||
        qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void icount_timer_cb(void *opaque)
 | 
			
		||||
{
 | 
			
		||||
    /*
 | 
			
		||||
     * No need for a checkpoint because the timer already synchronizes
 | 
			
		||||
     * with CHECKPOINT_CLOCK_VIRTUAL_RT.
 | 
			
		||||
     */
 | 
			
		||||
    icount_warp_rt();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void icount_start_warp_timer(void)
 | 
			
		||||
{
 | 
			
		||||
    int64_t clock;
 | 
			
		||||
    int64_t deadline;
 | 
			
		||||
 | 
			
		||||
    assert(icount_enabled());
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Nothing to do if the VM is stopped: QEMU_CLOCK_VIRTUAL timers
 | 
			
		||||
     * do not fire, so computing the deadline does not make sense.
 | 
			
		||||
     */
 | 
			
		||||
    if (!runstate_is_running()) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (replay_mode != REPLAY_MODE_PLAY) {
 | 
			
		||||
        if (!all_cpu_threads_idle()) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (qtest_enabled()) {
 | 
			
		||||
            /* When testing, qtest commands advance icount.  */
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        replay_checkpoint(CHECKPOINT_CLOCK_WARP_START);
 | 
			
		||||
    } else {
 | 
			
		||||
        /* warp clock deterministically in record/replay mode */
 | 
			
		||||
        if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP_START)) {
 | 
			
		||||
            /*
 | 
			
		||||
             * vCPU is sleeping and warp can't be started.
 | 
			
		||||
             * It is probably a race condition: notification sent
 | 
			
		||||
             * to vCPU was processed in advance and vCPU went to sleep.
 | 
			
		||||
             * Therefore we have to wake it up for doing something.
 | 
			
		||||
             */
 | 
			
		||||
            if (replay_has_event()) {
 | 
			
		||||
                qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
 | 
			
		||||
            }
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* We want to use the earliest deadline from ALL vm_clocks */
 | 
			
		||||
    clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT);
 | 
			
		||||
    deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
 | 
			
		||||
                                          ~QEMU_TIMER_ATTR_EXTERNAL);
 | 
			
		||||
    if (deadline < 0) {
 | 
			
		||||
        if (!icount_sleep) {
 | 
			
		||||
            warn_report_once("icount sleep disabled and no active timers");
 | 
			
		||||
        }
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (deadline > 0) {
 | 
			
		||||
        /*
 | 
			
		||||
         * Ensure QEMU_CLOCK_VIRTUAL proceeds even when the virtual CPU goes to
 | 
			
		||||
         * sleep.  Otherwise, the CPU might be waiting for a future timer
 | 
			
		||||
         * interrupt to wake it up, but the interrupt never comes because
 | 
			
		||||
         * the vCPU isn't running any insns and thus doesn't advance the
 | 
			
		||||
         * QEMU_CLOCK_VIRTUAL.
 | 
			
		||||
         */
 | 
			
		||||
        if (!icount_sleep) {
 | 
			
		||||
            /*
 | 
			
		||||
             * We never let VCPUs sleep in no sleep icount mode.
 | 
			
		||||
             * If there is a pending QEMU_CLOCK_VIRTUAL timer we just advance
 | 
			
		||||
             * to the next QEMU_CLOCK_VIRTUAL event and notify it.
 | 
			
		||||
             * It is useful when we want a deterministic execution time,
 | 
			
		||||
             * isolated from host latencies.
 | 
			
		||||
             */
 | 
			
		||||
            seqlock_write_lock(&timers_state.vm_clock_seqlock,
 | 
			
		||||
                               &timers_state.vm_clock_lock);
 | 
			
		||||
            qatomic_set_i64(&timers_state.qemu_icount_bias,
 | 
			
		||||
                            timers_state.qemu_icount_bias + deadline);
 | 
			
		||||
            seqlock_write_unlock(&timers_state.vm_clock_seqlock,
 | 
			
		||||
                                 &timers_state.vm_clock_lock);
 | 
			
		||||
            qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
 | 
			
		||||
        } else {
 | 
			
		||||
            /*
 | 
			
		||||
             * We do stop VCPUs and only advance QEMU_CLOCK_VIRTUAL after some
 | 
			
		||||
             * "real" time, (related to the time left until the next event) has
 | 
			
		||||
             * passed. The QEMU_CLOCK_VIRTUAL_RT clock will do this.
 | 
			
		||||
             * This avoids that the warps are visible externally; for example,
 | 
			
		||||
             * you will not be sending network packets continuously instead of
 | 
			
		||||
             * every 100ms.
 | 
			
		||||
             */
 | 
			
		||||
            seqlock_write_lock(&timers_state.vm_clock_seqlock,
 | 
			
		||||
                               &timers_state.vm_clock_lock);
 | 
			
		||||
            if (timers_state.vm_clock_warp_start == -1
 | 
			
		||||
                || timers_state.vm_clock_warp_start > clock) {
 | 
			
		||||
                timers_state.vm_clock_warp_start = clock;
 | 
			
		||||
            }
 | 
			
		||||
            seqlock_write_unlock(&timers_state.vm_clock_seqlock,
 | 
			
		||||
                                 &timers_state.vm_clock_lock);
 | 
			
		||||
            timer_mod_anticipate(timers_state.icount_warp_timer,
 | 
			
		||||
                                 clock + deadline);
 | 
			
		||||
        }
 | 
			
		||||
    } else if (deadline == 0) {
 | 
			
		||||
        qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void icount_account_warp_timer(void)
 | 
			
		||||
{
 | 
			
		||||
    if (!icount_sleep) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Nothing to do if the VM is stopped: QEMU_CLOCK_VIRTUAL timers
 | 
			
		||||
     * do not fire, so computing the deadline does not make sense.
 | 
			
		||||
     */
 | 
			
		||||
    if (!runstate_is_running()) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    replay_async_events();
 | 
			
		||||
 | 
			
		||||
    /* warp clock deterministically in record/replay mode */
 | 
			
		||||
    if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP_ACCOUNT)) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    timer_del(timers_state.icount_warp_timer);
 | 
			
		||||
    icount_warp_rt();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool icount_configure(QemuOpts *opts, Error **errp)
 | 
			
		||||
{
 | 
			
		||||
    const char *option = qemu_opt_get(opts, "shift");
 | 
			
		||||
    bool sleep = qemu_opt_get_bool(opts, "sleep", true);
 | 
			
		||||
    bool align = qemu_opt_get_bool(opts, "align", false);
 | 
			
		||||
    long time_shift = -1;
 | 
			
		||||
 | 
			
		||||
    if (!option) {
 | 
			
		||||
        if (qemu_opt_get(opts, "align") != NULL) {
 | 
			
		||||
            error_setg(errp, "Please specify shift option when using align");
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (align && !sleep) {
 | 
			
		||||
        error_setg(errp, "align=on and sleep=off are incompatible");
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (strcmp(option, "auto") != 0) {
 | 
			
		||||
        if (qemu_strtol(option, NULL, 0, &time_shift) < 0
 | 
			
		||||
            || time_shift < 0 || time_shift > MAX_ICOUNT_SHIFT) {
 | 
			
		||||
            error_setg(errp, "icount: Invalid shift value");
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    } else if (icount_align_option) {
 | 
			
		||||
        error_setg(errp, "shift=auto and align=on are incompatible");
 | 
			
		||||
        return false;
 | 
			
		||||
    } else if (!icount_sleep) {
 | 
			
		||||
        error_setg(errp, "shift=auto and sleep=off are incompatible");
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    icount_sleep = sleep;
 | 
			
		||||
    if (icount_sleep) {
 | 
			
		||||
        timers_state.icount_warp_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT,
 | 
			
		||||
                                         icount_timer_cb, NULL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    icount_align_option = align;
 | 
			
		||||
 | 
			
		||||
    if (time_shift >= 0) {
 | 
			
		||||
        timers_state.icount_time_shift = time_shift;
 | 
			
		||||
        icount_enable_precise();
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    icount_enable_adaptive();
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * 125MIPS seems a reasonable initial guess at the guest speed.
 | 
			
		||||
     * It will be corrected fairly quickly anyway.
 | 
			
		||||
     */
 | 
			
		||||
    timers_state.icount_time_shift = 3;
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Have both realtime and virtual time triggers for speed adjustment.
 | 
			
		||||
     * The realtime trigger catches emulated time passing too slowly,
 | 
			
		||||
     * the virtual time trigger catches emulated time passing too fast.
 | 
			
		||||
     * Realtime triggers occur even when idle, so use them less frequently
 | 
			
		||||
     * than VM triggers.
 | 
			
		||||
     */
 | 
			
		||||
    timers_state.vm_clock_warp_start = -1;
 | 
			
		||||
    timers_state.icount_rt_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL_RT,
 | 
			
		||||
                                   icount_adjust_rt, NULL);
 | 
			
		||||
    timer_mod(timers_state.icount_rt_timer,
 | 
			
		||||
                   qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL_RT) + 1000);
 | 
			
		||||
    timers_state.icount_vm_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
 | 
			
		||||
                                        icount_adjust_vm, NULL);
 | 
			
		||||
    timer_mod(timers_state.icount_vm_timer,
 | 
			
		||||
                   qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
 | 
			
		||||
                   NANOSECONDS_PER_SECOND / 10);
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void icount_notify_exit(void)
 | 
			
		||||
{
 | 
			
		||||
    assert(icount_enabled());
 | 
			
		||||
 | 
			
		||||
    if (current_cpu) {
 | 
			
		||||
        qemu_cpu_kick(current_cpu);
 | 
			
		||||
        qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,59 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Internal execution defines for qemu (target agnostic)
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2003 Fabrice Bellard
 | 
			
		||||
 *
 | 
			
		||||
 * SPDX-License-Identifier: LGPL-2.1-or-later
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef ACCEL_TCG_INTERNAL_COMMON_H
 | 
			
		||||
#define ACCEL_TCG_INTERNAL_COMMON_H
 | 
			
		||||
 | 
			
		||||
#include "exec/cpu-common.h"
 | 
			
		||||
#include "exec/translation-block.h"
 | 
			
		||||
 | 
			
		||||
extern int64_t max_delay;
 | 
			
		||||
extern int64_t max_advance;
 | 
			
		||||
 | 
			
		||||
extern bool one_insn_per_tb;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Return true if CS is not running in parallel with other cpus, either
 | 
			
		||||
 * because there are no other cpus or we are within an exclusive context.
 | 
			
		||||
 */
 | 
			
		||||
static inline bool cpu_in_serial_context(CPUState *cs)
 | 
			
		||||
{
 | 
			
		||||
    return !tcg_cflags_has(cs, CF_PARALLEL) || cpu_in_exclusive_context(cs);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * cpu_plugin_mem_cbs_enabled() - are plugin memory callbacks enabled?
 | 
			
		||||
 * @cs: CPUState pointer
 | 
			
		||||
 *
 | 
			
		||||
 * The memory callbacks are installed if a plugin has instrumented an
 | 
			
		||||
 * instruction for memory. This can be useful to know if you want to
 | 
			
		||||
 * force a slow path for a series of memory accesses.
 | 
			
		||||
 */
 | 
			
		||||
static inline bool cpu_plugin_mem_cbs_enabled(const CPUState *cpu)
 | 
			
		||||
{
 | 
			
		||||
#ifdef CONFIG_PLUGIN
 | 
			
		||||
    return !!cpu->neg.plugin_mem_cbs;
 | 
			
		||||
#else
 | 
			
		||||
    return false;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TranslationBlock *tb_gen_code(CPUState *cpu, vaddr pc,
 | 
			
		||||
                              uint64_t cs_base, uint32_t flags,
 | 
			
		||||
                              int cflags);
 | 
			
		||||
void page_init(void);
 | 
			
		||||
void tb_htable_init(void);
 | 
			
		||||
void tb_reset_jump(TranslationBlock *tb, int n);
 | 
			
		||||
TranslationBlock *tb_link_page(TranslationBlock *tb);
 | 
			
		||||
void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
 | 
			
		||||
                               uintptr_t host_pc);
 | 
			
		||||
 | 
			
		||||
bool tcg_exec_realizefn(CPUState *cpu, Error **errp);
 | 
			
		||||
void tcg_exec_unrealizefn(CPUState *cpu);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -1,118 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Internal execution defines for qemu (target specific)
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2003 Fabrice Bellard
 | 
			
		||||
 *
 | 
			
		||||
 * SPDX-License-Identifier: LGPL-2.1-or-later
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef ACCEL_TCG_INTERNAL_TARGET_H
 | 
			
		||||
#define ACCEL_TCG_INTERNAL_TARGET_H
 | 
			
		||||
 | 
			
		||||
#include "exec/exec-all.h"
 | 
			
		||||
#include "exec/translate-all.h"
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Access to the various translations structures need to be serialised
 | 
			
		||||
 * via locks for consistency.  In user-mode emulation access to the
 | 
			
		||||
 * memory related structures are protected with mmap_lock.
 | 
			
		||||
 * In !user-mode we use per-page locks.
 | 
			
		||||
 */
 | 
			
		||||
#ifdef CONFIG_USER_ONLY
 | 
			
		||||
#define assert_memory_lock() tcg_debug_assert(have_mmap_lock())
 | 
			
		||||
#else
 | 
			
		||||
#define assert_memory_lock()
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(CONFIG_SOFTMMU) && defined(CONFIG_DEBUG_TCG)
 | 
			
		||||
void assert_no_pages_locked(void);
 | 
			
		||||
#else
 | 
			
		||||
static inline void assert_no_pages_locked(void) { }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_USER_ONLY
 | 
			
		||||
static inline void page_table_config_init(void) { }
 | 
			
		||||
#else
 | 
			
		||||
void page_table_config_init(void);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_USER_ONLY
 | 
			
		||||
/*
 | 
			
		||||
 * For user-only, page_protect sets the page read-only.
 | 
			
		||||
 * Since most execution is already on read-only pages, and we'd need to
 | 
			
		||||
 * account for other TBs on the same page, defer undoing any page protection
 | 
			
		||||
 * until we receive the write fault.
 | 
			
		||||
 */
 | 
			
		||||
static inline void tb_lock_page0(tb_page_addr_t p0)
 | 
			
		||||
{
 | 
			
		||||
    page_protect(p0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void tb_lock_page1(tb_page_addr_t p0, tb_page_addr_t p1)
 | 
			
		||||
{
 | 
			
		||||
    page_protect(p1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void tb_unlock_page1(tb_page_addr_t p0, tb_page_addr_t p1) { }
 | 
			
		||||
static inline void tb_unlock_pages(TranslationBlock *tb) { }
 | 
			
		||||
#else
 | 
			
		||||
void tb_lock_page0(tb_page_addr_t);
 | 
			
		||||
void tb_lock_page1(tb_page_addr_t, tb_page_addr_t);
 | 
			
		||||
void tb_unlock_page1(tb_page_addr_t, tb_page_addr_t);
 | 
			
		||||
void tb_unlock_pages(TranslationBlock *);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_SOFTMMU
 | 
			
		||||
void tb_invalidate_phys_range_fast(ram_addr_t ram_addr,
 | 
			
		||||
                                   unsigned size,
 | 
			
		||||
                                   uintptr_t retaddr);
 | 
			
		||||
G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
 | 
			
		||||
#endif /* CONFIG_SOFTMMU */
 | 
			
		||||
 | 
			
		||||
bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc);
 | 
			
		||||
 | 
			
		||||
/* Return the current PC from CPU, which may be cached in TB. */
 | 
			
		||||
static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb)
 | 
			
		||||
{
 | 
			
		||||
    if (tb_cflags(tb) & CF_PCREL) {
 | 
			
		||||
        return cpu->cc->get_pc(cpu);
 | 
			
		||||
    } else {
 | 
			
		||||
        return tb->pc;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * tcg_req_mo:
 | 
			
		||||
 * @type: TCGBar
 | 
			
		||||
 *
 | 
			
		||||
 * Filter @type to the barrier that is required for the guest
 | 
			
		||||
 * memory ordering vs the host memory ordering.  A non-zero
 | 
			
		||||
 * result indicates that some barrier is required.
 | 
			
		||||
 *
 | 
			
		||||
 * If TCG_GUEST_DEFAULT_MO is not defined, assume that the
 | 
			
		||||
 * guest requires strict ordering.
 | 
			
		||||
 *
 | 
			
		||||
 * This is a macro so that it's constant even without optimization.
 | 
			
		||||
 */
 | 
			
		||||
#ifdef TCG_GUEST_DEFAULT_MO
 | 
			
		||||
# define tcg_req_mo(type) \
 | 
			
		||||
    ((type) & TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO)
 | 
			
		||||
#else
 | 
			
		||||
# define tcg_req_mo(type) ((type) & ~TCG_TARGET_DEFAULT_MO)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * cpu_req_mo:
 | 
			
		||||
 * @type: TCGBar
 | 
			
		||||
 *
 | 
			
		||||
 * If tcg_req_mo indicates a barrier for @type is required
 | 
			
		||||
 * for the guest memory model, issue a host memory barrier.
 | 
			
		||||
 */
 | 
			
		||||
#define cpu_req_mo(type)          \
 | 
			
		||||
    do {                          \
 | 
			
		||||
        if (tcg_req_mo(type)) {   \
 | 
			
		||||
            smp_mb();             \
 | 
			
		||||
        }                         \
 | 
			
		||||
    } while (0)
 | 
			
		||||
 | 
			
		||||
#endif /* ACCEL_TCG_INTERNAL_H */
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user