All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markos Chandras <Markos.Chandras@imgtec.com>
To: James Hogan <james.hogan@imgtec.com>,
	John Crispin <john@phrozen.org>,
	Ralf Baechle <ralf@linux-mips.org>, <linux-mips@linux-mips.org>
Cc: Gleb Natapov <gleb@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>, <kvm@vger.kernel.org>,
	Sanjay Lal <sanjayl@kymasys.com>
Subject: Re: [PATCH 1/2] MIPS: KVM: use common EHINV aware UNIQUE_ENTRYHI
Date: Wed, 15 Jan 2014 10:16:14 +0000	[thread overview]
Message-ID: <52D65FEE.2080303@imgtec.com> (raw)
In-Reply-To: <1389780682-32638-2-git-send-email-james.hogan@imgtec.com>

On 01/15/2014 10:11 AM, James Hogan wrote:
> When KVM is enabled and TLB invalidation is supported,
> kvm_mips_flush_host_tlb() can cause a machine check exception due to
> multiple matching TLB entries. This can occur on shutdown even when KVM
> hasn't been actively used.
>
> Commit adb78de9eae8 (MIPS: mm: Move UNIQUE_ENTRYHI macro to a header
> file) created a common UNIQUE_ENTRYHI in asm/tlb.h but it didn't update
> the copy of UNIQUE_ENTRYHI in kvm_tlb.c to use it.
>
> Commit 36b175451399 (MIPS: tlb: Set the EHINV bit for TLBINVF cores when
> invalidating the TLB) later added TLB invalidation (EHINV) support to
> the common UNIQUE_ENTRYHI.
>
> Therefore make kvm_tlb.c use the EHINV aware UNIQUE_ENTRYHI
> implementation in asm/tlb.h too.
>
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> Cc: Gleb Natapov <gleb@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: kvm@vger.kernel.org
> Cc: Markos Chandras <markos.chandras@imgtec.com>
> Cc: Sanjay Lal <sanjayl@kymasys.com>
> ---
> This is based on John Crispin's mips-next-3.14 branch.
>
> I do not object to it being squashed into commit adb78de9eae8 (MIPS: mm:
> Move UNIQUE_ENTRYHI macro to a header file) since that commit hasn't
> reached mainline yet.
> ---
>   arch/mips/kvm/kvm_tlb.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/mips/kvm/kvm_tlb.c b/arch/mips/kvm/kvm_tlb.c
> index c777dd36d4a8..52083ea7fddd 100644
> --- a/arch/mips/kvm/kvm_tlb.c
> +++ b/arch/mips/kvm/kvm_tlb.c
> @@ -25,6 +25,7 @@
>   #include <asm/mmu_context.h>
>   #include <asm/pgtable.h>
>   #include <asm/cacheflush.h>
> +#include <asm/tlb.h>
>
>   #undef CONFIG_MIPS_MT
>   #include <asm/r4kcache.h>
> @@ -35,9 +36,6 @@
>
>   #define PRIx64 "llx"
>
> -/* Use VZ EntryHi.EHINV to invalidate TLB entries */
> -#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
> -
>   atomic_t kvm_mips_instance;
>   EXPORT_SYMBOL(kvm_mips_instance);
>
>

Thanks. That looks good to me.

Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>

-- 
markos

WARNING: multiple messages have this Message-ID (diff)
From: Markos Chandras <Markos.Chandras@imgtec.com>
To: James Hogan <james.hogan@imgtec.com>,
	John Crispin <john@phrozen.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	linux-mips@linux-mips.org
Cc: Gleb Natapov <gleb@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, Sanjay Lal <sanjayl@kymasys.com>
Subject: Re: [PATCH 1/2] MIPS: KVM: use common EHINV aware UNIQUE_ENTRYHI
Date: Wed, 15 Jan 2014 10:16:14 +0000	[thread overview]
Message-ID: <52D65FEE.2080303@imgtec.com> (raw)
Message-ID: <20140115101614.k3YnbZpALkGTpCZLDyvmT6cddvbaGkPxKJbvBl9AD9w@z> (raw)
In-Reply-To: <1389780682-32638-2-git-send-email-james.hogan@imgtec.com>

On 01/15/2014 10:11 AM, James Hogan wrote:
> When KVM is enabled and TLB invalidation is supported,
> kvm_mips_flush_host_tlb() can cause a machine check exception due to
> multiple matching TLB entries. This can occur on shutdown even when KVM
> hasn't been actively used.
>
> Commit adb78de9eae8 (MIPS: mm: Move UNIQUE_ENTRYHI macro to a header
> file) created a common UNIQUE_ENTRYHI in asm/tlb.h but it didn't update
> the copy of UNIQUE_ENTRYHI in kvm_tlb.c to use it.
>
> Commit 36b175451399 (MIPS: tlb: Set the EHINV bit for TLBINVF cores when
> invalidating the TLB) later added TLB invalidation (EHINV) support to
> the common UNIQUE_ENTRYHI.
>
> Therefore make kvm_tlb.c use the EHINV aware UNIQUE_ENTRYHI
> implementation in asm/tlb.h too.
>
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> Cc: Gleb Natapov <gleb@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: kvm@vger.kernel.org
> Cc: Markos Chandras <markos.chandras@imgtec.com>
> Cc: Sanjay Lal <sanjayl@kymasys.com>
> ---
> This is based on John Crispin's mips-next-3.14 branch.
>
> I do not object to it being squashed into commit adb78de9eae8 (MIPS: mm:
> Move UNIQUE_ENTRYHI macro to a header file) since that commit hasn't
> reached mainline yet.
> ---
>   arch/mips/kvm/kvm_tlb.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/mips/kvm/kvm_tlb.c b/arch/mips/kvm/kvm_tlb.c
> index c777dd36d4a8..52083ea7fddd 100644
> --- a/arch/mips/kvm/kvm_tlb.c
> +++ b/arch/mips/kvm/kvm_tlb.c
> @@ -25,6 +25,7 @@
>   #include <asm/mmu_context.h>
>   #include <asm/pgtable.h>
>   #include <asm/cacheflush.h>
> +#include <asm/tlb.h>
>
>   #undef CONFIG_MIPS_MT
>   #include <asm/r4kcache.h>
> @@ -35,9 +36,6 @@
>
>   #define PRIx64 "llx"
>
> -/* Use VZ EntryHi.EHINV to invalidate TLB entries */
> -#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
> -
>   atomic_t kvm_mips_instance;
>   EXPORT_SYMBOL(kvm_mips_instance);
>
>

Thanks. That looks good to me.

Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>

-- 
markos

  reply	other threads:[~2014-01-15 10:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15 10:11 [PATCH 0/2] MIPS: KVM: fixes for KVM on ProAptiv cores James Hogan
2014-01-15 10:11 ` James Hogan
2014-01-15 10:11 ` [PATCH 1/2] MIPS: KVM: use common EHINV aware UNIQUE_ENTRYHI James Hogan
2014-01-15 10:11   ` James Hogan
2014-01-15 10:16   ` Markos Chandras [this message]
2014-01-15 10:16     ` Markos Chandras
2014-01-15 10:11 ` [PATCH 2/2] MIPS: KVM: remove shadow_tlb code James Hogan
2014-01-15 10:11   ` James Hogan
2014-01-15 11:09 ` [PATCH 0/2] MIPS: KVM: fixes for KVM on ProAptiv cores Paolo Bonzini

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=52D65FEE.2080303@imgtec.com \
    --to=markos.chandras@imgtec.com \
    --cc=gleb@redhat.com \
    --cc=james.hogan@imgtec.com \
    --cc=john@phrozen.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.