[PATCH 3/4] powerpc/powernv: Detect the secure boot mode of the system

2019-04-02 Thread Claudio Carvalho
From: Nayna Jain PowerNV secure boot defines different IMA policies based on the secure boot state of the system. This patch defines a function to detect the secure boot state of the system. Signed-off-by: Nayna Jain --- arch/powerpc/include/asm/secboot.h | 21 +

[PATCH 1/4] powerpc/include: Override unneeded early ioremap functions

2019-04-02 Thread Claudio Carvalho
. Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/early_ioremap.h | 41 1 file changed, 41 insertions(+) create mode 100644 arch/powerpc/include/asm/early_ioremap.h diff --git a/arch/powerpc/include/asm/early_ioremap.h b/arch/powerpc/include/asm/early_ioremap.h

[PATCH 4/4] powerpc: Add support to initialize ima policy rules

2019-04-02 Thread Claudio Carvalho
From: Nayna Jain PowerNV secure boot relies on the kernel IMA security subsystem to perform the OS kernel image signature verification. Since each secure boot mode has different IMA policy requirements, dynamic definition of the policy rules based on the runtime secure boot mode of the system is

[PATCH 2/4] powerpc/powernv: Add support for OPAL secure variables

2019-04-02 Thread Claudio Carvalho
CONFIG_OPAL_SECVAR for enabling the OPAL secure variables support in the kernel. Since CONFIG_OPAL_SECVAR selects CONFIG_EFI, it also allow us to manage the OPAL secure variables from userspace via efivarfs. Signed-off-by: Claudio Carvalho --- This patch depends on new OPAL calls that are being added

[PATCH 0/4] Enabling secure boot on PowerNV systems

2019-04-02 Thread Claudio Carvalho
appreciated. 3. Define IMA arch-specific policies based on the secure boot state and mode of the system. On secure boot enabled powernv systems, the host OS kernel signature will be verified by IMA appraisal. Claudio Carvalho (2): powerpc/include: Override unneeded early ioremap functions

Re: [PATCH 0/4] Enabling secure boot on PowerNV systems

2019-04-02 Thread Claudio Carvalho
On 4/2/19 4:36 PM, Matthew Garrett wrote: > On Tue, Apr 2, 2019 at 11:15 AM Claudio Carvalho > wrote: >> 1. Enable efivarfs by selecting CONFIG_EFI in the CONFIG_OPAL_SECVAR >>introduced in this patch set. With CONFIG_EFIVAR_FS, userspace tools can >>be u

Re: [PATCH 0/4] Enabling secure boot on PowerNV systems

2019-04-02 Thread Claudio Carvalho
On 4/2/19 6:51 PM, Matthew Garrett wrote: > On Tue, Apr 2, 2019 at 2:11 PM Claudio Carvalho > wrote: >> We want to use the efivarfs for compatibility with existing userspace >> tools. We will track and match any EFI changes that affect us. > So you implement the f

Re: [PATCH 0/4] Enabling secure boot on PowerNV systems

2019-04-03 Thread Claudio Carvalho
On 4/3/19 10:21 AM, Michael Ellerman wrote: > Hi Claudio, > > Thanks for posting this. > > Claudio Carvalho writes: >> This patch set is part of a series that implements secure boot on >> PowerNV systems. >> >> In order to verify the OS kernel

Re: [PATCH 0/4] Enabling secure boot on PowerNV systems

2019-04-05 Thread Claudio Carvalho
On 4/3/19 7:27 PM, Matthew Garrett wrote: > On Tue, Apr 2, 2019 at 4:31 PM Claudio Carvalho > wrote: >> >> On 4/2/19 6:51 PM, Matthew Garrett wrote: >>> So you implement the full PK/KEK/db/dbx/dbt infrastructure, and >>> updates are signed in the sam

[PATCH] powerpc/powernv: Fix no return statement issue in __opal_call_trace()

2019-03-08 Thread Claudio Carvalho
urning non-void [-Werror=return-type] This patch fixes the issue by returning zero as suggested by the author of the commit. Fixes: 75d9fc7fd94e ("powerpc/powernv: move OPAL call wrapper tracing and interrupt handling to C") Signed-off-by: Claudio Carvalho CC: Nicholas Piggin --- ar

Re: [PATCH 0/4] Enabling secure boot on PowerNV systems

2019-04-09 Thread Claudio Carvalho
On 4/5/19 7:19 PM, Matthew Garrett wrote: > On Fri, Apr 5, 2019 at 2:11 PM Claudio Carvalho > wrote: >> >> On 4/3/19 7:27 PM, Matthew Garrett wrote: >>> Not supporting dbx seems like a pretty significant shortcoming. How >>> are signatures meant to be

Re: [RFC PATCH v2 07/10] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-05-30 Thread Claudio Carvalho
On 5/21/19 2:24 AM, Madhavan Srinivasan wrote: > > On 18/05/19 7:55 PM, Claudio Carvalho wrote: >> From: Ram Pai When the ultravisor firmware is >> available, it takes control over the LDBAR register. In this case, >> thread-imc updates and save/restore operatio

Re: [PATCH v3 7/9] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-06-07 Thread Claudio Carvalho
On 6/7/19 1:48 AM, Madhavan Srinivasan wrote: > > On 06/06/19 11:06 PM, Claudio Carvalho wrote: >> When the ultravisor firmware is available, it takes control over the >> LDBAR register. In this case, thread-imc updates and save/restore >> operations on the LD

[PATCH v3 1/9] KVM: PPC: Ultravisor: Add PPC_UV config option

2019-06-06 Thread Claudio Carvalho
From: Anshuman Khandual CONFIG_PPC_UV adds support for ultravisor. Signed-off-by: Anshuman Khandual Signed-off-by: Bharata B Rao Signed-off-by: Ram Pai [Update config help and commit message] Signed-off-by: Claudio Carvalho --- arch/powerpc/Kconfig | 20 1 file changed

[PATCH v3 4/9] KVM: PPC: Ultravisor: Add generic ultravisor call handler

2019-06-06 Thread Claudio Carvalho
and move the headers, build ucall.S if CONFIG_PPC_UV set, and add some comments in the code] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/ultravisor-api.h | 20 +++ arch/powerpc/include/asm/ultravisor.h | 20 +++ arch/powerpc/kernel/Makefile

[PATCH v3 7/9] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-06-06 Thread Claudio Carvalho
When the ultravisor firmware is available, it takes control over the LDBAR register. In this case, thread-imc updates and save/restore operations on the LDBAR register are handled by ultravisor. Signed-off-by: Claudio Carvalho Signed-off-by: Ram Pai --- arch/powerpc/kvm/book3s_hv_rmhandlers.S

[PATCH v3 3/9] powerpc: Introduce FW_FEATURE_ULTRAVISOR

2019-06-06 Thread Claudio Carvalho
This feature tells if the ultravisor firmware is available to handle ucalls. Signed-off-by: Claudio Carvalho [Device node name to "ibm,ultravisor"] Signed-off-by: Michael Anderson --- arch/powerpc/include/asm/firmware.h | 5 +++-- arch/powerpc/include/asm/ultravi

[PATCH v3 6/9] KVM: PPC: Ultravisor: Restrict flush of the partition tlb cache

2019-06-06 Thread Claudio Carvalho
From: Ram Pai Ultravisor is responsible for flushing the tlb cache, since it manages the PATE entries. Hence skip tlb flush, if the ultravisor firmware is available. Signed-off-by: Ram Pai Signed-off-by: Claudio Carvalho --- arch/powerpc/mm/book3s64/pgtable.c | 33

[PATCH v3 5/9] KVM: PPC: Ultravisor: Use UV_WRITE_PATE ucall to register a PATE

2019-06-06 Thread Claudio Carvalho
table before doing that in UV's] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/ultravisor-api.h | 5 +++- arch/powerpc/include/asm/ultravisor.h | 14 ++ arch/powerpc/mm/book3s64/hash_utils.c | 3 +- arch/powerpc/mm/book3s64/pgtable.c| 34

[PATCH v3 9/9] KVM: PPC: Ultravisor: Check for MSR_S during hv_reset_msr

2019-06-06 Thread Claudio Carvalho
From: Michael Anderson - Check for MSR_S so that kvmppc_set_msr will include. Prior to this change return to guest would not have the S bit set. - Patch based on comment from Paul Mackerras Signed-off-by: Michael Anderson Signed-off-by: Claudio Carvalho --- arch/powerpc/kvm

[PATCH v3 2/9] KVM: PPC: Ultravisor: Introduce the MSR_S bit

2019-06-06 Thread Claudio Carvalho
(and can't) run with the MSR_S bit set, but a secure guest and the ultravisor firmware do. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Ram Pai [Update the commit message] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/reg.h | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH v3 8/9] KVM: PPC: Ultravisor: Enter a secure guest

2019-06-06 Thread Claudio Carvalho
Mackerras [Fix UV_RETURN token number and arch.secure_guest check] Signed-off-by: Ram Pai [Update commit message and ret_to_ultra comment] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/include/asm/ultravisor-api.h | 1 + arch/powerpc/kernel/asm

[PATCH v3 0/9] kvmppc: Paravirtualize KVM to support ultravisor

2019-06-06 Thread Claudio Carvalho
for hcalls from SVM" "[PATCH 13/13] KVM: PPC: UV: Have fast_guest_return check secure_guest" Anshuman Khandual (1): KVM: PPC: Ultravisor: Add PPC_UV config option Claudio Carvalho (2): powerpc: Introduce FW_FEATURE_ULTRAVISOR KVM: PPC: Ultravisor: Restrict LDBAR access Michael

Re: [PATCH v3 1/9] KVM: PPC: Ultravisor: Add PPC_UV config option

2019-06-10 Thread Claudio Carvalho
On 6/7/19 5:11 PM, Leonardo Bras wrote: > > On Thu, 2019-06-06 at 14:36 -0300, Claudio Carvalho wrote: >> From: Anshuman Khandual >> >> CONFIG_PPC_UV adds support for ultravisor. >> >> Signed-off-by: Anshuman Khandual >> Signed-off-by: Bharata B

Re: [PATCH 0/4] Enabling secure boot on PowerNV systems

2019-05-10 Thread Claudio Carvalho
Hi Matthew, Thanks for the feedback and sorry for the delay in responding. On 4/10/19 2:36 PM, Matthew Garrett wrote: > (Cc:ing Peter Jones) > > On Tue, Apr 9, 2019 at 3:55 PM Claudio Carvalho > wrote: >> >> On 4/5/19 7:19 PM, Matthew Garrett wrote: >>&

[RFC PATCH v2 07/10] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-05-18 Thread Claudio Carvalho
the commit message] Signed-off-by: Claudio Carvalho --- arch/powerpc/kvm/book3s_hv.c | 4 +- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 + arch/powerpc/perf/imc-pmu.c | 64 arch/powerpc/platforms/powernv/idle.c| 6 +- arch

[RFC PATCH v2 06/10] KVM: PPC: Ultravisor: Restrict flush of the partition tlb cache

2019-05-18 Thread Claudio Carvalho
From: Ram Pai Ultravisor is responsible for flushing the tlb cache, since it manages the PATE entries. Hence skip tlb flush, if the ultravisor firmware is available. Signed-off-by: Ram Pai Signed-off-by: Claudio Carvalho --- arch/powerpc/mm/book3s64/pgtable.c | 33

[RFC PATCH v2 10/10] KVM: PPC: Ultravisor: Check for MSR_S during hv_reset_msr

2019-05-18 Thread Claudio Carvalho
From: Michael Anderson - Check for MSR_S so that kvmppc_set_msr will include. Prior to this change return to guest would not have the S bit set. - Patch based on comment from Paul Mackerras Signed-off-by: Michael Anderson Signed-off-by: Claudio Carvalho --- arch/powerpc/kvm

[RFC PATCH v2 08/10] KVM: PPC: Ultravisor: Return to UV for hcalls from SVM

2019-05-18 Thread Claudio Carvalho
that even a new CPU will enter UV when started (in response to a RTAS start-cpu call). Thanks to input from Paul Mackerras, Ram Pai and Mike Anderson. Signed-off-by: Sukadev Bhattiprolu [Fix UV_RETURN token number and arch.secure_guest check] Signed-off-by: Ram Pai Signed-off-by: Claudio Carvalho

[RFC PATCH v2 09/10] KVM: PPC: Book3S HV: Fixed for running secure guests

2019-05-18 Thread Claudio Carvalho
From: Paul Mackerras - Pass SRR1 in r11 for UV_RETURN because SRR0 and SRR1 get set by the sc 2 instruction. (Note r3 - r10 potentially have hcall return values in them.) - Fix kvmppc_msr_interrupt to preserve the MSR_S bit. Signed-off-by: Paul Mackerras Signed-off-by: Claudio Carvalho

[RFC PATCH v2 03/10] powerpc: Introduce FW_FEATURE_ULTRAVISOR

2019-05-18 Thread Claudio Carvalho
This feature tells if the ultravisor firmware is available to handle ucalls. Signed-off-by: Claudio Carvalho [Device node name to "ibm,ultravisor"] Signed-off-by: Michael Anderson --- arch/powerpc/include/asm/firmware.h | 5 +++-- arch/powerpc/include/asm/ultravi

[RFC PATCH v2 04/10] KVM: PPC: Ultravisor: Add generic ultravisor call handler

2019-05-18 Thread Claudio Carvalho
and move the headers, build ucall.S if CONFIG_PPC_UV set, and add some comments in the code] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/ultravisor-api.h | 20 +++ arch/powerpc/include/asm/ultravisor.h | 25 ++ arch/powerpc/kernel/Makefile

[RFC PATCH v2 05/10] KVM: PPC: Ultravisor: Use UV_WRITE_PATE ucall to register a PATE

2019-05-18 Thread Claudio Carvalho
table before doing that in UV's] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/ultravisor-api.h | 5 +++- arch/powerpc/include/asm/ultravisor.h | 9 ++ arch/powerpc/mm/book3s64/hash_utils.c | 3 +- arch/powerpc/mm/book3s64/pgtable.c| 34

[RFC PATCH v2 02/10] KVM: PPC: Ultravisor: Introduce the MSR_S bit

2019-05-18 Thread Claudio Carvalho
(and can't) run with the MSR_S bit set, but a secure guest and the ultravisor firmware do. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Ram Pai [Update the commit message] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/reg.h | 3 +++ 1 file changed, 3 insertions(+) diff --git

[RFC PATCH v2 00/10] kvmppc: Paravirtualize KVM to support ultravisor

2019-05-18 Thread Claudio Carvalho
uot;[PATCH 09/13] KVM: PPC: Ultravisor: Return to UV for hcalls from SVM" "[PATCH 13/13] KVM: PPC: UV: Have fast_guest_return check secure_guest" Anshuman Khandual (1): KVM: PPC: Ultravisor: Add PPC_UV config option Claudio Carvalho (1): powerpc: Introduce FW_FEATURE_ULTRAVIS

[RFC PATCH v2 01/10] KVM: PPC: Ultravisor: Add PPC_UV config option

2019-05-18 Thread Claudio Carvalho
From: Anshuman Khandual CONFIG_PPC_UV adds support for ultravisor. Signed-off-by: Anshuman Khandual Signed-off-by: Bharata B Rao Signed-off-by: Ram Pai [Update config help and commit message] Signed-off-by: Claudio Carvalho --- arch/powerpc/Kconfig | 20 1 file changed

Re: [PATCH v4 1/8] KVM: PPC: Ultravisor: Introduce the MSR_S bit

2019-07-12 Thread Claudio Carvalho
, but a >> secure guest and the ultravisor firmware do. >> >> Signed-off-by: Sukadev Bhattiprolu >> Signed-off-by: Ram Pai >> [ Update the commit message ] >> Signed-off-by: Claudio Carvalho >> --- >> arch/powerpc/include/asm/reg.h | 3 +++ >> 1 file

Re: [PATCH v4 2/8] powerpc: Introduce FW_FEATURE_ULTRAVISOR

2019-07-13 Thread Claudio Carvalho
On 7/11/19 9:57 AM, Michael Ellerman wrote: > Claudio Carvalho writes: >> diff --git a/arch/powerpc/include/asm/ultravisor.h >> b/arch/powerpc/include/asm/ultravisor.h >> new file mode 100644 >> index ..e5009b0d84ea >> --- /dev/null >> +++

Re: [PATCH v4 6/8] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-07-13 Thread Claudio Carvalho
On 7/1/19 3:46 AM, Ram Pai wrote: > On Mon, Jul 01, 2019 at 04:30:55PM +1000, Alexey Kardashevskiy wrote: >> >> On 01/07/2019 16:17, maddy wrote: >>> On 01/07/19 11:24 AM, Alexey Kardashevskiy wrote: >>>> On 29/06/2019 06:08, Claudio Carvalho wrote

Re: [PATCH v4 3/8] KVM: PPC: Ultravisor: Add generic ultravisor call handler

2019-07-13 Thread Claudio Carvalho
On 7/11/19 9:57 AM, Michael Ellerman wrote: > Claudio Carvalho writes: >> From: Ram Pai >> >> Add the ucall() function, which can be used to make ultravisor calls >> with varied number of in and out arguments. Ultravisor calls can be made >> from the

[PATCH v4 3/8] KVM: PPC: Ultravisor: Add generic ultravisor call handler

2019-06-28 Thread Claudio Carvalho
and move headers, build ucall.S if CONFIG_PPC_POWERNV set, use R3 for the ucall number and add some comments in the code ] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/ultravisor-api.h | 20 +++ arch/powerpc/include/asm/ultravisor.h | 20 +++ arch

[PATCH v4 1/8] KVM: PPC: Ultravisor: Introduce the MSR_S bit

2019-06-28 Thread Claudio Carvalho
(and can't) run with the MSR_S bit set, but a secure guest and the ultravisor firmware do. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Ram Pai [ Update the commit message ] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/reg.h | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH v4 5/8] KVM: PPC: Ultravisor: Restrict flush of the partition tlb cache

2019-06-28 Thread Claudio Carvalho
From: Ram Pai Ultravisor is responsible for flushing the tlb cache, since it manages the PATE entries. Hence skip tlb flush, if the ultravisor firmware is available. Signed-off-by: Ram Pai Signed-off-by: Claudio Carvalho --- arch/powerpc/mm/book3s64/pgtable.c | 33

[RFC PATCH] powerpc: Add the ppc_capabilities ELF note

2019-07-01 Thread Claudio Carvalho
Add the ppc_capabilities ELF note to the powerpc kernel binary. It is a bitmap that can be used to advertise kernel capabilities to userland. This patch also defines PPCCAP_ULTRAVISOR_BIT as being the bit zero. Suggested-by: Paul Mackerras Signed-off-by: Claudio Carvalho --- arch/powerpc

Re: [PATCH v3 3/9] powerpc: Introduce FW_FEATURE_ULTRAVISOR

2019-07-01 Thread Claudio Carvalho
On 6/15/19 4:36 AM, Paul Mackerras wrote: > On Thu, Jun 06, 2019 at 02:36:08PM -0300, Claudio Carvalho wrote: >> This feature tells if the ultravisor firmware is available to handle >> ucalls. > Everything in this patch that depends on CONFIG_PPC_UV should just > depend

Re: [PATCH v4 5/8] KVM: PPC: Ultravisor: Restrict flush of the partition tlb cache

2019-07-08 Thread Claudio Carvalho
On 7/1/19 2:54 AM, Alexey Kardashevskiy wrote: > > On 29/06/2019 06:08, Claudio Carvalho wrote: >> From: Ram Pai >> >> Ultravisor is responsible for flushing the tlb cache, since it manages >> the PATE entries. Hence skip tlb flush, if the ultravisor firmware is

[RFC PATCH] powerpc/powernv: Add ultravisor message log interface

2019-07-08 Thread Claudio Carvalho
ce to view the messages. CC: Joel Stanley CC: Oliver O'Halloran Signed-off-by: Madhavan Srinivasan [ Read ibm,opal-uv-memcons instead of OPAL's ] Signed-off-by: Ryan Grimm [ Fix license, update the commit message ] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/opal.h |

Re: [PATCH v4 7/8] KVM: PPC: Ultravisor: Enter a secure guest

2019-07-08 Thread Claudio Carvalho
On 7/8/19 5:53 PM, janani wrote: > On 2019-06-28 15:08, Claudio Carvalho wrote: >> From: Sukadev Bhattiprolu >> >> To enter a secure guest, we have to go through the ultravisor, therefore >> we do a ucall when we are entering a secure guest. >> >> This

Re: [PATCH v4 6/8] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-07-14 Thread Claudio Carvalho
On 7/11/19 9:57 AM, Michael Ellerman wrote: > Claudio Carvalho writes: >> When the ultravisor firmware is available, it takes control over the >> LDBAR register. In this case, thread-imc updates and save/restore >> operations on the LDBAR register are handled by ultravi

[PATCH v4 0/8] kvmppc: Paravirtualize KVM to support ultravisor

2019-06-28 Thread Claudio Carvalho
UV_RESTRICTED_SPR_READ ucall" - "[PATCH 08/13] KVM: PPC: Ultravisor: fix mtspr and mfspr" - Squashed patches: - "[PATCH 09/13] KVM: PPC: Ultravisor: Return to UV for hcalls from SVM" - "[PATCH 13/13] KVM: PPC: UV: Have fast_guest_return check secure_guest"

[PATCH v4 4/8] KVM: PPC: Ultravisor: Use UV_WRITE_PATE ucall to register a PATE

2019-06-28 Thread Claudio Carvalho
table before doing that in UV's ] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/ultravisor-api.h | 5 +++- arch/powerpc/include/asm/ultravisor.h | 14 ++ arch/powerpc/mm/book3s64/hash_utils.c | 3 +- arch/powerpc/mm/book3s64/pgtable.c| 34

[PATCH v4 6/8] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-06-28 Thread Claudio Carvalho
When the ultravisor firmware is available, it takes control over the LDBAR register. In this case, thread-imc updates and save/restore operations on the LDBAR register are handled by ultravisor. Signed-off-by: Claudio Carvalho Reviewed-by: Ram Pai Reviewed-by: Ryan Grimm Acked-by: Madhavan

[PATCH v4 8/8] KVM: PPC: Ultravisor: Check for MSR_S during hv_reset_msr

2019-06-28 Thread Claudio Carvalho
From: Michael Anderson - Check for MSR_S so that kvmppc_set_msr will include it. Prior to this change return to guest would not have the S bit set. - Patch based on comment from Paul Mackerras Signed-off-by: Michael Anderson Signed-off-by: Claudio Carvalho Acked-by: Paul Mackerras

[PATCH v4 2/8] powerpc: Introduce FW_FEATURE_ULTRAVISOR

2019-06-28 Thread Claudio Carvalho
This feature tells if the ultravisor firmware is available to handle ucalls. Signed-off-by: Claudio Carvalho [ Device node name to "ibm,ultravisor" ] Signed-off-by: Michael Anderson --- arch/powerpc/include/asm/firmware.h | 5 +++-- arch/powerpc/include/asm/ultravi

[PATCH v4 7/8] KVM: PPC: Ultravisor: Enter a secure guest

2019-06-28 Thread Claudio Carvalho
for the UV_RETURN ucall number. Update commit message and ret_to_ultra comment ] Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/include/asm/ultravisor-api.h | 1 + arch/powerpc/kernel/asm-offsets.c | 1 + arch/powerpc/kvm/book3s_hv_rmhandlers.S

Re: [PATCH v5 1/7] Documentation/powerpc: Ultravisor API

2019-08-21 Thread Claudio Carvalho
On 8/9/19 9:45 AM, Michael Ellerman wrote: > Claudio Carvalho writes: >> From: Sukadev Bhattiprolu >> >> POWER9 processor includes support for Protected Execution Facility (PEF). >> Which POWER9? Please be more precise. >> >> It's public knowledge that

Re: [PATCH v5 1/7] Documentation/powerpc: Ultravisor API

2019-08-21 Thread Claudio Carvalho
On 8/12/19 12:58 PM, Fabiano Rosas wrote: > Claudio Carvalho writes: > > Some small suggestions below: > >> + >> +* The privilege of a process is now determined by three MSR bits, >> + MSR(S, HV, PR). In each of the tables below the modes are listed

Re: [PATCH v5 4/7] powerpc/mm: Use UV_WRITE_PATE ucall to register a PATE

2019-08-21 Thread Claudio Carvalho
On 8/14/19 8:33 AM, Michael Ellerman wrote: > Hi Claudio, > > Claudio Carvalho writes: >> From: Michael Anderson >> >> In ultravisor enabled systems, the ultravisor creates and maintains the >> partition table in secure memory w

Re: [PATCH v5 2/7] powerpc/kernel: Add ucall_norets() ultravisor call handler

2019-08-21 Thread Claudio Carvalho
On 8/14/19 3:34 PM, Segher Boessenkool wrote: > On Wed, Aug 14, 2019 at 08:46:15PM +1000, Michael Ellerman wrote: >> Claudio Carvalho writes: >>> +_GLOBAL(ucall_norets) >>> +EXPORT_SYMBOL_GPL(ucall_norets) >>> + mfcrr0 >>>

Re: [PATCH v5 2/7] powerpc/kernel: Add ucall_norets() ultravisor call handler

2019-08-21 Thread Claudio Carvalho
On 8/14/19 7:46 AM, Michael Ellerman wrote: > Claudio Carvalho writes: >> diff --git a/arch/powerpc/kernel/ucall.S b/arch/powerpc/kernel/ucall.S >> new file mode 100644 >> index ..de9133e45d21 >> --- /dev/null >> +++ b/arch/powerpc/kernel/ucall.

[PATCH v6 7/7] powerpc/kvm: Use UV_RETURN ucall to return to ultravisor

2019-08-21 Thread Claudio Carvalho
the ultracall number, i.e UV_RETURN. * If returning with a synthesized interrupt, R2 contains the synthesized interrupt number. Thanks to input from Paul Mackerras, Ram Pai and Mike Anderson. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm

[PATCH v6 6/7] powerpc/powernv: Access LDBAR only if ultravisor disabled

2019-08-21 Thread Claudio Carvalho
. Signed-off-by: Claudio Carvalho Reviewed-by: Ram Pai Reviewed-by: Ryan Grimm --- arch/powerpc/platforms/powernv/idle.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c index 09f49eed7fb8

[PATCH v6 0/7] kvmppc: Paravirtualize KVM to support ultravisor

2019-08-21 Thread Claudio Carvalho
Disable IMC devices, when Ultravisor is enabled. - Fixed signed-off-by. - Patch "KVM: PPC: Ultravisor: Enter a secure guest": - Changed the UV_RETURN assembly call to save the actual R3 in R0 for the ultravisor and pass the UV_RETURN call number in R3. - Patch "KVM: PPC:

[PATCH v6 1/7] Documentation/powerpc: Ultravisor API

2019-08-21 Thread Claudio Carvalho
as in the KVM Hypervisor. Based on input from Mike Anderson, Thiago Bauermann, Claudio Carvalho, Ben Herrenschmidt, Guerney Hunt, Paul Mackerras. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Ram Pai Signed-off-by: Guerney Hunt Reviewed-by: Claudio Carvalho Reviewed-by: Michael Anderson Reviewed

[PATCH v6 2/7] powerpc/kernel: Add ucall_norets() ultravisor call handler

2019-08-21 Thread Claudio Carvalho
will be redirected to the hypervisor which must handle/fail the call. Thanks to inputs from Ram Pai and Michael Anderson. Signed-off-by: Claudio Carvalho --- Ultravisor call support for secure guests is being proposed as part of the patchset "Secure Virtual Machine Enablement" posted

[PATCH v6 5/7] powerpc/mm: Write to PTCR only if ultravisor disabled

2019-08-21 Thread Claudio Carvalho
-by: Claudio Carvalho --- arch/powerpc/include/asm/ultravisor.h| 12 arch/powerpc/mm/book3s64/hash_utils.c| 5 +++-- arch/powerpc/mm/book3s64/pgtable.c | 2 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 8 +--- 4 files changed, 21 insertions(+), 6 deletions(-) diff

[PATCH v6 3/7] powerpc/powernv: Introduce FW_FEATURE_ULTRAVISOR

2019-08-21 Thread Claudio Carvalho
accessing resources (e.g. PTCR and LDBAR) in case PEF is enabled. Signed-off-by: Claudio Carvalho [ andmike: Device node name to "ibm,ultravisor" ] Signed-off-by: Michael Anderson --- arch/powerpc/include/asm/firmware.h | 5 +++-- arch/powerpc/include/asm/ultravisor.h

[PATCH v6 4/7] powerpc/mm: Use UV_WRITE_PATE ucall to register a PATE

2019-08-21 Thread Claudio Carvalho
) when Ultravisor is enabled. Signed-off-by: Michael Anderson Signed-off-by: Madhavan Srinivasan Signed-off-by: Ram Pai [ cclaudio: Write the PATE in HV's table before doing that in UV's ] Signed-off-by: Claudio Carvalho Reviewed-by: Ryan Grimm --- arch/powerpc/include/asm/ultravisor-api.h | 5

Re: [PATCH v2] powerpc/powernv: Add ultravisor message log interface

2019-08-24 Thread Claudio Carvalho
On 8/23/19 9:48 AM, Michael Ellerman wrote: > Hi Claudio, Hi Michael, > > Claudio Carvalho writes: >> Ultravisor (UV) provides an in-memory console which follows the OPAL >> in-memory console structure. >> >> This patch extends the OPAL msglog code to also in

[PATCH v3 2/2] powerpc/powernv: Add ultravisor message log interface

2019-08-27 Thread Claudio Carvalho
Signed-off-by: Claudio Carvalho --- This patch applies on top of the "kvmppc: Paravirtualize KVM to support ultravisor" patch series submitted by Claudio Carvalho. --- arch/powerpc/include/asm/ultravisor.h| 8 arch/powerpc/platforms/powernv/opal-msglog.c | 36

[PATCH v3 1/2] powerpc/powernv/opal-msglog: Refactor memcons code

2019-08-27 Thread Claudio Carvalho
This patch refactors the code in opal-msglog that operates on the OPAL memory console in order to make it cleaner and also allow the reuse of the new memcons_* functions. Signed-off-by: Claudio Carvalho --- arch/powerpc/platforms/powernv/opal-msglog.c | 61 ++-- 1 file changed

Re: [PATCH v4 2/2] powerpc/powernv: Add ultravisor message log interface

2019-08-28 Thread Claudio Carvalho
On 8/28/19 10:05 AM, Michael Ellerman wrote: > From: Claudio Carvalho > > The ultravisor (UV) provides an in-memory console which follows the > OPAL in-memory console structure. > > This patch extends the OPAL msglog code to initialize the UV memory > console and provi

Re: [PATCH v4 1/2] powerpc/powernv/opal-msglog: Refactor memcons code

2019-08-28 Thread Claudio Carvalho
On 8/28/19 10:05 AM, Michael Ellerman wrote: > From: Claudio Carvalho > > This patch refactors the code in opal-msglog that operates on the OPAL > memory console in order to make it cleaner and also allow the reuse of > the new memcons_* functions. Tested-by: Claudio Carvalho

[PATCH v2] powerpc/powernv: Add ultravisor message log interface

2019-08-23 Thread Claudio Carvalho
: Oliver O'Halloran Signed-off-by: Claudio Carvalho --- This patch depends on the "kvmppc: Paravirtualize KVM to support ultravisor" patchset submitted by Claudio Carvalho. --- arch/powerpc/platforms/powernv/opal-msglog.c | 99 ++-- 1 file changed, 72 insertions(+), 27

[PATCH v5 1/7] Documentation/powerpc: Ultravisor API

2019-08-07 Thread Claudio Carvalho
from Mike Anderson, Thiago Bauermann, Claudio Carvalho, Ben Herrenschmidt, Guerney Hunt, Paul Mackerras. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Ram Pai Signed-off-by: Guerney Hunt Reviewed-by: Claudio Carvalho Reviewed-by: Michael Anderson Reviewed-by: Thiago Bauermann Signed-off

[PATCH v5 4/7] powerpc/mm: Use UV_WRITE_PATE ucall to register a PATE

2019-08-07 Thread Claudio Carvalho
Anderson Signed-off-by: Madhavan Srinivasan Signed-off-by: Ram Pai [ cclaudio: Write the PATE in HV's table before doing that in UV's ] Signed-off-by: Claudio Carvalho Reviewed-by: Ryan Grimm --- arch/powerpc/include/asm/ultravisor-api.h | 5 ++ arch/powerpc/include/asm/ultravisor.h | 8

[PATCH v5 3/7] powerpc/powernv: Introduce FW_FEATURE_ULTRAVISOR

2019-08-07 Thread Claudio Carvalho
accessing resources (e.g. PTCR and LDBAR) in case PEF is enabled. Signed-off-by: Claudio Carvalho [ andmike: Device node name to "ibm,ultravisor" ] Signed-off-by: Michael Anderson --- arch/powerpc/include/asm/firmware.h | 5 +++-- arch/powerpc/include/asm/ultravisor.h

[PATCH v5 0/7] kvmppc: Paravirtualize KVM to support ultravisor

2019-08-07 Thread Claudio Carvalho
or: Return to UV for hcalls from SVM" - "KVM: PPC: Ultravisor: Enter a secure guest - Rebased - Addressed comments from Paul Mackerras - Dropped ultravisor checks made in power8 code - Updated the commit message for: "KVM: PPC: Ultravisor: Enter a secure guest" - Addre

[PATCH v5 2/7] powerpc/kernel: Add ucall_norets() ultravisor call handler

2019-08-07 Thread Claudio Carvalho
file is placed under arch/powerpc/kernel. If ultravisor is not enabled, the ucalls will be redirected to the hypervisor which must handle/fail the call. Thanks to inputs from Ram Pai and Michael Anderson. Signed-off-by: Claudio Carvalho --- Ultravisor call support for secure guests is being

[PATCH v5 5/7] powerpc/mm: Write to PTCR only if ultravisor disabled

2019-08-07 Thread Claudio Carvalho
disabled. Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm/reg.h | 13 + arch/powerpc/mm/book3s64/hash_utils.c| 4 ++-- arch/powerpc/mm/book3s64/pgtable.c | 2 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 6 +++--- 4 files changed, 19 insertions(+), 6

[PATCH v5 6/7] powerpc/powernv: Access LDBAR only if ultravisor disabled

2019-08-07 Thread Claudio Carvalho
. Signed-off-by: Claudio Carvalho Reviewed-by: Ram Pai Reviewed-by: Ryan Grimm --- arch/powerpc/platforms/powernv/idle.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c index 210fb73a5121

[PATCH v5 7/7] powerpc/kvm: Use UV_RETURN ucall to return to ultravisor

2019-08-07 Thread Claudio Carvalho
the ultracall number, i.e UV_RETURN. * If returning with a synthesized interrupt, R2 contains the synthesized interrupt number. Thanks to input from Paul Mackerras, Ram Pai and Mike Anderson. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Claudio Carvalho --- arch/powerpc/include/asm

Re: [PATCH v4 4/8] KVM: PPC: Ultravisor: Use UV_WRITE_PATE ucall to register a PATE

2019-07-18 Thread Claudio Carvalho
On 7/11/19 9:57 AM, Michael Ellerman wrote: > >> >> static pmd_t *get_pmd_from_cache(struct mm_struct *mm) >> diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c >> b/arch/powerpc/mm/book3s64/radix_pgtable.c >> index 8904aa1243d8..da6a6b76a040 100644 >> ---