]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
12 years agoadd socket_set_block
Paolo Bonzini [Wed, 5 Oct 2011 07:17:32 +0000 (09:17 +0200)]
add socket_set_block

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agosheepdog: add coroutine_fn markers
Paolo Bonzini [Wed, 5 Oct 2011 07:17:31 +0000 (09:17 +0200)]
sheepdog: add coroutine_fn markers

This makes the following patch easier to review.

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohw/arm_gic.c: Fix save/load of irq_target array
Dmitry Koshelev [Thu, 20 Oct 2011 10:48:35 +0000 (14:48 +0400)]
hw/arm_gic.c: Fix save/load of irq_target array

irq_target array saving/loading is in the wrong loop.
Version bump.

Signed-off-by: Dmitry Koshelev <karaghiozis@gmail.com>
Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
12 years agohw/omap2: Wire up the IRQ for the 2430's fifth GPIO module
Peter Maydell [Tue, 18 Oct 2011 15:12:54 +0000 (16:12 +0100)]
hw/omap2: Wire up the IRQ for the 2430's fifth GPIO module

The OMAP2430 version of the omap-gpio device has five GPIO modules,
not four like the other OMAP2 versions; wire up the fifth module's
IRQ line correctly.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
12 years agohw/9pfs: Fix broken compilation caused by wrong trace events
Stefan Weil [Thu, 20 Oct 2011 19:55:58 +0000 (21:55 +0200)]
hw/9pfs: Fix broken compilation caused by wrong trace events

Commit c572f23a3e7180dbeab5e86583e43ea2afed6271 added trace events
with mismatching format string and arguments.

gcc reports these errors:

In file included from trace.c:2:0:
trace.h: In function ‘trace_v9fs_attach’:
trace.h:2850:9: error: too many arguments for format [-Werror=format-extra-args]
trace.h: In function ‘trace_v9fs_wstat’:
trace.h:3039:9: error: too many arguments for format [-Werror=format-extra-args]
trace.h: In function ‘trace_v9fs_mkdir’:
trace.h:3088:9: error: too many arguments for format [-Werror=format-extra-args]
trace.h: In function ‘trace_v9fs_mkdir_return’:
trace.h:3095:9: error: too many arguments for format [-Werror=format-extra-args]

Fix the format strings and also use %u instead of %d for unsigned values
in the changed strings. There are more minor errors of this kind
which I did not fix because that would make the review more difficult.

v2: Fixed position of } for v9fs_mkdir_return.

Cc: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'quintela/migration-pull' into staging
Anthony Liguori [Thu, 20 Oct 2011 13:46:55 +0000 (08:46 -0500)]
Merge remote-tracking branch 'quintela/migration-pull' into staging

12 years agoMerge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging
Anthony Liguori [Thu, 20 Oct 2011 13:43:00 +0000 (08:43 -0500)]
Merge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging

12 years agoMerge remote-tracking branch 'aneesh/for-upstream-6' into staging
Anthony Liguori [Thu, 20 Oct 2011 13:42:08 +0000 (08:42 -0500)]
Merge remote-tracking branch 'aneesh/for-upstream-6' into staging

Conflicts:
trace-events

12 years agomigration: make migration-{tcp,unix} consistent
Juan Quintela [Wed, 23 Feb 2011 19:44:29 +0000 (20:44 +0100)]
migration: make migration-{tcp,unix} consistent

Files are almost identical in functionality, just remove the
differences that make no sense.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: propagate error correctly
Juan Quintela [Wed, 23 Feb 2011 18:56:52 +0000 (19:56 +0100)]
migration: propagate error correctly

unix and tcp outgoing migration have error values, but didn't returned
it.  Make them return the error.  Notice that EINPROGRESS & EWOULDBLOCK
are not considered errors as call will be retry later.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: Don't use callback on file defining it
Juan Quintela [Wed, 23 Feb 2011 10:52:12 +0000 (11:52 +0100)]
migration: Don't use callback on file defining it

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: Make state definitions local
Juan Quintela [Tue, 22 Feb 2011 23:48:46 +0000 (00:48 +0100)]
migration: Make state definitions local

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: Export a function that tells if the migration has finished correctly
Juan Quintela [Tue, 22 Feb 2011 23:43:59 +0000 (00:43 +0100)]
migration: Export a function that tells if the migration has finished correctly

This will allow us to hide the state values.

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: Pass MigrationState in migration notifiers
Juan Quintela [Wed, 5 Oct 2011 12:27:52 +0000 (14:27 +0200)]
migration: Pass MigrationState in migration notifiers

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: Use bandwidth_limit directly
Juan Quintela [Tue, 22 Feb 2011 23:33:19 +0000 (00:33 +0100)]
migration: Use bandwidth_limit directly

Now that current_migration always exist, there is no reason for
max_throotle variable.

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: create accessor for current_migration
Juan Quintela [Wed, 5 Oct 2011 11:50:43 +0000 (13:50 +0200)]
migration: create accessor for current_migration

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: Move exported functions to the end of the file
Juan Quintela [Tue, 22 Feb 2011 22:54:21 +0000 (23:54 +0100)]
migration: Move exported functions to the end of the file

This means we can remove the two forward declarations.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: Remove migration cancel() callback
Juan Quintela [Tue, 11 May 2010 21:38:23 +0000 (23:38 +0200)]
migration: Remove migration cancel() callback

It is used only in one place

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: Remove get_status() accessor
Juan Quintela [Tue, 11 May 2010 21:28:53 +0000 (23:28 +0200)]
migration: Remove get_status() accessor

It is only used inside migration.c, and fields on that struct are
accessed all around the place on that file.

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: Our release callback was just free
Juan Quintela [Tue, 11 May 2010 21:18:34 +0000 (23:18 +0200)]
migration: Our release callback was just free

We called it from a single place, and always with state !=
MIG_STATE_ACTIVE.  Just remove the whole callback.  For users of the
notifier, notice that this is exactly the case where they don't care,
we are just freeing the state from previous failed migration (it can't
be a sucessful one, otherwise we would not be running on that machine
in the first place).

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: Introduce migrate_fd_completed() for consistency
Juan Quintela [Tue, 22 Feb 2011 22:32:54 +0000 (23:32 +0100)]
migration: Introduce migrate_fd_completed() for consistency

This function is a bit different of the others that change the state,
in the sense that if migrate_fd_cleanup() returns an error, it set the
status to error, not completed.

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: Refactor and simplify error checking in migrate_fd_put_ready
Juan Quintela [Tue, 22 Feb 2011 22:18:20 +0000 (23:18 +0100)]
migration: Refactor and simplify error checking in migrate_fd_put_ready

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: Introduce MIG_STATE_SETUP
Juan Quintela [Tue, 11 May 2010 21:01:53 +0000 (23:01 +0200)]
migration: Introduce MIG_STATE_SETUP

Use MIG_STATE_ACTIVE only when migration has really started.  Use this
new state to setup migration parameters.  Change defines for an
anonymous struct.

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: move migrate_new to do_migrate
Juan Quintela [Tue, 11 May 2010 20:27:45 +0000 (22:27 +0200)]
migration: move migrate_new to do_migrate

Once there, remove all parameters that don't need to be passed to
*start_outgoing_migration() functions

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: Make all posible migration functions static
Juan Quintela [Sun, 11 Sep 2011 18:28:22 +0000 (20:28 +0200)]
migration: Make all posible migration functions static

I have to move two functions postions to avoid forward declarations

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: Refactor MigrationState creation
Juan Quintela [Tue, 11 May 2010 14:28:39 +0000 (16:28 +0200)]
migration: Refactor MigrationState creation

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: Rename FdMigrationState MigrationState
Juan Quintela [Tue, 11 May 2010 13:56:35 +0000 (15:56 +0200)]
migration: Rename FdMigrationState MigrationState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: Fold MigrationState into FdMigrationState
Juan Quintela [Tue, 11 May 2010 13:51:36 +0000 (15:51 +0200)]
migration: Fold MigrationState into FdMigrationState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: Use FdMigrationState instead of MigrationState when possible
Juan Quintela [Tue, 11 May 2010 13:46:39 +0000 (15:46 +0200)]
migration: Use FdMigrationState instead of MigrationState when possible

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: Make *start_outgoing_migration return FdMigrationState
Juan Quintela [Tue, 11 May 2010 13:18:38 +0000 (15:18 +0200)]
migration: Make *start_outgoing_migration return FdMigrationState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: make *save_live return errors
Juan Quintela [Wed, 19 Oct 2011 13:22:18 +0000 (15:22 +0200)]
migration: make *save_live return errors

Make *save_live() return negative values when there is one error, and
updates all callers to check for the error.

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: use qemu_file_get_error() return value when possible
Juan Quintela [Tue, 4 Oct 2011 23:14:46 +0000 (01:14 +0200)]
migration: use qemu_file_get_error() return value when possible

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agosavevm: Rename has_error to last_error field
Juan Quintela [Tue, 4 Oct 2011 23:05:21 +0000 (01:05 +0200)]
savevm: Rename has_error to last_error field

Now the field contains the last error name, so rename acordingly.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: rename qemu_file_has_error to qemu_file_get_error
Juan Quintela [Tue, 4 Oct 2011 23:02:52 +0000 (01:02 +0200)]
migration: rename qemu_file_has_error to qemu_file_get_error

Now the function returned errno, so it is better the new name.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: return real error code
Juan Quintela [Thu, 22 Sep 2011 09:02:14 +0000 (11:02 +0200)]
migration: return real error code

make functions propagate errno, instead of just using -EIO.  Add a
comment about what are the return value of qemu_savevm_state_iterate().

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: change has_error to contain errno values
Juan Quintela [Wed, 21 Sep 2011 21:01:54 +0000 (23:01 +0200)]
migration: change has_error to contain errno values

We normally already have an errno value.  When not, abuse EIO.

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: set error if select return one error
Juan Quintela [Wed, 21 Sep 2011 20:46:36 +0000 (22:46 +0200)]
migration: set error if select return one error

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: don't "write" when migration is not active
Juan Quintela [Wed, 21 Sep 2011 20:37:29 +0000 (22:37 +0200)]
migration: don't "write" when migration is not active

If migration is not active, just ignore writes.

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agobuffered_file: reuse QEMUFile has_error field
Juan Quintela [Wed, 21 Sep 2011 20:32:08 +0000 (22:32 +0200)]
buffered_file: reuse QEMUFile has_error field

Instead of having two has_error fields in QEMUFile & QEMUBufferedFile,
reuse the 1st one.  Notice that the one in buffered_file is only set
after a file operation.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agobuffered_file: Use right "opaque"
Juan Quintela [Wed, 21 Sep 2011 16:12:58 +0000 (18:12 +0200)]
buffered_file: Use right "opaque"

buffered_close 's' variable is of type QEMUFileBuffered, and
wait_for_unfreeze() expect to receive a MigrationState, that
'coincidentaly' is s->opaque.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: If there is one error, it makes no sense to continue
Juan Quintela [Wed, 23 Feb 2011 19:17:45 +0000 (20:17 +0100)]
migration: If there is one error, it makes no sense to continue

Once there, add a comment about what each error mean.

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agomigration: add error handling to migrate_fd_put_notify().
Yoshiaki Tamura [Tue, 22 Feb 2011 15:01:24 +0000 (00:01 +0900)]
migration: add error handling to migrate_fd_put_notify().

Although migrate_fd_put_buffer() sets MIG_STATE_ERROR if it failed,
since migrate_fd_put_notify() isn't checking error of underlying
QEMUFile, those resources are kept open.  This patch checks it and
calls migrate_fd_error() in case of error.

Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: Check that migration is active before cancel it
Juan Quintela [Tue, 11 May 2010 20:39:51 +0000 (22:39 +0200)]
migration: Check that migration is active before cancel it

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomigration: simplify state assignmente
Juan Quintela [Tue, 13 Sep 2011 13:11:38 +0000 (15:11 +0200)]
migration: simplify state assignmente

Once there, make sure that if we already know that there is one error,
just call migration_fd_cleanup() with the ERROR state.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agods1225y: Use stdio instead of QEMUFile
Juan Quintela [Tue, 13 Sep 2011 12:41:18 +0000 (14:41 +0200)]
ds1225y: Use stdio instead of QEMUFile

QEMUFile * is only intended for migration nowadays.  Using it for
anything else just adds pain and a layer of buffers for no good
reason.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoRevert "savevm: fix corruption in vmstate_subsection_load()."
Juan Quintela [Fri, 30 Sep 2011 17:46:43 +0000 (19:46 +0200)]
Revert "savevm: fix corruption in vmstate_subsection_load()."

This reverts commit eb60260de0b050a5e8ab725e84d377d0b44c43ae.

Conflicts:

savevm.c

We changed qemu_peek_byte() prototype, just fixed the rejects.

Signed-off-by: Juan Quintela<quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosavevm: improve subsections detection on load
Juan Quintela [Tue, 4 Oct 2011 13:28:31 +0000 (15:28 +0200)]
savevm: improve subsections detection on load

We add qemu_peek_buffer, that is identical to qemu_get_buffer, just
that it don't update f->buf_index.

We add a paramenter to qemu_peek_byte() to be able to peek more than
one byte.

Once this is done, to see if we have a subsection we look:
- 1st byte is QEMU_VM_SUBSECTION
- 2nd byte is a length, and is bigger than section name
- 3rd element is a string that starts with section_name

So, we shouldn't have false positives (yes, content could still get us
wrong but probabilities are really low).

v2:
- Alex Williamsom found that we could get negative values on index.
- Rework code to fix that part.
- Rewrite qemu_get_buffer() using qemu_peek_buffer()

v3:
- return "done" on error case

v4:
- fix qemu_file_skip() off by one.

Signed-off-by: Juan Quintela <quintela@redhat.com>
12 years agosavevm: define qemu_get_byte() using qemu_peek_byte()
Juan Quintela [Thu, 6 Oct 2011 12:29:32 +0000 (14:29 +0200)]
savevm: define qemu_get_byte() using qemu_peek_byte()

Signed-off-by: Juan Quintela<quintela@redhat.com>
12 years agosavevm: some coding style cleanups
Juan Quintela [Tue, 4 Oct 2011 11:55:32 +0000 (13:55 +0200)]
savevm: some coding style cleanups

This patch will make moving code on next patches and having checkpatch
happy easier.

Signed-off-by: Juan Quintela<quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosavevm: teach qemu_fill_buffer to do partial refills
Juan Quintela [Fri, 30 Sep 2011 17:28:45 +0000 (19:28 +0200)]
savevm: teach qemu_fill_buffer to do partial refills

We will need on next patch to be able to lookahead on next patch

v2: rename "used" to "pending" (Alex Williams)

Signed-off-by: Juan Quintela<quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agorunstate: Allow user to migrate twice
Luiz Capitulino [Fri, 14 Oct 2011 14:18:09 +0000 (11:18 -0300)]
runstate: Allow user to migrate twice

It should be a matter of allowing the transition POSTMIGRATE ->
FINISH_MIGRATE, but it turns out that the VM won't do the
transition the second time because it's already stopped.

So this commit also adds vm_stop_force_state() which performs
the transition even if the VM is already stopped.

While there also allow other states to migrate.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agosavevm: qemu_savevm_state(): Drop stop VM logic
Luiz Capitulino [Thu, 13 Oct 2011 14:36:40 +0000 (11:36 -0300)]
savevm: qemu_savevm_state(): Drop stop VM logic

qemu_savevm_state() has some logic to stop the VM and to (or not to)
resume it. But this seems to be a big noop, as qemu_savevm_state()
is only called by do_savevm() when the VM is already stopped.

So, let's drop qemu_savevm_state()'s stop VM logic.

Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agorunstate: Allow to transition from paused to postmigrate
Luiz Capitulino [Thu, 13 Oct 2011 17:39:59 +0000 (14:39 -0300)]
runstate: Allow to transition from paused to postmigrate

The user may already have paused the VM before starting the
migration process. If s/he does that, then the state will be
'paused' when we finish the migration process. In that case
we want to transition from 'paused' to 'postmigrate' as the
latter is now the real reason why the VM is stopped.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agorunstate: Print state transition when invalid
Luiz Capitulino [Thu, 13 Oct 2011 13:59:07 +0000 (10:59 -0300)]
runstate: Print state transition when invalid

Makes it easier to debug.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agoQMP: Fix blockdev-snapshot-sync doc example
Luiz Capitulino [Mon, 10 Oct 2011 20:30:08 +0000 (17:30 -0300)]
QMP: Fix blockdev-snapshot-sync doc example

Fix wrong command name.

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agotcx: convert to memory API
Avi Kivity [Wed, 5 Oct 2011 16:26:24 +0000 (18:26 +0200)]
tcx: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agotc63963xb: convert to memory API
Avi Kivity [Mon, 3 Oct 2011 12:42:42 +0000 (14:42 +0200)]
tc63963xb: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agosyborg: convert to memory API
Avi Kivity [Mon, 3 Oct 2011 12:33:26 +0000 (14:33 +0200)]
syborg: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agosun4u: convert to memory API
Avi Kivity [Mon, 3 Oct 2011 12:31:12 +0000 (14:31 +0200)]
sun4u: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agosun4m: convert to memory API
Avi Kivity [Mon, 3 Oct 2011 12:27:32 +0000 (14:27 +0200)]
sun4m: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agostrongarm: convert to memory API
Avi Kivity [Mon, 3 Oct 2011 12:14:20 +0000 (14:14 +0200)]
strongarm: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agospitz: convert to memory API
Avi Kivity [Mon, 3 Oct 2011 11:03:56 +0000 (13:03 +0200)]
spitz: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agospapr: convert to memory API
Avi Kivity [Mon, 3 Oct 2011 10:56:38 +0000 (12:56 +0200)]
spapr: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agosm501: convert to memory API
Avi Kivity [Sun, 2 Oct 2011 15:56:06 +0000 (17:56 +0200)]
sm501: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agos390-virtio: convert to memory API
Avi Kivity [Sun, 2 Oct 2011 15:06:42 +0000 (17:06 +0200)]
s390-virtio: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agorealview: convert to memory API
Avi Kivity [Sun, 2 Oct 2011 15:04:26 +0000 (17:04 +0200)]
realview: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agor2d: convert to memory API
Avi Kivity [Sun, 2 Oct 2011 14:48:42 +0000 (16:48 +0200)]
r2d: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoppcr500_mpc8544ds: convert to memory API
Avi Kivity [Sun, 2 Oct 2011 14:43:01 +0000 (16:43 +0200)]
ppcr500_mpc8544ds: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agopci: simplify memory region registration
Avi Kivity [Thu, 11 Aug 2011 11:40:58 +0000 (14:40 +0300)]
pci: simplify memory region registration

The two code paths (for ADDRESS_SPACE_IO and ADDRESS_SPACE_MEM) are
identical.  Unify them.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agopxa2xx: convert to memory API (part II)
Avi Kivity [Sun, 25 Sep 2011 15:19:19 +0000 (18:19 +0300)]
pxa2xx: convert to memory API (part II)

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agopxa2xx: convert to memory API (part I)
Avi Kivity [Sun, 25 Sep 2011 15:19:19 +0000 (18:19 +0300)]
pxa2xx: convert to memory API (part I)

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoppc_prep: convert to memory API
Avi Kivity [Sun, 25 Sep 2011 13:57:45 +0000 (16:57 +0300)]
ppc_prep: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoppc_oldworld: convert to memory API
Avi Kivity [Sun, 25 Sep 2011 13:27:52 +0000 (16:27 +0300)]
ppc_oldworld: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoi8259: Move to hw library
Jan Kiszka [Sun, 16 Oct 2011 09:53:17 +0000 (11:53 +0200)]
i8259: Move to hw library

No target-specific bits remaining, let's move it over.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agomonitor: Restrict pic/irq_info to supporting targets
Jan Kiszka [Sun, 16 Oct 2011 09:53:13 +0000 (11:53 +0200)]
monitor: Restrict pic/irq_info to supporting targets

This allows to drop various stubs and move the i8359 into hwlib.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Fix coding style
Jan Kiszka [Fri, 7 Oct 2011 07:19:54 +0000 (09:19 +0200)]
i8259: Fix coding style

No functional changes.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Convert to qdev
Jan Kiszka [Fri, 7 Oct 2011 07:19:53 +0000 (09:19 +0200)]
i8259: Convert to qdev

This key cleanup step requires to move the IRQ debugging bit from
i8259_set_irq directly to the per-PIC pic_set_irq, to pass the PIC
parameters (I/O base, ELCR address and mask, master/slave mode) as
qdev properties, and to interconnect the PICs with their environment via
GPIO pins.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoqdev: Add HEX8 property
Jan Kiszka [Fri, 7 Oct 2011 07:19:52 +0000 (09:19 +0200)]
qdev: Add HEX8 property

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Eliminate PicState2
Jan Kiszka [Fri, 7 Oct 2011 07:19:51 +0000 (09:19 +0200)]
i8259: Eliminate PicState2

Introduce a reference to the slave PIC for the few cases we need to
access it without a proper pointer at hand and drop PicState2. We could
even live without slave_pic if we had a better way of modeling the
cascade bus the PICs are attached to (in addition to the ISA bus).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Replace PicState::pics_state with master flag
Jan Kiszka [Fri, 7 Oct 2011 07:19:50 +0000 (09:19 +0200)]
i8259: Replace PicState::pics_state with master flag

This reflects how real PICs indentify their role (in non-buffered mode):
Pass the state of the /SP input on pic_init and use it instead of
pics_state to differentiate between master and slave mode.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: PREP: Replace pic_intack_read with pic_read_irq
Jan Kiszka [Fri, 7 Oct 2011 07:19:49 +0000 (09:19 +0200)]
i8259: PREP: Replace pic_intack_read with pic_read_irq

There is nothing in the i8259 spec that justifies the special
pic_intack_read. At least the Linux PREP kernels configure the PICs
properly so that pic_read_irq returns identical values, and setting
read_reg_select in PIC0 cannot be derived from any special i8259 mode.

So switch ppc_prep to pic_read_irq and drop the now unused PIC code.

CC: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Clean up pic_ioport_read
Jan Kiszka [Fri, 7 Oct 2011 07:19:48 +0000 (09:19 +0200)]
i8259: Clean up pic_ioport_read

Drop redundant local address variable.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Fix poll command
Jan Kiszka [Fri, 7 Oct 2011 07:19:47 +0000 (09:19 +0200)]
i8259: Fix poll command

This was probably never used so far: According to the spec, polling
means ack'ing the pending IRQ and setting its corresponding bit in isr.
Moreover, we have to signal a pending IRQ via bit 7 of the returned
value, and we must not return a spurious IRQ if none is pending.

This implements the poll command without the help of pic_poll_read which
is left untouched as pic_intack_read is still using it.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Switch to per-PIC IRQ update
Jan Kiszka [Fri, 7 Oct 2011 07:19:46 +0000 (09:19 +0200)]
i8259: Switch to per-PIC IRQ update

This converts pic_update_irq to work against a single PIC instead of the
complete cascade. Along this change, the required update after
pic_set_irq1 is now moved into that function.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Clear ELCR on reset
Jan Kiszka [Fri, 7 Oct 2011 07:19:45 +0000 (09:19 +0200)]
i8259: Clear ELCR on reset

The ELCR is actually part of the chipset but we model it here for
simplicity reasons. The PIIX3 clears the ELCR on reset, which was once
broken by 4dbe19e181. Fix this by splitting up pic_init_reset from
pic_reset and clearing the register in the latter.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Update IRQ state after reset
Jan Kiszka [Fri, 7 Oct 2011 07:19:44 +0000 (09:19 +0200)]
i8259: Update IRQ state after reset

MIPS and PPC users of the i8259 output signal expect us to report state
updates also after reset. As no consumer (including the master PIC) can
misinterpret the deassert as an activation event, it is safe to simply
update the IRQ state after reset.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Reorder intack in pic_read_irq
Jan Kiszka [Fri, 7 Oct 2011 07:19:43 +0000 (09:19 +0200)]
i8259: Reorder intack in pic_read_irq

As we want to move the IRQ update to pic_intack, ordering matters: the
slave ack must be executed before the master ack to avoid missing
further pending slave IRQs.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Do not update IRQ output after spurious pic_poll_read
Jan Kiszka [Fri, 7 Oct 2011 07:19:42 +0000 (09:19 +0200)]
i8259: Do not update IRQ output after spurious pic_poll_read

If pic_poll_read finds no pending IRQ and return a spurious one instead,
no PIC state is changed, thus we do not need to call pic_update_irq.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8239: Introduce per-PIC output interrupt
Jan Kiszka [Fri, 7 Oct 2011 07:19:41 +0000 (09:19 +0200)]
i8239: Introduce per-PIC output interrupt

As a first step towards more generic master-slave support, remove
parent_irq in favor of a per-PIC output interrupt line. The slave's
line is attached to IRQ2 of the master, but it remains unused for now.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Move pic_set_irq1 after pic_update_irq
Jan Kiszka [Fri, 7 Oct 2011 07:19:40 +0000 (09:19 +0200)]
i8259: Move pic_set_irq1 after pic_update_irq

We are about to call the latter from the former. No functional changes.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Drop obsolete prototypes
Jan Kiszka [Fri, 7 Oct 2011 07:19:39 +0000 (09:19 +0200)]
i8259: Drop obsolete prototypes

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoi8259: Remove premature inline function attributes
Jan Kiszka [Fri, 7 Oct 2011 07:19:38 +0000 (09:19 +0200)]
i8259: Remove premature inline function attributes

The compiler is smarter in choosing the right optimization.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agopc: Fix and clean up PIC-to-APIC IRQ path
Jan Kiszka [Fri, 7 Oct 2011 07:19:37 +0000 (09:19 +0200)]
pc: Fix and clean up PIC-to-APIC IRQ path

The master PIC is connected to the LINTIN0 of the APICs. As the APIC
currently does not track the state of that line, we have to ask the PIC
to reinject its IRQ after the CPU picked up an event from the APIC.

This introduces pic_get_output to read the master PIC IRQ line state
without changing it. The APIC uses this function to decide if a PIC IRQ
should be reinjected on apic_update_irq. This reflects better how the
real hardware works.

The patch fixes some failures of the kvm unit tests apic and eventinj by
allowing to enable the proper CPU IRQ deassertion when the guest masks
some pending IRQs at PIC level.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agopc: Convert GSIState::i8259_irq into array
Jan Kiszka [Fri, 7 Oct 2011 07:19:36 +0000 (09:19 +0200)]
pc: Convert GSIState::i8259_irq into array

Will be required when we no longer let i8259_init allocate the PIC IRQs
but convert that chips to qdev.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agopc: Generalize ISA IRQs to GSIs
Jan Kiszka [Fri, 7 Oct 2011 07:19:35 +0000 (09:19 +0200)]
pc: Generalize ISA IRQs to GSIs

The ISA bus IRQ range is 0..15. What isa_irq_handler and IsaIrqState are
actually dealing with are the Global System Interrupts. Refactor the
code to clarify this.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agopc: Drop useless test from isa_irq_handler
Jan Kiszka [Fri, 7 Oct 2011 07:19:34 +0000 (09:19 +0200)]
pc: Drop useless test from isa_irq_handler

IsaIrqState::ioapic is always non-NULL. Probably, the concrete
qemu_irq was supposed to be tested, but that's already done by
qemu_set_irq.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add Avnet LX60/LX110/LX200 boards
Max Filippov [Sat, 15 Oct 2011 22:56:46 +0000 (02:56 +0400)]
target-xtensa: add Avnet LX60/LX110/LX200 boards

These boards carry similar hardware: SDRAM (48M for LX110, 64M for LX60,
96M for LX200), 16 Mbyte FLASH, FPGA, 10/100 Mbps Ethernet PHY and 16550
UART. FPGA may be loaded with almost any Tensilica processor. It is also
used to implement Ethernet MAC, e.g. OpenCores 10/100 Mbps Ethernet MAC
and LED/DIP switches access.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agohw: add OpenCores 10/100 Mbps Ethernet controller
Max Filippov [Sat, 15 Oct 2011 22:56:45 +0000 (02:56 +0400)]
hw: add OpenCores 10/100 Mbps Ethernet controller

This is OpenCores Ethernet MAC + subset of National Semiconductors
DP83838C PHY.
OpenCores Ethernet MAC project: http://opencores.org/project,ethmac

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: rename dc232b board to sim
Max Filippov [Sat, 15 Oct 2011 22:56:07 +0000 (02:56 +0400)]
target-xtensa: rename dc232b board to sim

This is to get aligned with the linux name for this machine.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add fsf core
Max Filippov [Sat, 15 Oct 2011 22:56:06 +0000 (02:56 +0400)]
target-xtensa: add fsf core

This is FSF big endian core implemented through linux overlay.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>