04 Feb, 2008
3 commits
-
A reset function solves three problems:
1) It allows us to renegotiate features, eg. if we want to upgrade a
guest driver without rebooting the guest.2) It gives us a clean way of shutting down virtqueues: after a reset,
we know that the buffers won't be used by the host, and3) It helps the guest recover from messed-up drivers.
So we remove the ->shutdown hook, and the only way we now remove
feature bits is via reset.We leave it to the driver to do the reset before it deletes queues:
the balloon driver, for example, needs to chat to the host in its
remove function.Signed-off-by: Rusty Russell
-
It seems that virtio_net wants to disable callbacks (interrupts) before
calling netif_rx_schedule(), so we can't use the return value to do so.Rename "restart" to "cb_enable" and introduce "cb_disable" hook: callback
now returns void, rather than a boolean.Signed-off-by: Rusty Russell
-
Previously we used a type/len pair within the config space, but this
seems overkill. We now simply define a structure which represents the
layout in the config space: the config space can now only be extended
at the end.The main driver-visible changes:
1) We indicate what fields are present with an explicit feature bit.
2) Virtqueues are explicitly numbered, and not in the config space.Signed-off-by: Rusty Russell
31 Jan, 2008
2 commits
-
drivers/lguest/x86/core.c: In function ‘copy_in_guest_info’:
drivers/lguest/x86/core.c:97: error: ‘struct x86_hw_tss’ has no member named ‘esp1’Signed-off-by: Rusty Russell
Signed-off-by: Linus Torvalds -
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (27 commits)
lguest: use __PAGE_KERNEL instead of _PAGE_KERNEL
lguest: Use explicit includes rateher than indirect
lguest: get rid of lg variable assignments
lguest: change gpte_addr header
lguest: move changed bitmap to lg_cpu
lguest: move last_pages to lg_cpu
lguest: change last_guest to last_cpu
lguest: change spte_addr header
lguest: per-vcpu lguest pgdir management
lguest: make pending notifications per-vcpu
lguest: makes special fields be per-vcpu
lguest: per-vcpu lguest task management
lguest: replace lguest_arch with lg_cpu_arch.
lguest: make registers per-vcpu
lguest: make emulate_insn receive a vcpu struct.
lguest: map_switcher_in_guest() per-vcpu
lguest: per-vcpu interrupt processing.
lguest: per-vcpu lguest timers
lguest: make hypercalls use the vcpu struct
lguest: make write() operation smp aware
...Manual conflict resolved (maybe even correctly, who knows) in
drivers/lguest/x86/core.c
30 Jan, 2008
26 commits
-
This changes size-specific register names (eip/rip, esp/rsp, etc.) to
generic names in the thread and tss structures.Signed-off-by: H. Peter Anvin
Signed-off-by: Ingo Molnar
Signed-off-by: Thomas Gleixner -
x86_64 don't expose the intermediate representation with one underline,
_PAGE_KERNEL, just the double-underlined one.Use it, to get a common ground between 32 and 64-bit
Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
explicitly use ktime.h include
explicitly use hrtimer.h include
explicitly use sched.h includeThis patch adds headers explicitly to lguest sources file,
to avoid depending on them being included somewhere else.Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
We can save some lines of code by getting rid of
*lg = cpu... lines of code spread everywhere by now.Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
gpte_addr() does not depend on any guest information. So we wipe out
the lg parameter from it completely.Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
events represented in the 'changed' bitmap are per-cpu, not per-guest.
move it to the lg_cpu structureSigned-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
in our new model, pages are assigned to a virtual cpu, not to a guest.
We move it to the lg_cpu structure.Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
in our model, a guest does not run in a cpu anymore: a virtual cpu
does. So we change last_guest to last_cpuSigned-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
spte_addr does not depend on any guest information, so we
wipe out the lg parameter completely.Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
this patch makes the pgdir management per-vcpu. The pgdirs pool
is still guest-wide (although it'll probably need to grow when we
are really executing more vcpus), but the pgdidx index is gone,
since it makes no sense anymore. Instead, we use a per-vcpu
index.Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
this patch makes the pending_notify field, used to control
pending notifications, per-vcpu, instead of per-guestSigned-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
lguest struct have room for some fields, namely, cr2, ts, esp1
and ss1, that are not really guest-wide, but rather, vcpu-wide.This patch puts it in the vcpu struct
Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
lguest uses tasks to control its running behaviour (like sending
breaks, controlling halted state, etc). In a per-vcpu environment,
each vcpu will have its own underlying task. So this patch
makes the infrastructure for that possibleSigned-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
The fields found in lguest_arch are not really per-guest,
but per-cpu (gdt, idt, etc). So this patch turns lguest_arch
into lg_cpu_arch.It makes sense to have a per-guest per-arch struct, but this
can be addressed later, when the need arrives.Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
This is the most obvious per-vcpu field: registers.
So this patch moves it from struct lguest to struct vcpu,
and patch the places in which they are used, accordinglySigned-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
emulate_insn() needs to know about current eip, which will be,
in the future, a per-vcpu thing. So in this patch, the function
prototype is modified to receive a vcpu structSigned-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
The switcher needs to be mapped per-vcpu, because different vcpus
will potentially have different page tables (they don't have to,
because threads will share the same).So our first step is the make the function receive a vcpu struct
Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
This patch adapts interrupt processing for using the vcpu struct.
Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
Here, I introduce per-vcpu timers. With this, we can have
local expiries, needed for accounting time in smp guestsSigned-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
this patch changes do_hcall() and do_async_hcall() interfaces (and obviously their
callers) to get a vcpu struct. Again, a vcpu services the hypercall, not the whole
guestSigned-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
This patch makes the write() file operation smp aware. Which means, receiving
the vcpu_id value through the offset parameter, and being well aware to which
vcpu we're talking to.Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
This patch makes the run_guest() routine use the lg_cpu struct.
This is required since in a smp guest environment, there's no
more the notion of "running the guest", but rather, it is "running the vcpu"Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
this patch initializes the first vcpu in the initialize() routing,
which is responsible for starting the process of putting the guest up.
right now, as much of the fields are still not per-vcpu, it does not
do much.Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
this patch introduces a vcpu struct for lguest. In upcoming patches,
more and more fields will be moved from the lguest struct to the vcpuSigned-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell -
Reboot Implemented
(Prevent fd leak, fix style and fix documentation --RR)
Signed-off-by: Balaji Rao
Signed-off-by: Rusty Russell -
Currently, lguest module can't be compiled without the PARAVIRT flag being
on. This is a fake dependency, since the module itself shouldn't need any
paravirt override. Reason for that is the reference to pv_info structure
in initial loading tests.This patch removes it in favour of a more generic error message.
Signed-off-by: Glauber de Oliveira Costa
Signed-off-by: Rusty Russell
26 Jan, 2008
1 commit
-
Replace all lock_cpu_hotplug/unlock_cpu_hotplug from the kernel and use
get_online_cpus and put_online_cpus instead as it highlights the
refcount semantics in these operations.The new API guarantees protection against the cpu-hotplug operation, but
it doesn't guarantee serialized access to any of the local data
structures. Hence the changes needs to be reviewed.In case of pseries_add_processor/pseries_remove_processor, use
cpu_maps_update_begin()/cpu_maps_update_done() as we're modifying the
cpu_present_map there.Signed-off-by: Gautham R Shenoy
Signed-off-by: Ingo Molnar
20 Jan, 2008
1 commit
-
It was moved to arch/x86/lguest/Kconfig, but I lost the deletion part in a
patch suffle. My confused one-liner "fix" to turn it on is also reverted:
84f7466ee20cc094aa38617abfa2f3834871f054Signed-off-by: Rusty Russell
Signed-off-by: Linus Torvalds
19 Jan, 2008
1 commit
-
There's currently no way to turn on Lguest guest support; the planned
Kconfig virtualization reorg didn't get into 2.6.25.This was unnoticed because if you already had CONFIG_LGUEST_GUEST=y in
your config, it worked. Too bad about new users...Also, the Kconfig help was wrong now the virtio drivers are merged.
Signed-off-by: Rusty Russell
Signed-off-by: Linus Torvalds
19 Nov, 2007
1 commit
-
The virtio code never hooked through the ->remove callback. Although
noone supports device removal at the moment, this code is already
needed for module unloading.This of course also revealed bugs in virtio_blk, virtio_net and lguest
unloading paths.Signed-off-by: Rusty Russell
15 Nov, 2007
1 commit
-
This patch fixes a memory leak spotted by the Coverity checker.
Signed-off-by: Adrian Bunk
Cc: Rusty Russell
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Nov, 2007
1 commit
-
The virtio descriptor rings of size N-1 were nicely set up to be
aligned to an N-byte boundary. But as Anthony Liguori points out, the
free-running indices used by virtio require that the sizes be a power
of 2, otherwise we get problems on wrap (demonstrated with lguest).So we replace the clever "2^n-1" scheme with a simple "align to page
boundary" scheme: this means that all virtio rings take at least two
pages, but it's safer than guessing cache alignment.Signed-off-by: Rusty Russell
25 Oct, 2007
3 commits
-
Went through the documentation doing typo and content fixes. This
patch contains only comment and whitespace changes.Signed-off-by: Rusty Russell
-
Signed-off-by: Rusty Russell
-
Signed-off-by: Rusty Russell