He, Qing wrote:
> This patch sets up multiple TSS for real mode emulation on Intel vmx,
> one for each vcpu. This is a preparation patch for full SMP real mode
> support.
>
>
Why are separate tss's needed? Can't all vcpus use the same tss?
> Signed-off-by: Qing He <[EMAIL PROTECTED]>
>
>
> kvm.h | 1 +
> kvm_main.c | 1 +
> vmx.c | 31 +++++++++++++++++--------------
> 3 files changed, 19 insertions(+), 14 deletions(-)
>
>
> diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
> index 65ab268..0f7a4d9 100644
> --- a/drivers/kvm/kvm.h
> +++ b/drivers/kvm/kvm.h
> @@ -328,6 +328,7 @@ void kvm_io_bus_register_dev(struct kvm_io_bus *bus,
>
> struct kvm_vcpu {
> struct kvm *kvm;
> + int vcpu_id;
>
Switching to ->vcpu_id instead of computing (vcpu - vcpu->kvm->vcpus) is
a good idea (and necessary when separately allocating vcpus). But in
its own patch, please.
> - vmcs_write16(GUEST_CS_SELECTOR, 0xf000);
> - vmcs_writel(GUEST_CS_BASE, 0x000f0000);
> - vmcs_write32(GUEST_CS_LIMIT, 0xffff);
> - vmcs_write32(GUEST_CS_AR_BYTES, 0x9b);
> + if (vcpu->vcpu_id == 0) {
> + vmcs_write16(GUEST_CS_SELECTOR, 0xf000);
> + vmcs_writel(GUEST_CS_BASE, 0x000f0000);
> + vmcs_write32(GUEST_CS_LIMIT, 0xffff);
> + vmcs_write32(GUEST_CS_AR_BYTES, 0x9b);
> + vmcs_writel(GUEST_RIP, 0xfff0);
> + }
>
>
Since you're not initializing these registers for vcpu_id != 0, we might
as well not touch this code.
--
Do not meddle in the internals of kernels, for they are subtle and quick to
panic.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel