Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356359
b: refs/heads/master
c: a413f47
h: refs/heads/master
i:
  356357: d0e5a27
  356355: ed3c5f1
  356351: 0d2f364
v: v3
  • Loading branch information
Ian Munsie authored and Benjamin Herrenschmidt committed Jan 10, 2013
1 parent a491f83 commit 1f97953
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 96f013fe1b0904ee9059aa5105f7aa4959cd3914
refs/heads/master: a413f474a0ff29404bf1af5c024215476ed6ca01
9 changes: 9 additions & 0 deletions trunk/arch/powerpc/include/asm/hvcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,15 @@ static inline unsigned long cmo_get_page_size(void)
{
return CMO_PageSize;
}

extern long pSeries_enable_reloc_on_exc(void);
extern long pSeries_disable_reloc_on_exc(void);

#else

#define pSeries_enable_reloc_on_exc() do {} while (0)
#define pSeries_disable_reloc_on_exc() do {} while (0)

#endif /* CONFIG_PPC_PSERIES */

#endif /* __ASSEMBLY__ */
Expand Down
18 changes: 18 additions & 0 deletions trunk/arch/powerpc/kvm/book3s_pr.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <asm/kvm_book3s.h>
#include <asm/mmu_context.h>
#include <asm/switch_to.h>
#include <asm/firmware.h>
#include <linux/gfp.h>
#include <linux/sched.h>
#include <linux/vmalloc.h>
Expand Down Expand Up @@ -1284,12 +1285,21 @@ void kvmppc_core_flush_memslot(struct kvm *kvm, struct kvm_memory_slot *memslot)
{
}

static unsigned int kvm_global_user_count = 0;
static DEFINE_SPINLOCK(kvm_global_user_count_lock);

int kvmppc_core_init_vm(struct kvm *kvm)
{
#ifdef CONFIG_PPC64
INIT_LIST_HEAD(&kvm->arch.spapr_tce_tables);
#endif

if (firmware_has_feature(FW_FEATURE_SET_MODE)) {
spin_lock(&kvm_global_user_count_lock);
if (++kvm_global_user_count == 1)
pSeries_disable_reloc_on_exc();
spin_unlock(&kvm_global_user_count_lock);
}
return 0;
}

Expand All @@ -1298,6 +1308,14 @@ void kvmppc_core_destroy_vm(struct kvm *kvm)
#ifdef CONFIG_PPC64
WARN_ON(!list_empty(&kvm->arch.spapr_tce_tables));
#endif

if (firmware_has_feature(FW_FEATURE_SET_MODE)) {
spin_lock(&kvm_global_user_count_lock);
BUG_ON(kvm_global_user_count == 0);
if (--kvm_global_user_count == 0)
pSeries_enable_reloc_on_exc();
spin_unlock(&kvm_global_user_count_lock);
}
}

static int kvmppc_book3s_init(void)
Expand Down
8 changes: 5 additions & 3 deletions trunk/arch/powerpc/platforms/pseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ static void pSeries_idle(void)
* to ever be a problem in practice we can move this into a kernel thread to
* finish off the process later in boot.
*/
static int __init pSeries_enable_reloc_on_exc(void)
long pSeries_enable_reloc_on_exc(void)
{
long rc;
unsigned int delay, total_delay = 0;
Expand All @@ -397,9 +397,9 @@ static int __init pSeries_enable_reloc_on_exc(void)
mdelay(delay);
}
}
EXPORT_SYMBOL(pSeries_enable_reloc_on_exc);

#ifdef CONFIG_KEXEC
static long pSeries_disable_reloc_on_exc(void)
long pSeries_disable_reloc_on_exc(void)
{
long rc;

Expand All @@ -410,7 +410,9 @@ static long pSeries_disable_reloc_on_exc(void)
mdelay(get_longbusy_msecs(rc));
}
}
EXPORT_SYMBOL(pSeries_disable_reloc_on_exc);

#ifdef CONFIG_KEXEC
static void pSeries_machine_kexec(struct kimage *image)
{
long rc;
Expand Down

0 comments on commit 1f97953

Please sign in to comment.