Re: [PATCH v4 3/7] KVM: PPC: Remove redundant kvm_run from vcpu_arch

2020-05-26 Thread Paul Mackerras
On Mon, Apr 27, 2020 at 12:35:10PM +0800, Tianjia Zhang wrote: > The 'kvm_run' field already exists in the 'vcpu' structure, which > is the same structure as the 'kvm_run' in the 'vcpu_arch' and > should be deleted. > > Signed-off-by: Tianjia Zhang Thanks, patches 3 and 4 of this series applied

RE: [RFC] Use SMMU HTTU for DMA dirty page tracking

2020-05-26 Thread Tian, Kevin
> From: Xiang Zheng > Sent: Monday, May 25, 2020 7:34 PM > > [+cc Kirti, Yan, Alex] > > On 2020/5/23 1:14, Jean-Philippe Brucker wrote: > > Hi, > > > > On Tue, May 19, 2020 at 05:42:55PM +0800, Xiang Zheng wrote: > >> Hi all, > >> > >> Is there any plan for enabling SMMU HTTU? > > > > Not

[PATCH V5 0/4] arm64/cpufeature: Introduce ID_PFR2, ID_DFR1, ID_MMFR5 and other changes

2020-05-26 Thread Anshuman Khandual
These are remaining patches from V4 series which had some pending reviews from Suzuki (https://patchwork.kernel.org/cover/11557333/). Also dropped [PATCH 15/17] as that will need some more investigation and rework. This series applies on arm64/for-next/cpufeature. Cc: Catalin Marinas Cc: Will

RE: [RFC PATCH v12 03/11] psci: export smccc conduit get helper.

2020-05-26 Thread Jianyong Wu
Hi Sudeep, > -Original Message- > From: Sudeep Holla > Sent: Tuesday, May 26, 2020 6:10 PM > To: Jianyong Wu > Cc: net...@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > m...@kernel.org;

Re: [PATCH 23/26] KVM: arm64: Move SPSR_EL1 to the system register array

2020-05-26 Thread James Morse
Hi Marc, On 22/04/2020 13:00, Marc Zyngier wrote: > SPSR_EL1 being a VNCR-capable register with ARMv8.4-NV, move it to > the sysregs array and update the accessors. Reviewed-by: James Morse Thanks, James ___ kvmarm mailing list

Re: [PATCH 22/26] KVM: arm64: Disintegrate SPSR array

2020-05-26 Thread James Morse
Hi Marc, On 22/04/2020 13:00, Marc Zyngier wrote: > As we're about to move SPSR_EL1 into the VNCR page, we need to > disassociate it from the rest of the 32bit cruft. Let's break > the array into individual fields. Reviewed-by: James Morse Thanks, James

Re: [PATCH 21/26] KVM: arm64: Move SP_EL1 to the system register array

2020-05-26 Thread James Morse
Hi Marc, On 22/04/2020 13:00, Marc Zyngier wrote: > SP_EL1 being a VNCR-capable register with ARMv8.4-NV, move it to the > system register array and update the accessors. Reviewed-by: James Morse Thanks, James ___ kvmarm mailing list

Re: [PATCH 20/26] KVM: arm64: Move ELR_EL1 to the system register array

2020-05-26 Thread James Morse
Hi Marc, On 22/04/2020 13:00, Marc Zyngier wrote: > As ELR-EL1 is a VNCR-capable register with ARMv8.4-NV, let's move it to > the sys_regs array and repaint the accessors. While we're at it, let's > kill the now useless accessors used only on the fault injection path. Reviewed-by: James Morse

Re: [PATCH 19/26] KVM: arm64: Make struct kvm_regs userspace-only

2020-05-26 Thread James Morse
Hi Marc, On 22/04/2020 13:00, Marc Zyngier wrote: > struct kvm_regs is used by userspace to indicate which register gets > accessed by the {GET,SET}_ONE_REG API. But as we're about to refactor > the layout of the in-kernel register structures, we need the kernel to > move away from it. > > Let's

Re: [PATCH 11/26] KVM: arm64: Add missing reset handlers for PMU emulation

2020-05-26 Thread James Morse
Hi Marc, On 22/04/2020 13:00, Marc Zyngier wrote: > As we're about to become a bit more harsh when it comes to the lack of > reset callbacks, let's add the missing PMU reset handlers. Note that > these only cover *CLR registers that were always covered by their *SET > counterpart, so there is no

Re: [PATCH 10/26] KVM: arm64: Refactor vcpu_{read,write}_sys_reg

2020-05-26 Thread James Morse
Hi Marc, On 22/04/2020 13:00, Marc Zyngier wrote: > Extract the direct HW accessors for later reuse. > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > index 51db934702b64..46f218982df8c 100644 > --- a/arch/arm64/kvm/sys_regs.c > +++ b/arch/arm64/kvm/sys_regs.c > +u64

[PATCH 3/3] KVM: arm64: Add emulation for 32bit guests accessing ACTLR2

2020-05-26 Thread James Morse
ACTLR_EL1 is a 64bit register while the 32bit ACTLR is obviously 32bit. For 32bit software, the extra bits are accessible via ACTLR2... which KVM doesn't emulate. Signed-off-by: James Morse --- I'm not convinced this is endian safe, but it does match what kvm_inject_undef32() do. The

[PATCH 1/3] KVM: arm64: Stop writing aarch32's CSSELR into ACTLR

2020-05-26 Thread James Morse
aarch32 has pairs of registers to access the high and low parts of 64bit registers. KVM has a union of 64bit sys_regs[] and 32bit copro[]. The 32bit accessors read the high or low part of the 64bit sys_reg[] value through the union. Both sys_reg_descs[] and cp15_regs[] list access_csselr() as the

[PATCH 2/3] KVM: arm64: Stop save/restoring ACTLR_EL1

2020-05-26 Thread James Morse
KVM sets HCR_EL2.TACR (which it calls HCR_TAC) via HCR_GUEST_FLAGS. This means ACTLR* accesses from the guest are always trapped, and always return the value in the sys_regs array. The guest can't change the value of these registers, so we are save restoring the reset value, which came from the

[PATCH 0/3] KVM: arm64: aarch32 ACTLR accesses

2020-05-26 Thread James Morse
Hello! Patch 1 fixes an issue where the 32bit and 64bit indexes into copro[] and sys_regs[] are muddled. Patch 3 adds support for aarch32 accessing the top 32bits of ACTLR_EL1 via ACTLR2. Support for this register is advertised in ID_MMFR4.AC2, which doesn't get removed by cpufeature. The

[PATCH] KVM: arm64: Allow in-atomic injection of SPIs

2020-05-26 Thread Marc Zyngier
On a system that uses SPIs to implement MSIs (as it would be the case on a GICv2 system exposing a GICv2m to its guests), we deny the possibility of injecting SPIs on the in-atomic fast-path. This results in a very large amount of context-switches (roughly equivalent to twice the interrupt rate)

Re: [PATCH RFCv2 0/9] kvm/arm64: Support Async Page Fault

2020-05-26 Thread Mark Rutland
Hi Gavin, At a high-level I'm rather fearful of this series. I can see many ways that this can break, and I can also see that even if/when we get things into a working state, constant vigilance will be requried for any changes to the entry code. I'm not keen on injecting non-architectural

Re: [PATCH RFCv2 9/9] arm64: Support async page fault

2020-05-26 Thread Mark Rutland
On Fri, May 08, 2020 at 01:29:19PM +1000, Gavin Shan wrote: > This supports asynchronous page fault for the guest. The design is > similar to what x86 has: on receiving a PAGE_NOT_PRESENT signal from > the host, the current task is either rescheduled or put into power > saving mode. The task will

Re: [PATCH RFCv2 7/9] kvm/arm64: Support async page fault

2020-05-26 Thread Mark Rutland
On Fri, May 08, 2020 at 01:29:17PM +1000, Gavin Shan wrote: > There are two stages of fault pages and the stage one page fault is > handled by guest itself. The guest is trapped to host when the page > fault is caused by stage 2 page table, for example missing. The guest > is suspended until the

Re: [RFC PATCH 2/7] KVM: arm64: Set DBM bit of PTEs if hw DBM enabled

2020-05-26 Thread Catalin Marinas
On Mon, May 25, 2020 at 07:24:01PM +0800, Keqian Zhu wrote: > diff --git a/arch/arm64/include/asm/pgtable-prot.h > b/arch/arm64/include/asm/pgtable-prot.h > index 1305e28225fc..f9910ba2afd8 100644 > --- a/arch/arm64/include/asm/pgtable-prot.h > +++ b/arch/arm64/include/asm/pgtable-prot.h > @@

Re: [RFC PATCH v12 07/11] psci: Add hypercall service for kvm ptp.

2020-05-26 Thread Steven Price
On 25/05/2020 03:11, Jianyong Wu wrote: Hi Steven, Hi Jianyong, [...]>>> diff --git a/virt/kvm/arm/hypercalls.c b/virt/kvm/arm/hypercalls.c index db6dce3d0e23..c964122f8dae 100644 --- a/virt/kvm/arm/hypercalls.c +++ b/virt/kvm/arm/hypercalls.c @@ -3,6 +3,7 @@ #include #include

Re: [PATCH RFCv2 6/9] kvm/arm64: Export kvm_handle_user_mem_abort() with prefault mode

2020-05-26 Thread Mark Rutland
On Fri, May 08, 2020 at 01:29:16PM +1000, Gavin Shan wrote: > This renames user_mem_abort() to kvm_handle_user_mem_abort(), and > then export it. The function will be used in asynchronous page fault > to populate a page table entry once the corresponding page is populated > from the backup device

Re: [PATCH RFCv2 4/9] kvm/arm64: Detach ESR operator from vCPU struct

2020-05-26 Thread Mark Rutland
On Fri, May 08, 2020 at 01:29:14PM +1000, Gavin Shan wrote: > There are a set of inline functions defined in kvm_emulate.h. Those > functions reads ESR from vCPU fault information struct and then operate > on it. So it's tied with vCPU fault information and vCPU struct. It > limits their usage

Re: [PATCH RFCv2 5/9] kvm/arm64: Replace hsr with esr

2020-05-26 Thread Mark Rutland
On Fri, May 08, 2020 at 01:29:15PM +1000, Gavin Shan wrote: > This replace the variable names to make them self-explaining. The > tracepoint isn't changed accordingly because they're part of ABI: > >* @hsr to @esr >* @hsr_ec to @ec >* Use kvm_vcpu_trap_get_class() helper if possible >

Re: [PATCH RFCv2 3/9] kvm/arm64: Rename kvm_vcpu_get_hsr() to kvm_vcpu_get_esr()

2020-05-26 Thread Mark Rutland
On Fri, May 08, 2020 at 01:29:13PM +1000, Gavin Shan wrote: > Since kvm/arm32 was removed, this renames kvm_vcpu_get_hsr() to > kvm_vcpu_get_esr() to it a bit more self-explaining because the > functions returns ESR instead of HSR on aarch64. This shouldn't > cause any functional changes. > >

Re: [RFC PATCH v12 03/11] psci: export smccc conduit get helper.

2020-05-26 Thread Sudeep Holla
On Mon, May 25, 2020 at 01:37:56AM +, Jianyong Wu wrote: > Hi Sudeep, > > > -Original Message- > > From: Sudeep Holla > > Sent: Friday, May 22, 2020 9:12 PM > > To: Jianyong Wu > > Cc: net...@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > > t...@linutronix.de;

Re: [PATCH RFCv2 0/9] kvm/arm64: Support Async Page Fault

2020-05-26 Thread Gavin Shan
On 5/8/20 1:29 PM, Gavin Shan wrote: There are two stages of page faults and the stage one page fault is handled by guest itself. The guest is trapped to host when the page fault is caused by stage 2 page table, for example missing. The guest is suspended until the requested page is populated.

Re: [PATCH v4 4/7] KVM: PPC: clean up redundant 'kvm_run' parameters

2020-05-26 Thread Paul Mackerras
On Mon, Apr 27, 2020 at 12:35:11PM +0800, Tianjia Zhang wrote: > In the current kvm version, 'kvm_run' has been included in the 'kvm_vcpu' > structure. For historical reasons, many kvm-related function parameters > retain the 'kvm_run' and 'kvm_vcpu' parameters at the same time. This > patch does