Re: [Xen-devel] [PATCH 02/11] xen/arm: vpl011: Add new hvm params in Xen for ring buffer/event setup

2017-04-14 Thread Bhupinder Thakur
Hi Stefano, On 12 April 2017 at 03:37, Stefano Stabellini wrote: > On Tue, 11 Apr 2017, Bhupinder Thakur wrote: >> Hi, >> >> Kindly let me know if my understanding is correct. >> >> Using a domctl API will allow us to keep the vUART configuration >> fle

Re: [Xen-devel] [PATCH 01/10] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-04-19 Thread Bhupinder Thakur
Hi Stefano, Thanks for your comments. On 19 April 2017 at 05:45, Stefano Stabellini wrote: >> +static void vpl011_read_data(struct domain *d, uint8_t *data) >> +{ >> +unsigned long flags; >> +struct vpl011_s *vpl011=&d->arch.vpl011; > > The code style is: > > vpl011 = &d->arch.vpl011

Re: [Xen-devel] [PATCH 02/10] xen/arm: vpl011: Add new virtual console hvm params in Xen

2017-04-19 Thread Bhupinder Thakur
Hi Stefano, On 19 April 2017 at 05:52, Stefano Stabellini wrote: >> long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg) >> { >> @@ -61,9 +137,45 @@ long do_hvm_op(unsigned long op, >> XEN_GUEST_HANDLE_PARAM(void) arg) >> if ( op == HVMOP_set_param ) >> { >>

Re: [Xen-devel] [PATCH 04/10] xen/arm: vpl011: Provide a knob in libxl to enable/disable pl011 emulation

2017-04-19 Thread Bhupinder Thakur
Hi, On 19 April 2017 at 05:59, Stefano Stabellini wrote: > I think "console" is confusing an emulated device with xenconsole. > > I would use vuart=pl011 to clarify that we are specifying a new > component for emulation. Throughout the code, I am using "vconsole" or "vcon" as a prefix for most o

Re: [Xen-devel] [PATCH 05/10] xen/arm: vpl011: Allocate a new PFN in the toolstack for the virtual console

2017-04-19 Thread Bhupinder Thakur
Hi, On 19 April 2017 at 16:31, Julien Grall wrote: > There were some concerns on the first version about using HVM params because > this is tying the virtual UART to HVM and only allow us to have one virtual > console. > > HVM params are part of the stable ABI, so this would restrict ourselves to

Re: [Xen-devel] [PATCH 08/10] xen/arm: vpl011: Modify the APIs in xenconsole to acces both PV and VCON consoles

2017-04-24 Thread Bhupinder Thakur
Hi Wei Liu, Thanks for your comments. On 12 April 2017 at 22:03, Wei Liu wrote: > On Mon, Apr 03, 2017 at 03:14:31PM +0530, Bhupinder Thakur wrote: >> Xenconsole supports only PV console currently. To get access to emulated >> pl011 >> uart another backend console is requi

Re: [Xen-devel] [PATCH 01/10] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-04-25 Thread Bhupinder Thakur
On 20 April 2017 at 00:10, Stefano Stabellini wrote: > We don't have a formal protocol spec for PV console, but if we had, it > would say that the frontend (Xen in this case) should send notifications > every time there is new data to write. Thus, once per character in this > case. > > I would sta

Re: [Xen-devel] [PATCH 06/10] xen/arm: vpl011: Add new parameters to xenstore for the virtual console

2017-04-25 Thread Bhupinder Thakur
Hi Wei, >> } >> @@ -3159,6 +3162,13 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t >> domid, >> flexarray_append(ro_front, GCSPRINTF("%"PRIu32, >> state->console_port)); >> flexarray_append(ro_front, "ring-ref"); >> flexarray_append(ro_front, GCSPRINTF(

Re: [Xen-devel] [PATCH 01/10] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-04-26 Thread Bhupinder Thakur
Hi Stefano, >> > Regarding the optimization you introduced in this patch, delaying write >> > notifications until we receive a notification from xenconsoled, how many >> > notifications from xen to xenconsoled does it actually save? xenconsoled >> > is going to send a notification for every read:

Re: [Xen-devel] [PATCH 00/10] pl011 emulation support in Xen

2017-04-26 Thread Bhupinder Thakur
Hi Julien, >> tools/console/client/main.c | 6 + >> tools/console/daemon/io.c| 532 >> +++ >> tools/libxc/include/xc_dom.h | 3 + >> tools/libxc/xc_dom_arm.c | 7 +- >> tools/libxc/xc_dom_boot.c| 3 + >> tools/libxc/xc_

[Xen-devel] [PATCH 02/10 v2] xen/arm: vpl011: Add new vuart domctl interface to setup pfn and evtchn

2017-04-28 Thread Bhupinder Thakur
data on guest domain's behalf. Signed-off-by: Bhupinder Thakur --- Changes since v1: - Replaced the hvm interface with domctl interface tools/libxc/include/xenctrl.h | 26 ++ tools/libxc/xc_domain.c | 39 +++ xen/arc

[Xen-devel] [PATCH 03/10 v2] xen/arm: vpl011: Enable pl011 emulation for a guest domain in Xen

2017-04-28 Thread Bhupinder Thakur
: Bhupinder Thakur --- xen/arch/arm/domain.c | 6 ++ xen/common/domctl.c | 3 +++ xen/include/public/domctl.h | 2 ++ xen/include/xen/sched.h | 4 4 files changed, 15 insertions(+) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 76310ed..23baa81 100644

[Xen-devel] [PATCH 01/10 v2] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-04-28 Thread Bhupinder Thakur
/Server_Base_System_Architecture_v3_1_ARM_DEN_0029A.pdf Signed-off-by: Bhupinder Thakur --- Changes since v1: - Removed the optimiztion related to sendiing events to xenconsole - Use local variables as ring buffer indices while using the ring buffer xen/arch/arm/Kconfig | 5 + xen/arch/arm

[Xen-devel] [PATCH 05/10 v2] xen/arm: vpl011: Allocate a new PFN in the toolstack for vuart

2017-04-28 Thread Bhupinder Thakur
Allocate a new pfn and pass on to Xen using a domctl call. Signed-off-by: Bhupinder Thakur --- Changes since v1: - Replaced the hvm call with the domctl call to set the pfn. tools/libxc/include/xc_dom.h | 2 ++ tools/libxc/xc_dom_arm.c | 7 ++- tools/libxc/xc_dom_boot.c| 2 ++ 3

[Xen-devel] [PATCH 04/10 v2] xen/arm: vpl011: Add support for vuart in libxl

2017-04-28 Thread Bhupinder Thakur
the guest configuration file: vuart = "pl011" Signed-off-by: Bhupinder Thakur --- Changes since v1: - Modified the syntax for taking the pl011 as a console type in the configuration file. Now the syntax is vuart = "pl011". - Replaced the console type VCON with VUART, as it

[Xen-devel] [PATCH 07/10 v2] xen/arm: vpl011: Add support for vuart in xenconsole

2017-04-28 Thread Bhupinder Thakur
PV and VUART events. 5. Add a new log_file for VUART console logs. Signed-off-by: Bhupinder Thakur --- Changes since v1: - Split the domain struture to a separate console structure - Modified the functions to operate on the console struture - Replaced repetitive per console code with generic

[Xen-devel] [PATCH 06/10 v2] xen/arm: vpl011: Add vuart ring-buf and evtchn to xenstore

2017-04-28 Thread Bhupinder Thakur
: Bhupinder Thakur --- Changes since v1: - Modified the xenstore key names to /vuart/0/ring-ref and /vuart/0/port. - Replaced the hvm call with domctl call to get the event channel. tools/libxl/libxl_console.c | 10 ++ tools/libxl/libxl_dom.c | 4 2 files changed, 14 insertions

[Xen-devel] [PATCH 09/10 v2] xen/arm: vpl011: Add a pl011 uart DT node in the guest device tree

2017-04-28 Thread Bhupinder Thakur
irmware Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini --- Changes since v1: - Modified the code to increment nr_spis based on the SPI value reserved for vpl011. - Added a check to verify that physical irq assigment is not conflicting with vpl011 SPI. - Fixed minor ind

[Xen-devel] [PATCH 10/10 v2] xen/arm: vpl011: Update documentation for vuart console support

2017-04-28 Thread Bhupinder Thakur
1. Update documentation for vuart = "pl011" option added. 2. Update documentation about SPI irq reserved for vpl011. Signed-off-by: Bhupinder Thakur --- docs/man/xl.cfg.pod.5.in | 8 docs/misc/console.txt| 14 +- 2 files changed, 21 insertions(+), 1 deletio

[Xen-devel] [PATCH 00/10 v2] pl011 emulation support in Xen

2017-04-28 Thread Bhupinder Thakur
: url: ssh://g...@git.linaro.org:/people/bhupinder.thakur/xen.git branch: vpl011_v2 Bhupinder Thakur (10): xen/arm: vpl011: Add pl011 uart emulation in Xen xen/arm: vpl011: Add new vuart domctl interface to setup pfn and evtchn xen/arm: vpl011: Enable pl011 emulation for a guest domain in

[Xen-devel] [PATCH 08/10 v2] xen/arm: vpl011: Add a new vuart console type to xenconsole client

2017-04-28 Thread Bhupinder Thakur
Add a new console type VUART to connect to guest vuart. Signed-off-by: Bhupinder Thakur --- tools/console/client/main.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/console/client/main.c b/tools/console/client/main.c index 99f..ec5c6e1 100644 --- a/tools

Re: [Xen-devel] [PATCH 06/10 v2] xen/arm: vpl011: Add vuart ring-buf and evtchn to xenstore

2017-05-01 Thread Bhupinder Thakur
Hi Stefano, >> diff --git a/tools/libxl/libxl_console.c b/tools/libxl/libxl_console.c >> index 446e766..ef3bd44 100644 >> --- a/tools/libxl/libxl_console.c >> +++ b/tools/libxl/libxl_console.c >> @@ -67,6 +67,9 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int >> cons_num, >> cas

Re: [Xen-devel] [PATCH 02/10 v2] xen/arm: vpl011: Add new vuart domctl interface to setup pfn and evtchn

2017-05-02 Thread Bhupinder Thakur
Hi Jan, On 2 May 2017 at 13:09, Jan Beulich wrote: >>>> On 28.04.17 at 21:23, wrote: >> On Fri, 28 Apr 2017, Bhupinder Thakur wrote: >>> --- a/xen/include/public/domctl.h >>> +++ b/xen/include/public/domctl.h >>> @@ -1138,6 +1138,15 @@ struct xen

Re: [Xen-devel] [PATCH 02/10 v2] xen/arm: vpl011: Add new vuart domctl interface to setup pfn and evtchn

2017-05-02 Thread Bhupinder Thakur
Hi Jan, >> +case XEN_DOMCTL_vuart_op: >> +ret = -EOPNOTSUPP; >> +break; > > There should be no need for such an addition. This check was added to return a failure if user tries to call the vuart domctl in case of x86 (wrong user configuration). If this check is not there will

Re: [Xen-devel] [PATCH 03/10 v2] xen/arm: vpl011: Enable pl011 emulation for a guest domain in Xen

2017-05-02 Thread Bhupinder Thakur
Hi Jan, >> @@ -631,6 +632,9 @@ int arch_domain_create(struct domain *d, unsigned int >> domcr_flags, >> if ( (rc = domain_vtimer_init(d, config)) != 0 ) >> goto fail; >> >> +if ( domcr_flags & DOMCRF_vuart ) >> +if ( (rc = domain_vpl011_init(d, config)) != 0 ) >> +

Re: [Xen-devel] [PATCH 06/10 v2] xen/arm: vpl011: Add vuart ring-buf and evtchn to xenstore

2017-05-03 Thread Bhupinder Thakur
Hi, >> > It looks like you are reusing the libxl__device_console_add call for the >> > main PV console for the domain, to also add the vuart nodes to xenstore. >> > >> > I don't think it is a good idea to mix the two. I suggest to introduce a >> > new libxl__device call to introduce the vuart node

Re: [Xen-devel] [PATCH 06/10 v2] xen/arm: vpl011: Add vuart ring-buf and evtchn to xenstore

2017-05-04 Thread Bhupinder Thakur
Hi, >> >> > It looks like you are reusing the libxl__device_console_add call for the >> >> > main PV console for the domain, to also add the vuart nodes to xenstore. >> >> > >> >> > I don't think it is a good idea to mix the two. I suggest to introduce a >> >> > new libxl__device call to introduc

Re: [Xen-devel] [PATCH 03/10 v2] xen/arm: vpl011: Enable pl011 emulation for a guest domain in Xen

2017-05-05 Thread Bhupinder Thakur
Hi Julien, >>> Hi Jan, >>> > @@ -631,6 +632,9 @@ int arch_domain_create(struct domain *d, > unsigned int domcr_flags, > if ( (rc = domain_vtimer_init(d, config)) != 0 ) > goto fail; > > +if ( domcr_flags & DOMCRF_vuart ) > +if ( (rc = domain_vp

Re: [Xen-devel] [PATCH 06/10 v2] xen/arm: vpl011: Add vuart ring-buf and evtchn to xenstore

2017-05-05 Thread Bhupinder Thakur
Hi Stefano, >> >> >> > It looks like you are reusing the libxl__device_console_add call for >> >> >> > the >> >> >> > main PV console for the domain, to also add the vuart nodes to >> >> >> > xenstore. >> >> >> > >> >> >> > I don't think it is a good idea to mix the two. I suggest to >> >> >> >

Re: [Xen-devel] [PATCH 01/10 v2] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-05-05 Thread Bhupinder Thakur
Hi Julien, >> + >> +unsigned int vpl011_reg_mask[] = {0xff, 0x, 0x}; > > > This should be static. But I don't get what you need that. In the first > version, I suggested to re-purpose vgic_reg*_{extract,update} so we can use > it here. It would probably need to be renamed to vreg_reg*.

Re: [Xen-devel] [PATCH 01/10 v2] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-05-05 Thread Bhupinder Thakur
Hi Julien, +unsigned int vpl011_reg_mask[] = {0xff, 0x, 0x}; >>> >>> >>> >>> This should be static. But I don't get what you need that. In the first >>> version, I suggested to re-purpose vgic_reg*_{extract,update} so we can >>> use >>> it here. It would probably need to be rename

Re: [Xen-devel] [PATCH 06/10 v2] xen/arm: vpl011: Add vuart ring-buf and evtchn to xenstore

2017-05-07 Thread Bhupinder Thakur
Hi Stefano, >> >> >> >> > It looks like you are reusing the libxl__device_console_add call >> >> >> >> > for the >> >> >> >> > main PV console for the domain, to also add the vuart nodes to >> >> >> >> > xenstore. >> >> >> >> > >> >> >> >> > I don't think it is a good idea to mix the two. I sugg

Re: [Xen-devel] [PATCH 07/10 v2] xen/arm: vpl011: Add support for vuart in xenconsole

2017-05-07 Thread Bhupinder Thakur
Hi Stefano, On 29 April 2017 at 04:40, Stefano Stabellini wrote: > On Fri, 28 Apr 2017, Bhupinder Thakur wrote: >> Xenconsole supports only PV console currently. This patch adds support >> for vuart, which allows emulated pl011 uart to be accessed as a console. >> &

Re: [Xen-devel] [PATCH 03/10 v2] xen/arm: vpl011: Enable pl011 emulation for a guest domain in Xen

2017-05-07 Thread Bhupinder Thakur
Hi, >>> I was wondering whether it would be better to defer the PL011 creation to >>> a >>> domctl. This could be called after the domain is created with all the >>> information required (MMIO region, Console PFN...). >>> >>> This would also make the migration support more trivial as the we will >

Re: [Xen-devel] [PATCH 09/10 v2] xen/arm: vpl011: Add a pl011 uart DT node in the guest device tree

2017-05-07 Thread Bhupinder Thakur
Hi Julien, > On 28/04/17 17:01, Bhupinder Thakur wrote: >> >> The SBSA uart node format is as specified in >> Documentation/devicetree/bindings/serial/arm_sbsa_uart.txt and given >> below: >> >> ARM SBSA defined generic UART >> ---

[Xen-devel] [PATCH 00/12 v3] PL011 emulation support in Xen

2017-05-10 Thread Bhupinder Thakur
ents. The vpl011 changes available at the following repo: url: ssh://g...@git.linaro.org:/people/bhupinder.thakur/xen.git branch: vpl011_v3 Bhupinder Thakur (12): xen/arm: vpl011: Move vgic register access functions to vreg.h xen/arm: vpl011: Define generic vreg_reg* access functions in vreg.h

[Xen-devel] [PATCH 02/12 v3] xen/arm: vpl011: Define generic vreg_reg* access functions in vreg.h

2017-05-10 Thread Bhupinder Thakur
This patch redefines the vgic_reg* access functions to vreg_reg* functions. These are generic functions, which will be used by the vgic emulation code to access the vgic registers. PL011 emulation code will also use vreg_reg* access functions. Signed-off-by: Bhupinder Thakur --- xen/arch/arm

[Xen-devel] [PATCH 03/12 v3] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-05-10 Thread Bhupinder Thakur
/Server_Base_System_Architecture_v3_1_ARM_DEN_0029A.pdf Signed-off-by: Bhupinder Thakur --- Changes since v2: - Use generic vreg_reg* for read/write of registers emulating pl011. - Use generic ring buffer functions defined using DEFINE_XEN_FLEX_RING. - Renamed the SPI injection function to vpl011_update_spi

[Xen-devel] [PATCH 01/12 v3] xen/arm: vpl011: Move vgic register access functions to vreg.h

2017-05-10 Thread Bhupinder Thakur
These functions are generic in nature and can be reused by other emulation code in Xen. One recent example is pl011 emulation, which needs similar funictions to read/write the registers. This patch moves the register access function definitions from vgic.h to vreg.h. Signed-off-by: Bhupinder

[Xen-devel] [PATCH 04/12 v3] xen/arm: vpl011: Add support for vuart in libxl

2017-05-10 Thread Bhupinder Thakur
the guest configuration file: vuart = "pl011" Signed-off-by: Bhupinder Thakur --- Changes since v2: - Defined vuart option as an enum instead of a string. - Removed the domain creation flag defined for vuart and the related code to pass on the information while domain creation. Now

[Xen-devel] [PATCH 05/12 v3] xen/arm: vpl011: Add new domctl APIs to initialize/de-initialize vpl011

2017-05-10 Thread Bhupinder Thakur
transmit and receive pl011 data on guest domain's behalf. Signed-off-by: Bhupinder Thakur --- Changes since v2: - Replaced the DOMCTL APIs defined for get/set of event channel and GFN with a set of DOMCTL APIs for initializing and de-initializing vpl011 emulation. tools/libxc/include/xenc

[Xen-devel] [PATCH 06/12 v3] xen/arm: vpl011: Add a new vuart node in the xenstore

2017-05-10 Thread Bhupinder Thakur
Add a new vuart console node to xenstore. This node is added at /local/domain/$DOMID/vuart/0. The node contains information such as the ring-ref, event channel, buffer limit and type of console. Signed-off-by: Bhupinder Thakur --- tools/libxl/libxl_console.c | 33

[Xen-devel] [PATCH 07/12 v3] xen/arm: vpl011: Allocate a new GFN in the toolstack for vuart

2017-05-10 Thread Bhupinder Thakur
Allocate a new gfn to be used as a ring buffer between xenconsole and Xen for sending/receiving pl011 data. Signed-off-by: Bhupinder Thakur --- Changes since v2: - Removed the DOMCTL call to set the GFN as now this information is passed in the DOMCTL call to initialize vpl011 emulation

[Xen-devel] [PATCH 08/12 v3] xen/arm: vpl011: Modify xenconsole to support multiple consoles

2017-05-10 Thread Bhupinder Thakur
channel for each console. 3. Modify domain_create_ring() to use console_create_ring(). 4. Modifications in handle_ring_read() to read ring buffer data from multiple consoles. 5. Add log file support for multiple consoles. Signed-off-by: Bhupinder Thakur --- Changes since v2: - Defined a new

[Xen-devel] [PATCH 09/12 v3] xen/arm: vpl011: Add support for vuart in xenconsole

2017-05-10 Thread Bhupinder Thakur
Xenconsole supports only PV console currently. This patch adds support for vuart console, which allows emulated pl011 UART to be accessed as a console. Signed-off-by: Bhupinder Thakur --- One review comment was to keep the vuart code under CONFIG_ARM64 && CONFIG_ACPI flags. This cod

[Xen-devel] [PATCH 11/12 v3] xen/arm: vpl011: Add a pl011 uart DT node in the guest device tree

2017-05-10 Thread Bhupinder Thakur
irmware Signed-off-by: Bhupinder Thakur --- Changes since v2: - Currently device discovery using ACPI is not supported. - Dropped the reviewed-by tag by Stefano as there were some IRQ related changes done later. tools/libxl/libxl_arm.c | 53 +++-- 1 f

[Xen-devel] [PATCH 12/12 v3] xen/arm: vpl011: Update documentation for vuart console support

2017-05-10 Thread Bhupinder Thakur
1. Update documentation for a new vuart option added. 2. Update documentation about SPI irq reserved for vpl011. Signed-off-by: Bhupinder Thakur --- Changes since v2: - Incorporated the review comments on the documentation. docs/man/xl.cfg.pod.5.in | 9 + docs/misc/console.txt

[Xen-devel] [PATCH 10/12 v3] xen/arm: vpl011: Add a new vuart console type to xenconsole client

2017-05-10 Thread Bhupinder Thakur
Add a new console type VUART to connect to guest's emualated vuart console. Signed-off-by: Bhupinder Thakur --- tools/console/client/main.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/console/client/main.c b/tools/console/client/main.c index 99f..6f

Re: [Xen-devel] [PATCH 00/12 v3] PL011 emulation support in Xen

2017-05-10 Thread Bhupinder Thakur
Hi Julien, I will resend the series keeping you and Stefano in cc. Regards, Bhupinder On 10 May 2017 at 23:23, Stefano Stabellini wrote: > On Wed, 10 May 2017, Julien Grall wrote: >> Hi Bhupinder, >> >> I know that Jan requested to only CCed relevant maintainers to each patch. >> But >> can yo

Re: [Xen-devel] [PATCH 06/12 v3] xen/arm: vpl011: Add a new vuart node in the xenstore

2017-05-12 Thread Bhupinder Thakur
Hi Wei, On 11 May 2017 at 16:40, Wei Liu wrote: > On Wed, May 10, 2017 at 08:05:12PM +0530, Bhupinder Thakur wrote: >> libxl__device_console_add(gc, domid, &console, state, &device); >> @@ -1369,14 +1377,22 @@ static void domcreate_launch_dm(libxl__egc *e

Re: [Xen-devel] [PATCH 05/12 v3] xen/arm: vpl011: Add new domctl APIs to initialize/de-initialize vpl011

2017-05-22 Thread Bhupinder Thakur
Hi Wei, >> --- a/tools/libxl/libxl_dom.c >> +++ b/tools/libxl/libxl_dom.c >> @@ -688,6 +688,15 @@ static int libxl__build_dom(libxl__gc *gc, uint32_t >> domid, >> goto out; >> } >> >> +if ( info->vuart && >> + (ret = xc_dom_vpl011_init(CTX->xch, >> +

Re: [Xen-devel] [PATCH 06/12 v3] xen/arm: vpl011: Add a new vuart node in the xenstore

2017-05-22 Thread Bhupinder Thakur
Hi Wei, > [...] >> >> @@ -151,13 +154,19 @@ retry_transaction: >> >> if (rc) goto out; >> >> >> >> if (!libxl_only) { >> >> -rc = libxl__xs_write_checked(gc, t, >> >> GCSPRINTF("%s/frontend",libxl_path), >> >> - frontend_path); >> >> -

Re: [Xen-devel] [PATCH 01/12 v3] xen/arm: vpl011: Move vgic register access functions to vreg.h

2017-05-22 Thread Bhupinder Thakur
Hi Julien, > >> -static inline void vgic_reg##sz##_clearbits(uint##sz##_t *reg, \ >> -register_t bits,\ >> -const mmio_info_t *info)\ >> -{

Re: [Xen-devel] [PATCH 02/12 v3] xen/arm: vpl011: Define generic vreg_reg* access functions in vreg.h

2017-05-22 Thread Bhupinder Thakur
Hi Julien, >> >> -/* >> - * 64 bits registers are only supported on platform with 64-bit long. >> - * This is also allow us to optimize the 32 bit case by using >> - * unsigned long rather than uint64_t >> - */ >> -#if BITS_PER_LONG == 64 >> -VGIC_REG_HELPERS(64, 0x7); >> -#endif >> -VGIC_REG_HEL

Re: [Xen-devel] [PATCH 04/12 v3] xen/arm: vpl011: Add support for vuart in libxl

2017-05-23 Thread Bhupinder Thakur
Hi Wei, >> # Complex libxl types >> # >> @@ -470,6 +476,7 @@ libxl_domain_build_info = Struct("domain_build_info",[ >> ("disable_migrate", libxl_defbool), >> ("cpuid", libxl_cpuid_policy_list), >> ("blkdev_start",string), >> +("vuart", libxl_vuart_type)

Re: [Xen-devel] [PATCH 08/12 v3] xen/arm: vpl011: Modify xenconsole to support multiple consoles

2017-05-25 Thread Bhupinder Thakur
Hi, On 17 May 2017 at 05:11, Stefano Stabellini wrote: > On Wed, 10 May 2017, Bhupinder Thakur wrote: >> Xenconsole supports only PV console currently. This patch adds support >> for supporting multiple consoles. >> >> This patch modifies different data structures and

Re: [Xen-devel] [PATCH 03/12 v3] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-05-26 Thread Bhupinder Thakur
Hi Julien, Thanks for your comments. > > >> +static bool vpl011_reg32_check_access(int size) > > > Please pass hsr_dabt in parameter rather than the size directly. Which BTW > should have really be unsigned int. > ok. >> +{ >> +return (size == DABT_DOUBLE_WORD)? false : true; > > > This coul

Re: [Xen-devel] [PATCH 03/12 v3] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-05-29 Thread Bhupinder Thakur
Hi Julien, On 26 May 2017 at 19:12, Bhupinder Thakur wrote: >>> +#ifndef _VPL011_H_ >>> + >>> +#define _VPL011_H_ >>> + >>> +#include >>> +#include >>> + >>> +DEFINE_XEN_FLEX_RING(vpl011); >> >> >> I am

Re: [Xen-devel] [PATCH 06/12 v3] xen/arm: vpl011: Add a new vuart node in the xenstore

2017-06-01 Thread Bhupinder Thakur
Hi Wei, Thanks for your explanation. >> >> >> @@ -151,13 +154,19 @@ retry_transaction: >> >> >> if (rc) goto out; >> >> >> >> >> >> if (!libxl_only) { >> >> >> -rc = libxl__xs_write_checked(gc, t, >> >> >> GCSPRINTF("%s/frontend",libxl_path), >> >> >> -

Re: [Xen-devel] [PATCH 03/12 v3] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-06-01 Thread Bhupinder Thakur
Hi Julien, On 22 May 2017 at 19:54, Julien Grall wrote: >> +static const struct mmio_handler_ops vpl011_mmio_handler = { >> +.read = vpl011_mmio_read, >> +.write = vpl011_mmio_write, >> +}; >> + >> +int vpl011_map_guest_page(struct domain *d, xen_pfn_t gfn) > > > This function should eith

Re: [Xen-devel] [PATCH 03/12 v3] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-06-01 Thread Bhupinder Thakur
Hi Julien, On 26 May 2017 at 19:12, Bhupinder Thakur wrote: >>> + >>> +switch ( vpl011_reg ) >>> +{ >>> +case DR: >> >> >> As mentioned above, you could do: >> >> { >> uint8_t ch; >> ..

[Xen-devel] [PATCH 00/14 v4] PL011 emulation support in Xen

2017-06-06 Thread Bhupinder Thakur
default console. 3. ACPI support for pl011 device. Bhupinder Thakur (14): xen/arm: vpl011: Move vgic register access functions to vreg.h xen/arm: vpl011: Define generic vreg_reg* access functions in vreg.h xen/arm: vpl011: Add pl011 uart emulation in Xen xen/arm: vpl011: Add support for vuar

[Xen-devel] [PATCH 02/14 v4] xen/arm: vpl011: Define generic vreg_reg* access functions in vreg.h

2017-06-06 Thread Bhupinder Thakur
This patch redefines the vgic_reg* access functions to vreg_reg* functions. These are generic functions, which will be used by the vgic emulation code to access the vgic registers. PL011 emulation code will also use vreg_reg* access functions. Signed-off-by: Bhupinder Thakur --- Changes since

[Xen-devel] [PATCH 01/14 v4] xen/arm: vpl011: Move vgic register access functions to vreg.h

2017-06-06 Thread Bhupinder Thakur
These functions are generic in nature and can be reused by other emulation code in Xen. One recent example is pl011 emulation, which needs similar functions to read/write the registers. This patch moves the register access function definitions from vgic.h to vreg.h. Signed-off-by: Bhupinder

[Xen-devel] [PATCH 03/14 v4] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-06-06 Thread Bhupinder Thakur
/Server_Base_System_Architecture_v3_1_ARM_DEN_0029A.pdf Signed-off-by: Bhupinder Thakur --- Changes since v3: - Moved the call to DEFINE_XEN_FLEX_RING from vpl011.h to public/console.h. This macro defines standard functions to operate on the ring buffer. - Lock taken while updating the interrupt mask and

[Xen-devel] [PATCH 04/14 v4] xen/arm: vpl011: Add support for vuart in libxl

2017-06-06 Thread Bhupinder Thakur
the guest configuration file: vuart = "pl011" Signed-off-by: Bhupinder Thakur --- Changes since v3: - Added a new config option CONFIG_VUART_CONSOLE to enable/disable vuart console support. - Moved libxl_vuart_type to arch-arm part of libxl_domain_build_info - Updated xl command help

[Xen-devel] [PATCH 07/14 v4] xen/arm: vpl011: Add a new vuart node in the xenstore

2017-06-06 Thread Bhupinder Thakur
/receiving vuart data. Signed-off-by: Bhupinder Thakur --- Changes since v3: - Added a backend node for vpl011. - Removed libxl__device_vuart_add() for HVM guest. It is called only for PV guest. tools/libxl/libxl_console.c | 44 tools/libxl/libxl_create.c

[Xen-devel] [PATCH 06/14 v4] xen/arm: vpl011: Add a new domctl API to initialize vpl011

2017-06-06 Thread Bhupinder Thakur
data on the guest domain's behalf. Signed-off-by: Bhupinder Thakur --- Changes since v3: - Added a new arch specific function libxl__arch_domain_create_finish(), which calls the vpl011 initialization function. For x86 this function does not do anything. - domain_vpl011_init() takes a po

[Xen-devel] [PATCH 05/14 v4] xen/arm: vpl011: Allocate a new GFN in the toolstack for vuart

2017-06-06 Thread Bhupinder Thakur
Allocate a new gfn to be used as a ring buffer between xenconsole and Xen for sending/receiving pl011 console data. Signed-off-by: Bhupinder Thakur --- Changes since v3: - Added a new helper function xc_get_vuart_gfn() to return the GFN allocated for vpl011. - Since a new function has been

[Xen-devel] [PATCH 09/14 v4] xen/arm: vpl011: Modify xenconsole functions to take console structure as input

2017-06-06 Thread Bhupinder Thakur
ot;console_" to indicate that these are console specific functions. This patch is in preparation to support multiple consoles to support vuart console. Signed-off-by: Bhupinder Thakur --- Changes since v3: - The changes in xenconsole have been split into four patches. This is the second pa

[Xen-devel] [PATCH 10/14 v4] xen/arm: vpl011: Modify xenconsole to support multiple consoles

2017-06-06 Thread Bhupinder Thakur
This patch adds the support for multiple consoles and introduces the iterator functions to operate on multiple consoles. This patch is in preparation to support a new vuart console. Signed-off-by: Bhupinder Thakur --- Changes since v3: - The changes in xenconsole have been split into four

[Xen-devel] [PATCH 11/14 v4] xen/arm: vpl011: Add support for vuart console in xenconsole

2017-06-06 Thread Bhupinder Thakur
This patch finally adds the support for vuart console. Signed-off-by: Bhupinder Thakur --- Changes since v3: - The changes in xenconsole have been split into four patches. This is the fourth patch. - The vuart console support is added under CONFIG_VUART_CONSOLE option. tools/console/Makefile

[Xen-devel] [PATCH 08/14 v4] xen/arm: vpl011: Modify xenconsole to define and use a new console structure

2017-06-06 Thread Bhupinder Thakur
console tty. This patch is in preparation to support multiple consoles to support vuart console. Signed-off-by: Bhupinder Thakur --- Changes since v3: - The changes in xenconsole have been split into four patches. This is the first patch which modifies the xenconsole to use a new console

[Xen-devel] [PATCH 13/14 v4] xen/arm: vpl011: Add a pl011 uart DT node in the guest device tree

2017-06-06 Thread Bhupinder Thakur
by the firmware Currently the baud rate of 115200 has been selected as a default value, which is one of the valid baud rate setttings. Higher baud rate was selected since an emulated pl011 can support any valid baud rate without any limitation of the hardware. Signed-off-by: Bhupinder Thakur Revie

[Xen-devel] [PATCH 12/14 v4] xen/arm: vpl011: Add a new vuart console type to xenconsole client

2017-06-06 Thread Bhupinder Thakur
Add a new console type VUART to connect to guest's emualated vuart console. Signed-off-by: Bhupinder Thakur --- Changes since v3: - The vuart console support is under CONFIG_VUART_CONSOLE option. - Since there is a change from last review, I have not included reviewed-by tag from Stefan

[Xen-devel] [PATCH 14/14 v4] xen/arm: vpl011: Update documentation for vuart console support

2017-06-06 Thread Bhupinder Thakur
1. Update documentation for a new vuart option added. 2. Update documentation about SPI irq reserved for vpl011. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini Acked-by: Wei Liu --- docs/man/xl.cfg.pod.5.in | 9 + docs/misc/console.txt| 44

[Xen-devel] [PATCH 02/14 v4] xen/arm: vpl011: Define generic vreg_reg* access functions in vreg.h

2017-06-06 Thread Bhupinder Thakur
This patch redefines the vgic_reg* access functions to vreg_reg* functions. These are generic functions, which will be used by the vgic emulation code to access the vgic registers. PL011 emulation code will also use vreg_reg* access functions. Signed-off-by: Bhupinder Thakur --- CC: ss CC: jg

[Xen-devel] [PATCH 03/14 v4] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-06-06 Thread Bhupinder Thakur
/Server_Base_System_Architecture_v3_1_ARM_DEN_0029A.pdf Signed-off-by: Bhupinder Thakur --- CC: ij CC: wl CC: ss CC: jg CC: kw Changes since v3: - Moved the call to DEFINE_XEN_FLEX_RING from vpl011.h to public/console.h. This macro defines standard functions to operate on the ring buffer. - Lock taken while

[Xen-devel] [PATCH 08/14 v4] xen/arm: vpl011: Modify xenconsole to define and use a new console structure

2017-06-06 Thread Bhupinder Thakur
console tty. This patch is in preparation to support multiple consoles to support vuart console. Signed-off-by: Bhupinder Thakur --- CC: ij CC: wl CC: ss CC: jg Changes since v3: - The changes in xenconsole have been split into four patches. This is the first patch which modifies the

[Xen-devel] [PATCH 11/14 v4] xen/arm: vpl011: Add support for vuart console in xenconsole

2017-06-06 Thread Bhupinder Thakur
This patch finally adds the support for vuart console. Signed-off-by: Bhupinder Thakur --- CC: ij CC: wl CC: ss CC: jg Changes since v3: - The changes in xenconsole have been split into four patches. This is the fourth patch. - The vuart console support is added under CONFIG_VUART_CONSOLE

[Xen-devel] [PATCH 01/14 v4] xen/arm: vpl011: Move vgic register access functions to vreg.h

2017-06-06 Thread Bhupinder Thakur
These functions are generic in nature and can be reused by other emulation code in Xen. One recent example is pl011 emulation, which needs similar functions to read/write the registers. This patch moves the register access function definitions from vgic.h to vreg.h. Signed-off-by: Bhupinder

[Xen-devel] [PATCH 04/14 v4] xen/arm: vpl011: Add support for vuart in libxl

2017-06-06 Thread Bhupinder Thakur
the guest configuration file: vuart = "pl011" Signed-off-by: Bhupinder Thakur --- CC: ij CC: wl CC: ss CC: jg Changes since v3: - Added a new config option CONFIG_VUART_CONSOLE to enable/disable vuart console support. - Moved libxl_vuart_type to arch-arm part of libxl_domain_build_info

[Xen-devel] [PATCH 06/14 v4] xen/arm: vpl011: Add a new domctl API to initialize vpl011

2017-06-06 Thread Bhupinder Thakur
data on the guest domain's behalf. Signed-off-by: Bhupinder Thakur --- CC: ij CC: wl CC: ss CC: jg Changes since v3: - Added a new arch specific function libxl__arch_domain_create_finish(), which calls the vpl011 initialization function. For x86 this function does not do any

[Xen-devel] [PATCH 09/14 v4] xen/arm: vpl011: Modify xenconsole functions to take console structure as input

2017-06-06 Thread Bhupinder Thakur
ot;console_" to indicate that these are console specific functions. This patch is in preparation to support multiple consoles to support vuart console. Signed-off-by: Bhupinder Thakur --- CC: ij CC: wl CC: ss CC: jg Changes since v3: - The changes in xenconsole have been split into four

[Xen-devel] [PATCH 07/14 v4] xen/arm: vpl011: Add a new vuart node in the xenstore

2017-06-06 Thread Bhupinder Thakur
/receiving vuart data. Signed-off-by: Bhupinder Thakur --- CC: ij CC: wl CC: ss CC: jg Changes since v3: - Added a backend node for vpl011. - Removed libxl__device_vuart_add() for HVM guest. It is called only for PV guest. tools/libxl/libxl_console.c | 44

[Xen-devel] [PATCH 00/14 v4] PL011 emulation support in Xen

2017-06-06 Thread Bhupinder Thakur
default console. 3. ACPI support for pl011 device. CC: ij CC: wl CC: ss CC: jg CC: kw Bhupinder Thakur (14): xen/arm: vpl011: Move vgic register access functions to vreg.h xen/arm: vpl011: Define generic vreg_reg* access functions in vreg.h xen/arm: vpl011: Add pl011 uart emulation in Xen

[Xen-devel] [PATCH 05/14 v4] xen/arm: vpl011: Allocate a new GFN in the toolstack for vuart

2017-06-06 Thread Bhupinder Thakur
Allocate a new gfn to be used as a ring buffer between xenconsole and Xen for sending/receiving pl011 console data. Signed-off-by: Bhupinder Thakur --- CC: ij CC: wl CC: ss CC: jg Changes since v3: - Added a new helper function xc_get_vuart_gfn() to return the GFN allocated for vpl011

[Xen-devel] [PATCH 10/14 v4] xen/arm: vpl011: Modify xenconsole to support multiple consoles

2017-06-06 Thread Bhupinder Thakur
This patch adds the support for multiple consoles and introduces the iterator functions to operate on multiple consoles. This patch is in preparation to support a new vuart console. Signed-off-by: Bhupinder Thakur --- CC: ij CC: wl CC: ss CC: jg Changes since v3: - The changes in xenconsole

[Xen-devel] [PATCH 12/14 v4] xen/arm: vpl011: Add a new vuart console type to xenconsole client

2017-06-06 Thread Bhupinder Thakur
Add a new console type VUART to connect to guest's emualated vuart console. Signed-off-by: Bhupinder Thakur --- CC: ij CC: wl CC: ss CC: jg Changes since v3: - The vuart console support is under CONFIG_VUART_CONSOLE option. - Since there is a change from last review, I have not inc

[Xen-devel] [PATCH 13/14 v4] xen/arm: vpl011: Add a pl011 uart DT node in the guest device tree

2017-06-06 Thread Bhupinder Thakur
by the firmware Currently the baud rate of 115200 has been selected as a default value, which is one of the valid baud rate setttings. Higher baud rate was selected since an emulated pl011 can support any valid baud rate without any limitation of the hardware. Signed-off-by: Bhupinder Thakur Revie

[Xen-devel] [PATCH 14/14 v4] xen/arm: vpl011: Update documentation for vuart console support

2017-06-06 Thread Bhupinder Thakur
1. Update documentation for a new vuart option added. 2. Update documentation about SPI irq reserved for vpl011. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini Acked-by: Wei Liu --- CC: ij CC: wl CC: ss CC: jg docs/man/xl.cfg.pod.5.in | 9 + docs/misc/console.txt

Re: [Xen-devel] [PATCH 10/14 v4] xen/arm: vpl011: Modify xenconsole to support multiple consoles

2017-06-06 Thread Bhupinder Thakur
Hi Stefano, Thanks for your comments. >> diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c >> index c5dd08d..db73e10 100644 >> --- a/tools/console/daemon/io.c >> +++ b/tools/console/daemon/io.c >> @@ -90,12 +90,15 @@ struct buffer { >> }; >> >> struct console { >> + char *x

Re: [Xen-devel] [PATCH 03/14 v4] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-06-13 Thread Bhupinder Thakur
Hi Julien, >>> +static uint8_t vpl011_read_data(struct domain *d) >>> +{ >>> +unsigned long flags; >>> +uint8_t data = 0; >>> +struct vpl011 *vpl011 = &d->arch.vpl011; >>> +struct xencons_interface *intf = vpl011->ring_buf; >>> +XENCONS_RING_IDX in_cons = intf->in_cons; >>> +

Re: [Xen-devel] [PATCH 03/14 v4] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-06-13 Thread Bhupinder Thakur
Hi Julien, >> >> tools/console/daemon/io.c| 2 +- >> xen/arch/arm/Kconfig | 5 + >> xen/arch/arm/Makefile| 1 + >> xen/arch/arm/vpl011.c| 418 >> +++ >> xen/include/asm-arm/domain.h | 6 + >> xen/include/

Re: [Xen-devel] [PATCH 03/14 v4] xen/arm: vpl011: Add pl011 uart emulation in Xen

2017-06-13 Thread Bhupinder Thakur
Hi Julien, +} + +static void vpl011_update(struct domain *d) +{ +struct vpl011 *vpl011 = &d->arch.vpl011; + +/* + * TODO: PL011 interrupts are level triggered which means + * that interrupt needs to be set/clear instead of being +

Re: [Xen-devel] [PATCH 06/14 v4] xen/arm: vpl011: Add a new domctl API to initialize vpl011

2017-06-14 Thread Bhupinder Thakur
Hi Stefano, On 7 June 2017 at 04:56, Stefano Stabellini wrote: >> static int set_vnuma_info(libxl__gc *gc, uint32_t domid, >> @@ -788,6 +791,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid, >> if (xc_dom_translated(dom)) { >> state->console_mfn = dom->console_pfn; >>

Re: [Xen-devel] [PATCH 06/14 v4] xen/arm: vpl011: Add a new domctl API to initialize vpl011

2017-06-14 Thread Bhupinder Thakur
On 14 June 2017 at 13:05, Bhupinder Thakur wrote: > Hi Stefano, > > On 7 June 2017 at 04:56, Stefano Stabellini wrote: >>> static int set_vnuma_info(libxl__gc *gc, uint32_t domid, >>> @@ -788,6 +791,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid, >>

Re: [Xen-devel] [PATCH 06/14 v4] xen/arm: vpl011: Add a new domctl API to initialize vpl011

2017-06-14 Thread Bhupinder Thakur
Hi Julien, >> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h >> index 1629f41..77425dd 100644 >> --- a/tools/libxc/include/xenctrl.h >> +++ b/tools/libxc/include/xenctrl.h >> @@ -884,6 +884,23 @@ int xc_vcpu_getcontext(xc_interface *xch, >> uint

Re: [Xen-devel] [PATCH 06/14 v4] xen/arm: vpl011: Add a new domctl API to initialize vpl011

2017-06-14 Thread Bhupinder Thakur
Hi Julien, diff --git a/tools/libxl/libxl_arch.h b/tools/libxl/libxl_arch.h index 5e1fc60..d1ca9c6 100644 --- a/tools/libxl/libxl_arch.h +++ b/tools/libxl/libxl_arch.h @@ -32,6 +32,13 @@ _hidden int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config

Re: [Xen-devel] [PATCH 06/14 v4] xen/arm: vpl011: Add a new domctl API to initialize vpl011

2017-06-19 Thread Bhupinder Thakur
required by the emulation code for reading/writing data. By that time, the page would have been physically mapped. Regards, Bhupinder On 15 June 2017 at 12:03, Bhupinder Thakur wrote: > Hi Julien, > > >>>>> diff --git a/tools/libxl/libxl_arch.h b/tools/libxl/libxl_arch.h >

  1   2   3   4   5   >