From: Paolo Bonzini <pbonzini@redhat.com>
To: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org, linux-mips@linux-mips.org,
Ralf Baechle <ralf@linux-mips.org>,
Gleb Natapov <gleb@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH 06/18] KVM/MIPS32-VZ: VZ-ASE related callbacks to handle guest exceptions that trap to the Root context.
Date: Tue, 28 May 2013 17:04:22 +0200 [thread overview]
Message-ID: <51A4C776.8070002@redhat.com> (raw)
In-Reply-To: <1368942460-15577-7-git-send-email-sanjayl@kymasys.com>
Il 19/05/2013 07:47, Sanjay Lal ha scritto:
> +static int kvm_vz_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
> +{
> + struct mips_coproc *cop0 = vcpu->arch.cop0;
> +
> + /* some registers are not restored
> + * random, count : read-only
> + * userlocal : not implemented in qemu
> + * config6 : not implemented in processor variant
> + * compare, cause : defer to kvm_vz_restore_guest_timer_int
> + */
> +
> + kvm_write_c0_guest_index(cop0, regs->cp0reg[MIPS_CP0_TLB_INDEX][0]);
> + kvm_write_c0_guest_entrylo0(cop0, regs->cp0reg[MIPS_CP0_TLB_LO0][0]);
> + kvm_write_c0_guest_entrylo1(cop0, regs->cp0reg[MIPS_CP0_TLB_LO1][0]);
> + kvm_write_c0_guest_context(cop0, regs->cp0reg[MIPS_CP0_TLB_CONTEXT][0]);
> + kvm_write_c0_guest_pagemask(cop0,
> + regs->cp0reg[MIPS_CP0_TLB_PG_MASK][0]);
> + kvm_write_c0_guest_pagegrain(cop0,
> + regs->cp0reg[MIPS_CP0_TLB_PG_MASK][1]);
> + kvm_write_c0_guest_wired(cop0, regs->cp0reg[MIPS_CP0_TLB_WIRED][0]);
> + kvm_write_c0_guest_hwrena(cop0, regs->cp0reg[MIPS_CP0_HWRENA][0]);
> + kvm_write_c0_guest_badvaddr(cop0, regs->cp0reg[MIPS_CP0_BAD_VADDR][0]);
> + /* skip kvm_write_c0_guest_count */
> + kvm_write_c0_guest_entryhi(cop0, regs->cp0reg[MIPS_CP0_TLB_HI][0]);
> + /* defer kvm_write_c0_guest_compare */
> + kvm_write_c0_guest_status(cop0, regs->cp0reg[MIPS_CP0_STATUS][0]);
> + kvm_write_c0_guest_intctl(cop0, regs->cp0reg[MIPS_CP0_STATUS][1]);
> + /* defer kvm_write_c0_guest_cause */
> + kvm_write_c0_guest_epc(cop0, regs->cp0reg[MIPS_CP0_EXC_PC][0]);
> + kvm_write_c0_guest_prid(cop0, regs->cp0reg[MIPS_CP0_PRID][0]);
> + kvm_write_c0_guest_ebase(cop0, regs->cp0reg[MIPS_CP0_PRID][1]);
> +
> + /* only restore implemented config registers */
> + kvm_write_c0_guest_config(cop0, regs->cp0reg[MIPS_CP0_CONFIG][0]);
> +
> + if ((regs->cp0reg[MIPS_CP0_CONFIG][0] & MIPS_CONF_M) &
> + cpu_vz_has_config1)
> + kvm_write_c0_guest_config1(cop0,
> + regs->cp0reg[MIPS_CP0_CONFIG][1]);
> +
> + if ((regs->cp0reg[MIPS_CP0_CONFIG][1] & MIPS_CONF_M) &
> + cpu_vz_has_config2)
> + kvm_write_c0_guest_config2(cop0,
> + regs->cp0reg[MIPS_CP0_CONFIG][2]);
> +
> + if ((regs->cp0reg[MIPS_CP0_CONFIG][2] & MIPS_CONF_M) &
> + cpu_vz_has_config3)
> + kvm_write_c0_guest_config3(cop0,
> + regs->cp0reg[MIPS_CP0_CONFIG][3]);
> +
> + if ((regs->cp0reg[MIPS_CP0_CONFIG][3] & MIPS_CONF_M) &
> + cpu_vz_has_config4)
> + kvm_write_c0_guest_config4(cop0,
> + regs->cp0reg[MIPS_CP0_CONFIG][4]);
> +
> + if ((regs->cp0reg[MIPS_CP0_CONFIG][4] & MIPS_CONF_M) &
> + cpu_vz_has_config5)
> + kvm_write_c0_guest_config5(cop0,
> + regs->cp0reg[MIPS_CP0_CONFIG][5]);
> +
> + if (cpu_vz_has_config6)
> + kvm_write_c0_guest_config6(cop0,
> + regs->cp0reg[MIPS_CP0_CONFIG][6]);
> + if (cpu_vz_has_config7)
> + kvm_write_c0_guest_config7(cop0,
> + regs->cp0reg[MIPS_CP0_CONFIG][7]);
> +
> + kvm_write_c0_guest_errorepc(cop0, regs->cp0reg[MIPS_CP0_ERROR_PC][0]);
> +
> + /* call after setting MIPS_CP0_CAUSE to avoid having it overwritten
> + * this will set guest compare and cause.TI if necessary
> + */
> + kvm_vz_restore_guest_timer_int(vcpu, regs);
> +
> + return 0;
> +}
All this is now obsolete after David's patches (reusing kvm_regs looked
a bit strange in fact).
Paolo
next prev parent reply other threads:[~2013-05-28 15:04 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-19 5:47 [PATCH 00/18] KVM/MIPS32: Support for the new Virtualization ASE (VZ-ASE) Sanjay Lal
2013-05-19 5:47 ` [PATCH 01/18] Revert "MIPS: microMIPS: Support dynamic ASID sizing." Sanjay Lal
2013-05-19 5:47 ` [PATCH 02/18] Revert "MIPS: Allow ASID size to be determined at boot time." Sanjay Lal
2013-05-19 5:47 ` [PATCH 03/18] KVM/MIPS32: Export min_low_pfn Sanjay Lal
2013-05-19 5:47 ` [PATCH 04/18] KVM/MIPS32-VZ: MIPS VZ-ASE related register defines and helper macros Sanjay Lal
2013-05-19 5:47 ` [PATCH 05/18] KVM/MIPS32-VZ: VZ-ASE assembler wrapper functions to set GuestIDs Sanjay Lal
2013-05-19 13:36 ` Sergei Shtylyov
2013-05-19 5:47 ` [PATCH 06/18] KVM/MIPS32-VZ: VZ-ASE related callbacks to handle guest exceptions that trap to the Root context Sanjay Lal
2013-05-28 15:04 ` Paolo Bonzini [this message]
2013-05-30 18:35 ` Sanjay Lal
2013-05-28 16:14 ` Paolo Bonzini
2013-05-30 18:35 ` Sanjay Lal
2013-05-30 20:11 ` Paolo Bonzini
2013-05-31 1:56 ` Sanjay Lal
2013-05-19 5:47 ` [PATCH 07/18] KVM/MIPS32: VZ-ASE related CPU feature flags and options Sanjay Lal
2013-05-19 5:47 ` [PATCH 08/18] KVM/MIPS32-VZ: Entry point for trampolining to the guest and trap handlers Sanjay Lal
2013-05-28 14:43 ` Paolo Bonzini
2013-05-19 5:47 ` [PATCH 09/18] KVM/MIPS32-VZ: Add support for CONFIG_KVM_MIPS_VZ option Sanjay Lal
2013-05-19 5:47 ` [PATCH 10/18] KVM/MIPS32-VZ: Add API for VZ-ASE Capability Sanjay Lal
2013-05-28 16:34 ` Paolo Bonzini
2013-05-30 17:07 ` David Daney
2013-05-30 17:51 ` Paolo Bonzini
2013-05-30 18:35 ` David Daney
2013-05-30 18:30 ` Sanjay Lal
2013-05-19 5:47 ` [PATCH 11/18] KVM/MIPS32-VZ: VZ: Handle Guest TLB faults that are handled in Root context Sanjay Lal
2013-05-19 5:47 ` [PATCH 12/18] KVM/MIPS32-VZ: VM Exit Stats, add VZ exit reasons Sanjay Lal
2013-05-19 5:47 ` [PATCH 13/18] KVM/MIPS32-VZ: Top level handler for Guest faults Sanjay Lal
2013-05-19 5:47 ` [PATCH 14/18] KVM/MIPS32-VZ: Guest exception batching support Sanjay Lal
2013-05-19 5:47 ` [PATCH 15/18] KVM/MIPS32: Add dummy trap handler to catch unexpected exceptions and dump out useful info Sanjay Lal
2013-05-19 5:47 ` [PATCH 16/18] KVM/MIPS32-VZ: Add VZ-ASE support to KVM/MIPS data structures Sanjay Lal
2013-05-28 15:24 ` Paolo Bonzini
2013-05-19 5:47 ` [PATCH 17/18] KVM/MIPS32: Revert to older method for accessing ASID parameters Sanjay Lal
2013-05-19 5:47 ` [PATCH 18/18] KVM/MIPS32-VZ: Dump out additional info about VZ features as part of /proc/cpuinfo Sanjay Lal
2013-05-20 15:50 ` [PATCH 00/18] KVM/MIPS32: Support for the new Virtualization ASE (VZ-ASE) David Daney
2013-05-20 16:58 ` Sanjay Lal
2013-05-20 17:29 ` David Daney
2013-05-20 17:34 ` Sanjay Lal
2013-05-20 18:36 ` Maciej W. Rozycki
2013-05-20 18:58 ` David Daney
2013-05-27 12:45 ` Maciej W. Rozycki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51A4C776.8070002@redhat.com \
--to=pbonzini@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=mtosatti@redhat.com \
--cc=ralf@linux-mips.org \
--cc=sanjayl@kymasys.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox