[PATCH] cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin

2018-01-11 Thread Shilpasri G Bhat
Some OpenPOWER boxes can have same pstate values for nominal and pmin pstates. In these boxes the current code will not initialize 'powernv_pstate_info.min' variable and result in erroneous CPU frequency reporting. This patch fixes this problem. Fixes: 09ca4c9b5958 ("cpufreq: powernv: Replacing ps

[PATCH 2/2] powerpc/xive: Add interrupt flag to disable automatic EOI

2018-01-11 Thread Benjamin Herrenschmidt
This will be used by KVM in order to keep escalation interrupts in the non-EOI (masked) state after they fire. They will be re-enabled directly in HW by KVM when needed. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/xive.h | 3 +++ arch/powerpc/sysdev/xive/common.c | 3 ++-

[PATCH 1/2] powerpc/xive: Move definition of ESB bits

2018-01-11 Thread Benjamin Herrenschmidt
>From xive.h to xive-regs.h since it's a HW register definition and it can be used from assembly Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/xive-regs.h | 35 +++ arch/powerpc/include/asm/xive.h | 35 ---

Re: [PATCH 00/26] KVM: PPC: Book3S PR: Transaction memory support on PR KVM

2018-01-11 Thread Simon Guo
Hi Gustavo, On Thu, Jan 11, 2018 at 11:56:59AM -0200, Gustavo Romero wrote: > Hi Simon, > > On 01/11/2018 08:11 AM, wei.guo.si...@gmail.com wrote: > > From: Simon Guo > > > > In current days, many OS distributions have utilized transaction > > memory functionality. In PowerPC, HV KVM supports TM

[PATCH v4 5/6] powerpc/kvm/xive: Make xive_pushed a byte, not a word

2018-01-11 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/kvm_host.h | 2 +- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index bfe51356af5

[PATCH v4 2/6] powerpc/kvm/xive: Enable use of the new "single escalation" feature

2018-01-11 Thread Benjamin Herrenschmidt
That feature, provided by Power9 DDD2.0 and later, when supported by newer OPAL versions, allows to sacrifice a queue (priority 7) in favor of merging all the escalation interrupts of the queues of a single VP into a single interrupt. This reduces the number of host interrupts used up by KVM guest

[PATCH v4 6/6] powerpc/kvm/xive: Keep escalation interrupt masked unless ceded

2018-01-11 Thread Benjamin Herrenschmidt
This works on top of the single escalation support. When in single escalation, with this change, we will keep the escalation interrupt disabled unless the VCPU is in H_CEDE (idle). In any other case, we know the VCPU will be rescheduled and thus there is no need to take escalation interrupts in the

[PATCH v4 4/6] powerpc/kvm/xive: Check DR not IR to chose real vs virt mode MMIOs

2018-01-11 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index 327f5e6a1e4d..506a1c775370 100644 --- a/arch/powerpc/kvm/b

[PATCH v4 3/6] powerpc/kvm/xive: Don't use existing "prodded" flag for xive escalations

2018-01-11 Thread Benjamin Herrenschmidt
The prodded flag is only cleared at the beginning of H_CEDE, so every time we have an escalation, we will cause the *next* H_CEDE to return immediately. Instead use a dedicated "irq_pending" flag to indicate that a guest interrupt is pending for the VCPU. We don't reuse the existing exception bitm

[PATCH v4 1/6] powerpc/kvm/xive: Add more debugfs queues info

2018-01-11 Thread Benjamin Herrenschmidt
Add details about enabled queues and escalation interrupts Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kvm/book3s_xive.c | 28 1 file changed, 28 insertions(+) diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c index 0d750d274c4e

[PATCH 3/5] powerpc: Reduce log level of "OPAL detected !" message

2018-01-11 Thread Benjamin Herrenschmidt
This message isn't terribly useful. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/powernv/opal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 041ddbd1fc57..2479e3396ed8

[PATCH 4/5] powerpc: Remove useless EXC_COMMON_HV

2018-01-11 Thread Benjamin Herrenschmidt
The only difference between EXC_COMMON_HV and EXC_COMMON is that the former adds "2" to the trap number which is supposed to represent the fact that this is an "HV" interrupt which uses HSRR0/1. However KVM is the only one who cares and it has its own separate macros. In fact, we only have one us

[PATCH 2/5] powerpc: Remove DEBUG define in 64-bit early setup code

2018-01-11 Thread Benjamin Herrenschmidt
This statement causes some not very useful messages to always be printed on the serial port at boot, even on quiet boots. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_64.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/ke

[PATCH 1/5] powerpc/xive: Remove incorrect debug code

2018-01-11 Thread Benjamin Herrenschmidt
WORD2 if the TIMA isn't byte accessible and isn't that useful to know about, take out the pr_devel statement. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/sysdev/xive/common.c | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysd

[PATCH 5/5] powerpc: Use the TRAP macro whenever comparing a trap number

2018-01-11 Thread Benjamin Herrenschmidt
Trap numbers can have extra bits at the bottom that need to be filtered out. There are a few cases where we don't do that. It's possible that we got lucky but better safe than sorry. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/process.c | 2 +- arch/powerpc/kernel/traps.c |

[PATCH 06/11] signal/powerpc: Document conflicts with SI_USER and SIGFPE and SIGTRAP

2018-01-11 Thread Eric W. Biederman
Setting si_code to 0 results in a userspace seeing an si_code of 0. This is the same si_code as SI_USER. Posix and common sense requires that SI_USER not be a signal specific si_code. As such this use of 0 for the si_code is a pretty horribly broken ABI. Further use of si_code == 0 guaranteed th

Re: [linux-next][qla2xxx][85caa95]kernel BUG at lib/list_debug.c:31!

2018-01-11 Thread Madhani, Himanshu
> On Jan 10, 2018, at 9:38 PM, Abdul Haleem wrote: > > On Tue, 2018-01-09 at 18:09 +, Madhani, Himanshu wrote: >> Hello Abdul, >> >>> On Jan 9, 2018, at 7:54 AM, Bart Van Assche wrote: >>> >>> On Tue, 2018-01-09 at 14:44 +0530, Abdul Haleem wrote: Greeting's, Linux next

Re: [PATCH 00/26] KVM: PPC: Book3S PR: Transaction memory support on PR KVM

2018-01-11 Thread Benjamin Herrenschmidt
On Thu, 2018-01-11 at 11:56 -0200, Gustavo Romero wrote: > Hi Simon, > > On 01/11/2018 08:11 AM, wei.guo.si...@gmail.com wrote: > > From: Simon Guo > > > > In current days, many OS distributions have utilized transaction > > memory functionality. In PowerPC, HV KVM supports TM. But PR KVM > > do

Re: [PATCH v6 2/2] cxl: read PHB indications from the device tree

2018-01-11 Thread Frederic Barrat
Le 11/01/2018 à 16:01, Philippe Bergheaud a écrit : Configure the P9 XSL_DSNCTL register with PHB indications found in the device tree, or else use legacy hard-coded values. Signed-off-by: Philippe Bergheaud Acked-by: Frederic Barrat Thanks --- Changelog: v2: New patch. Use the new d

Re: [PATCH v6 1/2] powerpc/powernv: Enable tunneled operations

2018-01-11 Thread Frederic Barrat
Le 11/01/2018 à 16:01, Philippe Bergheaud a écrit : P9 supports PCI tunneled operations (atomics and as_notify). This patch adds support for tunneled operations on powernv, with a new API, to be called by device drivers: pnv_pci_get_tunnel_ind() Tell driver the 16-bit ASN indication used b

[PATCH 4/5] powerpc/4xx: Improve a size determination in two functions

2018-01-11 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 11 Jan 2018 18:32:33 +0100 Replace the specification of data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detec

[PATCH 5/5] powerpc/4xx: Delete an unnecessary return statement in two functions

2018-01-11 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 11 Jan 2018 18:40:23 +0100 The script "checkpatch.pl" pointed information out like the following. WARNING: void function return statements are not generally useful Thus remove such a statement in the affected functions. Signed-off-by: Markus Elfring --- arch/p

[PATCH 3/5] powerpc/4xx: Delete an error message for a failed memory allocation in three functions

2018-01-11 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 11 Jan 2018 18:28:54 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/4xx/msi.c | 5 ++--- arch/powerpc/platforms/4

[PATCH 2/5] powerpc/4xx: Use seq_putc() in ocm_debugfs_show()

2018-01-11 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 11 Jan 2018 18:10:02 +0100 A single character (line break) should be put into a sequence. Thus use the corresponding function "seq_putc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/4xx/ocm.

[PATCH 1/5] powerpc/4xx: Combine four seq_printf() calls into two in ocm_debugfs_show()

2018-01-11 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 11 Jan 2018 18:08:08 +0100 Some data were printed into a sequence by four separate function calls. Print the same data by two single function calls instead. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- arch/powerpc

[PATCH 0/5] powerpc/platforms/4xx: Adjustments for six function implementations

2018-01-11 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 11 Jan 2018 18:48:28 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (5): Combine four seq_printf() calls into two in ocm_debugfs_show() Use seq_putc() in ocm_debugfs_show() Delete an error message for

Re: [PATCH V7] cxl: Add support for ASB_Notify on POWER9

2018-01-11 Thread Frederic Barrat
Le 11/01/2018 à 09:55, Christophe Lombard a écrit : The POWER9 core supports a new feature: ASB_Notify which requires the support of the Special Purpose Register: TIDR. The ASB_Notify command, generated by the AFU, will attempt to wake-up the host thread identified by the particular LPID:PID:T

Re: revamp vmem_altmap / dev_pagemap handling V3

2018-01-11 Thread Jerome Glisse
On Mon, Jan 08, 2018 at 12:26:46PM +0100, Christoph Hellwig wrote: > Any chance to get this fully reviewed and picked up before the > end of the merge window? Sorry for taking so long to get to that, i looked at all the patches and did not see anything obviously wrong and i like the cleanup so Re

[PATCH v6 2/2] cxl: read PHB indications from the device tree

2018-01-11 Thread Philippe Bergheaud
Configure the P9 XSL_DSNCTL register with PHB indications found in the device tree, or else use legacy hard-coded values. Signed-off-by: Philippe Bergheaud --- Changelog: v2: New patch. Use the new device tree property "ibm,phb-indications". v3: No change. v4: No functional change. Drop co

[PATCH v6 1/2] powerpc/powernv: Enable tunneled operations

2018-01-11 Thread Philippe Bergheaud
P9 supports PCI tunneled operations (atomics and as_notify). This patch adds support for tunneled operations on powernv, with a new API, to be called by device drivers: pnv_pci_get_tunnel_ind() Tell driver the 16-bit ASN indication used by kernel. pnv_pci_set_tunnel_bar() Tell kernel the Tu

Re: [PATCH 00/26] KVM: PPC: Book3S PR: Transaction memory support on PR KVM

2018-01-11 Thread Gustavo Romero
Hi Simon, On 01/11/2018 08:11 AM, wei.guo.si...@gmail.com wrote: > From: Simon Guo > > In current days, many OS distributions have utilized transaction > memory functionality. In PowerPC, HV KVM supports TM. But PR KVM > does not. > > The drive for the transaction memory support of PR KVM is th

[PATCH 26/26] KVM: PPC: Book3S PR: enable HTM for PR KVM for KVM_CHECK_EXTENSION ioctl

2018-01-11 Thread wei . guo . simon
From: Simon Guo With current patch set, PR KVM now supports HTM. So this patch turns it on for PR KVM. Tested with: https://github.com/justdoitqd/publicFiles/blob/master/test_kvm_htm_cap.c Signed-off-by: Simon Guo --- arch/powerpc/kvm/powerpc.c | 3 +-- 1 file changed, 1 insertion(+), 2 delet

[PATCH 25/26] KVM: PPC: Book3S PR: Support TAR handling for PR KVM HTM.

2018-01-11 Thread wei . guo . simon
From: Simon Guo Currently guest kernel doesn't handle TAR fac unavailable and it always runs with TAR bit on. PR KVM will lazily enable TAR. TAR is not a frequent-use reg and it is not included in SVCPU struct. To make it work for transaction memory at PR KVM: 1). Flush/giveup TAR at kvmppc_save

[PATCH 24/26] KVM: PPC: Book3S PR: add guard code to prevent returning to guest with PR=0 and Transactional state

2018-01-11 Thread wei . guo . simon
From: Simon Guo Currently PR KVM doesn't support transaction memory at guest privilege state. This patch adds a check at setting guest msr, so that we can never return to guest with PR=0 and TS=0b10. A tabort will be emulated to indicate this and fail transaction immediately. Signed-off-by: Sim

[PATCH 23/26] KVM: PPC: Book3S PR: add emulation for tabort. for privilege guest

2018-01-11 Thread wei . guo . simon
From: Simon Guo Currently privilege guest will be run with TM disabled. Although the privilege guest cannot initiate a new transaction, it can use tabort to terminate its problem state's transaction. So it is still necessary to emulate tabort. for privilege guest. This patch adds emulation for

[PATCH 22/26] KVM: PPC: Book3S PR: add emulation for trechkpt in PR KVM.

2018-01-11 Thread wei . guo . simon
From: Simon Guo This patch adds host emulation when guest PR KVM executes "trechkpt.", which is a privileged instruction and will trap into host. We firstly copy vcpu ongoing content into vcpu tm checkpoint content, then perform kvmppc_restore_tm_pr() to do trechkpt. with updated vcpu tm checkpo

[PATCH 21/26] KVM: PPC: Book3S PR: adds emulation for treclaim.

2018-01-11 Thread wei . guo . simon
From: Simon Guo This patch adds support for "treclaim." emulation when PR KVM guest executes treclaim. and traps to host. We will firstly doing treclaim. and save TM checkpoint and doing treclaim. Then it is necessary to update vcpu current reg content with checkpointed vals. When rfid into gues

[PATCH 20/26] KVM: PPC: Book3S PR: enable NV reg restore for reading TM SPR at guest privilege state

2018-01-11 Thread wei . guo . simon
From: Simon Guo Currently kvmppc_handle_fac() will not update NV GPRs and thus it can return with GUEST_RESUME. However PR KVM guest always disables MSR_TM bit at privilege state. If PR privilege guest are trying to read TM SPRs, it will trigger TM facility unavailable exception and fall into kv

[PATCH 19/26] KVM: PPC: Book3S PR: always fail transaction in guest privilege state

2018-01-11 Thread wei . guo . simon
From: Simon Guo Currently kernel doesn't use transaction memory. And there is an issue for privilege guest that: tbegin/tsuspend/tresume/tabort TM instructions can impact MSR TM bits without trap into PR host. So following code will lead to a false mfmsr result: tbegin <- MSR bits update

[PATCH 18/26] KVM: PPC: Book3S PR: make mtspr/mfspr emulation behavior based on active TM SPRs

2018-01-11 Thread wei . guo . simon
From: Simon Guo The mfspr/mtspr on TM SPRs(TEXASR/TFIAR/TFHAR) are non-privileged instructions and can be executed at PR KVM guest without trapping into host in problem state. We only emulate mtspr/mfspr texasr/tfiar/tfhar at guest PR=0 state. When we are emulating mtspr tm sprs at guest PR=0 st

[PATCH 17/26] KVM: PPC: Book3S PR: add math support for PR KVM HTM

2018-01-11 Thread wei . guo . simon
From: Simon Guo The math registers will be saved into vcpu->arch.fp/vr and corresponding vcpu->arch.fp_tm/vr_tm area. We flush or giveup the math regs into vcpu->arch.fp/vr before saving transaction. After transaction is restored, the math regs will be loaded back into regs. If there is a FP/VE

[PATCH 16/26] KVM: PPC: Book3S PR: add transaction memory save/restore skeleton for PR KVM

2018-01-11 Thread wei . guo . simon
From: Simon Guo The transaction memory checkpoint area save/restore behavior is triggered when VCPU qemu process is switching out/into CPU. ie. at kvmppc_core_vcpu_put_pr() and kvmppc_core_vcpu_load_pr(). MSR TM active state is determined by TS bits: active: 10(transactional) or 01 (suspende

[PATCH 15/26] KVM: PPC: Book3S PR: add kvmppc_save/restore_tm_sprs() APIs

2018-01-11 Thread wei . guo . simon
From: Simon Guo This patch adds 2 new APIs kvmppc_save_tm_sprs()/kvmppc_restore_tm_sprs() for the purpose of TEXASR/TFIAR/TFHAR save/restore. Signed-off-by: Simon Guo Reviewed-by: Paul Mackerras --- arch/powerpc/kvm/book3s_pr.c | 22 ++ 1 file changed, 22 insertions(+) di

[PATCH 14/26] KVM: PPC: Book3S PR: export tm_enable()/tm_disable/tm_abort() APIs

2018-01-11 Thread wei . guo . simon
From: Simon Guo This patch exports tm_enable()/tm_disable/tm_abort() APIs, which will be used for PR KVM transaction memory logic. Signed-off-by: Simon Guo Reviewed-by: Paul Mackerras --- arch/powerpc/include/asm/asm-prototypes.h | 3 +++ arch/powerpc/include/asm/tm.h | 2 -- ar

[PATCH 13/26] KVM: PPC: Book3S PR: adds new kvmppc_copyto_vcpu_tm/kvmppc_copyfrom_vcpu_tm API for PR KVM.

2018-01-11 Thread wei . guo . simon
From: Simon Guo This patch adds 2 new APIs: kvmppc_copyto_vcpu_tm() and kvmppc_copyfrom_vcpu_tm(). These 2 APIs will be used to copy from/to TM data between VCPU_TM/VCPU area. PR KVM will use these APIs for treclaim. or trchkpt. emulation. Signed-off-by: Simon Guo Reviewed-by: Paul Mackerras

[PATCH 12/26] powerpc: export symbol msr_check_and_set().

2018-01-11 Thread wei . guo . simon
From: Simon Guo PR KVM will need to reuse msr_check_and_set(). This patch exports this API for reuse. Signed-off-by: Simon Guo Reviewed-by: Paul Mackerras --- arch/powerpc/kernel/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/

[PATCH 11/26] KVM: PPC: Book3S PR: prevent TS bits change in kvmppc_interrupt_pr()

2018-01-11 Thread wei . guo . simon
From: Simon Guo PR KVM host usually equipped with enabled TM in its host MSR value, and with non-transactional TS value. When a guest with TM active traps into PR KVM host, the rfid at the tail of kvmppc_interrupt_pr() will try to switch TS bits from S0 (Suspended & TM disabled) to N1 (Non-trans

[PATCH 10/26] KVM: PPC: Book3S PR: set MSR HV bit accordingly for PPC970 and others.

2018-01-11 Thread wei . guo . simon
From: Simon Guo Apple G5 machines(PPC970/FX/GX/MP) have supervisor mode disabled and MSR HV bit is forced into 1. We should follow this in PR KVM guest. This patch set MSR HV=1 for G5 machines and HV=0 for others on PR KVM guest. Signed-off-by: Simon Guo Suggested-by: Paul Mackerras --- arch

[PATCH 09/26] KVM: PPC: Book3S PR: implement RFID TM behavior to suppress change from S0 to N0

2018-01-11 Thread wei . guo . simon
From: Simon Guo Accordingly to ISA specification for RFID, in MSR TM disabled and TS suspended state(S0), if the target MSR is TM disabled and TS state is inactive(N0), rfid should suppress this update. This patch make RFID emulation of PR KVM to be consistent with this. Signed-off-by: Simon Gu

[PATCH 08/26] KVM: PPC: Book3S PR: Sync TM bits to shadow msr for problem state guest

2018-01-11 Thread wei . guo . simon
From: Simon Guo MSR TS bits can be modified with non-privileged instruction like tbegin./tend. That means guest can change MSR value "silently" without notifying host. It is necessary to sync the TM bits to host so that host can calculate shadow msr correctly. note privilege guest will always

[PATCH 07/26] KVM: PPC: Book3S PR: add TEXASR related macros

2018-01-11 Thread wei . guo . simon
From: Simon Guo This patches add some macros for CR0/TEXASR bits so that PR KVM TM logic(tbegin./treclaim./tabort.) can make use of them later. Signed-off-by: Simon Guo --- arch/powerpc/include/asm/reg.h | 21 - arch/powerpc/platforms/powernv/copy-paste.h | 3

[PATCH 06/26] KVM: PPC: Book3S PR: PR KVM pass through MSR TM/TS bits to shadow_msr.

2018-01-11 Thread wei . guo . simon
From: Simon Guo PowerPC TM functionality needs MSR TM/TS bits support in hardware level. Guest TM functionality can not be emulated with "fake" MSR (msr in magic page) TS bits. This patch syncs TM/TS bits in shadow_msr with the MSR value in magic page, so that the MSR TS value which guest sees i

[PATCH 05/26] KVM: PPC: Book3S PR: In PR KVM suspends Transactional state when inject an interrupt.

2018-01-11 Thread wei . guo . simon
From: Simon Guo This patch simulates interrupt behavior per Power ISA while injecting interrupt in PR KVM: - When interrupt happens, transactional state should be suspended. kvmppc_mmu_book3s_64_reset_msr() will be invoked when injecting an interrupt. This patch performs this ISA logic in kvmppc

[PATCH 04/26] KVM: PPC: Book3S PR: add C function wrapper for _kvmppc_save/restore_tm()

2018-01-11 Thread wei . guo . simon
From: Simon Guo Currently _kvmppc_save/restore_tm() APIs can only be invoked from assembly function. This patch adds C function wrappers for them so that they can be safely called from C function. Signed-off-by: Simon Guo --- arch/powerpc/include/asm/asm-prototypes.h | 7 ++ arch/powerpc/kvm

[PATCH 03/26] KVM: PPC: Book3S PR: turn on FP/VSX/VMX MSR bits in kvmppc_save_tm()

2018-01-11 Thread wei . guo . simon
From: Simon Guo kvmppc_save_tm() invokes store_fp_state/store_vr_state(). So it is mandatory to turn on FP/VSX/VMX MSR bits for its execution, just like what kvmppc_restore_tm() did. Previsouly HV KVM has turned the bits on outside of function kvmppc_save_tm(). Now we include this bit change i

[PATCH 02/26] KVM: PPC: Book3S PR: add new parameter (guest MSR) for kvmppc_save_tm()/kvmppc_restore_tm()

2018-01-11 Thread wei . guo . simon
From: Simon Guo HV KVM and PR KVM need different MSR source to indicate whether treclaim. or trecheckpoint. is necessary. This patch add new parameter (guest MSR) for these kvmppc_save_tm/ kvmppc_restore_tm() APIs: - For HV KVM, it is VCPU_MSR - For PR KVM, it is current host MSR or VCPU_SHADOW_

[PATCH 01/26] KVM: PPC: Book3S PR: Move kvmppc_save_tm/kvmppc_restore_tm to separate file

2018-01-11 Thread wei . guo . simon
From: Simon Guo It is a simple patch just for moving kvmppc_save_tm/kvmppc_restore_tm() functionalities to tm.S. There is no logic change. The reconstruct of those APIs will be done in later patches to improve readability. It is for preparation of reusing those APIs on both HV/PR PPC KVM. Signe

[PATCH 00/26] KVM: PPC: Book3S PR: Transaction memory support on PR KVM

2018-01-11 Thread wei . guo . simon
From: Simon Guo In current days, many OS distributions have utilized transaction memory functionality. In PowerPC, HV KVM supports TM. But PR KVM does not. The drive for the transaction memory support of PR KVM is the openstack Continuous Integration testing - They runs a HV(hypervisor) KVM(as l

Re: [PATCH] KVM: PPC: Use seq_puts() in kvmppc_exit_timing_show()

2018-01-11 Thread Paul Mackerras
On Sun, Jan 07, 2018 at 10:18:08AM +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 7 Jan 2018 10:07:36 +0100 > > A headline should be quickly put into a sequence. Thus use the > function "seq_puts" instead of "seq_printf" for this purpose. > > This issue was detected by using

Re: [PATCH] KVM: PPC: Book3S HV: Remove vcpu->arch.dec usage

2018-01-11 Thread Paul Mackerras
On Tue, Dec 19, 2017 at 03:56:24PM +0100, Alexander Graf wrote: > On Book3S in HV mode, we don't use the vcpu->arch.dec field at all. > Instead, all logic is built around vcpu->arch.dec_expires. > > So let's remove the one remaining piece of code that was setting it. > > Signed-off-by: Alexander

Re: [RFC PATCH kernel] KVM: PPC: Book3S PR: Fix WIMG handling under pHyp

2018-01-11 Thread Paul Mackerras
On Wed, Nov 22, 2017 at 02:42:21PM +1100, Alexey Kardashevskiy wrote: > 96df226 "KVM: PPC: Book3S PR: Preserve storage control bits" added WIMG > bits preserving but it missed 2 special cases: > - a magic page in kvmppc_mmu_book3s_64_xlate() and > - guest real mode in kvmppc_handle_pagefault(). >

[PATCH V7] cxl: Add support for ASB_Notify on POWER9

2018-01-11 Thread Christophe Lombard
The POWER9 core supports a new feature: ASB_Notify which requires the support of the Special Purpose Register: TIDR. The ASB_Notify command, generated by the AFU, will attempt to wake-up the host thread identified by the particular LPID:PID:TID. This patch assign a unique TIDR (thread id) for the