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

2017-11-27 Thread Volodymyr Babchuk
use it in production. It was tested on RCAR Salvator-M3 board. Signed-off-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> --- xen/arch/arm/tee/Kconfig | 4 + xen/arch/arm/tee/Makefile| 1 + xen/arch/arm/tee/optee.c | 765 +++ xe

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

2017-12-04 Thread Volodymyr Babchuk
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 my TODO list. Question i

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 <volodymyr_babc...@epam.com> Existing SMC wrapper call_smc() allows only 4 parameters and returns only one value. This is enough for existing use i

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

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 <volodymyr_babc...@epam.com> > > > > Existing SMC wrapper call_smc() allows only 4 parameters and

Re: [Xen-devel] [PATCH v4 08/10] arm: add QEMU, Rcar3 and MPSoC configs

2018-06-01 Thread Volodymyr Babchuk
/platforms/Makefile @@ -8,4 +8,4 @@ obj-$(CONFIG_ARM_64) += seattle.o obj-y += sunxi.o obj-$(CONFIG_ARM_64) += thunderx.o obj-$(CONFIG_ARM_64) += xgene-storm.o -obj-$(CONFIG_ARM_64) += xilinx-zynqmp.o +obj-$(CONFIG_MPSOC) += xilinx-zynqmp.o -- Volodymyr Babchuk ___

Re: [Xen-devel] [PATCH 2/3] xen/arm: vsmc: Don't implement function ID that doesn't exist

2018-01-26 Thread Volodymyr Babchuk
On 24.01.18 20:34, Julien Grall wrote: The current implementation of SMCCC relies on the fact only function number (bits [15:0]) is enough to identify what to implement. However, PSCI call are only available in the range 0x8400-0x841F and 0xC400-0xC41F. Furthermore, not all

Re: [Xen-devel] [PATCH 3/3] xen/arm: vpsci: Move PSCI function dispatching from vsmc.c to vpsci.c

2018-01-26 Thread Volodymyr Babchuk
Hi, On 26.01.18 20:15, Julien Grall wrote: Hi, On 26/01/18 18:09, Volodymyr Babchuk wrote: On 24.01.18 20:34, Julien Grall wrote: -    case PSCI_0_2_FN32(AFFINITY_INFO): -    case PSCI_0_2_FN64(AFFINITY_INFO): +    switch ( fid )   { -    register_t taff = PSCI_ARG(regs, 1

Re: [Xen-devel] [PATCH 2/3] xen/arm: vsmc: Don't implement function ID that doesn't exist

2018-01-26 Thread Volodymyr Babchuk
On 26.01.18 20:07, Julien Grall wrote: On 26/01/18 18:03, Volodymyr Babchuk wrote: diff --git a/xen/include/asm-arm/smccc.h b/xen/include/asm-arm/smccc.h index f543dea0bb..303517459f 100644 --- a/xen/include/asm-arm/smccc.h +++ b/xen/include/asm-arm/smccc.h @@ -82,9 +82,23 @@ static inline

Re: [Xen-devel] [PATCH v2 1/3] xen/arm: vpsci: Removing dummy MIGRATE and MIGRATE_INFO_UP_CPU

2018-02-02 Thread Volodymyr Babchuk
code. So remove the implementations for both function. Signed-off-by: Julien Grall <julien.gr...@linaro.org> `Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com>` --- Changes in v2: - Remove define in psci.h - Update SSSC_SMCCC_FUNCTION_COUNT ---

Re: [Xen-devel] [PATCH v2 3/3] xen/arm: vpsci: Move PSCI function dispatching from vsmc.c to vpsci.c

2018-02-02 Thread Volodymyr Babchuk
for virtual PSCI and avoid confusion with the host PSCI. Signed-off-by: Julien Grall <julien.gr...@linaro.org> I'm okay with this generally, you can have my r-b: `Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com>` But there are couple of minor questions below. --- C

Re: [Xen-devel] [PATCH v2 2/3] xen/arm: vsmc: Don't implement function ID that doesn't exist

2018-02-02 Thread Volodymyr Babchuk
suit the spec. Lastly, update SSSC_SMCCC_FUNCTION_COUNT to match the correct number of funtions. Note that version is not updated because the number has always been wrong, and nobody could properly use it. Signed-off-by: Julien Grall <julien.gr...@linaro.org> `Reviewed-by: Volodymyr B

Re: [Xen-devel] [PATCH 3/3] xen/arm: vpsci: Move PSCI function dispatching from vsmc.c to vpsci.c

2018-01-31 Thread Volodymyr Babchuk
On 31.01.18 16:54, Julien Grall wrote: On 31/01/18 11:32, Volodymyr Babchuk wrote: I thought about vpsci.h, but basically you will have only 2 functions in it and the number of PSCI calls. That's it. Is  this really a problem? It is quite natural to find declarations for something.c

Re: [Xen-devel] [PATCH 3/3] xen/arm: vpsci: Move PSCI function dispatching from vsmc.c to vpsci.c

2018-01-31 Thread Volodymyr Babchuk
Hi, On 31.01.18 13:36, Julien Grall wrote: Hi, On 31/01/18 11:32, Volodymyr Babchuk wrote: I thought about vpsci.h, but basically you will have only 2 functions in it and the number of PSCI calls. That's it. Is  this really a problem? It is quite natural to find declarations

Re: [Xen-devel] [PATCH v2 3/3] xen/arm: vpsci: Move PSCI function dispatching from vsmc.c to vpsci.c

2018-02-02 Thread Volodymyr Babchuk
Hi On 02.02.18 16:31, Julien Grall wrote: Hi, On 02/02/18 14:23, Volodymyr Babchuk wrote: On 02.02.18 13:41, Julien Grall wrote: At the moment PSCI function dispatching is done in vsmc.c and the function implementation in vpsci.c. Some bits of the implementation is even done in vsmc.c (see

Re: [Xen-devel] [PATCH 3/3] xen/arm: vpsci: Move PSCI function dispatching from vsmc.c to vpsci.c

2018-01-31 Thread Volodymyr Babchuk
Hi Julien, On 31.01.18 00:06, Julien Grall wrote: On 30 January 2018 at 19:35, Volodymyr Babchuk <volodymyr_babc...@epam.com> wrote: On 30.01.18 20:44, Julien Grall wrote: On 30/01/18 18:28, Volodymyr Babchuk wrote: Hi Julien, On 30.01.18 20:01, Julien Grall wrote: On 26/01

Re: [Xen-devel] [PATCH 2/7] xen/arm: psci: Rework the PSCI definitions

2018-02-06 Thread Volodymyr Babchuk
rall <julien.gr...@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> > --- > xen/arch/arm/platforms/seattle.c | 4 ++-- > xen/arch/arm/psci.c | 10 +- > xen/arch/arm/vpsci.c | 22 +++--- > xen/include/asm-arm/psc

Re: [Xen-devel] [PATCH 6/7] xen/arm: Adapt smccc.h to be able to use it in assembly code

2018-02-06 Thread Volodymyr Babchuk
Hi, On 5 February 2018 at 15:20, Julien Grall <julien.gr...@arm.com> wrote: > Signed-off-by: Julien Grall <julien.gr...@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> > --- > xen/include/asm-arm/smccc.h | 16 ++-- > 1 file changed,

Re: [Xen-devel] [PATCH 1/7] xen/arm: vpsci: Remove parameter 'ver' from do_common_cpu

2018-02-06 Thread Volodymyr Babchuk
this, the parameter 'ver' is removed and do_psci_cpu_on > (implementation for PSCI 0.1) is adapted to avoid returning > PSCI_ALREADY_ON. > > Signed-off-by: Julien Grall <julien.gr...@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> > --- > xen/arch/a

Re: [Xen-devel] [PATCH v2 3/3] xen/arm: vpsci: Move PSCI function dispatching from vsmc.c to vpsci.c

2018-02-06 Thread Volodymyr Babchuk
On 06.02.18 17:39, Julien Grall wrote: On 02/06/2018 03:28 PM, Volodymyr Babchuk wrote: Hi Julien, On 06.02.18 16:45, Julien Grall wrote: [...] +/* + * PSCI 0.2 or later calls. It will return false if the function ID is + * not handled. + */ +bool do_vpsci_0_2_call(struct cpu_user_regs

Re: [Xen-devel] [PATCH v2 3/3] xen/arm: vpsci: Move PSCI function dispatching from vsmc.c to vpsci.c

2018-02-06 Thread Volodymyr Babchuk
(or patch series) which alters the interface. "VPSCI_NR_FUNCS (in asm-arm/vpsci.h) should be updated when adding removing a function. SSCCC_SMCCC_*_REVISION should be updated once per Xen release". And who will be responsible for this?

Re: [Xen-devel] [PATCH 4/7] xen/arm: vsmc: Implement SMCCC 1.1

2018-02-06 Thread Volodymyr Babchuk
0x1) > + > /* Only one error code defined in SMCCC */ > #define ARM_SMCCC_ERR_UNKNOWN_FUNCTION (-1) > > -- > 2.11.0 > > > ___ > Xen-devel mailing list > Xen-devel@lists.xenproject.org > https://lists.xenproject.org/mailman/listinfo/xen-devel -- WBR Volodymyr Babchuk aka lorc [+380976646013] mailto: vlad.babc...@gmail.com ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v2 2/3] xen/arm: vsmc: Don't implement function ID that doesn't exist

2018-02-06 Thread Volodymyr Babchuk
Hi Julien, On 06.02.18 16:53, Julien Grall wrote: Hi Volodymyr, On 02/02/2018 01:46 PM, Volodymyr Babchuk wrote: On 02.02.18 13:41, Julien Grall wrote: The current implementation of SMCCC relies on the fact only function number (bits [15:0]) is enough to identify what to implement

Re: [Xen-devel] [PATCH 3/7] xen/arm: vpsci: Add support for PSCI 1.1

2018-02-06 Thread Volodymyr Babchuk
TURES PSCI_0_2_FN32(10) > > #define PSCI_0_2_FN64_CPU_SUSPEND PSCI_0_2_FN64(1) > #define PSCI_0_2_FN64_CPU_ON PSCI_0_2_FN64(3) > diff --git a/xen/include/asm-arm/vpsci.h b/xen/include/asm-arm/vpsci.h > index d6a

Re: [Xen-devel] [PATCH 7/7] xen/arm64: Implement a fast path for handling SMCCC_ARCH_WORKAROUND_1

2018-02-06 Thread Volodymyr Babchuk
; accesses */ > #define HDCR_TPMCR (_AC(1,U)<<5) /* Trap PMCR accesses */ > > +#define HSR_EC_SHIFT26 > + > #define HSR_EC_UNKNOWN 0x00 > #define HSR_EC_WFI_WFE 0x01 > #define HSR_EC_CP15_32 0x03 > -- > 2.11.0 > > > ___ > Xen-devel mailing list > Xen-devel@lists.xenproject.org > https://lists.xenproject.org/mailman/listinfo/xen-devel -- WBR Volodymyr Babchuk aka lorc [+380976646013] mailto: vlad.babc...@gmail.com ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH 5/7] xen/arm: vsmc: Implement SMCCC_ARCH_WORKAROUND_1 BP hardening support

2018-02-06 Thread Volodymyr Babchuk
_SMCCC_FAST_CALL, \ > + ARM_SMCCC_CONV_32,\ > + ARM_SMCCC_OWNER_ARCH, \ > + 0x8000) > + > /* Only one error code defined in SMCCC */ > #define ARM_SMCCC_ERR_UNKNOWN_FUNCTION (-1) &

Re: [Xen-devel] [PATCH v3 3/3] xen/arm: vpsci: Move PSCI function dispatching from vsmc.c to vpsci.c

2018-02-06 Thread Volodymyr Babchuk
definitions for virtual PSCI and avoid confusion with the host PSCI. Signed-off-by: Julien Grall <julien.gr...@linaro.org> Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> --- Changes in v3: - Add copyright and emacs magic in vpsci.h - Add a comment to update

Re: [Xen-devel] [PATCH v2 15/15] xen/arm: psci: Prefix with static any functions not exported

2018-02-09 Thread Volodymyr Babchuk
On 08.02.18 21:22, Julien Grall wrote: A bunch of PSCI functions are not prefixed with static despite no one is using them outside the file and the prototype is not available in psci.h. Signed-off-by: Julien Grall <julien.gr...@arm.com> Reviewed-by: Volodymyr Babchuk <volod

Re: [Xen-devel] [PATCH v2 14/15] xen/arm: psci: Consolidate PSCI version print

2018-02-09 Thread Volodymyr Babchuk
Grall <julien.gr...@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> --- Changes in v2: - Patch added --- xen/arch/arm/psci.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c inde

Re: [Xen-devel] [PATCH v2 09/15] xen/arm: psci: Detect SMCCC version

2018-02-09 Thread Volodymyr Babchuk
RTED into that patch and use it in mentioned function or add new patch that changes -1 to ARM_SMCCC_NOT_SUPPORTED ? /* SMCCC function identifier range which is reserved for existing APIs */ #define ARM_SMCCC_RESERVED_RANGE_START 0x0 -- Volodymyr Babchuk

Re: [Xen-devel] [PATCH v2 08/15] xen/arm: smccc: Add macros SMCCC_VERSION, SMCCC_VERSION_{MINOR, MAJOR}

2018-02-09 Thread Volodymyr Babchuk
to define ARM_SMCCC_VERSION_1_0 and ARM_SMCCC_VERSION_1_1. Signed-off-by: Julien Grall <julien.gr...@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> --- Changes in v2: - Patch added --- xen/include/asm-arm/smccc.h | 16 ++-- 1 file change

Re: [Xen-devel] [PATCH v2 09/15] xen/arm: psci: Detect SMCCC version

2018-02-12 Thread Volodymyr Babchuk
Hi Julien, On 09.02.18 19:09, Julien Grall wrote: On 02/09/2018 05:04 PM, Volodymyr Babchuk wrote: Julien, On 08.02.18 21:21, Julien Grall wrote: PSCI 1.0 and later allows the SMCCC version to be (indirectly) probed via PSCI_FEATURES. If the PSCI_FEATURES does not exist (PSCI 0.2

Re: [Xen-devel] [PATCH v2 11/15] xen/arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support

2018-02-12 Thread Volodymyr Babchuk
Julien, On 12.02.18 19:12, Julien Grall wrote: On 12/02/18 16:55, Volodymyr Babchuk wrote: Hi Julien, Hi Volodymyr, On 08.02.18 21:21, Julien Grall wrote: Add the detection and runtime code for ARM_SMCCC_ARCH_WORKAROUND_1. Signed-off-by: Julien Grall <julien.gr...@arm.

Re: [Xen-devel] [PATCH v2 07/15] xen/arm64: Print a per-CPU message with the BP hardening method used

2018-02-09 Thread Volodymyr Babchuk
On 08.02.18 21:21, Julien Grall wrote: This will make easier to know whether BP hardening has been enabled for a CPU and which method is used. Signed-off-by: Julien Grall <julien.gr...@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> --- C

Re: [Xen-devel] [PATCH v2 03/15] xen/arm: vsmc: Implement SMCCC 1.1

2018-02-09 Thread Volodymyr Babchuk
On 09.02.18 18:15, Julien Grall wrote: On 02/09/2018 04:08 PM, Volodymyr Babchuk wrote: Hi, Hi Volodymyr, Thank you for the review. I have noticed that your e-mail client seem to mess up with the e-mail sent sometimes (see below). You may want to configure it to avoid that. Oops, sorry

Re: [Xen-devel] [PATCH v2 02/15] xen/arm: vpsci: Add support for PSCI 1.1

2018-02-09 Thread Volodymyr Babchuk
--git a/xen/include/asm-arm/vpsci.h b/xen/include/asm-arm/vpsci.h index 035a41e812..0cca5e6830 100644 --- a/xen/include/asm-arm/vpsci.h +++ b/xen/include/asm-arm/vpsci.h @@ -23,7 +23,7 @@ #include /* Number of function implemented by virtual PSCI (only 0.2 or later) */ -#define VPSCI_NR_FUNCS

Re: [Xen-devel] [PATCH v2 03/15] xen/arm: vsmc: Implement SMCCC 1.1

2018-02-09 Thread Volodymyr Babchuk
lien Grall <julien.gr...@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> --- Changes in v2: - Add a humand readable name for the specification --- xen/arch/arm/vpsci.c| 1 + xen/arch/arm/vsmc.c | 23 +++ xen/includ

Re: [Xen-devel] [PATCH 1/7] xen/arm: vpsci: Remove parameter 'ver' from do_common_cpu

2018-02-09 Thread Volodymyr Babchuk
t if the CPU is already on. >>> >>> Based on this, the parameter 'ver' is removed and do_psci_cpu_on >>> (implementation for PSCI 0.1) is adapted to avoid returning >>> PSCI_ALREADY_ON. >>> >>> Signed-off-by: Julien Grall <julien.gr...@arm.co

Re: [Xen-devel] [PATCH 4/7] xen/arm: vsmc: Implement SMCCC 1.1

2018-02-07 Thread Volodymyr Babchuk
Hi Julien, On 6 February 2018 at 20:04, Julien Grall <julien.gr...@arm.com> wrote: > Hi, > > On 02/06/2018 04:18 PM, Volodymyr Babchuk wrote: >> >> On 5 February 2018 at 15:20, Julien Grall <julien.gr...@arm.com> wrote: >>> >>> The new SMC Call

Re: [Xen-devel] [PATCH 7/7] xen/arm64: Implement a fast path for handling SMCCC_ARCH_WORKAROUND_1

2018-02-07 Thread Volodymyr Babchuk
Hi Julien, On 6 February 2018 at 20:33, Julien Grall <julien.gr...@arm.com> wrote: > Hi, > > On 02/06/2018 04:36 PM, Volodymyr Babchuk wrote: >> >> On 5 February 2018 at 15:20, Julien Grall <julien.gr...@arm.com> wrote: >>> >>> The function

Re: [Xen-devel] [PATCH 5/7] xen/arm: vsmc: Implement SMCCC_ARCH_WORKAROUND_1 BP hardening support

2018-02-07 Thread Volodymyr Babchuk
Hi, On 6 February 2018 at 20:12, Julien Grall <julien.gr...@arm.com> wrote: > On 02/06/2018 04:23 PM, Volodymyr Babchuk wrote: >> >> Hi, > > > Hi, > >> On 5 February 2018 at 15:20, Julien Grall <julien.gr...@arm.com> wrote: >>> >>>

Re: [Xen-devel] [PATCH v3 10/17] xen/arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support

2018-02-15 Thread Volodymyr Babchuk
Julien, On 15.02.18 17:02, Julien Grall wrote: Add the detection and runtime code for ARM_SMCCC_ARCH_WORKAROUND_1. Signed-off-by: Julien Grall <julien.gr...@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> --- Changes in v3: - Add the missing ca

Re: [Xen-devel] [PATCH v3 02/17] xen/arm: vsmc: Implement SMCCC 1.1

2018-02-15 Thread Volodymyr Babchuk
by: Julien Grall <julien.gr...@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> --- Changes in v3: - Use ARM_SMCCC_NOT_SUPPORTED rather than hardcoded return Changes in v2: - Add a humand readable name for the specification ---

Re: [Xen-devel] [PATCH v5 11/18] xen/arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support

2018-02-23 Thread Volodymyr Babchuk
Julien, Looks good now On 23.02.18 20:57, Julien Grall wrote: Add the detection and runtime code for ARM_SMCCC_ARCH_WORKAROUND_1. Signed-off-by: Julien Grall <julien.gr...@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babc...@epam.com> --- Changes in v5: - Fo

Re: [Xen-devel] [PATCH v4 11/19] xen/arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support

2018-02-23 Thread Volodymyr Babchuk
+#define ARM_SMCCC_SUCCESS (0) /* SMCCC function identifier range which is reserved for existing APIs */ #define ARM_SMCCC_RESERVED_RANGE_START 0x0 -- Volodymyr Babchuk ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v1 6/6] xsm: add tee access policy support

2018-08-23 Thread Volodymyr Babchuk
Hello Daniel, On 23.08.18 01:44, DeGraaf, Daniel G wrote: From: Volodymyr Babchuk Sent: Wednesday, August 22, 2018 10:12 AM As we don't want any guest to access limited resources of TEE, we need a way to control who can work with it. Thus, new access vector class "tee" is added

Re: [Xen-devel] [PATCH v1 5/6] libxl: create DTS node for OP-TEE if it is enabled

2018-08-23 Thread Volodymyr Babchuk
Hi, On 22.08.18 20:32, Julien Grall wrote: Hi, On 22/08/18 15:11, Volodymyr Babchuk wrote: Signed-off-by: Volodymyr Babchuk I am a bit confused. The DT is only here to tell the guest OP-TEE is present. But I don't see anything to tell the hypervisor the guest will use OP-TEE. Yes

Re: [Xen-devel] [PATCH v1 5/6] libxl: create DTS node for OP-TEE if it is enabled

2018-08-23 Thread Volodymyr Babchuk
Hi, On 23.08.18 17:11, Julien Grall wrote: Hi, On 08/23/2018 03:03 PM, Volodymyr Babchuk wrote: Hi, On 22.08.18 20:32, Julien Grall wrote: Hi, On 22/08/18 15:11, Volodymyr Babchuk wrote: Signed-off-by: Volodymyr Babchuk I am a bit confused. The DT is only here to tell the guest OP-TEE

Re: [Xen-devel] [PATCH v1 4/6] optee: add OP-TEE mediator

2018-08-23 Thread Volodymyr Babchuk
Hi, On 22.08.18 20:28, Julien Grall wrote: Hi, Please only CC relevant people to the patches. This could be done easily using the new script add_maintainers.pl. Oh, I'm sorry. I used get_maintainers.pl. On 22/08/18 15:11, Volodymyr Babchuk wrote: Add OP-TEE mediator, so guests can

Re: [Xen-devel] [PATCH v1 1/6] arm: add SMC wrapper that is compatible with SMCCC

2018-08-23 Thread Volodymyr Babchuk
Hi, On 23.08.18 17:45, Julien Grall wrote: On 08/23/2018 03:35 PM, Volodymyr Babchuk wrote: Hi, Hi Volodymyr, On 22.08.18 19:46, Julien Grall wrote: Hi Volodymyr, On 22/08/18 15:11, Volodymyr Babchuk wrote: Existing SMC wrapper call_smc() allows only 4 parameters and returns only one

Re: [Xen-devel] [PATCH v1 6/6] xsm: add tee access policy support

2018-08-23 Thread Volodymyr Babchuk
. For an overall control, that should be go through a DOMCTL tell Xen to initialize OP-TEE for that domain. Just to be sure. You are proposing to add flag "TEE_ENABLED" for a domain and set it during domain construction, based on configuration, right? What did you mean by "fine grain&

Re: [Xen-devel] [PATCH v1 1/6] arm: add SMC wrapper that is compatible with SMCCC

2018-08-23 Thread Volodymyr Babchuk
Hi, On 22.08.18 19:46, Julien Grall wrote: Hi Volodymyr, On 22/08/18 15:11, Volodymyr Babchuk wrote: 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 need a call that is fully compatible

Re: [Xen-devel] [PATCH 5/6] xen/arm: smccc: Add wrapper to automatically select the calling convention

2018-08-28 Thread Volodymyr Babchuk
Hi Julien, On 28.08.18 17:05, Julien Grall wrote: Hi Volodymyr, On 27/08/18 17:50, Volodymyr Babchuk wrote: On 27.08.18 18:29, Julien Grall wrote: On 27/08/2018 15:15, Volodymyr Babchuk wrote: On 24.08.18 19:58, Julien Grall wrote: Signed-off-by: Julien Grall This is indeed increasing

Re: [Xen-devel] [PATCH 5/6] xen/arm: smccc: Add wrapper to automatically select the calling convention

2018-08-28 Thread Volodymyr Babchuk
Hi Julien, On 28.08.18 18:27, Julien Grall wrote: Hi Volodymyr, On 28/08/18 16:10, Volodymyr Babchuk wrote: On 28.08.18 17:43, Julien Grall wrote: [...] I have looked at cpus_have_const_cap() and haven't found good way to optimize it with the current infrastructure in Xen. Feel free

Re: [Xen-devel] [PATCH 5/6] xen/arm: smccc: Add wrapper to automatically select the calling convention

2018-08-28 Thread Volodymyr Babchuk
ranch will be taken if the branch is a conditional backwards branch or not taken if the branch is a conditional forwards branch." [1] [1] http://linuxkernelhacker.blogspot.com/2014/07/branch-prediction-logic-in-arm.html -- Volodymyr Babchuk ___

Re: [Xen-devel] [PATCH v1 1/6] arm: add SMC wrapper that is compatible with SMCCC

2018-08-27 Thread Volodymyr Babchuk
your e-mail address. So I added you to To: list. Now I tried add_mandainers.pl and it nevertheless adds you to CCs. So, I'm really sorry bothering you. But probably you might want to fix mentioned scripts/MAINTAINERS file, to make sure you will never receive unwanted emails? -- Volodymyr

Re: [Xen-devel] [PATCH v1 2/6] arm: add generic TEE mediator framework

2018-08-27 Thread Volodymyr Babchuk
printing a warning seems a bit too much. I can change this to INFO. Or it is better to remove this print at all? Thank you for review, BTW. -- Volodymyr Babchuk ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.or

Re: [Xen-devel] [PATCH 5/6] xen/arm: smccc: Add wrapper to automatically select the calling convention

2018-08-27 Thread Volodymyr Babchuk
smccc_1_1_smc() because it is being constructed inline every time. But we can write it explicitly and then have one indirect call to (maybe cached) function instead of lots inlined code with conditional branches. #endif /* __ASSEMBLY__ */ -- Volo

[Xen-devel] [PATCH v1 6/6] xsm: add tee access policy support

2018-08-22 Thread Volodymyr Babchuk
ple security context domU_with_tee_t was added. Signed-off-by: Volodymyr Babchuk --- tools/flask/policy/modules/dom0.te | 3 +++ tools/flask/policy/modules/domU_with_tee.te | 23 +++ tools/flask/policy/modules/modules.conf | 1 + tools/flask/policy/modules/x

[Xen-devel] [PATCH v1 3/6] arm: tee: add OP-TEE header files

2018-08-22 Thread Volodymyr Babchuk
/) and mangled a bit to compile with XEN. Signed-off-by: Volodymyr Babchuk --- Changes from "RFC": - moved headers to include/asm-arm/tee xen/include/asm-arm/tee/optee_msg.h | 444 +++ xen/include/asm-arm/tee/optee_smc.h | 457 +

[Xen-devel] [PATCH v1 0/6] TEE mediator (and OP-TEE) support in XEN

2018-08-22 Thread Volodymyr Babchuk
with TEEs. Also I changed way 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 Volodymyr Babchuk (6): arm: add SMC wrapper

[Xen-devel] [PATCH v1 2/6] arm: add generic TEE mediator framework

2018-08-22 Thread Volodymyr Babchuk
which TEE is installed on the platform. Then generic vSMC handler will call selected mediator when it intercept SMC that belongs to TEE OS or TEE application. Also, there are hooks for domain construction and destruction, so TEE mediator can inform TEE about VM lifecycle. Signed-off-by: Volodym

[Xen-devel] [PATCH v1 5/6] libxl: create DTS node for OP-TEE if it is enabled

2018-08-22 Thread Volodymyr Babchuk
Signed-off-by: Volodymyr Babchuk --- tools/libxl/libxl_arm.c | 29 + tools/libxl/libxl_create.c | 1 + tools/libxl/libxl_types.idl | 1 + tools/xl/xl_parse.c | 1 + 4 files changed, 32 insertions(+) diff --git a/tools/libxl/libxl_arm.c b/tools/libxl

Re: [Xen-devel] [PATCH 2/6] xen/arm: smccc-1.1: Handle function result as parameters

2018-08-27 Thread Volodymyr Babchuk
x2, x3, [x19, #16] 5bc: f9400bf3ldr x19, [sp, #16] 5c0: a8c27bfdldp x29, x30, [sp], #32 5c4: d65f03c0ret Reported-by: Stefano Stabellini Signed-off-by: Marc Zyngier Reviewed-by: Volodymyr Babchuk --- xen/includ

Re: [Xen-devel] [PATCH 6/6] xen/arm: Replace call_smc with arm_smccc_smc

2018-08-27 Thread Volodymyr Babchuk
rror(struct cpu_user_regs *regs); void do_trap_guest_serror(struct cpu_user_regs *regs); -- Volodymyr Babchuk ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH 1/6] xen/arm: smccc-1.1: Make return values unsigned long

2018-08-27 Thread Volodymyr Babchuk
a3, a4, res)\ __declare_arg_3(a0, a1, a2, a3, res); \ -register typeof(a4) r4 asm("r4") = a4 +register unsigned long r4 asm("r4") = a4 #define __declare_arg_5(a0, a1, a2, a3, a4, a5, res)\ __declare_arg_4(a0, a1, a2, a3, a4, res); \ -- Volodymyr Babchuk ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH 1/6] xen/arm: smccc-1.1: Make return values unsigned long

2018-08-27 Thread Volodymyr Babchuk
Julien, On 27.08.18 18:23, Julien Grall wrote: On 27/08/2018 15:03, Volodymyr Babchuk wrote: Hi  Julien, Marc Hi, On 24.08.18 19:58, Julien Grall wrote: From: Marc Zyngier An unfortunate consequence of having a strong typing for the input values to the SMC call is that it also affects

Re: [Xen-devel] [PATCH 5/6] xen/arm: smccc: Add wrapper to automatically select the calling convention

2018-08-27 Thread Volodymyr Babchuk
Hi, On 27.08.18 18:29, Julien Grall wrote: On 27/08/2018 15:15, Volodymyr Babchuk wrote: Hi Julien, Hi, On 24.08.18 19:58, Julien Grall wrote: Signed-off-by: Julien Grall ---   xen/arch/arm/psci.c  | 4   xen/include/asm-arm/cpufeature.h | 3 ++-   xen/include/asm-arm

Re: [Xen-devel] [PATCH 4/6] xen/arm: cpufeature: Add helper to check constant caps

2018-08-30 Thread Volodymyr Babchuk
\ +__ret; \ +}) + static inline void cpus_set_cap(unsigned int num) { if (num >= ARM_NCAPS) -- Volodymyr Babchuk ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] Dangling whitespaces in xen code

2018-08-29 Thread Volodymyr Babchuk
Hi Andrew, On 29.08.18 19:22, Andrew Cooper wrote: On 29/08/18 17:11, Volodymyr Babchuk wrote: Hello all, During xen hacking I often encounter white spaces at EOLs. It is quite annoying to see red marker in, say, xen/arch/arm/domctl.c:25 I used sed to create patch that removes all

[Xen-devel] Dangling whitespaces in xen code

2018-08-29 Thread Volodymyr Babchuk
[:space:]]*$//g" Problem is that patch is quite big: 285 files changed, 1463 insertions(+), 1463 deletions(-) So what is the best way to publish this fix? I can just send it to ML as one patch. There is no functional changes, so should I add maintainers?

Re: [Xen-devel] [PATCH 0/6] xen/arm: SMCCC fixup and improvement

2018-08-30 Thread Volodymyr Babchuk
1.1. So you can have my Tested-by: Volodymyr Babchuk for this this 6 patches. Cheers, Julien Grall (3): xen/arm: cpufeature: Add helper to check constant caps xen/arm: smccc: Add wrapper to automatically select the calling convention xen/arm: Replace call_smc with arm_smccc_smc

Re: [Xen-devel] [PATCH 5/6] xen/arm: smccc: Add wrapper to automatically select the calling convention

2018-08-30 Thread Volodymyr Babchuk
c(__VA_ARGS__); \ +} while ( 0 ) #endif /* CONFIG_ARM_64 */ #endif /* __ASSEMBLY__ */ -- Volodymyr Babchuk ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

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

2018-09-05 Thread Volodymyr Babchuk
Hi, On 05.09.18 16:16, Julien Grall wrote: Hi, On 09/05/2018 01:17 PM, Volodymyr Babchuk wrote: On 04.09.18 22:48, Julien Grall wrote: On 09/03/2018 06:55 PM, Volodymyr Babchuk wrote: Hi Julien, Hi Volodymyr, On 03.09.18 20:38, Julien Grall wrote: Hi Volodymyr, On 03/09/18 17:54

Re: [Xen-devel] [PATCH v2 06/13] optee: add domain contexts

2018-09-05 Thread Volodymyr Babchuk
Hi, On 05.09.18 17:10, Julien Grall wrote: Hi, On 09/03/2018 05:54 PM, Volodymyr Babchuk wrote: OP-TEE meditor needs to store per-domain context, as will be seen s/meditor/mediator/ in the next patches. At this moment it stores only reference to domain. This allows us to filter out calls

Re: [Xen-devel] [PATCH v2 08/13] optee: add support for RPC SHM buffers

2018-09-10 Thread Volodymyr Babchuk
Hi Julien, On 10.09.18 16:01, Julien Grall wrote: Hi Volodymyr, On 03/09/18 17:54, Volodymyr Babchuk wrote: OP-TEE usually uses the same idea with command buffers (see previous commit) to issue RPC requests. Problem is that initially it has no buffer, where it can write request. So the first

Re: [Xen-devel] [PATCH v2 09/13] optee: add support for arbitrary shared memory

2018-09-10 Thread Volodymyr Babchuk
Hi, On 10.09.18 17:02, Julien Grall wrote: Hi, On 03/09/18 17:54, Volodymyr Babchuk wrote: Shared memory is widely used by NW to communicate with TAs in OP-TEE. NW can share part of own memory with TA or OP-TEE core, by registering it OP-TEE, or by providing a temporal refernce. Anyways

Re: [Xen-devel] [PATCH v2 07/13] optee: add std call handling

2018-09-10 Thread Volodymyr Babchuk
Hi Julien, On 05.09.18 18:17, Julien Grall wrote: Hi, On 09/03/2018 05:54 PM, Volodymyr Babchuk wrote: Main way to communicate with OP-TEE is to issue standard SMCCC NIT: The main way call. "Standard" is a SMCCC term and it means that call can be interrupted and OP-TEE can retu

Re: [Xen-devel] [PATCH v2 10/13] optee: add support for RPC commands

2018-09-10 Thread Volodymyr Babchuk
Hi, On 10.09.18 18:34, Julien Grall wrote: Hi Volodymyr, On 03/09/18 17:54, Volodymyr Babchuk wrote: OP-TEE can issue multiple RPC requests. We are interested mostly in request that asks NW to allocate/free shared memory for OP-TEE needs, becuase mediator need to do address translation

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

2018-09-05 Thread Volodymyr Babchuk
Hi Julien, On 04.09.18 22:48, Julien Grall wrote: On 09/03/2018 06:55 PM, Volodymyr Babchuk wrote: Hi Julien, Hi Volodymyr, On 03.09.18 20:38, Julien Grall wrote: Hi Volodymyr, On 03/09/18 17:54, Volodymyr Babchuk wrote: Add very basic OP-TEE mediator. It can probe for OP-TEE presence

Re: [Xen-devel] [PATCH v2 07/13] optee: add std call handling

2018-09-11 Thread Volodymyr Babchuk
On 11.09.18 14:19, Julien Grall wrote: On 10/09/18 18:37, Volodymyr Babchuk wrote: Hi Julien, Hi, On 05.09.18 18:17, Julien Grall wrote: Hi, On 09/03/2018 05:54 PM, Volodymyr Babchuk wrote: Main way to communicate with OP-TEE is to issue standard SMCCC NIT: The main way call

Re: [Xen-devel] [PATCH v1 1/6] arm: add SMC wrapper that is compatible with SMCCC

2018-08-30 Thread Volodymyr Babchuk
ither version 2 of the License, or (at your option) any later version". Do maintainers/code owners plan to update existing files? Also, are there any plans to switch to SPDX-Licence-Identifier? -- Volodymyr Babchuk ___ Xen-devel mailing list

[Xen-devel] [PATCH v2 12/13] xl: add "tee" option for xl.cfg

2018-09-03 Thread Volodymyr Babchuk
This boolean option controls if TEE access is enabled for the domain. If access is enabled, xl will call xc_dom_tee_enable(...) to ask hypervisor to enable TEE support. Signed-off-by: Volodymyr Babchuk --- docs/man/xl.cfg.pod.5.in| 10 ++ tools/libxl/libxl_arm.c | 30

[Xen-devel] [PATCH v2 13/13] lixl: arm: create optee firmware node in DT if tee=1

2018-09-03 Thread Volodymyr Babchuk
If TEE support is enabled with "tee=1" option in xl.cfg, then we need to inform guest about available TEE. Currently only OP-TEE is supported, so we'll create DT node in a way that is expected by optee driver in linux. Signed-off-by: Volodymyr Babchuk --- tools/libxl/libxl_

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

2018-09-03 Thread Volodymyr Babchuk
Hi Julien, On 03.09.18 20:38, Julien Grall wrote: Hi Volodymyr, On 03/09/18 17:54, Volodymyr Babchuk wrote: Add very basic OP-TEE mediator. It can probe for OP-TEE presence, tell it about domain creation/destuction and forward all known s/destuction/destruction/ calls. This is all what

[Xen-devel] [PATCH v2 02/13] domctl: add tee_op domctl

2018-09-03 Thread Volodymyr Babchuk
Currently this call used only to enable TEE support for a domain. It is planed to extend it when there will be multiple TEE mediators, so toolstack can determine which TEE is available on a platform. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/domctl.c | 10 ++ xen/include

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

2018-09-03 Thread Volodymyr Babchuk
From: Volodymyr Babchuk Hello all, This is v2 of patch series for OP-TEE mediator support in XEN. Changes from v1: - Added domctl interface, so now xl decides what domain should work with TEE - Removed XSM support due to change described above - Patch with OP-TEE mediator was splited to 7

[Xen-devel] [PATCH v2 01/13] arm: add generic TEE mediator framework

2018-09-03 Thread Volodymyr Babchuk
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. Curently TEE mediator is enabled only for Dom0. Signed-off-by: Volodymyr Babchuk --- Changes from v1: - Removed tee_remove(

[Xen-devel] [PATCH v2 08/13] optee: add support for RPC SHM buffers

2018-09-03 Thread Volodymyr Babchuk
guests. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/tee/optee.c | 121 ++- 1 file changed, 119 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c index 1008eba..6d6b51d 100644 --- a/xen/arch/arm/tee

[Xen-devel] [PATCH v2 06/13] optee: add domain contexts

2018-09-03 Thread Volodymyr Babchuk
OP-TEE meditor needs to store per-domain context, as will be seen in the next patches. At this moment it stores only reference to domain. This allows us to filter out calls from domains that are not allowed to work with OP-TEE. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/tee/optee.c | 66

[Xen-devel] [PATCH v2 09/13] optee: add support for arbitrary shared memory

2018-09-03 Thread Volodymyr Babchuk
will be unpinned. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/tee/optee.c | 245 ++- 1 file changed, 244 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c index 6d6b51d..8bfcfdc 100644 --- a/xen/arch/arm/tee

[Xen-devel] [PATCH v2 07/13] optee: add std call handling

2018-09-03 Thread Volodymyr Babchuk
alue is not RPC request. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/tee/optee.c | 319 ++- 1 file changed, 316 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c index c895a99..1008eba 100644 --- a/x

[Xen-devel] [PATCH v2 11/13] libxc: add xc_dom_tee_enable(...) function

2018-09-03 Thread Volodymyr Babchuk
This function uses XEN_DOMCTL_tee_op domctl to enable TEE support for a given domain. Signed-off-by: Volodymyr Babchuk --- tools/libxc/include/xenctrl.h | 7 +++ tools/libxc/xc_domain.c | 13 + 2 files changed, 20 insertions(+) diff --git a/tools/libxc/include/xenctrl.h

[Xen-devel] [PATCH v2 10/13] optee: add support for RPC commands

2018-09-03 Thread Volodymyr Babchuk
buffer, we need to shadow it in the same way, as we shadow request buffers for STD calls. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/tee/optee.c | 137 +++ 1 file changed, 126 insertions(+), 11 deletions(-) diff --git a/xen/arch/arm/tee/optee.c b

[Xen-devel] [PATCH v2 03/13] arm: tee: add OP-TEE header files

2018-09-03 Thread Volodymyr Babchuk
/) and mangled a bit to compile with XEN. Signed-off-by: Volodymyr Babchuk --- xen/include/asm-arm/tee/optee_msg.h | 444 +++ xen/include/asm-arm/tee/optee_smc.h | 457 2 files changed, 901 insertions(+) create mode 100644 xen

[Xen-devel] [PATCH v2 05/13] optee: add fast calls handling

2018-09-03 Thread Volodymyr Babchuk
, which it can share with OP-TEE. OP-TEE maps this memory dynamically, when it wants to access it. Because mediator can't share one static SHM region with all guests, it just disables it for all. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/tee/optee.c | 56

[Xen-devel] [PATCH v2 04/13] optee: add OP-TEE mediator skeleton

2018-09-03 Thread Volodymyr Babchuk
and can lead to spectacular results. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/tee/Kconfig| 4 ++ xen/arch/arm/tee/Makefile | 1 + xen/arch/arm/tee/optee.c| 134 xen/include/asm-arm/tee/optee_smc.h | 50

Re: [Xen-devel] [PATCH v2 10/13] optee: add support for RPC commands

2018-09-19 Thread Volodymyr Babchuk
Hi Julien, On 18.09.18 19:50, Julien Grall wrote: Hi Volodymyr, On 09/11/2018 07:58 PM, Volodymyr Babchuk wrote: On 11.09.18 16:56, Julien Grall wrote: On 10/09/18 19:14, Volodymyr Babchuk wrote: On 10.09.18 18:34, Julien Grall wrote: On 03/09/18 17:54, Volodymyr Babchuk wrote: 1. OP-TEE

Re: [Xen-devel] [PATCH v2 5/6] xen/arm: smccc: Add wrapper to automatically select the calling convention

2018-09-26 Thread Volodymyr Babchuk
Hi Julien, On 25.09.18 20:20, Julien Grall wrote: Signed-off-by: Julien Grall Reviewed-by: Volodymyr Babchuk --- Changes in v2: - Invert the condition - Add missing includes --- xen/arch/arm/psci.c | 4 xen/include/asm-arm/cpufeature.h | 3

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

  1   2   3   4   5   6   7   >