Giter Club home page Giter Club logo

qemu-eos's Introduction

QEMU README

QEMU is a generic and open source machine & userspace emulator and virtualizer.

QEMU is capable of emulating a complete machine in software without any need for hardware virtualization support. By using dynamic translation, it achieves very good performance. QEMU can also integrate with the Xen and KVM hypervisors to provide emulated hardware while allowing the hypervisor to manage the CPU. With hypervisor support, QEMU can achieve near native performance for CPUs. When QEMU emulates CPUs directly it is capable of running operating systems made for one machine (e.g. an ARMv7 board) on a different machine (e.g. an x86_64 PC board).

QEMU is also capable of providing userspace API virtualization for Linux and BSD kernel interfaces. This allows binaries compiled against one architecture ABI (e.g. the Linux PPC64 ABI) to be run on a host using a different architecture ABI (e.g. the Linux x86_64 ABI). This does not involve any hardware emulation, simply CPU and syscall emulation.

QEMU aims to fit into a variety of use cases. It can be invoked directly by users wishing to have full control over its behaviour and settings. It also aims to facilitate integration into higher level management layers, by providing a stable command line interface and monitor API. It is commonly invoked indirectly via the libvirt library when using open source applications such as oVirt, OpenStack and virt-manager.

QEMU as a whole is released under the GNU General Public License, version 2. For full licensing details, consult the LICENSE file.

Documentation

Documentation can be found hosted online at https://www.qemu.org/documentation/. The documentation for the current development version that is available at https://www.qemu.org/docs/master/ is generated from the docs/ folder in the source tree, and is built by Sphinx <https://www.sphinx-doc.org/en/master/>_.

Building

QEMU is multi-platform software intended to be buildable on all modern Linux platforms, OS-X, Win32 (via the Mingw64 toolchain) and a variety of other UNIX targets. The simple steps to build QEMU are:

mkdir build
cd build
../configure
make

Additional information can also be found online via the QEMU website:

Submitting patches

The QEMU source code is maintained under the GIT version control system.

git clone https://gitlab.com/qemu-project/qemu.git

When submitting patches, one common approach is to use 'git format-patch' and/or 'git send-email' to format & send the mail to the [email protected] mailing list. All patches submitted must contain a 'Signed-off-by' line from the author. Patches should follow the guidelines set out in the style section <https://www.qemu.org/docs/master/devel/style.html> of the Developers Guide.

Additional information on submitting patches can be found online via the QEMU website

The QEMU website is also maintained under source control.

git clone https://gitlab.com/qemu-project/qemu-web.git

A 'git-publish' utility was created to make above process less cumbersome, and is highly recommended for making regular contributions, or even just for sending consecutive patch series revisions. It also requires a working 'git send-email' setup, and by default doesn't automate everything, so you may want to go through the above steps manually for once.

For installation instructions, please go to

The workflow with 'git-publish' is:

$ git checkout master -b my-feature
$ # work on new commits, add your 'Signed-off-by' lines to each
$ git publish

Your patch series will be sent and tagged as my-feature-v1 if you need to refer back to it in the future.

Sending v2:

$ git checkout my-feature # same topic branch
$ # making changes to the commits (using 'git rebase', for example)
$ git publish

Your patch series will be sent with 'v2' tag in the subject and the git tip will be tagged as my-feature-v2.

Bug reporting

The QEMU project uses GitLab issues to track bugs. Bugs found when running code built from QEMU git or upstream released sources should be reported via:

If using QEMU via an operating system vendor pre-built binary package, it is preferable to report bugs to the vendor's own bug tracker first. If the bug is also known to affect latest upstream code, it can also be reported via GitLab.

For additional information on bug reporting consult:

ChangeLog

For version history and release notes, please visit https://wiki.qemu.org/ChangeLog/ or look at the git history for more detailed information.

Contact

The QEMU community can be contacted in a number of ways, with the two main methods being email and IRC

Information on additional methods of contacting the community can be found online via the QEMU website:

qemu-eos's People

Contributors

afaerber avatar agraf avatar aliguori avatar aurel32 avatar berrange avatar blueswirl avatar bonzini avatar dagrh avatar davidhildenbrand avatar dgibson avatar ebblake avatar edgarigl avatar ehabkost avatar elmarco avatar gkurz avatar huth avatar jan-kiszka avatar jnsnow avatar kraxel avatar legoater avatar mcayland avatar mstsirkin avatar philmd avatar pm215 avatar rth7680 avatar stefanharh avatar stsquad avatar stweil avatar vivier avatar xanclic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

qemu-eos's Issues

Building with vte triggers eos_uart_can_rx(opaque) assert

If configure pulls in libvte, trying to access serial is okay for reads, but attempting to send data triggers a crash on the second keypress:

hw/eos/../eos/eos.c:1596: eos_uart_rx: Assertion `eos_uart_can_rx(opaque)' failed

Workaround is to configure with --disable-vte (but you lose scrollback and nice resolution terminal...)

debugmsg skips most messages in Qemu 4

QEMU_EOS_DEBUGMSG doesn't work as well in Qemu 4. This is what -d debugmsg uses. I believe this is because we use tb_exec_cb() to look for and log DryosDebugMsg() calls. But one TB can be many instructions, we get tb->pc and hope it matches DryosDebugMsg, and it doesn't in most cases (some will print, presumably when they're the first insn in a TB, but this seems rare).

If you use a gdb script to put a break on DryosDebugMsg, that does nothing except continue, then tb_exec_cb matches every time with tb->pc. Here I'm guessing inserting the breakpoint triggers changes to TBs (it will write into code region and Qemu will have to notice this somehow). So this is an effective workaround but requires gdb.

From Qemu 4, there's a plugin architecture that can do a callback at instruction level, not just TB level - this is what we should be doing. But it's not well documented. I spent a few hours on it. Can't find any docs on how to actually build a plugin.

We want to be able to do instruction level hooking in Qemu 4.

Log qemu output into test_output dir

If a LogTest fails, there is currently no way to inspect why. There's some output to console but you can't verify this because the log isn't saved. We should save this.

Cams that fail pre-test checks don't get shown in summary

Need some way to include very early failures in the summary. The summary currently only checks Cam objects, but early failures prevent these getting created. This also means we report overall test suite status as Pass if the only failures are pre-test ones, which is obviously bad.

qemu-eos logging mangles uart log

Both emulated uart and our additional qemu logging goes to stderr. This is unbuffered. It is fairly common for some messages, e.g. DMA logging, to occur while Canon is logging. This causes interleaved output that makes comparing the results of a test run difficult.

Ideally we would be able to know the difference between our logging and Canon output, while also being able to reconstruct order of events. We could log each to separate files, but that makes reconstruction of order hard. We could wrap our output in magic prefix/suffix (a little ugly). We could use some kind of event store (DB, json?) - line by line for uart, fprintf based for our additional logging?

Incomplete GIC / SGI handling

We have a naive software implementation of GIC / SGI handling, see eos_handle_intengine_gic().

Known bugs:

  • doesn't handle nested interrupts
  • sometimes cpu0 will intend to signal cpu1 but win the race and handle its own interrupt (and vice versa)

Currently we create an interrupt with cpu_interrupt(cpu_id, CPU_INTERRUPT_HARD), this presumably is visible to both cores (although you do have to specify a cpu id...) and maybe real SGI aren't? I assume the actual interrupt is some inter-core signal.

Possibly related, we don't store the cpu_id in the interrupt value we send via "iar". This is wrong according to ARM manual on GICC_IAR and GICC_EOIR. Unsure if this is used to route the interrupt or not, maybe it is on real hardware - we're not emulating this.

(/bin/sh^M: bad interpreter) Script Folder, Line ending in DOS Windows (CRLF) will confuse many UNIX bash interpreters

According to this message at here

e.g. with the scripts/git-submodule.sh used during building will have this weird error

joelwindows7@JOEL-ROG-GL503GE:~/sauce/simplified/qemu-eos-build$ ./scripts/git-submodule.sh
-bash: ./scripts/git-submodule.sh: /bin/sh^M: bad interpreter: No such file or directory

which basically the bash (like in my WSL) confused and thinks you had /bin/sh^M at the first line, while actually not.

This is due to a fact I just figured out that the line ending format is in DOS (CRLF) which happens to confuse various Bash interpreters including mine.

Now what I did to fix this problem is to convert every file possible inside the qemu-eos/script from DOS Windows (CRLF) to UNIX line ended (LF). So I went to that script folder & do this command:

for FILER in ./*; do chmod +x $FILER; dos2unix $FILER;

Basically, for each file, add executable right & also convert the line format from CRLF to LF. Forget the former since permission won't uploads into git. the latter does.

I suggest that should also convert your script and maybe others to such line ending format & push them all here so others will not encounter such error. No idea if others don't have this error, but just in case, it's recommended to do so anyways.

See this answer from Ask Ubuntu on the dos2unix utility.

-d tasks only tracks cpu0

Old code assumes only one cpu, eos_tasks_log_exec() logs task switches via eos_state->model->current_task_addr, which is only for cpu0.

Really this current_task_addr should be part of the cpu, not the model, or we need multiple current_task_addr fields for the model.

print_task_switch() should output which cpu it's logging (adding this but never seeing cpu1 is how I found this bug).

eos_tasks_log_exec() should be moved to the instruction monitoring plugin, qemu 4 doesn't provide accurate per instruction logging anymore so we may be missing events - and the plugin is faster. In practice task switch logging seems to work okay, maybe because large jumps tend to generate new TBs.

Update location for romcpy etc output

Old scripting assumes run scripts are used from within the combined build and src dir, and assumes a named dir exists per cam at top-level.

We now use split build and src dirs (cleaner, and the recommended Qemu build process). We have per cam dirs under cam_config so the top-level is not as crowded.

-d romcpy and similar output files according to the old assumptions. Where should these go under the new scheme? If we use run_qemu.py from the source dir, output into that dir or lower will be git managed, so we'd have to have a good .gitignore which might be impractical. If we output outside of git managed dirs (rom dir?), we need to be clear where the output is, and would like it to work neatly with the consumers of the output files.

Image comparison should be done on image data, not file data

When we test emulation by comparing screenshot capture to expected image file, we currently compare file hashes. This has been reliable so far, but could be annoying if e.g. vncdotool starts using a different PNG header. We'd fail even though the images looked identical.

It would be better to compare the image data, this is conceptually correct and should be more robust.

Current code is this in tests.py:

            for k in key_sequence:
                capture_filename = q.key_press(k)
                capture_filepath = os.path.join(self.output_dir, capture_filename)
                expected_hash = 0
                with open(capture_filepath, "rb") as f:
                    test_hash = hashlib.md5(f.read()).hexdigest()

Why does framebufferUpdateRequest(incremental=1) cause expectScreen() to fail?

framebufferUpdateRequest(incremental=1), used internally by expectScreen(), always fails. There's a cryptic note by alex about this in the old vnc patch, which claims it was intermittent then.

I use _fbReplacer() to work around this without requiring upstream changes, but it's kind of ugly. Can we understand this problem so we can get upstream to fix it, or find a real fix our side? Might be a qemu interaction, if we could get a clean repro on vanilla qemu with some standard OS, that would probably be enough to open a useful issue with vncdotool.

See 43bd315

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.