[Xen-devel] [PATCH] xen/arm: gicv2: Export GICv2m register frames to domain0 by device tree

2016-04-21 Thread Wei Chen
ICv2m extension support, the domain0 kernel can do GICv2m frame setup and initialization. This patch is based on the GICv2m patch of Suravee Suthikulpanit: [PATCH 2/2] xen/arm: gicv2: Adding support for GICv2m in Dom0 http://lists.xen.org/archives/html/xen-devel/2015-04/msg02613.html Signed-off-by

Re: [Xen-devel] [PATCH] xen/arm: gicv2: Export GICv2m register frames to domain0 by device tree

2016-04-25 Thread Wei Chen
Hi Julien, On 23 April 2016 at 02:29, Julien Grall wrote: > Hi Wei, > > > On 21/04/16 09:24, Wei Chen wrote: > >> This patch adds v2m extension support in GIC-v2 driver. The GICv2 driver >> detects the MSI frames from device tree and creates corresponding device >

[Xen-devel] [PATCH v2] xen/arm: gicv2: Export GICv2m register frames to domain0 by device tree

2016-04-25 Thread Wei Chen
ICv2m extension support, the domain0 kernel can do GICv2m frame setup and initialization. This patch is based on the GICv2m patch of Suravee Suthikulpanit: [PATCH 2/2] xen/arm: gicv2: Adding support for GICv2m in Dom0 http://lists.xen.org/archives/html/xen-devel/2015-04/msg02613.html Signed-off-by

Re: [Xen-devel] [PATCH] xen/arm: gicv2: Export GICv2m register frames to domain0 by device tree

2016-04-25 Thread Wei Chen
Sorry, I forget to change to the plain text mode. On 25 April 2016 at 17:45, Stefano Stabellini wrote: > Hello Wei, > > could you please send email replies in plain text (rather than html)? > > Thanks, > > Stefano > > On Mon, 25 Apr 2016, Wei Chen wrote: >> Hi

Re: [Xen-devel] [PATCH] xen/arm: gicv2: Export GICv2m register frames to domain0 by device tree

2016-04-25 Thread Wei Chen
Hi Julien On 23 April 2016 at 02:29, Julien Grall wrote: > Hi Wei, > > > On 21/04/16 09:24, Wei Chen wrote: >> >> This patch adds v2m extension support in GIC-v2 driver. The GICv2 driver >> detects the MSI frames from device tree and creates corresponding device

Re: [Xen-devel] [PATCH v2] xen/arm: gicv2: Export GICv2m register frames to domain0 by device tree

2016-04-26 Thread Wei Chen
Hi Julien, On 26 April 2016 at 18:49, Julien Grall wrote: > Hello Wei, > > On 25/04/2016 10:39, Wei Chen wrote: >> >> This patch adds v2m extension support in GIC-v2 driver. The GICv2 driver >> detects the MSI frames from device tree and creates corresponding device

[Xen-devel] [PATCH v3] xen/arm: gicv2: Export GICv2m register frames to Dom0 by device tree

2016-04-27 Thread Wei Chen
nsion support, the dom0 kernel can do GICv2m frame setup and initialization. This patch is based on the GICv2m patch of Suravee Suthikulpanit: [PATCH 2/2] xen/arm: gicv2: Adding support for GICv2m in Dom0 http://lists.xen.org/archives/html/xen-devel/2015-04/msg02613.html Signed-off-by: Wei Chen -

Re: [Xen-devel] [PATCH v2] xen/arm: gicv2: Export GICv2m register frames to domain0 by device tree

2016-04-27 Thread Wei Chen
Hi Julien, On 27 April 2016 at 17:40, Julien Grall wrote: > > > On 27/04/2016 07:05, Wei Chen wrote: >> >> Hi Julien, > > > Hi Wei, > >> On 26 April 2016 at 18:49, Julien Grall wrote: >>> >>> On 25/04/2016 10:39, W

Re: [Xen-devel] [RFC 00/16] xen/arm: Introduce alternative runtime patching for ARM64

2016-05-10 Thread Wei Chen
code... (XEN) *** LOADING DOMAIN 0 *** Tested-by: Wei Chen Regards. On 6 May 2016 at 00:34, Julien Grall wrote: > Hello, > > Some of the processor erratum will require to modify code sequence. As those > modifications may impact the performance, they should only be enabled on >

Re: [Xen-devel] [for-4.7 2/2] xen/arm: p2m: Release the p2m lock before undoing the mappings

2016-05-16 Thread Wei Chen
Hi Julien, This code looks good to me, and I have tested that the deadlock is fixed by this patch. Reviewed-and-Tested-by: Wei Chen Original: (XEN) smmu: /smb/smmu@e080: P2M IPA size not supported (P2M=44 SMMU=40)! (XEN) I/O virtualisation disabled (XEN) Request p2m Spinlock... (XEN

Re: [Xen-devel] [for-4.7 1/2] xen/arm: p2m: apply_p2m_changes: Do not undo more than necessary

2016-05-16 Thread Wei Chen
Hi Julien, This code looks good to me. Reviewed-by: Wei Chen On 2016/5/16 22:08, Julien Grall wrote: Since commit 4b25423a "arch/arm: unmap partially-mapped memory regions", Xen has been undoing the P2M mappings when an error occurred during insertion or memory allocation. Th

Re: [Xen-devel] [for-4.7 2/2] xen/arm: p2m: Release the p2m lock before undoing the mappings

2016-05-16 Thread Wei Chen
security risk? On 2016/5/17 13:45, Wei Chen wrote: Hi Julien, This code looks good to me, and I have tested that the deadlock is fixed by this patch. Reviewed-and-Tested-by: Wei Chen Original: (XEN) smmu: /smb/smmu@e080: P2M IPA size not supported (P2M=44 SMMU=40)! (XEN) I/O virtualisation

Re: [Xen-devel] [PATCH v2 0/1] xen/device-tree: Do not remap IRQs for secondary IRQ controllers

2016-05-17 Thread Wei Chen
Hi Julien, On 17 May 2016 at 00:30, Julien Grall wrote: > Hi Wei, > > > On 16/05/16 16:47, Wei Liu wrote: >> >> On Mon, May 16, 2016 at 05:03:54PM +0200, Edgar E. Iglesias wrote: >>> >>> From: "Edgar E. Iglesias" >>> >>> I'm sending this as a v2 considering that I previously posted a diff >>> in

[Xen-devel] [PATCH] xen/arm32: Distinguish guest SError from Xen data aborts

2017-05-02 Thread Wei Chen
borts. So we want to change the policy to handle data aborts for ARM32: 1. If this data abort is guest generated SError, we will handle this data abort follow the SError handle option setting. 2. If this data abort is synchronous data abort or Xen generate SError, we will PANIC the whole system.

Re: [Xen-devel] [PATCH] xen/arm32: Distinguish guest SError from Xen data aborts

2017-05-03 Thread Wei Chen
Hi Stefano, On 2017/5/4 5:56, Stefano Stabellini wrote: > On Wed, 3 May 2017, Wei Chen wrote: >> ARM32 doesn't have an exception similar to hyp_sync of ARM64 to catch >> the synchronous data abort (For example, a NULL pointer has been referenced). >> Hence the SError a

[Xen-devel] [PATCH v2] xen/arm32: Distinguish guest SError from Xen data aborts

2017-05-03 Thread Wei Chen
borts. So we want to change the policy to handle data aborts for ARM32: 1. If this data abort is guest generated SError, we will handle this data abort follow the SError handle option setting. 2. If this data abort is synchronous data abort or Xen generate SError, we will PANIC the whole system.

[Xen-devel] [PATCH 0/7] Generic IOMMU bindings support for Xen platform devices

2017-06-29 Thread Wei Chen
erver. The platform device can be passthrough to guest with both Legacy and Generic IOMMU bindings. I noticed that Sameer has a iommu_fwspec series in review. It would be nice to look at it and see if we can re-use it in this series. Wei Chen (7): xen/arm: SMMU: Implement the add_device callback in SMMU

[Xen-devel] [PATCH 5/7] xen/arm: SMMU: Keep registering legacy master in SMMU probe

2017-06-29 Thread Wei Chen
eep registering legacy master in SMMU probing. Signed-off-by: Wei Chen --- xen/drivers/passthrough/arm/smmu.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c index 441c296.

[Xen-devel] [PATCH 3/7] xen/arm: Prepare SMMU resources for protected devices

2017-06-29 Thread Wei Chen
r all protected devices, regardless of passthrough or not. Signed-off-by: Wei Chen --- xen/arch/arm/domain_build.c | 12 1 file changed, 12 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index c6776d7..6aea427 100644 --- a/xen/arch/arm/domain_bu

[Xen-devel] [PATCH 7/7] xen: Fix a typo in error message of iommu_do_dt_domctl

2017-06-29 Thread Wei Chen
It's a error message about XEN_DOMCTL_deassign_device, but the print message is XEN_DOMCTL_assign_device. Signed-off-by: Wei Chen --- xen/drivers/passthrough/device_tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/device_tree.c

[Xen-devel] [PATCH 6/7] xen/arm: SMMU: Support generic IOMMU bindings

2017-06-29 Thread Wei Chen
find their master devices. It's better to register SMMU master for generic bindings in add_device callback. This callback will only be called while constructing Dom0. Signed-off-by: Wei Chen --- xen/drivers/passthrough/arm/smmu.c | 144 - 1 file changed, 143 i

[Xen-devel] [PATCH 2/7] xen/arm: SMMU: Introduce a helper to add DT device to SMMU

2017-06-29 Thread Wei Chen
some preparation for further use. In this case, we can't call iommu_assign_dt_device. In previous patch, we have implement the add_device callback for SMMU, so we can separate this work from assign_device now. Signed-off-by: Wei Chen --- xen/drivers/passthrough/device_tree.c | 20 +++

[Xen-devel] [PATCH 1/7] xen/arm: SMMU: Implement the add_device callback in SMMU

2017-06-29 Thread Wei Chen
main0. Signed-off-by: Wei Chen --- xen/drivers/passthrough/arm/smmu.c | 34 +++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c index 74c09b0..2efa52d 100644 --- a/xen/dr

[Xen-devel] [PATCH 4/7] xen/arm: SMMU: Detect types of device tree binding

2017-06-29 Thread Wei Chen
we have to detect the binding types while doing SMMU probing. This detect code is based on Linux ARM SMMUv2 driver: https://github.com/torvalds/linux/blob/master/drivers/iommu/arm-smmu.c Signed-off-by: Wei Chen --- xen/drivers/passthrough/arm/smmu.c | 23 +++ 1 file changed

[Xen-devel] [PATCH 1/2] xen: devicetree: Introduce a helper to translate PCI requester ID

2017-06-29 Thread Wei Chen
i.c: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/of/of_pci.c The commit id is: 987068fcbdb7a085bb11151b91dc6f4c956c4a1b Signed-off-by: Wei Chen --- xen/common/device_tree.c | 89 +++ xen/include/xen/device_tree.h | 23

[Xen-devel] [PATCH 2/2] xen/arm: smmu: Parse generic iommu binding for PCI devices

2017-06-29 Thread Wei Chen
s patch is based on Linux of_iommu.c: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/iommu/of_iommu.c The commit id is: 2a0c57545a291f257cd231b1c4b18285b84608d8 Signed-off-by: Wei Chen --- xen/drivers/passthrough/arm/smmu.c | 73 +++

[Xen-devel] [PATCH 0/2] Add support parse PCI iommu bindings for Xen SMMU

2017-06-29 Thread Wei Chen
The legacy IOMMU bindings will be deprecated in future. Instead, device tree provide generic IOMMU bindings and PCI IOMMU bindings. Currently, the PCI support hasn't been enabled on ARM Xen. So in this series, we just add the support of parsing PCI IOMMU bindings. Wei Chen (2): xen: devic

Re: [Xen-devel] [PATCH 1/7] xen/arm: SMMU: Implement the add_device callback in SMMU

2017-07-03 Thread Wei Chen
Hi Stefano, > -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 2017年7月4日 5:58 > To: Wei Chen > Cc: xen-devel@lists.xen.org; sstabell...@kernel.org; Steve Capper > ; Kaly Xin ; Julien Grall > ; nd > Subject: Re: [Xen-devel] [

Re: [Xen-devel] [PATCH 2/7] xen/arm: SMMU: Introduce a helper to add DT device to SMMU

2017-07-03 Thread Wei Chen
Hi Stefano, > -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 2017年7月4日 6:03 > To: Wei Chen > Cc: xen-devel@lists.xen.org; sstabell...@kernel.org; Steve Capper > ; Kaly Xin ; Julien Grall > ; nd > Subject: Re: [Xen-devel] [

Re: [Xen-devel] [PATCH 4/7] xen/arm: SMMU: Detect types of device tree binding

2017-07-03 Thread Wei Chen
Hi Stefano, > -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 2017年7月4日 6:30 > To: Wei Chen > Cc: xen-devel@lists.xen.org; sstabell...@kernel.org; Steve Capper > ; Kaly Xin ; Julien Grall > ; nd > Subject: Re: [Xen-devel] [

Re: [Xen-devel] [PATCH 6/7] xen/arm: SMMU: Support generic IOMMU bindings

2017-07-03 Thread Wei Chen
Hi Stefano, > -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 2017年7月4日 7:00 > To: Wei Chen > Cc: xen-devel@lists.xen.org; sstabell...@kernel.org; Steve Capper > ; Kaly Xin ; Julien Grall > ; nd > Subject: Re: [Xen-devel] [

Re: [Xen-devel] [PATCH 6/7] xen/arm: SMMU: Support generic IOMMU bindings

2017-07-05 Thread Wei Chen
Hi Julien, > -Original Message- > From: Julien Grall [mailto:julien.gr...@arm.com] > Sent: 2017年7月4日 15:27 > To: Wei Chen ; Stefano Stabellini > Cc: xen-devel@lists.xen.org; Steve Capper ; Kaly Xin > ; nd > Subject: Re: [Xen-devel] [PATCH 6/7] xen/arm: SMMU:

Re: [Xen-devel] [PATCH 1/7] xen/arm: SMMU: Implement the add_device callback in SMMU

2017-07-05 Thread Wei Chen
Hi Julien, > -Original Message- > From: Julien Grall [mailto:julien.gr...@arm.com] > Sent: 2017年7月4日 23:41 > To: Wei Chen ; xen-devel@lists.xen.org > Cc: sstabell...@kernel.org; Steve Capper ; Kaly Xin > ; nd > Subject: Re: [PATCH 1/7] xen/arm: SMMU: Implement the a

Re: [Xen-devel] [PATCH 6/7] xen/arm: SMMU: Support generic IOMMU bindings

2017-07-05 Thread Wei Chen
Hi Julien, > -Original Message- > From: Julien Grall [mailto:julien.gr...@arm.com] > Sent: 2017年7月5日 21:08 > To: Wei Chen ; Stefano Stabellini > Cc: xen-devel@lists.xen.org; Steve Capper ; Kaly Xin > ; nd ; Sameer Goel > Subject: Re: [Xen-devel] [PATCH 6/7] x

Re: [Xen-devel] [PATCH 1/7] xen/arm: SMMU: Implement the add_device callback in SMMU

2017-07-05 Thread Wei Chen
> -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 2017年7月6日 1:58 > To: Wei Chen > Cc: Stefano Stabellini ; xen-devel@lists.xen.org; > Steve Capper ; Kaly Xin ; Julien Grall > ; nd > Subject: RE: [Xen-devel] [PATCH 1/7] xen/

Re: [Xen-devel] [PATCH 2/7] xen/arm: SMMU: Introduce a helper to add DT device to SMMU

2017-07-05 Thread Wei Chen
> -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 2017年7月6日 2:02 > To: Wei Chen > Cc: Stefano Stabellini ; Kaly Xin ; > Julien Grall ; Steve Capper ; nd > ; xen-devel@lists.xen.org > Subject: Re: [Xen-devel] [PATCH 2/7] xe

Re: [Xen-devel] [PATCH 4/7] xen/arm: SMMU: Detect types of device tree binding

2017-07-05 Thread Wei Chen
> -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 2017年7月6日 2:08 > To: Wei Chen > Cc: Stefano Stabellini ; Kaly Xin ; > Julien Grall ; Steve Capper ; nd > ; xen-devel@lists.xen.org > Subject: Re: [Xen-devel] [PATCH 4/7] xen

Re: [Xen-devel] [PATCH 6/7] xen/arm: SMMU: Support generic IOMMU bindings

2017-07-05 Thread Wei Chen
> -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 2017年7月6日 2:15 > To: Wei Chen > Cc: Julien Grall ; Stefano Stabellini > ; Kaly Xin ; nd ; > Steve > Capper ; xen-devel@lists.xen.org > Subject: Re: [Xen-devel] [PATCH

Re: [Xen-devel] [PATCH 1/2] xen: devicetree: Introduce a helper to translate PCI requester ID

2017-07-06 Thread Wei Chen
Hi Stefano, > -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 2017年7月7日 4:26 > To: Wei Chen > Cc: xen-devel@lists.xen.org; sstabell...@kernel.org; Julien Grall > ; Steve Capper ; Kaly Xin > ; nd > Subject: Re: [PATCH 1/2] xe

Re: [Xen-devel] [PATCH 2/2] xen/arm: smmu: Parse generic iommu binding for PCI devices

2017-07-06 Thread Wei Chen
Hi Stefano, > -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 2017年7月7日 5:05 > To: Wei Chen > Cc: xen-devel@lists.xen.org; sstabell...@kernel.org; Julien Grall > ; Steve Capper ; Kaly Xin > ; nd > Subject: Re: [PATCH 2

Re: [Xen-devel] [PATCH v2] xen/arm:alternative: Register re-mapped Xen area as a temporary virtual region

2017-03-23 Thread Wei Chen
Hi Julien, On 2017/3/24 3:19, Julien Grall wrote: > Hi Wei, > > NIT: title: please add a space between : and alternative. > Ok. > On 23/03/17 09:43, Wei Chen wrote: >> While I was using the alternative patching in the SErrors patch series [1]. >> I used a branch

Re: [Xen-devel] [PATCH for-4.8] xen/arm:alternative: Register re-mapped Xen area as a temporary virtual region

2017-03-23 Thread Wei Chen
nation. Now I know :) > Cheers, > > On 23/03/17 09:43, Wei Chen wrote: >> While I was using the alternative patching in the SErrors patch series [1]. >> I used a branch instruction as alternative instruction. >> >> ALTE

Re: [Xen-devel] [PATCH 14/18] xen/arm: Unmask the Abort/SError bit in the exception entries

2017-03-24 Thread Wei Chen
Hi Stefano, On 2017/3/24 8:10, Stefano Stabellini wrote: > On Thu, 23 Mar 2017, Julien Grall wrote: >> Hi Wei, >> >> On 23/03/17 03:13, Wei Chen wrote: >>> On 2017/3/23 6:22, Stefano Stabellini wrote: >>>> On Wed, 22 Mar 2017, Julien Grall wrote: >&g

[Xen-devel] [PATCH v3] xen/arm: alternative: Register re-mapped Xen area as a temporary virtual region

2017-03-27 Thread Wei Chen
https://lists.xenproject.org/archives/html/xen-devel/2017-03/msg01939.html Signed-off-by: Wei Chen --- Notes: This bug will affect the staging, staging-4.8 and stable-4.8 source trees. --- v2->v3 1. Fix typos. 2. Explain this bug only happening when booting Xen in commit message. --- xen/arch/

Re: [Xen-devel] [PATCH 1/2] xen/arm32: Introduce alternative runtime patching

2017-03-27 Thread Wei Chen
Hi Julien, On 2017/3/24 18:48, Julien Grall wrote: > On 03/17/2017 06:35 AM, Wei Chen wrote: >> Hi Julien, > > Hi Wei, > > Sorry for the late answer, I missed that e-mail. > >> On 2017/3/17 6:24, Julien Grall wrote: >>> On 03/16/2017 09:53 AM, Wei Chen wrot

[Xen-devel] [PATCH v2] xen/arm32: Introduce alternative runtime patching

2017-03-28 Thread Wei Chen
the page.h of ARM32 doesn't include alternative.h, and we don't have the reason to include it to ARM32 page.h now. So we have to include the alternative.h directly in livepatch.c. Signed-off-by: Wei Chen Reviewed-by: Konrad Rzeszutek Wilk --- v1->v2: 1. Remove duplicate header file.

Re: [Xen-devel] [PATCH v2] xen/arm32: Introduce alternative runtime patching

2017-03-29 Thread Wei Chen
Hi Julien, On 2017/3/29 16:40, Julien Grall wrote: > Hi Wei, > > On 28/03/2017 08:23, Wei Chen wrote: >> diff --git a/xen/include/asm-arm/arm32/insn.h >> b/xen/include/asm-arm/arm32/insn.h >> new file mode 100644 >> index 000..4cda69e >> --- /dev/

Re: [Xen-devel] [PATCH v2] xen/arm32: Introduce alternative runtime patching

2017-03-29 Thread Wei Chen
Hi Julien, On 2017/3/29 22:07, Julien Grall wrote: > > > On 29/03/17 10:28, Wei Chen wrote: >> Hi Julien, >> >> On 2017/3/29 16:40, Julien Grall wrote: >>> Hi Wei, >>> >>> On 28/03/2017 08:23, Wei Chen wrote: >>>> diff --git a/

[Xen-devel] [PATCH v3] xen/arm32: Introduce alternative runtime patching

2017-03-30 Thread Wei Chen
the page.h of ARM32 doesn't include alternative.h, and we don't have the reason to include it to ARM32 page.h now. So we have to include the alternative.h directly in livepatch.c. Signed-off-by: Wei Chen Reviewed-by: Konrad Rzeszutek Wilk --- v2->v3: 1. Introduce a macro to cache bl

[Xen-devel] [PATCH v2 01/19] xen/arm: Save ESR_EL2 to avoid using mismatched value in syndrome check

2017-03-30 Thread Wei Chen
dp to restore ELR and CPSR from stack at the same time. We have to use ldr to restore them separately. Signed-off-by: Wei Chen --- v1->v2: 1. Use more accurate words in the commit message. 2. Remove pointless comment message in cpu_user_regs. 3. Explain the changes of the registers save/restore

[Xen-devel] [PATCH v2 05/19] xen/arm: Avoid setting/clearing HCR_RW at every context switch

2017-03-30 Thread Wei Chen
W at every context switch. Signed-off-by: Wei Chen --- xen/arch/arm/arm64/domctl.c | 6 ++ xen/arch/arm/domain.c| 5 + xen/arch/arm/domain_build.c | 7 +++ xen/arch/arm/p2m.c | 5 - xen/include/asm-arm/domain.h | 1 + 5 files changed, 19 insertions(+), 5 delet

[Xen-devel] [PATCH v2 04/19] xen/arm: Restore HCR_EL2 register

2017-03-30 Thread Wei Chen
s write to restore the HCR_EL2 for each vCPU. Of course, the value of each vCPU's HCR_EL2 should be adjusted to have proper HCR_EL2.RW bit in this function. In the later patch of this series, we will set the HCR_EL2.RW for each vCPU while the domain is creating. Signed-off-by: wei chen --- v1->

[Xen-devel] [PATCH v2 02/19] xen/arm: Remove vwfi while setting HCR_EL2 in init_traps

2017-03-30 Thread Wei Chen
in dom0's context. So checking vwfi in init_trap is pointless. Signed-off-by: Wei Chen --- I have tried to remove HCR_EL2 setting from init_traps, but the Xen will hang at the place of creating domain0. The console hot key can work, so the Xen is alive, not panic. --- xen/arch/arm/traps.

[Xen-devel] [PATCH v2 08/19] xen/arm: Introduce a command line parameter for SErrors/Aborts

2017-03-30 Thread Wei Chen
overhead of the dsb/isb pairs. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- v1->v2: 1. Correct words and syntax in the commit message and docs. 2. Add Stefano's Reviewed-by tag. --- docs/misc/xen-command-line.markdown | 43 +

[Xen-devel] [PATCH v2 00/19] Provide a command line option to choose how to handle SErrors

2017-03-30 Thread Wei Chen
aced in separated patchs. Wei Chen (19): xen/arm: Save ESR_EL2 to avoid using mismatched value in syndrome check xen/arm: Remove vwfi while setting HCR_EL2 in init_traps xen/arm: Move parse_vwfi from trap.c to domain.c xen/arm: Restore HCR_EL2 register xen/arm: Avoid setting/clearin

[Xen-devel] [PATCH v2 09/19] xen/arm: Introduce a initcall to update cpu_hwcaps by serror_op

2017-03-30 Thread Wei Chen
cpu_hwcaps. So, we introduce this initcall to guarantee the cpu_hwcaps can be updated no matter the serror parameter is placed in the command line or not. Signed-off-by: Wei Chen --- v1->v2: 1. Explain this initcall is to future-proof the code in commit message. 2. Fix a coding style of

[Xen-devel] [PATCH v2 03/19] xen/arm: Move parse_vwfi from trap.c to domain.c

2017-03-30 Thread Wei Chen
had removed the HCR_EL2 setting from init_traps. Keep parse_vwfi in trap.c is pointless. And we will set the HCR_EL2 for each domain individually while it's creating in the later patch of this series. So we move parse_vwfi to domain.c for preparation. Signed-off-by: Wei Chen --- xen/ar

[Xen-devel] [PATCH v2 13/19] xen/arm: Introduce new helpers to handle guest/hyp SErrors

2017-03-30 Thread Wei Chen
Error, that would be a bug. In the new helpers, we have used the function "inject_vabt_exception" which was disabled by "#if 0" before. Now, we can remove the "#if 0" to make this function to be available. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- x

[Xen-devel] [PATCH v2 19/19] xen/arm: Handle guest external abort as guest SError

2017-03-30 Thread Wei Chen
The guest generated external data/instruction aborts can be treated as guest SErrors. We already have a handler to handle the SErrors, so we can reuse this handler to handle guest external aborts. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- xen/arch/arm/traps.c | 14

[Xen-devel] [PATCH v2 07/19] xen/arm: Introduce a virtual abort injection helper

2017-03-30 Thread Wei Chen
here. This would be useful when VM introspection will gain support of SVC32/64 trapping. This helper will be used by the later patches in this series, we use #if 0 to disable it in this patch temporarily to remove the warning message of unused function from compiler. Signed-off-by: Wei Chen Acked-b

[Xen-devel] [PATCH v2 15/19] xen/arm: Unmask the Abort/SError bit in the exception entries

2017-03-30 Thread Wei Chen
t in order to avoid receiving nested asynchronous abort, we don't unmask Abort/SError bit in hyp_error and trap_data_abort. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- xen/arch/arm/arm32/entry.S | 15 ++- xen/arch/arm/arm64/entry.S | 13 - 2 fi

[Xen-devel] [PATCH v2 16/19] xen/arm: Introduce a helper to synchronize SError

2017-03-30 Thread Wei Chen
introduce this helper to synchronize SErrors while returning to guest and doing context switch. This function should be used out of trap.c in later patch of this series. We have to export this helper in header file. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- v1->v2: 1. Update comm

[Xen-devel] [PATCH v2 17/19] xen/arm: Isolate the SError between the context switch of 2 vCPUs

2017-03-30 Thread Wei Chen
rce files. Signed-off-by: Wei Chen --- v1->v2: 1. Added a new flag in cpu_hwcaps to avoid using serror_op to skip synchronizing SError in context switch. 2. Update commit message to explain why we added this cpu_hwcaps. --- xen/arch/arm/domain.c| 14 ++ xen/arch/

[Xen-devel] [PATCH v2 18/19] xen/arm: Prevent slipping hypervisor SError to guest

2017-03-30 Thread Wei Chen
return to guest. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- xen/arch/arm/traps.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 9b4546e..f3d794e 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -

[Xen-devel] [PATCH v2 11/19] xen/arm32: Use alternative to skip the check of pending serrors

2017-03-30 Thread Wei Chen
ARM32 supports the alternative patching feature. We can use an ALTERNATIVE to avoid checking option at every trap. We added a new cpufeature named "SKIP_CHECK_PENDING_VSERROR". This feature will be enabled when the option is not diverse. Signed-off-by: Wei Chen --- xen/arch/arm/arm32/en

[Xen-devel] [PATCH v2 12/19] xen/arm: Move macro VABORT_GEN_BY_GUEST to common header

2017-03-30 Thread Wei Chen
abort_guest_exit_start and abort_guest_exit_end. After we moved this macro to common header, we should export these two symbols to other source files that will use VABORT_GEN_BY_GUEST macro. So we change these two symbols to global. Signed-off-by: Wei Chen --- v1->v2: 1. Explain in commit message why we cha

[Xen-devel] [PATCH v2 06/19] xen/arm: Save HCR_EL2 when a guest took the SError

2017-03-30 Thread Wei Chen
restore it to HCR_EL2 when context switch to this guest. This is achieved by writing saved HCR_EL2 value in guest context back to HCR_EL2 register before return to guest. This had been done by the patch of "Restore HCR_EL2 register". Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini

[Xen-devel] [PATCH v2 10/19] xen/arm64: Use alternative to skip the check of pending serrors

2017-03-30 Thread Wei Chen
ARM64 supports the alternative patching feature. We can use an ALTERNATIVE to avoid checking option at every trap. We added a new cpufeature named "SKIP_CHECK_PENDING_VSERROR". This feature will be enabled when the option is not diverse. Signed-off-by: Wei Chen Reviewed-by: Stefano

[Xen-devel] [PATCH v2 14/19] xen/arm: Replace do_trap_guest_serror with new helpers

2017-03-30 Thread Wei Chen
We have introduced two helpers to handle the guest/hyp SErrors: do_trap_guest_serror and do_trap_guest_hyp_serror. These handlers can take the role of do_trap_guest_serror and reduce the assembly code in the same time. So we use these two helpers to replace it and drop it now. Signed-off-by: Wei

Re: [Xen-devel] [PATCH v2 04/19] xen/arm: Restore HCR_EL2 register

2017-03-30 Thread Wei Chen
Hi Julien and Stefano, On 2017/3/31 6:03, Stefano Stabellini wrote: > On Thu, 30 Mar 2017, Julien Grall wrote: >> Hi Wei, >> >> On 30/03/17 10:13, Wei Chen wrote: >>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c >>> index de59e5f

Re: [Xen-devel] [PATCH v3] xen/arm32: Introduce alternative runtime patching

2017-03-30 Thread Wei Chen
Hi Julien, On 2017/3/30 20:55, Julien Grall wrote: > Hi Wei, > > On 30/03/17 10:02, Wei Chen wrote: >> +/* Unconditional branch instructions */ >> +/* >> + * From ARM DDI 0406C.c Section A8.8.25. We can see blx has a H bit. >> + * In an ARM/Thumb instructions mi

Re: [Xen-devel] [PATCH v2 01/19] xen/arm: Save ESR_EL2 to avoid using mismatched value in syndrome check

2017-03-30 Thread Wei Chen
Hi Julien On 2017/3/30 21:31, Julien Grall wrote: > Hi Wei, > > On 30/03/17 10:13, Wei Chen wrote: >> Xen will do exception syndrome check while some types of exception >> take place in EL2. The syndrome check code read the ESR_EL2 register >> directly, but in some si

Re: [Xen-devel] [PATCH v2 07/19] xen/arm: Introduce a virtual abort injection helper

2017-03-30 Thread Wei Chen
On 2017/3/31 1:20, Julien Grall wrote: > Hi Wei, > > On 30/03/17 10:13, Wei Chen wrote: >> When guest triggers async aborts, in most platform, such aborts >> will be routed to hypervisor. But we don't want the hypervisor >> to handle such aborts, so we have to

Re: [Xen-devel] [PATCH v2 08/19] xen/arm: Introduce a command line parameter for SErrors/Aborts

2017-03-30 Thread Wei Chen
Hi Julien, On 2017/3/31 1:39, Julien Grall wrote: > Hi Wei, > > On 30/03/17 10:13, Wei Chen wrote: >> In order to distinguish guest-generated SErrors from hypervisor-generated >> SErrors we have to place SError checking code in every EL1 -> EL2 paths. >> That will ca

Re: [Xen-devel] [PATCH v2 11/19] xen/arm32: Use alternative to skip the check of pending serrors

2017-03-30 Thread Wei Chen
On 2017/3/31 5:29, Stefano Stabellini wrote: > On Thu, 30 Mar 2017, Julien Grall wrote: >> Hi Wei, >> >> On 30/03/17 10:13, Wei Chen wrote: >>> We have provided an option to administrator to determine how to >>> handle the SErrors. In order to skip the check

Re: [Xen-devel] [PATCH v2 12/19] xen/arm: Move macro VABORT_GEN_BY_GUEST to common header

2017-03-30 Thread Wei Chen
On 2017/3/31 5:36, Stefano Stabellini wrote: > On Thu, 30 Mar 2017, Wei Chen wrote: >> We want to move part of SErrors checking code from hyp_error assembly code >> to a function. This new function will use this macro to distinguish the >> guest SErrors from hypervisor SError

Re: [Xen-devel] [PATCH v2 16/19] xen/arm: Introduce a helper to synchronize SError

2017-03-30 Thread Wei Chen
On 2017/3/31 2:38, Julien Grall wrote: > > > On 30/03/17 19:32, Julien Grall wrote: >> On 30/03/17 19:28, Julien Grall wrote: >>> Hi Wei, >>> >>> On 30/03/17 10:13, Wei Chen wrote: >>>> +void synchronize_serror(void) >>> >&

Re: [Xen-devel] [PATCH v2 17/19] xen/arm: Isolate the SError between the context switch of 2 vCPUs

2017-03-30 Thread Wei Chen
On 2017/3/31 6:00, Julien Grall wrote: > > > On 30/03/2017 22:49, Stefano Stabellini wrote: >> On Thu, 30 Mar 2017, Wei Chen wrote: >>> +/* >>> + * If the SErrors option is "FORWARD", we have to prevent forwarding >>> + * serror to

Re: [Xen-devel] [PATCH v2 02/19] xen/arm: Remove vwfi while setting HCR_EL2 in init_traps

2017-03-30 Thread Wei Chen
On 2017/3/31 6:29, Stefano Stabellini wrote: > On Thu, 30 Mar 2017, Julien Grall wrote: >> Hi Wei, >> >> On 30/03/17 10:13, Wei Chen wrote: >>> We will set HCR_EL2 for each domain individually at the place where each >>> domain is created. vwfi will aff

[Xen-devel] [PATCH v4] xen/arm32: Introduce alternative runtime patching

2017-03-31 Thread Wei Chen
the page.h of ARM32 doesn't include alternative.h, and we don't have the reason to include it to ARM32 page.h now. So we have to include the alternative.h directly in livepatch.c. Signed-off-by: Wei Chen Reviewed-by: Konrad Rzeszutek Wilk --- v3->v4: 1. Use open-code to replace the m

Re: [Xen-devel] [PATCH v2 04/19] xen/arm: Restore HCR_EL2 register

2017-03-31 Thread Wei Chen
On 2017/3/31 16:39, Julien Grall wrote: > Hi Wei, > > On 03/31/2017 03:10 AM, Wei Chen wrote: >> Hi Julien and Stefano, >> >> On 2017/3/31 6:03, Stefano Stabellini wrote: >>> On Thu, 30 Mar 2017, Julien Grall wrote: >>>> Hi Wei, >>>> &g

Re: [Xen-devel] [PATCH v2 16/19] xen/arm: Introduce a helper to synchronize SError

2017-03-31 Thread Wei Chen
Hi Julien, On 2017/3/31 2:38, Julien Grall wrote: > > > On 30/03/17 19:32, Julien Grall wrote: >> On 30/03/17 19:28, Julien Grall wrote: >>> Hi Wei, >>> >>> On 30/03/17 10:13, Wei Chen wrote: >>>> +void synchronize_serror(void) >>> &

Re: [Xen-devel] [PATCH v2 16/19] xen/arm: Introduce a helper to synchronize SError

2017-03-31 Thread Wei Chen
On 2017/3/31 19:06, Julien Grall wrote: > > > On 31/03/17 11:55, Wei Chen wrote: >> Hi Julien, > > Hi Wei, > >> On 2017/3/31 2:38, Julien Grall wrote: >>> >>> >>> On 30/03/17 19:32, Julien Grall wrote: >>>> On 30/03/17 19:28,

[Xen-devel] [PATCH v3 00/19] Provide a command line option to choose how to handle SErrors

2017-03-31 Thread Wei Chen
aced in separated patchs. Wei Chen (19): xen/arm: Save ESR_EL2 to avoid using mismatched value in syndrome check xen/arm: Introduce a helper to get default HCR_EL2 flags xen/arm: Set and restore HCR_EL2 register for each vCPU separately xen/arm: Avoid setting/clearing HCR_RW at every con

[Xen-devel] [PATCH v3 05/19] xen/arm: Save HCR_EL2 when a guest took the SError

2017-03-31 Thread Wei Chen
restore it to HCR_EL2 when context switch to this guest. This is achieved by writing saved HCR_EL2 value in guest context back to HCR_EL2 register before return to guest. This had been done by the patch of "Restore HCR_EL2 register". Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini

[Xen-devel] [PATCH v3 04/19] xen/arm: Avoid setting/clearing HCR_RW at every context switch

2017-03-31 Thread Wei Chen
W at every context switch. Signed-off-by: Wei Chen Acked-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/arm64/domctl.c | 6 ++ xen/arch/arm/domain.c| 5 + xen/arch/arm/domain_build.c | 7 +++ xen/arch/arm/p2m.c | 5 - xen/include/asm-ar

[Xen-devel] [PATCH v3 01/19] xen/arm: Save ESR_EL2 to avoid using mismatched value in syndrome check

2017-03-31 Thread Wei Chen
dp to restore ELR and CPSR from stack at the same time. We have to use ldr to restore them separately. Signed-off-by: Wei Chen --- Note: This patch is a bug fix, this bug affects the 4.8 and 4.7 source trees too. v2->v3: 1. Add note to the commit message. 2. Read ESR_EL2 value from vCPU context in

[Xen-devel] [PATCH v3 02/19] xen/arm: Introduce a helper to get default HCR_EL2 flags

2017-03-31 Thread Wei Chen
We want to add HCR_EL2 register to Xen context switch. And each copy of HCR_EL2 in vcpu structure will be initialized with the same set of trap flags as the HCR_EL2 register. We introduce a helper here to represent these flags to be reused easily. Signed-off-by: Wei Chen --- xen/arch/arm

[Xen-devel] [PATCH v3 03/19] xen/arm: Set and restore HCR_EL2 register for each vCPU separately

2017-03-31 Thread Wei Chen
s write to restore the HCR_EL2 for each vCPU. Of course, the value of each vCPU's HCR_EL2 should be adjusted to have proper HCR_EL2.RW bit in this function. In the later patch of this series, we will set the HCR_EL2.RW for each vCPU while the domain is creating. Signed-off-by: wei chen --- v2->v

[Xen-devel] [PATCH v3 08/19] xen/arm: Introduce a initcall to update cpu_hwcaps by serror_op

2017-03-31 Thread Wei Chen
, this may change in the future. So we introduce this initcall to guarantee the cpu_hwcaps can be updated no matter the serror parameter is placed in the command line or not. Signed-off-by: Wei Chen Acked-by: Julien Grall Reviewed-by: Stefano Stabellini --- v2->v3 1. Rewrite the commit message to

[Xen-devel] [PATCH v3 09/19] xen/arm64: Use alternative to skip the check of pending serrors

2017-03-31 Thread Wei Chen
ARM64 supports the alternative patching feature. We can use an ALTERNATIVE to avoid checking option at every trap. We added a new cpufeature named "SKIP_CHECK_PENDING_VSERROR". This feature will be enabled when the option is not diverse. Signed-off-by: Wei Chen Reviewed-by: Stefano

[Xen-devel] [PATCH v3 13/19] xen/arm: Replace do_trap_guest_serror with new helpers

2017-03-31 Thread Wei Chen
We have introduced two helpers to handle the guest/hyp SErrors: do_trap_guest_serror and do_trap_guest_hyp_serror. These handlers can take the role of do_trap_guest_serror and reduce the assembly code in the same time. So we use these two helpers to replace it and drop it now. Signed-off-by: Wei

[Xen-devel] [PATCH v3 11/19] xen/arm: Move macro VABORT_GEN_BY_GUEST to common header

2017-03-31 Thread Wei Chen
abort_guest_exit_start and abort_guest_exit_end. After we move this macro to a common header, we need to make sure that the two symbols are visible to other source files. Currently, they are declared .global in arm32/entry.S, but not arm64/entry.S. Fix that. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini

[Xen-devel] [PATCH v3 06/19] xen/arm: Introduce a virtual abort injection helper

2017-03-31 Thread Wei Chen
this series, we use #if 0 to disable it in this patch temporarily to remove the warning message of unused function from compiler. Signed-off-by: Wei Chen Acked-by: Stefano Stabellini Reviewed-by: Stefano Stabellini --- v2->v3: 1. After updating HCR_EL2.VSE bit of vCPU HCR_EL2, write

[Xen-devel] [PATCH v3 12/19] xen/arm: Introduce new helpers to handle guest/hyp SErrors

2017-03-31 Thread Wei Chen
Error, that would be a bug. In the new helpers, we have used the function "inject_vabt_exception" which was disabled by "#if 0" before. Now, we can remove the "#if 0" to make this function to be available. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- x

[Xen-devel] [PATCH v3 07/19] xen/arm: Introduce a command line parameter for SErrors/Aborts

2017-03-31 Thread Wei Chen
on will avoid all overhead of the dsb/isb pairs. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- v2->v3: 1. Replace "entries" to "entries and exits" in commit message and doc. because all options will take effect on entries and exits. 2. Fix a typo in co

[Xen-devel] [PATCH v3 14/19] xen/arm: Unmask the Abort/SError bit in the exception entries

2017-03-31 Thread Wei Chen
t in order to avoid receiving nested asynchronous abort, we don't unmask Abort/SError bit in hyp_error and trap_data_abort. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- xen/arch/arm/arm32/entry.S | 15 ++- xen/arch/arm/arm64/entry.S | 13 - 2 fi

[Xen-devel] [PATCH v3 18/19] xen/arm: Prevent slipping hypervisor SError to guest

2017-03-31 Thread Wei Chen
have to disable the Abort/SError before returning to guest as we have done for IRQ. Signed-off-by: Wei Chen --- v2->v3: 1. Use alternative instead of check serror_op to skip sychronizing SErrors while option is NOT "DIVERSE". 2. Disable Abort/SError before returning to

[Xen-devel] [PATCH v3 10/19] xen/arm32: Use alternative to skip the check of pending serrors

2017-03-31 Thread Wei Chen
ARM32 supports the alternative patching feature. We can use an ALTERNATIVE to avoid checking option at every trap. We added a new cpufeature named "SKIP_CHECK_PENDING_VSERROR". This feature will be enabled when the option is not diverse. Signed-off-by: Wei Chen Reviewed-by: Julien Grall

[Xen-devel] [PATCH v3 19/19] xen/arm: Handle guest external abort as guest SError

2017-03-31 Thread Wei Chen
The guest generated external data/instruction aborts can be treated as guest SErrors. We already have a handler to handle the SErrors, so we can reuse this handler to handle guest external aborts. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- xen/arch/arm/traps.c | 14

  1   2   3   >