Compare commits
164 Commits
v8.0.0-rc1
...
v8.0.0-rc4
Author | SHA1 | Date | |
---|---|---|---|
|
7dbd6f8a27 | ||
|
c38b2ca738 | ||
|
69d4e746b3 | ||
|
28ef5339c3 | ||
|
37502df32c | ||
|
06064a6715 | ||
|
6621883f93 | ||
|
86d063fa83 | ||
|
9d177b7f87 | ||
|
3fe64abcde | ||
|
77a87a0722 | ||
|
4b32319cda | ||
|
cb16e5c76f | ||
|
abb02ce0e7 | ||
|
81f730d4d0 | ||
|
9ed98cae15 | ||
|
e5203a3b5d | ||
|
2c5451ca52 | ||
|
8c6f27e7d8 | ||
|
439cc330c5 | ||
|
6188088f72 | ||
|
160a29e2f8 | ||
|
6c50845a91 | ||
|
2b1f8fcb84 | ||
|
8af037fe4c | ||
|
dda860b9c0 | ||
|
20861f34e0 | ||
|
25acc3f279 | ||
|
7d9e1ee424 | ||
|
26aeb3b589 | ||
|
8539dc0055 | ||
|
6a3b1e440b | ||
|
08dede0703 | ||
|
64f1c63d87 | ||
|
a253231fbe | ||
|
cc40b8b844 | ||
|
c6f3cbca32 | ||
|
b1ab8f9cc5 | ||
|
b5fba99ec7 | ||
|
56adee407f | ||
|
7d0334e491 | ||
|
8a712df4d4 | ||
|
992473749f | ||
|
1ffbe5d681 | ||
|
3371802fba | ||
|
c83574392e | ||
|
c8cb603293 | ||
|
fc9988916a | ||
|
bdd53274f2 | ||
|
90834f5de6 | ||
|
6e3be02291 | ||
|
452b3eeacc | ||
|
3be8c03460 | ||
|
0beaebc041 | ||
|
b846ad627e | ||
|
6cda41daa2 | ||
|
899c3fc2dc | ||
|
f1426881a8 | ||
|
4584e76c9a | ||
|
b8b6d3c04a | ||
|
ec28dd6c6f | ||
|
51d54503e8 | ||
|
51a6dc9d39 | ||
|
a0eaa126af | ||
|
782781e85d | ||
|
12148d442e | ||
|
b15bdc9651 | ||
|
efcd0ec14b | ||
|
aad3eb1ffe | ||
|
95bf341865 | ||
|
9d403d27bc | ||
|
3d85c7c15f | ||
|
450cb7ec2c | ||
|
baead64297 | ||
|
f00506aeca | ||
|
87e303de70 | ||
|
a085860834 | ||
|
6eece7f531 | ||
|
4f5c67f8df | ||
|
95059f9c31 | ||
|
a3a67f54f0 | ||
|
e506ad6a05 | ||
|
73f96d51ff | ||
|
f6555e3f39 | ||
|
f7e2add5fd | ||
|
10310cbd62 | ||
|
49840a4a09 | ||
|
2f7828b572 | ||
|
1ff4a81bd3 | ||
|
e3feb2cc22 | ||
|
d37158bb24 | ||
|
3b555b5115 | ||
|
eeb2f7e357 | ||
|
52dd5f6f70 | ||
|
ecaefc8f50 | ||
|
46e3b237c5 | ||
|
fba7c3b788 | ||
|
7581baed88 | ||
|
3c2e0a6853 | ||
|
5f12d70304 | ||
|
3269ebb3e0 | ||
|
1c1e649761 | ||
|
2e68546a43 | ||
|
e860ef1568 | ||
|
2a5f744ef2 | ||
|
4cf3a63849 | ||
|
f4fdaf009c | ||
|
212f7b1dac | ||
|
ca2a091802 | ||
|
9b4f01812f | ||
|
d8fbf9aa85 | ||
|
e62da98527 | ||
|
2957dc40a2 | ||
|
bd2cd4a441 | ||
|
e3debd5e7d | ||
|
d82e2e7635 | ||
|
a219645ce3 | ||
|
670d8c6ebf | ||
|
8635a3a153 | ||
|
da80f11efe | ||
|
8f03c08506 | ||
|
7b1bde9560 | ||
|
07e4804fcd | ||
|
f79283fdb8 | ||
|
d091b5b442 | ||
|
0030b244a7 | ||
|
f75e4f2234 | ||
|
0fcd574b02 | ||
|
60ca584b8a | ||
|
e35b9a2e81 | ||
|
6205a70b92 | ||
|
3556c1034d | ||
|
bfa2e7aacb | ||
|
111fc86241 | ||
|
8bc9e104b7 | ||
|
b89b72de16 | ||
|
e00c621bba | ||
|
0d01a2f8a4 | ||
|
51ab5f8bd7 | ||
|
5ba7db0938 | ||
|
cb845eaa88 | ||
|
6e5792a1f6 | ||
|
663755b022 | ||
|
a9e21786da | ||
|
0c8076b024 | ||
|
85b983485b | ||
|
3b67f43cf3 | ||
|
507271d468 | ||
|
aa4cf6eb82 | ||
|
720ace24ae | ||
|
cc37d98bfb | ||
|
e8956e0c6c | ||
|
10588491c1 | ||
|
e04660afef | ||
|
fb3af2d182 | ||
|
6f6ca067d2 | ||
|
32ba75adc0 | ||
|
dbe9a9cdbb | ||
|
82790dfefc | ||
|
6df250e181 | ||
|
55154c5785 | ||
|
9f95111474 | ||
|
80232dba16 | ||
|
136b6085f1 |
111
.cirrus.yml
111
.cirrus.yml
@@ -1,111 +0,0 @@
|
||||
env:
|
||||
CIRRUS_CLONE_DEPTH: 1
|
||||
|
||||
windows_msys2_task:
|
||||
timeout_in: 90m
|
||||
windows_container:
|
||||
image: cirrusci/windowsservercore:2019
|
||||
os_version: 2019
|
||||
cpu: 8
|
||||
memory: 8G
|
||||
env:
|
||||
CIRRUS_SHELL: powershell
|
||||
MSYS: winsymlinks:native
|
||||
MSYSTEM: MINGW64
|
||||
MSYS2_URL: https://github.com/msys2/msys2-installer/releases/download/2022-06-03/msys2-base-x86_64-20220603.sfx.exe
|
||||
MSYS2_FINGERPRINT: 0
|
||||
MSYS2_PACKAGES: "
|
||||
diffutils git grep make pkg-config sed
|
||||
mingw-w64-x86_64-python
|
||||
mingw-w64-x86_64-python-sphinx
|
||||
mingw-w64-x86_64-toolchain
|
||||
mingw-w64-x86_64-SDL2
|
||||
mingw-w64-x86_64-SDL2_image
|
||||
mingw-w64-x86_64-gtk3
|
||||
mingw-w64-x86_64-glib2
|
||||
mingw-w64-x86_64-ninja
|
||||
mingw-w64-x86_64-jemalloc
|
||||
mingw-w64-x86_64-lzo2
|
||||
mingw-w64-x86_64-zstd
|
||||
mingw-w64-x86_64-libjpeg-turbo
|
||||
mingw-w64-x86_64-pixman
|
||||
mingw-w64-x86_64-libgcrypt
|
||||
mingw-w64-x86_64-libpng
|
||||
mingw-w64-x86_64-libssh
|
||||
mingw-w64-x86_64-snappy
|
||||
mingw-w64-x86_64-libusb
|
||||
mingw-w64-x86_64-usbredir
|
||||
mingw-w64-x86_64-libtasn1
|
||||
mingw-w64-x86_64-nettle
|
||||
mingw-w64-x86_64-cyrus-sasl
|
||||
mingw-w64-x86_64-curl
|
||||
mingw-w64-x86_64-gnutls
|
||||
mingw-w64-x86_64-libnfs
|
||||
"
|
||||
CHERE_INVOKING: 1
|
||||
msys2_cache:
|
||||
folder: C:\tools\archive
|
||||
reupload_on_changes: false
|
||||
# These env variables are used to generate fingerprint to trigger the cache procedure
|
||||
# If wanna to force re-populate msys2, increase MSYS2_FINGERPRINT
|
||||
fingerprint_script:
|
||||
- |
|
||||
echo $env:CIRRUS_TASK_NAME
|
||||
echo $env:MSYS2_URL
|
||||
echo $env:MSYS2_FINGERPRINT
|
||||
echo $env:MSYS2_PACKAGES
|
||||
populate_script:
|
||||
- |
|
||||
md -Force C:\tools\archive\pkg
|
||||
$start_time = Get-Date
|
||||
bitsadmin /transfer msys_download /dynamic /download /priority FOREGROUND $env:MSYS2_URL C:\tools\archive\base.exe
|
||||
Write-Output "Download time taken: $((Get-Date).Subtract($start_time))"
|
||||
cd C:\tools
|
||||
C:\tools\archive\base.exe -y
|
||||
del -Force C:\tools\archive\base.exe
|
||||
Write-Output "Base install time taken: $((Get-Date).Subtract($start_time))"
|
||||
$start_time = Get-Date
|
||||
|
||||
((Get-Content -path C:\tools\msys64\etc\\post-install\\07-pacman-key.post -Raw) -replace '--refresh-keys', '--version') | Set-Content -Path C:\tools\msys64\etc\\post-install\\07-pacman-key.post
|
||||
C:\tools\msys64\usr\bin\bash.exe -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
|
||||
C:\tools\msys64\usr\bin\bash.exe -lc "export"
|
||||
C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Sy
|
||||
echo Y | C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Suu --overwrite=*
|
||||
taskkill /F /FI "MODULES eq msys-2.0.dll"
|
||||
tasklist
|
||||
C:\tools\msys64\usr\bin\bash.exe -lc "mv -f /etc/pacman.conf.pacnew /etc/pacman.conf || true"
|
||||
C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu --overwrite=*"
|
||||
Write-Output "Core install time taken: $((Get-Date).Subtract($start_time))"
|
||||
$start_time = Get-Date
|
||||
|
||||
C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S --needed $env:MSYS2_PACKAGES"
|
||||
Write-Output "Package install time taken: $((Get-Date).Subtract($start_time))"
|
||||
$start_time = Get-Date
|
||||
|
||||
del -Force -ErrorAction SilentlyContinue C:\tools\msys64\etc\mtab
|
||||
del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\fd
|
||||
del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stderr
|
||||
del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stdin
|
||||
del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stdout
|
||||
del -Force -Recurse -ErrorAction SilentlyContinue C:\tools\msys64\var\cache\pacman\pkg
|
||||
tar cf C:\tools\archive\msys64.tar -C C:\tools\ msys64
|
||||
|
||||
Write-Output "Package archive time taken: $((Get-Date).Subtract($start_time))"
|
||||
del -Force -Recurse -ErrorAction SilentlyContinue c:\tools\msys64
|
||||
install_script:
|
||||
- |
|
||||
$start_time = Get-Date
|
||||
cd C:\tools
|
||||
ls C:\tools\archive\msys64.tar
|
||||
tar xf C:\tools\archive\msys64.tar
|
||||
Write-Output "Extract msys2 time taken: $((Get-Date).Subtract($start_time))"
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- C:\tools\msys64\usr\bin\bash.exe -lc "../configure --python=python3
|
||||
--target-list-exclude=i386-softmmu,ppc64-softmmu,aarch64-softmmu,mips64-softmmu,mipsel-softmmu,sh4-softmmu"
|
||||
- C:\tools\msys64\usr\bin\bash.exe -lc "make -j8"
|
||||
- exit $LastExitCode
|
||||
test_script:
|
||||
- C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make V=1 check"
|
||||
- exit $LastExitCode
|
21
.git-blame-ignore-revs
Normal file
21
.git-blame-ignore-revs
Normal file
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# 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
|
@@ -75,5 +75,5 @@
|
||||
- if: '$QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != "qemu-project"'
|
||||
when: manual
|
||||
|
||||
# Jobs can run if any jobs they depend on were successfull
|
||||
# Jobs can run if any jobs they depend on were successful
|
||||
- when: on_success
|
||||
|
@@ -1,4 +1,9 @@
|
||||
# All centos-stream-8 jobs should run successfully in an environment
|
||||
# setup by the scripts/ci/setup/stream/8/build-environment.yml task
|
||||
# "Installation of extra packages to build QEMU"
|
||||
|
||||
centos-stream-8-x86_64:
|
||||
extends: .custom_runner_template
|
||||
allow_failure: true
|
||||
needs: []
|
||||
stage: build
|
||||
@@ -8,15 +13,6 @@ centos-stream-8-x86_64:
|
||||
rules:
|
||||
- if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
|
||||
- if: "$CENTOS_STREAM_8_x86_64_RUNNER_AVAILABLE"
|
||||
artifacts:
|
||||
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
||||
when: on_failure
|
||||
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:
|
||||
- JOBS=$(expr $(nproc) + 1)
|
||||
script:
|
||||
@@ -25,6 +21,4 @@ centos-stream-8-x86_64:
|
||||
- ../scripts/ci/org.centos/stream/8/x86_64/configure
|
||||
|| { cat config.log meson-logs/meson-log.txt; exit 1; }
|
||||
- make -j"$JOBS"
|
||||
- make NINJA=":" check
|
||||
|| { cat meson-logs/testlog.txt; exit 1; } ;
|
||||
- ../scripts/ci/org.centos/stream/8/x86_64/test-avocado
|
||||
- make NINJA=":" check check-avocado
|
||||
|
@@ -59,6 +59,7 @@ msys2-64bit:
|
||||
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 "
|
||||
- $env:CHERE_INVOKING = 'yes' # Preserve the current working directory
|
||||
@@ -108,6 +109,7 @@ msys2-32bit:
|
||||
mingw-w64-i686-SDL2
|
||||
mingw-w64-i686-SDL2_image
|
||||
mingw-w64-i686-snappy
|
||||
mingw-w64-i686-spice
|
||||
mingw-w64-i686-usbredir
|
||||
mingw-w64-i686-zstd "
|
||||
- $env:CHERE_INVOKING = 'yes' # Preserve the current working directory
|
||||
|
27
MAINTAINERS
27
MAINTAINERS
@@ -64,6 +64,20 @@ L: qemu-devel@nongnu.org
|
||||
F: *
|
||||
F: */
|
||||
|
||||
Project policy and developer guides
|
||||
R: Alex Bennée <alex.bennee@linaro.org>
|
||||
R: Daniel P. Berrangé <berrange@redhat.com>
|
||||
R: Thomas Huth <thuth@redhat.com>
|
||||
R: Markus Armbruster <armbru@redhat.com>
|
||||
R: Philippe Mathieu-Daudé <philmd@linaro.org>
|
||||
W: https://www.qemu.org/docs/master/devel/index.html
|
||||
S: Odd Fixes
|
||||
F: docs/devel/style.rst
|
||||
F: docs/devel/code-of-conduct.rst
|
||||
F: docs/devel/conflict-resolution.rst
|
||||
F: docs/devel/submitting-a-patch.rst
|
||||
F: docs/devel/submitting-a-pull-request.rst
|
||||
|
||||
Responsible Disclosure, Reporting Security Issues
|
||||
-------------------------------------------------
|
||||
W: https://wiki.qemu.org/SecurityProcess
|
||||
@@ -2119,7 +2133,6 @@ T: git https://github.com/borntraeger/qemu.git s390-next
|
||||
L: qemu-s390x@nongnu.org
|
||||
|
||||
virtiofs
|
||||
M: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
M: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
S: Supported
|
||||
F: hw/virtio/vhost-user-fs*
|
||||
@@ -2252,6 +2265,7 @@ F: tests/qtest/libqos/e1000e.*
|
||||
|
||||
igb
|
||||
M: Akihiko Odaki <akihiko.odaki@daynix.com>
|
||||
R: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
|
||||
S: Maintained
|
||||
F: docs/system/devices/igb.rst
|
||||
F: hw/net/igb*
|
||||
@@ -2862,7 +2876,7 @@ F: tests/unit/test-rcu-*.c
|
||||
F: util/rcu.c
|
||||
|
||||
Human Monitor (HMP)
|
||||
M: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
M: Dr. David Alan Gilbert <dave@treblig.org>
|
||||
S: Maintained
|
||||
F: monitor/monitor-internal.h
|
||||
F: monitor/misc.c
|
||||
@@ -3135,7 +3149,6 @@ F: scripts/checkpatch.pl
|
||||
|
||||
Migration
|
||||
M: Juan Quintela <quintela@redhat.com>
|
||||
M: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
S: Maintained
|
||||
F: hw/core/vmstate-if.c
|
||||
F: include/hw/vmstate-if.h
|
||||
@@ -3818,8 +3831,7 @@ W: https://cirrus-ci.com/github/qemu/qemu
|
||||
Windows Hosted Continuous Integration
|
||||
M: Yonggang Luo <luoyonggang@gmail.com>
|
||||
S: Maintained
|
||||
F: .cirrus.yml
|
||||
W: https://cirrus-ci.com/github/qemu/qemu
|
||||
F: .gitlab-ci.d/windows.yml
|
||||
|
||||
Guest Test Compilation Support
|
||||
M: Alex Bennée <alex.bennee@linaro.org>
|
||||
@@ -3908,3 +3920,8 @@ Performance Tools and Tests
|
||||
M: Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
|
||||
S: Maintained
|
||||
F: scripts/performance/
|
||||
|
||||
Code Coverage Tools
|
||||
M: Alex Bennée <alex.bennee@linaro.org>
|
||||
S: Odd Fixes
|
||||
F: scripts/coverage/
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include "qemu/accel.h"
|
||||
#include "hw/boards.h"
|
||||
#include "sysemu/cpus.h"
|
||||
|
||||
#include "qemu/error-report.h"
|
||||
#include "accel-softmmu.h"
|
||||
|
||||
int accel_init_machine(AccelState *accel, MachineState *ms)
|
||||
|
@@ -685,6 +685,15 @@ static uint32_t kvm_dirty_ring_reap_one(KVMState *s, CPUState *cpu)
|
||||
uint32_t ring_size = s->kvm_dirty_ring_size;
|
||||
uint32_t count = 0, fetch = cpu->kvm_fetch_index;
|
||||
|
||||
/*
|
||||
* It's possible that we race with vcpu creation code where the vcpu is
|
||||
* put onto the vcpus list but not yet initialized the dirty ring
|
||||
* structures. If so, skip it.
|
||||
*/
|
||||
if (!cpu->created) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
assert(dirty_gfns && ring_size);
|
||||
trace_kvm_dirty_ring_reap_vcpu(cpu->cpu_index);
|
||||
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include "sysemu/cpus.h"
|
||||
#include "sysemu/tcg.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "qemu/plugin.h"
|
||||
|
||||
bool tcg_allowed;
|
||||
|
||||
@@ -65,6 +66,8 @@ void cpu_loop_exit(CPUState *cpu)
|
||||
{
|
||||
/* Undo the setting in cpu_tb_exec. */
|
||||
cpu->can_do_io = 1;
|
||||
/* Undo any setting in generated code. */
|
||||
qemu_plugin_disable_mem_helpers(cpu);
|
||||
siglongjmp(cpu->jmp_env, 1);
|
||||
}
|
||||
|
||||
|
@@ -257,7 +257,7 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc,
|
||||
|
||||
if (cflags & CF_PCREL) {
|
||||
/* Use acquire to ensure current load of pc from jc. */
|
||||
tb = qatomic_load_acquire(&jc->array[hash].tb);
|
||||
tb = qatomic_load_acquire(&jc->array[hash].tb);
|
||||
|
||||
if (likely(tb &&
|
||||
jc->array[hash].pc == pc &&
|
||||
@@ -272,7 +272,7 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc,
|
||||
return NULL;
|
||||
}
|
||||
jc->array[hash].pc = pc;
|
||||
/* Use store_release on tb to ensure pc is written first. */
|
||||
/* Ensure pc is written first. */
|
||||
qatomic_store_release(&jc->array[hash].tb, tb);
|
||||
} else {
|
||||
/* Use rcu_read to ensure current load of pc from *tb. */
|
||||
@@ -459,6 +459,7 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit)
|
||||
qemu_thread_jit_execute();
|
||||
ret = tcg_qemu_tb_exec(env, tb_ptr);
|
||||
cpu->can_do_io = 1;
|
||||
qemu_plugin_disable_mem_helpers(cpu);
|
||||
/*
|
||||
* TODO: Delay swapping back to the read-write region of the TB
|
||||
* until we actually need to modify the TB. The read-only copy,
|
||||
@@ -526,7 +527,6 @@ static void cpu_exec_exit(CPUState *cpu)
|
||||
if (cc->tcg_ops->cpu_exec_exit) {
|
||||
cc->tcg_ops->cpu_exec_exit(cpu);
|
||||
}
|
||||
QEMU_PLUGIN_ASSERT(cpu->plugin_mem_cbs == NULL);
|
||||
}
|
||||
|
||||
void cpu_exec_step_atomic(CPUState *cpu)
|
||||
@@ -580,7 +580,6 @@ void cpu_exec_step_atomic(CPUState *cpu)
|
||||
qemu_mutex_unlock_iothread();
|
||||
}
|
||||
assert_no_pages_locked();
|
||||
qemu_plugin_disable_mem_helpers(cpu);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -972,18 +971,27 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc)
|
||||
|
||||
tb = tb_lookup(cpu, pc, cs_base, flags, cflags);
|
||||
if (tb == NULL) {
|
||||
CPUJumpCache *jc;
|
||||
uint32_t h;
|
||||
|
||||
mmap_lock();
|
||||
tb = tb_gen_code(cpu, pc, cs_base, flags, cflags);
|
||||
mmap_unlock();
|
||||
|
||||
/*
|
||||
* We add the TB in the virtual pc hash table
|
||||
* for the fast lookup
|
||||
*/
|
||||
h = tb_jmp_cache_hash_func(pc);
|
||||
/* Use the pc value already stored in tb->pc. */
|
||||
qatomic_set(&cpu->tb_jmp_cache->array[h].tb, tb);
|
||||
jc = cpu->tb_jmp_cache;
|
||||
if (cflags & CF_PCREL) {
|
||||
jc->array[h].pc = pc;
|
||||
/* Ensure pc is written first. */
|
||||
qatomic_store_release(&jc->array[h].tb, tb);
|
||||
} else {
|
||||
/* Use the pc value already stored in tb->pc. */
|
||||
qatomic_set(&jc->array[h].tb, tb);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
@@ -1004,7 +1012,6 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc)
|
||||
|
||||
cpu_loop_exec_tb(cpu, tb, pc, &last_tb, &tb_exit);
|
||||
|
||||
QEMU_PLUGIN_ASSERT(cpu->plugin_mem_cbs == NULL);
|
||||
/* Try to align the host and virtual clocks
|
||||
if the guest is in advance */
|
||||
align_clocks(sc, cpu);
|
||||
@@ -1029,7 +1036,6 @@ static int cpu_exec_setjmp(CPUState *cpu, SyncClocks *sc)
|
||||
if (qemu_mutex_iothread_locked()) {
|
||||
qemu_mutex_unlock_iothread();
|
||||
}
|
||||
qemu_plugin_disable_mem_helpers(cpu);
|
||||
|
||||
assert_no_pages_locked();
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/interval-tree.h"
|
||||
#include "qemu/qtree.h"
|
||||
#include "exec/cputlb.h"
|
||||
#include "exec/log.h"
|
||||
#include "exec/exec-all.h"
|
||||
@@ -126,29 +127,29 @@ static void tb_remove(TranslationBlock *tb)
|
||||
}
|
||||
|
||||
/* TODO: For now, still shared with translate-all.c for system mode. */
|
||||
#define PAGE_FOR_EACH_TB(start, end, pagedesc, T, N) \
|
||||
for (T = foreach_tb_first(start, end), \
|
||||
N = foreach_tb_next(T, start, end); \
|
||||
#define PAGE_FOR_EACH_TB(start, last, pagedesc, T, N) \
|
||||
for (T = foreach_tb_first(start, last), \
|
||||
N = foreach_tb_next(T, start, last); \
|
||||
T != NULL; \
|
||||
T = N, N = foreach_tb_next(N, start, end))
|
||||
T = N, N = foreach_tb_next(N, start, last))
|
||||
|
||||
typedef TranslationBlock *PageForEachNext;
|
||||
|
||||
static PageForEachNext foreach_tb_first(tb_page_addr_t start,
|
||||
tb_page_addr_t end)
|
||||
tb_page_addr_t last)
|
||||
{
|
||||
IntervalTreeNode *n = interval_tree_iter_first(&tb_root, start, end - 1);
|
||||
IntervalTreeNode *n = interval_tree_iter_first(&tb_root, start, last);
|
||||
return n ? container_of(n, TranslationBlock, itree) : NULL;
|
||||
}
|
||||
|
||||
static PageForEachNext foreach_tb_next(PageForEachNext tb,
|
||||
tb_page_addr_t start,
|
||||
tb_page_addr_t end)
|
||||
tb_page_addr_t last)
|
||||
{
|
||||
IntervalTreeNode *n;
|
||||
|
||||
if (tb) {
|
||||
n = interval_tree_iter_next(&tb->itree, start, end - 1);
|
||||
n = interval_tree_iter_next(&tb->itree, start, last);
|
||||
if (n) {
|
||||
return container_of(n, TranslationBlock, itree);
|
||||
}
|
||||
@@ -314,12 +315,12 @@ struct page_entry {
|
||||
* See also: page_collection_lock().
|
||||
*/
|
||||
struct page_collection {
|
||||
GTree *tree;
|
||||
QTree *tree;
|
||||
struct page_entry *max;
|
||||
};
|
||||
|
||||
typedef int PageForEachNext;
|
||||
#define PAGE_FOR_EACH_TB(start, end, pagedesc, tb, n) \
|
||||
#define PAGE_FOR_EACH_TB(start, last, pagedesc, tb, n) \
|
||||
TB_FOR_EACH_TAGGED((pagedesc)->first_tb, tb, n, page_next)
|
||||
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
@@ -467,7 +468,7 @@ static bool page_trylock_add(struct page_collection *set, tb_page_addr_t addr)
|
||||
struct page_entry *pe;
|
||||
PageDesc *pd;
|
||||
|
||||
pe = g_tree_lookup(set->tree, &index);
|
||||
pe = q_tree_lookup(set->tree, &index);
|
||||
if (pe) {
|
||||
return false;
|
||||
}
|
||||
@@ -478,7 +479,7 @@ static bool page_trylock_add(struct page_collection *set, tb_page_addr_t addr)
|
||||
}
|
||||
|
||||
pe = page_entry_new(pd, index);
|
||||
g_tree_insert(set->tree, &pe->index, pe);
|
||||
q_tree_insert(set->tree, &pe->index, pe);
|
||||
|
||||
/*
|
||||
* If this is either (1) the first insertion or (2) a page whose index
|
||||
@@ -510,30 +511,30 @@ static gint tb_page_addr_cmp(gconstpointer ap, gconstpointer bp, gpointer udata)
|
||||
}
|
||||
|
||||
/*
|
||||
* Lock a range of pages ([@start,@end[) as well as the pages of all
|
||||
* Lock a range of pages ([@start,@last]) as well as the pages of all
|
||||
* intersecting TBs.
|
||||
* Locking order: acquire locks in ascending order of page index.
|
||||
*/
|
||||
static struct page_collection *page_collection_lock(tb_page_addr_t start,
|
||||
tb_page_addr_t end)
|
||||
tb_page_addr_t last)
|
||||
{
|
||||
struct page_collection *set = g_malloc(sizeof(*set));
|
||||
tb_page_addr_t index;
|
||||
PageDesc *pd;
|
||||
|
||||
start >>= TARGET_PAGE_BITS;
|
||||
end >>= TARGET_PAGE_BITS;
|
||||
g_assert(start <= end);
|
||||
last >>= TARGET_PAGE_BITS;
|
||||
g_assert(start <= last);
|
||||
|
||||
set->tree = g_tree_new_full(tb_page_addr_cmp, NULL, NULL,
|
||||
set->tree = q_tree_new_full(tb_page_addr_cmp, NULL, NULL,
|
||||
page_entry_destroy);
|
||||
set->max = NULL;
|
||||
assert_no_pages_locked();
|
||||
|
||||
retry:
|
||||
g_tree_foreach(set->tree, page_entry_lock, NULL);
|
||||
q_tree_foreach(set->tree, page_entry_lock, NULL);
|
||||
|
||||
for (index = start; index <= end; index++) {
|
||||
for (index = start; index <= last; index++) {
|
||||
TranslationBlock *tb;
|
||||
PageForEachNext n;
|
||||
|
||||
@@ -542,7 +543,7 @@ static struct page_collection *page_collection_lock(tb_page_addr_t start,
|
||||
continue;
|
||||
}
|
||||
if (page_trylock_add(set, index << TARGET_PAGE_BITS)) {
|
||||
g_tree_foreach(set->tree, page_entry_unlock, NULL);
|
||||
q_tree_foreach(set->tree, page_entry_unlock, NULL);
|
||||
goto retry;
|
||||
}
|
||||
assert_page_locked(pd);
|
||||
@@ -551,7 +552,7 @@ static struct page_collection *page_collection_lock(tb_page_addr_t start,
|
||||
(tb_page_addr1(tb) != -1 &&
|
||||
page_trylock_add(set, tb_page_addr1(tb)))) {
|
||||
/* drop all locks, and reacquire in order */
|
||||
g_tree_foreach(set->tree, page_entry_unlock, NULL);
|
||||
q_tree_foreach(set->tree, page_entry_unlock, NULL);
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
@@ -562,7 +563,7 @@ static struct page_collection *page_collection_lock(tb_page_addr_t start,
|
||||
static void page_collection_unlock(struct page_collection *set)
|
||||
{
|
||||
/* entries are unlocked and freed via page_entry_destroy */
|
||||
g_tree_destroy(set->tree);
|
||||
q_tree_destroy(set->tree);
|
||||
g_free(set);
|
||||
}
|
||||
|
||||
@@ -990,14 +991,14 @@ TranslationBlock *tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
|
||||
* Called with mmap_lock held for user-mode emulation.
|
||||
* NOTE: this function must not be called while a TB is running.
|
||||
*/
|
||||
void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end)
|
||||
void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t last)
|
||||
{
|
||||
TranslationBlock *tb;
|
||||
PageForEachNext n;
|
||||
|
||||
assert_memory_lock();
|
||||
|
||||
PAGE_FOR_EACH_TB(start, end, unused, tb, n) {
|
||||
PAGE_FOR_EACH_TB(start, last, unused, tb, n) {
|
||||
tb_phys_invalidate__locked(tb);
|
||||
}
|
||||
}
|
||||
@@ -1009,11 +1010,11 @@ void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end)
|
||||
*/
|
||||
void tb_invalidate_phys_page(tb_page_addr_t addr)
|
||||
{
|
||||
tb_page_addr_t start, end;
|
||||
tb_page_addr_t start, last;
|
||||
|
||||
start = addr & TARGET_PAGE_MASK;
|
||||
end = start + TARGET_PAGE_SIZE;
|
||||
tb_invalidate_phys_range(start, end);
|
||||
last = addr | ~TARGET_PAGE_MASK;
|
||||
tb_invalidate_phys_range(start, last);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1029,6 +1030,7 @@ bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc)
|
||||
bool current_tb_modified;
|
||||
TranslationBlock *tb;
|
||||
PageForEachNext n;
|
||||
tb_page_addr_t last;
|
||||
|
||||
/*
|
||||
* Without precise smc semantics, or when outside of a TB,
|
||||
@@ -1045,10 +1047,11 @@ bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc)
|
||||
assert_memory_lock();
|
||||
current_tb = tcg_tb_lookup(pc);
|
||||
|
||||
last = addr | ~TARGET_PAGE_MASK;
|
||||
addr &= TARGET_PAGE_MASK;
|
||||
current_tb_modified = false;
|
||||
|
||||
PAGE_FOR_EACH_TB(addr, addr + TARGET_PAGE_SIZE, unused, tb, n) {
|
||||
PAGE_FOR_EACH_TB(addr, last, unused, tb, n) {
|
||||
if (current_tb == tb &&
|
||||
(tb_cflags(current_tb) & CF_COUNT_MASK) != 1) {
|
||||
/*
|
||||
@@ -1080,11 +1083,10 @@ bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc)
|
||||
static void
|
||||
tb_invalidate_phys_page_range__locked(struct page_collection *pages,
|
||||
PageDesc *p, tb_page_addr_t start,
|
||||
tb_page_addr_t end,
|
||||
tb_page_addr_t last,
|
||||
uintptr_t retaddr)
|
||||
{
|
||||
TranslationBlock *tb;
|
||||
tb_page_addr_t tb_start, tb_end;
|
||||
PageForEachNext n;
|
||||
#ifdef TARGET_HAS_PRECISE_SMC
|
||||
bool current_tb_modified = false;
|
||||
@@ -1092,22 +1094,22 @@ tb_invalidate_phys_page_range__locked(struct page_collection *pages,
|
||||
#endif /* TARGET_HAS_PRECISE_SMC */
|
||||
|
||||
/*
|
||||
* We remove all the TBs in the range [start, end[.
|
||||
* We remove all the TBs in the range [start, last].
|
||||
* XXX: see if in some cases it could be faster to invalidate all the code
|
||||
*/
|
||||
PAGE_FOR_EACH_TB(start, end, p, tb, n) {
|
||||
PAGE_FOR_EACH_TB(start, last, p, tb, n) {
|
||||
tb_page_addr_t tb_start, tb_last;
|
||||
|
||||
/* NOTE: this is subtle as a TB may span two physical pages */
|
||||
tb_start = tb_page_addr0(tb);
|
||||
tb_last = tb_start + tb->size - 1;
|
||||
if (n == 0) {
|
||||
/* NOTE: tb_end may be after the end of the page, but
|
||||
it is not a problem */
|
||||
tb_start = tb_page_addr0(tb);
|
||||
tb_end = tb_start + tb->size;
|
||||
tb_last = MIN(tb_last, tb_start | ~TARGET_PAGE_MASK);
|
||||
} else {
|
||||
tb_start = tb_page_addr1(tb);
|
||||
tb_end = tb_start + ((tb_page_addr0(tb) + tb->size)
|
||||
& ~TARGET_PAGE_MASK);
|
||||
tb_last = tb_start + (tb_last & ~TARGET_PAGE_MASK);
|
||||
}
|
||||
if (!(tb_end <= start || tb_start >= end)) {
|
||||
if (!(tb_last < start || tb_start > last)) {
|
||||
#ifdef TARGET_HAS_PRECISE_SMC
|
||||
if (current_tb == tb &&
|
||||
(tb_cflags(current_tb) & CF_COUNT_MASK) != 1) {
|
||||
@@ -1149,7 +1151,7 @@ tb_invalidate_phys_page_range__locked(struct page_collection *pages,
|
||||
void tb_invalidate_phys_page(tb_page_addr_t addr)
|
||||
{
|
||||
struct page_collection *pages;
|
||||
tb_page_addr_t start, end;
|
||||
tb_page_addr_t start, last;
|
||||
PageDesc *p;
|
||||
|
||||
p = page_find(addr >> TARGET_PAGE_BITS);
|
||||
@@ -1158,35 +1160,37 @@ void tb_invalidate_phys_page(tb_page_addr_t addr)
|
||||
}
|
||||
|
||||
start = addr & TARGET_PAGE_MASK;
|
||||
end = start + TARGET_PAGE_SIZE;
|
||||
pages = page_collection_lock(start, end);
|
||||
tb_invalidate_phys_page_range__locked(pages, p, start, end, 0);
|
||||
last = addr | ~TARGET_PAGE_MASK;
|
||||
pages = page_collection_lock(start, last);
|
||||
tb_invalidate_phys_page_range__locked(pages, p, start, last, 0);
|
||||
page_collection_unlock(pages);
|
||||
}
|
||||
|
||||
/*
|
||||
* Invalidate all TBs which intersect with the target physical address range
|
||||
* [start;end[. NOTE: start and end may refer to *different* physical pages.
|
||||
* [start;last]. NOTE: start and end may refer to *different* physical pages.
|
||||
* 'is_cpu_write_access' should be true if called from a real cpu write
|
||||
* access: the virtual CPU will exit the current TB if code is modified inside
|
||||
* this TB.
|
||||
*/
|
||||
void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end)
|
||||
void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t last)
|
||||
{
|
||||
struct page_collection *pages;
|
||||
tb_page_addr_t next;
|
||||
tb_page_addr_t index, index_last;
|
||||
|
||||
pages = page_collection_lock(start, end);
|
||||
for (next = (start & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
|
||||
start < end;
|
||||
start = next, next += TARGET_PAGE_SIZE) {
|
||||
PageDesc *pd = page_find(start >> TARGET_PAGE_BITS);
|
||||
tb_page_addr_t bound = MIN(next, end);
|
||||
pages = page_collection_lock(start, last);
|
||||
|
||||
index_last = last >> TARGET_PAGE_BITS;
|
||||
for (index = start >> TARGET_PAGE_BITS; index <= index_last; index++) {
|
||||
PageDesc *pd = page_find(index);
|
||||
tb_page_addr_t bound;
|
||||
|
||||
if (pd == NULL) {
|
||||
continue;
|
||||
}
|
||||
assert_page_locked(pd);
|
||||
bound = (index << TARGET_PAGE_BITS) | ~TARGET_PAGE_MASK;
|
||||
bound = MIN(bound, last);
|
||||
tb_invalidate_phys_page_range__locked(pages, pd, start, bound, 0);
|
||||
}
|
||||
page_collection_unlock(pages);
|
||||
@@ -1207,7 +1211,7 @@ static void tb_invalidate_phys_page_fast__locked(struct page_collection *pages,
|
||||
}
|
||||
|
||||
assert_page_locked(p);
|
||||
tb_invalidate_phys_page_range__locked(pages, p, start, start + len, ra);
|
||||
tb_invalidate_phys_page_range__locked(pages, p, start, start + len - 1, ra);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1221,7 +1225,7 @@ void tb_invalidate_phys_range_fast(ram_addr_t ram_addr,
|
||||
{
|
||||
struct page_collection *pages;
|
||||
|
||||
pages = page_collection_lock(ram_addr, ram_addr + size);
|
||||
pages = page_collection_lock(ram_addr, ram_addr + size - 1);
|
||||
tb_invalidate_phys_page_fast__locked(pages, ram_addr, size, retaddr);
|
||||
page_collection_unlock(pages);
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ void tcg_cpu_init_cflags(CPUState *cpu, bool parallel)
|
||||
|
||||
cflags |= parallel ? CF_PARALLEL : 0;
|
||||
cflags |= icount_enabled() ? CF_USE_ICOUNT : 0;
|
||||
cpu->tcg_cflags = cflags;
|
||||
cpu->tcg_cflags |= cflags;
|
||||
}
|
||||
|
||||
void tcg_cpus_destroy(CPUState *cpu)
|
||||
|
@@ -572,7 +572,7 @@ void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr)
|
||||
cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
|
||||
addr = get_page_addr_code(env, pc);
|
||||
if (addr != -1) {
|
||||
tb_invalidate_phys_range(addr, addr + 1);
|
||||
tb_invalidate_phys_range(addr, addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -480,24 +480,22 @@ static bool pageflags_set_clear(target_ulong start, target_ulong last,
|
||||
* The flag PAGE_WRITE_ORG is positioned automatically depending
|
||||
* on PAGE_WRITE. The mmap_lock should already be held.
|
||||
*/
|
||||
void page_set_flags(target_ulong start, target_ulong end, int flags)
|
||||
void page_set_flags(target_ulong start, target_ulong last, int flags)
|
||||
{
|
||||
target_ulong last;
|
||||
bool reset = false;
|
||||
bool inval_tb = false;
|
||||
|
||||
/* This function should never be called with addresses outside the
|
||||
guest address space. If this assert fires, it probably indicates
|
||||
a missing call to h2g_valid. */
|
||||
assert(start < end);
|
||||
assert(end - 1 <= GUEST_ADDR_MAX);
|
||||
assert(start <= last);
|
||||
assert(last <= GUEST_ADDR_MAX);
|
||||
/* Only set PAGE_ANON with new mappings. */
|
||||
assert(!(flags & PAGE_ANON) || (flags & PAGE_RESET));
|
||||
assert_memory_lock();
|
||||
|
||||
start = start & TARGET_PAGE_MASK;
|
||||
end = TARGET_PAGE_ALIGN(end);
|
||||
last = end - 1;
|
||||
start &= TARGET_PAGE_MASK;
|
||||
last |= ~TARGET_PAGE_MASK;
|
||||
|
||||
if (!(flags & PAGE_VALID)) {
|
||||
flags = 0;
|
||||
@@ -510,7 +508,7 @@ void page_set_flags(target_ulong start, target_ulong end, int flags)
|
||||
}
|
||||
|
||||
if (!flags || reset) {
|
||||
page_reset_target_data(start, end);
|
||||
page_reset_target_data(start, last);
|
||||
inval_tb |= pageflags_unset(start, last);
|
||||
}
|
||||
if (flags) {
|
||||
@@ -518,7 +516,7 @@ void page_set_flags(target_ulong start, target_ulong end, int flags)
|
||||
~(reset ? 0 : PAGE_STICKY));
|
||||
}
|
||||
if (inval_tb) {
|
||||
tb_invalidate_phys_range(start, end);
|
||||
tb_invalidate_phys_range(start, last);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -816,15 +814,14 @@ typedef struct TargetPageDataNode {
|
||||
|
||||
static IntervalTreeRoot targetdata_root;
|
||||
|
||||
void page_reset_target_data(target_ulong start, target_ulong end)
|
||||
void page_reset_target_data(target_ulong start, target_ulong last)
|
||||
{
|
||||
IntervalTreeNode *n, *next;
|
||||
target_ulong last;
|
||||
|
||||
assert_memory_lock();
|
||||
|
||||
start = start & TARGET_PAGE_MASK;
|
||||
last = TARGET_PAGE_ALIGN(end) - 1;
|
||||
start &= TARGET_PAGE_MASK;
|
||||
last |= ~TARGET_PAGE_MASK;
|
||||
|
||||
for (n = interval_tree_iter_first(&targetdata_root, start, last),
|
||||
next = n ? interval_tree_iter_next(n, start, last) : NULL;
|
||||
@@ -887,7 +884,7 @@ void *page_get_target_data(target_ulong address)
|
||||
return t->data[(page - region) >> TARGET_PAGE_BITS];
|
||||
}
|
||||
#else
|
||||
void page_reset_target_data(target_ulong start, target_ulong end) { }
|
||||
void page_reset_target_data(target_ulong start, target_ulong last) { }
|
||||
#endif /* TARGET_PAGE_DATA_SIZE */
|
||||
|
||||
/* The softmmu versions of these helpers are in cputlb.c. */
|
||||
|
@@ -32,28 +32,13 @@ xendevicemodel_handle *xen_dmod;
|
||||
|
||||
static void xenstore_record_dm_state(const char *state)
|
||||
{
|
||||
struct xs_handle *xs;
|
||||
char path[50];
|
||||
|
||||
/* We now have everything we need to set the xenstore entry. */
|
||||
xs = xs_open(0);
|
||||
if (xs == NULL) {
|
||||
fprintf(stderr, "Could not contact XenStore\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
snprintf(path, sizeof (path), "device-model/%u/state", xen_domid);
|
||||
/*
|
||||
* This call may fail when running restricted so don't make it fatal in
|
||||
* that case. Toolstacks should instead use QMP to listen for state changes.
|
||||
*/
|
||||
if (!xs_write(xs, XBT_NULL, path, state, strlen(state)) &&
|
||||
!xen_domid_restrict) {
|
||||
if (!qemu_xen_xs_write(xenstore, XBT_NULL, path, state, strlen(state))) {
|
||||
error_report("error recording dm state");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
xs_close(xs);
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +96,15 @@ static int xen_init(MachineState *ms)
|
||||
xc_interface_close(xen_xc);
|
||||
return -1;
|
||||
}
|
||||
qemu_add_vm_change_state_handler(xen_change_state_handler, NULL);
|
||||
|
||||
/*
|
||||
* The XenStore write would fail when running restricted so don't attempt
|
||||
* it in that case. Toolstacks should instead use QMP to listen for state
|
||||
* changes.
|
||||
*/
|
||||
if (!xen_domid_restrict) {
|
||||
qemu_add_vm_change_state_handler(xen_change_state_handler, NULL);
|
||||
}
|
||||
/*
|
||||
* opt out of system RAM being allocated by generic code
|
||||
*/
|
||||
|
34
block.c
34
block.c
@@ -4918,6 +4918,7 @@ static void bdrv_reopen_commit(BDRVReopenState *reopen_state)
|
||||
qdict_del(bs->options, "backing");
|
||||
|
||||
bdrv_refresh_limits(bs, NULL, NULL);
|
||||
bdrv_refresh_total_sectors(bs, bs->total_sectors);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5849,7 +5850,7 @@ int64_t coroutine_fn bdrv_co_nb_sectors(BlockDriverState *bs)
|
||||
if (!drv)
|
||||
return -ENOMEDIUM;
|
||||
|
||||
if (drv->has_variable_length) {
|
||||
if (bs->bl.has_variable_length) {
|
||||
int ret = bdrv_co_refresh_total_sectors(bs, bs->total_sectors);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
@@ -5858,6 +5859,28 @@ int64_t coroutine_fn bdrv_co_nb_sectors(BlockDriverState *bs)
|
||||
return bs->total_sectors;
|
||||
}
|
||||
|
||||
/*
|
||||
* This wrapper is written by hand because this function is in the hot I/O path,
|
||||
* via blk_get_geometry.
|
||||
*/
|
||||
int64_t coroutine_mixed_fn bdrv_nb_sectors(BlockDriverState *bs)
|
||||
{
|
||||
BlockDriver *drv = bs->drv;
|
||||
IO_CODE();
|
||||
|
||||
if (!drv)
|
||||
return -ENOMEDIUM;
|
||||
|
||||
if (bs->bl.has_variable_length) {
|
||||
int ret = bdrv_refresh_total_sectors(bs, bs->total_sectors);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return bs->total_sectors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return length in bytes on success, -errno on error.
|
||||
* The length is always a multiple of BDRV_SECTOR_SIZE.
|
||||
@@ -5878,15 +5901,6 @@ int64_t coroutine_fn bdrv_co_getlength(BlockDriverState *bs)
|
||||
return ret * BDRV_SECTOR_SIZE;
|
||||
}
|
||||
|
||||
/* return 0 as number of sectors if no device present or error */
|
||||
void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr)
|
||||
{
|
||||
int64_t nb_sectors = bdrv_nb_sectors(bs);
|
||||
IO_CODE();
|
||||
|
||||
*nb_sectors_ptr = nb_sectors < 0 ? 0 : nb_sectors;
|
||||
}
|
||||
|
||||
bool bdrv_is_sg(BlockDriverState *bs)
|
||||
{
|
||||
IO_CODE();
|
||||
|
@@ -1615,26 +1615,53 @@ int64_t coroutine_fn blk_co_getlength(BlockBackend *blk)
|
||||
return bdrv_co_getlength(blk_bs(blk));
|
||||
}
|
||||
|
||||
void blk_get_geometry(BlockBackend *blk, uint64_t *nb_sectors_ptr)
|
||||
{
|
||||
IO_CODE();
|
||||
if (!blk_bs(blk)) {
|
||||
*nb_sectors_ptr = 0;
|
||||
} else {
|
||||
bdrv_get_geometry(blk_bs(blk), nb_sectors_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
int64_t coroutine_fn blk_co_nb_sectors(BlockBackend *blk)
|
||||
{
|
||||
BlockDriverState *bs = blk_bs(blk);
|
||||
|
||||
IO_CODE();
|
||||
GRAPH_RDLOCK_GUARD();
|
||||
|
||||
if (!blk_co_is_available(blk)) {
|
||||
if (!bs) {
|
||||
return -ENOMEDIUM;
|
||||
} else {
|
||||
return bdrv_co_nb_sectors(bs);
|
||||
}
|
||||
}
|
||||
|
||||
return bdrv_co_nb_sectors(blk_bs(blk));
|
||||
/*
|
||||
* This wrapper is written by hand because this function is in the hot I/O path,
|
||||
* via blk_get_geometry.
|
||||
*/
|
||||
int64_t coroutine_mixed_fn blk_nb_sectors(BlockBackend *blk)
|
||||
{
|
||||
BlockDriverState *bs = blk_bs(blk);
|
||||
|
||||
IO_CODE();
|
||||
|
||||
if (!bs) {
|
||||
return -ENOMEDIUM;
|
||||
} else {
|
||||
return bdrv_nb_sectors(bs);
|
||||
}
|
||||
}
|
||||
|
||||
/* return 0 as number of sectors if no device present or error */
|
||||
void coroutine_fn blk_co_get_geometry(BlockBackend *blk,
|
||||
uint64_t *nb_sectors_ptr)
|
||||
{
|
||||
int64_t ret = blk_co_nb_sectors(blk);
|
||||
*nb_sectors_ptr = ret < 0 ? 0 : ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* This wrapper is written by hand because this function is in the hot I/O path.
|
||||
*/
|
||||
void coroutine_mixed_fn blk_get_geometry(BlockBackend *blk,
|
||||
uint64_t *nb_sectors_ptr)
|
||||
{
|
||||
int64_t ret = blk_nb_sectors(blk);
|
||||
*nb_sectors_ptr = ret < 0 ? 0 : ret;
|
||||
}
|
||||
|
||||
BlockAIOCB *blk_aio_preadv(BlockBackend *blk, int64_t offset,
|
||||
|
@@ -259,7 +259,6 @@ static BlockDriver bdrv_copy_on_read = {
|
||||
.bdrv_co_eject = cor_co_eject,
|
||||
.bdrv_co_lock_medium = cor_co_lock_medium,
|
||||
|
||||
.has_variable_length = true,
|
||||
.is_filter = true,
|
||||
};
|
||||
|
||||
|
@@ -23,7 +23,12 @@
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include "dmg.h"
|
||||
|
||||
/* Work around a -Wstrict-prototypes warning in LZFSE headers */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
|
||||
#include <lzfse.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
static int dmg_uncompress_lzfse_do(char *next_in, unsigned int avail_in,
|
||||
char *next_out, unsigned int avail_out)
|
||||
|
@@ -22,8 +22,9 @@ struct virtio_blk_inhdr {
|
||||
unsigned char status;
|
||||
};
|
||||
|
||||
static bool virtio_blk_sect_range_ok(BlockBackend *blk, uint32_t block_size,
|
||||
uint64_t sector, size_t size)
|
||||
static bool coroutine_fn
|
||||
virtio_blk_sect_range_ok(BlockBackend *blk, uint32_t block_size,
|
||||
uint64_t sector, size_t size)
|
||||
{
|
||||
uint64_t nb_sectors;
|
||||
uint64_t total_sectors;
|
||||
@@ -41,7 +42,7 @@ static bool virtio_blk_sect_range_ok(BlockBackend *blk, uint32_t block_size,
|
||||
if ((sector << VIRTIO_BLK_SECTOR_BITS) % block_size) {
|
||||
return false;
|
||||
}
|
||||
blk_get_geometry(blk, &total_sectors);
|
||||
blk_co_get_geometry(blk, &total_sectors);
|
||||
if (sector > total_sectors || nb_sectors > total_sectors - sector) {
|
||||
return false;
|
||||
}
|
||||
|
@@ -3743,6 +3743,12 @@ static void cdrom_parse_filename(const char *filename, QDict *options,
|
||||
{
|
||||
bdrv_parse_filename_strip_prefix(filename, "host_cdrom:", options);
|
||||
}
|
||||
|
||||
static void cdrom_refresh_limits(BlockDriverState *bs, Error **errp)
|
||||
{
|
||||
bs->bl.has_variable_length = true;
|
||||
raw_refresh_limits(bs, errp);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
@@ -3838,14 +3844,13 @@ static BlockDriver bdrv_host_cdrom = {
|
||||
.bdrv_co_preadv = raw_co_preadv,
|
||||
.bdrv_co_pwritev = raw_co_pwritev,
|
||||
.bdrv_co_flush_to_disk = raw_co_flush_to_disk,
|
||||
.bdrv_refresh_limits = raw_refresh_limits,
|
||||
.bdrv_refresh_limits = cdrom_refresh_limits,
|
||||
.bdrv_co_io_plug = raw_co_io_plug,
|
||||
.bdrv_co_io_unplug = raw_co_io_unplug,
|
||||
.bdrv_attach_aio_context = raw_aio_attach_aio_context,
|
||||
|
||||
.bdrv_co_truncate = raw_co_truncate,
|
||||
.bdrv_co_getlength = raw_co_getlength,
|
||||
.has_variable_length = true,
|
||||
.bdrv_co_get_allocated_file_size = raw_co_get_allocated_file_size,
|
||||
|
||||
/* removable device support */
|
||||
@@ -3967,14 +3972,13 @@ static BlockDriver bdrv_host_cdrom = {
|
||||
.bdrv_co_preadv = raw_co_preadv,
|
||||
.bdrv_co_pwritev = raw_co_pwritev,
|
||||
.bdrv_co_flush_to_disk = raw_co_flush_to_disk,
|
||||
.bdrv_refresh_limits = raw_refresh_limits,
|
||||
.bdrv_refresh_limits = cdrom_refresh_limits,
|
||||
.bdrv_co_io_plug = raw_co_io_plug,
|
||||
.bdrv_co_io_unplug = raw_co_io_unplug,
|
||||
.bdrv_attach_aio_context = raw_aio_attach_aio_context,
|
||||
|
||||
.bdrv_co_truncate = raw_co_truncate,
|
||||
.bdrv_co_getlength = raw_co_getlength,
|
||||
.has_variable_length = true,
|
||||
.bdrv_co_get_allocated_file_size = raw_co_get_allocated_file_size,
|
||||
|
||||
/* removable device support */
|
||||
|
@@ -838,6 +838,7 @@ static void hdev_refresh_limits(BlockDriverState *bs, Error **errp)
|
||||
{
|
||||
/* XXX Does Windows support AIO on less than 512-byte alignment? */
|
||||
bs->bl.request_alignment = 512;
|
||||
bs->bl.has_variable_length = true;
|
||||
}
|
||||
|
||||
static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
@@ -933,7 +934,6 @@ static BlockDriver bdrv_host_device = {
|
||||
.bdrv_attach_aio_context = raw_attach_aio_context,
|
||||
|
||||
.bdrv_co_getlength = raw_co_getlength,
|
||||
.has_variable_length = true,
|
||||
.bdrv_co_get_allocated_file_size = raw_co_get_allocated_file_size,
|
||||
};
|
||||
|
||||
|
@@ -146,7 +146,6 @@ static BlockDriver bdrv_compress = {
|
||||
.bdrv_co_eject = compress_co_eject,
|
||||
.bdrv_co_lock_medium = compress_co_lock_medium,
|
||||
|
||||
.has_variable_length = true,
|
||||
.is_filter = true,
|
||||
};
|
||||
|
||||
|
@@ -190,6 +190,10 @@ void bdrv_refresh_limits(BlockDriverState *bs, Transaction *tran, Error **errp)
|
||||
bdrv_merge_limits(&bs->bl, &c->bs->bl);
|
||||
have_limits = true;
|
||||
}
|
||||
|
||||
if (c->role & BDRV_CHILD_FILTERED) {
|
||||
bs->bl.has_variable_length |= c->bs->bl.has_variable_length;
|
||||
}
|
||||
}
|
||||
|
||||
if (!have_limits) {
|
||||
|
@@ -48,6 +48,7 @@
|
||||
#include "qemu/option.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "monitor/monitor.h"
|
||||
#include "monitor/hmp.h"
|
||||
|
24
block/nfs.c
24
block/nfs.c
@@ -726,10 +726,8 @@ nfs_get_allocated_file_size_cb(int ret, struct nfs_context *nfs, void *data,
|
||||
if (task->ret < 0) {
|
||||
error_report("NFS Error: %s", nfs_get_error(nfs));
|
||||
}
|
||||
|
||||
/* Set task->complete before reading bs->wakeup. */
|
||||
qatomic_mb_set(&task->complete, 1);
|
||||
bdrv_wakeup(task->bs);
|
||||
replay_bh_schedule_oneshot_event(task->client->aio_context,
|
||||
nfs_co_generic_bh_cb, task);
|
||||
}
|
||||
|
||||
static int64_t coroutine_fn nfs_co_get_allocated_file_size(BlockDriverState *bs)
|
||||
@@ -743,15 +741,19 @@ static int64_t coroutine_fn nfs_co_get_allocated_file_size(BlockDriverState *bs)
|
||||
return client->st_blocks * 512;
|
||||
}
|
||||
|
||||
task.bs = bs;
|
||||
nfs_co_init_task(bs, &task);
|
||||
task.st = &st;
|
||||
if (nfs_fstat_async(client->context, client->fh, nfs_get_allocated_file_size_cb,
|
||||
&task) != 0) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
WITH_QEMU_LOCK_GUARD(&client->mutex) {
|
||||
if (nfs_fstat_async(client->context, client->fh, nfs_get_allocated_file_size_cb,
|
||||
&task) != 0) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
nfs_set_events(client);
|
||||
BDRV_POLL_WHILE(bs, !task.complete);
|
||||
nfs_set_events(client);
|
||||
}
|
||||
while (!task.complete) {
|
||||
qemu_coroutine_yield();
|
||||
}
|
||||
|
||||
return (task.ret < 0 ? task.ret : st.st_blocks * 512);
|
||||
}
|
||||
|
@@ -558,7 +558,6 @@ BlockDriver bdrv_preallocate_filter = {
|
||||
.bdrv_set_perm = preallocate_set_perm,
|
||||
.bdrv_child_perm = preallocate_child_perm,
|
||||
|
||||
.has_variable_length = true,
|
||||
.is_filter = true,
|
||||
};
|
||||
|
||||
|
@@ -377,6 +377,8 @@ raw_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||
|
||||
static void raw_refresh_limits(BlockDriverState *bs, Error **errp)
|
||||
{
|
||||
bs->bl.has_variable_length = bs->file->bs->bl.has_variable_length;
|
||||
|
||||
if (bs->probed) {
|
||||
/* To make it easier to protect the first sector, any probed
|
||||
* image is restricted to read-modify-write on sub-sector
|
||||
@@ -623,7 +625,6 @@ BlockDriver bdrv_raw = {
|
||||
.bdrv_co_truncate = &raw_co_truncate,
|
||||
.bdrv_co_getlength = &raw_co_getlength,
|
||||
.is_format = true,
|
||||
.has_variable_length = true,
|
||||
.bdrv_measure = &raw_measure,
|
||||
.bdrv_co_get_info = &raw_co_get_info,
|
||||
.bdrv_refresh_limits = &raw_refresh_limits,
|
||||
|
@@ -762,7 +762,6 @@ static BlockDriver bdrv_replication = {
|
||||
|
||||
.is_filter = true,
|
||||
|
||||
.has_variable_length = true,
|
||||
.strong_runtime_opts = replication_strong_runtime_opts,
|
||||
};
|
||||
|
||||
|
@@ -981,7 +981,7 @@ static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s,
|
||||
sector_write = merged_sector;
|
||||
} else if (i == sectors - 1 && trailing_length) {
|
||||
/* partial sector at the end of the buffer */
|
||||
ret = bdrv_pread(bs->file, file_offset,
|
||||
ret = bdrv_pread(bs->file, file_offset + trailing_length,
|
||||
VHDX_LOG_SECTOR_SIZE - trailing_length,
|
||||
merged_sector + trailing_length, 0);
|
||||
if (ret < 0) {
|
||||
|
@@ -68,13 +68,9 @@ bool have_guest_base;
|
||||
# if HOST_LONG_BITS > TARGET_VIRT_ADDR_SPACE_BITS
|
||||
# if TARGET_VIRT_ADDR_SPACE_BITS == 32 && \
|
||||
(TARGET_LONG_BITS == 32 || defined(TARGET_ABI32))
|
||||
/*
|
||||
* There are a number of places where we assign reserved_va to a variable
|
||||
* of type abi_ulong and expect it to fit. Avoid the last page.
|
||||
*/
|
||||
# define MAX_RESERVED_VA (0xfffffffful & TARGET_PAGE_MASK)
|
||||
# define MAX_RESERVED_VA 0xfffffffful
|
||||
# else
|
||||
# define MAX_RESERVED_VA (1ul << TARGET_VIRT_ADDR_SPACE_BITS)
|
||||
# define MAX_RESERVED_VA ((1ul << TARGET_VIRT_ADDR_SPACE_BITS) - 1)
|
||||
# endif
|
||||
# else
|
||||
# define MAX_RESERVED_VA 0
|
||||
@@ -466,7 +462,7 @@ int main(int argc, char **argv)
|
||||
envlist_free(envlist);
|
||||
|
||||
if (reserved_va) {
|
||||
mmap_next_start = reserved_va;
|
||||
mmap_next_start = reserved_va + 1;
|
||||
}
|
||||
|
||||
{
|
||||
|
@@ -118,7 +118,7 @@ int target_mprotect(abi_ulong start, abi_ulong len, int prot)
|
||||
if (ret != 0)
|
||||
goto error;
|
||||
}
|
||||
page_set_flags(start, start + len, prot | PAGE_VALID);
|
||||
page_set_flags(start, start + len - 1, prot | PAGE_VALID);
|
||||
mmap_unlock();
|
||||
return 0;
|
||||
error:
|
||||
@@ -234,7 +234,7 @@ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size,
|
||||
size = HOST_PAGE_ALIGN(size) + alignment;
|
||||
end_addr = start + size;
|
||||
if (end_addr > reserved_va) {
|
||||
end_addr = reserved_va;
|
||||
end_addr = reserved_va + 1;
|
||||
}
|
||||
addr = end_addr - qemu_host_page_size;
|
||||
|
||||
@@ -243,7 +243,7 @@ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size,
|
||||
if (looped) {
|
||||
return (abi_ulong)-1;
|
||||
}
|
||||
end_addr = reserved_va;
|
||||
end_addr = reserved_va + 1;
|
||||
addr = end_addr - qemu_host_page_size;
|
||||
looped = 1;
|
||||
continue;
|
||||
@@ -656,7 +656,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
|
||||
}
|
||||
}
|
||||
the_end1:
|
||||
page_set_flags(start, start + len, prot | PAGE_VALID);
|
||||
page_set_flags(start, start + len - 1, prot | PAGE_VALID);
|
||||
the_end:
|
||||
#ifdef DEBUG_MMAP
|
||||
printf("ret=0x" TARGET_ABI_FMT_lx "\n", start);
|
||||
@@ -767,7 +767,7 @@ int target_munmap(abi_ulong start, abi_ulong len)
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
page_set_flags(start, start + len, 0);
|
||||
page_set_flags(start, start + len - 1, 0);
|
||||
}
|
||||
mmap_unlock();
|
||||
return ret;
|
||||
|
15
configure
vendored
15
configure
vendored
@@ -231,6 +231,7 @@ safe_stack=""
|
||||
use_containers="yes"
|
||||
gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
|
||||
gdb_arches=""
|
||||
glib_has_gslice="no"
|
||||
|
||||
if test -e "$source_path/.git"
|
||||
then
|
||||
@@ -1494,6 +1495,17 @@ for i in $glib_modules; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Check whether glib has gslice, which we have to avoid for correctness.
|
||||
# TODO: remove this check and the corresponding workaround (qtree) when
|
||||
# the minimum supported glib is >= $glib_dropped_gslice_version.
|
||||
glib_dropped_gslice_version=2.75.3
|
||||
for i in $glib_modules; do
|
||||
if ! $pkg_config --atleast-version=$glib_dropped_gslice_version $i; then
|
||||
glib_has_gslice="yes"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
glib_bindir="$($pkg_config --variable=bindir glib-2.0)"
|
||||
if test -z "$glib_bindir" ; then
|
||||
glib_bindir="$($pkg_config --variable=prefix glib-2.0)"/bin
|
||||
@@ -2420,6 +2432,9 @@ echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
|
||||
echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
|
||||
echo "GLIB_BINDIR=$glib_bindir" >> $config_host_mak
|
||||
echo "GLIB_VERSION=$($pkg_config --modversion glib-2.0)" >> $config_host_mak
|
||||
if test "$glib_has_gslice" = "yes" ; then
|
||||
echo "HAVE_GLIB_WITH_SLICE_ALLOCATOR=y" >> $config_host_mak
|
||||
fi
|
||||
echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
|
||||
echo "EXESUF=$EXESUF" >> $config_host_mak
|
||||
|
||||
|
@@ -4,7 +4,12 @@
|
||||
# This maps email domains to nice easy to read company names
|
||||
#
|
||||
|
||||
linux.alibaba.com Alibaba
|
||||
amazon.com Amazon
|
||||
amazon.co.uk Amazon
|
||||
amazon.de Amazon
|
||||
amd.com AMD
|
||||
aspeedtech.com ASPEED Technology Inc.
|
||||
baidu.com Baidu
|
||||
bytedance.com ByteDance
|
||||
cmss.chinamobile.com China Mobile
|
||||
@@ -32,17 +37,18 @@ oracle.com Oracle
|
||||
proxmox.com Proxmox
|
||||
quicinc.com Qualcomm Innovation Center
|
||||
redhat.com Red Hat
|
||||
rev.ng rev.ng Labs
|
||||
rt-rk.com RT-RK
|
||||
samsung.com Samsung
|
||||
siemens.com Siemens
|
||||
sifive.com SiFive
|
||||
suse.com SUSE
|
||||
suse.de SUSE
|
||||
syrmia.com SYRMIA
|
||||
ventanamicro.com Ventana Micro Systems
|
||||
virtuozzo.com Virtuozzo
|
||||
vrull.eu VRULL
|
||||
wdc.com Western Digital
|
||||
windriver.com Wind River
|
||||
xilinx.com Xilinx
|
||||
yadro.com YADRO
|
||||
yandex-team.ru Yandex
|
||||
|
7
contrib/gitdm/group-map-alibaba
Normal file
7
contrib/gitdm/group-map-alibaba
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# Alibaba contributors including its subsidiaries
|
||||
#
|
||||
|
||||
# c-sky.com, now part of T-Head, wholly-owned entity of Alibaba Group
|
||||
ren_guo@c-sky.com
|
||||
zhiwei_liu@c-sky.com
|
8
contrib/gitdm/group-map-amd
Normal file
8
contrib/gitdm/group-map-amd
Normal file
@@ -0,0 +1,8 @@
|
||||
# AMD acquired Xilinx and contributors have been slowly updating emails
|
||||
|
||||
edgar.iglesias@xilinx.com
|
||||
fnu.vikram@xilinx.com
|
||||
francisco.iglesias@xilinx.com
|
||||
sai.pavan.boddu@xilinx.com
|
||||
stefano.stabellini@xilinx.com
|
||||
tong.ho@xilinx.com
|
@@ -38,3 +38,7 @@ paul@nowt.org
|
||||
git@xen0n.name
|
||||
simon@simonsafar.com
|
||||
research_trasio@irq.a4lg.com
|
||||
shentey@gmail.com
|
||||
bmeng@tinylab.org
|
||||
strahinja.p.jankovic@gmail.com
|
||||
Jason@zx2c4.com
|
||||
|
1
cpu.c
1
cpu.c
@@ -42,6 +42,7 @@
|
||||
#include "hw/core/accel-cpu.h"
|
||||
#include "trace/trace-root.h"
|
||||
#include "qemu/accel.h"
|
||||
#include "qemu/plugin.h"
|
||||
|
||||
uintptr_t qemu_host_page_size;
|
||||
intptr_t qemu_host_page_mask;
|
||||
|
@@ -206,15 +206,6 @@ be an effective use of its limited resources, and thus intends to discontinue
|
||||
it. Since all recent x86 hardware from the past >10 years is capable of the
|
||||
64-bit x86 extensions, a corresponding 64-bit OS should be used instead.
|
||||
|
||||
System emulation on 32-bit arm hosts (since 8.0)
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
Since QEMU needs a strong host machine for running full system emulation, and
|
||||
all recent powerful arm hosts support 64-bit, the QEMU project deprecates the
|
||||
support for running any system emulation on 32-bit arm hosts in general. Use
|
||||
64-bit arm hosts for system emulation instead. (Note: "user" mode emulation
|
||||
continues to be supported on 32-bit arm hosts, too)
|
||||
|
||||
|
||||
QEMU API (QAPI) events
|
||||
----------------------
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include "qapi/qapi-commands-dump.h"
|
||||
#include "qapi/qapi-events-dump.h"
|
||||
#include "qapi/qmp/qerror.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/main-loop.h"
|
||||
#include "hw/misc/vmcoreinfo.h"
|
||||
#include "migration/blocker.h"
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "sysemu/dump.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/qmp/qerror.h"
|
||||
#include "exec/cpu-defs.h"
|
||||
#include "hw/core/cpu.h"
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "qemu/ctype.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "trace.h"
|
||||
#include "exec/gdbstub.h"
|
||||
#include "gdbstub/syscalls.h"
|
||||
@@ -1467,7 +1468,7 @@ static void handle_query_supported(GArray *params, void *user_ctx)
|
||||
";ReverseStep+;ReverseContinue+");
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USER_ONLY
|
||||
#if defined(CONFIG_USER_ONLY) && defined(CONFIG_LINUX)
|
||||
if (gdbserver_state.c_cpu->opaque) {
|
||||
g_string_append(gdbserver_state.str_buf, ";qXfer:auxv:read+");
|
||||
}
|
||||
|
@@ -20,11 +20,13 @@ gdb_softmmu_ss = gdb_softmmu_ss.apply(config_host, strict: false)
|
||||
libgdb_user = static_library('gdb_user',
|
||||
gdb_user_ss.sources() + genh,
|
||||
name_suffix: 'fa',
|
||||
c_args: '-DCONFIG_USER_ONLY')
|
||||
c_args: '-DCONFIG_USER_ONLY',
|
||||
build_by_default: have_user)
|
||||
|
||||
libgdb_softmmu = static_library('gdb_softmmu',
|
||||
gdb_softmmu_ss.sources() + genh,
|
||||
name_suffix: 'fa')
|
||||
name_suffix: 'fa',
|
||||
build_by_default: have_system)
|
||||
|
||||
gdb_user = declare_dependency(link_whole: libgdb_user)
|
||||
user_ss.add(gdb_user)
|
||||
|
@@ -31,6 +31,8 @@ EmailMap contrib/gitdm/domain-map
|
||||
# identifiable corporate emails. Please keep this list sorted.
|
||||
#
|
||||
|
||||
GroupMap contrib/gitdm/group-map-alibaba Alibaba
|
||||
GroupMap contrib/gitdm/group-map-amd AMD
|
||||
GroupMap contrib/gitdm/group-map-cadence Cadence Design Systems
|
||||
GroupMap contrib/gitdm/group-map-codeweavers CodeWeavers
|
||||
GroupMap contrib/gitdm/group-map-facebook Facebook
|
||||
|
@@ -689,7 +689,10 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
|
||||
qemu_register_reset_nosnapshotload(qemu_fdt_randomize_seeds,
|
||||
rom_ptr_for_as(as, addr, size));
|
||||
|
||||
g_free(fdt);
|
||||
if (fdt != ms->fdt) {
|
||||
g_free(ms->fdt);
|
||||
ms->fdt = fdt;
|
||||
}
|
||||
|
||||
return size;
|
||||
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#include "exec/address-spaces.h"
|
||||
#include "cpu.h"
|
||||
#include "qom/object.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
|
||||
#define RAM_SIZE (512 * MiB)
|
||||
#define FLASH_SIZE (32 * MiB)
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "hw/boards.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/arm/allwinner-a10.h"
|
||||
|
@@ -37,6 +37,8 @@
|
||||
#include "qemu/cutils.h"
|
||||
#include "qom/object.h"
|
||||
#include "hw/net/mv88w8618_eth.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
|
||||
#define MP_MISC_BASE 0x80002000
|
||||
#define MP_MISC_SIZE 0x00001000
|
||||
|
@@ -30,6 +30,8 @@
|
||||
#include "sysemu/blockdev.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "sysemu/block-backend.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
|
||||
#define NPCM7XX_POWER_ON_STRAPS_DEFAULT ( \
|
||||
NPCM7XX_PWRON_STRAP_SPI0F18 | \
|
||||
|
@@ -45,6 +45,8 @@
|
||||
#include "hw/loader.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
|
||||
/* Nokia N8x0 support */
|
||||
struct n800_s {
|
||||
|
@@ -37,6 +37,8 @@
|
||||
#include "exec/address-spaces.h"
|
||||
#include "cpu.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Siemens SX1 Cellphone V1 */
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include "qemu/units.h"
|
||||
#include "exec/address-spaces.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "hw/boards.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/arm/allwinner-h3.h"
|
||||
|
@@ -32,6 +32,8 @@
|
||||
#include "cpu.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qom/object.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
|
||||
static uint64_t static_read(void *opaque, hwaddr offset, unsigned size)
|
||||
{
|
||||
|
@@ -601,8 +601,8 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
FD_STATE_MULTI = 0x01, /* multi track flag */
|
||||
FD_STATE_FORMAT = 0x02, /* format flag */
|
||||
FD_STATE_MULTI = 0x01, /* multi track flag */
|
||||
FD_STATE_FORMAT = 0x02, /* format flag */
|
||||
};
|
||||
|
||||
enum {
|
||||
|
208
hw/block/nand.c
208
hw/block/nand.c
@@ -30,33 +30,33 @@
|
||||
#include "qemu/module.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
# define NAND_CMD_READ0 0x00
|
||||
# define NAND_CMD_READ1 0x01
|
||||
# define NAND_CMD_READ2 0x50
|
||||
# define NAND_CMD_LPREAD2 0x30
|
||||
# define NAND_CMD_NOSERIALREAD2 0x35
|
||||
# define NAND_CMD_RANDOMREAD1 0x05
|
||||
# define NAND_CMD_RANDOMREAD2 0xe0
|
||||
# define NAND_CMD_READID 0x90
|
||||
# define NAND_CMD_RESET 0xff
|
||||
# define NAND_CMD_PAGEPROGRAM1 0x80
|
||||
# define NAND_CMD_PAGEPROGRAM2 0x10
|
||||
# define NAND_CMD_CACHEPROGRAM2 0x15
|
||||
# define NAND_CMD_BLOCKERASE1 0x60
|
||||
# define NAND_CMD_BLOCKERASE2 0xd0
|
||||
# define NAND_CMD_READSTATUS 0x70
|
||||
# define NAND_CMD_COPYBACKPRG1 0x85
|
||||
# define NAND_CMD_READ0 0x00
|
||||
# define NAND_CMD_READ1 0x01
|
||||
# define NAND_CMD_READ2 0x50
|
||||
# define NAND_CMD_LPREAD2 0x30
|
||||
# define NAND_CMD_NOSERIALREAD2 0x35
|
||||
# define NAND_CMD_RANDOMREAD1 0x05
|
||||
# define NAND_CMD_RANDOMREAD2 0xe0
|
||||
# define NAND_CMD_READID 0x90
|
||||
# define NAND_CMD_RESET 0xff
|
||||
# define NAND_CMD_PAGEPROGRAM1 0x80
|
||||
# define NAND_CMD_PAGEPROGRAM2 0x10
|
||||
# define NAND_CMD_CACHEPROGRAM2 0x15
|
||||
# define NAND_CMD_BLOCKERASE1 0x60
|
||||
# define NAND_CMD_BLOCKERASE2 0xd0
|
||||
# define NAND_CMD_READSTATUS 0x70
|
||||
# define NAND_CMD_COPYBACKPRG1 0x85
|
||||
|
||||
# define NAND_IOSTATUS_ERROR (1 << 0)
|
||||
# define NAND_IOSTATUS_PLANE0 (1 << 1)
|
||||
# define NAND_IOSTATUS_PLANE1 (1 << 2)
|
||||
# define NAND_IOSTATUS_PLANE2 (1 << 3)
|
||||
# define NAND_IOSTATUS_PLANE3 (1 << 4)
|
||||
# define NAND_IOSTATUS_ERROR (1 << 0)
|
||||
# define NAND_IOSTATUS_PLANE0 (1 << 1)
|
||||
# define NAND_IOSTATUS_PLANE1 (1 << 2)
|
||||
# define NAND_IOSTATUS_PLANE2 (1 << 3)
|
||||
# define NAND_IOSTATUS_PLANE3 (1 << 4)
|
||||
# define NAND_IOSTATUS_READY (1 << 6)
|
||||
# define NAND_IOSTATUS_UNPROTCT (1 << 7)
|
||||
# define NAND_IOSTATUS_UNPROTCT (1 << 7)
|
||||
|
||||
# define MAX_PAGE 0x800
|
||||
# define MAX_OOB 0x40
|
||||
# define MAX_PAGE 0x800
|
||||
# define MAX_OOB 0x40
|
||||
|
||||
typedef struct NANDFlashState NANDFlashState;
|
||||
struct NANDFlashState {
|
||||
@@ -102,40 +102,40 @@ static void mem_and(uint8_t *dest, const uint8_t *src, size_t n)
|
||||
}
|
||||
}
|
||||
|
||||
# define NAND_NO_AUTOINCR 0x00000001
|
||||
# define NAND_BUSWIDTH_16 0x00000002
|
||||
# define NAND_NO_PADDING 0x00000004
|
||||
# define NAND_CACHEPRG 0x00000008
|
||||
# define NAND_COPYBACK 0x00000010
|
||||
# define NAND_IS_AND 0x00000020
|
||||
# define NAND_4PAGE_ARRAY 0x00000040
|
||||
# define NAND_NO_READRDY 0x00000100
|
||||
# define NAND_SAMSUNG_LP (NAND_NO_PADDING | NAND_COPYBACK)
|
||||
# define NAND_NO_AUTOINCR 0x00000001
|
||||
# define NAND_BUSWIDTH_16 0x00000002
|
||||
# define NAND_NO_PADDING 0x00000004
|
||||
# define NAND_CACHEPRG 0x00000008
|
||||
# define NAND_COPYBACK 0x00000010
|
||||
# define NAND_IS_AND 0x00000020
|
||||
# define NAND_4PAGE_ARRAY 0x00000040
|
||||
# define NAND_NO_READRDY 0x00000100
|
||||
# define NAND_SAMSUNG_LP (NAND_NO_PADDING | NAND_COPYBACK)
|
||||
|
||||
# define NAND_IO
|
||||
|
||||
# define PAGE(addr) ((addr) >> ADDR_SHIFT)
|
||||
# define PAGE_START(page) (PAGE(page) * (NAND_PAGE_SIZE + OOB_SIZE))
|
||||
# define PAGE_MASK ((1 << ADDR_SHIFT) - 1)
|
||||
# define OOB_SHIFT (PAGE_SHIFT - 5)
|
||||
# define OOB_SIZE (1 << OOB_SHIFT)
|
||||
# define SECTOR(addr) ((addr) >> (9 + ADDR_SHIFT - PAGE_SHIFT))
|
||||
# define SECTOR_OFFSET(addr) ((addr) & ((511 >> PAGE_SHIFT) << 8))
|
||||
# define PAGE(addr) ((addr) >> ADDR_SHIFT)
|
||||
# define PAGE_START(page) (PAGE(page) * (NAND_PAGE_SIZE + OOB_SIZE))
|
||||
# define PAGE_MASK ((1 << ADDR_SHIFT) - 1)
|
||||
# define OOB_SHIFT (PAGE_SHIFT - 5)
|
||||
# define OOB_SIZE (1 << OOB_SHIFT)
|
||||
# define SECTOR(addr) ((addr) >> (9 + ADDR_SHIFT - PAGE_SHIFT))
|
||||
# define SECTOR_OFFSET(addr) ((addr) & ((511 >> PAGE_SHIFT) << 8))
|
||||
|
||||
# define NAND_PAGE_SIZE 256
|
||||
# define PAGE_SHIFT 8
|
||||
# define PAGE_SECTORS 1
|
||||
# define ADDR_SHIFT 8
|
||||
# define NAND_PAGE_SIZE 256
|
||||
# define PAGE_SHIFT 8
|
||||
# define PAGE_SECTORS 1
|
||||
# define ADDR_SHIFT 8
|
||||
# include "nand.c"
|
||||
# define NAND_PAGE_SIZE 512
|
||||
# define PAGE_SHIFT 9
|
||||
# define PAGE_SECTORS 1
|
||||
# define ADDR_SHIFT 8
|
||||
# define NAND_PAGE_SIZE 512
|
||||
# define PAGE_SHIFT 9
|
||||
# define PAGE_SECTORS 1
|
||||
# define ADDR_SHIFT 8
|
||||
# include "nand.c"
|
||||
# define NAND_PAGE_SIZE 2048
|
||||
# define PAGE_SHIFT 11
|
||||
# define PAGE_SECTORS 4
|
||||
# define ADDR_SHIFT 16
|
||||
# define NAND_PAGE_SIZE 2048
|
||||
# define PAGE_SHIFT 11
|
||||
# define PAGE_SECTORS 4
|
||||
# define ADDR_SHIFT 16
|
||||
# include "nand.c"
|
||||
|
||||
/* Information based on Linux drivers/mtd/nand/raw/nand_ids.c */
|
||||
@@ -148,79 +148,79 @@ static const struct {
|
||||
} nand_flash_ids[0x100] = {
|
||||
[0 ... 0xff] = { 0 },
|
||||
|
||||
[0x6b] = { 4, 8, 9, 4, 0 },
|
||||
[0xe3] = { 4, 8, 9, 4, 0 },
|
||||
[0xe5] = { 4, 8, 9, 4, 0 },
|
||||
[0xd6] = { 8, 8, 9, 4, 0 },
|
||||
[0xe6] = { 8, 8, 9, 4, 0 },
|
||||
[0x6b] = { 4, 8, 9, 4, 0 },
|
||||
[0xe3] = { 4, 8, 9, 4, 0 },
|
||||
[0xe5] = { 4, 8, 9, 4, 0 },
|
||||
[0xd6] = { 8, 8, 9, 4, 0 },
|
||||
[0xe6] = { 8, 8, 9, 4, 0 },
|
||||
|
||||
[0x33] = { 16, 8, 9, 5, 0 },
|
||||
[0x73] = { 16, 8, 9, 5, 0 },
|
||||
[0x43] = { 16, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x53] = { 16, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x33] = { 16, 8, 9, 5, 0 },
|
||||
[0x73] = { 16, 8, 9, 5, 0 },
|
||||
[0x43] = { 16, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x53] = { 16, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
|
||||
[0x35] = { 32, 8, 9, 5, 0 },
|
||||
[0x75] = { 32, 8, 9, 5, 0 },
|
||||
[0x45] = { 32, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x55] = { 32, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x35] = { 32, 8, 9, 5, 0 },
|
||||
[0x75] = { 32, 8, 9, 5, 0 },
|
||||
[0x45] = { 32, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x55] = { 32, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
|
||||
[0x36] = { 64, 8, 9, 5, 0 },
|
||||
[0x76] = { 64, 8, 9, 5, 0 },
|
||||
[0x46] = { 64, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x56] = { 64, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x36] = { 64, 8, 9, 5, 0 },
|
||||
[0x76] = { 64, 8, 9, 5, 0 },
|
||||
[0x46] = { 64, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x56] = { 64, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
|
||||
[0x78] = { 128, 8, 9, 5, 0 },
|
||||
[0x39] = { 128, 8, 9, 5, 0 },
|
||||
[0x79] = { 128, 8, 9, 5, 0 },
|
||||
[0x72] = { 128, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x49] = { 128, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x74] = { 128, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x59] = { 128, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x78] = { 128, 8, 9, 5, 0 },
|
||||
[0x39] = { 128, 8, 9, 5, 0 },
|
||||
[0x79] = { 128, 8, 9, 5, 0 },
|
||||
[0x72] = { 128, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x49] = { 128, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x74] = { 128, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
[0x59] = { 128, 16, 9, 5, NAND_BUSWIDTH_16 },
|
||||
|
||||
[0x71] = { 256, 8, 9, 5, 0 },
|
||||
[0x71] = { 256, 8, 9, 5, 0 },
|
||||
|
||||
/*
|
||||
* These are the new chips with large page size. The pagesize and the
|
||||
* erasesize is determined from the extended id bytes
|
||||
*/
|
||||
# define LP_OPTIONS (NAND_SAMSUNG_LP | NAND_NO_READRDY | NAND_NO_AUTOINCR)
|
||||
# define LP_OPTIONS16 (LP_OPTIONS | NAND_BUSWIDTH_16)
|
||||
# define LP_OPTIONS (NAND_SAMSUNG_LP | NAND_NO_READRDY | NAND_NO_AUTOINCR)
|
||||
# define LP_OPTIONS16 (LP_OPTIONS | NAND_BUSWIDTH_16)
|
||||
|
||||
/* 512 Megabit */
|
||||
[0xa2] = { 64, 8, 0, 0, LP_OPTIONS },
|
||||
[0xf2] = { 64, 8, 0, 0, LP_OPTIONS },
|
||||
[0xb2] = { 64, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xc2] = { 64, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xa2] = { 64, 8, 0, 0, LP_OPTIONS },
|
||||
[0xf2] = { 64, 8, 0, 0, LP_OPTIONS },
|
||||
[0xb2] = { 64, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xc2] = { 64, 16, 0, 0, LP_OPTIONS16 },
|
||||
|
||||
/* 1 Gigabit */
|
||||
[0xa1] = { 128, 8, 0, 0, LP_OPTIONS },
|
||||
[0xf1] = { 128, 8, 0, 0, LP_OPTIONS },
|
||||
[0xb1] = { 128, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xc1] = { 128, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xa1] = { 128, 8, 0, 0, LP_OPTIONS },
|
||||
[0xf1] = { 128, 8, 0, 0, LP_OPTIONS },
|
||||
[0xb1] = { 128, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xc1] = { 128, 16, 0, 0, LP_OPTIONS16 },
|
||||
|
||||
/* 2 Gigabit */
|
||||
[0xaa] = { 256, 8, 0, 0, LP_OPTIONS },
|
||||
[0xda] = { 256, 8, 0, 0, LP_OPTIONS },
|
||||
[0xba] = { 256, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xca] = { 256, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xaa] = { 256, 8, 0, 0, LP_OPTIONS },
|
||||
[0xda] = { 256, 8, 0, 0, LP_OPTIONS },
|
||||
[0xba] = { 256, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xca] = { 256, 16, 0, 0, LP_OPTIONS16 },
|
||||
|
||||
/* 4 Gigabit */
|
||||
[0xac] = { 512, 8, 0, 0, LP_OPTIONS },
|
||||
[0xdc] = { 512, 8, 0, 0, LP_OPTIONS },
|
||||
[0xbc] = { 512, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xcc] = { 512, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xac] = { 512, 8, 0, 0, LP_OPTIONS },
|
||||
[0xdc] = { 512, 8, 0, 0, LP_OPTIONS },
|
||||
[0xbc] = { 512, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xcc] = { 512, 16, 0, 0, LP_OPTIONS16 },
|
||||
|
||||
/* 8 Gigabit */
|
||||
[0xa3] = { 1024, 8, 0, 0, LP_OPTIONS },
|
||||
[0xd3] = { 1024, 8, 0, 0, LP_OPTIONS },
|
||||
[0xb3] = { 1024, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xc3] = { 1024, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xa3] = { 1024, 8, 0, 0, LP_OPTIONS },
|
||||
[0xd3] = { 1024, 8, 0, 0, LP_OPTIONS },
|
||||
[0xb3] = { 1024, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xc3] = { 1024, 16, 0, 0, LP_OPTIONS16 },
|
||||
|
||||
/* 16 Gigabit */
|
||||
[0xa5] = { 2048, 8, 0, 0, LP_OPTIONS },
|
||||
[0xd5] = { 2048, 8, 0, 0, LP_OPTIONS },
|
||||
[0xb5] = { 2048, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xc5] = { 2048, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xa5] = { 2048, 8, 0, 0, LP_OPTIONS },
|
||||
[0xd5] = { 2048, 8, 0, 0, LP_OPTIONS },
|
||||
[0xb5] = { 2048, 16, 0, 0, LP_OPTIONS16 },
|
||||
[0xc5] = { 2048, 16, 0, 0, LP_OPTIONS16 },
|
||||
};
|
||||
|
||||
static void nand_reset(DeviceState *dev)
|
||||
@@ -812,4 +812,4 @@ static void glue(nand_init_, NAND_PAGE_SIZE)(NANDFlashState *s)
|
||||
# undef PAGE_SHIFT
|
||||
# undef PAGE_SECTORS
|
||||
# undef ADDR_SHIFT
|
||||
#endif /* NAND_IO */
|
||||
#endif /* NAND_IO */
|
||||
|
@@ -35,10 +35,10 @@
|
||||
#include "qom/object.h"
|
||||
|
||||
/* 11 for 2kB-page OneNAND ("2nd generation") and 10 for 1kB-page chips */
|
||||
#define PAGE_SHIFT 11
|
||||
#define PAGE_SHIFT 11
|
||||
|
||||
/* Fixed */
|
||||
#define BLOCK_SHIFT (PAGE_SHIFT + 6)
|
||||
#define BLOCK_SHIFT (PAGE_SHIFT + 6)
|
||||
|
||||
#define TYPE_ONE_NAND "onenand"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(OneNANDState, ONE_NAND)
|
||||
@@ -408,23 +408,23 @@ static void onenand_command(OneNANDState *s)
|
||||
int b;
|
||||
int sec;
|
||||
void *buf;
|
||||
#define SETADDR(block, page) \
|
||||
sec = (s->addr[page] & 3) + \
|
||||
((((s->addr[page] >> 2) & 0x3f) + \
|
||||
(((s->addr[block] & 0xfff) | \
|
||||
(s->addr[block] >> 15 ? \
|
||||
s->density_mask : 0)) << 6)) << (PAGE_SHIFT - 9));
|
||||
#define SETBUF_M() \
|
||||
buf = (s->bufaddr & 8) ? \
|
||||
s->data[(s->bufaddr >> 2) & 1][0] : s->boot[0]; \
|
||||
#define SETADDR(block, page) \
|
||||
sec = (s->addr[page] & 3) + \
|
||||
((((s->addr[page] >> 2) & 0x3f) + \
|
||||
(((s->addr[block] & 0xfff) | \
|
||||
(s->addr[block] >> 15 ? s->density_mask : 0)) \
|
||||
<< 6)) \
|
||||
<< (PAGE_SHIFT - 9));
|
||||
#define SETBUF_M() \
|
||||
buf = (s->bufaddr & 8) ? s->data[(s->bufaddr >> 2) & 1][0] : s->boot[0]; \
|
||||
buf += (s->bufaddr & 3) << 9;
|
||||
#define SETBUF_S() \
|
||||
buf = (s->bufaddr & 8) ? \
|
||||
s->data[(s->bufaddr >> 2) & 1][1] : s->boot[1]; \
|
||||
#define SETBUF_S() \
|
||||
buf = (s->bufaddr & 8) ? \
|
||||
s->data[(s->bufaddr >> 2) & 1][1] : s->boot[1]; \
|
||||
buf += (s->bufaddr & 3) << 4;
|
||||
|
||||
switch (s->command) {
|
||||
case 0x00: /* Load single/multiple sector data unit into buffer */
|
||||
case 0x00: /* Load single/multiple sector data unit into buffer */
|
||||
SETADDR(ONEN_BUF_BLOCK, ONEN_BUF_PAGE)
|
||||
|
||||
SETBUF_M()
|
||||
@@ -443,7 +443,7 @@ static void onenand_command(OneNANDState *s)
|
||||
*/
|
||||
s->intstatus |= ONEN_INT | ONEN_INT_LOAD;
|
||||
break;
|
||||
case 0x13: /* Load single/multiple spare sector into buffer */
|
||||
case 0x13: /* Load single/multiple spare sector into buffer */
|
||||
SETADDR(ONEN_BUF_BLOCK, ONEN_BUF_PAGE)
|
||||
|
||||
SETBUF_S()
|
||||
@@ -456,7 +456,7 @@ static void onenand_command(OneNANDState *s)
|
||||
*/
|
||||
s->intstatus |= ONEN_INT | ONEN_INT_LOAD;
|
||||
break;
|
||||
case 0x80: /* Program single/multiple sector data unit from buffer */
|
||||
case 0x80: /* Program single/multiple sector data unit from buffer */
|
||||
SETADDR(ONEN_BUF_BLOCK, ONEN_BUF_PAGE)
|
||||
|
||||
SETBUF_M()
|
||||
@@ -475,7 +475,7 @@ static void onenand_command(OneNANDState *s)
|
||||
*/
|
||||
s->intstatus |= ONEN_INT | ONEN_INT_PROG;
|
||||
break;
|
||||
case 0x1a: /* Program single/multiple spare area sector from buffer */
|
||||
case 0x1a: /* Program single/multiple spare area sector from buffer */
|
||||
SETADDR(ONEN_BUF_BLOCK, ONEN_BUF_PAGE)
|
||||
|
||||
SETBUF_S()
|
||||
@@ -488,7 +488,7 @@ static void onenand_command(OneNANDState *s)
|
||||
*/
|
||||
s->intstatus |= ONEN_INT | ONEN_INT_PROG;
|
||||
break;
|
||||
case 0x1b: /* Copy-back program */
|
||||
case 0x1b: /* Copy-back program */
|
||||
SETBUF_S()
|
||||
|
||||
SETADDR(ONEN_BUF_BLOCK, ONEN_BUF_PAGE)
|
||||
@@ -504,7 +504,7 @@ static void onenand_command(OneNANDState *s)
|
||||
s->intstatus |= ONEN_INT | ONEN_INT_PROG;
|
||||
break;
|
||||
|
||||
case 0x23: /* Unlock NAND array block(s) */
|
||||
case 0x23: /* Unlock NAND array block(s) */
|
||||
s->intstatus |= ONEN_INT;
|
||||
|
||||
/* XXX the previous (?) area should be locked automatically */
|
||||
@@ -519,7 +519,7 @@ static void onenand_command(OneNANDState *s)
|
||||
s->wpstatus = s->blockwp[b] = ONEN_LOCK_UNLOCKED;
|
||||
}
|
||||
break;
|
||||
case 0x27: /* Unlock All NAND array blocks */
|
||||
case 0x27: /* Unlock All NAND array blocks */
|
||||
s->intstatus |= ONEN_INT;
|
||||
|
||||
for (b = 0; b < s->blocks; b ++) {
|
||||
@@ -530,7 +530,7 @@ static void onenand_command(OneNANDState *s)
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x2a: /* Lock NAND array block(s) */
|
||||
case 0x2a: /* Lock NAND array block(s) */
|
||||
s->intstatus |= ONEN_INT;
|
||||
|
||||
for (b = s->unladdr[0]; b <= s->unladdr[1]; b ++) {
|
||||
@@ -544,7 +544,7 @@ static void onenand_command(OneNANDState *s)
|
||||
s->wpstatus = s->blockwp[b] = ONEN_LOCK_LOCKED;
|
||||
}
|
||||
break;
|
||||
case 0x2c: /* Lock-tight NAND array block(s) */
|
||||
case 0x2c: /* Lock-tight NAND array block(s) */
|
||||
s->intstatus |= ONEN_INT;
|
||||
|
||||
for (b = s->unladdr[0]; b <= s->unladdr[1]; b ++) {
|
||||
@@ -559,13 +559,13 @@ static void onenand_command(OneNANDState *s)
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x71: /* Erase-Verify-Read */
|
||||
case 0x71: /* Erase-Verify-Read */
|
||||
s->intstatus |= ONEN_INT;
|
||||
break;
|
||||
case 0x95: /* Multi-block erase */
|
||||
case 0x95: /* Multi-block erase */
|
||||
qemu_irq_pulse(s->intr);
|
||||
/* Fall through. */
|
||||
case 0x94: /* Block erase */
|
||||
case 0x94: /* Block erase */
|
||||
sec = ((s->addr[ONEN_BUF_BLOCK] & 0xfff) |
|
||||
(s->addr[ONEN_BUF_BLOCK] >> 15 ? s->density_mask : 0))
|
||||
<< (BLOCK_SHIFT - 9);
|
||||
@@ -574,20 +574,20 @@ static void onenand_command(OneNANDState *s)
|
||||
|
||||
s->intstatus |= ONEN_INT | ONEN_INT_ERASE;
|
||||
break;
|
||||
case 0xb0: /* Erase suspend */
|
||||
case 0xb0: /* Erase suspend */
|
||||
break;
|
||||
case 0x30: /* Erase resume */
|
||||
case 0x30: /* Erase resume */
|
||||
s->intstatus |= ONEN_INT | ONEN_INT_ERASE;
|
||||
break;
|
||||
|
||||
case 0xf0: /* Reset NAND Flash core */
|
||||
case 0xf0: /* Reset NAND Flash core */
|
||||
onenand_reset(s, 0);
|
||||
break;
|
||||
case 0xf3: /* Reset OneNAND */
|
||||
case 0xf3: /* Reset OneNAND */
|
||||
onenand_reset(s, 0);
|
||||
break;
|
||||
|
||||
case 0x65: /* OTP Access */
|
||||
case 0x65: /* OTP Access */
|
||||
s->intstatus |= ONEN_INT;
|
||||
s->blk_cur = NULL;
|
||||
s->current = s->otp;
|
||||
@@ -616,52 +616,52 @@ static uint64_t onenand_read(void *opaque, hwaddr addr,
|
||||
case 0x0000 ... 0xbffe:
|
||||
return lduw_le_p(s->boot[0] + addr);
|
||||
|
||||
case 0xf000: /* Manufacturer ID */
|
||||
case 0xf000: /* Manufacturer ID */
|
||||
return s->id.man;
|
||||
case 0xf001: /* Device ID */
|
||||
case 0xf001: /* Device ID */
|
||||
return s->id.dev;
|
||||
case 0xf002: /* Version ID */
|
||||
case 0xf002: /* Version ID */
|
||||
return s->id.ver;
|
||||
/* TODO: get the following values from a real chip! */
|
||||
case 0xf003: /* Data Buffer size */
|
||||
case 0xf003: /* Data Buffer size */
|
||||
return 1 << PAGE_SHIFT;
|
||||
case 0xf004: /* Boot Buffer size */
|
||||
case 0xf004: /* Boot Buffer size */
|
||||
return 0x200;
|
||||
case 0xf005: /* Amount of buffers */
|
||||
case 0xf005: /* Amount of buffers */
|
||||
return 1 | (2 << 8);
|
||||
case 0xf006: /* Technology */
|
||||
case 0xf006: /* Technology */
|
||||
return 0;
|
||||
|
||||
case 0xf100 ... 0xf107: /* Start addresses */
|
||||
case 0xf100 ... 0xf107: /* Start addresses */
|
||||
return s->addr[offset - 0xf100];
|
||||
|
||||
case 0xf200: /* Start buffer */
|
||||
case 0xf200: /* Start buffer */
|
||||
return (s->bufaddr << 8) | ((s->count - 1) & (1 << (PAGE_SHIFT - 10)));
|
||||
|
||||
case 0xf220: /* Command */
|
||||
case 0xf220: /* Command */
|
||||
return s->command;
|
||||
case 0xf221: /* System Configuration 1 */
|
||||
case 0xf221: /* System Configuration 1 */
|
||||
return s->config[0] & 0xffe0;
|
||||
case 0xf222: /* System Configuration 2 */
|
||||
case 0xf222: /* System Configuration 2 */
|
||||
return s->config[1];
|
||||
|
||||
case 0xf240: /* Controller Status */
|
||||
case 0xf240: /* Controller Status */
|
||||
return s->status;
|
||||
case 0xf241: /* Interrupt */
|
||||
case 0xf241: /* Interrupt */
|
||||
return s->intstatus;
|
||||
case 0xf24c: /* Unlock Start Block Address */
|
||||
case 0xf24c: /* Unlock Start Block Address */
|
||||
return s->unladdr[0];
|
||||
case 0xf24d: /* Unlock End Block Address */
|
||||
case 0xf24d: /* Unlock End Block Address */
|
||||
return s->unladdr[1];
|
||||
case 0xf24e: /* Write Protection Status */
|
||||
case 0xf24e: /* Write Protection Status */
|
||||
return s->wpstatus;
|
||||
|
||||
case 0xff00: /* ECC Status */
|
||||
case 0xff00: /* ECC Status */
|
||||
return 0x00;
|
||||
case 0xff01: /* ECC Result of main area data */
|
||||
case 0xff02: /* ECC Result of spare area data */
|
||||
case 0xff03: /* ECC Result of main area data */
|
||||
case 0xff04: /* ECC Result of spare area data */
|
||||
case 0xff01: /* ECC Result of main area data */
|
||||
case 0xff02: /* ECC Result of spare area data */
|
||||
case 0xff03: /* ECC Result of main area data */
|
||||
case 0xff04: /* ECC Result of spare area data */
|
||||
qemu_log_mask(LOG_UNIMP,
|
||||
"onenand: ECC result registers unimplemented\n");
|
||||
return 0x0000;
|
||||
@@ -696,15 +696,15 @@ static void onenand_write(void *opaque, hwaddr addr,
|
||||
}
|
||||
|
||||
switch (value) {
|
||||
case 0x00f0: /* Reset OneNAND */
|
||||
case 0x00f0: /* Reset OneNAND */
|
||||
onenand_reset(s, 0);
|
||||
break;
|
||||
|
||||
case 0x00e0: /* Load Data into Buffer */
|
||||
case 0x00e0: /* Load Data into Buffer */
|
||||
s->cycle = 1;
|
||||
break;
|
||||
|
||||
case 0x0090: /* Read Identification Data */
|
||||
case 0x0090: /* Read Identification Data */
|
||||
memset(s->boot[0], 0, 3 << s->shift);
|
||||
s->boot[0][0 << s->shift] = s->id.man & 0xff;
|
||||
s->boot[0][1 << s->shift] = s->id.dev & 0xff;
|
||||
@@ -718,11 +718,11 @@ static void onenand_write(void *opaque, hwaddr addr,
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xf100 ... 0xf107: /* Start addresses */
|
||||
case 0xf100 ... 0xf107: /* Start addresses */
|
||||
s->addr[offset - 0xf100] = value;
|
||||
break;
|
||||
|
||||
case 0xf200: /* Start buffer */
|
||||
case 0xf200: /* Start buffer */
|
||||
s->bufaddr = (value >> 8) & 0xf;
|
||||
if (PAGE_SHIFT == 11)
|
||||
s->count = (value & 3) ?: 4;
|
||||
@@ -730,36 +730,36 @@ static void onenand_write(void *opaque, hwaddr addr,
|
||||
s->count = (value & 1) ?: 2;
|
||||
break;
|
||||
|
||||
case 0xf220: /* Command */
|
||||
case 0xf220: /* Command */
|
||||
if (s->intstatus & (1 << 15))
|
||||
break;
|
||||
s->command = value;
|
||||
onenand_command(s);
|
||||
break;
|
||||
case 0xf221: /* System Configuration 1 */
|
||||
case 0xf221: /* System Configuration 1 */
|
||||
s->config[0] = value;
|
||||
onenand_intr_update(s);
|
||||
qemu_set_irq(s->rdy, (s->config[0] >> 7) & 1);
|
||||
break;
|
||||
case 0xf222: /* System Configuration 2 */
|
||||
case 0xf222: /* System Configuration 2 */
|
||||
s->config[1] = value;
|
||||
break;
|
||||
|
||||
case 0xf241: /* Interrupt */
|
||||
case 0xf241: /* Interrupt */
|
||||
s->intstatus &= value;
|
||||
if ((1 << 15) & ~s->intstatus)
|
||||
s->status &= ~(ONEN_ERR_CMD | ONEN_ERR_ERASE |
|
||||
ONEN_ERR_PROG | ONEN_ERR_LOAD);
|
||||
onenand_intr_update(s);
|
||||
break;
|
||||
case 0xf24c: /* Unlock Start Block Address */
|
||||
case 0xf24c: /* Unlock Start Block Address */
|
||||
s->unladdr[0] = value & (s->blocks - 1);
|
||||
/* For some reason we have to set the end address to by default
|
||||
* be same as start because the software forgets to write anything
|
||||
* in there. */
|
||||
s->unladdr[1] = value & (s->blocks - 1);
|
||||
break;
|
||||
case 0xf24d: /* Unlock End Block Address */
|
||||
case 0xf24d: /* Unlock End Block Address */
|
||||
s->unladdr[1] = value & (s->blocks - 1);
|
||||
break;
|
||||
|
||||
|
@@ -62,24 +62,24 @@ static void init_dev(tc58128_dev * dev, const char *filename)
|
||||
dev->flash_contents = g_malloc(FLASH_SIZE);
|
||||
memset(dev->flash_contents, 0xff, FLASH_SIZE);
|
||||
if (filename) {
|
||||
/* Load flash image skipping the first block */
|
||||
/* Load flash image skipping the first block */
|
||||
ret = load_image_size(filename, dev->flash_contents + 528 * 32,
|
||||
FLASH_SIZE - 528 * 32);
|
||||
if (ret < 0) {
|
||||
if (ret < 0) {
|
||||
if (!qtest_enabled()) {
|
||||
error_report("Could not load flash image %s", filename);
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
/* Build first block with number of blocks */
|
||||
} else {
|
||||
/* Build first block with number of blocks */
|
||||
blocks = DIV_ROUND_UP(ret, 528 * 32);
|
||||
dev->flash_contents[0] = blocks & 0xff;
|
||||
dev->flash_contents[1] = (blocks >> 8) & 0xff;
|
||||
dev->flash_contents[2] = (blocks >> 16) & 0xff;
|
||||
dev->flash_contents[3] = (blocks >> 24) & 0xff;
|
||||
fprintf(stderr, "loaded %d bytes for %s into flash\n", ret,
|
||||
filename);
|
||||
}
|
||||
dev->flash_contents[0] = blocks & 0xff;
|
||||
dev->flash_contents[1] = (blocks >> 8) & 0xff;
|
||||
dev->flash_contents[2] = (blocks >> 16) & 0xff;
|
||||
dev->flash_contents[3] = (blocks >> 24) & 0xff;
|
||||
fprintf(stderr, "loaded %d bytes for %s into flash\n", ret,
|
||||
filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,26 +87,26 @@ static void handle_command(tc58128_dev * dev, uint8_t command)
|
||||
{
|
||||
switch (command) {
|
||||
case 0xff:
|
||||
fprintf(stderr, "reset flash device\n");
|
||||
dev->state = WAIT;
|
||||
break;
|
||||
fprintf(stderr, "reset flash device\n");
|
||||
dev->state = WAIT;
|
||||
break;
|
||||
case 0x00:
|
||||
fprintf(stderr, "read mode 1\n");
|
||||
dev->state = READ1;
|
||||
dev->address_cycle = 0;
|
||||
break;
|
||||
fprintf(stderr, "read mode 1\n");
|
||||
dev->state = READ1;
|
||||
dev->address_cycle = 0;
|
||||
break;
|
||||
case 0x01:
|
||||
fprintf(stderr, "read mode 2\n");
|
||||
dev->state = READ2;
|
||||
dev->address_cycle = 0;
|
||||
break;
|
||||
fprintf(stderr, "read mode 2\n");
|
||||
dev->state = READ2;
|
||||
dev->address_cycle = 0;
|
||||
break;
|
||||
case 0x50:
|
||||
fprintf(stderr, "read mode 3\n");
|
||||
dev->state = READ3;
|
||||
dev->address_cycle = 0;
|
||||
break;
|
||||
fprintf(stderr, "read mode 3\n");
|
||||
dev->state = READ3;
|
||||
dev->address_cycle = 0;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "unknown flash command 0x%02x\n", command);
|
||||
fprintf(stderr, "unknown flash command 0x%02x\n", command);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
@@ -117,28 +117,28 @@ static void handle_address(tc58128_dev * dev, uint8_t data)
|
||||
case READ1:
|
||||
case READ2:
|
||||
case READ3:
|
||||
switch (dev->address_cycle) {
|
||||
case 0:
|
||||
dev->address = data;
|
||||
if (dev->state == READ2)
|
||||
dev->address |= 0x100;
|
||||
else if (dev->state == READ3)
|
||||
dev->address |= 0x200;
|
||||
break;
|
||||
case 1:
|
||||
dev->address += data * 528 * 0x100;
|
||||
break;
|
||||
case 2:
|
||||
dev->address += data * 528;
|
||||
fprintf(stderr, "address pointer in flash: 0x%08x\n",
|
||||
dev->address);
|
||||
break;
|
||||
default:
|
||||
/* Invalid data */
|
||||
switch (dev->address_cycle) {
|
||||
case 0:
|
||||
dev->address = data;
|
||||
if (dev->state == READ2)
|
||||
dev->address |= 0x100;
|
||||
else if (dev->state == READ3)
|
||||
dev->address |= 0x200;
|
||||
break;
|
||||
case 1:
|
||||
dev->address += data * 528 * 0x100;
|
||||
break;
|
||||
case 2:
|
||||
dev->address += data * 528;
|
||||
fprintf(stderr, "address pointer in flash: 0x%08x\n",
|
||||
dev->address);
|
||||
break;
|
||||
default:
|
||||
/* Invalid data */
|
||||
abort();
|
||||
}
|
||||
dev->address_cycle++;
|
||||
break;
|
||||
}
|
||||
dev->address_cycle++;
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
@@ -148,7 +148,7 @@ static uint8_t handle_read(tc58128_dev * dev)
|
||||
{
|
||||
#if 0
|
||||
if (dev->address % 0x100000 == 0)
|
||||
fprintf(stderr, "reading flash at address 0x%08x\n", dev->address);
|
||||
fprintf(stderr, "reading flash at address 0x%08x\n", dev->address);
|
||||
#endif
|
||||
return dev->flash_contents[dev->address++];
|
||||
}
|
||||
@@ -163,31 +163,31 @@ static int tc58128_cb(uint16_t porta, uint16_t portb,
|
||||
int dev;
|
||||
|
||||
if ((porta & CE1) == 0)
|
||||
dev = 0;
|
||||
dev = 0;
|
||||
else if ((porta & CE2) == 0)
|
||||
dev = 1;
|
||||
dev = 1;
|
||||
else
|
||||
return 0; /* No device selected */
|
||||
return 0; /* No device selected */
|
||||
|
||||
if ((porta & RE) && (porta & WE)) {
|
||||
/* Nothing to do, assert ready and return to input state */
|
||||
*periph_portadir &= 0xff00;
|
||||
*periph_portadir |= RDY(dev);
|
||||
*periph_pdtra |= RDY(dev);
|
||||
return 1;
|
||||
/* Nothing to do, assert ready and return to input state */
|
||||
*periph_portadir &= 0xff00;
|
||||
*periph_portadir |= RDY(dev);
|
||||
*periph_pdtra |= RDY(dev);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (porta & CLE) {
|
||||
/* Command */
|
||||
assert((porta & WE) == 0);
|
||||
handle_command(&tc58128_devs[dev], porta & 0x00ff);
|
||||
/* Command */
|
||||
assert((porta & WE) == 0);
|
||||
handle_command(&tc58128_devs[dev], porta & 0x00ff);
|
||||
} else if (porta & ALE) {
|
||||
assert((porta & WE) == 0);
|
||||
handle_address(&tc58128_devs[dev], porta & 0x00ff);
|
||||
assert((porta & WE) == 0);
|
||||
handle_address(&tc58128_devs[dev], porta & 0x00ff);
|
||||
} else if ((porta & RE) == 0) {
|
||||
*periph_portadir |= 0x00ff;
|
||||
*periph_pdtra &= 0xff00;
|
||||
*periph_pdtra |= handle_read(&tc58128_devs[dev]);
|
||||
*periph_portadir |= 0x00ff;
|
||||
*periph_pdtra &= 0xff00;
|
||||
*periph_pdtra |= handle_read(&tc58128_devs[dev]);
|
||||
} else {
|
||||
abort();
|
||||
}
|
||||
@@ -195,9 +195,9 @@ static int tc58128_cb(uint16_t porta, uint16_t portb,
|
||||
}
|
||||
|
||||
static sh7750_io_device tc58128 = {
|
||||
RE | WE, /* Port A triggers */
|
||||
0, /* Port B triggers */
|
||||
tc58128_cb /* Callback */
|
||||
RE | WE, /* Port A triggers */
|
||||
0, /* Port B triggers */
|
||||
tc58128_cb /* Callback */
|
||||
};
|
||||
|
||||
int tc58128_init(struct SH7750State *s, const char *zone1, const char *zone2)
|
||||
|
@@ -178,8 +178,7 @@ static int store_con_info(struct XenConsole *con)
|
||||
Chardev *cs = qemu_chr_fe_get_driver(&con->chr);
|
||||
char *pts = NULL;
|
||||
char *dom_path;
|
||||
GString *path;
|
||||
int ret = -1;
|
||||
g_autoptr(GString) path = NULL;
|
||||
|
||||
/* Only continue if we're talking to a pty. */
|
||||
if (!CHARDEV_IS_PTY(cs)) {
|
||||
@@ -204,15 +203,9 @@ static int store_con_info(struct XenConsole *con)
|
||||
|
||||
if (xenstore_write_str(con->console, path->str, pts)) {
|
||||
fprintf(stderr, "xenstore_write_str for '%s' fail", path->str);
|
||||
goto out;
|
||||
return -1;
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
out:
|
||||
g_string_free(path, true);
|
||||
free(path);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int con_init(struct XenLegacyDevice *xendev)
|
||||
|
@@ -44,6 +44,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/datadir.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-commands-machine.h"
|
||||
#include "qapi/type-helpers.h"
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "hw/boards.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
|
||||
/*
|
||||
* Report information of a machine's supported CPU topology hierarchy.
|
||||
|
@@ -42,6 +42,7 @@
|
||||
GlobalProperty hw_compat_7_2[] = {
|
||||
{ "e1000e", "migrate-timadj", "off" },
|
||||
{ "virtio-mem", "x-early-migration", "false" },
|
||||
{ "migration", "x-preempt-pre-7-2", "true" },
|
||||
};
|
||||
const size_t hw_compat_7_2_len = G_N_ELEMENTS(hw_compat_7_2);
|
||||
|
||||
|
@@ -466,10 +466,8 @@ static void allwinner_i2c_sun6i_init(Object *obj)
|
||||
|
||||
static const TypeInfo allwinner_i2c_sun6i_type_info = {
|
||||
.name = TYPE_AW_I2C_SUN6I,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(AWI2CState),
|
||||
.parent = TYPE_AW_I2C,
|
||||
.instance_init = allwinner_i2c_sun6i_init,
|
||||
.class_init = allwinner_i2c_class_init,
|
||||
};
|
||||
|
||||
static void allwinner_i2c_register_types(void)
|
||||
|
@@ -94,6 +94,13 @@ void pmbus_send64(PMBusDevice *pmdev, uint64_t data)
|
||||
|
||||
void pmbus_send_string(PMBusDevice *pmdev, const char *data)
|
||||
{
|
||||
if (!data) {
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"%s: %s: uninitialised read from 0x%02x\n",
|
||||
__func__, DEVICE(pmdev)->canonical_path, pmdev->code);
|
||||
return;
|
||||
}
|
||||
|
||||
size_t len = strlen(data);
|
||||
g_assert(len > 0);
|
||||
g_assert(len + pmdev->out_buf_len < SMBUS_DATA_MAX_LEN);
|
||||
|
@@ -3850,7 +3850,7 @@ static void vtd_iommu_replay(IOMMUMemoryRegion *iommu_mr, IOMMUNotifier *n)
|
||||
.domain_id = vtd_get_domain_id(s, &ce, vtd_as->pasid),
|
||||
};
|
||||
|
||||
vtd_page_walk(s, &ce, n->start, n->end, &info, vtd_as->pasid);
|
||||
vtd_page_walk(s, &ce, 0, ~0ULL, &info, vtd_as->pasid);
|
||||
}
|
||||
} else {
|
||||
trace_vtd_replay_ce_invalid(bus_n, PCI_SLOT(vtd_as->devfn),
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include "qemu/lockable.h"
|
||||
#include "qemu/main-loop.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "monitor/monitor.h"
|
||||
#include "monitor/hmp.h"
|
||||
#include "qapi/error.h"
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/main-loop.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qom/object.h"
|
||||
#include "migration/vmstate.h"
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#include "monitor/monitor.h"
|
||||
#include "monitor/hmp-target.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/qapi-commands-misc-target.h"
|
||||
#include "exec/address-spaces.h"
|
||||
#include "sysemu/hw_accel.h"
|
||||
|
@@ -36,20 +36,20 @@
|
||||
#include "trace.h"
|
||||
|
||||
/* CMD646 specific */
|
||||
#define CFR 0x50
|
||||
#define CFR_INTR_CH0 0x04
|
||||
#define CNTRL 0x51
|
||||
#define CNTRL_EN_CH0 0x04
|
||||
#define CNTRL_EN_CH1 0x08
|
||||
#define ARTTIM23 0x57
|
||||
#define ARTTIM23_INTR_CH1 0x10
|
||||
#define MRDMODE 0x71
|
||||
#define MRDMODE_INTR_CH0 0x04
|
||||
#define MRDMODE_INTR_CH1 0x08
|
||||
#define MRDMODE_BLK_CH0 0x10
|
||||
#define MRDMODE_BLK_CH1 0x20
|
||||
#define UDIDETCR0 0x73
|
||||
#define UDIDETCR1 0x7B
|
||||
#define CFR 0x50
|
||||
#define CFR_INTR_CH0 0x04
|
||||
#define CNTRL 0x51
|
||||
#define CNTRL_EN_CH0 0x04
|
||||
#define CNTRL_EN_CH1 0x08
|
||||
#define ARTTIM23 0x57
|
||||
#define ARTTIM23_INTR_CH1 0x10
|
||||
#define MRDMODE 0x71
|
||||
#define MRDMODE_INTR_CH0 0x04
|
||||
#define MRDMODE_INTR_CH1 0x08
|
||||
#define MRDMODE_BLK_CH0 0x10
|
||||
#define MRDMODE_BLK_CH1 0x20
|
||||
#define UDIDETCR0 0x73
|
||||
#define UDIDETCR1 0x7B
|
||||
|
||||
static void cmd646_update_irq(PCIDevice *pd);
|
||||
|
||||
|
@@ -318,52 +318,52 @@ static void ide_cfata_identify(IDEState *s)
|
||||
|
||||
cur_sec = s->cylinders * s->heads * s->sectors;
|
||||
|
||||
put_le16(p + 0, 0x848a); /* CF Storage Card signature */
|
||||
put_le16(p + 1, s->cylinders); /* Default cylinders */
|
||||
put_le16(p + 3, s->heads); /* Default heads */
|
||||
put_le16(p + 6, s->sectors); /* Default sectors per track */
|
||||
put_le16(p + 0, 0x848a); /* CF Storage Card signature */
|
||||
put_le16(p + 1, s->cylinders); /* Default cylinders */
|
||||
put_le16(p + 3, s->heads); /* Default heads */
|
||||
put_le16(p + 6, s->sectors); /* Default sectors per track */
|
||||
/* *(p + 7) := nb_sectors >> 16 -- see ide_cfata_identify_size */
|
||||
/* *(p + 8) := nb_sectors -- see ide_cfata_identify_size */
|
||||
padstr((char *)(p + 10), s->drive_serial_str, 20); /* serial number */
|
||||
put_le16(p + 22, 0x0004); /* ECC bytes */
|
||||
padstr((char *) (p + 23), s->version, 8); /* Firmware Revision */
|
||||
put_le16(p + 22, 0x0004); /* ECC bytes */
|
||||
padstr((char *) (p + 23), s->version, 8); /* Firmware Revision */
|
||||
padstr((char *) (p + 27), s->drive_model_str, 40);/* Model number */
|
||||
#if MAX_MULT_SECTORS > 1
|
||||
put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS);
|
||||
#else
|
||||
put_le16(p + 47, 0x0000);
|
||||
#endif
|
||||
put_le16(p + 49, 0x0f00); /* Capabilities */
|
||||
put_le16(p + 51, 0x0002); /* PIO cycle timing mode */
|
||||
put_le16(p + 52, 0x0001); /* DMA cycle timing mode */
|
||||
put_le16(p + 53, 0x0003); /* Translation params valid */
|
||||
put_le16(p + 54, s->cylinders); /* Current cylinders */
|
||||
put_le16(p + 55, s->heads); /* Current heads */
|
||||
put_le16(p + 56, s->sectors); /* Current sectors */
|
||||
put_le16(p + 57, cur_sec); /* Current capacity */
|
||||
put_le16(p + 58, cur_sec >> 16); /* Current capacity */
|
||||
if (s->mult_sectors) /* Multiple sector setting */
|
||||
put_le16(p + 49, 0x0f00); /* Capabilities */
|
||||
put_le16(p + 51, 0x0002); /* PIO cycle timing mode */
|
||||
put_le16(p + 52, 0x0001); /* DMA cycle timing mode */
|
||||
put_le16(p + 53, 0x0003); /* Translation params valid */
|
||||
put_le16(p + 54, s->cylinders); /* Current cylinders */
|
||||
put_le16(p + 55, s->heads); /* Current heads */
|
||||
put_le16(p + 56, s->sectors); /* Current sectors */
|
||||
put_le16(p + 57, cur_sec); /* Current capacity */
|
||||
put_le16(p + 58, cur_sec >> 16); /* Current capacity */
|
||||
if (s->mult_sectors) /* Multiple sector setting */
|
||||
put_le16(p + 59, 0x100 | s->mult_sectors);
|
||||
/* *(p + 60) := nb_sectors -- see ide_cfata_identify_size */
|
||||
/* *(p + 61) := nb_sectors >> 16 -- see ide_cfata_identify_size */
|
||||
put_le16(p + 63, 0x0203); /* Multiword DMA capability */
|
||||
put_le16(p + 64, 0x0001); /* Flow Control PIO support */
|
||||
put_le16(p + 65, 0x0096); /* Min. Multiword DMA cycle */
|
||||
put_le16(p + 66, 0x0096); /* Rec. Multiword DMA cycle */
|
||||
put_le16(p + 68, 0x00b4); /* Min. PIO cycle time */
|
||||
put_le16(p + 82, 0x400c); /* Command Set supported */
|
||||
put_le16(p + 83, 0x7068); /* Command Set supported */
|
||||
put_le16(p + 84, 0x4000); /* Features supported */
|
||||
put_le16(p + 85, 0x000c); /* Command Set enabled */
|
||||
put_le16(p + 86, 0x7044); /* Command Set enabled */
|
||||
put_le16(p + 87, 0x4000); /* Features enabled */
|
||||
put_le16(p + 91, 0x4060); /* Current APM level */
|
||||
put_le16(p + 129, 0x0002); /* Current features option */
|
||||
put_le16(p + 130, 0x0005); /* Reassigned sectors */
|
||||
put_le16(p + 131, 0x0001); /* Initial power mode */
|
||||
put_le16(p + 132, 0x0000); /* User signature */
|
||||
put_le16(p + 160, 0x8100); /* Power requirement */
|
||||
put_le16(p + 161, 0x8001); /* CF command set */
|
||||
put_le16(p + 63, 0x0203); /* Multiword DMA capability */
|
||||
put_le16(p + 64, 0x0001); /* Flow Control PIO support */
|
||||
put_le16(p + 65, 0x0096); /* Min. Multiword DMA cycle */
|
||||
put_le16(p + 66, 0x0096); /* Rec. Multiword DMA cycle */
|
||||
put_le16(p + 68, 0x00b4); /* Min. PIO cycle time */
|
||||
put_le16(p + 82, 0x400c); /* Command Set supported */
|
||||
put_le16(p + 83, 0x7068); /* Command Set supported */
|
||||
put_le16(p + 84, 0x4000); /* Features supported */
|
||||
put_le16(p + 85, 0x000c); /* Command Set enabled */
|
||||
put_le16(p + 86, 0x7044); /* Command Set enabled */
|
||||
put_le16(p + 87, 0x4000); /* Features enabled */
|
||||
put_le16(p + 91, 0x4060); /* Current APM level */
|
||||
put_le16(p + 129, 0x0002); /* Current features option */
|
||||
put_le16(p + 130, 0x0005); /* Reassigned sectors */
|
||||
put_le16(p + 131, 0x0001); /* Initial power mode */
|
||||
put_le16(p + 132, 0x0000); /* User signature */
|
||||
put_le16(p + 160, 0x8100); /* Power requirement */
|
||||
put_le16(p + 161, 0x8001); /* CF command set */
|
||||
|
||||
ide_cfata_identify_size(s);
|
||||
s->identify_set = 1;
|
||||
@@ -1131,13 +1131,13 @@ static void ide_cfata_metadata_inquiry(IDEState *s)
|
||||
memset(p, 0, 0x200);
|
||||
spd = ((s->mdata_size - 1) >> 9) + 1;
|
||||
|
||||
put_le16(p + 0, 0x0001); /* Data format revision */
|
||||
put_le16(p + 1, 0x0000); /* Media property: silicon */
|
||||
put_le16(p + 2, s->media_changed); /* Media status */
|
||||
put_le16(p + 3, s->mdata_size & 0xffff); /* Capacity in bytes (low) */
|
||||
put_le16(p + 4, s->mdata_size >> 16); /* Capacity in bytes (high) */
|
||||
put_le16(p + 5, spd & 0xffff); /* Sectors per device (low) */
|
||||
put_le16(p + 6, spd >> 16); /* Sectors per device (high) */
|
||||
put_le16(p + 0, 0x0001); /* Data format revision */
|
||||
put_le16(p + 1, 0x0000); /* Media property: silicon */
|
||||
put_le16(p + 2, s->media_changed); /* Media status */
|
||||
put_le16(p + 3, s->mdata_size & 0xffff); /* Capacity in bytes (low) */
|
||||
put_le16(p + 4, s->mdata_size >> 16); /* Capacity in bytes (high) */
|
||||
put_le16(p + 5, spd & 0xffff); /* Sectors per device (low) */
|
||||
put_le16(p + 6, spd >> 16); /* Sectors per device (high) */
|
||||
}
|
||||
|
||||
static void ide_cfata_metadata_read(IDEState *s)
|
||||
@@ -1153,7 +1153,7 @@ static void ide_cfata_metadata_read(IDEState *s)
|
||||
p = (uint16_t *) s->io_buffer;
|
||||
memset(p, 0, 0x200);
|
||||
|
||||
put_le16(p + 0, s->media_changed); /* Media status */
|
||||
put_le16(p + 0, s->media_changed); /* Media status */
|
||||
memcpy(p + 1, s->mdata_storage + (((s->hcyl << 16) | s->lcyl) << 9),
|
||||
MIN(MIN(s->mdata_size - (((s->hcyl << 16) | s->lcyl) << 9),
|
||||
s->nsector << 9), 0x200 - 2));
|
||||
|
@@ -40,7 +40,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(MicroDriveState, MICRODRIVE)
|
||||
/***********************************************************/
|
||||
/* CF-ATA Microdrive */
|
||||
|
||||
#define METADATA_SIZE 0x20
|
||||
#define METADATA_SIZE 0x20
|
||||
|
||||
/* DSCM-1XXXX Microdrive hard disk with CF+ II / PCMCIA interface. */
|
||||
|
||||
@@ -65,29 +65,29 @@ struct MicroDriveState {
|
||||
|
||||
/* Register bitfields */
|
||||
enum md_opt {
|
||||
OPT_MODE_MMAP = 0,
|
||||
OPT_MODE_IOMAP16 = 1,
|
||||
OPT_MODE_IOMAP1 = 2,
|
||||
OPT_MODE_IOMAP2 = 3,
|
||||
OPT_MODE = 0x3f,
|
||||
OPT_LEVIREQ = 0x40,
|
||||
OPT_SRESET = 0x80,
|
||||
OPT_MODE_MMAP = 0,
|
||||
OPT_MODE_IOMAP16 = 1,
|
||||
OPT_MODE_IOMAP1 = 2,
|
||||
OPT_MODE_IOMAP2 = 3,
|
||||
OPT_MODE = 0x3f,
|
||||
OPT_LEVIREQ = 0x40,
|
||||
OPT_SRESET = 0x80,
|
||||
};
|
||||
enum md_cstat {
|
||||
STAT_INT = 0x02,
|
||||
STAT_PWRDWN = 0x04,
|
||||
STAT_XE = 0x10,
|
||||
STAT_IOIS8 = 0x20,
|
||||
STAT_SIGCHG = 0x40,
|
||||
STAT_CHANGED = 0x80,
|
||||
STAT_INT = 0x02,
|
||||
STAT_PWRDWN = 0x04,
|
||||
STAT_XE = 0x10,
|
||||
STAT_IOIS8 = 0x20,
|
||||
STAT_SIGCHG = 0x40,
|
||||
STAT_CHANGED = 0x80,
|
||||
};
|
||||
enum md_pins {
|
||||
PINS_MRDY = 0x02,
|
||||
PINS_CRDY = 0x20,
|
||||
PINS_MRDY = 0x02,
|
||||
PINS_CRDY = 0x20,
|
||||
};
|
||||
enum md_ctrl {
|
||||
CTRL_IEN = 0x02,
|
||||
CTRL_SRST = 0x04,
|
||||
CTRL_IEN = 0x02,
|
||||
CTRL_SRST = 0x04,
|
||||
};
|
||||
|
||||
static inline void md_interrupt_update(MicroDriveState *s)
|
||||
@@ -99,7 +99,7 @@ static inline void md_interrupt_update(MicroDriveState *s)
|
||||
}
|
||||
|
||||
qemu_set_irq(card->slot->irq,
|
||||
!(s->stat & STAT_INT) && /* Inverted */
|
||||
!(s->stat & STAT_INT) && /* Inverted */
|
||||
!(s->ctrl & (CTRL_IEN | CTRL_SRST)) &&
|
||||
!(s->opt & OPT_SRESET));
|
||||
}
|
||||
@@ -145,17 +145,17 @@ static uint8_t md_attr_read(PCMCIACardState *card, uint32_t at)
|
||||
at -= s->attr_base;
|
||||
|
||||
switch (at) {
|
||||
case 0x00: /* Configuration Option Register */
|
||||
case 0x00: /* Configuration Option Register */
|
||||
return s->opt;
|
||||
case 0x02: /* Card Configuration Status Register */
|
||||
case 0x02: /* Card Configuration Status Register */
|
||||
if (s->ctrl & CTRL_IEN) {
|
||||
return s->stat & ~STAT_INT;
|
||||
} else {
|
||||
return s->stat;
|
||||
}
|
||||
case 0x04: /* Pin Replacement Register */
|
||||
case 0x04: /* Pin Replacement Register */
|
||||
return (s->pins & PINS_CRDY) | 0x0c;
|
||||
case 0x06: /* Socket and Copy Register */
|
||||
case 0x06: /* Socket and Copy Register */
|
||||
return 0x00;
|
||||
#ifdef VERBOSE
|
||||
default:
|
||||
@@ -173,14 +173,14 @@ static void md_attr_write(PCMCIACardState *card, uint32_t at, uint8_t value)
|
||||
at -= s->attr_base;
|
||||
|
||||
switch (at) {
|
||||
case 0x00: /* Configuration Option Register */
|
||||
case 0x00: /* Configuration Option Register */
|
||||
s->opt = value & 0xcf;
|
||||
if (value & OPT_SRESET) {
|
||||
device_cold_reset(DEVICE(s));
|
||||
}
|
||||
md_interrupt_update(s);
|
||||
break;
|
||||
case 0x02: /* Card Configuration Status Register */
|
||||
case 0x02: /* Card Configuration Status Register */
|
||||
if ((s->stat ^ value) & STAT_PWRDWN) {
|
||||
s->pins |= PINS_CRDY;
|
||||
}
|
||||
@@ -189,11 +189,11 @@ static void md_attr_write(PCMCIACardState *card, uint32_t at, uint8_t value)
|
||||
md_interrupt_update(s);
|
||||
/* Word 170 in Identify Device must be equal to STAT_XE */
|
||||
break;
|
||||
case 0x04: /* Pin Replacement Register */
|
||||
case 0x04: /* Pin Replacement Register */
|
||||
s->pins &= PINS_CRDY;
|
||||
s->pins |= value & PINS_MRDY;
|
||||
break;
|
||||
case 0x06: /* Socket and Copy Register */
|
||||
case 0x06: /* Socket and Copy Register */
|
||||
break;
|
||||
default:
|
||||
printf("%s: Bad attribute space register %02x\n", __func__, at);
|
||||
@@ -232,7 +232,7 @@ static uint16_t md_common_read(PCMCIACardState *card, uint32_t at)
|
||||
}
|
||||
|
||||
switch (at) {
|
||||
case 0x0: /* Even RD Data */
|
||||
case 0x0: /* Even RD Data */
|
||||
case 0x8:
|
||||
return ide_data_readw(&s->bus, 0);
|
||||
|
||||
@@ -245,18 +245,18 @@ static uint16_t md_common_read(PCMCIACardState *card, uint32_t at)
|
||||
}
|
||||
s->cycle = !s->cycle;
|
||||
return ret;
|
||||
case 0x9: /* Odd RD Data */
|
||||
case 0x9: /* Odd RD Data */
|
||||
return s->io >> 8;
|
||||
case 0xd: /* Error */
|
||||
case 0xd: /* Error */
|
||||
return ide_ioport_read(&s->bus, 0x1);
|
||||
case 0xe: /* Alternate Status */
|
||||
case 0xe: /* Alternate Status */
|
||||
ifs = ide_bus_active_if(&s->bus);
|
||||
if (ifs->blk) {
|
||||
return ifs->status;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
case 0xf: /* Device Address */
|
||||
case 0xf: /* Device Address */
|
||||
ifs = ide_bus_active_if(&s->bus);
|
||||
return 0xc2 | ((~ifs->select << 2) & 0x3c);
|
||||
default:
|
||||
@@ -296,7 +296,7 @@ static void md_common_write(PCMCIACardState *card, uint32_t at, uint16_t value)
|
||||
}
|
||||
|
||||
switch (at) {
|
||||
case 0x0: /* Even WR Data */
|
||||
case 0x0: /* Even WR Data */
|
||||
case 0x8:
|
||||
ide_data_writew(&s->bus, 0, value);
|
||||
break;
|
||||
@@ -313,10 +313,10 @@ static void md_common_write(PCMCIACardState *card, uint32_t at, uint16_t value)
|
||||
s->io = value & 0xff;
|
||||
s->cycle = !s->cycle;
|
||||
break;
|
||||
case 0xd: /* Features */
|
||||
case 0xd: /* Features */
|
||||
ide_ioport_write(&s->bus, 0x1, value);
|
||||
break;
|
||||
case 0xe: /* Device Control */
|
||||
case 0xe: /* Device Control */
|
||||
s->ctrl = value;
|
||||
if (value & CTRL_SRST) {
|
||||
device_cold_reset(DEVICE(s));
|
||||
@@ -350,35 +350,35 @@ static const VMStateDescription vmstate_microdrive = {
|
||||
};
|
||||
|
||||
static const uint8_t dscm1xxxx_cis[0x14a] = {
|
||||
[0x000] = CISTPL_DEVICE, /* 5V Device Information */
|
||||
[0x002] = 0x03, /* Tuple length = 4 bytes */
|
||||
[0x004] = 0xdb, /* ID: DTYPE_FUNCSPEC, non WP, DSPEED_150NS */
|
||||
[0x006] = 0x01, /* Size = 2K bytes */
|
||||
[0x000] = CISTPL_DEVICE, /* 5V Device Information */
|
||||
[0x002] = 0x03, /* Tuple length = 4 bytes */
|
||||
[0x004] = 0xdb, /* ID: DTYPE_FUNCSPEC, non WP, DSPEED_150NS */
|
||||
[0x006] = 0x01, /* Size = 2K bytes */
|
||||
[0x008] = CISTPL_ENDMARK,
|
||||
|
||||
[0x00a] = CISTPL_DEVICE_OC, /* Additional Device Information */
|
||||
[0x00c] = 0x04, /* Tuple length = 4 byest */
|
||||
[0x00e] = 0x03, /* Conditions: Ext = 0, Vcc 3.3V, MWAIT = 1 */
|
||||
[0x010] = 0xdb, /* ID: DTYPE_FUNCSPEC, non WP, DSPEED_150NS */
|
||||
[0x012] = 0x01, /* Size = 2K bytes */
|
||||
[0x00a] = CISTPL_DEVICE_OC, /* Additional Device Information */
|
||||
[0x00c] = 0x04, /* Tuple length = 4 byest */
|
||||
[0x00e] = 0x03, /* Conditions: Ext = 0, Vcc 3.3V, MWAIT = 1 */
|
||||
[0x010] = 0xdb, /* ID: DTYPE_FUNCSPEC, non WP, DSPEED_150NS */
|
||||
[0x012] = 0x01, /* Size = 2K bytes */
|
||||
[0x014] = CISTPL_ENDMARK,
|
||||
|
||||
[0x016] = CISTPL_JEDEC_C, /* JEDEC ID */
|
||||
[0x018] = 0x02, /* Tuple length = 2 bytes */
|
||||
[0x01a] = 0xdf, /* PC Card ATA with no Vpp required */
|
||||
[0x016] = CISTPL_JEDEC_C, /* JEDEC ID */
|
||||
[0x018] = 0x02, /* Tuple length = 2 bytes */
|
||||
[0x01a] = 0xdf, /* PC Card ATA with no Vpp required */
|
||||
[0x01c] = 0x01,
|
||||
|
||||
[0x01e] = CISTPL_MANFID, /* Manufacture ID */
|
||||
[0x020] = 0x04, /* Tuple length = 4 bytes */
|
||||
[0x022] = 0xa4, /* TPLMID_MANF = 00a4 (IBM) */
|
||||
[0x01e] = CISTPL_MANFID, /* Manufacture ID */
|
||||
[0x020] = 0x04, /* Tuple length = 4 bytes */
|
||||
[0x022] = 0xa4, /* TPLMID_MANF = 00a4 (IBM) */
|
||||
[0x024] = 0x00,
|
||||
[0x026] = 0x00, /* PLMID_CARD = 0000 */
|
||||
[0x026] = 0x00, /* PLMID_CARD = 0000 */
|
||||
[0x028] = 0x00,
|
||||
|
||||
[0x02a] = CISTPL_VERS_1, /* Level 1 Version */
|
||||
[0x02c] = 0x12, /* Tuple length = 23 bytes */
|
||||
[0x02e] = 0x04, /* Major Version = JEIDA 4.2 / PCMCIA 2.1 */
|
||||
[0x030] = 0x01, /* Minor Version = 1 */
|
||||
[0x02a] = CISTPL_VERS_1, /* Level 1 Version */
|
||||
[0x02c] = 0x12, /* Tuple length = 23 bytes */
|
||||
[0x02e] = 0x04, /* Major Version = JEIDA 4.2 / PCMCIA 2.1 */
|
||||
[0x030] = 0x01, /* Minor Version = 1 */
|
||||
[0x032] = 'I',
|
||||
[0x034] = 'B',
|
||||
[0x036] = 'M',
|
||||
@@ -396,142 +396,142 @@ static const uint8_t dscm1xxxx_cis[0x14a] = {
|
||||
[0x04e] = 0x00,
|
||||
[0x050] = CISTPL_ENDMARK,
|
||||
|
||||
[0x052] = CISTPL_FUNCID, /* Function ID */
|
||||
[0x054] = 0x02, /* Tuple length = 2 bytes */
|
||||
[0x056] = 0x04, /* TPLFID_FUNCTION = Fixed Disk */
|
||||
[0x058] = 0x01, /* TPLFID_SYSINIT: POST = 1, ROM = 0 */
|
||||
[0x052] = CISTPL_FUNCID, /* Function ID */
|
||||
[0x054] = 0x02, /* Tuple length = 2 bytes */
|
||||
[0x056] = 0x04, /* TPLFID_FUNCTION = Fixed Disk */
|
||||
[0x058] = 0x01, /* TPLFID_SYSINIT: POST = 1, ROM = 0 */
|
||||
|
||||
[0x05a] = CISTPL_FUNCE, /* Function Extension */
|
||||
[0x05c] = 0x02, /* Tuple length = 2 bytes */
|
||||
[0x05e] = 0x01, /* TPLFE_TYPE = Disk Device Interface */
|
||||
[0x060] = 0x01, /* TPLFE_DATA = PC Card ATA Interface */
|
||||
[0x05a] = CISTPL_FUNCE, /* Function Extension */
|
||||
[0x05c] = 0x02, /* Tuple length = 2 bytes */
|
||||
[0x05e] = 0x01, /* TPLFE_TYPE = Disk Device Interface */
|
||||
[0x060] = 0x01, /* TPLFE_DATA = PC Card ATA Interface */
|
||||
|
||||
[0x062] = CISTPL_FUNCE, /* Function Extension */
|
||||
[0x064] = 0x03, /* Tuple length = 3 bytes */
|
||||
[0x066] = 0x02, /* TPLFE_TYPE = Basic PC Card ATA Interface */
|
||||
[0x068] = 0x08, /* TPLFE_DATA: Rotating, Unique, Single */
|
||||
[0x06a] = 0x0f, /* TPLFE_DATA: Sleep, Standby, Idle, Auto */
|
||||
[0x062] = CISTPL_FUNCE, /* Function Extension */
|
||||
[0x064] = 0x03, /* Tuple length = 3 bytes */
|
||||
[0x066] = 0x02, /* TPLFE_TYPE = Basic PC Card ATA Interface */
|
||||
[0x068] = 0x08, /* TPLFE_DATA: Rotating, Unique, Single */
|
||||
[0x06a] = 0x0f, /* TPLFE_DATA: Sleep, Standby, Idle, Auto */
|
||||
|
||||
[0x06c] = CISTPL_CONFIG, /* Configuration */
|
||||
[0x06e] = 0x05, /* Tuple length = 5 bytes */
|
||||
[0x070] = 0x01, /* TPCC_RASZ = 2 bytes, TPCC_RMSZ = 1 byte */
|
||||
[0x072] = 0x07, /* TPCC_LAST = 7 */
|
||||
[0x074] = 0x00, /* TPCC_RADR = 0200 */
|
||||
[0x06c] = CISTPL_CONFIG, /* Configuration */
|
||||
[0x06e] = 0x05, /* Tuple length = 5 bytes */
|
||||
[0x070] = 0x01, /* TPCC_RASZ = 2 bytes, TPCC_RMSZ = 1 byte */
|
||||
[0x072] = 0x07, /* TPCC_LAST = 7 */
|
||||
[0x074] = 0x00, /* TPCC_RADR = 0200 */
|
||||
[0x076] = 0x02,
|
||||
[0x078] = 0x0f, /* TPCC_RMSK = 200, 202, 204, 206 */
|
||||
[0x078] = 0x0f, /* TPCC_RMSK = 200, 202, 204, 206 */
|
||||
|
||||
[0x07a] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x07c] = 0x0b, /* Tuple length = 11 bytes */
|
||||
[0x07e] = 0xc0, /* TPCE_INDX = Memory Mode, Default, Iface */
|
||||
[0x080] = 0xc0, /* TPCE_IF = Memory, no BVDs, no WP, READY */
|
||||
[0x082] = 0xa1, /* TPCE_FS = Vcc only, no I/O, Memory, Misc */
|
||||
[0x084] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
|
||||
[0x086] = 0x55, /* NomV: 5.0 V */
|
||||
[0x088] = 0x4d, /* MinV: 4.5 V */
|
||||
[0x08a] = 0x5d, /* MaxV: 5.5 V */
|
||||
[0x08c] = 0x4e, /* Peakl: 450 mA */
|
||||
[0x08e] = 0x08, /* TPCE_MS = 1 window, 1 byte, Host address */
|
||||
[0x090] = 0x00, /* Window descriptor: Window length = 0 */
|
||||
[0x092] = 0x20, /* TPCE_MI: support power down mode, RW */
|
||||
[0x07a] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x07c] = 0x0b, /* Tuple length = 11 bytes */
|
||||
[0x07e] = 0xc0, /* TPCE_INDX = Memory Mode, Default, Iface */
|
||||
[0x080] = 0xc0, /* TPCE_IF = Memory, no BVDs, no WP, READY */
|
||||
[0x082] = 0xa1, /* TPCE_FS = Vcc only, no I/O, Memory, Misc */
|
||||
[0x084] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
|
||||
[0x086] = 0x55, /* NomV: 5.0 V */
|
||||
[0x088] = 0x4d, /* MinV: 4.5 V */
|
||||
[0x08a] = 0x5d, /* MaxV: 5.5 V */
|
||||
[0x08c] = 0x4e, /* Peakl: 450 mA */
|
||||
[0x08e] = 0x08, /* TPCE_MS = 1 window, 1 byte, Host address */
|
||||
[0x090] = 0x00, /* Window descriptor: Window length = 0 */
|
||||
[0x092] = 0x20, /* TPCE_MI: support power down mode, RW */
|
||||
|
||||
[0x094] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x096] = 0x06, /* Tuple length = 6 bytes */
|
||||
[0x098] = 0x00, /* TPCE_INDX = Memory Mode, no Default */
|
||||
[0x09a] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
|
||||
[0x09c] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
|
||||
[0x09e] = 0xb5, /* NomV: 3.3 V */
|
||||
[0x094] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x096] = 0x06, /* Tuple length = 6 bytes */
|
||||
[0x098] = 0x00, /* TPCE_INDX = Memory Mode, no Default */
|
||||
[0x09a] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
|
||||
[0x09c] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
|
||||
[0x09e] = 0xb5, /* NomV: 3.3 V */
|
||||
[0x0a0] = 0x1e,
|
||||
[0x0a2] = 0x3e, /* Peakl: 350 mA */
|
||||
[0x0a2] = 0x3e, /* Peakl: 350 mA */
|
||||
|
||||
[0x0a4] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x0a6] = 0x0d, /* Tuple length = 13 bytes */
|
||||
[0x0a8] = 0xc1, /* TPCE_INDX = I/O and Memory Mode, Default */
|
||||
[0x0aa] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */
|
||||
[0x0ac] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */
|
||||
[0x0ae] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
|
||||
[0x0b0] = 0x55, /* NomV: 5.0 V */
|
||||
[0x0b2] = 0x4d, /* MinV: 4.5 V */
|
||||
[0x0b4] = 0x5d, /* MaxV: 5.5 V */
|
||||
[0x0b6] = 0x4e, /* Peakl: 450 mA */
|
||||
[0x0b8] = 0x64, /* TPCE_IO = 16-byte boundary, 16/8 accesses */
|
||||
[0x0ba] = 0xf0, /* TPCE_IR = MASK, Level, Pulse, Share */
|
||||
[0x0bc] = 0xff, /* IRQ0..IRQ7 supported */
|
||||
[0x0be] = 0xff, /* IRQ8..IRQ15 supported */
|
||||
[0x0c0] = 0x20, /* TPCE_MI = support power down mode */
|
||||
[0x0a4] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x0a6] = 0x0d, /* Tuple length = 13 bytes */
|
||||
[0x0a8] = 0xc1, /* TPCE_INDX = I/O and Memory Mode, Default */
|
||||
[0x0aa] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */
|
||||
[0x0ac] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */
|
||||
[0x0ae] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
|
||||
[0x0b0] = 0x55, /* NomV: 5.0 V */
|
||||
[0x0b2] = 0x4d, /* MinV: 4.5 V */
|
||||
[0x0b4] = 0x5d, /* MaxV: 5.5 V */
|
||||
[0x0b6] = 0x4e, /* Peakl: 450 mA */
|
||||
[0x0b8] = 0x64, /* TPCE_IO = 16-byte boundary, 16/8 accesses */
|
||||
[0x0ba] = 0xf0, /* TPCE_IR = MASK, Level, Pulse, Share */
|
||||
[0x0bc] = 0xff, /* IRQ0..IRQ7 supported */
|
||||
[0x0be] = 0xff, /* IRQ8..IRQ15 supported */
|
||||
[0x0c0] = 0x20, /* TPCE_MI = support power down mode */
|
||||
|
||||
[0x0c2] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x0c4] = 0x06, /* Tuple length = 6 bytes */
|
||||
[0x0c6] = 0x01, /* TPCE_INDX = I/O and Memory Mode */
|
||||
[0x0c8] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
|
||||
[0x0ca] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
|
||||
[0x0cc] = 0xb5, /* NomV: 3.3 V */
|
||||
[0x0c2] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x0c4] = 0x06, /* Tuple length = 6 bytes */
|
||||
[0x0c6] = 0x01, /* TPCE_INDX = I/O and Memory Mode */
|
||||
[0x0c8] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
|
||||
[0x0ca] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
|
||||
[0x0cc] = 0xb5, /* NomV: 3.3 V */
|
||||
[0x0ce] = 0x1e,
|
||||
[0x0d0] = 0x3e, /* Peakl: 350 mA */
|
||||
[0x0d0] = 0x3e, /* Peakl: 350 mA */
|
||||
|
||||
[0x0d2] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x0d4] = 0x12, /* Tuple length = 18 bytes */
|
||||
[0x0d6] = 0xc2, /* TPCE_INDX = I/O Primary Mode */
|
||||
[0x0d8] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */
|
||||
[0x0da] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */
|
||||
[0x0dc] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
|
||||
[0x0de] = 0x55, /* NomV: 5.0 V */
|
||||
[0x0e0] = 0x4d, /* MinV: 4.5 V */
|
||||
[0x0e2] = 0x5d, /* MaxV: 5.5 V */
|
||||
[0x0e4] = 0x4e, /* Peakl: 450 mA */
|
||||
[0x0e6] = 0xea, /* TPCE_IO = 1K boundary, 16/8 access, Range */
|
||||
[0x0e8] = 0x61, /* Range: 2 fields, 2 bytes addr, 1 byte len */
|
||||
[0x0ea] = 0xf0, /* Field 1 address = 0x01f0 */
|
||||
[0x0d2] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x0d4] = 0x12, /* Tuple length = 18 bytes */
|
||||
[0x0d6] = 0xc2, /* TPCE_INDX = I/O Primary Mode */
|
||||
[0x0d8] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */
|
||||
[0x0da] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */
|
||||
[0x0dc] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
|
||||
[0x0de] = 0x55, /* NomV: 5.0 V */
|
||||
[0x0e0] = 0x4d, /* MinV: 4.5 V */
|
||||
[0x0e2] = 0x5d, /* MaxV: 5.5 V */
|
||||
[0x0e4] = 0x4e, /* Peakl: 450 mA */
|
||||
[0x0e6] = 0xea, /* TPCE_IO = 1K boundary, 16/8 access, Range */
|
||||
[0x0e8] = 0x61, /* Range: 2 fields, 2 bytes addr, 1 byte len */
|
||||
[0x0ea] = 0xf0, /* Field 1 address = 0x01f0 */
|
||||
[0x0ec] = 0x01,
|
||||
[0x0ee] = 0x07, /* Address block length = 8 */
|
||||
[0x0f0] = 0xf6, /* Field 2 address = 0x03f6 */
|
||||
[0x0ee] = 0x07, /* Address block length = 8 */
|
||||
[0x0f0] = 0xf6, /* Field 2 address = 0x03f6 */
|
||||
[0x0f2] = 0x03,
|
||||
[0x0f4] = 0x01, /* Address block length = 2 */
|
||||
[0x0f6] = 0xee, /* TPCE_IR = IRQ E, Level, Pulse, Share */
|
||||
[0x0f8] = 0x20, /* TPCE_MI = support power down mode */
|
||||
[0x0f4] = 0x01, /* Address block length = 2 */
|
||||
[0x0f6] = 0xee, /* TPCE_IR = IRQ E, Level, Pulse, Share */
|
||||
[0x0f8] = 0x20, /* TPCE_MI = support power down mode */
|
||||
|
||||
[0x0fa] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x0fc] = 0x06, /* Tuple length = 6 bytes */
|
||||
[0x0fe] = 0x02, /* TPCE_INDX = I/O Primary Mode, no Default */
|
||||
[0x100] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
|
||||
[0x102] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
|
||||
[0x104] = 0xb5, /* NomV: 3.3 V */
|
||||
[0x0fa] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x0fc] = 0x06, /* Tuple length = 6 bytes */
|
||||
[0x0fe] = 0x02, /* TPCE_INDX = I/O Primary Mode, no Default */
|
||||
[0x100] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
|
||||
[0x102] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
|
||||
[0x104] = 0xb5, /* NomV: 3.3 V */
|
||||
[0x106] = 0x1e,
|
||||
[0x108] = 0x3e, /* Peakl: 350 mA */
|
||||
[0x108] = 0x3e, /* Peakl: 350 mA */
|
||||
|
||||
[0x10a] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x10c] = 0x12, /* Tuple length = 18 bytes */
|
||||
[0x10e] = 0xc3, /* TPCE_INDX = I/O Secondary Mode, Default */
|
||||
[0x110] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */
|
||||
[0x112] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */
|
||||
[0x114] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
|
||||
[0x116] = 0x55, /* NomV: 5.0 V */
|
||||
[0x118] = 0x4d, /* MinV: 4.5 V */
|
||||
[0x11a] = 0x5d, /* MaxV: 5.5 V */
|
||||
[0x11c] = 0x4e, /* Peakl: 450 mA */
|
||||
[0x11e] = 0xea, /* TPCE_IO = 1K boundary, 16/8 access, Range */
|
||||
[0x120] = 0x61, /* Range: 2 fields, 2 byte addr, 1 byte len */
|
||||
[0x122] = 0x70, /* Field 1 address = 0x0170 */
|
||||
[0x10a] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x10c] = 0x12, /* Tuple length = 18 bytes */
|
||||
[0x10e] = 0xc3, /* TPCE_INDX = I/O Secondary Mode, Default */
|
||||
[0x110] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */
|
||||
[0x112] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */
|
||||
[0x114] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
|
||||
[0x116] = 0x55, /* NomV: 5.0 V */
|
||||
[0x118] = 0x4d, /* MinV: 4.5 V */
|
||||
[0x11a] = 0x5d, /* MaxV: 5.5 V */
|
||||
[0x11c] = 0x4e, /* Peakl: 450 mA */
|
||||
[0x11e] = 0xea, /* TPCE_IO = 1K boundary, 16/8 access, Range */
|
||||
[0x120] = 0x61, /* Range: 2 fields, 2 byte addr, 1 byte len */
|
||||
[0x122] = 0x70, /* Field 1 address = 0x0170 */
|
||||
[0x124] = 0x01,
|
||||
[0x126] = 0x07, /* Address block length = 8 */
|
||||
[0x128] = 0x76, /* Field 2 address = 0x0376 */
|
||||
[0x126] = 0x07, /* Address block length = 8 */
|
||||
[0x128] = 0x76, /* Field 2 address = 0x0376 */
|
||||
[0x12a] = 0x03,
|
||||
[0x12c] = 0x01, /* Address block length = 2 */
|
||||
[0x12e] = 0xee, /* TPCE_IR = IRQ E, Level, Pulse, Share */
|
||||
[0x130] = 0x20, /* TPCE_MI = support power down mode */
|
||||
[0x12c] = 0x01, /* Address block length = 2 */
|
||||
[0x12e] = 0xee, /* TPCE_IR = IRQ E, Level, Pulse, Share */
|
||||
[0x130] = 0x20, /* TPCE_MI = support power down mode */
|
||||
|
||||
[0x132] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x134] = 0x06, /* Tuple length = 6 bytes */
|
||||
[0x136] = 0x03, /* TPCE_INDX = I/O Secondary Mode */
|
||||
[0x138] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
|
||||
[0x13a] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
|
||||
[0x13c] = 0xb5, /* NomV: 3.3 V */
|
||||
[0x132] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
|
||||
[0x134] = 0x06, /* Tuple length = 6 bytes */
|
||||
[0x136] = 0x03, /* TPCE_INDX = I/O Secondary Mode */
|
||||
[0x138] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
|
||||
[0x13a] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
|
||||
[0x13c] = 0xb5, /* NomV: 3.3 V */
|
||||
[0x13e] = 0x1e,
|
||||
[0x140] = 0x3e, /* Peakl: 350 mA */
|
||||
[0x140] = 0x3e, /* Peakl: 350 mA */
|
||||
|
||||
[0x142] = CISTPL_NO_LINK, /* No Link */
|
||||
[0x144] = 0x00, /* Tuple length = 0 bytes */
|
||||
[0x142] = CISTPL_NO_LINK, /* No Link */
|
||||
[0x144] = 0x00, /* Tuple length = 0 bytes */
|
||||
|
||||
[0x146] = CISTPL_END, /* Tuple End */
|
||||
[0x146] = CISTPL_END, /* Tuple End */
|
||||
};
|
||||
|
||||
#define TYPE_DSCM1XXXX "dscm1xxxx"
|
||||
|
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/thread.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "hw/i386/apic_internal.h"
|
||||
#include "hw/i386/apic.h"
|
||||
#include "hw/intc/ioapic.h"
|
||||
|
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/bitmap.h"
|
||||
#include "hw/pci/pci.h"
|
||||
#include "hw/core/cpu.h"
|
||||
|
@@ -44,6 +44,8 @@
|
||||
#include "sysemu/tpm.h"
|
||||
#include "sysemu/block-backend.h"
|
||||
#include "hw/block/flash.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
|
||||
static void virt_flash_create(LoongArchMachineState *lams)
|
||||
{
|
||||
@@ -397,7 +399,7 @@ static struct _loaderparams {
|
||||
|
||||
static uint64_t cpu_loongarch_virt_to_phys(void *opaque, uint64_t addr)
|
||||
{
|
||||
return addr & 0x1fffffffll;
|
||||
return addr & MAKE_64BIT_MASK(0, TARGET_PHYS_ADDR_SPACE_BITS);
|
||||
}
|
||||
|
||||
static int64_t load_kernel_info(void)
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include "hw/block/fdc.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "ui/console.h"
|
||||
#include "target/m68k/cpu.h"
|
||||
#include "migration/vmstate.h"
|
||||
|
@@ -45,6 +45,7 @@
|
||||
#include "hw/block/swim.h"
|
||||
#include "net/net.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "sysemu/qtest.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "sysemu/reset.h"
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "bootinfo.h"
|
||||
#include "net/net.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "sysemu/qtest.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "sysemu/reset.h"
|
||||
|
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "hw/mem/memory-device.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/boards.h"
|
||||
|
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/sysbus.h"
|
||||
|
@@ -765,7 +765,7 @@ e1000e_process_tx_desc(E1000ECore *core,
|
||||
}
|
||||
|
||||
tx->skip_cp = false;
|
||||
net_tx_pkt_reset(tx->tx_pkt);
|
||||
net_tx_pkt_reset(tx->tx_pkt, core->owner);
|
||||
|
||||
tx->sum_needed = 0;
|
||||
tx->cptse = 0;
|
||||
@@ -3447,7 +3447,7 @@ e1000e_core_pci_uninit(E1000ECore *core)
|
||||
qemu_del_vm_change_state_handler(core->vmstate);
|
||||
|
||||
for (i = 0; i < E1000E_NUM_QUEUES; i++) {
|
||||
net_tx_pkt_reset(core->tx[i].tx_pkt);
|
||||
net_tx_pkt_reset(core->tx[i].tx_pkt, core->owner);
|
||||
net_tx_pkt_uninit(core->tx[i].tx_pkt);
|
||||
}
|
||||
|
||||
@@ -3572,7 +3572,7 @@ static void e1000e_reset(E1000ECore *core, bool sw)
|
||||
e1000x_reset_mac_addr(core->owner_nic, core->mac, core->permanent_mac);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(core->tx); i++) {
|
||||
net_tx_pkt_reset(core->tx[i].tx_pkt);
|
||||
net_tx_pkt_reset(core->tx[i].tx_pkt, core->owner);
|
||||
memset(&core->tx[i].props, 0, sizeof(core->tx[i].props));
|
||||
core->tx[i].skip_cp = false;
|
||||
}
|
||||
|
@@ -335,6 +335,7 @@
|
||||
#define E1000_ICR_RXDMT0 0x00000010 /* rx desc min. threshold (0) */
|
||||
#define E1000_ICR_RXO 0x00000040 /* rx overrun */
|
||||
#define E1000_ICR_RXT0 0x00000080 /* rx timer intr (ring 0) */
|
||||
#define E1000_ICR_RXDW 0x00000080 /* rx desc written back */
|
||||
#define E1000_ICR_MDAC 0x00000200 /* MDIO access complete */
|
||||
#define E1000_ICR_RXCFG 0x00000400 /* RX /c/ ordered set */
|
||||
#define E1000_ICR_GPI_EN0 0x00000800 /* GP Int 0 */
|
||||
@@ -378,6 +379,7 @@
|
||||
#define E1000_ICS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */
|
||||
#define E1000_ICS_RXO E1000_ICR_RXO /* rx overrun */
|
||||
#define E1000_ICS_RXT0 E1000_ICR_RXT0 /* rx timer intr */
|
||||
#define E1000_ICS_RXDW E1000_ICR_RXDW /* rx desc written back */
|
||||
#define E1000_ICS_MDAC E1000_ICR_MDAC /* MDIO access complete */
|
||||
#define E1000_ICS_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */
|
||||
#define E1000_ICS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */
|
||||
@@ -407,6 +409,7 @@
|
||||
#define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */
|
||||
#define E1000_IMS_RXO E1000_ICR_RXO /* rx overrun */
|
||||
#define E1000_IMS_RXT0 E1000_ICR_RXT0 /* rx timer intr */
|
||||
#define E1000_IMS_RXDW E1000_ICR_RXDW /* rx desc written back */
|
||||
#define E1000_IMS_MDAC E1000_ICR_MDAC /* MDIO access complete */
|
||||
#define E1000_IMS_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */
|
||||
#define E1000_IMS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */
|
||||
@@ -441,6 +444,7 @@
|
||||
#define E1000_IMC_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */
|
||||
#define E1000_IMC_RXO E1000_ICR_RXO /* rx overrun */
|
||||
#define E1000_IMC_RXT0 E1000_ICR_RXT0 /* rx timer intr */
|
||||
#define E1000_IMC_RXDW E1000_ICR_RXDW /* rx desc written back */
|
||||
#define E1000_IMC_MDAC E1000_ICR_MDAC /* MDIO access complete */
|
||||
#define E1000_IMC_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */
|
||||
#define E1000_IMC_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */
|
||||
|
26
hw/net/igb.c
26
hw/net/igb.c
@@ -502,16 +502,28 @@ static int igb_post_load(void *opaque, int version_id)
|
||||
return igb_core_post_load(&s->core);
|
||||
}
|
||||
|
||||
static const VMStateDescription igb_vmstate_tx = {
|
||||
.name = "igb-tx",
|
||||
static const VMStateDescription igb_vmstate_tx_ctx = {
|
||||
.name = "igb-tx-ctx",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT16(vlan, struct igb_tx),
|
||||
VMSTATE_UINT16(mss, struct igb_tx),
|
||||
VMSTATE_BOOL(tse, struct igb_tx),
|
||||
VMSTATE_BOOL(ixsm, struct igb_tx),
|
||||
VMSTATE_BOOL(txsm, struct igb_tx),
|
||||
VMSTATE_UINT32(vlan_macip_lens, struct e1000_adv_tx_context_desc),
|
||||
VMSTATE_UINT32(seqnum_seed, struct e1000_adv_tx_context_desc),
|
||||
VMSTATE_UINT32(type_tucmd_mlhl, struct e1000_adv_tx_context_desc),
|
||||
VMSTATE_UINT32(mss_l4len_idx, struct e1000_adv_tx_context_desc),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
|
||||
static const VMStateDescription igb_vmstate_tx = {
|
||||
.name = "igb-tx",
|
||||
.version_id = 2,
|
||||
.minimum_version_id = 2,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_STRUCT_ARRAY(ctx, struct igb_tx, 2, 0, igb_vmstate_tx_ctx,
|
||||
struct e1000_adv_tx_context_desc),
|
||||
VMSTATE_UINT32(first_cmd_type_len, struct igb_tx),
|
||||
VMSTATE_UINT32(first_olinfo_status, struct igb_tx),
|
||||
VMSTATE_BOOL(first, struct igb_tx),
|
||||
VMSTATE_BOOL(skip_cp, struct igb_tx),
|
||||
VMSTATE_END_OF_LIST()
|
||||
|
@@ -386,11 +386,35 @@ igb_rss_parse_packet(IGBCore *core, struct NetRxPkt *pkt, bool tx,
|
||||
info->queue = E1000_RSS_QUEUE(&core->mac[RETA], info->hash);
|
||||
}
|
||||
|
||||
static void
|
||||
igb_tx_insert_vlan(IGBCore *core, uint16_t qn, struct igb_tx *tx,
|
||||
uint16_t vlan, bool insert_vlan)
|
||||
{
|
||||
if (core->mac[MRQC] & 1) {
|
||||
uint16_t pool = qn % IGB_NUM_VM_POOLS;
|
||||
|
||||
if (core->mac[VMVIR0 + pool] & E1000_VMVIR_VLANA_DEFAULT) {
|
||||
/* always insert default VLAN */
|
||||
insert_vlan = true;
|
||||
vlan = core->mac[VMVIR0 + pool] & 0xffff;
|
||||
} else if (core->mac[VMVIR0 + pool] & E1000_VMVIR_VLANA_NEVER) {
|
||||
insert_vlan = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (insert_vlan && e1000x_vlan_enabled(core->mac)) {
|
||||
net_tx_pkt_setup_vlan_header_ex(tx->tx_pkt, vlan,
|
||||
core->mac[VET] & 0xffff);
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
igb_setup_tx_offloads(IGBCore *core, struct igb_tx *tx)
|
||||
{
|
||||
if (tx->tse) {
|
||||
if (!net_tx_pkt_build_vheader(tx->tx_pkt, true, true, tx->mss)) {
|
||||
if (tx->first_cmd_type_len & E1000_ADVTXD_DCMD_TSE) {
|
||||
uint32_t idx = (tx->first_olinfo_status >> 4) & 1;
|
||||
uint32_t mss = tx->ctx[idx].mss_l4len_idx >> 16;
|
||||
if (!net_tx_pkt_build_vheader(tx->tx_pkt, true, true, mss)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -399,13 +423,13 @@ igb_setup_tx_offloads(IGBCore *core, struct igb_tx *tx)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tx->txsm) {
|
||||
if (tx->first_olinfo_status & E1000_ADVTXD_POTS_TXSM) {
|
||||
if (!net_tx_pkt_build_vheader(tx->tx_pkt, false, true, 0)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (tx->ixsm) {
|
||||
if (tx->first_olinfo_status & E1000_ADVTXD_POTS_IXSM) {
|
||||
net_tx_pkt_update_ip_hdr_checksum(tx->tx_pkt);
|
||||
}
|
||||
|
||||
@@ -490,7 +514,7 @@ igb_tx_pkt_send(IGBCore *core, struct igb_tx *tx, int queue_index)
|
||||
}
|
||||
|
||||
static void
|
||||
igb_on_tx_done_update_stats(IGBCore *core, struct NetTxPkt *tx_pkt)
|
||||
igb_on_tx_done_update_stats(IGBCore *core, struct NetTxPkt *tx_pkt, int qn)
|
||||
{
|
||||
static const int PTCregs[6] = { PTC64, PTC127, PTC255, PTC511,
|
||||
PTC1023, PTC1522 };
|
||||
@@ -517,17 +541,25 @@ igb_on_tx_done_update_stats(IGBCore *core, struct NetTxPkt *tx_pkt)
|
||||
core->mac[GPTC] = core->mac[TPT];
|
||||
core->mac[GOTCL] = core->mac[TOTL];
|
||||
core->mac[GOTCH] = core->mac[TOTH];
|
||||
|
||||
if (core->mac[MRQC] & 1) {
|
||||
uint16_t pool = qn % IGB_NUM_VM_POOLS;
|
||||
|
||||
core->mac[PVFGOTC0 + (pool * 64)] += tot_len;
|
||||
core->mac[PVFGPTC0 + (pool * 64)]++;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
igb_process_tx_desc(IGBCore *core,
|
||||
PCIDevice *dev,
|
||||
struct igb_tx *tx,
|
||||
union e1000_adv_tx_desc *tx_desc,
|
||||
int queue_index)
|
||||
{
|
||||
struct e1000_adv_tx_context_desc *tx_ctx_desc;
|
||||
uint32_t cmd_type_len;
|
||||
uint32_t olinfo_status;
|
||||
uint32_t idx;
|
||||
uint64_t buffer_addr;
|
||||
uint16_t length;
|
||||
|
||||
@@ -538,20 +570,19 @@ igb_process_tx_desc(IGBCore *core,
|
||||
E1000_ADVTXD_DTYP_DATA) {
|
||||
/* advanced transmit data descriptor */
|
||||
if (tx->first) {
|
||||
olinfo_status = le32_to_cpu(tx_desc->read.olinfo_status);
|
||||
|
||||
tx->tse = !!(cmd_type_len & E1000_ADVTXD_DCMD_TSE);
|
||||
tx->ixsm = !!(olinfo_status & E1000_ADVTXD_POTS_IXSM);
|
||||
tx->txsm = !!(olinfo_status & E1000_ADVTXD_POTS_TXSM);
|
||||
|
||||
tx->first_cmd_type_len = cmd_type_len;
|
||||
tx->first_olinfo_status = le32_to_cpu(tx_desc->read.olinfo_status);
|
||||
tx->first = false;
|
||||
}
|
||||
} else if ((cmd_type_len & E1000_ADVTXD_DTYP_CTXT) ==
|
||||
E1000_ADVTXD_DTYP_CTXT) {
|
||||
/* advanced transmit context descriptor */
|
||||
tx_ctx_desc = (struct e1000_adv_tx_context_desc *)tx_desc;
|
||||
tx->vlan = le32_to_cpu(tx_ctx_desc->vlan_macip_lens) >> 16;
|
||||
tx->mss = le32_to_cpu(tx_ctx_desc->mss_l4len_idx) >> 16;
|
||||
idx = (le32_to_cpu(tx_ctx_desc->mss_l4len_idx) >> 4) & 1;
|
||||
tx->ctx[idx].vlan_macip_lens = le32_to_cpu(tx_ctx_desc->vlan_macip_lens);
|
||||
tx->ctx[idx].seqnum_seed = le32_to_cpu(tx_ctx_desc->seqnum_seed);
|
||||
tx->ctx[idx].type_tucmd_mlhl = le32_to_cpu(tx_ctx_desc->type_tucmd_mlhl);
|
||||
tx->ctx[idx].mss_l4len_idx = le32_to_cpu(tx_ctx_desc->mss_l4len_idx);
|
||||
return;
|
||||
} else {
|
||||
/* unknown descriptor type */
|
||||
@@ -574,18 +605,19 @@ igb_process_tx_desc(IGBCore *core,
|
||||
|
||||
if (cmd_type_len & E1000_TXD_CMD_EOP) {
|
||||
if (!tx->skip_cp && net_tx_pkt_parse(tx->tx_pkt)) {
|
||||
if (cmd_type_len & E1000_TXD_CMD_VLE) {
|
||||
net_tx_pkt_setup_vlan_header_ex(tx->tx_pkt, tx->vlan,
|
||||
core->mac[VET] & 0xffff);
|
||||
}
|
||||
idx = (tx->first_olinfo_status >> 4) & 1;
|
||||
igb_tx_insert_vlan(core, queue_index, tx,
|
||||
tx->ctx[idx].vlan_macip_lens >> 16,
|
||||
!!(cmd_type_len & E1000_TXD_CMD_VLE));
|
||||
|
||||
if (igb_tx_pkt_send(core, tx, queue_index)) {
|
||||
igb_on_tx_done_update_stats(core, tx->tx_pkt);
|
||||
igb_on_tx_done_update_stats(core, tx->tx_pkt, queue_index);
|
||||
}
|
||||
}
|
||||
|
||||
tx->first = true;
|
||||
tx->skip_cp = false;
|
||||
net_tx_pkt_reset(tx->tx_pkt);
|
||||
net_tx_pkt_reset(tx->tx_pkt, dev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -780,6 +812,18 @@ igb_txdesc_writeback(IGBCore *core, dma_addr_t base,
|
||||
return igb_tx_wb_eic(core, txi->idx);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
igb_tx_enabled(IGBCore *core, const E1000E_RingInfo *txi)
|
||||
{
|
||||
bool vmdq = core->mac[MRQC] & 1;
|
||||
uint16_t qn = txi->idx;
|
||||
uint16_t pool = qn % IGB_NUM_VM_POOLS;
|
||||
|
||||
return (core->mac[TCTL] & E1000_TCTL_EN) &&
|
||||
(!vmdq || core->mac[VFTE] & BIT(pool)) &&
|
||||
(core->mac[TXDCTL0 + (qn * 16)] & E1000_TXDCTL_QUEUE_ENABLE);
|
||||
}
|
||||
|
||||
static void
|
||||
igb_start_xmit(IGBCore *core, const IGB_TxRing *txr)
|
||||
{
|
||||
@@ -789,8 +833,7 @@ igb_start_xmit(IGBCore *core, const IGB_TxRing *txr)
|
||||
const E1000E_RingInfo *txi = txr->i;
|
||||
uint32_t eic = 0;
|
||||
|
||||
/* TODO: check if the queue itself is enabled too. */
|
||||
if (!(core->mac[TCTL] & E1000_TCTL_EN)) {
|
||||
if (!igb_tx_enabled(core, txi)) {
|
||||
trace_e1000e_tx_disabled();
|
||||
return;
|
||||
}
|
||||
@@ -800,6 +843,8 @@ igb_start_xmit(IGBCore *core, const IGB_TxRing *txr)
|
||||
d = core->owner;
|
||||
}
|
||||
|
||||
net_tx_pkt_reset(txr->tx->tx_pkt, d);
|
||||
|
||||
while (!igb_ring_empty(core, txi)) {
|
||||
base = igb_ring_head_descr(core, txi);
|
||||
|
||||
@@ -808,7 +853,7 @@ igb_start_xmit(IGBCore *core, const IGB_TxRing *txr)
|
||||
trace_e1000e_tx_descr((void *)(intptr_t)desc.read.buffer_addr,
|
||||
desc.read.cmd_type_len, desc.wb.status);
|
||||
|
||||
igb_process_tx_desc(core, txr->tx, &desc, txi->idx);
|
||||
igb_process_tx_desc(core, d, txr->tx, &desc, txi->idx);
|
||||
igb_ring_advance(core, txi, 1);
|
||||
eic |= igb_txdesc_writeback(core, base, &desc, txi);
|
||||
}
|
||||
@@ -866,6 +911,9 @@ igb_can_receive(IGBCore *core)
|
||||
|
||||
for (i = 0; i < IGB_NUM_QUEUES; i++) {
|
||||
E1000E_RxRing rxr;
|
||||
if (!(core->mac[RXDCTL0 + (i * 16)] & E1000_RXDCTL_QUEUE_ENABLE)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
igb_rx_ring_init(core, &rxr, i);
|
||||
if (igb_ring_enabled(core, rxr.i) && igb_has_rxbufs(core, rxr.i, 1)) {
|
||||
@@ -901,12 +949,26 @@ igb_rx_l4_cso_enabled(IGBCore *core)
|
||||
return !!(core->mac[RXCSUM] & E1000_RXCSUM_TUOFLD);
|
||||
}
|
||||
|
||||
static bool
|
||||
igb_rx_is_oversized(IGBCore *core, uint16_t qn, size_t size)
|
||||
{
|
||||
uint16_t pool = qn % IGB_NUM_VM_POOLS;
|
||||
bool lpe = !!(core->mac[VMOLR0 + pool] & E1000_VMOLR_LPE);
|
||||
int max_ethernet_lpe_size =
|
||||
core->mac[VMOLR0 + pool] & E1000_VMOLR_RLPML_MASK;
|
||||
int max_ethernet_vlan_size = 1522;
|
||||
|
||||
return size > (lpe ? max_ethernet_lpe_size : max_ethernet_vlan_size);
|
||||
}
|
||||
|
||||
static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr,
|
||||
E1000E_RSSInfo *rss_info, bool *external_tx)
|
||||
size_t size, E1000E_RSSInfo *rss_info,
|
||||
bool *external_tx)
|
||||
{
|
||||
static const int ta_shift[] = { 4, 3, 2, 0 };
|
||||
uint32_t f, ra[2], *macp, rctl = core->mac[RCTL];
|
||||
uint16_t queues = 0;
|
||||
uint16_t oversized = 0;
|
||||
uint16_t vid = lduw_be_p(&PKT_GET_VLAN_HDR(ehdr)->h_tci) & VLAN_VID_MASK;
|
||||
bool accepted = false;
|
||||
int i;
|
||||
@@ -932,7 +994,7 @@ static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr,
|
||||
|
||||
if (core->mac[MRQC] & 1) {
|
||||
if (is_broadcast_ether_addr(ehdr->h_dest)) {
|
||||
for (i = 0; i < 8; i++) {
|
||||
for (i = 0; i < IGB_NUM_VM_POOLS; i++) {
|
||||
if (core->mac[VMOLR0 + i] & E1000_VMOLR_BAM) {
|
||||
queues |= BIT(i);
|
||||
}
|
||||
@@ -966,7 +1028,7 @@ static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr,
|
||||
f = ta_shift[(rctl >> E1000_RCTL_MO_SHIFT) & 3];
|
||||
f = (((ehdr->h_dest[5] << 8) | ehdr->h_dest[4]) >> f) & 0xfff;
|
||||
if (macp[f >> 5] & (1 << (f & 0x1f))) {
|
||||
for (i = 0; i < 8; i++) {
|
||||
for (i = 0; i < IGB_NUM_VM_POOLS; i++) {
|
||||
if (core->mac[VMOLR0 + i] & E1000_VMOLR_ROMPE) {
|
||||
queues |= BIT(i);
|
||||
}
|
||||
@@ -989,7 +1051,7 @@ static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 8; i++) {
|
||||
for (i = 0; i < IGB_NUM_VM_POOLS; i++) {
|
||||
if (core->mac[VMOLR0 + i] & E1000_VMOLR_AUPE) {
|
||||
mask |= BIT(i);
|
||||
}
|
||||
@@ -1005,9 +1067,34 @@ static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr,
|
||||
queues = BIT(def_pl >> E1000_VT_CTL_DEFAULT_POOL_SHIFT);
|
||||
}
|
||||
|
||||
igb_rss_parse_packet(core, core->rx_pkt, external_tx != NULL, rss_info);
|
||||
if (rss_info->queue & 1) {
|
||||
queues <<= 8;
|
||||
queues &= core->mac[VFRE];
|
||||
if (queues) {
|
||||
for (i = 0; i < IGB_NUM_VM_POOLS; i++) {
|
||||
if ((queues & BIT(i)) && igb_rx_is_oversized(core, i, size)) {
|
||||
oversized |= BIT(i);
|
||||
}
|
||||
}
|
||||
/* 8.19.37 increment ROC if packet is oversized for all queues */
|
||||
if (oversized == queues) {
|
||||
trace_e1000x_rx_oversized(size);
|
||||
e1000x_inc_reg_if_not_full(core->mac, ROC);
|
||||
}
|
||||
queues &= ~oversized;
|
||||
}
|
||||
|
||||
if (queues) {
|
||||
igb_rss_parse_packet(core, core->rx_pkt,
|
||||
external_tx != NULL, rss_info);
|
||||
/* Sec 8.26.1: PQn = VFn + VQn*8 */
|
||||
if (rss_info->queue & 1) {
|
||||
for (i = 0; i < IGB_NUM_VM_POOLS; i++) {
|
||||
if ((queues & BIT(i)) &&
|
||||
(core->mac[VMOLR0 + i] & E1000_VMOLR_RSSE)) {
|
||||
queues |= BIT(i + IGB_NUM_VM_POOLS);
|
||||
queues &= ~BIT(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch (net_rx_pkt_get_packet_type(core->rx_pkt)) {
|
||||
@@ -1350,7 +1437,8 @@ igb_write_to_rx_buffers(IGBCore *core,
|
||||
}
|
||||
|
||||
static void
|
||||
igb_update_rx_stats(IGBCore *core, size_t data_size, size_t data_fcs_size)
|
||||
igb_update_rx_stats(IGBCore *core, const E1000E_RingInfo *rxi,
|
||||
size_t data_size, size_t data_fcs_size)
|
||||
{
|
||||
e1000x_update_rx_total_stats(core->mac, data_size, data_fcs_size);
|
||||
|
||||
@@ -1366,6 +1454,16 @@ igb_update_rx_stats(IGBCore *core, size_t data_size, size_t data_fcs_size)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (core->mac[MRQC] & 1) {
|
||||
uint16_t pool = rxi->idx % IGB_NUM_VM_POOLS;
|
||||
|
||||
core->mac[PVFGORC0 + (pool * 64)] += data_size + 4;
|
||||
core->mac[PVFGPRC0 + (pool * 64)]++;
|
||||
if (net_rx_pkt_get_packet_type(core->rx_pkt) == ETH_PKT_MCAST) {
|
||||
core->mac[PVFMPRC0 + (pool * 64)]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool
|
||||
@@ -1467,7 +1565,21 @@ igb_write_packet_to_guest(IGBCore *core, struct NetRxPkt *pkt,
|
||||
|
||||
} while (desc_offset < total_size);
|
||||
|
||||
igb_update_rx_stats(core, size, total_size);
|
||||
igb_update_rx_stats(core, rxi, size, total_size);
|
||||
}
|
||||
|
||||
static bool
|
||||
igb_rx_strip_vlan(IGBCore *core, const E1000E_RingInfo *rxi)
|
||||
{
|
||||
if (core->mac[MRQC] & 1) {
|
||||
uint16_t pool = rxi->idx % IGB_NUM_VM_POOLS;
|
||||
/* Sec 7.10.3.8: CTRL.VME is ignored, only VMOLR/RPLOLR is used */
|
||||
return (net_rx_pkt_get_packet_type(core->rx_pkt) == ETH_PKT_MCAST) ?
|
||||
core->mac[RPLOLR] & E1000_RPLOLR_STRVLAN :
|
||||
core->mac[VMOLR0 + pool] & E1000_VMOLR_STRVLAN;
|
||||
}
|
||||
|
||||
return e1000x_vlan_enabled(core->mac);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -1550,34 +1662,36 @@ igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt,
|
||||
|
||||
ehdr = PKT_GET_ETH_HDR(filter_buf);
|
||||
net_rx_pkt_set_packet_type(core->rx_pkt, get_eth_packet_type(ehdr));
|
||||
net_rx_pkt_set_protocols(core->rx_pkt, filter_buf, size);
|
||||
|
||||
net_rx_pkt_attach_iovec_ex(core->rx_pkt, iov, iovcnt, iov_ofs,
|
||||
e1000x_vlan_enabled(core->mac),
|
||||
core->mac[VET] & 0xffff);
|
||||
|
||||
queues = igb_receive_assign(core, ehdr, &rss_info, external_tx);
|
||||
queues = igb_receive_assign(core, ehdr, size, &rss_info, external_tx);
|
||||
if (!queues) {
|
||||
trace_e1000e_rx_flt_dropped();
|
||||
return orig_size;
|
||||
}
|
||||
|
||||
total_size = net_rx_pkt_get_total_len(core->rx_pkt) +
|
||||
e1000x_fcs_len(core->mac);
|
||||
|
||||
for (i = 0; i < IGB_NUM_QUEUES; i++) {
|
||||
if (!(queues & BIT(i))) {
|
||||
if (!(queues & BIT(i)) ||
|
||||
!(core->mac[RXDCTL0 + (i * 16)] & E1000_RXDCTL_QUEUE_ENABLE)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
igb_rx_ring_init(core, &rxr, i);
|
||||
|
||||
net_rx_pkt_attach_iovec_ex(core->rx_pkt, iov, iovcnt, iov_ofs,
|
||||
igb_rx_strip_vlan(core, rxr.i),
|
||||
core->mac[VET] & 0xffff);
|
||||
|
||||
total_size = net_rx_pkt_get_total_len(core->rx_pkt) +
|
||||
e1000x_fcs_len(core->mac);
|
||||
|
||||
if (!igb_has_rxbufs(core, rxr.i, total_size)) {
|
||||
n |= E1000_ICS_RXO;
|
||||
trace_e1000e_rx_not_written_to_guest(rxr.i->idx);
|
||||
continue;
|
||||
}
|
||||
|
||||
n |= E1000_ICR_RXT0;
|
||||
n |= E1000_ICR_RXDW;
|
||||
|
||||
igb_rx_fix_l4_csum(core, core->rx_pkt);
|
||||
igb_write_packet_to_guest(core, core->rx_pkt, &rxr, &rss_info);
|
||||
@@ -1892,14 +2006,6 @@ static void igb_set_eims(IGBCore *core, int index, uint32_t val)
|
||||
igb_update_interrupt_state(core);
|
||||
}
|
||||
|
||||
static void igb_vf_reset(IGBCore *core, uint16_t vfn)
|
||||
{
|
||||
/* TODO: Reset of the queue enable and the interrupt registers of the VF. */
|
||||
|
||||
core->mac[V2PMAILBOX0 + vfn] &= ~E1000_V2PMAILBOX_RSTI;
|
||||
core->mac[V2PMAILBOX0 + vfn] = E1000_V2PMAILBOX_RSTD;
|
||||
}
|
||||
|
||||
static void mailbox_interrupt_to_vf(IGBCore *core, uint16_t vfn)
|
||||
{
|
||||
uint32_t ent = core->mac[VTIVAR_MISC + vfn];
|
||||
@@ -1977,6 +2083,24 @@ static void igb_set_vfmailbox(IGBCore *core, int index, uint32_t val)
|
||||
}
|
||||
}
|
||||
|
||||
static void igb_vf_reset(IGBCore *core, uint16_t vfn)
|
||||
{
|
||||
uint16_t qn0 = vfn;
|
||||
uint16_t qn1 = vfn + IGB_NUM_VM_POOLS;
|
||||
|
||||
/* disable Rx and Tx for the VF*/
|
||||
core->mac[RXDCTL0 + (qn0 * 16)] &= ~E1000_RXDCTL_QUEUE_ENABLE;
|
||||
core->mac[RXDCTL0 + (qn1 * 16)] &= ~E1000_RXDCTL_QUEUE_ENABLE;
|
||||
core->mac[TXDCTL0 + (qn0 * 16)] &= ~E1000_TXDCTL_QUEUE_ENABLE;
|
||||
core->mac[TXDCTL0 + (qn1 * 16)] &= ~E1000_TXDCTL_QUEUE_ENABLE;
|
||||
core->mac[VFRE] &= ~BIT(vfn);
|
||||
core->mac[VFTE] &= ~BIT(vfn);
|
||||
/* indicate VF reset to PF */
|
||||
core->mac[VFLRE] |= BIT(vfn);
|
||||
/* VFLRE and mailbox use the same interrupt cause */
|
||||
mailbox_interrupt_to_pf(core);
|
||||
}
|
||||
|
||||
static void igb_w1c(IGBCore *core, int index, uint32_t val)
|
||||
{
|
||||
core->mac[index] &= ~val;
|
||||
@@ -2231,14 +2355,20 @@ igb_set_status(IGBCore *core, int index, uint32_t val)
|
||||
static void
|
||||
igb_set_ctrlext(IGBCore *core, int index, uint32_t val)
|
||||
{
|
||||
trace_e1000e_link_set_ext_params(!!(val & E1000_CTRL_EXT_ASDCHK),
|
||||
!!(val & E1000_CTRL_EXT_SPD_BYPS));
|
||||
|
||||
/* TODO: PFRSTD */
|
||||
trace_igb_link_set_ext_params(!!(val & E1000_CTRL_EXT_ASDCHK),
|
||||
!!(val & E1000_CTRL_EXT_SPD_BYPS),
|
||||
!!(val & E1000_CTRL_EXT_PFRSTD));
|
||||
|
||||
/* Zero self-clearing bits */
|
||||
val &= ~(E1000_CTRL_EXT_ASDCHK | E1000_CTRL_EXT_EE_RST);
|
||||
core->mac[CTRL_EXT] = val;
|
||||
|
||||
if (core->mac[CTRL_EXT] & E1000_CTRL_EXT_PFRSTD) {
|
||||
for (int vfn = 0; vfn < IGB_MAX_VF_FUNCTIONS; vfn++) {
|
||||
core->mac[V2PMAILBOX0 + vfn] &= ~E1000_V2PMAILBOX_RSTI;
|
||||
core->mac[V2PMAILBOX0 + vfn] |= E1000_V2PMAILBOX_RSTD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3825,7 +3955,7 @@ igb_core_pci_realize(IGBCore *core,
|
||||
core->vmstate = qemu_add_vm_change_state_handler(igb_vm_state_change, core);
|
||||
|
||||
for (i = 0; i < IGB_NUM_QUEUES; i++) {
|
||||
net_tx_pkt_init(&core->tx[i].tx_pkt, core->owner, E1000E_MAX_TX_FRAGS);
|
||||
net_tx_pkt_init(&core->tx[i].tx_pkt, NULL, E1000E_MAX_TX_FRAGS);
|
||||
}
|
||||
|
||||
net_rx_pkt_init(&core->rx_pkt);
|
||||
@@ -3850,7 +3980,7 @@ igb_core_pci_uninit(IGBCore *core)
|
||||
qemu_del_vm_change_state_handler(core->vmstate);
|
||||
|
||||
for (i = 0; i < IGB_NUM_QUEUES; i++) {
|
||||
net_tx_pkt_reset(core->tx[i].tx_pkt);
|
||||
net_tx_pkt_reset(core->tx[i].tx_pkt, NULL);
|
||||
net_tx_pkt_uninit(core->tx[i].tx_pkt);
|
||||
}
|
||||
|
||||
@@ -3899,6 +4029,7 @@ igb_phy_reg_init[] = {
|
||||
static const uint32_t igb_mac_reg_init[] = {
|
||||
[LEDCTL] = 2 | (3 << 8) | BIT(15) | (6 << 16) | (7 << 24),
|
||||
[EEMNGCTL] = BIT(31),
|
||||
[TXDCTL0] = E1000_TXDCTL_QUEUE_ENABLE,
|
||||
[RXDCTL0] = E1000_RXDCTL_QUEUE_ENABLE | (1 << 16),
|
||||
[RXDCTL1] = 1 << 16,
|
||||
[RXDCTL2] = 1 << 16,
|
||||
@@ -4021,14 +4152,15 @@ static void igb_reset(IGBCore *core, bool sw)
|
||||
|
||||
e1000x_reset_mac_addr(core->owner_nic, core->mac, core->permanent_mac);
|
||||
|
||||
for (int vfn = 0; vfn < IGB_MAX_VF_FUNCTIONS; vfn++) {
|
||||
/* Set RSTI, so VF can identify a PF reset is in progress */
|
||||
core->mac[V2PMAILBOX0 + vfn] |= E1000_V2PMAILBOX_RSTI;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(core->tx); i++) {
|
||||
tx = &core->tx[i];
|
||||
net_tx_pkt_reset(tx->tx_pkt);
|
||||
tx->vlan = 0;
|
||||
tx->mss = 0;
|
||||
tx->tse = false;
|
||||
tx->ixsm = false;
|
||||
tx->txsm = false;
|
||||
net_tx_pkt_reset(tx->tx_pkt, NULL);
|
||||
memset(tx->ctx, 0, sizeof(tx->ctx));
|
||||
tx->first = true;
|
||||
tx->skip_cp = false;
|
||||
}
|
||||
|
@@ -47,6 +47,7 @@
|
||||
#define IGB_MSIX_VEC_NUM (10)
|
||||
#define IGBVF_MSIX_VEC_NUM (3)
|
||||
#define IGB_NUM_QUEUES (16)
|
||||
#define IGB_NUM_VM_POOLS (8)
|
||||
|
||||
typedef struct IGBCore IGBCore;
|
||||
|
||||
@@ -72,11 +73,9 @@ struct IGBCore {
|
||||
QEMUTimer *autoneg_timer;
|
||||
|
||||
struct igb_tx {
|
||||
uint16_t vlan; /* VLAN Tag */
|
||||
uint16_t mss; /* Maximum Segment Size */
|
||||
bool tse; /* TCP/UDP Segmentation Enable */
|
||||
bool ixsm; /* Insert IP Checksum */
|
||||
bool txsm; /* Insert TCP/UDP Checksum */
|
||||
struct e1000_adv_tx_context_desc ctx[2];
|
||||
uint32_t first_cmd_type_len;
|
||||
uint32_t first_olinfo_status;
|
||||
|
||||
bool first;
|
||||
bool skip_cp;
|
||||
|
@@ -160,6 +160,9 @@ union e1000_adv_rx_desc {
|
||||
#define E1000_MRQC_RSS_FIELD_IPV6_UDP 0x00800000
|
||||
#define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000
|
||||
|
||||
/* Additional Transmit Descriptor Control definitions */
|
||||
#define E1000_TXDCTL_QUEUE_ENABLE 0x02000000 /* Enable specific Tx Queue */
|
||||
|
||||
/* Additional Receive Descriptor Control definitions */
|
||||
#define E1000_RXDCTL_QUEUE_ENABLE 0x02000000 /* Enable specific Rx Queue */
|
||||
|
||||
@@ -240,6 +243,9 @@ union e1000_adv_rx_desc {
|
||||
|
||||
/* from igb/e1000_defines.h */
|
||||
|
||||
/* Physical Func Reset Done Indication */
|
||||
#define E1000_CTRL_EXT_PFRSTD 0x00004000
|
||||
|
||||
#define E1000_IVAR_VALID 0x80
|
||||
#define E1000_GPIE_NSICR 0x00000001
|
||||
#define E1000_GPIE_MSIX_MODE 0x00000010
|
||||
|
@@ -43,7 +43,11 @@ struct NetTxPkt {
|
||||
struct iovec *vec;
|
||||
|
||||
uint8_t l2_hdr[ETH_MAX_L2_HDR_LEN];
|
||||
uint8_t l3_hdr[ETH_MAX_IP_DGRAM_LEN];
|
||||
union {
|
||||
struct ip_header ip;
|
||||
struct ip6_header ip6;
|
||||
uint8_t octets[ETH_MAX_IP_DGRAM_LEN];
|
||||
} l3_hdr;
|
||||
|
||||
uint32_t payload_len;
|
||||
|
||||
@@ -89,16 +93,14 @@ void net_tx_pkt_update_ip_hdr_checksum(struct NetTxPkt *pkt)
|
||||
{
|
||||
uint16_t csum;
|
||||
assert(pkt);
|
||||
struct ip_header *ip_hdr;
|
||||
ip_hdr = pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base;
|
||||
|
||||
ip_hdr->ip_len = cpu_to_be16(pkt->payload_len +
|
||||
pkt->l3_hdr.ip.ip_len = cpu_to_be16(pkt->payload_len +
|
||||
pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_len);
|
||||
|
||||
ip_hdr->ip_sum = 0;
|
||||
csum = net_raw_checksum((uint8_t *)ip_hdr,
|
||||
pkt->l3_hdr.ip.ip_sum = 0;
|
||||
csum = net_raw_checksum(pkt->l3_hdr.octets,
|
||||
pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_len);
|
||||
ip_hdr->ip_sum = cpu_to_be16(csum);
|
||||
pkt->l3_hdr.ip.ip_sum = cpu_to_be16(csum);
|
||||
}
|
||||
|
||||
void net_tx_pkt_update_ip_checksums(struct NetTxPkt *pkt)
|
||||
@@ -443,7 +445,7 @@ void net_tx_pkt_dump(struct NetTxPkt *pkt)
|
||||
#endif
|
||||
}
|
||||
|
||||
void net_tx_pkt_reset(struct NetTxPkt *pkt)
|
||||
void net_tx_pkt_reset(struct NetTxPkt *pkt, PCIDevice *pci_dev)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -467,6 +469,7 @@ void net_tx_pkt_reset(struct NetTxPkt *pkt)
|
||||
pkt->raw[i].iov_len, DMA_DIRECTION_TO_DEVICE, 0);
|
||||
}
|
||||
}
|
||||
pkt->pci_dev = pci_dev;
|
||||
pkt->raw_frags = 0;
|
||||
|
||||
pkt->hdr_len = 0;
|
||||
@@ -795,11 +798,13 @@ bool net_tx_pkt_send_custom(struct NetTxPkt *pkt, bool offload,
|
||||
{
|
||||
assert(pkt);
|
||||
|
||||
uint8_t gso_type = pkt->virt_hdr.gso_type & ~VIRTIO_NET_HDR_GSO_ECN;
|
||||
|
||||
/*
|
||||
* Since underlying infrastructure does not support IP datagrams longer
|
||||
* than 64K we should drop such packets and don't even try to send
|
||||
*/
|
||||
if (VIRTIO_NET_HDR_GSO_NONE != pkt->virt_hdr.gso_type) {
|
||||
if (VIRTIO_NET_HDR_GSO_NONE != gso_type) {
|
||||
if (pkt->payload_len >
|
||||
ETH_MAX_IP_DGRAM_LEN -
|
||||
pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_len) {
|
||||
@@ -807,7 +812,7 @@ bool net_tx_pkt_send_custom(struct NetTxPkt *pkt, bool offload,
|
||||
}
|
||||
}
|
||||
|
||||
if (offload || pkt->virt_hdr.gso_type == VIRTIO_NET_HDR_GSO_NONE) {
|
||||
if (offload || gso_type == VIRTIO_NET_HDR_GSO_NONE) {
|
||||
if (!offload && pkt->virt_hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
|
||||
net_tx_pkt_do_sw_csum(pkt, &pkt->vec[NET_TX_PKT_L2HDR_FRAG],
|
||||
pkt->payload_frags + NET_TX_PKT_PL_START_FRAG - 1,
|
||||
@@ -829,15 +834,14 @@ void net_tx_pkt_fix_ip6_payload_len(struct NetTxPkt *pkt)
|
||||
{
|
||||
struct iovec *l2 = &pkt->vec[NET_TX_PKT_L2HDR_FRAG];
|
||||
if (eth_get_l3_proto(l2, 1, l2->iov_len) == ETH_P_IPV6) {
|
||||
struct ip6_header *ip6 = (struct ip6_header *) pkt->l3_hdr;
|
||||
/*
|
||||
* TODO: if qemu would support >64K packets - add jumbo option check
|
||||
* something like that:
|
||||
* 'if (ip6->ip6_plen == 0 && !has_jumbo_option(ip6)) {'
|
||||
*/
|
||||
if (ip6->ip6_plen == 0) {
|
||||
if (pkt->l3_hdr.ip6.ip6_plen == 0) {
|
||||
if (pkt->payload_len <= ETH_MAX_IP_DGRAM_LEN) {
|
||||
ip6->ip6_plen = htons(pkt->payload_len);
|
||||
pkt->l3_hdr.ip6.ip6_plen = htons(pkt->payload_len);
|
||||
}
|
||||
/*
|
||||
* TODO: if qemu would support >64K packets
|
||||
|
@@ -148,9 +148,10 @@ void net_tx_pkt_dump(struct NetTxPkt *pkt);
|
||||
* reset tx packet private context (needed to be called between packets)
|
||||
*
|
||||
* @pkt: packet
|
||||
* @dev: PCI device processing the next packet
|
||||
*
|
||||
*/
|
||||
void net_tx_pkt_reset(struct NetTxPkt *pkt);
|
||||
void net_tx_pkt_reset(struct NetTxPkt *pkt, PCIDevice *dev);
|
||||
|
||||
/**
|
||||
* Send packet to qemu. handles sw offloads if vhdr is not supported.
|
||||
|
@@ -280,6 +280,8 @@ igb_core_mdic_read_unhandled(uint32_t addr) "MDIC READ: PHY[%u] UNHANDLED"
|
||||
igb_core_mdic_write(uint32_t addr, uint32_t data) "MDIC WRITE: PHY[%u] = 0x%x"
|
||||
igb_core_mdic_write_unhandled(uint32_t addr) "MDIC WRITE: PHY[%u] UNHANDLED"
|
||||
|
||||
igb_link_set_ext_params(bool asd_check, bool speed_select_bypass, bool pfrstd) "Set extended link params: ASD check: %d, Speed select bypass: %d, PF reset done: %d"
|
||||
|
||||
igb_rx_desc_buff_size(uint32_t b) "buffer size: %u"
|
||||
igb_rx_desc_buff_write(uint64_t addr, uint16_t offset, const void* source, uint32_t len) "addr: 0x%"PRIx64", offset: %u, from: %p, length: %u"
|
||||
|
||||
|
@@ -678,7 +678,7 @@ static void vmxnet3_process_tx_queue(VMXNET3State *s, int qidx)
|
||||
vmxnet3_complete_packet(s, qidx, txd_idx);
|
||||
s->tx_sop = true;
|
||||
s->skip_current_tx_pkt = false;
|
||||
net_tx_pkt_reset(s->tx_pkt);
|
||||
net_tx_pkt_reset(s->tx_pkt, PCI_DEVICE(s));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1159,7 +1159,7 @@ static void vmxnet3_deactivate_device(VMXNET3State *s)
|
||||
{
|
||||
if (s->device_active) {
|
||||
VMW_CBPRN("Deactivating vmxnet3...");
|
||||
net_tx_pkt_reset(s->tx_pkt);
|
||||
net_tx_pkt_reset(s->tx_pkt, PCI_DEVICE(s));
|
||||
net_tx_pkt_uninit(s->tx_pkt);
|
||||
net_rx_pkt_uninit(s->rx_pkt);
|
||||
s->device_active = false;
|
||||
|
@@ -1434,26 +1434,26 @@ uint16_t nvme_bounce_mdata(NvmeCtrl *n, void *ptr, uint32_t len,
|
||||
}
|
||||
|
||||
static inline void nvme_blk_read(BlockBackend *blk, int64_t offset,
|
||||
BlockCompletionFunc *cb, NvmeRequest *req)
|
||||
uint32_t align, BlockCompletionFunc *cb,
|
||||
NvmeRequest *req)
|
||||
{
|
||||
assert(req->sg.flags & NVME_SG_ALLOC);
|
||||
|
||||
if (req->sg.flags & NVME_SG_DMA) {
|
||||
req->aiocb = dma_blk_read(blk, &req->sg.qsg, offset, BDRV_SECTOR_SIZE,
|
||||
cb, req);
|
||||
req->aiocb = dma_blk_read(blk, &req->sg.qsg, offset, align, cb, req);
|
||||
} else {
|
||||
req->aiocb = blk_aio_preadv(blk, offset, &req->sg.iov, 0, cb, req);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void nvme_blk_write(BlockBackend *blk, int64_t offset,
|
||||
BlockCompletionFunc *cb, NvmeRequest *req)
|
||||
uint32_t align, BlockCompletionFunc *cb,
|
||||
NvmeRequest *req)
|
||||
{
|
||||
assert(req->sg.flags & NVME_SG_ALLOC);
|
||||
|
||||
if (req->sg.flags & NVME_SG_DMA) {
|
||||
req->aiocb = dma_blk_write(blk, &req->sg.qsg, offset, BDRV_SECTOR_SIZE,
|
||||
cb, req);
|
||||
req->aiocb = dma_blk_write(blk, &req->sg.qsg, offset, align, cb, req);
|
||||
} else {
|
||||
req->aiocb = blk_aio_pwritev(blk, offset, &req->sg.iov, 0, cb, req);
|
||||
}
|
||||
@@ -2207,10 +2207,10 @@ static void nvme_rw_cb(void *opaque, int ret)
|
||||
}
|
||||
|
||||
if (req->cmd.opcode == NVME_CMD_READ) {
|
||||
return nvme_blk_read(blk, offset, nvme_rw_complete_cb, req);
|
||||
return nvme_blk_read(blk, offset, 1, nvme_rw_complete_cb, req);
|
||||
}
|
||||
|
||||
return nvme_blk_write(blk, offset, nvme_rw_complete_cb, req);
|
||||
return nvme_blk_write(blk, offset, 1, nvme_rw_complete_cb, req);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2378,7 +2378,7 @@ static void nvme_compare_mdata_cb(void *opaque, int ret)
|
||||
|
||||
for (bufp = buf; mbufp < end; bufp += ns->lbaf.ms, mbufp += ns->lbaf.ms) {
|
||||
if (memcmp(bufp + pil, mbufp + pil, ns->lbaf.ms - pil)) {
|
||||
req->status = NVME_CMP_FAILURE;
|
||||
req->status = NVME_CMP_FAILURE | NVME_DNR;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -2387,7 +2387,7 @@ static void nvme_compare_mdata_cb(void *opaque, int ret)
|
||||
}
|
||||
|
||||
if (memcmp(buf, ctx->mdata.bounce, ctx->mdata.iov.size)) {
|
||||
req->status = NVME_CMP_FAILURE;
|
||||
req->status = NVME_CMP_FAILURE | NVME_DNR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -2436,7 +2436,7 @@ static void nvme_compare_data_cb(void *opaque, int ret)
|
||||
}
|
||||
|
||||
if (memcmp(buf, ctx->data.bounce, ctx->data.iov.size)) {
|
||||
req->status = NVME_CMP_FAILURE;
|
||||
req->status = NVME_CMP_FAILURE | NVME_DNR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -2619,6 +2619,9 @@ static uint16_t nvme_dsm(NvmeCtrl *n, NvmeRequest *req)
|
||||
status = nvme_h2c(n, (uint8_t *)iocb->range, sizeof(NvmeDsmRange) * nr,
|
||||
req);
|
||||
if (status) {
|
||||
g_free(iocb->range);
|
||||
qemu_aio_unref(iocb);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -3437,7 +3440,7 @@ static uint16_t nvme_read(NvmeCtrl *n, NvmeRequest *req)
|
||||
|
||||
block_acct_start(blk_get_stats(blk), &req->acct, data_size,
|
||||
BLOCK_ACCT_READ);
|
||||
nvme_blk_read(blk, data_offset, nvme_rw_cb, req);
|
||||
nvme_blk_read(blk, data_offset, BDRV_SECTOR_SIZE, nvme_rw_cb, req);
|
||||
return NVME_NO_COMPLETE;
|
||||
|
||||
invalid:
|
||||
@@ -3607,7 +3610,7 @@ static uint16_t nvme_do_write(NvmeCtrl *n, NvmeRequest *req, bool append,
|
||||
|
||||
block_acct_start(blk_get_stats(blk), &req->acct, data_size,
|
||||
BLOCK_ACCT_WRITE);
|
||||
nvme_blk_write(blk, data_offset, nvme_rw_cb, req);
|
||||
nvme_blk_write(blk, data_offset, BDRV_SECTOR_SIZE, nvme_rw_cb, req);
|
||||
} else {
|
||||
req->aiocb = blk_aio_pwrite_zeroes(blk, data_offset, data_size,
|
||||
BDRV_REQ_MAY_UNMAP, nvme_rw_cb,
|
||||
|
@@ -399,7 +399,8 @@ static bool nvme_ns_init_fdp(NvmeNamespace *ns, Error **errp)
|
||||
NvmeEnduranceGroup *endgrp = ns->endgrp;
|
||||
NvmeRuHandle *ruh;
|
||||
uint8_t lbafi = NVME_ID_NS_FLBAS_INDEX(ns->id_ns.flbas);
|
||||
unsigned int *ruhid, *ruhids;
|
||||
g_autofree unsigned int *ruhids = NULL;
|
||||
unsigned int *ruhid;
|
||||
char *r, *p, *token;
|
||||
uint16_t *ph;
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include "sysemu/device_tree.h"
|
||||
#include "sysemu/qtest.h"
|
||||
#include "sysemu/reset.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
#include <libfdt.h>
|
||||
|
||||
|
@@ -321,9 +321,6 @@ static void gt64120_isd_mapping(GT64120State *s)
|
||||
static void gt64120_update_pci_cfgdata_mapping(GT64120State *s)
|
||||
{
|
||||
/* Indexed on MByteSwap bit, see Table 158: PCI_0 Command, Offset: 0xc00 */
|
||||
static const MemoryRegionOps *pci_host_conf_ops[] = {
|
||||
&pci_host_conf_be_ops, &pci_host_conf_le_ops
|
||||
};
|
||||
static const MemoryRegionOps *pci_host_data_ops[] = {
|
||||
&pci_host_data_be_ops, &pci_host_data_le_ops
|
||||
};
|
||||
@@ -339,15 +336,6 @@ static void gt64120_update_pci_cfgdata_mapping(GT64120State *s)
|
||||
* - Table 16: 32-bit PCI Transaction Endianess
|
||||
* - Table 158: PCI_0 Command, Offset: 0xc00
|
||||
*/
|
||||
if (memory_region_is_mapped(&phb->conf_mem)) {
|
||||
memory_region_del_subregion(&s->ISD_mem, &phb->conf_mem);
|
||||
object_unparent(OBJECT(&phb->conf_mem));
|
||||
}
|
||||
memory_region_init_io(&phb->conf_mem, OBJECT(phb),
|
||||
pci_host_conf_ops[s->regs[GT_PCI0_CMD] & 1],
|
||||
s, "pci-conf-idx", 4);
|
||||
memory_region_add_subregion_overlap(&s->ISD_mem, GT_PCI0_CFGADDR << 2,
|
||||
&phb->conf_mem, 1);
|
||||
|
||||
if (memory_region_is_mapped(&phb->data_mem)) {
|
||||
memory_region_del_subregion(&s->ISD_mem, &phb->data_mem);
|
||||
@@ -1208,6 +1196,12 @@ static void gt64120_realize(DeviceState *dev, Error **errp)
|
||||
PCI_DEVFN(18, 0), TYPE_PCI_BUS);
|
||||
|
||||
pci_create_simple(phb->bus, PCI_DEVFN(0, 0), "gt64120_pci");
|
||||
memory_region_init_io(&phb->conf_mem, OBJECT(phb),
|
||||
&pci_host_conf_le_ops,
|
||||
s, "pci-conf-idx", 4);
|
||||
memory_region_add_subregion_overlap(&s->ISD_mem, GT_PCI0_CFGADDR << 2,
|
||||
&phb->conf_mem, 1);
|
||||
|
||||
|
||||
/*
|
||||
* The whole address space decoded by the GT-64120A doesn't generate
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "exec/address-spaces.h" /* get_system_memory() */
|
||||
#include "hw/irq.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
|
@@ -1,12 +1,14 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qemu/memalign.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "cpu.h"
|
||||
#include "helper_regs.h"
|
||||
#include "hw/ppc/spapr.h"
|
||||
#include "mmu-hash64.h"
|
||||
#include "mmu-book3s-v3.h"
|
||||
|
||||
|
||||
static inline bool valid_ptex(PowerPCCPU *cpu, target_ulong ptex)
|
||||
{
|
||||
/*
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include "qemu/cutils.h"
|
||||
#include "hw/riscv/opentitan.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "hw/boards.h"
|
||||
#include "hw/misc/unimp.h"
|
||||
#include "hw/riscv/boot.h"
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include "hw/boards.h"
|
||||
#include "hw/riscv/shakti_c.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "hw/intc/sifive_plic.h"
|
||||
#include "hw/intc/riscv_aclint.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "hw/acpi/aml-build.h"
|
||||
#include "hw/acpi/utils.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "sysemu/reset.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "hw/riscv/virt.h"
|
||||
|
@@ -156,6 +156,7 @@ static void xlx_spi_do_reset(XilinxSPI *s)
|
||||
txfifo_reset(s);
|
||||
|
||||
s->regs[R_SPISSR] = ~0;
|
||||
s->regs[R_SPICR] = R_SPICR_MTI;
|
||||
xlx_spi_update_irq(s);
|
||||
xlx_spi_update_cs(s);
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <linux/vfio.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "qemu/error-report.h"
|
||||
#include "hw/display/edid.h"
|
||||
#include "ui/console.h"
|
||||
#include "qapi/error.h"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user