[Xen-devel] [RFC] WIP: optee: add OP-TEE mediator

2017-11-27 Thread Volodymyr Babchuk
all corner cases, so, please don't use it in production. It was tested on RCAR Salvator-M3 board. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/tee/Kconfig | 4 + xen/arch/arm/tee/Makefile| 1 + xen/arch/arm/tee/optee.c | 765 +++

Re: [Xen-devel] [RFC] WIP: optee: add OP-TEE mediator

2017-12-04 Thread Volodymyr Babchuk
Hi Stefano, On Fri, Dec 01, 2017 at 02:58:57PM -0800, Stefano Stabellini wrote: > On Mon, 27 Nov 2017, Volodymyr Babchuk wrote: > > This is follow-up to our conversation during community call. > > You asked me to send OP-TEE mediator as a patch, so we can > > discuss it in

Re: [Xen-devel] [RFC] WIP: optee: add OP-TEE mediator

2017-12-04 Thread Volodymyr Babchuk
Hi Julien, On Mon, Dec 04, 2017 at 02:30:32PM +, Julien Grall wrote: > Hi, > > I am going to answer both e-mails (Stefano and Volodymyr) at once. > > On 01/12/17 22:58, Stefano Stabellini wrote: > >On Mon, 27 Nov 2017, Volodymyr Babchuk wrote: > >>This is

Re: [Xen-devel] [RFC] WIP: optee: add OP-TEE mediator

2017-12-04 Thread Volodymyr Babchuk
ssed to OP-TEE need to be pinned (otherwise Xen doesn't > >>guarantee they'll be available). I think the right function to call for > >>that is get_page_from_gfn or get_page. > >Yes, I need to pin pages. I have this in

Re: [Xen-devel] [RFC] WIP: optee: add OP-TEE mediator

2017-12-05 Thread Volodymyr Babchuk
Hi Stefano, On 05.12.17 00:06, Stefano Stabellini wrote: On Mon, 4 Dec 2017, Volodymyr Babchuk wrote: = Xen command forwarding = In the code below, it looks like Xen is forwarding everything to OP-TEE. Are there some commands Xen should avoid forwarding? Should we have a whitelist or a

Re: [Xen-devel] [RFC PATCH 16/31] arm: add SMC wrapper that is compatible with SMCCC

2017-12-05 Thread Volodymyr Babchuk
Hi Stefano, On Mon, Dec 04, 2017 at 06:30:13PM -0800, Stefano Stabellini wrote: > On Thu, 9 Nov 2017, Oleksandr Tyshchenko wrote: > > From: Volodymyr Babchuk > > > > Existing SMC wrapper call_smc() allows only 4 parameters and > > returns only one value. This is eno

Re: [Xen-devel] [RFC PATCH 16/31] arm: add SMC wrapper that is compatible with SMCCC

2017-12-05 Thread Volodymyr Babchuk
Hi Julien, On 05.12.17 16:58, Julien Grall wrote: Hi Oleksandr, On 09/11/17 17:10, Oleksandr Tyshchenko wrote: From: Volodymyr Babchuk Existing SMC wrapper call_smc() allows only 4 parameters and returns only one value. This is enough for existing use in PSCI code, but TEE mediator will

Re: [Xen-devel] [PATCH] xen/arm: setup: Relocate the Device-Tree later on in the boot

2019-09-11 Thread Volodymyr Babchuk
I system. So > there are no need to relocate it and can just be discarded. > > Signed-off-by: Julien Grall Reviewed-by: Volodymyr Babchuk This certainly is looking better now. > --- > xen/arch/arm/setup.c | 58 > > 1

Re: [Xen-devel] [PATCH] xen/arm: bootfd: Fix indentation in process_multiboot_node()

2019-09-11 Thread Volodymyr Babchuk
Julien Grall writes: > One line in process_multiboot_node() is using hard tab rather than soft > tab. So fix it! > > Signed-off-by: Julien Grall Reviewed-by: Volodymyr Babchuk So, hunting them one-by-one is the preferred way? I'm asking this because there are more of them:

Re: [Xen-devel] [RFC 4/9] arm64: utilize time accounting

2019-09-11 Thread Volodymyr Babchuk
in.c b/xen/arch/arm/domain.c > index a9c4113..53ef630 100644 > --- a/xen/arch/arm/domain.c > +++ b/xen/arch/arm/domain.c > @@ -51,11 +51,13 @@ static void do_idle(void) > process_pending_softirqs(); > > local_irq_disable(); > +tacc_idle(1); 1 and 2 (below) look like some magical values to me. I believe, you need to define some enumeration. > if ( cpu_is_haltable(cpu) ) > { > dsb(sy); > wfi(); > } > +tacc_hyp(2); > local_irq_enable(); > > sched_tick_resume(); -- Volodymyr Babchuk at EPAM ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [RFC 1/9] schedule: Introduce per-pcpu time accounting

2019-09-11 Thread Volodymyr Babchuk
sinfo *pi); > > +enum TACC_STATES { If I remember correct, enum names should in lower case > +TACC_HYP = 0, > + TACC_GUEST = 1, > +TACC_IDLE = 2, > +TACC_IRQ = 3, > +TACC_GSYNC = 4, > +TACC_STATES_MAX > +}; > + > +struct tacc > +{ >

Re: [Xen-devel] [PATCH 4/5] xen/arm: optee: handle share buffer translation error

2019-09-11 Thread Volodymyr Babchuk
Julien Grall writes: > Hi Volodymyr, > > On 8/23/19 7:48 PM, Volodymyr Babchuk wrote: >> There is a case possible, when OP-TEE asks guest to allocate shared >> buffer, but Xen for some reason can't translate buffer's addresses. In >> this situation we should

Re: [Xen-devel] [PATCH 5/5] xen/arm: optee: remove experimental status

2019-09-11 Thread Volodymyr Babchuk
Julien Grall writes: > On 8/23/19 8:20 PM, Volodymyr Babchuk wrote: >> >> Hi Julien, > > Hi, > > Apologies for the delay. It is okay. I myself was busy a bit. > >> >> Julien Grall writes: >> >>> Hi, >>> >>> On 8/23/19

Re: [Xen-devel] [PATCH 1/5] xen/arm: optee: impose limit on shared buffer size

2019-09-11 Thread Volodymyr Babchuk
Julien Grall writes: > Hi Volodymyr, > > On 8/23/19 7:48 PM, Volodymyr Babchuk wrote: >> We want to limit number of calls to lookup_and_pin_guest_ram_addr() >> per one request. There are two ways to do this: either preempt >> translate_noncontig() or to limit siz

Re: [Xen-devel] [PATCH 2/5] xen/arm: optee: check for preemption while freeing shared buffers

2019-09-11 Thread Volodymyr Babchuk
Julien Grall writes: > Hi Volodymyr, > > On 8/23/19 7:48 PM, Volodymyr Babchuk wrote: >> Now we have limit for one shared buffer size, so we can be sure that >> one call to free_optee_shm_buf() will not free all >> MAX_TOTAL_SMH_BUF_PG pages at once.

Re: [Xen-devel] [PATCH 1/5] xen/arm: optee: impose limit on shared buffer size

2019-09-12 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi Volodymyr, > > On 9/11/19 7:48 PM, Volodymyr Babchuk wrote: >> >> Julien Grall writes: >> >>> Hi Volodymyr, >>> >>> On 8/23/19 7:48 PM, Volodymyr Babchuk wrote: >>>> We want to limit numbe

Re: [Xen-devel] [PATCH 2/5] xen/arm: optee: check for preemption while freeing shared buffers

2019-09-12 Thread Volodymyr Babchuk
Julien Grall writes: > Hi Volodymyr, > > On 9/11/19 7:53 PM, Volodymyr Babchuk wrote: >> >> Julien Grall writes: >> >>> Hi Volodymyr, >>> >>> On 8/23/19 7:48 PM, Volodymyr Babchuk wrote: >>>> Now we have limit for one shared buffe

Re: [Xen-devel] [PATCH 1/5] xen/arm: optee: impose limit on shared buffer size

2019-09-16 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi, > > On 9/12/19 8:45 PM, Volodymyr Babchuk wrote: >> >> Hi Julien, >> >> Julien Grall writes: >> >>> Hi Volodymyr, >>> >>> On 9/11/19 7:48 PM, Volodymyr Babchuk wrote: >>>> >

Re: [Xen-devel] [PATCH 1/5] xen/arm: optee: impose limit on shared buffer size

2019-09-17 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi Volodymyr, > > On 9/16/19 4:26 PM, Volodymyr Babchuk wrote: >> >> Hi Julien, >> >> Julien Grall writes: >> >>> Hi, >>> >>> On 9/12/19 8:45 PM, Volodymyr Babchuk wrote: >>&

Re: [Xen-devel] [PATCH for-4.13] xen/arm: livepatch: Prevent CPUs to fetch stale instructions after livepatching

2019-09-18 Thread Volodymyr Babchuk
ent modification and execution of instructions" in > DDI 0487E.a, flushing the instruction cache is not enough to ensure new > instructions are seen. All the PEs should also do an isb() to > synchronize the fetched instruction stream. > > Signed-off-by: Julien Grall Reviewed-by: V

[Xen-devel] [PATCH v2 3/6] xen/arm: optee: limit number of shared buffers

2019-09-18 Thread Volodymyr Babchuk
We want to limit number of shared buffers that guest can register in OP-TEE. Every such buffer consumes XEN resources and we don't want guest to exhaust XEN. So we choose arbitrary limit for shared buffers. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/tee/optee.c

[Xen-devel] [PATCH v2 4/6] xen/arm: optee: handle shared buffer translation error

2019-09-18 Thread Volodymyr Babchuk
pages) shared buffers. Signed-off-by: Volodymyr Babchuk --- Changes from v1: - Renamed OPTEEM_CALL_* to OPTEE_CALL_* - Fixed comments - Added ASSERT() in handle_xen_rpc_return() --- xen/arch/arm/tee/optee.c | 172 --- 1 file changed, 141 insertions(+),

[Xen-devel] [PATCH v2 1/6] xen/arm: optee: impose limit on shared buffer size

2019-09-18 Thread Volodymyr Babchuk
this limitation OP-TEE still passes own "xtest" test suite, so this is okay for now. Signed-off-by: Volodymyr Babchuk --- Changes from v1: - Added comment before BUILD_BUG_ON(PAGE_SIZE != 4096); - Fixed typo in the commit message - Decreased MAX_SHM_BUFFER_PG to 129 --- xen/arch/

[Xen-devel] [PATCH v2 2/6] xen/arm: optee: check for preemption while freeing shared buffers

2019-09-18 Thread Volodymyr Babchuk
We can check for hypercall_preempt_check() in the loop inside optee_relinquish_resources() to increase hypervisor responsiveness in case if preemption is required. Signed-off-by: Volodymyr Babchuk --- Changes from v1: - Removed extra hypercall_preempt_check() - Updated the commit message

[Xen-devel] [PATCH v2 5/6] SUPPORT.md: Describe OP-TEE mediator

2019-09-18 Thread Volodymyr Babchuk
With the latest patches to the mediator, it can be considered as Technological Preview feature. Signed-off-by: Volodymyr Babchuk --- Note for commiter: Obviously this patch should be merged after all other patches in this series. --- SUPPORT.md | 4 1 file changed, 4 insertions(+) diff

[Xen-devel] [PATCH v2 6/6] xen/arm: optee: update description in Kconfig

2019-09-18 Thread Volodymyr Babchuk
OP-TEE mediator now is "Tech Preview" state, and we want to update it's description in Kconfig accordingly. Signed-off-by: Volodymyr Babchuk --- Note to commiter: this patch depends on first 4 patches in the series. --- xen/arch/arm/tee/Kconfig | 12 1 file change

[Xen-devel] [PATCH v2 0/6] arch/arm: optee: fix TODOs and change status to "Tech Preview"

2019-09-18 Thread Volodymyr Babchuk
. [1] https://github.com/lorc/xen/tree/optee3_v1 [2] https://github.com/lorc/xen/tree/optee3_v2 Volodymyr Babchuk (6): xen/arm: optee: impose limit on shared buffer size xen/arm: optee: check for preemption while freeing shared buffers xen/arm: optee: limit number of shared buffers xen/

Re: [Xen-devel] [PATCH v2 4/6] xen/arm: optee: handle shared buffer translation error

2019-09-24 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi, > > On 18/09/2019 19:51, Volodymyr Babchuk wrote: >> +/* Handles return from Xen-issued RPC */ >> +static void handle_xen_rpc_return(struct optee_domain *ctx, >> +

Re: [Xen-devel] [PATCH v2 4/6] xen/arm: optee: handle shared buffer translation error

2019-09-24 Thread Volodymyr Babchuk
Julien Grall writes: > On 24/09/2019 12:37, Volodymyr Babchuk wrote: >> >> Hi Julien, >> >> Julien Grall writes: >> >>> Hi, >>> >>> On 18/09/2019 19:51, Volodymyr Babchuk wrote: >>>> +/* Handles return from Xen-issued

Re: [Xen-devel] [PATCH for-4.13] xen/arm: Implement workaround for Cortex A-57 and Cortex A72 AT speculate

2019-09-24 Thread Volodymyr Babchuk
it > a18be06aca "xen/arm: Implement workaround for Cortex-A76 erratum 1165522", > so it is only necessary to plumb in the cpuerrata framework. > > Signed-off-by: Julien Grall With a few nits: Reviewed-by: Volodymyr Babchuk > --- > docs/misc/arm/silicon-errata.txt | 2

Re: [Xen-devel] [RESEND][PATCH for-4.13] xen/arm: mm: Clear boot pagetables before bringing-up each secondary CPU

2019-09-24 Thread Volodymyr Babchuk
before bringing-up each secondary CPU. > > Signed-off-by: Julien Grall Taking into account fixed remark below: Reviewed-by: Volodymyr Babchuk > --- > xen/arch/arm/mm.c | 27 ++- > 1 file changed, 18 insertions(+), 9 deletions(-) > > diff --git

Re: [Xen-devel] [PATCH for-4.13 v2 2/2] docs: Replace all instance of ARM by Arm

2019-09-24 Thread Volodymyr Babchuk
uot;wait for interrupt". WFE is similar and > -means "wait for event". This option, which is ARM specific, changes the > +WFI is the Arm instruction to "wait for interrupt". WFE is similar and > +means "wait for event". This option, which is Arm specific, changes the > way guest WFI and WFE are implemented in Xen. By default, Xen traps both > instructions. In the case of WFI, Xen blocks the guest vcpu; in the case > of WFE, Xen yield the guest vcpu. When setting vwfi to `native`, Xen > diff --git a/docs/process/xen-release-management.pandoc > b/docs/process/xen-release-management.pandoc > index d6abc90a02..96207c93f0 100644 > --- a/docs/process/xen-release-management.pandoc > +++ b/docs/process/xen-release-management.pandoc > @@ -416,7 +416,7 @@ J: XEN-28 > > === x86 === > > -=== ARM === > +=== Arm === > > == Completed == > > diff --git a/docs/specs/libxc-migration-stream.pandoc > b/docs/specs/libxc-migration-stream.pandoc > index 97dacb6e30..ddd7d1eb2f 100644 > --- a/docs/specs/libxc-migration-stream.pandoc > +++ b/docs/specs/libxc-migration-stream.pandoc > @@ -30,7 +30,7 @@ image used in Xen 4.4 and earlier (the _legacy format_). > > A new format that addresses the above is required. > > -ARM does not yet have have a domain save image format specified and > +Arm does not yet have have a domain save image format specified and > the format described in this specification should be suitable. > > Not Yet Included > @@ -41,7 +41,7 @@ included in a future draft. > > * Page data compression. > > -* ARM > +* Arm > > > Overview > @@ -162,7 +162,7 @@ type0x: Reserved. > > 0x0003: x86 PVH. > > -0x0004: ARM. > +0x0004: Arm. > > 0x0005 - 0x: Reserved. > > diff --git a/docs/specs/libxl-migration-stream.pandoc > b/docs/specs/libxl-migration-stream.pandoc > index 3766f37f4f..d407abd817 100644 > --- a/docs/specs/libxl-migration-stream.pandoc > +++ b/docs/specs/libxl-migration-stream.pandoc > @@ -43,7 +43,7 @@ Not Yet Included > The following features are not yet fully specified and will be > included in a future draft. > > -* ARM > +* Arm > > > Overview -- Volodymyr Babchuk at EPAM ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH for-4.13 v2 2/2] docs: Replace all instance of ARM by Arm

2019-09-24 Thread Volodymyr Babchuk
Julien Grall writes: > Hi, > > On 9/24/19 3:56 PM, Volodymyr Babchuk wrote: >> Julien Grall writes: >> >>> The documentation is using a mix of ARM (old) and Arm (new). To stay >>> consistent, use only the new name. >>> >> Honestly, thi

[Xen-devel] [PATCH v3 0/3] arch/arm: optee: fix TODOs and change status to "Tech Preview"

2019-09-24 Thread Volodymyr Babchuk
/github.com/lorc/xen/tree/optee3_v1 [2] https://github.com/lorc/xen/tree/optee3_v2 [3] https://github.com/lorc/xen/tree/optee3_v3 Volodymyr Babchuk (3): xen/arm: optee: handle shared buffer translation error SUPPORT.md: Describe OP-TEE mediator xen/arm: optee: update descriptio

[Xen-devel] [PATCH v3 1/3] xen/arm: optee: handle shared buffer translation error

2019-09-24 Thread Volodymyr Babchuk
pages) shared buffers. Signed-off-by: Volodymyr Babchuk --- Changes from v1: - Renamed OPTEEM_CALL_* to OPTEE_CALL_* - Fixed comments - Added ASSERT() in handle_xen_rpc_return() Changes from v2: - ASSERT() in handle_xen_rpc_return() is replaced with domain_crash() --- xen/arch/arm/tee/

[Xen-devel] [PATCH v3 2/3] SUPPORT.md: Describe OP-TEE mediator

2019-09-24 Thread Volodymyr Babchuk
With the latest patches to the mediator, it can be considered as Technological Preview feature. Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- Note for commiter: Obviously this patch should be merged after all other patches in this series. Changes from v2: - ARM->Arm - Adde

[Xen-devel] [PATCH v3 3/3] xen/arm: optee: update description in Kconfig

2019-09-24 Thread Volodymyr Babchuk
OP-TEE mediator now is "Tech Preview" state, and we want to update it's description in Kconfig accordingly. Signed-off-by: Volodymyr Babchuk --- Note to commiter: this patch depends on first 4 patches in the series. --- xen/arch/arm/tee/Kconfig | 9 + 1 file change

Re: [Xen-devel] [PATCH RFC for-4.13 01/10] xen/arm64: entry: Introduce a macro to generate guest vector and use it

2019-09-27 Thread Volodymyr Babchuk
n the one that use the open-code version. > > Signed-off-by: Julien Grall Reviewed-by: Volodymyr Babchuk -- Volodymyr Babchuk at EPAM ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH RFC for-4.13 02/10] xen/arm64: head: Check if an SError is pending when receiving a vSError

2019-09-27 Thread Volodymyr Babchuk
> > The recently introduced macro 'guest_vector' could used to generate the > two vectors and therefore take advantage of any change required in the > future. > > Signed-off-by: Julien Grall Reviewed-by: Volodymyr Babchuk -- Volodymyr Babchuk at EPAM

Re: [Xen-devel] [PATCH RFC for-4.13 03/10] xen/arm: traps: Rework entry/exit from the guest path

2019-09-27 Thread Volodymyr Babchuk
; { > -enter_hypervisor_head(regs); > - > __do_trap_serror(regs, true); > } > > void do_trap_irq(struct cpu_user_regs *regs) > { > -enter_hypervisor_head(regs); > gic_interrupt(regs, 0); > } > > vo

Re: [Xen-devel] [PATCH RFC for-4.13 05/10] xen/arm: alternative: Remove unused parameter for alternative_if_not_cap

2019-09-27 Thread Volodymyr Babchuk
Julien Grall writes: > The macro alternative_if_not_cap is taking two parameters. The second > parameter is never used and it is hard to see how this can be used > correctly as it is only protecting the alternative section magic. > > Signed-off-by: Julien Grall Reviewed-by: Vo

Re: [Xen-devel] [PATCH RFC for-4.13 06/10] xen/arm: Move ARCH_PATCH_INSN_SIZE out of the header livepatch.h

2019-09-27 Thread Volodymyr Babchuk
t; > Signed-off-by: Julien Grall Reviewed-by: Volodymyr Babchuk -- Volodymyr Babchuk at EPAM ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH RFC for-4.13 07/10] xen/arm: Allow insn.h to be called from assembly

2019-09-27 Thread Volodymyr Babchuk
Julien Grall writes: > A follow-up patch will require to include insn.h from assembly code. So > wee need to protect any C-specific definition to avoid compilation > error when used in assembly code. > > Signed-off-by: Julien Grall Reviewed-by: Volodymyr Babchuk > --- >

Re: [Xen-devel] [PATCH RFC for-4.13 04/10] xen/arm: Ensure the SSBD workaround is re-enabled right after exiting a guest

2019-09-27 Thread Volodymyr Babchuk
e guest and before any > + * request from it is handled. Depending on the exception trap, this may > + * be called with interrupts unmasked. > + */ > +void enter_hypervisor_from_guest(struct cpu_user_regs *regs) > +{ > +struct vcpu *v = current; > > /* > * If we pended a virtual abort, preserve it until it gets cleared. -- Volodymyr Babchuk at EPAM ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH RFC for-4.13 09/10] xen/arm: asm: Replace use of ALTERNATIVE with alternative_if

2019-09-27 Thread Volodymyr Babchuk
RONIZE_SERROR_ENTRY_EXIT) > +alternative_if SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT > +nop > +alternative_else > + b skip_check > +alternative_endif > + for the arm32 code you can have my r-b: Reviewed-By: Volodymyr Babchuk > /* >

Re: [Xen-devel] [PATCH RFC for-4.13 03/10] xen/arm: traps: Rework entry/exit from the guest path

2019-09-27 Thread Volodymyr Babchuk
Julien Grall writes: > On 27/09/2019 12:45, Volodymyr Babchuk wrote: >> >> Julien, > > Hi... > >> Julien Grall writes: >> >>> At the moment, enter_hypervisor_head() and leave_hypervisor_tail() are >>> used to deal with actions to

Re: [Xen-devel] [PATCH RFC for-4.13 04/10] xen/arm: Ensure the SSBD workaround is re-enabled right after exiting a guest

2019-09-27 Thread Volodymyr Babchuk
Julien Grall writes: > On 27/09/2019 12:56, Volodymyr Babchuk wrote: >> >> Julien, > > Hi... > >> >> Julien Grall writes: >> >>> At the moment, SSBD workaround is re-enabled for Xen after interrupts >>> are unmasked. This means we

Re: [Xen-devel] [PATCH RFC for-4.13 09/10] xen/arm: asm: Replace use of ALTERNATIVE with alternative_if

2019-09-27 Thread Volodymyr Babchuk
Julien Grall writes: > Hi, > > On 27/09/2019 13:11, Volodymyr Babchuk wrote: >> >> >> Julien Grall writes: >> >>> Using alternative_if makes the code a bit more streamlined. >>> >>> Take the opportunity to use the new auto-nop infras

Re: [Xen-devel] [PATCH RFC for-4.13 03/10] xen/arm: traps: Rework entry/exit from the guest path

2019-09-27 Thread Volodymyr Babchuk
Julien Grall writes: > Hi, > > On 27/09/2019 13:27, Volodymyr Babchuk wrote: >> >> Julien Grall writes: >> >>> On 27/09/2019 12:45, Volodymyr Babchuk wrote: >>>> >>>> Julien, >>> >>> Hi... >>> >>>&g

Re: [Xen-devel] [PATCH RFC for-4.13 04/10] xen/arm: Ensure the SSBD workaround is re-enabled right after exiting a guest

2019-09-27 Thread Volodymyr Babchuk
Hi, Julien Grall writes: > Hi, > > On 27/09/2019 13:39, Volodymyr Babchuk wrote: >> Julien Grall writes: >>> On 27/09/2019 12:56, Volodymyr Babchuk wrote: >>>> Julien Grall writes: >>>> >>>>> At the moment, SSBD workaround is re-ena

Re: [Xen-devel] [PATCH RFC for-4.13 04/10] xen/arm: Ensure the SSBD workaround is re-enabled right after exiting a guest

2019-09-27 Thread Volodymyr Babchuk
Julien Grall writes: > On 27/09/2019 14:33, Volodymyr Babchuk wrote: >> Julien Grall writes: >>> On 27/09/2019 13:39, Volodymyr Babchuk wrote: >>>> Julien Grall writes: >>>>> On 27/09/2019 12:56, Volodymyr Babchuk wrote: >>>>>> Jul

Re: [Xen-devel] [PATCH RFC for-4.13 10/10] xen/arm64: entry: Ensure the guest state is synced when receiving a vSError

2019-09-27 Thread Volodymyr Babchuk
o pending virtual SError took place. > */ > check_pending_vserror: > /* > @@ -432,9 +439,9 @@ abort_guest_exit_end: > > /* > * Not equal, the pending SError exception took place, set > - * x0 to non-zero. > + * x19 to non-zero.

Re: [Xen-devel] [PATCH RFC for-4.13 08/10] xen/arm: alternative: add auto-nop infrastructure

2019-09-27 Thread Volodymyr Babchuk
[will: use new nops macro to generate nop sequences] > Signed-off-by: Will Deacon > [julien: Add nops and port to Xen] > Signed-off-by: Julien Grall Reviewed-by: Volodymyr Babchuk -- Volodymyr Babchuk at EPAM ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH RFC for-4.13 04/10] xen/arm: Ensure the SSBD workaround is re-enabled right after exiting a guest

2019-09-27 Thread Volodymyr Babchuk
Julien Grall writes: > Hi, > > On 27/09/2019 15:21, Volodymyr Babchuk wrote: >> >> Julien Grall writes: >> >>> On 27/09/2019 14:33, Volodymyr Babchuk wrote: >>>> Julien Grall writes: >>>>> On 27/09/2019 13:39, Volodymyr Babchuk

Re: [Xen-devel] [PATCH RFC for-4.13 04/10] xen/arm: Ensure the SSBD workaround is re-enabled right after exiting a guest

2019-09-30 Thread Volodymyr Babchuk
r_hypervisor_from_guest_noirq to enter_hypervisor_from_guest_preirq(): Reviewed-by: Volodymyr Babchuk > 2) enter_hypervisor_from_guest() called with interrupts unmasked. > > Note that while enter_hypervisor_from_guest_noirq() does not use the > on-stack context registers, it is still pa

[Xen-devel] [PATCH v1 1/2] makefile: add support for *_defconfig targets

2019-05-14 Thread Volodymyr Babchuk
Ease up XEN configuration for non-standard builds, like armv8 tiny config. Signed-off-by: Volodymyr Babchuk --- Makefile | 4 xen/Makefile | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 829ac63741..ef1ea44ef1 100644 --- a/Makefile +++ b/Makefile

[Xen-devel] [PATCH v1 2/2] arm: rename tiny64.conf to tiny64_defconfig

2019-05-14 Thread Volodymyr Babchuk
As build system now supports *_defconfig rules it is good to be able to configure minimal XEN image with make tiny64_defconfig command. Signed-off-by: Volodymyr Babchuk Suggested-by: Andrii Anisov --- xen/arch/arm/configs/{tiny64.conf => tiny64_defconfig} | 0 1 file changed, 0 inserti

Re: [Xen-devel] [PATCH v1 1/2] makefile: add support for *_defconfig targets

2019-05-15 Thread Volodymyr Babchuk
ldcard ) expects to find a file, matching the wildcard. But %_defconfig is the phony rule, so I can't imagine how to use $(wildcard ) in this case. On other hand, following rule checks the presence of required _defconfig file: %_defconfig: arch/$(SRCARCH)/configs/%_defc

[Xen-devel] [PATCH v2 2/2] arm: rename tiny64.conf to tiny64_defconfig

2019-05-16 Thread Volodymyr Babchuk
As build system now supports *_defconfig rules it is good to be able to configure minimal XEN image with make tiny64_defconfig command. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/configs/{tiny64.conf => tiny64_defconfig} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename

[Xen-devel] [PATCH v2 1/2] makefile: add support for *_defconfig targets

2019-05-16 Thread Volodymyr Babchuk
Ease up XEN configuration for non-standard builds, like armv8 tiny config. Signed-off-by: Volodymyr Babchuk --- Changes from v2: - remove %_defconfig rule in favor of list of real *_defconfig files Makefile | 4 xen/Makefile | 2 +- 2 files changed, 5 insertions(+), 1 deletion

Re: [Xen-devel] [PATCH v2 2/2] arm: rename tiny64.conf to tiny64_defconfig

2019-05-20 Thread Volodymyr Babchuk
scripts/get_maintainer.pl: file 'defconfig_v2/v2-0002-arm-rename-tiny64.conf-to-tiny64_defconfig.patch' doesn't appear to be a patch. Add -f to options? > > On 16/05/2019 14:37, Volodymyr Babchuk wrote: >> As build system now supports *_defconfig rules it is good to be a

Re: [Xen-devel] [PATCH v2 2/2] arm: rename tiny64.conf to tiny64_defconfig

2019-05-20 Thread Volodymyr Babchuk
Julien Grall writes: > Hi, > > On 20/05/2019 14:41, Volodymyr Babchuk wrote: >> Julien Grall writes: >> >>> Hi, >>> >>> First of all, please add a cover letter when you send a series. This >>> help for threading and also a place to commen

[Xen-devel] [PATCH v5 04/10] xen/arm: optee: add fast calls handling

2019-05-21 Thread Volodymyr Babchuk
can't share one static SHM region with all guests, it just disables it for all of them. It is possible to make exception for Dom0, but it requires separate handling for buffers allocated from that region. Thus, it is not implemented yet. Signed-off-by: Volodymyr Babchuk --- All the patches

[Xen-devel] [PATCH v5 06/10] xen/arm: optee: add support for RPC SHM buffers

2019-05-21 Thread Volodymyr Babchuk
the SHM buffer it just freed. OP-TEE expects that this RPC buffer have size of OPTEE_MSG_NONCONTIG_PAGE_SIZE, which equals to 4096 and is aligned with the same size. So, basically it expects one 4k page from the guest. This is the same as Xen's PAGE_SIZE. Signed-off-by: Volodymyr Ba

[Xen-devel] [PATCH v5 08/10] xen/arm: optee: add support for RPC commands

2019-05-21 Thread Volodymyr Babchuk
, but now we need to read and write to it, so it should be shadowed. Signed-off-by: Volodymyr Babchuk --- All the patches to optee.c should be merged together. They were split to ease up review. But they depend heavily on each other. Changes from v3: - return value of

[Xen-devel] [PATCH v5 10/10] tools/arm: optee: create optee firmware node in DT if tee=optee

2019-05-21 Thread Volodymyr Babchuk
If TEE support is enabled with "tee=optee" option in xl.cfg, then we need to inform guest about available TEE, by creating corresponding node in the guest's device tree. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- This patch depends on patches to optee.c.

[Xen-devel] [PATCH v5 02/10] xen/arm: optee: add OP-TEE header files

2019-05-21 Thread Volodymyr Babchuk
mangled a bit to compile with XEN. Signed-off-by: Volodymyr Babchuk --- Changes from v4: - Updated to latest OP-TEE version because of adding OPTEE_SMC_GET_THREAD_COUNT call which will be released with OP-TEE 3.5.0 Changes from v3: - Updated to latest OP-TEE version because

[Xen-devel] [PATCH v5 07/10] xen/arm: optee: add support for arbitrary shared memory

2019-05-21 Thread Volodymyr Babchuk
o get limit from OP-TEE, we need to choose some arbitrary value. Currently limit is 16384 of 4K pages. Signed-off-by: Volodymyr Babchuk --- All the patches to optee.c should be merged together. They were split to ease up review. But they depend heavily on each other. Changes from v3: - Rew

[Xen-devel] [PATCH v5 03/10] xen/arm: optee: add OP-TEE mediator skeleton

2019-05-21 Thread Volodymyr Babchuk
y are considered "fast calls" in terms of ARM SMCCC. Signed-off-by: Volodymyr Babchuk --- All the patches to optee.c should be merged together. They were split to ease up review. But they depend heavily on each other. Changes from v4: - Removed OPTEE_ENABLED macro. Empty (

[Xen-devel] [PATCH v5 00/10] TEE mediator (and OP-TEE) support in XEN

2019-05-21 Thread Volodymyr Babchuk
how TEE discovery is done. Now it is very generic and should support any platform. [1] https://lists.xenproject.org/archives/html/xen-devel/2017-10/msg01451.html [2] https://github.com/OP-TEE/optee_os/pull/2370 [3] https://lists.xenproject.org/archives/html/xen-devel/2018-08/msg02138.html Volo

[Xen-devel] [PATCH v5 05/10] xen/arm: optee: add std call handling

2019-05-21 Thread Volodymyr Babchuk
the original call. Thus, mediator needs to maintain context for original standard call during multiple SMCCC calls. Standard call is considered complete, when returned value is not a RPC request. Signed-off-by: Volodymyr Babchuk --- All the patches to optee.c should be merged together. They

[Xen-devel] [PATCH v5 01/10] xen/arm: add generic TEE mediator framework

2019-05-21 Thread Volodymyr Babchuk
find which TEE is installed on the platform. Then generic vSMC handler will call selected mediator when it intercept SMC/HVC that belongs to TEE OS or TEE application. Signed-off-by: Volodymyr Babchuk --- Changes from v4: - Added tee_get_type() function, which returns id of currently

[Xen-devel] [PATCH v5 09/10] tools/arm: tee: add "tee" option for xl.cfg

2019-05-21 Thread Volodymyr Babchuk
n a platform. It is possible to add another types in the future. Signed-off-by: Volodymyr Babchuk --- All the patches to optee.c should be merged together. They were split to ease up review. But they depend heavily on each other. Changes from v4: - "native" option was replaced

[Xen-devel] [PATCH] get_maintainer: Improve patch recognition

2019-05-29 Thread Volodymyr Babchuk
From: Joe Perches From: Joe Perches There are mode change and rename only patches that are unrecognized by the get_maintainer.pl script. Recognize them. Reported-by: Heinrich Schuchardt CC: Julien Grall Signed-off-by: Joe Perches Signed-off-by: Volodymyr Babchuk --- scripts

Re: [Xen-devel] [PATCH v2 2/2] arm: rename tiny64.conf to tiny64_defconfig

2019-05-29 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi Volodymyr, > > Sorry for the late reply. It's okay, no worries. > On 5/20/19 3:57 PM, Volodymyr Babchuk wrote: >> >> Julien Grall writes: >> >>> Hi, >>> >>> On 20/05/2019 14:41, Vo

Re: [Xen-devel] [PATCH] get_maintainer: Improve patch recognition

2019-05-29 Thread Volodymyr Babchuk
t. >> >> Recognize them. >> [ Upstream commit 0455c74788fd5aad4399f00e3fbbb7e87450ca58 ] >> Reported-by: Heinrich Schuchardt >> CC: Julien Grall >> Signed-off-by: Joe Perches >> Signed-off-by: Volodymyr Babchuk > > Mentioning the original Linux commit ID would have been

Re: [Xen-devel] [PATCH v5 00/10] TEE mediator (and OP-TEE) support in XEN

2019-06-01 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi Volodymyr, > > I tried to apply the patches to staging but fail because the patches > contains =20. Do you have a tree with the series applied? Sure, you can find them at [1] [1] https://github.com/lorc/xen/tree/optee_v5 -- Best regard

Re: [Xen-devel] [PATCH v5 00/10] TEE mediator (and OP-TEE) support in XEN

2019-06-04 Thread Volodymyr Babchuk
Hello Julien, Julien Grall writes: > On 6/1/19 5:07 PM, Volodymyr Babchuk wrote: >> >> Hi Julien, > > Hi Volodymyr, > >> Julien Grall writes: >> >>> Hi Volodymyr, >>> >>> I tried to apply the patches to staging but fail because t

Re: [Xen-devel] [PATCH v5 02/10] xen/arm: optee: add OP-TEE header files

2019-06-10 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi, > > On 21/05/2019 22:25, Volodymyr Babchuk wrote: >> This header files describes protocol between OP-TEE and OP-TEE client >> driver in Linux. They are needed for upcoming OP-TEE mediator, which >> is added in the next patch. >

Re: [Xen-devel] [PATCH v5 01/10] xen/arm: add generic TEE mediator framework

2019-06-11 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > On 06/06/2019 17:02, Julien Grall wrote: >> Hi Volodymyr, >> >> On 5/21/19 10:25 PM, Volodymyr Babchuk wrote: >>> +static inline bool tee_handle_call(struct cpu_user_regs *regs) >>> +{ >>> + return false; >

[Xen-devel] [PATCH v6 01/10] xen/arm: add generic TEE mediator framework

2019-06-11 Thread Volodymyr Babchuk
find which TEE is installed on the platform. Then generic vSMC handler will call selected mediator when it intercept SMC/HVC that belongs to TEE OS or TEE application. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- Changes from v5: - Fixed bug, when XEN won't boot with CO

[Xen-devel] [PATCH v6 00/10] TEE mediator (and OP-TEE) support in XEN

2019-06-11 Thread Volodymyr Babchuk
://lists.xenproject.org/archives/html/xen-devel/2017-10/msg01451.html [2] https://github.com/OP-TEE/optee_os/pull/2370 [3] https://lists.xenproject.org/archives/html/xen-devel/2018-08/msg02138.html [4] https://github.com/lorc/xen/tree/optee_v6 [5] https://lists.xenproject.org/archives/html/xen-devel/2

[Xen-devel] [PATCH v6 02/10] xen/arm: optee: add OP-TEE header files

2019-06-11 Thread Volodymyr Babchuk
-TEE OS 3.5.0 tree and mangled a bit to compile with XEN. Location of the files in the original tree: core/include/optee_msg.h core/include/optee_rpc_cmd.h core/arch/arm/include/sm/optee_smc.h [OP-TEE commit id 5df2a985b2ffd0b6f1107f12ca2a88203bf31328] Signed-off-by: Volodymyr Babchuk

[Xen-devel] [PATCH v6 09/10] tools/arm: tee: add "tee" option for xl.cfg

2019-06-11 Thread Volodymyr Babchuk
This requires special OP-TEE build with virtualization support enabled. Signed-off-by: Volodymyr Babchuk --- All the patches to optee.c should be merged together. They were split to ease up review. But they depend heavily on each other. Changes from v5: - Replaced "native" with

[Xen-devel] [PATCH v6 10/10] tools/arm: optee: create optee firmware node in DT if tee=optee

2019-06-11 Thread Volodymyr Babchuk
If TEE support is enabled with "tee=optee" option in xl.cfg, then we need to inform guest about available TEE, by creating corresponding node in the guest's device tree. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall Acked-by: Ian Jackson --- This patch depend

[Xen-devel] [PATCH v6 07/10] xen/arm: optee: add support for arbitrary shared memory

2019-06-11 Thread Volodymyr Babchuk
o get limit from OP-TEE, we need to choose some arbitrary value. Currently limit is 16384 of 4K pages. Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- All the patches to optee.c should be merged together. They were split to ease up review. But they depend heavily on each other. Ch

[Xen-devel] [PATCH v6 04/10] xen/arm: optee: add fast calls handling

2019-06-11 Thread Volodymyr Babchuk
can't share one static SHM region with all guests, it just disables it for all of them. It is possible to make exception for Dom0, but it requires separate handling for buffers allocated from that region. Thus, it is not implemented yet. Signed-off-by: Volodymyr Babchuk Acked-by: Julien Gral

[Xen-devel] [PATCH v6 08/10] xen/arm: optee: add support for RPC commands

2019-06-11 Thread Volodymyr Babchuk
, but now we need to read and write to it, so it should be shadowed. Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- All the patches to optee.c should be merged together. They were split to ease up review. But they depend heavily on each other. Changes from v5: - There was change

[Xen-devel] [PATCH v6 06/10] xen/arm: optee: add support for RPC SHM buffers

2019-06-11 Thread Volodymyr Babchuk
the SHM buffer it just freed. OP-TEE expects that this RPC buffer have size of OPTEE_MSG_NONCONTIG_PAGE_SIZE, which equals to 4096 and is aligned with the same size. So, basically it expects one 4k page from the guest. This is the same as Xen's PAGE_SIZE. Signed-off-by: Volodymyr Babchuk Ack

[Xen-devel] [PATCH v6 05/10] xen/arm: optee: add std call handling

2019-06-11 Thread Volodymyr Babchuk
the original call. Thus, mediator needs to maintain context for original standard call during multiple SMCCC calls. Standard call is considered complete, when returned value is not a RPC request. Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- All the patches to optee.c should b

[Xen-devel] [PATCH v6 03/10] xen/arm: optee: add OP-TEE mediator skeleton

2019-06-11 Thread Volodymyr Babchuk
y are considered "fast calls" in terms of ARM SMCCC. Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- All the patches to optee.c should be merged together. They were split to ease up review. But they depend heavily on each other. Changes from v4: - Removed OPTEE_ENABLED ma

Re: [Xen-devel] [PATCH v2 2/2] arm: rename tiny64.conf to tiny64_defconfig

2019-06-11 Thread Volodymyr Babchuk
Hello Julien, Jan, Julien Grall writes: >>>>> On 16.05.19 at 15:37, wrote: >>> As build system now supports *_defconfig rules it is good to be able >>> to configure minimal XEN image with >>> >>> make tiny64_defconfig >>> >>

Re: [Xen-devel] [PATCH v3 02/11] arm: add tee_enabled flag to xen_arch_domainconfig

2019-01-16 Thread Volodymyr Babchuk
Hello Julien, Julien Grall writes: > Hi, > > On 12/18/18 9:11 PM, Volodymyr Babchuk wrote: >> From: Volodymyr Babchuk >> >> This flag enables TEE support for a domain. >> >> Signed-off-by: Volodymyr Babchuk >> --- >> xen/arch/arm/d

Re: [Xen-devel] [PATCH v3 04/11] optee: add OP-TEE mediator skeleton

2019-01-16 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi Volodymyr, > > On 12/18/18 9:11 PM, Volodymyr Babchuk wrote: >> From: Volodymyr Babchuk >> >> Add very basic OP-TEE mediator. It can probe for OP-TEE presence, >> tell it about domain creation/destruction and forward all

Re: [Xen-devel] [PATCH v3 06/11] optee: add std call handling

2019-01-17 Thread Volodymyr Babchuk
Hello Julien, Julien Grall writes: > Hi Volodymyr, > > On 18/12/2018 21:11, Volodymyr Babchuk wrote: >> From: Volodymyr Babchuk >> >> The main way to communicate with OP-TEE is to issue standard SMCCC >> call. "Standard" is a SMCCC term and it means

Re: [Xen-devel] [PATCH v3 06/11] optee: add std call handling

2019-01-17 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi Volodymyr, > > On 17/01/2019 15:21, Volodymyr Babchuk wrote: >> Julien Grall writes: >> >>> Hi Volodymyr, >>> >>> On 18/12/2018 21:11, Volodymyr Babchuk wrote: >>>> From: Volodymyr Babchuk &

Re: [Xen-devel] [PATCH v3 05/11] optee: add fast calls handling

2019-01-17 Thread Volodymyr Babchuk
d. But, actually, there is a caveat. Right now linux driver requires static SHM, even if it will not use it. I have submitted patch that fixes it, but it still not merged. So... what do you think? Should I add piece of code which is needed right now, but will not be used later?

Re: [Xen-devel] [PATCH v3 07/11] optee: add support for RPC SHM buffers

2019-01-17 Thread Volodymyr Babchuk
Julien Grall writes: > Hi Volodymyr, > > On 18/12/2018 21:11, Volodymyr Babchuk wrote: >> From: Volodymyr Babchuk >> >> OP-TEE usually uses the same idea with command buffers (see >> previous commit) to issue RPC requests. Problem is that initially >&g

Re: [Xen-devel] [PATCH v3 05/11] optee: add fast calls handling

2019-01-17 Thread Volodymyr Babchuk
Hi, Julien Grall writes: > Hi, > > On 1/17/19 7:22 PM, Volodymyr Babchuk wrote: >> Julien Grall writes: >> >> [...] >>>> Because mediator can't share one static SHM region with all guests, >>>> it just disables it for all. >>> &g

Re: [Xen-devel] [PATCH v3 06/11] optee: add std call handling

2019-01-17 Thread Volodymyr Babchuk
Julien Grall writes: > On 1/17/19 7:13 PM, Volodymyr Babchuk wrote: >>>> Actually, OP-TEE protocol have possibility to handle limited number of >>>> threads correctly. OP-TEE can report that all threads are busy and >>>> client will wait for a free one. XE

  1   2   3   4   5   6   7   8   >