diff options
author | Paul Mackerras <paulus@ozlabs.org> | 2018-01-18 20:09:57 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2018-01-18 20:09:57 -0500 |
commit | d27998185da8fbdc35911307ae13518d168778d7 (patch) | |
tree | 4c5a99fd7cff7c9da1f858fdfccf8dc1cc6c597b /arch/powerpc/kvm | |
parent | 00608e1f007e4cf6031485c5630e0e504bceef9b (diff) | |
parent | d075745d893c78730e4a3b7a60fca23c2f764081 (diff) |
Merge remote-tracking branch 'remotes/powerpc/topic/ppc-kvm' into kvm-ppc-next
This merges in the ppc-kvm topic branch of the powerpc tree to get
two patches which are prerequisites for the following patch series,
plus another patch which touches both powerpc and KVM code.
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_ras.c | 8 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_rmhandlers.S | 9 | ||||
-rw-r--r-- | arch/powerpc/kvm/booke.c | 7 | ||||
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 7 |
4 files changed, 15 insertions, 16 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_ras.c b/arch/powerpc/kvm/book3s_hv_ras.c index c356f9a40b24..c296343d0dcc 100644 --- a/arch/powerpc/kvm/book3s_hv_ras.c +++ b/arch/powerpc/kvm/book3s_hv_ras.c | |||
@@ -268,17 +268,19 @@ static void kvmppc_tb_resync_done(void) | |||
268 | * secondary threads to proceed. | 268 | * secondary threads to proceed. |
269 | * - All secondary threads will eventually call opal hmi handler on | 269 | * - All secondary threads will eventually call opal hmi handler on |
270 | * their exit path. | 270 | * their exit path. |
271 | * | ||
272 | * Returns 1 if the timebase offset should be applied, 0 if not. | ||
271 | */ | 273 | */ |
272 | 274 | ||
273 | long kvmppc_realmode_hmi_handler(void) | 275 | long kvmppc_realmode_hmi_handler(void) |
274 | { | 276 | { |
275 | int ptid = local_paca->kvm_hstate.ptid; | ||
276 | bool resync_req; | 277 | bool resync_req; |
277 | 278 | ||
278 | /* This is only called on primary thread. */ | ||
279 | BUG_ON(ptid != 0); | ||
280 | __this_cpu_inc(irq_stat.hmi_exceptions); | 279 | __this_cpu_inc(irq_stat.hmi_exceptions); |
281 | 280 | ||
281 | if (hmi_handle_debugtrig(NULL) >= 0) | ||
282 | return 1; | ||
283 | |||
282 | /* | 284 | /* |
283 | * By now primary thread has already completed guest->host | 285 | * By now primary thread has already completed guest->host |
284 | * partition switch but haven't signaled secondaries yet. | 286 | * partition switch but haven't signaled secondaries yet. |
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index 30ece4cebaf5..7daf21be33d0 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S | |||
@@ -1909,16 +1909,17 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) | |||
1909 | bne 27f | 1909 | bne 27f |
1910 | bl kvmppc_realmode_hmi_handler | 1910 | bl kvmppc_realmode_hmi_handler |
1911 | nop | 1911 | nop |
1912 | cmpdi r3, 0 | ||
1912 | li r12, BOOK3S_INTERRUPT_HMI | 1913 | li r12, BOOK3S_INTERRUPT_HMI |
1913 | /* | 1914 | /* |
1914 | * At this point kvmppc_realmode_hmi_handler would have resync-ed | 1915 | * At this point kvmppc_realmode_hmi_handler may have resync-ed |
1915 | * the TB. Hence it is not required to subtract guest timebase | 1916 | * the TB, and if it has, we must not subtract the guest timebase |
1916 | * offset from timebase. So, skip it. | 1917 | * offset from the timebase. So, skip it. |
1917 | * | 1918 | * |
1918 | * Also, do not call kvmppc_subcore_exit_guest() because it has | 1919 | * Also, do not call kvmppc_subcore_exit_guest() because it has |
1919 | * been invoked as part of kvmppc_realmode_hmi_handler(). | 1920 | * been invoked as part of kvmppc_realmode_hmi_handler(). |
1920 | */ | 1921 | */ |
1921 | b 30f | 1922 | beq 30f |
1922 | 1923 | ||
1923 | 27: | 1924 | 27: |
1924 | /* Subtract timebase offset from timebase */ | 1925 | /* Subtract timebase offset from timebase */ |
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 071b87ee682f..83b485810aea 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c | |||
@@ -599,9 +599,9 @@ static void arm_next_watchdog(struct kvm_vcpu *vcpu) | |||
599 | spin_unlock_irqrestore(&vcpu->arch.wdt_lock, flags); | 599 | spin_unlock_irqrestore(&vcpu->arch.wdt_lock, flags); |
600 | } | 600 | } |
601 | 601 | ||
602 | void kvmppc_watchdog_func(unsigned long data) | 602 | void kvmppc_watchdog_func(struct timer_list *t) |
603 | { | 603 | { |
604 | struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; | 604 | struct kvm_vcpu *vcpu = from_timer(vcpu, t, arch.wdt_timer); |
605 | u32 tsr, new_tsr; | 605 | u32 tsr, new_tsr; |
606 | int final; | 606 | int final; |
607 | 607 | ||
@@ -1412,8 +1412,7 @@ int kvmppc_subarch_vcpu_init(struct kvm_vcpu *vcpu) | |||
1412 | { | 1412 | { |
1413 | /* setup watchdog timer once */ | 1413 | /* setup watchdog timer once */ |
1414 | spin_lock_init(&vcpu->arch.wdt_lock); | 1414 | spin_lock_init(&vcpu->arch.wdt_lock); |
1415 | setup_timer(&vcpu->arch.wdt_timer, kvmppc_watchdog_func, | 1415 | timer_setup(&vcpu->arch.wdt_timer, kvmppc_watchdog_func, 0); |
1416 | (unsigned long)vcpu); | ||
1417 | 1416 | ||
1418 | /* | 1417 | /* |
1419 | * Clear DBSR.MRR to avoid guest debug interrupt as | 1418 | * Clear DBSR.MRR to avoid guest debug interrupt as |
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 7c9e45f54186..77eb25abc601 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -1403,7 +1403,6 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) | |||
1403 | int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) | 1403 | int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) |
1404 | { | 1404 | { |
1405 | int r; | 1405 | int r; |
1406 | sigset_t sigsaved; | ||
1407 | 1406 | ||
1408 | if (vcpu->mmio_needed) { | 1407 | if (vcpu->mmio_needed) { |
1409 | vcpu->mmio_needed = 0; | 1408 | vcpu->mmio_needed = 0; |
@@ -1444,16 +1443,14 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) | |||
1444 | #endif | 1443 | #endif |
1445 | } | 1444 | } |
1446 | 1445 | ||
1447 | if (vcpu->sigset_active) | 1446 | kvm_sigset_activate(vcpu); |
1448 | sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved); | ||
1449 | 1447 | ||
1450 | if (run->immediate_exit) | 1448 | if (run->immediate_exit) |
1451 | r = -EINTR; | 1449 | r = -EINTR; |
1452 | else | 1450 | else |
1453 | r = kvmppc_vcpu_run(run, vcpu); | 1451 | r = kvmppc_vcpu_run(run, vcpu); |
1454 | 1452 | ||
1455 | if (vcpu->sigset_active) | 1453 | kvm_sigset_deactivate(vcpu); |
1456 | sigprocmask(SIG_SETMASK, &sigsaved, NULL); | ||
1457 | 1454 | ||
1458 | return r; | 1455 | return r; |
1459 | } | 1456 | } |