Re: [Xen-devel] Unable to create guest PV domain on OMAP5432

2017-11-17 Thread Volodymyr Babchuk
your DomU executes right now. This can help along with addr2line, objdump and other tools. - You can modify traps.c in XEN to crash domain when SMC instruction is trapped. Then you can put SMC invocation into various parts of kernel code, to see if it reaches that place. This can help on early sta

Re: [Xen-devel] [RFC 0/4] TEE mediator framework + OP-TEE mediator

2017-11-02 Thread Volodymyr Babchuk
On Thu, Nov 02, 2017 at 05:49:12PM +, Julien Grall wrote: Hi Julien, > On 02/11/17 16:53, Volodymyr Babchuk wrote: > >On Thu, Nov 02, 2017 at 01:17:26PM +, Julien Grall wrote: > >>On 24/10/17 20:02, Volodymyr Babchuk wrote: > >>>>>>>>If it

Re: [Xen-devel] [RFC 0/4] TEE mediator framework + OP-TEE mediator

2017-11-02 Thread Volodymyr Babchuk
On Thu, Nov 02, 2017 at 01:17:26PM +, Julien Grall wrote: Hi Julien, > On 24/10/17 20:02, Volodymyr Babchuk wrote: > >>>>>>If it is not safe, this means you have a whitelist solution and > >>>>>>therefore > >>>>>>

Re: [Xen-devel] [RFC 0/4] TEE mediator framework + OP-TEE mediator

2017-10-24 Thread Volodymyr Babchuk
here. Jens, if you want to catch up, you can find whole thread at [1]. On Tue, Oct 24, 2017 at 06:33:20PM +0100, Julien Grall wrote: > Hi, > > On 23/10/17 21:11, Volodymyr Babchuk wrote: > >On Mon, Oct 23, 2017 at 05:59:44PM +0100, Julien Grall wrote: > > > >>Hi Volody

Re: [Xen-devel] [RFC 0/4] TEE mediator framework + OP-TEE mediator

2017-10-24 Thread Volodymyr Babchuk
Hello Stefano On Mon, Oct 23, 2017 at 02:26:56PM -0700, Stefano Stabellini wrote: > > > >This is a lot of a work. It requires changes in generic parts of XEN. > > > >I fear it will be very hard to upstream such changes, because no one > > > >sees an immediate value in them. How do you think, what

Re: [Xen-devel] [RFC 0/4] TEE mediator framework + OP-TEE mediator

2017-10-23 Thread Volodymyr Babchuk
eassuring :) In my turn, I'm not totally against TEE mediators in stubdoms. I'm only concerned about required efforts. > On 20/10/17 18:37, Volodymyr Babchuk wrote: > >On Fri, Oct 20, 2017 at 02:11:14PM +0100, Julien Grall wrote: > >>On 17/10/17 16:59, Volodymyr Babchuk w

Re: [Xen-devel] [RFC 0/4] TEE mediator framework + OP-TEE mediator

2017-10-20 Thread Volodymyr Babchuk
among multiple stubdoms. WBR Volodymyr Babchuk ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [RFC 0/4] TEE mediator framework + OP-TEE mediator

2017-10-20 Thread Volodymyr Babchuk
On Fri, Oct 20, 2017 at 02:11:14PM +0100, Julien Grall wrote: > Hi Volodymyr, Hi Julien, > On 17/10/17 16:59, Volodymyr Babchuk wrote: > >On Mon, Oct 16, 2017 at 01:00:21PM +0100, Julien Grall wrote: > >> > >> > >>On 11/10/17 20:01, Volodymyr Babchuk wrote

Re: [Xen-devel] [RFC 4/4] arm: tee: add basic OP-TEE mediator

2017-10-19 Thread Volodymyr Babchuk
On Thu, Oct 19, 2017 at 05:12:17PM +0100, Julien Grall wrote: Hi Julien, > >>>+if ( rc < 0 ) > >>>+{ > >>>+gprintk(XENLOG_INFO, "OP-TEE: Can't map static shm for Dom0: > >>>%d", rc); > >> > >>gprintk already dump the domid. So no need to say Dom0. > >I

Re: [Xen-devel] [RFC 4/4] arm: tee: add basic OP-TEE mediator

2017-10-19 Thread Volodymyr Babchuk
On Thu, Oct 19, 2017 at 03:01:28PM +0100, Julien Grall wrote: > Hi Volodymyr, Hi Julien, [...] >>+} >>+ >>+static bool forward_call(struct cpu_user_regs *regs) >>+{ >>+register_t resp[4]; >>+ >>+call_smccc_smc(get_user_reg(regs, 0), >>+ ge

Re: [Xen-devel] [RFC 4/4] arm: tee: add basic OP-TEE mediator

2017-10-17 Thread Volodymyr Babchuk
On Tue, Oct 17, 2017 at 06:30:13PM +0100, Julien Grall wrote: > >>On 11/10/17 20:01, Volodymyr Babchuk wrote: > >>>Add basic OP-TEE mediator as an example how TEE mediator framework > >>>works. > >>> > >>>Currently it support only calls fro

Re: [Xen-devel] [RFC 2/4] arm: add generic TEE mediator framework

2017-10-17 Thread Volodymyr Babchuk
> >>>diff --git a/xen/arch/arm/tee/tee.c b/xen/arch/arm/tee/tee.c > >>>new file mode 100644 > >>>index 000..7f7a846 > >>>--- /dev/null > >>>+++ b/xen/arch/arm/tee/tee.c > >>>@@ -0,0 +1,134 @@ > >>>+/* > >&g

Re: [Xen-devel] [RFC 4/4] arm: tee: add basic OP-TEE mediator

2017-10-17 Thread Volodymyr Babchuk
On Mon, Oct 16, 2017 at 03:36:38PM +0100, Julien Grall wrote: > Hi Volodymyr, Hi Julien, > On 11/10/17 20:01, Volodymyr Babchuk wrote: > >Add basic OP-TEE mediator as an example how TEE mediator framework > >works. > > > >Currently it support only calls from Dom0. C

Re: [Xen-devel] [RFC 3/4] arm: tee: add OP-TEE header files

2017-10-17 Thread Volodymyr Babchuk
On Mon, Oct 16, 2017 at 03:04:44PM +0100, Julien Grall wrote: > Hi Volodymyr, Hi Julien, > On 11/10/17 20:01, Volodymyr Babchuk wrote: > >This header files describe protocol between OP-TEE and OP-TEE client > >driver in Linux. They are needed for upcomient OP-TEE mediator, wh

Re: [Xen-devel] [RFC 2/4] arm: add generic TEE mediator framework

2017-10-17 Thread Volodymyr Babchuk
framework. During registration it provides supported SMC fn ranges. This is for case when TEE is not SMCCC-compatible and uses function numbers outside ARM_SMCCC_OWNER_TRUSTED_OS range. > > > >Also, there are hooks for domain construction and destruction, so > >TEE media

Re: [Xen-devel] [RFC 0/4] TEE mediator framework + OP-TEE mediator

2017-10-17 Thread Volodymyr Babchuk
On Mon, Oct 16, 2017 at 01:00:21PM +0100, Julien Grall wrote: > > > On 11/10/17 20:01, Volodymyr Babchuk wrote: > >Hello all, > > Hi Volodymyr, Hi Julien > > > > >I want to present TEE mediator, that was discussed earlier ([1]). > > > >I selected

[Xen-devel] [RFC 0/4] TEE mediator framework + OP-TEE mediator

2017-10-11 Thread Volodymyr Babchuk
mediator support only calls from Dom0, but does this in full extent. All OP-TEE tests was passed. I tested this on my Renesas Salvator X M3 board. Also, I'm ready to be maintainer of this TEE mediators, if there are no objections. [1] https://marc.info/?l=xen-devel&m=148002191906172&w

[Xen-devel] [RFC 3/4] arm: tee: add OP-TEE header files

2017-10-11 Thread Volodymyr Babchuk
mangled a bit to compile with XEN. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/tee/optee_msg.h | 444 + xen/arch/arm/tee/optee_smc.h | 457 +++ 2 files changed, 901 insertions(+) create mode 100644 xen/arch

[Xen-devel] [RFC 2/4] arm: add generic TEE mediator framework

2017-10-11 Thread Volodymyr Babchuk
tializes one of built-in mediators. 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: Vo

[Xen-devel] [RFC 4/4] arm: tee: add basic OP-TEE mediator

2017-10-11 Thread Volodymyr Babchuk
-by: Volodymyr Babchuk --- xen/arch/arm/tee/Kconfig | 4 ++ xen/arch/arm/tee/Makefile | 1 + xen/arch/arm/tee/optee.c | 178 ++ 3 files changed, 183 insertions(+) create mode 100644 xen/arch/arm/tee/optee.c diff --git a/xen/arch/arm/tee/Kconfig b

[Xen-devel] [RFC 1/4] arm: add SMC wrapper that is compatible with SMCCC

2017-10-11 Thread Volodymyr Babchuk
. Iglesias ([1]), but looks like it is abandoned. [1] https://lists.xenproject.org/archives/html/xen-devel/2017-02/msg00636.html CC: "Edgar E. Iglesias" Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/arm32/Makefile | 1 + xen/arch/arm/arm32/smc.S

Re: [Xen-devel] [PATCH v8 04/11] public: xen.h: add definitions for UUID handling

2017-10-11 Thread Volodymyr Babchuk
Hi jan On 11.10.17 11:07, Jan Beulich wrote: On 10.10.17 at 19:03, wrote: On 10.10.17 19:12, Jan Beulich wrote: On 10.10.17 at 17:52, wrote: +uint8_t a[16]; +} xen_uuid_t; + +/* + * XEN_DEFINE_UUID(0x00112233, 0x4455, 0x6677, 0x8899, + * 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xf

[Xen-devel] [PATCH v10 04/11] public: xen.h: add definitions for UUID handling

2017-10-11 Thread Volodymyr Babchuk
big-endian. The structure defined in this patch, unlike EFI_GUID, is compatible with the Linux kernel and libuuid. Signed-off-by: Volodymyr Babchuk --- * Added check `|| defined(__GNUC__) to #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) --- xen/include/public

[Xen-devel] [PATCH v9 04/11] public: xen.h: add definitions for UUID handling

2017-10-10 Thread Volodymyr Babchuk
and big-endian. The structure defined in this patch, unlike EFI_GUID, is compatible with the Linux kernel and libuuid. Signed-off-by: Volodymyr Babchuk --- * Fixed code formatting * Added parenthess around (xen_uuid_t)XEN_DEFINE_UUID_(..) --- xen/include/public/xen.h | 33

Re: [Xen-devel] [PATCH v8 04/11] public: xen.h: add definitions for UUID handling

2017-10-10 Thread Volodymyr Babchuk
Hello Jan, On 10.10.17 19:12, Jan Beulich wrote: On 10.10.17 at 17:52, wrote: --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -930,6 +930,39 @@ __DEFINE_XEN_GUEST_HANDLE(uint16, uint16_t); __DEFINE_XEN_GUEST_HANDLE(uint32, uint32_t); __DEFINE_XEN_GUEST_HANDLE(uint64, uint6

[Xen-devel] [PATCH v8 08/11] arm: traps: handle PSCI calls inside `vsmc.c`

2017-10-10 Thread Volodymyr Babchuk
existing APIs (ARM DEN 0028B, page 16), while newer PSCI 0.2 and later is defined as "standard secure service" with its own ranges (ARM DEN 0028B, page 18). Signed-off-by: Volodymyr Babchuk Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Oleksandr Tyshchenko Acked-by: Ju

[Xen-devel] [PATCH v8 11/11] public: add and enable XENFEAT_ARM_SMCCC_supported feature

2017-10-10 Thread Volodymyr Babchuk
means that it safe to invoke SMC/HVC calls that are compatible with SMC calling convention. Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall Acked-by: Jan Beulich --- xen/common/kernel.c | 3 +++ xen/include/public/features.h | 3 +++ 2 files changed, 6 insertions(+) diff --git

[Xen-devel] [PATCH v8 10/11] arm: vsmc: remove 64 bit mode check in PSCI handler

2017-10-10 Thread Volodymyr Babchuk
from 64 bit caller. This patch removes that extra check. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- * Dropped Stefano's R-b, added Julien's one. --- xen/arch/arm/vsmc.c | 62 ++--- 1 file changed, 26 insertions(+), 36

[Xen-devel] [PATCH v8 09/11] arm: PSCI: use definitions provided by asm/smccc.h

2017-10-10 Thread Volodymyr Babchuk
ll be constructed using generic macros from smccc.h. Function psci_mode_check() in vsmc.c will be removed in a next patch, so there are no need to review it. I had to rework it, because PSCI_0_2_64BIT definition is dropped now. Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- xen/arc

[Xen-devel] [PATCH v8 07/11] arm: smccc: handle SMCs according to SMCCC

2017-10-10 Thread Volodymyr Babchuk
SMC is forwarded to standard SMCCC handler, it can be routed to a domain monitor, if one is installed. Signed-off-by: Volodymyr Babchuk Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Oleksandr Tyshchenko Acked-by: Julien Grall --- xen/arch/arm/Makefile | 1 + xen/arch/arm

[Xen-devel] [PATCH v8 06/11] arm: add SMCCC protocol definitions

2017-10-10 Thread Volodymyr Babchuk
acros were converted to inlined functions to ease parsing. They can be used by both SMCCC clients (like PSCI) and by SMCCC servers (like vPSCI or upcoming generic SMCCC handler). Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- xen/include/asm-arm/smc

[Xen-devel] [PATCH v8 04/11] public: xen.h: add definitions for UUID handling

2017-10-10 Thread Volodymyr Babchuk
big-endian. The structure defined in this patch, unlike EFI_GUID, is compatible with the Linux kernel and libuuid. Signed-off-by: Volodymyr Babchuk --- * Changed commit message ("NB:" part). Thanks to George Dunlap for suggestion. --- xen/include/public/

[Xen-devel] [PATCH v8 05/11] arm: processor.h: add definition for immediate value mask

2017-10-10 Thread Volodymyr Babchuk
This patch defines HSR_XXC_IMM_MASK. It can be used to extract immediate value for trapped HVC32, HVC64, SMC64, SVC32, SVC64 instructions, as described in the ARM ARM (ARM DDI 0487B.a pages D7-2270, D7-2272). Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- xen/include/asm-arm

[Xen-devel] [PATCH v8 02/11] arm: traps: use generic register accessors in the PSCI code

2017-10-10 Thread Volodymyr Babchuk
There are standard functions set_user_reg() and get_user_reg(). We can use them in PSCI_SET_RESULT()/PSCI_ARG() macros instead of relying on CONFIG_ARM_64 definition. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- xen/arch/arm/traps.c | 38

[Xen-devel] [PATCH v8 03/11] arm: traps: check if SMC was conditional before handling it

2017-10-10 Thread Volodymyr Babchuk
Trapped SMC instruction can fail condition check on ARMv8 architecture (ARM DDI 0487B.a page D7-2271). So we need to check if condition was meet. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- xen/arch/arm/traps.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/xen

[Xen-devel] [PATCH v8 00/11] Handle SMCs and HVCs in conformance with SMCCC

2017-10-10 Thread Volodymyr Babchuk
guest can tell if PSCI calls are handled by hypervisor or by, say, ARM TF. Also those patches are needed for upcoming TEE support. --- Volodymyr Babchuk (11): arm: traps: use only least 32 bits of fid in PSCI handler arm: traps: use generic register accessors in the PSCI code arm: traps

[Xen-devel] [PATCH v8 01/11] arm: traps: use only least 32 bits of fid in PSCI handler

2017-10-10 Thread Volodymyr Babchuk
According to SMCCC (ARM DEN 0028B, page 12), function id is stored in least 32 bits of r0/x0 register: The least significant 32-bits are used, and the most significant 32-bits are zero. Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- * Removed part of the quote from ARM

Re: [Xen-devel] [PATCH v7 04/11] public: xen.h: add definitions for UUID handling

2017-10-10 Thread Volodymyr Babchuk
Hi Julien, On 10.10.17 18:19, Julien Grall wrote: Hi, On 09/10/17 10:40, George Dunlap wrote: On 10/05/2017 03:50 PM, Volodymyr Babchuk wrote: Hi Konrad, On 05.10.17 16:03, Konrad Rzeszutek Wilk wrote: On Thu, Oct 05, 2017 at 12:00:20AM +0300, Volodymyr Babchuk wrote: Added type

Re: [Xen-devel] [PATCH v7 04/11] public: xen.h: add definitions for UUID handling

2017-10-05 Thread Volodymyr Babchuk
Hi Konrad, On 05.10.17 16:03, Konrad Rzeszutek Wilk wrote: On Thu, Oct 05, 2017 at 12:00:20AM +0300, Volodymyr Babchuk wrote: Added type xen_uuid_t. This type represents UUID as an array of 16 bytes in big endian format. Added macro XEN_DEFINE_UUID that constructs UUID in the usual way

[Xen-devel] [PATCH v7 10/11] arm: vsmc: remove 64 bit mode check in PSCI handler

2017-10-04 Thread Volodymyr Babchuk
from 64 bit caller. This patch removes that extra check. Signed-off-by: Volodymyr Babchuk Reviewed-by: Stefano Stabellini --- xen/arch/arm/vsmc.c | 62 ++--- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/xen/arch/arm/vsmc.c b/xen

[Xen-devel] [PATCH v7 11/11] public: add and enable XENFEAT_ARM_SMCCC_supported feature

2017-10-04 Thread Volodymyr Babchuk
means that it safe to invoke SMC/HVC calls that are compatible with SMC calling convention. Signed-off-by: Volodymyr Babchuk --- xen/common/kernel.c | 3 +++ xen/include/public/features.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/xen/common/kernel.c b/xen/common/kernel.c

[Xen-devel] [PATCH v7 06/11] arm: add SMCCC protocol definitions

2017-10-04 Thread Volodymyr Babchuk
acros were converted to inlined functions to ease parsing. They can be used by both SMCCC clients (like PSCI) and by SMCCC servers (like vPSCI or upcoming generic SMCCC handler). Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- xen/include/asm-arm/smc

[Xen-devel] [PATCH v7 08/11] arm: traps: handle PSCI calls inside `vsmc.c`

2017-10-04 Thread Volodymyr Babchuk
existing APIs (ARM DEN 0028B, page 16), while newer PSCI 0.2 and later is defined as "standard secure service" with its own ranges (ARM DEN 0028B, page 18). Signed-off-by: Volodymyr Babchuk Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Oleksandr Tyshchenko --- * Used least 32 bi

[Xen-devel] [PATCH v7 09/11] arm: PSCI: use definitions provided by asm/smccc.h

2017-10-04 Thread Volodymyr Babchuk
ll be constructed using generic macros from smccc.h. Function psci_mode_check() in vsmc.c will be removed in a next patch, so there are no need to review it. I had to rework it, because PSCI_0_2_64BIT definition is dropped now. Signed-off-by: Volodymyr Babchuk --- * Fixed indentation for #d

[Xen-devel] [PATCH v7 07/11] arm: smccc: handle SMCs according to SMCCC

2017-10-04 Thread Volodymyr Babchuk
SMC is forwarded to standard SMCCC handler, it can be routed to a domain monitor, if one is installed. Signed-off-by: Volodymyr Babchuk Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Oleksandr Tyshchenko Acked-by: Julien Grall --- xen/arch/arm/Makefile | 1 + xen/arch/arm

[Xen-devel] [PATCH v7 05/11] arm: processor.h: add definition for immediate value mask

2017-10-04 Thread Volodymyr Babchuk
This patch defines HSR_XXC_IMM_MASK. It can be used to extract immediate value for trapped HVC32, HVC64, SMC64, SVC32, SVC64 instructions, as described in the ARM ARM (ARM DDI 0487B.a pages D7-2270, D7-2272). Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- xen/include/asm-arm

[Xen-devel] [PATCH v7 02/11] arm: traps: use generic register accessors in the PSCI code

2017-10-04 Thread Volodymyr Babchuk
There are standard functions set_user_reg() and get_user_reg(). We can use them in PSCI_SET_RESULT()/PSCI_ARG() macros instead of relying on CONFIG_ARM_64 definition. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- xen/arch/arm/traps.c | 38

[Xen-devel] [PATCH v7 00/11] Handle SMCs and HVCs in conformance with SMCCC

2017-10-04 Thread Volodymyr Babchuk
series guest can query hypervisor in a standard way to determine which virtualization system is used. The same applies to PSCI calls. Now guest can tell if PSCI calls are handled by hypervisor or by, say, ARM TF. Also those patches are needed for upcoming TEE support. --- Volodymyr Babchuk (11):

[Xen-devel] [PATCH v7 04/11] public: xen.h: add definitions for UUID handling

2017-10-04 Thread Volodymyr Babchuk
little-endian, some are big-endian). Signed-off-by: Volodymyr Babchuk --- * Fixed example for XEN_DEFINE_UUID() usage. Was XEN_DEFINE_UUID(0x00112233, 0x4455, 0x6677, 0x8899, 0xaabbccddeeff) * Added comment to xen.h * Used #if defined (__STDC_VERSION__) && __STDC_VERSION__ &g

[Xen-devel] [PATCH v7 03/11] arm: traps: check if SMC was conditional before handling it

2017-10-04 Thread Volodymyr Babchuk
Trapped SMC instruction can fail condition check on ARMv8 architecture (ARM DDI 0487B.a page D7-2271). So we need to check if condition was meet. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- xen/arch/arm/traps.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/xen

[Xen-devel] [PATCH v7 01/11] arm: traps: use only least 32 bits of fid in PSCI handler

2017-10-04 Thread Volodymyr Babchuk
According to SMCCC (ARM DEN 0028B, page 12), function id is stored in least 32 bits of r0/x0 register: The least significant 32-bits are used, and the most significant 32-bits are zero. Implementations must ignore the least significant bits. Signed-off-by: Volodymyr Babchuk --- xen

Re: [Xen-devel] [PATCH v6 08/10] arm: PSCI: use definitions provided by asm/smccc.h

2017-10-04 Thread Volodymyr Babchuk
Hi Julien, On 03.10.17 16:18, Julien Grall wrote: Hi Volodymyr, On 21/09/17 21:00, Volodymyr Babchuk wrote: diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c index 34ee97e..be4e8e6 100644 --- a/xen/arch/arm/psci.c +++ b/xen/arch/arm/psci.c @@ -31,9 +31,9 @@ * (native-width) function

[Xen-devel] [PATCH v6 08/10] arm: PSCI: use definitions provided by asm/smccc.h

2017-09-21 Thread Volodymyr Babchuk
ll be constructed using generic macros from smccc.h. Function psci_mode_check() in vsmc.c will be removed in a next patch, so there are no need to review it. I had to rework it, because PSCI_0_2_64BIT definition is dropped now. Signed-off-by: Volodymyr Babchuk --- * Fixed indentation for PSCI_0_2

[Xen-devel] [PATCH v6 10/10] public: add and enable XENFEAT_ARM_SMCCC_supported feature

2017-09-21 Thread Volodymyr Babchuk
means that it safe to invoke SMC/HVC calls that are compatible with SMC calling convention. Signed-off-by: Volodymyr Babchuk --- xen/common/kernel.c | 3 +++ xen/include/public/features.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/xen/common/kernel.c b/xen/common/kernel.c

[Xen-devel] [PATCH v6 09/10] arm: vsmc: remove 64 bit mode check in PSCI handler

2017-09-21 Thread Volodymyr Babchuk
from 64 bit caller. This patch removes that extra check. Signed-off-by: Volodymyr Babchuk Reviewed-by: Stefano Stabellini --- xen/arch/arm/vsmc.c | 62 ++--- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/xen/arch/arm/vsmc.c b/xen

[Xen-devel] [PATCH v6 06/10] arm: smccc: handle SMCs according to SMCCC

2017-09-21 Thread Volodymyr Babchuk
SMC is forwarded to standard SMCCC handler, it can be routed to a domain monitor, if one is installed. Signed-off-by: Volodymyr Babchuk Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Oleksandr Tyshchenko --- * Added helepers fill_revision() and fill_function_call_count() * Renamed fill_uuid

[Xen-devel] [PATCH v6 07/10] arm: traps: handle PSCI calls inside `vsmc.c`

2017-09-21 Thread Volodymyr Babchuk
existing APIs (ARM DEN 0028B, page 16), while newer PSCI 0.2 and later is defined as "standard secure service" with its own ranges (ARM DEN 0028B, page 18). Signed-off-by: Volodymyr Babchuk Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Oleksandr Tyshchenko --- * Fixed aligning of SSSC

[Xen-devel] [PATCH v6 03/10] public: xen.h: add definitions for UUID handling

2017-09-21 Thread Volodymyr Babchuk
). Signed-off-by: Volodymyr Babchuk --- * Fixed commit message (added 0x in XEN_DEFINE_UUID usage example) * As was agreed with Julien Grail ([1]), added two flavours of XEN_DEFINE_UUID(). One of them casts initialization list to right type (if compiler supports this), another - does not. [1

[Xen-devel] [PATCH v6 00/10] Handle SMCs and HVCs in conformance with SMCCC

2017-09-21 Thread Volodymyr Babchuk
PSCI calls. Now guest can tell if PSCI calls are handled by hypervisor or by, say, ARM TF. Also those patches are needed for upcoming TEE support. --- Volodymyr Babchuk (10): arm: traps: use generic register accessors in the PSCI code arm: traps: check if SMC was conditional before ha

[Xen-devel] [PATCH v6 04/10] arm: processor.h: add definition for immediate value mask

2017-09-21 Thread Volodymyr Babchuk
This patch defines HSR_XXC_IMM_MASK. It can be used to extract immediate value for trapped HVC32, HVC64, SMC64, SVC32, SVC64 instructions, as described in the ARM ARM (ARM DDI 0487B.a pages D7-2270, D7-2272). Signed-off-by: Volodymyr Babchuk Acked-by: Julien Grall --- xen/include/asm-arm

[Xen-devel] [PATCH v6 05/10] arm: add SMCCC protocol definitions

2017-09-21 Thread Volodymyr Babchuk
acros were converted to inlined functions to ease parsing. They can be used by both SMCCC clients (like PSCI) and by SMCCC servers (like vPSCI or upcoming generic SMCCC handler). Signed-off-by: Volodymyr Babchuk --- * Added reference to original code from the Linux Kernel --- xen/include/asm-arm/smc

[Xen-devel] [PATCH v6 02/10] arm: traps: check if SMC was conditional before handling it

2017-09-21 Thread Volodymyr Babchuk
Trapped SMC instruction can fail condition check on ARMv8 architecture (ARM DDI 0487B.a page D7-2271). So we need to check if condition was meet. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- xen/arch/arm/traps.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/xen

[Xen-devel] [PATCH v6 01/10] arm: traps: use generic register accessors in the PSCI code

2017-09-21 Thread Volodymyr Babchuk
There are standard functions set_user_reg() and get_user_reg(). We can use them in PSCI_SET_RESULT()/PSCI_ARG() macros instead of relying on CONFIG_ARM_64 definition. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- xen/arch/arm/traps.c | 38

Re: [Xen-devel] [PATCH v5 08/10] arm: PSCI: use definitions provided by asm/smccc.h

2017-09-21 Thread Volodymyr Babchuk
Hi Julien, On 13.09.17 14:58, Julien Grall wrote: diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c index 34ee97e..be4e8e6 100644 --- a/xen/arch/arm/psci.c +++ b/xen/arch/arm/psci.c @@ -31,9 +31,9 @@ * (native-width) function ID. */ #ifdef CONFIG_ARM_64 -#define PSCI_0_2_FN_NATIVE(n

Re: [Xen-devel] [PATCH v5 06/10] arm: smccc: handle SMCs according to SMCCC

2017-09-20 Thread Volodymyr Babchuk
On 20.09.17 23:02, Julien Grall wrote: On 20/09/2017 19:11, Volodymyr Babchuk wrote: On 20.09.17 20:21, Julien Grall wrote: On 19/09/17 22:44, Volodymyr Babchuk wrote: Hi Julien, Hi Volodymyr, On 13.09.17 14:11, Julien Grall wrote: Hi, On 08/31/2017 09:09 PM, Volodymyr Babchuk

Re: [Xen-devel] [PATCH v5 06/10] arm: smccc: handle SMCs according to SMCCC

2017-09-20 Thread Volodymyr Babchuk
Hi Julien, On 20.09.17 20:21, Julien Grall wrote: > > > On 19/09/17 22:44, Volodymyr Babchuk wrote: >> Hi Julien, > > Hi Volodymyr, > >> >> On 13.09.17 14:11, Julien Grall wrote: >>> Hi, >>> >>> On 08/31/2017 09:09 PM, Volodymyr Bab

Re: [Xen-devel] [PATCH v5 06/10] arm: smccc: handle SMCs according to SMCCC

2017-09-19 Thread Volodymyr Babchuk
Hi Julien, On 13.09.17 14:11, Julien Grall wrote: Hi, On 08/31/2017 09:09 PM, Volodymyr Babchuk wrote: +static void fill_uuid(struct cpu_user_regs *regs, const xen_uuid_t *u) Actually why do you pass a pointer for u? This requires every caller to introduce temporary variable because the

[Xen-devel] [PATCH v5 10/10] public: add and enable XENFEAT_ARM_SMCCC_supported feature

2017-08-31 Thread Volodymyr Babchuk
means that it safe to invoke SMC/HVC calls that are compatible with SMC calling convention. Signed-off-by: Volodymyr Babchuk --- xen/common/kernel.c | 3 +++ xen/include/public/features.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/xen/common/kernel.c b/xen/common/kernel.c

[Xen-devel] [PATCH v5 09/10] arm: vsmc: remove 64 bit mode check in PSCI handler

2017-08-31 Thread Volodymyr Babchuk
from 64 bit caller. This patch removes that extra check. Signed-off-by: Volodymyr Babchuk Reviewed-by: Stefano Stabellini --- xen/arch/arm/vsmc.c | 62 ++--- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/xen/arch/arm/vsmc.c b/xen

[Xen-devel] [PATCH v5 06/10] arm: smccc: handle SMCs according to SMCCC

2017-08-31 Thread Volodymyr Babchuk
SMC is forwarded to standard SMCCC handler, it can be routed to a domain monitor, if one is installed. Signed-off-by: Volodymyr Babchuk Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Oleksandr Tyshchenko --- * reworked fill_uuid() function * dropped vsmc.h header. Function prototypes

[Xen-devel] [PATCH v5 07/10] arm: traps: handle PSCI calls inside `vsmc.c`

2017-08-31 Thread Volodymyr Babchuk
existing APIs (ARM DEN 0028B, page 16), while newer PSCI 0.2 and later is defined as "standard secure service" with its own ranges (ARM DEN 0028B, page 18). Signed-off-by: Volodymyr Babchuk Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Oleksandr Tyshchenko --- * handle_psci_0_x()

[Xen-devel] [PATCH v5 08/10] arm: PSCI: use definitions provided by asm/smccc.h

2017-08-31 Thread Volodymyr Babchuk
ll be constructed using generic macros from smccc.h. Function psci_mode_check() in vsmc.c will be removed in a next patch, so there are no need to review it. I had to rework it, because PSCI_0_2_64BIT definition is dropped now. Signed-off-by: Volodymyr Babchuk --- * removed #include from seat

[Xen-devel] [PATCH v5 02/10] arm: traps: check if SMC was conditional before handling it

2017-08-31 Thread Volodymyr Babchuk
Trapped SMC instruction can fail condition check on ARMv8 architecture (ARM DDI 0487B.a page D7-2271). So we need to check if condition was meet. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- * added Julien's R-b tag --- xen/arch/arm/traps.c | 6 ++ 1 file chang

[Xen-devel] [PATCH v5 03/10] public: xen.h: add definitions for UUID handling

2017-08-31 Thread Volodymyr Babchuk
-by: Volodymyr Babchuk --- * Array was wrapped into a structure --- xen/include/public/xen.h | 13 + 1 file changed, 13 insertions(+) diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index 2ac6b1e..3dc81e3 100644 --- a/xen/include/public/xen.h +++ b/xen/include

[Xen-devel] [PATCH v5 04/10] arm: processor.h: add definition for immediate value mask

2017-08-31 Thread Volodymyr Babchuk
This patch define HSR_XXC_IMM_MASK. It can be used to extract immediate value for trapped HVC32, HVC64, SMC64, SVC32, SVC64 instructions, as described in the ARM ARM (ARM DDI 0487B.a pages D7-2270, D7-2272). Signed-off-by: Volodymyr Babchuk --- * spelling fixes --- xen/include/asm-arm

[Xen-devel] [PATCH v5 01/10] arm: traps: use generic register accessors in the PSCI code

2017-08-31 Thread Volodymyr Babchuk
There are standard functions set_user_reg() and get_user_reg(). We can use them in PSCI_SET_RESULT()/PSCI_ARG() macros instead of relying on CONFIG_ARM_64 definition. Signed-off-by: Volodymyr Babchuk --- * removed 0x mask * coding style left unchanged, because it will be fixed in next

[Xen-devel] [PATCH v5 00/10] Handle SMCs and HVCs in conformance with SMCCC

2017-08-31 Thread Volodymyr Babchuk
y hypervisor in a standard way to determine which virtualization system is used. The same applies to PSCI calls. Now guest can tell if PSCI calls are handled by hypervisor or by, say, ARM TF. Also those patches are needed for upcoming TEE support. --- Volodymyr Babchuk (10): arm: traps: use g

[Xen-devel] [PATCH v5 05/10] arm: add SMCCC protocol definitions

2017-08-31 Thread Volodymyr Babchuk
(like PSCI) and by SMCCC servers (like vPSCI or upcoming generic SMCCC handler). Signed-off-by: Volodymyr Babchuk --- * Accessor macros were converted to inlined functions * ARM_SMCCC_SMC_{32,64} renamed to ARM_SMCCC_CONV_{32,64} * Fixed indentation for ARM_SMCCC_CALL_VAL --- xen/include/asm

Re: [Xen-devel] [PATCH v4 10/11] public: add XENFEAT_ARM_SMCCC_supported feature

2017-08-31 Thread Volodymyr Babchuk
Hi Sergej On 31.08.17 16:51, Sergej Proskurin wrote: Hi Volodymyr, On 08/31/2017 02:44 PM, Volodymyr Babchuk wrote: Hello Sergej, On 31.08.17 15:20, Sergej Proskurin wrote: Hi Volodymyr, hi Julien, On 08/24/2017 07:25 PM, Julien Grall wrote: On 21/08/17 21:27, Volodymyr Babchuk wrote

Re: [Xen-devel] [PATCH v4 03/11] public: xen.h: add definitions for UUID handling

2017-08-31 Thread Volodymyr Babchuk
On 31.08.17 15:53, Jan Beulich wrote: On 31.08.17 at 14:24, wrote: Hi Jan, On 31.08.17 10:34, Jan Beulich wrote: On 30.08.17 at 18:20, wrote: My first intention was to declare union with all possible representations, so it would be possible to access the same UUID as an array of bytes or,

Re: [Xen-devel] [PATCH v4 10/11] public: add XENFEAT_ARM_SMCCC_supported feature

2017-08-31 Thread Volodymyr Babchuk
Hello Sergej, On 31.08.17 15:20, Sergej Proskurin wrote: Hi Volodymyr, hi Julien, On 08/24/2017 07:25 PM, Julien Grall wrote: On 21/08/17 21:27, Volodymyr Babchuk wrote: This feature indicates that hypervisor is compatible with ARM SMC calling convention. Hypervisor will not inject an

Re: [Xen-devel] [PATCH v4 03/11] public: xen.h: add definitions for UUID handling

2017-08-31 Thread Volodymyr Babchuk
Hi Jan, On 31.08.17 10:34, Jan Beulich wrote: On 30.08.17 at 18:20, wrote: My first intention was to declare union with all possible representations, so it would be possible to access the same UUID as an array of bytes or, for example, as Microsoft GUID. Like this: typedef union { /* UU

Re: [Xen-devel] [PATCH v4 03/11] public: xen.h: add definitions for UUID handling

2017-08-30 Thread Volodymyr Babchuk
Hi Jan, On 23.08.17 14:29, Jan Beulich wrote: On 23.08.17 at 13:08, wrote: On 23.08.17 11:10, Jan Beulich wrote: On 22.08.17 at 16:37, wrote: I can't see why you want to map UUID to a certain structure. This is so that the type cannot mistakenly be passed to a function taking unsigned cha

Re: [Xen-devel] [PATCH v4 05/11] arm: add SMCCC protocol definitions.

2017-08-28 Thread Volodymyr Babchuk
Hi Julien, On 24.08.17 18:00, Julien Grall wrote: Hi Volodymyr, Title: No need for the full stop. On 21/08/17 21:27, Volodymyr Babchuk wrote: This patch adds generic definitions used in ARM SMC call convention. Those definitions was taken from linux header arm-smccc.h, extended and formatted

Re: [Xen-devel] [PATCH v4 08/11] arm: PSCI: use definitions provided by asm/smccc.h

2017-08-25 Thread Volodymyr Babchuk
Hi, On 24.08.17 20:22, Julien Grall wrote: Hi Volodymyr, On 21/08/17 21:27, Volodymyr Babchuk wrote: smccc.h provides definitions to construct SMC call function number according to SMCCC. We don't need multiple definitions for one thing, and definitions in smccc.h are more generic than

Re: [Xen-devel] [PATCH v4 07/11] arm: traps: handle PSCI calls inside `vsmc.c`

2017-08-25 Thread Volodymyr Babchuk
Hi Julien, Thanks for the review. On 24.08.17 19:58, Julien Grall wrote: Hi Volodymyr, On 21/08/17 21:27, Volodymyr Babchuk wrote: PSCI is part of HVC/SMC interface, so it should be handled in appropriate place: `vsmc.c`. This patch just moves PSCI handler calls from `traps.c` to `vsmc.c

Re: [Xen-devel] [PATCH v4 03/11] public: xen.h: add definitions for UUID handling

2017-08-23 Thread Volodymyr Babchuk
Hello Jan On 23.08.17 11:10, Jan Beulich wrote: On 22.08.17 at 16:37, wrote: I can't see why you want to map UUID to a certain structure. This is so that the type cannot mistakenly be passed to a function taking unsigned char *, or be assigned to a variable of that type. Right, I see the po

Re: [Xen-devel] [PATCH v4 03/11] public: xen.h: add definitions for UUID handling

2017-08-22 Thread Volodymyr Babchuk
Hi Jan, On 22.08.17 10:26, Jan Beulich wrote: On 21.08.17 at 22:27, wrote: --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -930,6 +930,15 @@ __DEFINE_XEN_GUEST_HANDLE(uint16, uint16_t); __DEFINE_XEN_GUEST_HANDLE(uint32, uint32_t); __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t

[Xen-devel] [PATCH v4 11/11] arm: enable XENFEAT_ARM_SMCCC_supported feature

2017-08-21 Thread Volodymyr Babchuk
As Xen now supports SMCCC, we can enable this feature to tell guests that it is safe to call generic SMCs and HVCs. Signed-off-by: Volodymyr Babchuk --- xen/common/kernel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/common/kernel.c b/xen/common/kernel.c index ce7cb8a..18c4d51

[Xen-devel] [PATCH v4 09/11] arm: vsmc: remove 64 bit mode check in PSCI handler

2017-08-21 Thread Volodymyr Babchuk
from 64 bit caller. This patch removes that extra check. Signed-off-by: Volodymyr Babchuk Reviewed-by: Stefano Stabellini --- * Used case xxx: { } formatting as Julien suggested --- xen/arch/arm/vsmc.c | 63 + 1 file

[Xen-devel] [PATCH v4 10/11] public: add XENFEAT_ARM_SMCCC_supported feature

2017-08-21 Thread Volodymyr Babchuk
This feature indicates that hypervisor is compatible with ARM SMC calling convention. Hypervisor will not inject an undefined instruction exception if an invalid SMC function were called and will not crash a domain if an invlalid HVC functions were called. Signed-off-by: Volodymyr Babchuk

[Xen-devel] [PATCH v4 08/11] arm: PSCI: use definitions provided by asm/smccc.h

2017-08-21 Thread Volodymyr Babchuk
y both use PSCI function numbers. Signed-off-by: Volodymyr Babchuk --- * Reworked definitions to minimize their lenght * Described why I replaced PSCI_0_2_FN_xxx with PSCI_0_2_FUNC_xxx --- xen/arch/arm/platforms/seattle.c | 5 +++-- xen/arch/arm/psci.c | 10 - xen/arch/

[Xen-devel] [PATCH v4 05/11] arm: add SMCCC protocol definitions.

2017-08-21 Thread Volodymyr Babchuk
handler). Signed-off-by: Volodymyr Babchuk --- xen/include/asm-arm/smccc.h | 92 + 1 file changed, 92 insertions(+) create mode 100644 xen/include/asm-arm/smccc.h diff --git a/xen/include/asm-arm/smccc.h b/xen/include/asm-arm/smccc.h new file mode 100644

[Xen-devel] [PATCH v4 06/11] arm: smccc: handle SMCs according to SMCCC

2017-08-21 Thread Volodymyr Babchuk
SMC is forwarded to standard SMCCC handler, it can be routed to a domain monitor, if one is installed. Signed-off-by: Volodymyr Babchuk Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Oleksandr Tyshchenko --- * Reworked UUID handling (due to new UUID type definition) * Renamed

[Xen-devel] [PATCH v4 07/11] arm: traps: handle PSCI calls inside `vsmc.c`

2017-08-21 Thread Volodymyr Babchuk
is defined as "standard secure service" with own ranges (ARM DEN 0028B, page 18). Signed-off-by: Volodymyr Babchuk Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Oleksandr Tyshchenko --- * Fixed mistakes about non-existant PSCI 2.0 * Added special SMC function number handling fo

[Xen-devel] [PATCH v4 04/11] arm: processor.h: add definition for immediate value mask

2017-08-21 Thread Volodymyr Babchuk
This patch adds definition HSR_XXC_IMM_MASK. It can be used to extract immediate value for trapped HVC32, HVC64, SMC64, SVC32, SVC64 instructions, as described at ARM ARM (ARM DDI 0487B.a pages D7-2270, D7-2272). Signed-off-by: Volodymyr Babchuk --- xen/include/asm-arm/processor.h | 3 +++ 1

[Xen-devel] [PATCH v4 02/11] arm: traps: check if SMC was conditional before handling it

2017-08-21 Thread Volodymyr Babchuk
Trapped SMC instruction can fail condition check on ARMv8 arhcitecture (ARM DDI 0487B.a page D7-2271). So we need to check if condition was meet. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/traps.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/arm/traps.c b/xen/arch

[Xen-devel] [PATCH v4 03/11] public: xen.h: add definitions for UUID handling

2017-08-21 Thread Volodymyr Babchuk
-by: Volodymyr Babchuk --- xen/include/public/xen.h | 9 + 1 file changed, 9 insertions(+) diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index 2ac6b1e..d1a4765 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -930,6 +930,15

[Xen-devel] [PATCH v4 01/11] arm: traps: use generic register accessors in the PSCI code

2017-08-21 Thread Volodymyr Babchuk
There are standard functions set_user_reg() and get_user_reg(). We can use them in PSCI_SET_RESULT()/PSCI_ARG() macroses instead of relying on CONFIG_ARM_64 definition. Signed-off-by: Volodymyr Babchuk --- * Added space into reg,n * Used 32-bit constant tin PSCI_ARG32 --- xen/arch/arm/traps.c

[Xen-devel] [PATCH v4 00/11] Handle SMCs and HVCs in conformance with SMCCC

2017-08-21 Thread Volodymyr Babchuk
EE support. --- Volodymyr Babchuk (11): arm: traps: use generic register accessors in the PSCI code arm: traps: check if SMC was conditional before handling it public: xen.h: add definitions for UUID handling arm: processor.h: add definition for immediate value mask arm: add SMCC

  1   2   3   >