All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 00/29] KVM/ARM Changes for v4.7
@ 2016-05-11 13:29 ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Christoffer Dall

Hi Paolo and Radim,

Here is the initial set of changes for KVM/ARM for v4.7.

Sorry I'm a bit late with these, but we were trying to get the new vgic
implementation in as part of this, but I have decided to send this pull
request now, and we can follow up with another for the new VGIC,
assuming we feel like we have that in place in a few days.

There are a few changes in this pull request touching things outside
KVM, but they should all carry the necessary acks and it made the
merge process much easier to do it this way.

Hope this works for you guys.

For a description of the content, see below; otherwise:

The following changes since commit 06a71a24bae57a07afee9cda6b00495347d8a448:

  arm64: KVM: unregister notifiers in hyp mode teardown path (2016-04-06 13:47:52 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvm-arm-for-4.7

for you to fetch changes up to 06485053244480f5f403d8f89b8617bd7d549113:

  kvm: arm64: Enable hardware updates of the Access Flag for Stage 2 page tables (2016-05-09 22:23:08 +0200)


Thanks,
-Christoffer

----------------------------------------------------------------
KVM/ARM Changes for Linux v4.7

Reworks our stage 2 page table handling to have page table manipulation
macros separate from those of the host systems as the underlying
hardware page tables can be configured to be noticably different in
layout from the stage 1 page tables used by the host.

Adds 16K page size support based on the above.

Adds a generic firmware probing layer for the timer and GIC so that KVM
initializes using the same logic based on both ACPI and FDT.

Finally adds support for hardware updating of the access flag.

----------------------------------------------------------------
Catalin Marinas (1):
      kvm: arm64: Enable hardware updates of the Access Flag for Stage 2 page tables

Julien Grall (10):
      clocksource: arm_arch_timer: Gather KVM specific information in a structure
      clocksource: arm_arch_timer: Extend arch_timer_kvm_info to get the virtual IRQ
      irqchip/gic-v2: Gather ACPI specific data in a single structure
      irqchip/gic-v2: Parse and export virtual GIC information
      irqchip/gic-v3: Prefix all pr_* messages by "GICv3: "
      irqchip/gic-v3: Gather all ACPI specific data in a single structure
      irqchip/gic-v3: Parse and export virtual GIC information
      KVM: arm/arm64: arch_timer: Rely on the arch timer to parse the firmware tables
      KVM: arm/arm64: vgic: Rely on the GIC driver to parse the firmware tables
      clocksource: arm_arch_timer: Remove arch_timer_get_timecounter

Marc Zyngier (1):
      arm/arm64: KVM: Enforce Break-Before-Make on Stage-2 page tables

Suzuki K Poulose (17):
      arm64: Reuse TCR field definitions for EL1 and EL2
      arm64: Cleanup VTCR_EL2 and VTTBR field values
      kvm arm: Move fake PGD handling to arch specific files
      arm64: Introduce pmd_thp_or_huge
      kvm-arm: Replace kvm_pmd_huge with pmd_thp_or_huge
      kvm-arm: Remove kvm_pud_huge()
      kvm-arm: arm32: Introduce stage2 page table helpers
      kvm-arm: arm: Introduce hyp page table empty checks
      kvm-arm: arm64: Introduce stage2 page table helpers
      kvm-arm: arm64: Introduce hyp page table empty checks
      kvm-arm: Use explicit stage2 helper routines
      kvm-arm: Add explicit hyp page table modifiers
      kvm-arm: Add stage2 page table modifiers
      kvm-arm: Cleanup kvm_* wrappers
      kvm: arm64: Get rid of fake page table levels
      kvm-arm: Cleanup stage2 pgd handling
      arm64: kvm: Add support for 16K pages

 arch/arm/include/asm/kvm_mmu.h                |  43 +--
 arch/arm/include/asm/stage2_pgtable.h         |  61 ++++
 arch/arm/kvm/arm.c                            |   2 +-
 arch/arm/kvm/mmu.c                            | 408 ++++++++++++++------------
 arch/arm64/include/asm/kvm_arm.h              |  85 +++---
 arch/arm64/include/asm/kvm_mmu.h              | 111 ++-----
 arch/arm64/include/asm/pgtable-hwdef.h        |  80 +++--
 arch/arm64/include/asm/pgtable.h              |  15 +-
 arch/arm64/include/asm/stage2_pgtable-nopmd.h |  42 +++
 arch/arm64/include/asm/stage2_pgtable-nopud.h |  39 +++
 arch/arm64/include/asm/stage2_pgtable.h       | 142 +++++++++
 arch/arm64/kvm/Kconfig                        |   1 -
 arch/arm64/kvm/hyp/s2-setup.c                 |   8 +
 drivers/clocksource/arm_arch_timer.c          |  11 +-
 drivers/irqchip/irq-gic-common.c              |  13 +
 drivers/irqchip/irq-gic-common.h              |   3 +
 drivers/irqchip/irq-gic-v3.c                  | 176 +++++++++--
 drivers/irqchip/irq-gic.c                     |  87 +++++-
 include/clocksource/arm_arch_timer.h          |  12 +-
 include/kvm/arm_vgic.h                        |   7 +-
 include/linux/irqchip/arm-gic-common.h        |  34 +++
 virt/kvm/arm/arch_timer.c                     |  40 +--
 virt/kvm/arm/vgic-v2.c                        |  61 ++--
 virt/kvm/arm/vgic-v3.c                        |  47 +--
 virt/kvm/arm/vgic.c                           |  50 ++--
 25 files changed, 1053 insertions(+), 525 deletions(-)
 create mode 100644 arch/arm/include/asm/stage2_pgtable.h
 create mode 100644 arch/arm64/include/asm/stage2_pgtable-nopmd.h
 create mode 100644 arch/arm64/include/asm/stage2_pgtable-nopud.h
 create mode 100644 arch/arm64/include/asm/stage2_pgtable.h
 create mode 100644 include/linux/irqchip/arm-gic-common.h

^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PULL 00/29] KVM/ARM Changes for v4.7
@ 2016-05-11 13:29 ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paolo and Radim,

Here is the initial set of changes for KVM/ARM for v4.7.

Sorry I'm a bit late with these, but we were trying to get the new vgic
implementation in as part of this, but I have decided to send this pull
request now, and we can follow up with another for the new VGIC,
assuming we feel like we have that in place in a few days.

There are a few changes in this pull request touching things outside
KVM, but they should all carry the necessary acks and it made the
merge process much easier to do it this way.

Hope this works for you guys.

For a description of the content, see below; otherwise:

The following changes since commit 06a71a24bae57a07afee9cda6b00495347d8a448:

  arm64: KVM: unregister notifiers in hyp mode teardown path (2016-04-06 13:47:52 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvm-arm-for-4.7

for you to fetch changes up to 06485053244480f5f403d8f89b8617bd7d549113:

  kvm: arm64: Enable hardware updates of the Access Flag for Stage 2 page tables (2016-05-09 22:23:08 +0200)


Thanks,
-Christoffer

----------------------------------------------------------------
KVM/ARM Changes for Linux v4.7

Reworks our stage 2 page table handling to have page table manipulation
macros separate from those of the host systems as the underlying
hardware page tables can be configured to be noticably different in
layout from the stage 1 page tables used by the host.

Adds 16K page size support based on the above.

Adds a generic firmware probing layer for the timer and GIC so that KVM
initializes using the same logic based on both ACPI and FDT.

Finally adds support for hardware updating of the access flag.

----------------------------------------------------------------
Catalin Marinas (1):
      kvm: arm64: Enable hardware updates of the Access Flag for Stage 2 page tables

Julien Grall (10):
      clocksource: arm_arch_timer: Gather KVM specific information in a structure
      clocksource: arm_arch_timer: Extend arch_timer_kvm_info to get the virtual IRQ
      irqchip/gic-v2: Gather ACPI specific data in a single structure
      irqchip/gic-v2: Parse and export virtual GIC information
      irqchip/gic-v3: Prefix all pr_* messages by "GICv3: "
      irqchip/gic-v3: Gather all ACPI specific data in a single structure
      irqchip/gic-v3: Parse and export virtual GIC information
      KVM: arm/arm64: arch_timer: Rely on the arch timer to parse the firmware tables
      KVM: arm/arm64: vgic: Rely on the GIC driver to parse the firmware tables
      clocksource: arm_arch_timer: Remove arch_timer_get_timecounter

Marc Zyngier (1):
      arm/arm64: KVM: Enforce Break-Before-Make on Stage-2 page tables

Suzuki K Poulose (17):
      arm64: Reuse TCR field definitions for EL1 and EL2
      arm64: Cleanup VTCR_EL2 and VTTBR field values
      kvm arm: Move fake PGD handling to arch specific files
      arm64: Introduce pmd_thp_or_huge
      kvm-arm: Replace kvm_pmd_huge with pmd_thp_or_huge
      kvm-arm: Remove kvm_pud_huge()
      kvm-arm: arm32: Introduce stage2 page table helpers
      kvm-arm: arm: Introduce hyp page table empty checks
      kvm-arm: arm64: Introduce stage2 page table helpers
      kvm-arm: arm64: Introduce hyp page table empty checks
      kvm-arm: Use explicit stage2 helper routines
      kvm-arm: Add explicit hyp page table modifiers
      kvm-arm: Add stage2 page table modifiers
      kvm-arm: Cleanup kvm_* wrappers
      kvm: arm64: Get rid of fake page table levels
      kvm-arm: Cleanup stage2 pgd handling
      arm64: kvm: Add support for 16K pages

 arch/arm/include/asm/kvm_mmu.h                |  43 +--
 arch/arm/include/asm/stage2_pgtable.h         |  61 ++++
 arch/arm/kvm/arm.c                            |   2 +-
 arch/arm/kvm/mmu.c                            | 408 ++++++++++++++------------
 arch/arm64/include/asm/kvm_arm.h              |  85 +++---
 arch/arm64/include/asm/kvm_mmu.h              | 111 ++-----
 arch/arm64/include/asm/pgtable-hwdef.h        |  80 +++--
 arch/arm64/include/asm/pgtable.h              |  15 +-
 arch/arm64/include/asm/stage2_pgtable-nopmd.h |  42 +++
 arch/arm64/include/asm/stage2_pgtable-nopud.h |  39 +++
 arch/arm64/include/asm/stage2_pgtable.h       | 142 +++++++++
 arch/arm64/kvm/Kconfig                        |   1 -
 arch/arm64/kvm/hyp/s2-setup.c                 |   8 +
 drivers/clocksource/arm_arch_timer.c          |  11 +-
 drivers/irqchip/irq-gic-common.c              |  13 +
 drivers/irqchip/irq-gic-common.h              |   3 +
 drivers/irqchip/irq-gic-v3.c                  | 176 +++++++++--
 drivers/irqchip/irq-gic.c                     |  87 +++++-
 include/clocksource/arm_arch_timer.h          |  12 +-
 include/kvm/arm_vgic.h                        |   7 +-
 include/linux/irqchip/arm-gic-common.h        |  34 +++
 virt/kvm/arm/arch_timer.c                     |  40 +--
 virt/kvm/arm/vgic-v2.c                        |  61 ++--
 virt/kvm/arm/vgic-v3.c                        |  47 +--
 virt/kvm/arm/vgic.c                           |  50 ++--
 25 files changed, 1053 insertions(+), 525 deletions(-)
 create mode 100644 arch/arm/include/asm/stage2_pgtable.h
 create mode 100644 arch/arm64/include/asm/stage2_pgtable-nopmd.h
 create mode 100644 arch/arm64/include/asm/stage2_pgtable-nopud.h
 create mode 100644 arch/arm64/include/asm/stage2_pgtable.h
 create mode 100644 include/linux/irqchip/arm-gic-common.h

^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PULL 01/29] arm64: Reuse TCR field definitions for EL1 and EL2
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:29   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Suzuki K Poulose,
	Catalin Marinas, Mark Rutland

From: Suzuki K Poulose <suzuki.poulose@arm.com>

TCR_EL1, TCR_EL2 and VTCR_EL2, all share some field positions
(TG0, ORGN0, IRGN0 and SH0) and their corresponding value definitions.

This patch makes the TCR_EL1 definitions reusable and uses them for TCR_EL2
and VTCR_EL2 fields.

This also fixes a bug where we assume TG0 in {V}TCR_EL2 is 1bit field.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_arm.h       | 48 ++++++++++----------
 arch/arm64/include/asm/pgtable-hwdef.h | 80 ++++++++++++++++++++++++++--------
 2 files changed, 88 insertions(+), 40 deletions(-)

diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index 3f29887..a46b39f 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -96,32 +96,34 @@
 			 SCTLR_EL2_SA | SCTLR_EL2_I)
 
 /* TCR_EL2 Registers bits */
-#define TCR_EL2_RES1	((1 << 31) | (1 << 23))
-#define TCR_EL2_TBI	(1 << 20)
-#define TCR_EL2_PS	(7 << 16)
-#define TCR_EL2_PS_40B	(2 << 16)
-#define TCR_EL2_TG0	(1 << 14)
-#define TCR_EL2_SH0	(3 << 12)
-#define TCR_EL2_ORGN0	(3 << 10)
-#define TCR_EL2_IRGN0	(3 << 8)
-#define TCR_EL2_T0SZ	0x3f
-#define TCR_EL2_MASK	(TCR_EL2_TG0 | TCR_EL2_SH0 | \
-			 TCR_EL2_ORGN0 | TCR_EL2_IRGN0 | TCR_EL2_T0SZ)
+#define TCR_EL2_RES1		((1 << 31) | (1 << 23))
+#define TCR_EL2_TBI		(1 << 20)
+#define TCR_EL2_PS_SHIFT	16
+#define TCR_EL2_PS_MASK		(7 << TCR_EL2_PS_SHIFT)
+#define TCR_EL2_PS_40B		(2 << TCR_EL2_PS_SHIFT)
+#define TCR_EL2_TG0_MASK	TCR_TG0_MASK
+#define TCR_EL2_SH0_MASK	TCR_SH0_MASK
+#define TCR_EL2_ORGN0_MASK	TCR_ORGN0_MASK
+#define TCR_EL2_IRGN0_MASK	TCR_IRGN0_MASK
+#define TCR_EL2_T0SZ_MASK	0x3f
+#define TCR_EL2_MASK	(TCR_EL2_TG0_MASK | TCR_EL2_SH0_MASK | \
+			 TCR_EL2_ORGN0_MASK | TCR_EL2_IRGN0_MASK | TCR_EL2_T0SZ_MASK)
 
 /* VTCR_EL2 Registers bits */
 #define VTCR_EL2_RES1		(1 << 31)
-#define VTCR_EL2_PS_MASK	(7 << 16)
-#define VTCR_EL2_TG0_MASK	(1 << 14)
-#define VTCR_EL2_TG0_4K		(0 << 14)
-#define VTCR_EL2_TG0_64K	(1 << 14)
-#define VTCR_EL2_SH0_MASK	(3 << 12)
-#define VTCR_EL2_SH0_INNER	(3 << 12)
-#define VTCR_EL2_ORGN0_MASK	(3 << 10)
-#define VTCR_EL2_ORGN0_WBWA	(1 << 10)
-#define VTCR_EL2_IRGN0_MASK	(3 << 8)
-#define VTCR_EL2_IRGN0_WBWA	(1 << 8)
-#define VTCR_EL2_SL0_MASK	(3 << 6)
-#define VTCR_EL2_SL0_LVL1	(1 << 6)
+#define VTCR_EL2_PS_MASK	TCR_EL2_PS_MASK
+#define VTCR_EL2_TG0_MASK	TCR_TG0_MASK
+#define VTCR_EL2_TG0_4K		TCR_TG0_4K
+#define VTCR_EL2_TG0_64K	TCR_TG0_64K
+#define VTCR_EL2_SH0_MASK	TCR_SH0_MASK
+#define VTCR_EL2_SH0_INNER	TCR_SH0_INNER
+#define VTCR_EL2_ORGN0_MASK	TCR_ORGN0_MASK
+#define VTCR_EL2_ORGN0_WBWA	TCR_ORGN0_WBWA
+#define VTCR_EL2_IRGN0_MASK	TCR_IRGN0_MASK
+#define VTCR_EL2_IRGN0_WBWA	TCR_IRGN0_WBWA
+#define VTCR_EL2_SL0_SHIFT	6
+#define VTCR_EL2_SL0_MASK	(3 << VTCR_EL2_SL0_SHIFT)
+#define VTCR_EL2_SL0_LVL1	(1 << VTCR_EL2_SL0_SHIFT)
 #define VTCR_EL2_T0SZ_MASK	0x3f
 #define VTCR_EL2_T0SZ_40B	24
 #define VTCR_EL2_VS_SHIFT	19
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
index 5c25b83..936f173 100644
--- a/arch/arm64/include/asm/pgtable-hwdef.h
+++ b/arch/arm64/include/asm/pgtable-hwdef.h
@@ -208,23 +208,69 @@
 #define TCR_T1SZ(x)		((UL(64) - (x)) << TCR_T1SZ_OFFSET)
 #define TCR_TxSZ(x)		(TCR_T0SZ(x) | TCR_T1SZ(x))
 #define TCR_TxSZ_WIDTH		6
-#define TCR_IRGN_NC		((UL(0) << 8) | (UL(0) << 24))
-#define TCR_IRGN_WBWA		((UL(1) << 8) | (UL(1) << 24))
-#define TCR_IRGN_WT		((UL(2) << 8) | (UL(2) << 24))
-#define TCR_IRGN_WBnWA		((UL(3) << 8) | (UL(3) << 24))
-#define TCR_IRGN_MASK		((UL(3) << 8) | (UL(3) << 24))
-#define TCR_ORGN_NC		((UL(0) << 10) | (UL(0) << 26))
-#define TCR_ORGN_WBWA		((UL(1) << 10) | (UL(1) << 26))
-#define TCR_ORGN_WT		((UL(2) << 10) | (UL(2) << 26))
-#define TCR_ORGN_WBnWA		((UL(3) << 10) | (UL(3) << 26))
-#define TCR_ORGN_MASK		((UL(3) << 10) | (UL(3) << 26))
-#define TCR_SHARED		((UL(3) << 12) | (UL(3) << 28))
-#define TCR_TG0_4K		(UL(0) << 14)
-#define TCR_TG0_64K		(UL(1) << 14)
-#define TCR_TG0_16K		(UL(2) << 14)
-#define TCR_TG1_16K		(UL(1) << 30)
-#define TCR_TG1_4K		(UL(2) << 30)
-#define TCR_TG1_64K		(UL(3) << 30)
+
+#define TCR_IRGN0_SHIFT		8
+#define TCR_IRGN0_MASK		(UL(3) << TCR_IRGN0_SHIFT)
+#define TCR_IRGN0_NC		(UL(0) << TCR_IRGN0_SHIFT)
+#define TCR_IRGN0_WBWA		(UL(1) << TCR_IRGN0_SHIFT)
+#define TCR_IRGN0_WT		(UL(2) << TCR_IRGN0_SHIFT)
+#define TCR_IRGN0_WBnWA		(UL(3) << TCR_IRGN0_SHIFT)
+
+#define TCR_IRGN1_SHIFT		24
+#define TCR_IRGN1_MASK		(UL(3) << TCR_IRGN1_SHIFT)
+#define TCR_IRGN1_NC		(UL(0) << TCR_IRGN1_SHIFT)
+#define TCR_IRGN1_WBWA		(UL(1) << TCR_IRGN1_SHIFT)
+#define TCR_IRGN1_WT		(UL(2) << TCR_IRGN1_SHIFT)
+#define TCR_IRGN1_WBnWA		(UL(3) << TCR_IRGN1_SHIFT)
+
+#define TCR_IRGN_NC		(TCR_IRGN0_NC | TCR_IRGN1_NC)
+#define TCR_IRGN_WBWA		(TCR_IRGN0_WBWA | TCR_IRGN1_WBWA)
+#define TCR_IRGN_WT		(TCR_IRGN0_WT | TCR_IRGN1_WT)
+#define TCR_IRGN_WBnWA		(TCR_IRGN0_WBnWA | TCR_IRGN1_WBnWA)
+#define TCR_IRGN_MASK		(TCR_IRGN0_MASK | TCR_IRGN1_MASK)
+
+
+#define TCR_ORGN0_SHIFT		10
+#define TCR_ORGN0_MASK		(UL(3) << TCR_ORGN0_SHIFT)
+#define TCR_ORGN0_NC		(UL(0) << TCR_ORGN0_SHIFT)
+#define TCR_ORGN0_WBWA		(UL(1) << TCR_ORGN0_SHIFT)
+#define TCR_ORGN0_WT		(UL(2) << TCR_ORGN0_SHIFT)
+#define TCR_ORGN0_WBnWA		(UL(3) << TCR_ORGN0_SHIFT)
+
+#define TCR_ORGN1_SHIFT		26
+#define TCR_ORGN1_MASK		(UL(3) << TCR_ORGN1_SHIFT)
+#define TCR_ORGN1_NC		(UL(0) << TCR_ORGN1_SHIFT)
+#define TCR_ORGN1_WBWA		(UL(1) << TCR_ORGN1_SHIFT)
+#define TCR_ORGN1_WT		(UL(2) << TCR_ORGN1_SHIFT)
+#define TCR_ORGN1_WBnWA		(UL(3) << TCR_ORGN1_SHIFT)
+
+#define TCR_ORGN_NC		(TCR_ORGN0_NC | TCR_ORGN1_NC)
+#define TCR_ORGN_WBWA		(TCR_ORGN0_WBWA | TCR_ORGN1_WBWA)
+#define TCR_ORGN_WT		(TCR_ORGN0_WT | TCR_ORGN1_WT)
+#define TCR_ORGN_WBnWA		(TCR_ORGN0_WBnWA | TCR_ORGN1_WBnWA)
+#define TCR_ORGN_MASK		(TCR_ORGN0_MASK | TCR_ORGN1_MASK)
+
+#define TCR_SH0_SHIFT		12
+#define TCR_SH0_MASK		(UL(3) << TCR_SH0_SHIFT)
+#define TCR_SH0_INNER		(UL(3) << TCR_SH0_SHIFT)
+
+#define TCR_SH1_SHIFT		28
+#define TCR_SH1_MASK		(UL(3) << TCR_SH1_SHIFT)
+#define TCR_SH1_INNER		(UL(3) << TCR_SH1_SHIFT)
+#define TCR_SHARED		(TCR_SH0_INNER | TCR_SH1_INNER)
+
+#define TCR_TG0_SHIFT		14
+#define TCR_TG0_MASK		(UL(3) << TCR_TG0_SHIFT)
+#define TCR_TG0_4K		(UL(0) << TCR_TG0_SHIFT)
+#define TCR_TG0_64K		(UL(1) << TCR_TG0_SHIFT)
+#define TCR_TG0_16K		(UL(2) << TCR_TG0_SHIFT)
+
+#define TCR_TG1_SHIFT		30
+#define TCR_TG1_MASK		(UL(3) << TCR_TG1_SHIFT)
+#define TCR_TG1_16K		(UL(1) << TCR_TG1_SHIFT)
+#define TCR_TG1_4K		(UL(2) << TCR_TG1_SHIFT)
+#define TCR_TG1_64K		(UL(3) << TCR_TG1_SHIFT)
+
 #define TCR_ASID16		(UL(1) << 36)
 #define TCR_TBI0		(UL(1) << 37)
 #define TCR_HA			(UL(1) << 39)
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 01/29] arm64: Reuse TCR field definitions for EL1 and EL2
@ 2016-05-11 13:29   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

TCR_EL1, TCR_EL2 and VTCR_EL2, all share some field positions
(TG0, ORGN0, IRGN0 and SH0) and their corresponding value definitions.

This patch makes the TCR_EL1 definitions reusable and uses them for TCR_EL2
and VTCR_EL2 fields.

This also fixes a bug where we assume TG0 in {V}TCR_EL2 is 1bit field.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_arm.h       | 48 ++++++++++----------
 arch/arm64/include/asm/pgtable-hwdef.h | 80 ++++++++++++++++++++++++++--------
 2 files changed, 88 insertions(+), 40 deletions(-)

diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index 3f29887..a46b39f 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -96,32 +96,34 @@
 			 SCTLR_EL2_SA | SCTLR_EL2_I)
 
 /* TCR_EL2 Registers bits */
-#define TCR_EL2_RES1	((1 << 31) | (1 << 23))
-#define TCR_EL2_TBI	(1 << 20)
-#define TCR_EL2_PS	(7 << 16)
-#define TCR_EL2_PS_40B	(2 << 16)
-#define TCR_EL2_TG0	(1 << 14)
-#define TCR_EL2_SH0	(3 << 12)
-#define TCR_EL2_ORGN0	(3 << 10)
-#define TCR_EL2_IRGN0	(3 << 8)
-#define TCR_EL2_T0SZ	0x3f
-#define TCR_EL2_MASK	(TCR_EL2_TG0 | TCR_EL2_SH0 | \
-			 TCR_EL2_ORGN0 | TCR_EL2_IRGN0 | TCR_EL2_T0SZ)
+#define TCR_EL2_RES1		((1 << 31) | (1 << 23))
+#define TCR_EL2_TBI		(1 << 20)
+#define TCR_EL2_PS_SHIFT	16
+#define TCR_EL2_PS_MASK		(7 << TCR_EL2_PS_SHIFT)
+#define TCR_EL2_PS_40B		(2 << TCR_EL2_PS_SHIFT)
+#define TCR_EL2_TG0_MASK	TCR_TG0_MASK
+#define TCR_EL2_SH0_MASK	TCR_SH0_MASK
+#define TCR_EL2_ORGN0_MASK	TCR_ORGN0_MASK
+#define TCR_EL2_IRGN0_MASK	TCR_IRGN0_MASK
+#define TCR_EL2_T0SZ_MASK	0x3f
+#define TCR_EL2_MASK	(TCR_EL2_TG0_MASK | TCR_EL2_SH0_MASK | \
+			 TCR_EL2_ORGN0_MASK | TCR_EL2_IRGN0_MASK | TCR_EL2_T0SZ_MASK)
 
 /* VTCR_EL2 Registers bits */
 #define VTCR_EL2_RES1		(1 << 31)
-#define VTCR_EL2_PS_MASK	(7 << 16)
-#define VTCR_EL2_TG0_MASK	(1 << 14)
-#define VTCR_EL2_TG0_4K		(0 << 14)
-#define VTCR_EL2_TG0_64K	(1 << 14)
-#define VTCR_EL2_SH0_MASK	(3 << 12)
-#define VTCR_EL2_SH0_INNER	(3 << 12)
-#define VTCR_EL2_ORGN0_MASK	(3 << 10)
-#define VTCR_EL2_ORGN0_WBWA	(1 << 10)
-#define VTCR_EL2_IRGN0_MASK	(3 << 8)
-#define VTCR_EL2_IRGN0_WBWA	(1 << 8)
-#define VTCR_EL2_SL0_MASK	(3 << 6)
-#define VTCR_EL2_SL0_LVL1	(1 << 6)
+#define VTCR_EL2_PS_MASK	TCR_EL2_PS_MASK
+#define VTCR_EL2_TG0_MASK	TCR_TG0_MASK
+#define VTCR_EL2_TG0_4K		TCR_TG0_4K
+#define VTCR_EL2_TG0_64K	TCR_TG0_64K
+#define VTCR_EL2_SH0_MASK	TCR_SH0_MASK
+#define VTCR_EL2_SH0_INNER	TCR_SH0_INNER
+#define VTCR_EL2_ORGN0_MASK	TCR_ORGN0_MASK
+#define VTCR_EL2_ORGN0_WBWA	TCR_ORGN0_WBWA
+#define VTCR_EL2_IRGN0_MASK	TCR_IRGN0_MASK
+#define VTCR_EL2_IRGN0_WBWA	TCR_IRGN0_WBWA
+#define VTCR_EL2_SL0_SHIFT	6
+#define VTCR_EL2_SL0_MASK	(3 << VTCR_EL2_SL0_SHIFT)
+#define VTCR_EL2_SL0_LVL1	(1 << VTCR_EL2_SL0_SHIFT)
 #define VTCR_EL2_T0SZ_MASK	0x3f
 #define VTCR_EL2_T0SZ_40B	24
 #define VTCR_EL2_VS_SHIFT	19
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
index 5c25b83..936f173 100644
--- a/arch/arm64/include/asm/pgtable-hwdef.h
+++ b/arch/arm64/include/asm/pgtable-hwdef.h
@@ -208,23 +208,69 @@
 #define TCR_T1SZ(x)		((UL(64) - (x)) << TCR_T1SZ_OFFSET)
 #define TCR_TxSZ(x)		(TCR_T0SZ(x) | TCR_T1SZ(x))
 #define TCR_TxSZ_WIDTH		6
-#define TCR_IRGN_NC		((UL(0) << 8) | (UL(0) << 24))
-#define TCR_IRGN_WBWA		((UL(1) << 8) | (UL(1) << 24))
-#define TCR_IRGN_WT		((UL(2) << 8) | (UL(2) << 24))
-#define TCR_IRGN_WBnWA		((UL(3) << 8) | (UL(3) << 24))
-#define TCR_IRGN_MASK		((UL(3) << 8) | (UL(3) << 24))
-#define TCR_ORGN_NC		((UL(0) << 10) | (UL(0) << 26))
-#define TCR_ORGN_WBWA		((UL(1) << 10) | (UL(1) << 26))
-#define TCR_ORGN_WT		((UL(2) << 10) | (UL(2) << 26))
-#define TCR_ORGN_WBnWA		((UL(3) << 10) | (UL(3) << 26))
-#define TCR_ORGN_MASK		((UL(3) << 10) | (UL(3) << 26))
-#define TCR_SHARED		((UL(3) << 12) | (UL(3) << 28))
-#define TCR_TG0_4K		(UL(0) << 14)
-#define TCR_TG0_64K		(UL(1) << 14)
-#define TCR_TG0_16K		(UL(2) << 14)
-#define TCR_TG1_16K		(UL(1) << 30)
-#define TCR_TG1_4K		(UL(2) << 30)
-#define TCR_TG1_64K		(UL(3) << 30)
+
+#define TCR_IRGN0_SHIFT		8
+#define TCR_IRGN0_MASK		(UL(3) << TCR_IRGN0_SHIFT)
+#define TCR_IRGN0_NC		(UL(0) << TCR_IRGN0_SHIFT)
+#define TCR_IRGN0_WBWA		(UL(1) << TCR_IRGN0_SHIFT)
+#define TCR_IRGN0_WT		(UL(2) << TCR_IRGN0_SHIFT)
+#define TCR_IRGN0_WBnWA		(UL(3) << TCR_IRGN0_SHIFT)
+
+#define TCR_IRGN1_SHIFT		24
+#define TCR_IRGN1_MASK		(UL(3) << TCR_IRGN1_SHIFT)
+#define TCR_IRGN1_NC		(UL(0) << TCR_IRGN1_SHIFT)
+#define TCR_IRGN1_WBWA		(UL(1) << TCR_IRGN1_SHIFT)
+#define TCR_IRGN1_WT		(UL(2) << TCR_IRGN1_SHIFT)
+#define TCR_IRGN1_WBnWA		(UL(3) << TCR_IRGN1_SHIFT)
+
+#define TCR_IRGN_NC		(TCR_IRGN0_NC | TCR_IRGN1_NC)
+#define TCR_IRGN_WBWA		(TCR_IRGN0_WBWA | TCR_IRGN1_WBWA)
+#define TCR_IRGN_WT		(TCR_IRGN0_WT | TCR_IRGN1_WT)
+#define TCR_IRGN_WBnWA		(TCR_IRGN0_WBnWA | TCR_IRGN1_WBnWA)
+#define TCR_IRGN_MASK		(TCR_IRGN0_MASK | TCR_IRGN1_MASK)
+
+
+#define TCR_ORGN0_SHIFT		10
+#define TCR_ORGN0_MASK		(UL(3) << TCR_ORGN0_SHIFT)
+#define TCR_ORGN0_NC		(UL(0) << TCR_ORGN0_SHIFT)
+#define TCR_ORGN0_WBWA		(UL(1) << TCR_ORGN0_SHIFT)
+#define TCR_ORGN0_WT		(UL(2) << TCR_ORGN0_SHIFT)
+#define TCR_ORGN0_WBnWA		(UL(3) << TCR_ORGN0_SHIFT)
+
+#define TCR_ORGN1_SHIFT		26
+#define TCR_ORGN1_MASK		(UL(3) << TCR_ORGN1_SHIFT)
+#define TCR_ORGN1_NC		(UL(0) << TCR_ORGN1_SHIFT)
+#define TCR_ORGN1_WBWA		(UL(1) << TCR_ORGN1_SHIFT)
+#define TCR_ORGN1_WT		(UL(2) << TCR_ORGN1_SHIFT)
+#define TCR_ORGN1_WBnWA		(UL(3) << TCR_ORGN1_SHIFT)
+
+#define TCR_ORGN_NC		(TCR_ORGN0_NC | TCR_ORGN1_NC)
+#define TCR_ORGN_WBWA		(TCR_ORGN0_WBWA | TCR_ORGN1_WBWA)
+#define TCR_ORGN_WT		(TCR_ORGN0_WT | TCR_ORGN1_WT)
+#define TCR_ORGN_WBnWA		(TCR_ORGN0_WBnWA | TCR_ORGN1_WBnWA)
+#define TCR_ORGN_MASK		(TCR_ORGN0_MASK | TCR_ORGN1_MASK)
+
+#define TCR_SH0_SHIFT		12
+#define TCR_SH0_MASK		(UL(3) << TCR_SH0_SHIFT)
+#define TCR_SH0_INNER		(UL(3) << TCR_SH0_SHIFT)
+
+#define TCR_SH1_SHIFT		28
+#define TCR_SH1_MASK		(UL(3) << TCR_SH1_SHIFT)
+#define TCR_SH1_INNER		(UL(3) << TCR_SH1_SHIFT)
+#define TCR_SHARED		(TCR_SH0_INNER | TCR_SH1_INNER)
+
+#define TCR_TG0_SHIFT		14
+#define TCR_TG0_MASK		(UL(3) << TCR_TG0_SHIFT)
+#define TCR_TG0_4K		(UL(0) << TCR_TG0_SHIFT)
+#define TCR_TG0_64K		(UL(1) << TCR_TG0_SHIFT)
+#define TCR_TG0_16K		(UL(2) << TCR_TG0_SHIFT)
+
+#define TCR_TG1_SHIFT		30
+#define TCR_TG1_MASK		(UL(3) << TCR_TG1_SHIFT)
+#define TCR_TG1_16K		(UL(1) << TCR_TG1_SHIFT)
+#define TCR_TG1_4K		(UL(2) << TCR_TG1_SHIFT)
+#define TCR_TG1_64K		(UL(3) << TCR_TG1_SHIFT)
+
 #define TCR_ASID16		(UL(1) << 36)
 #define TCR_TBI0		(UL(1) << 37)
 #define TCR_HA			(UL(1) << 39)
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 02/29] arm64: Cleanup VTCR_EL2 and VTTBR field values
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:29   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Suzuki K Poulose

From: Suzuki K Poulose <suzuki.poulose@arm.com>

We share most of the bits for VTCR_EL2 for different page sizes,
except for the TG0 value and the entry level value. This patch
makes the definitions a bit more cleaner to reflect this fact.

Also cleans up the VTTBR_X calculation. No functional changes.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_arm.h | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index a46b39f..1281d98 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -144,30 +144,32 @@
  * The magic numbers used for VTTBR_X in this patch can be found in Tables
  * D4-23 and D4-25 in ARM DDI 0487A.b.
  */
+
+#define VTCR_EL2_T0SZ_IPA	VTCR_EL2_T0SZ_40B
+#define VTCR_EL2_COMMON_BITS	(VTCR_EL2_SH0_INNER | VTCR_EL2_ORGN0_WBWA | \
+				 VTCR_EL2_IRGN0_WBWA | VTCR_EL2_RES1)
+
 #ifdef CONFIG_ARM64_64K_PAGES
 /*
  * Stage2 translation configuration:
- * 40bits input  (T0SZ = 24)
  * 64kB pages (TG0 = 1)
  * 2 level page tables (SL = 1)
  */
-#define VTCR_EL2_FLAGS		(VTCR_EL2_TG0_64K | VTCR_EL2_SH0_INNER | \
-				 VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \
-				 VTCR_EL2_SL0_LVL1 | VTCR_EL2_RES1)
-#define VTTBR_X		(38 - VTCR_EL2_T0SZ_40B)
+#define VTCR_EL2_TGRAN_FLAGS		(VTCR_EL2_TG0_64K | VTCR_EL2_SL0_LVL1)
+#define VTTBR_X_TGRAN_MAGIC		38
 #else
 /*
  * Stage2 translation configuration:
- * 40bits input  (T0SZ = 24)
  * 4kB pages (TG0 = 0)
  * 3 level page tables (SL = 1)
  */
-#define VTCR_EL2_FLAGS		(VTCR_EL2_TG0_4K | VTCR_EL2_SH0_INNER | \
-				 VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \
-				 VTCR_EL2_SL0_LVL1 | VTCR_EL2_RES1)
-#define VTTBR_X		(37 - VTCR_EL2_T0SZ_40B)
+#define VTCR_EL2_TGRAN_FLAGS		(VTCR_EL2_TG0_4K | VTCR_EL2_SL0_LVL1)
+#define VTTBR_X_TGRAN_MAGIC		37
 #endif
 
+#define VTCR_EL2_FLAGS			(VTCR_EL2_COMMON_BITS | VTCR_EL2_TGRAN_FLAGS)
+#define VTTBR_X				(VTTBR_X_TGRAN_MAGIC - VTCR_EL2_T0SZ_IPA)
+
 #define VTTBR_BADDR_SHIFT (VTTBR_X - 1)
 #define VTTBR_BADDR_MASK  (((UL(1) << (PHYS_MASK_SHIFT - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT)
 #define VTTBR_VMID_SHIFT  (UL(48))
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 02/29] arm64: Cleanup VTCR_EL2 and VTTBR field values
@ 2016-05-11 13:29   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

We share most of the bits for VTCR_EL2 for different page sizes,
except for the TG0 value and the entry level value. This patch
makes the definitions a bit more cleaner to reflect this fact.

Also cleans up the VTTBR_X calculation. No functional changes.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_arm.h | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index a46b39f..1281d98 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -144,30 +144,32 @@
  * The magic numbers used for VTTBR_X in this patch can be found in Tables
  * D4-23 and D4-25 in ARM DDI 0487A.b.
  */
+
+#define VTCR_EL2_T0SZ_IPA	VTCR_EL2_T0SZ_40B
+#define VTCR_EL2_COMMON_BITS	(VTCR_EL2_SH0_INNER | VTCR_EL2_ORGN0_WBWA | \
+				 VTCR_EL2_IRGN0_WBWA | VTCR_EL2_RES1)
+
 #ifdef CONFIG_ARM64_64K_PAGES
 /*
  * Stage2 translation configuration:
- * 40bits input  (T0SZ = 24)
  * 64kB pages (TG0 = 1)
  * 2 level page tables (SL = 1)
  */
-#define VTCR_EL2_FLAGS		(VTCR_EL2_TG0_64K | VTCR_EL2_SH0_INNER | \
-				 VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \
-				 VTCR_EL2_SL0_LVL1 | VTCR_EL2_RES1)
-#define VTTBR_X		(38 - VTCR_EL2_T0SZ_40B)
+#define VTCR_EL2_TGRAN_FLAGS		(VTCR_EL2_TG0_64K | VTCR_EL2_SL0_LVL1)
+#define VTTBR_X_TGRAN_MAGIC		38
 #else
 /*
  * Stage2 translation configuration:
- * 40bits input  (T0SZ = 24)
  * 4kB pages (TG0 = 0)
  * 3 level page tables (SL = 1)
  */
-#define VTCR_EL2_FLAGS		(VTCR_EL2_TG0_4K | VTCR_EL2_SH0_INNER | \
-				 VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \
-				 VTCR_EL2_SL0_LVL1 | VTCR_EL2_RES1)
-#define VTTBR_X		(37 - VTCR_EL2_T0SZ_40B)
+#define VTCR_EL2_TGRAN_FLAGS		(VTCR_EL2_TG0_4K | VTCR_EL2_SL0_LVL1)
+#define VTTBR_X_TGRAN_MAGIC		37
 #endif
 
+#define VTCR_EL2_FLAGS			(VTCR_EL2_COMMON_BITS | VTCR_EL2_TGRAN_FLAGS)
+#define VTTBR_X				(VTTBR_X_TGRAN_MAGIC - VTCR_EL2_T0SZ_IPA)
+
 #define VTTBR_BADDR_SHIFT (VTTBR_X - 1)
 #define VTTBR_BADDR_MASK  (((UL(1) << (PHYS_MASK_SHIFT - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT)
 #define VTTBR_VMID_SHIFT  (UL(48))
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 03/29] kvm arm: Move fake PGD handling to arch specific files
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:29   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: Marc Zyngier, kvmarm, linux-arm-kernel, kvm

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Rearrange the code for fake pgd handling, which is applicable
only for arm64. This will later be removed once we introduce
the stage2 page table walker macros.

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/include/asm/kvm_mmu.h   | 11 ++++++++--
 arch/arm/kvm/mmu.c               | 47 ++++++----------------------------------
 arch/arm64/include/asm/kvm_mmu.h | 43 ++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+), 42 deletions(-)

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index da44be9..c2b2b27 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -161,8 +161,6 @@ static inline bool kvm_page_empty(void *ptr)
 #define kvm_pmd_table_empty(kvm, pmdp) kvm_page_empty(pmdp)
 #define kvm_pud_table_empty(kvm, pudp) (0)
 
-#define KVM_PREALLOC_LEVEL	0
-
 static inline void *kvm_get_hwpgd(struct kvm *kvm)
 {
 	return kvm->arch.pgd;
@@ -173,6 +171,15 @@ static inline unsigned int kvm_get_hwpgd_size(void)
 	return PTRS_PER_S2_PGD * sizeof(pgd_t);
 }
 
+static inline pgd_t *kvm_setup_fake_pgd(pgd_t *hwpgd)
+{
+	return hwpgd;
+}
+
+static inline void kvm_free_fake_pgd(pgd_t *pgd)
+{
+}
+
 struct kvm;
 
 #define kvm_flush_dcache_to_poc(a,l)	__cpuc_flush_dcache_area((a), (l))
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 58dbd5c..774d00b 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -684,47 +684,16 @@ int kvm_alloc_stage2_pgd(struct kvm *kvm)
 	if (!hwpgd)
 		return -ENOMEM;
 
-	/* When the kernel uses more levels of page tables than the
+	/*
+	 * When the kernel uses more levels of page tables than the
 	 * guest, we allocate a fake PGD and pre-populate it to point
 	 * to the next-level page table, which will be the real
 	 * initial page table pointed to by the VTTBR.
-	 *
-	 * When KVM_PREALLOC_LEVEL==2, we allocate a single page for
-	 * the PMD and the kernel will use folded pud.
-	 * When KVM_PREALLOC_LEVEL==1, we allocate 2 consecutive PUD
-	 * pages.
 	 */
-	if (KVM_PREALLOC_LEVEL > 0) {
-		int i;
-
-		/*
-		 * Allocate fake pgd for the page table manipulation macros to
-		 * work.  This is not used by the hardware and we have no
-		 * alignment requirement for this allocation.
-		 */
-		pgd = kmalloc(PTRS_PER_S2_PGD * sizeof(pgd_t),
-				GFP_KERNEL | __GFP_ZERO);
-
-		if (!pgd) {
-			kvm_free_hwpgd(hwpgd);
-			return -ENOMEM;
-		}
-
-		/* Plug the HW PGD into the fake one. */
-		for (i = 0; i < PTRS_PER_S2_PGD; i++) {
-			if (KVM_PREALLOC_LEVEL == 1)
-				pgd_populate(NULL, pgd + i,
-					     (pud_t *)hwpgd + i * PTRS_PER_PUD);
-			else if (KVM_PREALLOC_LEVEL == 2)
-				pud_populate(NULL, pud_offset(pgd, 0) + i,
-					     (pmd_t *)hwpgd + i * PTRS_PER_PMD);
-		}
-	} else {
-		/*
-		 * Allocate actual first-level Stage-2 page table used by the
-		 * hardware for Stage-2 page table walks.
-		 */
-		pgd = (pgd_t *)hwpgd;
+	pgd = kvm_setup_fake_pgd(hwpgd);
+	if (IS_ERR(pgd)) {
+		kvm_free_hwpgd(hwpgd);
+		return PTR_ERR(pgd);
 	}
 
 	kvm_clean_pgd(pgd);
@@ -831,9 +800,7 @@ void kvm_free_stage2_pgd(struct kvm *kvm)
 
 	unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
 	kvm_free_hwpgd(kvm_get_hwpgd(kvm));
-	if (KVM_PREALLOC_LEVEL > 0)
-		kfree(kvm->arch.pgd);
-
+	kvm_free_fake_pgd(kvm->arch.pgd);
 	kvm->arch.pgd = NULL;
 }
 
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 22732a5..9a3409f 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -208,6 +208,49 @@ static inline unsigned int kvm_get_hwpgd_size(void)
 	return PTRS_PER_S2_PGD * sizeof(pgd_t);
 }
 
+/*
+ * Allocate fake pgd for the host kernel page table macros to work.
+ * This is not used by the hardware and we have no alignment
+ * requirement for this allocation.
+ */
+static inline pgd_t *kvm_setup_fake_pgd(pgd_t *hwpgd)
+{
+	int i;
+	pgd_t *pgd;
+
+	if (!KVM_PREALLOC_LEVEL)
+		return hwpgd;
+
+	/*
+	 * When KVM_PREALLOC_LEVEL==2, we allocate a single page for
+	 * the PMD and the kernel will use folded pud.
+	 * When KVM_PREALLOC_LEVEL==1, we allocate 2 consecutive PUD
+	 * pages.
+	 */
+
+	pgd = kmalloc(PTRS_PER_S2_PGD * sizeof(pgd_t),
+			GFP_KERNEL | __GFP_ZERO);
+	if (!pgd)
+		return ERR_PTR(-ENOMEM);
+
+	/* Plug the HW PGD into the fake one. */
+	for (i = 0; i < PTRS_PER_S2_PGD; i++) {
+		if (KVM_PREALLOC_LEVEL == 1)
+			pgd_populate(NULL, pgd + i,
+				     (pud_t *)hwpgd + i * PTRS_PER_PUD);
+		else if (KVM_PREALLOC_LEVEL == 2)
+			pud_populate(NULL, pud_offset(pgd, 0) + i,
+				     (pmd_t *)hwpgd + i * PTRS_PER_PMD);
+	}
+
+	return pgd;
+}
+
+static inline void kvm_free_fake_pgd(pgd_t *pgd)
+{
+	if (KVM_PREALLOC_LEVEL > 0)
+		kfree(pgd);
+}
 static inline bool kvm_page_empty(void *ptr)
 {
 	struct page *ptr_page = virt_to_page(ptr);
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 03/29] kvm arm: Move fake PGD handling to arch specific files
@ 2016-05-11 13:29   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Rearrange the code for fake pgd handling, which is applicable
only for arm64. This will later be removed once we introduce
the stage2 page table walker macros.

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/include/asm/kvm_mmu.h   | 11 ++++++++--
 arch/arm/kvm/mmu.c               | 47 ++++++----------------------------------
 arch/arm64/include/asm/kvm_mmu.h | 43 ++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+), 42 deletions(-)

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index da44be9..c2b2b27 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -161,8 +161,6 @@ static inline bool kvm_page_empty(void *ptr)
 #define kvm_pmd_table_empty(kvm, pmdp) kvm_page_empty(pmdp)
 #define kvm_pud_table_empty(kvm, pudp) (0)
 
-#define KVM_PREALLOC_LEVEL	0
-
 static inline void *kvm_get_hwpgd(struct kvm *kvm)
 {
 	return kvm->arch.pgd;
@@ -173,6 +171,15 @@ static inline unsigned int kvm_get_hwpgd_size(void)
 	return PTRS_PER_S2_PGD * sizeof(pgd_t);
 }
 
+static inline pgd_t *kvm_setup_fake_pgd(pgd_t *hwpgd)
+{
+	return hwpgd;
+}
+
+static inline void kvm_free_fake_pgd(pgd_t *pgd)
+{
+}
+
 struct kvm;
 
 #define kvm_flush_dcache_to_poc(a,l)	__cpuc_flush_dcache_area((a), (l))
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 58dbd5c..774d00b 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -684,47 +684,16 @@ int kvm_alloc_stage2_pgd(struct kvm *kvm)
 	if (!hwpgd)
 		return -ENOMEM;
 
-	/* When the kernel uses more levels of page tables than the
+	/*
+	 * When the kernel uses more levels of page tables than the
 	 * guest, we allocate a fake PGD and pre-populate it to point
 	 * to the next-level page table, which will be the real
 	 * initial page table pointed to by the VTTBR.
-	 *
-	 * When KVM_PREALLOC_LEVEL==2, we allocate a single page for
-	 * the PMD and the kernel will use folded pud.
-	 * When KVM_PREALLOC_LEVEL==1, we allocate 2 consecutive PUD
-	 * pages.
 	 */
-	if (KVM_PREALLOC_LEVEL > 0) {
-		int i;
-
-		/*
-		 * Allocate fake pgd for the page table manipulation macros to
-		 * work.  This is not used by the hardware and we have no
-		 * alignment requirement for this allocation.
-		 */
-		pgd = kmalloc(PTRS_PER_S2_PGD * sizeof(pgd_t),
-				GFP_KERNEL | __GFP_ZERO);
-
-		if (!pgd) {
-			kvm_free_hwpgd(hwpgd);
-			return -ENOMEM;
-		}
-
-		/* Plug the HW PGD into the fake one. */
-		for (i = 0; i < PTRS_PER_S2_PGD; i++) {
-			if (KVM_PREALLOC_LEVEL == 1)
-				pgd_populate(NULL, pgd + i,
-					     (pud_t *)hwpgd + i * PTRS_PER_PUD);
-			else if (KVM_PREALLOC_LEVEL == 2)
-				pud_populate(NULL, pud_offset(pgd, 0) + i,
-					     (pmd_t *)hwpgd + i * PTRS_PER_PMD);
-		}
-	} else {
-		/*
-		 * Allocate actual first-level Stage-2 page table used by the
-		 * hardware for Stage-2 page table walks.
-		 */
-		pgd = (pgd_t *)hwpgd;
+	pgd = kvm_setup_fake_pgd(hwpgd);
+	if (IS_ERR(pgd)) {
+		kvm_free_hwpgd(hwpgd);
+		return PTR_ERR(pgd);
 	}
 
 	kvm_clean_pgd(pgd);
@@ -831,9 +800,7 @@ void kvm_free_stage2_pgd(struct kvm *kvm)
 
 	unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
 	kvm_free_hwpgd(kvm_get_hwpgd(kvm));
-	if (KVM_PREALLOC_LEVEL > 0)
-		kfree(kvm->arch.pgd);
-
+	kvm_free_fake_pgd(kvm->arch.pgd);
 	kvm->arch.pgd = NULL;
 }
 
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 22732a5..9a3409f 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -208,6 +208,49 @@ static inline unsigned int kvm_get_hwpgd_size(void)
 	return PTRS_PER_S2_PGD * sizeof(pgd_t);
 }
 
+/*
+ * Allocate fake pgd for the host kernel page table macros to work.
+ * This is not used by the hardware and we have no alignment
+ * requirement for this allocation.
+ */
+static inline pgd_t *kvm_setup_fake_pgd(pgd_t *hwpgd)
+{
+	int i;
+	pgd_t *pgd;
+
+	if (!KVM_PREALLOC_LEVEL)
+		return hwpgd;
+
+	/*
+	 * When KVM_PREALLOC_LEVEL==2, we allocate a single page for
+	 * the PMD and the kernel will use folded pud.
+	 * When KVM_PREALLOC_LEVEL==1, we allocate 2 consecutive PUD
+	 * pages.
+	 */
+
+	pgd = kmalloc(PTRS_PER_S2_PGD * sizeof(pgd_t),
+			GFP_KERNEL | __GFP_ZERO);
+	if (!pgd)
+		return ERR_PTR(-ENOMEM);
+
+	/* Plug the HW PGD into the fake one. */
+	for (i = 0; i < PTRS_PER_S2_PGD; i++) {
+		if (KVM_PREALLOC_LEVEL == 1)
+			pgd_populate(NULL, pgd + i,
+				     (pud_t *)hwpgd + i * PTRS_PER_PUD);
+		else if (KVM_PREALLOC_LEVEL == 2)
+			pud_populate(NULL, pud_offset(pgd, 0) + i,
+				     (pmd_t *)hwpgd + i * PTRS_PER_PMD);
+	}
+
+	return pgd;
+}
+
+static inline void kvm_free_fake_pgd(pgd_t *pgd)
+{
+	if (KVM_PREALLOC_LEVEL > 0)
+		kfree(pgd);
+}
 static inline bool kvm_page_empty(void *ptr)
 {
 	struct page *ptr_page = virt_to_page(ptr);
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 04/29] arm64: Introduce pmd_thp_or_huge
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:29   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Suzuki K Poulose,
	Catalin Marinas, Steve Capper, Will Deacon

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Add a helper to determine if a given pmd represents a huge page
either by hugetlb or thp, as we have for arm. This will be used
by KVM MMU code.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Steve Capper <steve.capper@linaro.org>
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/pgtable.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 989fef1..dda4aa9 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -290,6 +290,8 @@ static inline pgprot_t mk_sect_prot(pgprot_t prot)
 #define pmd_mkyoung(pmd)	pte_pmd(pte_mkyoung(pmd_pte(pmd)))
 #define pmd_mknotpresent(pmd)	(__pmd(pmd_val(pmd) & ~PMD_TYPE_MASK))
 
+#define pmd_thp_or_huge(pmd)	(pmd_huge(pmd) || pmd_trans_huge(pmd))
+
 #define __HAVE_ARCH_PMD_WRITE
 #define pmd_write(pmd)		pte_write(pmd_pte(pmd))
 
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 04/29] arm64: Introduce pmd_thp_or_huge
@ 2016-05-11 13:29   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Add a helper to determine if a given pmd represents a huge page
either by hugetlb or thp, as we have for arm. This will be used
by KVM MMU code.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Steve Capper <steve.capper@linaro.org>
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/pgtable.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 989fef1..dda4aa9 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -290,6 +290,8 @@ static inline pgprot_t mk_sect_prot(pgprot_t prot)
 #define pmd_mkyoung(pmd)	pte_pmd(pte_mkyoung(pmd_pte(pmd)))
 #define pmd_mknotpresent(pmd)	(__pmd(pmd_val(pmd) & ~PMD_TYPE_MASK))
 
+#define pmd_thp_or_huge(pmd)	(pmd_huge(pmd) || pmd_trans_huge(pmd))
+
 #define __HAVE_ARCH_PMD_WRITE
 #define pmd_write(pmd)		pte_write(pmd_pte(pmd))
 
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 05/29] kvm-arm: Replace kvm_pmd_huge with pmd_thp_or_huge
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:29   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Suzuki K Poulose

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Both arm and arm64 now provides a helper, pmd_thp_or_huge()
to check if the given pmd represents a huge page. Use that
instead of our own custom check.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/kvm/mmu.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 774d00b..7837f0a 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -45,7 +45,6 @@ static phys_addr_t hyp_idmap_vector;
 
 #define hyp_pgd_order get_order(PTRS_PER_PGD * sizeof(pgd_t))
 
-#define kvm_pmd_huge(_x)	(pmd_huge(_x) || pmd_trans_huge(_x))
 #define kvm_pud_huge(_x)	pud_huge(_x)
 
 #define KVM_S2PTE_FLAG_IS_IOMAP		(1UL << 0)
@@ -115,7 +114,7 @@ static bool kvm_is_device_pfn(unsigned long pfn)
  */
 static void stage2_dissolve_pmd(struct kvm *kvm, phys_addr_t addr, pmd_t *pmd)
 {
-	if (!kvm_pmd_huge(*pmd))
+	if (!pmd_thp_or_huge(*pmd))
 		return;
 
 	pmd_clear(pmd);
@@ -177,7 +176,7 @@ static void clear_pud_entry(struct kvm *kvm, pud_t *pud, phys_addr_t addr)
 static void clear_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr)
 {
 	pte_t *pte_table = pte_offset_kernel(pmd, 0);
-	VM_BUG_ON(kvm_pmd_huge(*pmd));
+	VM_BUG_ON(pmd_thp_or_huge(*pmd));
 	pmd_clear(pmd);
 	kvm_tlb_flush_vmid_ipa(kvm, addr);
 	pte_free_kernel(NULL, pte_table);
@@ -240,7 +239,7 @@ static void unmap_pmds(struct kvm *kvm, pud_t *pud,
 	do {
 		next = kvm_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
-			if (kvm_pmd_huge(*pmd)) {
+			if (pmd_thp_or_huge(*pmd)) {
 				pmd_t old_pmd = *pmd;
 
 				pmd_clear(pmd);
@@ -326,7 +325,7 @@ static void stage2_flush_pmds(struct kvm *kvm, pud_t *pud,
 	do {
 		next = kvm_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
-			if (kvm_pmd_huge(*pmd))
+			if (pmd_thp_or_huge(*pmd))
 				kvm_flush_dcache_pmd(*pmd);
 			else
 				stage2_flush_ptes(kvm, pmd, addr, next);
@@ -1050,7 +1049,7 @@ static void stage2_wp_pmds(pud_t *pud, phys_addr_t addr, phys_addr_t end)
 	do {
 		next = kvm_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
-			if (kvm_pmd_huge(*pmd)) {
+			if (pmd_thp_or_huge(*pmd)) {
 				if (!kvm_s2pmd_readonly(pmd))
 					kvm_set_s2pmd_readonly(pmd);
 			} else {
@@ -1331,7 +1330,7 @@ static void handle_access_fault(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa)
 	if (!pmd || pmd_none(*pmd))	/* Nothing there */
 		goto out;
 
-	if (kvm_pmd_huge(*pmd)) {	/* THP, HugeTLB */
+	if (pmd_thp_or_huge(*pmd)) {	/* THP, HugeTLB */
 		*pmd = pmd_mkyoung(*pmd);
 		pfn = pmd_pfn(*pmd);
 		pfn_valid = true;
@@ -1555,7 +1554,7 @@ static int kvm_age_hva_handler(struct kvm *kvm, gpa_t gpa, void *data)
 	if (!pmd || pmd_none(*pmd))	/* Nothing there */
 		return 0;
 
-	if (kvm_pmd_huge(*pmd)) {	/* THP, HugeTLB */
+	if (pmd_thp_or_huge(*pmd)) {	/* THP, HugeTLB */
 		if (pmd_young(*pmd)) {
 			*pmd = pmd_mkold(*pmd);
 			return 1;
@@ -1585,7 +1584,7 @@ static int kvm_test_age_hva_handler(struct kvm *kvm, gpa_t gpa, void *data)
 	if (!pmd || pmd_none(*pmd))	/* Nothing there */
 		return 0;
 
-	if (kvm_pmd_huge(*pmd))		/* THP, HugeTLB */
+	if (pmd_thp_or_huge(*pmd))		/* THP, HugeTLB */
 		return pmd_young(*pmd);
 
 	pte = pte_offset_kernel(pmd, gpa);
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 05/29] kvm-arm: Replace kvm_pmd_huge with pmd_thp_or_huge
@ 2016-05-11 13:29   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Both arm and arm64 now provides a helper, pmd_thp_or_huge()
to check if the given pmd represents a huge page. Use that
instead of our own custom check.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/kvm/mmu.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 774d00b..7837f0a 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -45,7 +45,6 @@ static phys_addr_t hyp_idmap_vector;
 
 #define hyp_pgd_order get_order(PTRS_PER_PGD * sizeof(pgd_t))
 
-#define kvm_pmd_huge(_x)	(pmd_huge(_x) || pmd_trans_huge(_x))
 #define kvm_pud_huge(_x)	pud_huge(_x)
 
 #define KVM_S2PTE_FLAG_IS_IOMAP		(1UL << 0)
@@ -115,7 +114,7 @@ static bool kvm_is_device_pfn(unsigned long pfn)
  */
 static void stage2_dissolve_pmd(struct kvm *kvm, phys_addr_t addr, pmd_t *pmd)
 {
-	if (!kvm_pmd_huge(*pmd))
+	if (!pmd_thp_or_huge(*pmd))
 		return;
 
 	pmd_clear(pmd);
@@ -177,7 +176,7 @@ static void clear_pud_entry(struct kvm *kvm, pud_t *pud, phys_addr_t addr)
 static void clear_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr)
 {
 	pte_t *pte_table = pte_offset_kernel(pmd, 0);
-	VM_BUG_ON(kvm_pmd_huge(*pmd));
+	VM_BUG_ON(pmd_thp_or_huge(*pmd));
 	pmd_clear(pmd);
 	kvm_tlb_flush_vmid_ipa(kvm, addr);
 	pte_free_kernel(NULL, pte_table);
@@ -240,7 +239,7 @@ static void unmap_pmds(struct kvm *kvm, pud_t *pud,
 	do {
 		next = kvm_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
-			if (kvm_pmd_huge(*pmd)) {
+			if (pmd_thp_or_huge(*pmd)) {
 				pmd_t old_pmd = *pmd;
 
 				pmd_clear(pmd);
@@ -326,7 +325,7 @@ static void stage2_flush_pmds(struct kvm *kvm, pud_t *pud,
 	do {
 		next = kvm_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
-			if (kvm_pmd_huge(*pmd))
+			if (pmd_thp_or_huge(*pmd))
 				kvm_flush_dcache_pmd(*pmd);
 			else
 				stage2_flush_ptes(kvm, pmd, addr, next);
@@ -1050,7 +1049,7 @@ static void stage2_wp_pmds(pud_t *pud, phys_addr_t addr, phys_addr_t end)
 	do {
 		next = kvm_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
-			if (kvm_pmd_huge(*pmd)) {
+			if (pmd_thp_or_huge(*pmd)) {
 				if (!kvm_s2pmd_readonly(pmd))
 					kvm_set_s2pmd_readonly(pmd);
 			} else {
@@ -1331,7 +1330,7 @@ static void handle_access_fault(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa)
 	if (!pmd || pmd_none(*pmd))	/* Nothing there */
 		goto out;
 
-	if (kvm_pmd_huge(*pmd)) {	/* THP, HugeTLB */
+	if (pmd_thp_or_huge(*pmd)) {	/* THP, HugeTLB */
 		*pmd = pmd_mkyoung(*pmd);
 		pfn = pmd_pfn(*pmd);
 		pfn_valid = true;
@@ -1555,7 +1554,7 @@ static int kvm_age_hva_handler(struct kvm *kvm, gpa_t gpa, void *data)
 	if (!pmd || pmd_none(*pmd))	/* Nothing there */
 		return 0;
 
-	if (kvm_pmd_huge(*pmd)) {	/* THP, HugeTLB */
+	if (pmd_thp_or_huge(*pmd)) {	/* THP, HugeTLB */
 		if (pmd_young(*pmd)) {
 			*pmd = pmd_mkold(*pmd);
 			return 1;
@@ -1585,7 +1584,7 @@ static int kvm_test_age_hva_handler(struct kvm *kvm, gpa_t gpa, void *data)
 	if (!pmd || pmd_none(*pmd))	/* Nothing there */
 		return 0;
 
-	if (kvm_pmd_huge(*pmd))		/* THP, HugeTLB */
+	if (pmd_thp_or_huge(*pmd))		/* THP, HugeTLB */
 		return pmd_young(*pmd);
 
 	pte = pte_offset_kernel(pmd, gpa);
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 06/29] kvm-arm: Remove kvm_pud_huge()
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:29   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: Marc Zyngier, kvmarm, linux-arm-kernel, kvm

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Get rid of kvm_pud_huge() which falls back to pud_huge. Use
pud_huge instead.

Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/kvm/mmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 7837f0a..d0c0ee9 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -45,8 +45,6 @@ static phys_addr_t hyp_idmap_vector;
 
 #define hyp_pgd_order get_order(PTRS_PER_PGD * sizeof(pgd_t))
 
-#define kvm_pud_huge(_x)	pud_huge(_x)
-
 #define KVM_S2PTE_FLAG_IS_IOMAP		(1UL << 0)
 #define KVM_S2_FLAG_LOGGING_ACTIVE	(1UL << 1)
 
@@ -1077,7 +1075,7 @@ static void  stage2_wp_puds(pgd_t *pgd, phys_addr_t addr, phys_addr_t end)
 		next = kvm_pud_addr_end(addr, end);
 		if (!pud_none(*pud)) {
 			/* TODO:PUD not supported, revisit later if supported */
-			BUG_ON(kvm_pud_huge(*pud));
+			BUG_ON(pud_huge(*pud));
 			stage2_wp_pmds(pud, addr, next);
 		}
 	} while (pud++, addr = next, addr != end);
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 06/29] kvm-arm: Remove kvm_pud_huge()
@ 2016-05-11 13:29   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:29 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Get rid of kvm_pud_huge() which falls back to pud_huge. Use
pud_huge instead.

Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/kvm/mmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 7837f0a..d0c0ee9 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -45,8 +45,6 @@ static phys_addr_t hyp_idmap_vector;
 
 #define hyp_pgd_order get_order(PTRS_PER_PGD * sizeof(pgd_t))
 
-#define kvm_pud_huge(_x)	pud_huge(_x)
-
 #define KVM_S2PTE_FLAG_IS_IOMAP		(1UL << 0)
 #define KVM_S2_FLAG_LOGGING_ACTIVE	(1UL << 1)
 
@@ -1077,7 +1075,7 @@ static void  stage2_wp_puds(pgd_t *pgd, phys_addr_t addr, phys_addr_t end)
 		next = kvm_pud_addr_end(addr, end);
 		if (!pud_none(*pud)) {
 			/* TODO:PUD not supported, revisit later if supported */
-			BUG_ON(kvm_pud_huge(*pud));
+			BUG_ON(pud_huge(*pud));
 			stage2_wp_pmds(pud, addr, next);
 		}
 	} while (pud++, addr = next, addr != end);
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 07/29] kvm-arm: arm32: Introduce stage2 page table helpers
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Suzuki K Poulose,
	Christoffer Dall

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Define the page table helpers for walking the stage2 pagetable
for arm. Since both hyp and stage2 have the same number of levels,
as that of the host we reuse the host helpers.

The exceptions are the p.d_addr_end routines which have to deal
with IPA > 32bit, hence we use the open coded version of their host helpers
which supports 64bit.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 arch/arm/include/asm/kvm_mmu.h        |  1 +
 arch/arm/include/asm/stage2_pgtable.h | 61 +++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 arch/arm/include/asm/stage2_pgtable.h

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index c2b2b27..7d207b4 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -47,6 +47,7 @@
 #include <linux/highmem.h>
 #include <asm/cacheflush.h>
 #include <asm/pgalloc.h>
+#include <asm/stage2_pgtable.h>
 
 int create_hyp_mappings(void *from, void *to);
 int create_hyp_io_mappings(void *from, void *to, phys_addr_t);
diff --git a/arch/arm/include/asm/stage2_pgtable.h b/arch/arm/include/asm/stage2_pgtable.h
new file mode 100644
index 0000000..460d616
--- /dev/null
+++ b/arch/arm/include/asm/stage2_pgtable.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2016 - ARM Ltd
+ *
+ * stage2 page table helpers
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __ARM_S2_PGTABLE_H_
+#define __ARM_S2_PGTABLE_H_
+
+#define stage2_pgd_none(pgd)			pgd_none(pgd)
+#define stage2_pgd_clear(pgd)			pgd_clear(pgd)
+#define stage2_pgd_present(pgd)			pgd_present(pgd)
+#define stage2_pgd_populate(pgd, pud)		pgd_populate(NULL, pgd, pud)
+#define stage2_pud_offset(pgd, address)		pud_offset(pgd, address)
+#define stage2_pud_free(pud)			pud_free(NULL, pud)
+
+#define stage2_pud_none(pud)			pud_none(pud)
+#define stage2_pud_clear(pud)			pud_clear(pud)
+#define stage2_pud_present(pud)			pud_present(pud)
+#define stage2_pud_populate(pud, pmd)		pud_populate(NULL, pud, pmd)
+#define stage2_pmd_offset(pud, address)		pmd_offset(pud, address)
+#define stage2_pmd_free(pmd)			pmd_free(NULL, pmd)
+
+#define stage2_pud_huge(pud)			pud_huge(pud)
+
+/* Open coded p*d_addr_end that can deal with 64bit addresses */
+static inline phys_addr_t stage2_pgd_addr_end(phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t boundary = (addr + PGDIR_SIZE) & PGDIR_MASK;
+
+	return (boundary - 1 < end - 1) ? boundary : end;
+}
+
+#define stage2_pud_addr_end(addr, end)		(end)
+
+static inline phys_addr_t stage2_pmd_addr_end(phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t boundary = (addr + PMD_SIZE) & PMD_MASK;
+
+	return (boundary - 1 < end - 1) ? boundary : end;
+}
+
+#define stage2_pgd_index(addr)				pgd_index(addr)
+
+#define stage2_pte_table_empty(ptep)			kvm_page_empty(ptep)
+#define stage2_pmd_table_empty(pmdp)			kvm_page_empty(pmdp)
+#define stage2_pud_table_empty(pudp)			false
+
+#endif	/* __ARM_S2_PGTABLE_H_ */
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 07/29] kvm-arm: arm32: Introduce stage2 page table helpers
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Define the page table helpers for walking the stage2 pagetable
for arm. Since both hyp and stage2 have the same number of levels,
as that of the host we reuse the host helpers.

The exceptions are the p.d_addr_end routines which have to deal
with IPA > 32bit, hence we use the open coded version of their host helpers
which supports 64bit.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 arch/arm/include/asm/kvm_mmu.h        |  1 +
 arch/arm/include/asm/stage2_pgtable.h | 61 +++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 arch/arm/include/asm/stage2_pgtable.h

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index c2b2b27..7d207b4 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -47,6 +47,7 @@
 #include <linux/highmem.h>
 #include <asm/cacheflush.h>
 #include <asm/pgalloc.h>
+#include <asm/stage2_pgtable.h>
 
 int create_hyp_mappings(void *from, void *to);
 int create_hyp_io_mappings(void *from, void *to, phys_addr_t);
diff --git a/arch/arm/include/asm/stage2_pgtable.h b/arch/arm/include/asm/stage2_pgtable.h
new file mode 100644
index 0000000..460d616
--- /dev/null
+++ b/arch/arm/include/asm/stage2_pgtable.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2016 - ARM Ltd
+ *
+ * stage2 page table helpers
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __ARM_S2_PGTABLE_H_
+#define __ARM_S2_PGTABLE_H_
+
+#define stage2_pgd_none(pgd)			pgd_none(pgd)
+#define stage2_pgd_clear(pgd)			pgd_clear(pgd)
+#define stage2_pgd_present(pgd)			pgd_present(pgd)
+#define stage2_pgd_populate(pgd, pud)		pgd_populate(NULL, pgd, pud)
+#define stage2_pud_offset(pgd, address)		pud_offset(pgd, address)
+#define stage2_pud_free(pud)			pud_free(NULL, pud)
+
+#define stage2_pud_none(pud)			pud_none(pud)
+#define stage2_pud_clear(pud)			pud_clear(pud)
+#define stage2_pud_present(pud)			pud_present(pud)
+#define stage2_pud_populate(pud, pmd)		pud_populate(NULL, pud, pmd)
+#define stage2_pmd_offset(pud, address)		pmd_offset(pud, address)
+#define stage2_pmd_free(pmd)			pmd_free(NULL, pmd)
+
+#define stage2_pud_huge(pud)			pud_huge(pud)
+
+/* Open coded p*d_addr_end that can deal with 64bit addresses */
+static inline phys_addr_t stage2_pgd_addr_end(phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t boundary = (addr + PGDIR_SIZE) & PGDIR_MASK;
+
+	return (boundary - 1 < end - 1) ? boundary : end;
+}
+
+#define stage2_pud_addr_end(addr, end)		(end)
+
+static inline phys_addr_t stage2_pmd_addr_end(phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t boundary = (addr + PMD_SIZE) & PMD_MASK;
+
+	return (boundary - 1 < end - 1) ? boundary : end;
+}
+
+#define stage2_pgd_index(addr)				pgd_index(addr)
+
+#define stage2_pte_table_empty(ptep)			kvm_page_empty(ptep)
+#define stage2_pmd_table_empty(pmdp)			kvm_page_empty(pmdp)
+#define stage2_pud_table_empty(pudp)			false
+
+#endif	/* __ARM_S2_PGTABLE_H_ */
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 08/29] kvm-arm: arm: Introduce hyp page table empty checks
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvm, Marc Zyngier, linux-arm-kernel, kvmarm

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Introduce hyp_pxx_table_empty helpers for checking whether
a given table entry is empty. This will be used explicitly
once we switch to explicit routines for hyp page table walk.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 arch/arm/include/asm/kvm_mmu.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index 7d207b4..5522cdd 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -160,7 +160,11 @@ static inline bool kvm_page_empty(void *ptr)
 
 #define kvm_pte_table_empty(kvm, ptep) kvm_page_empty(ptep)
 #define kvm_pmd_table_empty(kvm, pmdp) kvm_page_empty(pmdp)
-#define kvm_pud_table_empty(kvm, pudp) (0)
+#define kvm_pud_table_empty(kvm, pudp) false
+
+#define hyp_pte_table_empty(ptep) kvm_page_empty(ptep)
+#define hyp_pmd_table_empty(pmdp) kvm_page_empty(pmdp)
+#define hyp_pud_table_empty(pudp) false
 
 static inline void *kvm_get_hwpgd(struct kvm *kvm)
 {
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 08/29] kvm-arm: arm: Introduce hyp page table empty checks
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Introduce hyp_pxx_table_empty helpers for checking whether
a given table entry is empty. This will be used explicitly
once we switch to explicit routines for hyp page table walk.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 arch/arm/include/asm/kvm_mmu.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index 7d207b4..5522cdd 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -160,7 +160,11 @@ static inline bool kvm_page_empty(void *ptr)
 
 #define kvm_pte_table_empty(kvm, ptep) kvm_page_empty(ptep)
 #define kvm_pmd_table_empty(kvm, pmdp) kvm_page_empty(pmdp)
-#define kvm_pud_table_empty(kvm, pudp) (0)
+#define kvm_pud_table_empty(kvm, pudp) false
+
+#define hyp_pte_table_empty(ptep) kvm_page_empty(ptep)
+#define hyp_pmd_table_empty(pmdp) kvm_page_empty(pmdp)
+#define hyp_pud_table_empty(pudp) false
 
 static inline void *kvm_get_hwpgd(struct kvm *kvm)
 {
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 09/29] kvm-arm: arm64: Introduce stage2 page table helpers
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: Marc Zyngier, kvmarm, linux-arm-kernel, kvm

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Introduce stage2 page table helpers for arm64. With the fake
page table level still in place, the stage2 table has the same
number of levels as that of the host (and hyp), so they all
fallback to the host version.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_mmu.h        | 29 +----------
 arch/arm64/include/asm/stage2_pgtable.h | 86 +++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 27 deletions(-)
 create mode 100644 arch/arm64/include/asm/stage2_pgtable.h

diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 9a3409f..e3f53e3 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -91,6 +91,8 @@ alternative_endif
 #define KVM_PHYS_SIZE	(1UL << KVM_PHYS_SHIFT)
 #define KVM_PHYS_MASK	(KVM_PHYS_SIZE - 1UL)
 
+#include <asm/stage2_pgtable.h>
+
 int create_hyp_mappings(void *from, void *to);
 int create_hyp_io_mappings(void *from, void *to, phys_addr_t);
 void free_boot_hyp_pgd(void);
@@ -156,35 +158,8 @@ static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 #define kvm_pud_addr_end(addr, end)	pud_addr_end(addr, end)
 #define kvm_pmd_addr_end(addr, end)	pmd_addr_end(addr, end)
 
-/*
- * In the case where PGDIR_SHIFT is larger than KVM_PHYS_SHIFT, we can address
- * the entire IPA input range with a single pgd entry, and we would only need
- * one pgd entry.  Note that in this case, the pgd is actually not used by
- * the MMU for Stage-2 translations, but is merely a fake pgd used as a data
- * structure for the kernel pgtable macros to work.
- */
-#if PGDIR_SHIFT > KVM_PHYS_SHIFT
-#define PTRS_PER_S2_PGD_SHIFT	0
-#else
-#define PTRS_PER_S2_PGD_SHIFT	(KVM_PHYS_SHIFT - PGDIR_SHIFT)
-#endif
-#define PTRS_PER_S2_PGD		(1 << PTRS_PER_S2_PGD_SHIFT)
-
 #define kvm_pgd_index(addr)	(((addr) >> PGDIR_SHIFT) & (PTRS_PER_S2_PGD - 1))
 
-/*
- * If we are concatenating first level stage-2 page tables, we would have less
- * than or equal to 16 pointers in the fake PGD, because that's what the
- * architecture allows.  In this case, (4 - CONFIG_PGTABLE_LEVELS)
- * represents the first level for the host, and we add 1 to go to the next
- * level (which uses contatenation) for the stage-2 tables.
- */
-#if PTRS_PER_S2_PGD <= 16
-#define KVM_PREALLOC_LEVEL	(4 - CONFIG_PGTABLE_LEVELS + 1)
-#else
-#define KVM_PREALLOC_LEVEL	(0)
-#endif
-
 static inline void *kvm_get_hwpgd(struct kvm *kvm)
 {
 	pgd_t *pgd = kvm->arch.pgd;
diff --git a/arch/arm64/include/asm/stage2_pgtable.h b/arch/arm64/include/asm/stage2_pgtable.h
new file mode 100644
index 0000000..0ec218f
--- /dev/null
+++ b/arch/arm64/include/asm/stage2_pgtable.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2016 - ARM Ltd
+ *
+ * stage2 page table helpers
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __ARM64_S2_PGTABLE_H_
+#define __ARM64_S2_PGTABLE_H_
+
+#include <asm/pgtable.h>
+
+/*
+ * In the case where PGDIR_SHIFT is larger than KVM_PHYS_SHIFT, we can address
+ * the entire IPA input range with a single pgd entry, and we would only need
+ * one pgd entry.  Note that in this case, the pgd is actually not used by
+ * the MMU for Stage-2 translations, but is merely a fake pgd used as a data
+ * structure for the kernel pgtable macros to work.
+ */
+#if PGDIR_SHIFT > KVM_PHYS_SHIFT
+#define PTRS_PER_S2_PGD_SHIFT	0
+#else
+#define PTRS_PER_S2_PGD_SHIFT	(KVM_PHYS_SHIFT - PGDIR_SHIFT)
+#endif
+#define PTRS_PER_S2_PGD		(1 << PTRS_PER_S2_PGD_SHIFT)
+
+/*
+ * If we are concatenating first level stage-2 page tables, we would have less
+ * than or equal to 16 pointers in the fake PGD, because that's what the
+ * architecture allows.  In this case, (4 - CONFIG_PGTABLE_LEVELS)
+ * represents the first level for the host, and we add 1 to go to the next
+ * level (which uses contatenation) for the stage-2 tables.
+ */
+#if PTRS_PER_S2_PGD <= 16
+#define KVM_PREALLOC_LEVEL	(4 - CONFIG_PGTABLE_LEVELS + 1)
+#else
+#define KVM_PREALLOC_LEVEL	(0)
+#endif
+
+#define stage2_pgd_none(pgd)				pgd_none(pgd)
+#define stage2_pgd_clear(pgd)				pgd_clear(pgd)
+#define stage2_pgd_present(pgd)				pgd_present(pgd)
+#define stage2_pgd_populate(pgd, pud)			pgd_populate(NULL, pgd, pud)
+#define stage2_pud_offset(pgd, address)			pud_offset(pgd, address)
+#define stage2_pud_free(pud)				pud_free(NULL, pud)
+
+#define stage2_pud_none(pud)				pud_none(pud)
+#define stage2_pud_clear(pud)				pud_clear(pud)
+#define stage2_pud_present(pud)				pud_present(pud)
+#define stage2_pud_populate(pud, pmd)			pud_populate(NULL, pud, pmd)
+#define stage2_pmd_offset(pud, address)			pmd_offset(pud, address)
+#define stage2_pmd_free(pmd)				pmd_free(NULL, pmd)
+
+#define stage2_pud_huge(pud)				pud_huge(pud)
+
+#define stage2_pgd_addr_end(address, end)		pgd_addr_end(address, end)
+#define stage2_pud_addr_end(address, end)		pud_addr_end(address, end)
+#define stage2_pmd_addr_end(address, end)		pmd_addr_end(address, end)
+
+#define stage2_pte_table_empty(ptep)			kvm_page_empty(ptep)
+#ifdef __PGTABLE_PMD_FOLDED
+#define stage2_pmd_table_empty(pmdp)			(0)
+#else
+#define stage2_pmd_table_empty(pmdp)			((KVM_PREALLOC_LEVEL < 2) && kvm_page_empty(pmdp))
+#endif
+
+#ifdef __PGTABLE_PUD_FOLDED
+#define stage2_pud_table_empty(pudp)			(0)
+#else
+#define stage2_pud_table_empty(pudp)			((KVM_PREALLOC_LEVEL < 1) && kvm_page_empty(pudp))
+#endif
+
+#define stage2_pgd_index(addr)				(((addr) >> PGDIR_SHIFT) & (PTRS_PER_S2_PGD - 1))
+
+#endif	/* __ARM64_S2_PGTABLE_H_ */
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 09/29] kvm-arm: arm64: Introduce stage2 page table helpers
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Introduce stage2 page table helpers for arm64. With the fake
page table level still in place, the stage2 table has the same
number of levels as that of the host (and hyp), so they all
fallback to the host version.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_mmu.h        | 29 +----------
 arch/arm64/include/asm/stage2_pgtable.h | 86 +++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 27 deletions(-)
 create mode 100644 arch/arm64/include/asm/stage2_pgtable.h

diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 9a3409f..e3f53e3 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -91,6 +91,8 @@ alternative_endif
 #define KVM_PHYS_SIZE	(1UL << KVM_PHYS_SHIFT)
 #define KVM_PHYS_MASK	(KVM_PHYS_SIZE - 1UL)
 
+#include <asm/stage2_pgtable.h>
+
 int create_hyp_mappings(void *from, void *to);
 int create_hyp_io_mappings(void *from, void *to, phys_addr_t);
 void free_boot_hyp_pgd(void);
@@ -156,35 +158,8 @@ static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 #define kvm_pud_addr_end(addr, end)	pud_addr_end(addr, end)
 #define kvm_pmd_addr_end(addr, end)	pmd_addr_end(addr, end)
 
-/*
- * In the case where PGDIR_SHIFT is larger than KVM_PHYS_SHIFT, we can address
- * the entire IPA input range with a single pgd entry, and we would only need
- * one pgd entry.  Note that in this case, the pgd is actually not used by
- * the MMU for Stage-2 translations, but is merely a fake pgd used as a data
- * structure for the kernel pgtable macros to work.
- */
-#if PGDIR_SHIFT > KVM_PHYS_SHIFT
-#define PTRS_PER_S2_PGD_SHIFT	0
-#else
-#define PTRS_PER_S2_PGD_SHIFT	(KVM_PHYS_SHIFT - PGDIR_SHIFT)
-#endif
-#define PTRS_PER_S2_PGD		(1 << PTRS_PER_S2_PGD_SHIFT)
-
 #define kvm_pgd_index(addr)	(((addr) >> PGDIR_SHIFT) & (PTRS_PER_S2_PGD - 1))
 
-/*
- * If we are concatenating first level stage-2 page tables, we would have less
- * than or equal to 16 pointers in the fake PGD, because that's what the
- * architecture allows.  In this case, (4 - CONFIG_PGTABLE_LEVELS)
- * represents the first level for the host, and we add 1 to go to the next
- * level (which uses contatenation) for the stage-2 tables.
- */
-#if PTRS_PER_S2_PGD <= 16
-#define KVM_PREALLOC_LEVEL	(4 - CONFIG_PGTABLE_LEVELS + 1)
-#else
-#define KVM_PREALLOC_LEVEL	(0)
-#endif
-
 static inline void *kvm_get_hwpgd(struct kvm *kvm)
 {
 	pgd_t *pgd = kvm->arch.pgd;
diff --git a/arch/arm64/include/asm/stage2_pgtable.h b/arch/arm64/include/asm/stage2_pgtable.h
new file mode 100644
index 0000000..0ec218f
--- /dev/null
+++ b/arch/arm64/include/asm/stage2_pgtable.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2016 - ARM Ltd
+ *
+ * stage2 page table helpers
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __ARM64_S2_PGTABLE_H_
+#define __ARM64_S2_PGTABLE_H_
+
+#include <asm/pgtable.h>
+
+/*
+ * In the case where PGDIR_SHIFT is larger than KVM_PHYS_SHIFT, we can address
+ * the entire IPA input range with a single pgd entry, and we would only need
+ * one pgd entry.  Note that in this case, the pgd is actually not used by
+ * the MMU for Stage-2 translations, but is merely a fake pgd used as a data
+ * structure for the kernel pgtable macros to work.
+ */
+#if PGDIR_SHIFT > KVM_PHYS_SHIFT
+#define PTRS_PER_S2_PGD_SHIFT	0
+#else
+#define PTRS_PER_S2_PGD_SHIFT	(KVM_PHYS_SHIFT - PGDIR_SHIFT)
+#endif
+#define PTRS_PER_S2_PGD		(1 << PTRS_PER_S2_PGD_SHIFT)
+
+/*
+ * If we are concatenating first level stage-2 page tables, we would have less
+ * than or equal to 16 pointers in the fake PGD, because that's what the
+ * architecture allows.  In this case, (4 - CONFIG_PGTABLE_LEVELS)
+ * represents the first level for the host, and we add 1 to go to the next
+ * level (which uses contatenation) for the stage-2 tables.
+ */
+#if PTRS_PER_S2_PGD <= 16
+#define KVM_PREALLOC_LEVEL	(4 - CONFIG_PGTABLE_LEVELS + 1)
+#else
+#define KVM_PREALLOC_LEVEL	(0)
+#endif
+
+#define stage2_pgd_none(pgd)				pgd_none(pgd)
+#define stage2_pgd_clear(pgd)				pgd_clear(pgd)
+#define stage2_pgd_present(pgd)				pgd_present(pgd)
+#define stage2_pgd_populate(pgd, pud)			pgd_populate(NULL, pgd, pud)
+#define stage2_pud_offset(pgd, address)			pud_offset(pgd, address)
+#define stage2_pud_free(pud)				pud_free(NULL, pud)
+
+#define stage2_pud_none(pud)				pud_none(pud)
+#define stage2_pud_clear(pud)				pud_clear(pud)
+#define stage2_pud_present(pud)				pud_present(pud)
+#define stage2_pud_populate(pud, pmd)			pud_populate(NULL, pud, pmd)
+#define stage2_pmd_offset(pud, address)			pmd_offset(pud, address)
+#define stage2_pmd_free(pmd)				pmd_free(NULL, pmd)
+
+#define stage2_pud_huge(pud)				pud_huge(pud)
+
+#define stage2_pgd_addr_end(address, end)		pgd_addr_end(address, end)
+#define stage2_pud_addr_end(address, end)		pud_addr_end(address, end)
+#define stage2_pmd_addr_end(address, end)		pmd_addr_end(address, end)
+
+#define stage2_pte_table_empty(ptep)			kvm_page_empty(ptep)
+#ifdef __PGTABLE_PMD_FOLDED
+#define stage2_pmd_table_empty(pmdp)			(0)
+#else
+#define stage2_pmd_table_empty(pmdp)			((KVM_PREALLOC_LEVEL < 2) && kvm_page_empty(pmdp))
+#endif
+
+#ifdef __PGTABLE_PUD_FOLDED
+#define stage2_pud_table_empty(pudp)			(0)
+#else
+#define stage2_pud_table_empty(pudp)			((KVM_PREALLOC_LEVEL < 1) && kvm_page_empty(pudp))
+#endif
+
+#define stage2_pgd_index(addr)				(((addr) >> PGDIR_SHIFT) & (PTRS_PER_S2_PGD - 1))
+
+#endif	/* __ARM64_S2_PGTABLE_H_ */
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 10/29] kvm-arm: arm64: Introduce hyp page table empty checks
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: Marc Zyngier, kvmarm, linux-arm-kernel, kvm

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Introduce hyp_pxx_table_empty helpers for checking whether
a given table entry is empty. This will be used explicitly
once we switch to explicit routines for hyp page table walk.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_mmu.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index e3f53e3..edf3c62 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -249,6 +249,20 @@ static inline bool kvm_page_empty(void *ptr)
 #endif
 
 
+#define hyp_pte_table_empty(ptep) kvm_page_empty(ptep)
+
+#ifdef __PAGETABLE_PMD_FOLDED
+#define hyp_pmd_table_empty(pmdp) (0)
+#else
+#define hyp_pmd_table_empty(pmdp) kvm_page_empty(pmdp)
+#endif
+
+#ifdef __PAGETABLE_PUD_FOLDED
+#define hyp_pud_table_empty(pudp) (0)
+#else
+#define hyp_pud_table_empty(pudp) kvm_page_empty(pudp)
+#endif
+
 struct kvm;
 
 #define kvm_flush_dcache_to_poc(a,l)	__flush_dcache_area((a), (l))
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 10/29] kvm-arm: arm64: Introduce hyp page table empty checks
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Introduce hyp_pxx_table_empty helpers for checking whether
a given table entry is empty. This will be used explicitly
once we switch to explicit routines for hyp page table walk.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_mmu.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index e3f53e3..edf3c62 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -249,6 +249,20 @@ static inline bool kvm_page_empty(void *ptr)
 #endif
 
 
+#define hyp_pte_table_empty(ptep) kvm_page_empty(ptep)
+
+#ifdef __PAGETABLE_PMD_FOLDED
+#define hyp_pmd_table_empty(pmdp) (0)
+#else
+#define hyp_pmd_table_empty(pmdp) kvm_page_empty(pmdp)
+#endif
+
+#ifdef __PAGETABLE_PUD_FOLDED
+#define hyp_pud_table_empty(pudp) (0)
+#else
+#define hyp_pud_table_empty(pudp) kvm_page_empty(pudp)
+#endif
+
 struct kvm;
 
 #define kvm_flush_dcache_to_poc(a,l)	__flush_dcache_area((a), (l))
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 11/29] kvm-arm: Use explicit stage2 helper routines
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: Marc Zyngier, kvmarm, linux-arm-kernel, kvm

From: Suzuki K Poulose <suzuki.poulose@arm.com>

We have stage2 page table helpers for both arm and arm64. Switch to
the stage2 helpers for routines that only deal with stage2 page table.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/kvm/mmu.c | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index d0c0ee9..f93f717 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -319,9 +319,9 @@ static void stage2_flush_pmds(struct kvm *kvm, pud_t *pud,
 	pmd_t *pmd;
 	phys_addr_t next;
 
-	pmd = pmd_offset(pud, addr);
+	pmd = stage2_pmd_offset(pud, addr);
 	do {
-		next = kvm_pmd_addr_end(addr, end);
+		next = stage2_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
 			if (pmd_thp_or_huge(*pmd))
 				kvm_flush_dcache_pmd(*pmd);
@@ -337,11 +337,11 @@ static void stage2_flush_puds(struct kvm *kvm, pgd_t *pgd,
 	pud_t *pud;
 	phys_addr_t next;
 
-	pud = pud_offset(pgd, addr);
+	pud = stage2_pud_offset(pgd, addr);
 	do {
-		next = kvm_pud_addr_end(addr, end);
-		if (!pud_none(*pud)) {
-			if (pud_huge(*pud))
+		next = stage2_pud_addr_end(addr, end);
+		if (!stage2_pud_none(*pud)) {
+			if (stage2_pud_huge(*pud))
 				kvm_flush_dcache_pud(*pud);
 			else
 				stage2_flush_pmds(kvm, pud, addr, next);
@@ -357,9 +357,9 @@ static void stage2_flush_memslot(struct kvm *kvm,
 	phys_addr_t next;
 	pgd_t *pgd;
 
-	pgd = kvm->arch.pgd + kvm_pgd_index(addr);
+	pgd = kvm->arch.pgd + stage2_pgd_index(addr);
 	do {
-		next = kvm_pgd_addr_end(addr, end);
+		next = stage2_pgd_addr_end(addr, end);
 		stage2_flush_puds(kvm, pgd, addr, next);
 	} while (pgd++, addr = next, addr != end);
 }
@@ -807,16 +807,16 @@ static pud_t *stage2_get_pud(struct kvm *kvm, struct kvm_mmu_memory_cache *cache
 	pgd_t *pgd;
 	pud_t *pud;
 
-	pgd = kvm->arch.pgd + kvm_pgd_index(addr);
-	if (WARN_ON(pgd_none(*pgd))) {
+	pgd = kvm->arch.pgd + stage2_pgd_index(addr);
+	if (WARN_ON(stage2_pgd_none(*pgd))) {
 		if (!cache)
 			return NULL;
 		pud = mmu_memory_cache_alloc(cache);
-		pgd_populate(NULL, pgd, pud);
+		stage2_pgd_populate(pgd, pud);
 		get_page(virt_to_page(pgd));
 	}
 
-	return pud_offset(pgd, addr);
+	return stage2_pud_offset(pgd, addr);
 }
 
 static pmd_t *stage2_get_pmd(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
@@ -826,15 +826,15 @@ static pmd_t *stage2_get_pmd(struct kvm *kvm, struct kvm_mmu_memory_cache *cache
 	pmd_t *pmd;
 
 	pud = stage2_get_pud(kvm, cache, addr);
-	if (pud_none(*pud)) {
+	if (stage2_pud_none(*pud)) {
 		if (!cache)
 			return NULL;
 		pmd = mmu_memory_cache_alloc(cache);
-		pud_populate(NULL, pud, pmd);
+		stage2_pud_populate(pud, pmd);
 		get_page(virt_to_page(pud));
 	}
 
-	return pmd_offset(pud, addr);
+	return stage2_pmd_offset(pud, addr);
 }
 
 static int stage2_set_pmd_huge(struct kvm *kvm, struct kvm_mmu_memory_cache
@@ -1042,10 +1042,10 @@ static void stage2_wp_pmds(pud_t *pud, phys_addr_t addr, phys_addr_t end)
 	pmd_t *pmd;
 	phys_addr_t next;
 
-	pmd = pmd_offset(pud, addr);
+	pmd = stage2_pmd_offset(pud, addr);
 
 	do {
-		next = kvm_pmd_addr_end(addr, end);
+		next = stage2_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
 			if (pmd_thp_or_huge(*pmd)) {
 				if (!kvm_s2pmd_readonly(pmd))
@@ -1070,12 +1070,12 @@ static void  stage2_wp_puds(pgd_t *pgd, phys_addr_t addr, phys_addr_t end)
 	pud_t *pud;
 	phys_addr_t next;
 
-	pud = pud_offset(pgd, addr);
+	pud = stage2_pud_offset(pgd, addr);
 	do {
-		next = kvm_pud_addr_end(addr, end);
-		if (!pud_none(*pud)) {
+		next = stage2_pud_addr_end(addr, end);
+		if (!stage2_pud_none(*pud)) {
 			/* TODO:PUD not supported, revisit later if supported */
-			BUG_ON(pud_huge(*pud));
+			BUG_ON(stage2_pud_huge(*pud));
 			stage2_wp_pmds(pud, addr, next);
 		}
 	} while (pud++, addr = next, addr != end);
@@ -1092,7 +1092,7 @@ static void stage2_wp_range(struct kvm *kvm, phys_addr_t addr, phys_addr_t end)
 	pgd_t *pgd;
 	phys_addr_t next;
 
-	pgd = kvm->arch.pgd + kvm_pgd_index(addr);
+	pgd = kvm->arch.pgd + stage2_pgd_index(addr);
 	do {
 		/*
 		 * Release kvm_mmu_lock periodically if the memory region is
@@ -1104,8 +1104,8 @@ static void stage2_wp_range(struct kvm *kvm, phys_addr_t addr, phys_addr_t end)
 		if (need_resched() || spin_needbreak(&kvm->mmu_lock))
 			cond_resched_lock(&kvm->mmu_lock);
 
-		next = kvm_pgd_addr_end(addr, end);
-		if (pgd_present(*pgd))
+		next = stage2_pgd_addr_end(addr, end);
+		if (stage2_pgd_present(*pgd))
 			stage2_wp_puds(pgd, addr, next);
 	} while (pgd++, addr = next, addr != end);
 }
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 11/29] kvm-arm: Use explicit stage2 helper routines
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

We have stage2 page table helpers for both arm and arm64. Switch to
the stage2 helpers for routines that only deal with stage2 page table.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/kvm/mmu.c | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index d0c0ee9..f93f717 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -319,9 +319,9 @@ static void stage2_flush_pmds(struct kvm *kvm, pud_t *pud,
 	pmd_t *pmd;
 	phys_addr_t next;
 
-	pmd = pmd_offset(pud, addr);
+	pmd = stage2_pmd_offset(pud, addr);
 	do {
-		next = kvm_pmd_addr_end(addr, end);
+		next = stage2_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
 			if (pmd_thp_or_huge(*pmd))
 				kvm_flush_dcache_pmd(*pmd);
@@ -337,11 +337,11 @@ static void stage2_flush_puds(struct kvm *kvm, pgd_t *pgd,
 	pud_t *pud;
 	phys_addr_t next;
 
-	pud = pud_offset(pgd, addr);
+	pud = stage2_pud_offset(pgd, addr);
 	do {
-		next = kvm_pud_addr_end(addr, end);
-		if (!pud_none(*pud)) {
-			if (pud_huge(*pud))
+		next = stage2_pud_addr_end(addr, end);
+		if (!stage2_pud_none(*pud)) {
+			if (stage2_pud_huge(*pud))
 				kvm_flush_dcache_pud(*pud);
 			else
 				stage2_flush_pmds(kvm, pud, addr, next);
@@ -357,9 +357,9 @@ static void stage2_flush_memslot(struct kvm *kvm,
 	phys_addr_t next;
 	pgd_t *pgd;
 
-	pgd = kvm->arch.pgd + kvm_pgd_index(addr);
+	pgd = kvm->arch.pgd + stage2_pgd_index(addr);
 	do {
-		next = kvm_pgd_addr_end(addr, end);
+		next = stage2_pgd_addr_end(addr, end);
 		stage2_flush_puds(kvm, pgd, addr, next);
 	} while (pgd++, addr = next, addr != end);
 }
@@ -807,16 +807,16 @@ static pud_t *stage2_get_pud(struct kvm *kvm, struct kvm_mmu_memory_cache *cache
 	pgd_t *pgd;
 	pud_t *pud;
 
-	pgd = kvm->arch.pgd + kvm_pgd_index(addr);
-	if (WARN_ON(pgd_none(*pgd))) {
+	pgd = kvm->arch.pgd + stage2_pgd_index(addr);
+	if (WARN_ON(stage2_pgd_none(*pgd))) {
 		if (!cache)
 			return NULL;
 		pud = mmu_memory_cache_alloc(cache);
-		pgd_populate(NULL, pgd, pud);
+		stage2_pgd_populate(pgd, pud);
 		get_page(virt_to_page(pgd));
 	}
 
-	return pud_offset(pgd, addr);
+	return stage2_pud_offset(pgd, addr);
 }
 
 static pmd_t *stage2_get_pmd(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
@@ -826,15 +826,15 @@ static pmd_t *stage2_get_pmd(struct kvm *kvm, struct kvm_mmu_memory_cache *cache
 	pmd_t *pmd;
 
 	pud = stage2_get_pud(kvm, cache, addr);
-	if (pud_none(*pud)) {
+	if (stage2_pud_none(*pud)) {
 		if (!cache)
 			return NULL;
 		pmd = mmu_memory_cache_alloc(cache);
-		pud_populate(NULL, pud, pmd);
+		stage2_pud_populate(pud, pmd);
 		get_page(virt_to_page(pud));
 	}
 
-	return pmd_offset(pud, addr);
+	return stage2_pmd_offset(pud, addr);
 }
 
 static int stage2_set_pmd_huge(struct kvm *kvm, struct kvm_mmu_memory_cache
@@ -1042,10 +1042,10 @@ static void stage2_wp_pmds(pud_t *pud, phys_addr_t addr, phys_addr_t end)
 	pmd_t *pmd;
 	phys_addr_t next;
 
-	pmd = pmd_offset(pud, addr);
+	pmd = stage2_pmd_offset(pud, addr);
 
 	do {
-		next = kvm_pmd_addr_end(addr, end);
+		next = stage2_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
 			if (pmd_thp_or_huge(*pmd)) {
 				if (!kvm_s2pmd_readonly(pmd))
@@ -1070,12 +1070,12 @@ static void  stage2_wp_puds(pgd_t *pgd, phys_addr_t addr, phys_addr_t end)
 	pud_t *pud;
 	phys_addr_t next;
 
-	pud = pud_offset(pgd, addr);
+	pud = stage2_pud_offset(pgd, addr);
 	do {
-		next = kvm_pud_addr_end(addr, end);
-		if (!pud_none(*pud)) {
+		next = stage2_pud_addr_end(addr, end);
+		if (!stage2_pud_none(*pud)) {
 			/* TODO:PUD not supported, revisit later if supported */
-			BUG_ON(pud_huge(*pud));
+			BUG_ON(stage2_pud_huge(*pud));
 			stage2_wp_pmds(pud, addr, next);
 		}
 	} while (pud++, addr = next, addr != end);
@@ -1092,7 +1092,7 @@ static void stage2_wp_range(struct kvm *kvm, phys_addr_t addr, phys_addr_t end)
 	pgd_t *pgd;
 	phys_addr_t next;
 
-	pgd = kvm->arch.pgd + kvm_pgd_index(addr);
+	pgd = kvm->arch.pgd + stage2_pgd_index(addr);
 	do {
 		/*
 		 * Release kvm_mmu_lock periodically if the memory region is
@@ -1104,8 +1104,8 @@ static void stage2_wp_range(struct kvm *kvm, phys_addr_t addr, phys_addr_t end)
 		if (need_resched() || spin_needbreak(&kvm->mmu_lock))
 			cond_resched_lock(&kvm->mmu_lock);
 
-		next = kvm_pgd_addr_end(addr, end);
-		if (pgd_present(*pgd))
+		next = stage2_pgd_addr_end(addr, end);
+		if (stage2_pgd_present(*pgd))
 			stage2_wp_puds(pgd, addr, next);
 	} while (pgd++, addr = next, addr != end);
 }
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 12/29] kvm-arm: Add explicit hyp page table modifiers
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: Marc Zyngier, kvmarm, linux-arm-kernel, kvm

From: Suzuki K Poulose <suzuki.poulose@arm.com>

We have common routines to modify hyp and stage2 page tables
based on the 'kvm' parameter. For a smoother transition to
using separate routines for each, duplicate the routines
and modify the copy to work on hyp.

Marks the forked routines with _hyp_ and gets rid of the
kvm parameter which is no longer needed and is NULL for hyp.
Also, gets rid of calls to kvm_tlb_flush_by_vmid_ipa() calls
from the hyp versions. Uses explicit host page table accessors
instead of the kvm_* page table helpers.

Suggested-by: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/kvm/mmu.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 99 insertions(+), 5 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index f93f717..af526f6 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -388,6 +388,100 @@ static void stage2_flush_vm(struct kvm *kvm)
 	srcu_read_unlock(&kvm->srcu, idx);
 }
 
+static void clear_hyp_pgd_entry(pgd_t *pgd)
+{
+	pud_t *pud_table __maybe_unused = pud_offset(pgd, 0UL);
+	pgd_clear(pgd);
+	pud_free(NULL, pud_table);
+	put_page(virt_to_page(pgd));
+}
+
+static void clear_hyp_pud_entry(pud_t *pud)
+{
+	pmd_t *pmd_table __maybe_unused = pmd_offset(pud, 0);
+	VM_BUG_ON(pud_huge(*pud));
+	pud_clear(pud);
+	pmd_free(NULL, pmd_table);
+	put_page(virt_to_page(pud));
+}
+
+static void clear_hyp_pmd_entry(pmd_t *pmd)
+{
+	pte_t *pte_table = pte_offset_kernel(pmd, 0);
+	VM_BUG_ON(pmd_thp_or_huge(*pmd));
+	pmd_clear(pmd);
+	pte_free_kernel(NULL, pte_table);
+	put_page(virt_to_page(pmd));
+}
+
+static void unmap_hyp_ptes(pmd_t *pmd, phys_addr_t addr, phys_addr_t end)
+{
+	pte_t *pte, *start_pte;
+
+	start_pte = pte = pte_offset_kernel(pmd, addr);
+	do {
+		if (!pte_none(*pte)) {
+			kvm_set_pte(pte, __pte(0));
+			put_page(virt_to_page(pte));
+		}
+	} while (pte++, addr += PAGE_SIZE, addr != end);
+
+	if (hyp_pte_table_empty(start_pte))
+		clear_hyp_pmd_entry(pmd);
+}
+
+static void unmap_hyp_pmds(pud_t *pud, phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t next;
+	pmd_t *pmd, *start_pmd;
+
+	start_pmd = pmd = pmd_offset(pud, addr);
+	do {
+		next = pmd_addr_end(addr, end);
+		/* Hyp doesn't use huge pmds */
+		if (!pmd_none(*pmd))
+			unmap_hyp_ptes(pmd, addr, next);
+	} while (pmd++, addr = next, addr != end);
+
+	if (hyp_pmd_table_empty(start_pmd))
+		clear_hyp_pud_entry(pud);
+}
+
+static void unmap_hyp_puds(pgd_t *pgd, phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t next;
+	pud_t *pud, *start_pud;
+
+	start_pud = pud = pud_offset(pgd, addr);
+	do {
+		next = pud_addr_end(addr, end);
+		/* Hyp doesn't use huge puds */
+		if (!pud_none(*pud))
+			unmap_hyp_pmds(pud, addr, next);
+	} while (pud++, addr = next, addr != end);
+
+	if (hyp_pud_table_empty(start_pud))
+		clear_hyp_pgd_entry(pgd);
+}
+
+static void unmap_hyp_range(pgd_t *pgdp, phys_addr_t start, u64 size)
+{
+	pgd_t *pgd;
+	phys_addr_t addr = start, end = start + size;
+	phys_addr_t next;
+
+	/*
+	 * We don't unmap anything from HYP, except at the hyp tear down.
+	 * Hence, we don't have to invalidate the TLBs here.
+	 */
+	pgd = pgdp + pgd_index(addr);
+	do {
+		next = pgd_addr_end(addr, end);
+		if (!pgd_none(*pgd))
+			unmap_hyp_puds(pgd, addr, next);
+	} while (pgd++, addr = next, addr != end);
+}
+
 /**
  * free_boot_hyp_pgd - free HYP boot page tables
  *
@@ -398,14 +492,14 @@ void free_boot_hyp_pgd(void)
 	mutex_lock(&kvm_hyp_pgd_mutex);
 
 	if (boot_hyp_pgd) {
-		unmap_range(NULL, boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE);
-		unmap_range(NULL, boot_hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE);
+		unmap_hyp_range(boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE);
+		unmap_hyp_range(boot_hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE);
 		free_pages((unsigned long)boot_hyp_pgd, hyp_pgd_order);
 		boot_hyp_pgd = NULL;
 	}
 
 	if (hyp_pgd)
-		unmap_range(NULL, hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE);
+		unmap_hyp_range(hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE);
 
 	mutex_unlock(&kvm_hyp_pgd_mutex);
 }
@@ -430,9 +524,9 @@ void free_hyp_pgds(void)
 
 	if (hyp_pgd) {
 		for (addr = PAGE_OFFSET; virt_addr_valid(addr); addr += PGDIR_SIZE)
-			unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
+			unmap_hyp_range(hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
 		for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE)
-			unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
+			unmap_hyp_range(hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
 
 		free_pages((unsigned long)hyp_pgd, hyp_pgd_order);
 		hyp_pgd = NULL;
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 12/29] kvm-arm: Add explicit hyp page table modifiers
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

We have common routines to modify hyp and stage2 page tables
based on the 'kvm' parameter. For a smoother transition to
using separate routines for each, duplicate the routines
and modify the copy to work on hyp.

Marks the forked routines with _hyp_ and gets rid of the
kvm parameter which is no longer needed and is NULL for hyp.
Also, gets rid of calls to kvm_tlb_flush_by_vmid_ipa() calls
from the hyp versions. Uses explicit host page table accessors
instead of the kvm_* page table helpers.

Suggested-by: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/kvm/mmu.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 99 insertions(+), 5 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index f93f717..af526f6 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -388,6 +388,100 @@ static void stage2_flush_vm(struct kvm *kvm)
 	srcu_read_unlock(&kvm->srcu, idx);
 }
 
+static void clear_hyp_pgd_entry(pgd_t *pgd)
+{
+	pud_t *pud_table __maybe_unused = pud_offset(pgd, 0UL);
+	pgd_clear(pgd);
+	pud_free(NULL, pud_table);
+	put_page(virt_to_page(pgd));
+}
+
+static void clear_hyp_pud_entry(pud_t *pud)
+{
+	pmd_t *pmd_table __maybe_unused = pmd_offset(pud, 0);
+	VM_BUG_ON(pud_huge(*pud));
+	pud_clear(pud);
+	pmd_free(NULL, pmd_table);
+	put_page(virt_to_page(pud));
+}
+
+static void clear_hyp_pmd_entry(pmd_t *pmd)
+{
+	pte_t *pte_table = pte_offset_kernel(pmd, 0);
+	VM_BUG_ON(pmd_thp_or_huge(*pmd));
+	pmd_clear(pmd);
+	pte_free_kernel(NULL, pte_table);
+	put_page(virt_to_page(pmd));
+}
+
+static void unmap_hyp_ptes(pmd_t *pmd, phys_addr_t addr, phys_addr_t end)
+{
+	pte_t *pte, *start_pte;
+
+	start_pte = pte = pte_offset_kernel(pmd, addr);
+	do {
+		if (!pte_none(*pte)) {
+			kvm_set_pte(pte, __pte(0));
+			put_page(virt_to_page(pte));
+		}
+	} while (pte++, addr += PAGE_SIZE, addr != end);
+
+	if (hyp_pte_table_empty(start_pte))
+		clear_hyp_pmd_entry(pmd);
+}
+
+static void unmap_hyp_pmds(pud_t *pud, phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t next;
+	pmd_t *pmd, *start_pmd;
+
+	start_pmd = pmd = pmd_offset(pud, addr);
+	do {
+		next = pmd_addr_end(addr, end);
+		/* Hyp doesn't use huge pmds */
+		if (!pmd_none(*pmd))
+			unmap_hyp_ptes(pmd, addr, next);
+	} while (pmd++, addr = next, addr != end);
+
+	if (hyp_pmd_table_empty(start_pmd))
+		clear_hyp_pud_entry(pud);
+}
+
+static void unmap_hyp_puds(pgd_t *pgd, phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t next;
+	pud_t *pud, *start_pud;
+
+	start_pud = pud = pud_offset(pgd, addr);
+	do {
+		next = pud_addr_end(addr, end);
+		/* Hyp doesn't use huge puds */
+		if (!pud_none(*pud))
+			unmap_hyp_pmds(pud, addr, next);
+	} while (pud++, addr = next, addr != end);
+
+	if (hyp_pud_table_empty(start_pud))
+		clear_hyp_pgd_entry(pgd);
+}
+
+static void unmap_hyp_range(pgd_t *pgdp, phys_addr_t start, u64 size)
+{
+	pgd_t *pgd;
+	phys_addr_t addr = start, end = start + size;
+	phys_addr_t next;
+
+	/*
+	 * We don't unmap anything from HYP, except at the hyp tear down.
+	 * Hence, we don't have to invalidate the TLBs here.
+	 */
+	pgd = pgdp + pgd_index(addr);
+	do {
+		next = pgd_addr_end(addr, end);
+		if (!pgd_none(*pgd))
+			unmap_hyp_puds(pgd, addr, next);
+	} while (pgd++, addr = next, addr != end);
+}
+
 /**
  * free_boot_hyp_pgd - free HYP boot page tables
  *
@@ -398,14 +492,14 @@ void free_boot_hyp_pgd(void)
 	mutex_lock(&kvm_hyp_pgd_mutex);
 
 	if (boot_hyp_pgd) {
-		unmap_range(NULL, boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE);
-		unmap_range(NULL, boot_hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE);
+		unmap_hyp_range(boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE);
+		unmap_hyp_range(boot_hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE);
 		free_pages((unsigned long)boot_hyp_pgd, hyp_pgd_order);
 		boot_hyp_pgd = NULL;
 	}
 
 	if (hyp_pgd)
-		unmap_range(NULL, hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE);
+		unmap_hyp_range(hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE);
 
 	mutex_unlock(&kvm_hyp_pgd_mutex);
 }
@@ -430,9 +524,9 @@ void free_hyp_pgds(void)
 
 	if (hyp_pgd) {
 		for (addr = PAGE_OFFSET; virt_addr_valid(addr); addr += PGDIR_SIZE)
-			unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
+			unmap_hyp_range(hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
 		for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE)
-			unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
+			unmap_hyp_range(hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
 
 		free_pages((unsigned long)hyp_pgd, hyp_pgd_order);
 		hyp_pgd = NULL;
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 13/29] kvm-arm: Add stage2 page table modifiers
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Suzuki K Poulose

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Now that the hyp page table is handled by different set of
routines, rename the original shared routines to stage2 handlers.
Also make explicit use of the stage2 page table helpers.

unmap_range has been merged to existing unmap_stage2_range.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/kvm/mmu.c | 97 +++++++++++++++++++++++++-----------------------------
 1 file changed, 44 insertions(+), 53 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index af526f6..f2a6d9b 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -152,26 +152,26 @@ static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc)
 	return p;
 }
 
-static void clear_pgd_entry(struct kvm *kvm, pgd_t *pgd, phys_addr_t addr)
+static void clear_stage2_pgd_entry(struct kvm *kvm, pgd_t *pgd, phys_addr_t addr)
 {
-	pud_t *pud_table __maybe_unused = pud_offset(pgd, 0);
-	pgd_clear(pgd);
+	pud_t *pud_table __maybe_unused = stage2_pud_offset(pgd, 0UL);
+	stage2_pgd_clear(pgd);
 	kvm_tlb_flush_vmid_ipa(kvm, addr);
-	pud_free(NULL, pud_table);
+	stage2_pud_free(pud_table);
 	put_page(virt_to_page(pgd));
 }
 
-static void clear_pud_entry(struct kvm *kvm, pud_t *pud, phys_addr_t addr)
+static void clear_stage2_pud_entry(struct kvm *kvm, pud_t *pud, phys_addr_t addr)
 {
-	pmd_t *pmd_table = pmd_offset(pud, 0);
-	VM_BUG_ON(pud_huge(*pud));
-	pud_clear(pud);
+	pmd_t *pmd_table __maybe_unused = stage2_pmd_offset(pud, 0);
+	VM_BUG_ON(stage2_pud_huge(*pud));
+	stage2_pud_clear(pud);
 	kvm_tlb_flush_vmid_ipa(kvm, addr);
-	pmd_free(NULL, pmd_table);
+	stage2_pmd_free(pmd_table);
 	put_page(virt_to_page(pud));
 }
 
-static void clear_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr)
+static void clear_stage2_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr)
 {
 	pte_t *pte_table = pte_offset_kernel(pmd, 0);
 	VM_BUG_ON(pmd_thp_or_huge(*pmd));
@@ -201,7 +201,7 @@ static void clear_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr)
  * the corresponding TLBs, we call kvm_flush_dcache_p*() to make sure
  * the IO subsystem will never hit in the cache.
  */
-static void unmap_ptes(struct kvm *kvm, pmd_t *pmd,
+static void unmap_stage2_ptes(struct kvm *kvm, pmd_t *pmd,
 		       phys_addr_t addr, phys_addr_t end)
 {
 	phys_addr_t start_addr = addr;
@@ -223,19 +223,19 @@ static void unmap_ptes(struct kvm *kvm, pmd_t *pmd,
 		}
 	} while (pte++, addr += PAGE_SIZE, addr != end);
 
-	if (kvm_pte_table_empty(kvm, start_pte))
-		clear_pmd_entry(kvm, pmd, start_addr);
+	if (stage2_pte_table_empty(start_pte))
+		clear_stage2_pmd_entry(kvm, pmd, start_addr);
 }
 
-static void unmap_pmds(struct kvm *kvm, pud_t *pud,
+static void unmap_stage2_pmds(struct kvm *kvm, pud_t *pud,
 		       phys_addr_t addr, phys_addr_t end)
 {
 	phys_addr_t next, start_addr = addr;
 	pmd_t *pmd, *start_pmd;
 
-	start_pmd = pmd = pmd_offset(pud, addr);
+	start_pmd = pmd = stage2_pmd_offset(pud, addr);
 	do {
-		next = kvm_pmd_addr_end(addr, end);
+		next = stage2_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
 			if (pmd_thp_or_huge(*pmd)) {
 				pmd_t old_pmd = *pmd;
@@ -247,57 +247,64 @@ static void unmap_pmds(struct kvm *kvm, pud_t *pud,
 
 				put_page(virt_to_page(pmd));
 			} else {
-				unmap_ptes(kvm, pmd, addr, next);
+				unmap_stage2_ptes(kvm, pmd, addr, next);
 			}
 		}
 	} while (pmd++, addr = next, addr != end);
 
-	if (kvm_pmd_table_empty(kvm, start_pmd))
-		clear_pud_entry(kvm, pud, start_addr);
+	if (stage2_pmd_table_empty(start_pmd))
+		clear_stage2_pud_entry(kvm, pud, start_addr);
 }
 
-static void unmap_puds(struct kvm *kvm, pgd_t *pgd,
+static void unmap_stage2_puds(struct kvm *kvm, pgd_t *pgd,
 		       phys_addr_t addr, phys_addr_t end)
 {
 	phys_addr_t next, start_addr = addr;
 	pud_t *pud, *start_pud;
 
-	start_pud = pud = pud_offset(pgd, addr);
+	start_pud = pud = stage2_pud_offset(pgd, addr);
 	do {
-		next = kvm_pud_addr_end(addr, end);
-		if (!pud_none(*pud)) {
-			if (pud_huge(*pud)) {
+		next = stage2_pud_addr_end(addr, end);
+		if (!stage2_pud_none(*pud)) {
+			if (stage2_pud_huge(*pud)) {
 				pud_t old_pud = *pud;
 
-				pud_clear(pud);
+				stage2_pud_clear(pud);
 				kvm_tlb_flush_vmid_ipa(kvm, addr);
-
 				kvm_flush_dcache_pud(old_pud);
-
 				put_page(virt_to_page(pud));
 			} else {
-				unmap_pmds(kvm, pud, addr, next);
+				unmap_stage2_pmds(kvm, pud, addr, next);
 			}
 		}
 	} while (pud++, addr = next, addr != end);
 
-	if (kvm_pud_table_empty(kvm, start_pud))
-		clear_pgd_entry(kvm, pgd, start_addr);
+	if (stage2_pud_table_empty(start_pud))
+		clear_stage2_pgd_entry(kvm, pgd, start_addr);
 }
 
-
-static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
-			phys_addr_t start, u64 size)
+/**
+ * unmap_stage2_range -- Clear stage2 page table entries to unmap a range
+ * @kvm:   The VM pointer
+ * @start: The intermediate physical base address of the range to unmap
+ * @size:  The size of the area to unmap
+ *
+ * Clear a range of stage-2 mappings, lowering the various ref-counts.  Must
+ * be called while holding mmu_lock (unless for freeing the stage2 pgd before
+ * destroying the VM), otherwise another faulting VCPU may come in and mess
+ * with things behind our backs.
+ */
+static void unmap_stage2_range(struct kvm *kvm, phys_addr_t start, u64 size)
 {
 	pgd_t *pgd;
 	phys_addr_t addr = start, end = start + size;
 	phys_addr_t next;
 
-	pgd = pgdp + kvm_pgd_index(addr);
+	pgd = kvm->arch.pgd + stage2_pgd_index(addr);
 	do {
-		next = kvm_pgd_addr_end(addr, end);
-		if (!pgd_none(*pgd))
-			unmap_puds(kvm, pgd, addr, next);
+		next = stage2_pgd_addr_end(addr, end);
+		if (!stage2_pgd_none(*pgd))
+			unmap_stage2_puds(kvm, pgd, addr, next);
 	} while (pgd++, addr = next, addr != end);
 }
 
@@ -792,22 +799,6 @@ int kvm_alloc_stage2_pgd(struct kvm *kvm)
 	return 0;
 }
 
-/**
- * unmap_stage2_range -- Clear stage2 page table entries to unmap a range
- * @kvm:   The VM pointer
- * @start: The intermediate physical base address of the range to unmap
- * @size:  The size of the area to unmap
- *
- * Clear a range of stage-2 mappings, lowering the various ref-counts.  Must
- * be called while holding mmu_lock (unless for freeing the stage2 pgd before
- * destroying the VM), otherwise another faulting VCPU may come in and mess
- * with things behind our backs.
- */
-static void unmap_stage2_range(struct kvm *kvm, phys_addr_t start, u64 size)
-{
-	unmap_range(kvm, kvm->arch.pgd, start, size);
-}
-
 static void stage2_unmap_memslot(struct kvm *kvm,
 				 struct kvm_memory_slot *memslot)
 {
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 13/29] kvm-arm: Add stage2 page table modifiers
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Now that the hyp page table is handled by different set of
routines, rename the original shared routines to stage2 handlers.
Also make explicit use of the stage2 page table helpers.

unmap_range has been merged to existing unmap_stage2_range.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/kvm/mmu.c | 97 +++++++++++++++++++++++++-----------------------------
 1 file changed, 44 insertions(+), 53 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index af526f6..f2a6d9b 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -152,26 +152,26 @@ static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc)
 	return p;
 }
 
-static void clear_pgd_entry(struct kvm *kvm, pgd_t *pgd, phys_addr_t addr)
+static void clear_stage2_pgd_entry(struct kvm *kvm, pgd_t *pgd, phys_addr_t addr)
 {
-	pud_t *pud_table __maybe_unused = pud_offset(pgd, 0);
-	pgd_clear(pgd);
+	pud_t *pud_table __maybe_unused = stage2_pud_offset(pgd, 0UL);
+	stage2_pgd_clear(pgd);
 	kvm_tlb_flush_vmid_ipa(kvm, addr);
-	pud_free(NULL, pud_table);
+	stage2_pud_free(pud_table);
 	put_page(virt_to_page(pgd));
 }
 
-static void clear_pud_entry(struct kvm *kvm, pud_t *pud, phys_addr_t addr)
+static void clear_stage2_pud_entry(struct kvm *kvm, pud_t *pud, phys_addr_t addr)
 {
-	pmd_t *pmd_table = pmd_offset(pud, 0);
-	VM_BUG_ON(pud_huge(*pud));
-	pud_clear(pud);
+	pmd_t *pmd_table __maybe_unused = stage2_pmd_offset(pud, 0);
+	VM_BUG_ON(stage2_pud_huge(*pud));
+	stage2_pud_clear(pud);
 	kvm_tlb_flush_vmid_ipa(kvm, addr);
-	pmd_free(NULL, pmd_table);
+	stage2_pmd_free(pmd_table);
 	put_page(virt_to_page(pud));
 }
 
-static void clear_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr)
+static void clear_stage2_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr)
 {
 	pte_t *pte_table = pte_offset_kernel(pmd, 0);
 	VM_BUG_ON(pmd_thp_or_huge(*pmd));
@@ -201,7 +201,7 @@ static void clear_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr)
  * the corresponding TLBs, we call kvm_flush_dcache_p*() to make sure
  * the IO subsystem will never hit in the cache.
  */
-static void unmap_ptes(struct kvm *kvm, pmd_t *pmd,
+static void unmap_stage2_ptes(struct kvm *kvm, pmd_t *pmd,
 		       phys_addr_t addr, phys_addr_t end)
 {
 	phys_addr_t start_addr = addr;
@@ -223,19 +223,19 @@ static void unmap_ptes(struct kvm *kvm, pmd_t *pmd,
 		}
 	} while (pte++, addr += PAGE_SIZE, addr != end);
 
-	if (kvm_pte_table_empty(kvm, start_pte))
-		clear_pmd_entry(kvm, pmd, start_addr);
+	if (stage2_pte_table_empty(start_pte))
+		clear_stage2_pmd_entry(kvm, pmd, start_addr);
 }
 
-static void unmap_pmds(struct kvm *kvm, pud_t *pud,
+static void unmap_stage2_pmds(struct kvm *kvm, pud_t *pud,
 		       phys_addr_t addr, phys_addr_t end)
 {
 	phys_addr_t next, start_addr = addr;
 	pmd_t *pmd, *start_pmd;
 
-	start_pmd = pmd = pmd_offset(pud, addr);
+	start_pmd = pmd = stage2_pmd_offset(pud, addr);
 	do {
-		next = kvm_pmd_addr_end(addr, end);
+		next = stage2_pmd_addr_end(addr, end);
 		if (!pmd_none(*pmd)) {
 			if (pmd_thp_or_huge(*pmd)) {
 				pmd_t old_pmd = *pmd;
@@ -247,57 +247,64 @@ static void unmap_pmds(struct kvm *kvm, pud_t *pud,
 
 				put_page(virt_to_page(pmd));
 			} else {
-				unmap_ptes(kvm, pmd, addr, next);
+				unmap_stage2_ptes(kvm, pmd, addr, next);
 			}
 		}
 	} while (pmd++, addr = next, addr != end);
 
-	if (kvm_pmd_table_empty(kvm, start_pmd))
-		clear_pud_entry(kvm, pud, start_addr);
+	if (stage2_pmd_table_empty(start_pmd))
+		clear_stage2_pud_entry(kvm, pud, start_addr);
 }
 
-static void unmap_puds(struct kvm *kvm, pgd_t *pgd,
+static void unmap_stage2_puds(struct kvm *kvm, pgd_t *pgd,
 		       phys_addr_t addr, phys_addr_t end)
 {
 	phys_addr_t next, start_addr = addr;
 	pud_t *pud, *start_pud;
 
-	start_pud = pud = pud_offset(pgd, addr);
+	start_pud = pud = stage2_pud_offset(pgd, addr);
 	do {
-		next = kvm_pud_addr_end(addr, end);
-		if (!pud_none(*pud)) {
-			if (pud_huge(*pud)) {
+		next = stage2_pud_addr_end(addr, end);
+		if (!stage2_pud_none(*pud)) {
+			if (stage2_pud_huge(*pud)) {
 				pud_t old_pud = *pud;
 
-				pud_clear(pud);
+				stage2_pud_clear(pud);
 				kvm_tlb_flush_vmid_ipa(kvm, addr);
-
 				kvm_flush_dcache_pud(old_pud);
-
 				put_page(virt_to_page(pud));
 			} else {
-				unmap_pmds(kvm, pud, addr, next);
+				unmap_stage2_pmds(kvm, pud, addr, next);
 			}
 		}
 	} while (pud++, addr = next, addr != end);
 
-	if (kvm_pud_table_empty(kvm, start_pud))
-		clear_pgd_entry(kvm, pgd, start_addr);
+	if (stage2_pud_table_empty(start_pud))
+		clear_stage2_pgd_entry(kvm, pgd, start_addr);
 }
 
-
-static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
-			phys_addr_t start, u64 size)
+/**
+ * unmap_stage2_range -- Clear stage2 page table entries to unmap a range
+ * @kvm:   The VM pointer
+ * @start: The intermediate physical base address of the range to unmap
+ * @size:  The size of the area to unmap
+ *
+ * Clear a range of stage-2 mappings, lowering the various ref-counts.  Must
+ * be called while holding mmu_lock (unless for freeing the stage2 pgd before
+ * destroying the VM), otherwise another faulting VCPU may come in and mess
+ * with things behind our backs.
+ */
+static void unmap_stage2_range(struct kvm *kvm, phys_addr_t start, u64 size)
 {
 	pgd_t *pgd;
 	phys_addr_t addr = start, end = start + size;
 	phys_addr_t next;
 
-	pgd = pgdp + kvm_pgd_index(addr);
+	pgd = kvm->arch.pgd + stage2_pgd_index(addr);
 	do {
-		next = kvm_pgd_addr_end(addr, end);
-		if (!pgd_none(*pgd))
-			unmap_puds(kvm, pgd, addr, next);
+		next = stage2_pgd_addr_end(addr, end);
+		if (!stage2_pgd_none(*pgd))
+			unmap_stage2_puds(kvm, pgd, addr, next);
 	} while (pgd++, addr = next, addr != end);
 }
 
@@ -792,22 +799,6 @@ int kvm_alloc_stage2_pgd(struct kvm *kvm)
 	return 0;
 }
 
-/**
- * unmap_stage2_range -- Clear stage2 page table entries to unmap a range
- * @kvm:   The VM pointer
- * @start: The intermediate physical base address of the range to unmap
- * @size:  The size of the area to unmap
- *
- * Clear a range of stage-2 mappings, lowering the various ref-counts.  Must
- * be called while holding mmu_lock (unless for freeing the stage2 pgd before
- * destroying the VM), otherwise another faulting VCPU may come in and mess
- * with things behind our backs.
- */
-static void unmap_stage2_range(struct kvm *kvm, phys_addr_t start, u64 size)
-{
-	unmap_range(kvm, kvm->arch.pgd, start, size);
-}
-
 static void stage2_unmap_memslot(struct kvm *kvm,
 				 struct kvm_memory_slot *memslot)
 {
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 14/29] kvm-arm: Cleanup kvm_* wrappers
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Suzuki K Poulose

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Now that we have switched to explicit page table routines,
get rid of the obsolete kvm_* wrappers.

Also, kvm_tlb_flush_vmid_by_ipa is now called only on stage2
page tables, hence get rid of the redundant check.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/include/asm/kvm_mmu.h   | 16 ----------------
 arch/arm/kvm/mmu.c               |  9 +--------
 arch/arm64/include/asm/kvm_mmu.h | 24 ------------------------
 3 files changed, 1 insertion(+), 48 deletions(-)

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index 5522cdd..a7736d5 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -136,22 +136,6 @@ static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 	return (pmd_val(*pmd) & L_PMD_S2_RDWR) == L_PMD_S2_RDONLY;
 }
 
-
-/* Open coded p*d_addr_end that can deal with 64bit addresses */
-#define kvm_pgd_addr_end(addr, end)					\
-({	u64 __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;		\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-
-#define kvm_pud_addr_end(addr,end)		(end)
-
-#define kvm_pmd_addr_end(addr, end)					\
-({	u64 __boundary = ((addr) + PMD_SIZE) & PMD_MASK;		\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-
-#define kvm_pgd_index(addr)			pgd_index(addr)
-
 static inline bool kvm_page_empty(void *ptr)
 {
 	struct page *ptr_page = virt_to_page(ptr);
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index f2a6d9b..d3fa96e 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -66,14 +66,7 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
 
 static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
 {
-	/*
-	 * This function also gets called when dealing with HYP page
-	 * tables. As HYP doesn't have an associated struct kvm (and
-	 * the HYP page tables are fairly static), we don't do
-	 * anything there.
-	 */
-	if (kvm)
-		kvm_call_hyp(__kvm_tlb_flush_vmid_ipa, kvm, ipa);
+	kvm_call_hyp(__kvm_tlb_flush_vmid_ipa, kvm, ipa);
 }
 
 /*
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index edf3c62..a3c0d05 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -153,13 +153,6 @@ static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 	return (pmd_val(*pmd) & PMD_S2_RDWR) == PMD_S2_RDONLY;
 }
 
-
-#define kvm_pgd_addr_end(addr, end)	pgd_addr_end(addr, end)
-#define kvm_pud_addr_end(addr, end)	pud_addr_end(addr, end)
-#define kvm_pmd_addr_end(addr, end)	pmd_addr_end(addr, end)
-
-#define kvm_pgd_index(addr)	(((addr) >> PGDIR_SHIFT) & (PTRS_PER_S2_PGD - 1))
-
 static inline void *kvm_get_hwpgd(struct kvm *kvm)
 {
 	pgd_t *pgd = kvm->arch.pgd;
@@ -232,23 +225,6 @@ static inline bool kvm_page_empty(void *ptr)
 	return page_count(ptr_page) == 1;
 }
 
-#define kvm_pte_table_empty(kvm, ptep) kvm_page_empty(ptep)
-
-#ifdef __PAGETABLE_PMD_FOLDED
-#define kvm_pmd_table_empty(kvm, pmdp) (0)
-#else
-#define kvm_pmd_table_empty(kvm, pmdp) \
-	(kvm_page_empty(pmdp) && (!(kvm) || KVM_PREALLOC_LEVEL < 2))
-#endif
-
-#ifdef __PAGETABLE_PUD_FOLDED
-#define kvm_pud_table_empty(kvm, pudp) (0)
-#else
-#define kvm_pud_table_empty(kvm, pudp) \
-	(kvm_page_empty(pudp) && (!(kvm) || KVM_PREALLOC_LEVEL < 1))
-#endif
-
-
 #define hyp_pte_table_empty(ptep) kvm_page_empty(ptep)
 
 #ifdef __PAGETABLE_PMD_FOLDED
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 14/29] kvm-arm: Cleanup kvm_* wrappers
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Now that we have switched to explicit page table routines,
get rid of the obsolete kvm_* wrappers.

Also, kvm_tlb_flush_vmid_by_ipa is now called only on stage2
page tables, hence get rid of the redundant check.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/include/asm/kvm_mmu.h   | 16 ----------------
 arch/arm/kvm/mmu.c               |  9 +--------
 arch/arm64/include/asm/kvm_mmu.h | 24 ------------------------
 3 files changed, 1 insertion(+), 48 deletions(-)

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index 5522cdd..a7736d5 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -136,22 +136,6 @@ static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 	return (pmd_val(*pmd) & L_PMD_S2_RDWR) == L_PMD_S2_RDONLY;
 }
 
-
-/* Open coded p*d_addr_end that can deal with 64bit addresses */
-#define kvm_pgd_addr_end(addr, end)					\
-({	u64 __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;		\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-
-#define kvm_pud_addr_end(addr,end)		(end)
-
-#define kvm_pmd_addr_end(addr, end)					\
-({	u64 __boundary = ((addr) + PMD_SIZE) & PMD_MASK;		\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-
-#define kvm_pgd_index(addr)			pgd_index(addr)
-
 static inline bool kvm_page_empty(void *ptr)
 {
 	struct page *ptr_page = virt_to_page(ptr);
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index f2a6d9b..d3fa96e 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -66,14 +66,7 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
 
 static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
 {
-	/*
-	 * This function also gets called when dealing with HYP page
-	 * tables. As HYP doesn't have an associated struct kvm (and
-	 * the HYP page tables are fairly static), we don't do
-	 * anything there.
-	 */
-	if (kvm)
-		kvm_call_hyp(__kvm_tlb_flush_vmid_ipa, kvm, ipa);
+	kvm_call_hyp(__kvm_tlb_flush_vmid_ipa, kvm, ipa);
 }
 
 /*
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index edf3c62..a3c0d05 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -153,13 +153,6 @@ static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 	return (pmd_val(*pmd) & PMD_S2_RDWR) == PMD_S2_RDONLY;
 }
 
-
-#define kvm_pgd_addr_end(addr, end)	pgd_addr_end(addr, end)
-#define kvm_pud_addr_end(addr, end)	pud_addr_end(addr, end)
-#define kvm_pmd_addr_end(addr, end)	pmd_addr_end(addr, end)
-
-#define kvm_pgd_index(addr)	(((addr) >> PGDIR_SHIFT) & (PTRS_PER_S2_PGD - 1))
-
 static inline void *kvm_get_hwpgd(struct kvm *kvm)
 {
 	pgd_t *pgd = kvm->arch.pgd;
@@ -232,23 +225,6 @@ static inline bool kvm_page_empty(void *ptr)
 	return page_count(ptr_page) == 1;
 }
 
-#define kvm_pte_table_empty(kvm, ptep) kvm_page_empty(ptep)
-
-#ifdef __PAGETABLE_PMD_FOLDED
-#define kvm_pmd_table_empty(kvm, pmdp) (0)
-#else
-#define kvm_pmd_table_empty(kvm, pmdp) \
-	(kvm_page_empty(pmdp) && (!(kvm) || KVM_PREALLOC_LEVEL < 2))
-#endif
-
-#ifdef __PAGETABLE_PUD_FOLDED
-#define kvm_pud_table_empty(kvm, pudp) (0)
-#else
-#define kvm_pud_table_empty(kvm, pudp) \
-	(kvm_page_empty(pudp) && (!(kvm) || KVM_PREALLOC_LEVEL < 1))
-#endif
-
-
 #define hyp_pte_table_empty(ptep) kvm_page_empty(ptep)
 
 #ifdef __PAGETABLE_PMD_FOLDED
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 15/29] kvm: arm64: Get rid of fake page table levels
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvm, Marc Zyngier, linux-arm-kernel, kvmarm

From: Suzuki K Poulose <suzuki.poulose@arm.com>

On arm64, the hardware supports concatenation of upto 16 tables,
at entry level for stage2 translations and we make use that whenever
possible. This could lead to reduced number of translation levels than
the normal (stage1 table) table. Also, since the IPA(40bit) is smaller
than the some of the supported VA_BITS (e.g, 48bit), there could be
different number of levels in stage-1 vs stage-2 tables. To reuse the
kernel host page table walker for stage2 we have been using a fake
software page table level, not known to the hardware. But with 16K
translations, there could be upto 2 fake software levels (with 48bit VA
and 40bit IPA), which complicates the code. Hence, we want to get rid of
the hack.

Now that we have explicit accessors for hyp vs stage2 page tables,
define the stage2 walker helpers accordingly based on the actual
table used by the hardware.

Once we know the number of translation levels used by the hardware,
it is merely a job of defining the helpers based on whether a
particular level is folded or not, looking at the number of levels.

Some facts before we calculate the translation levels:

1) Smallest page size supported by arm64 is 4K.
2) The minimum number of bits resolved at any page table level
   is (PAGE_SHIFT - 3) at intermediate levels.
Both of them implies, minimum number of bits required for a level
change is 9.

Since we can concatenate upto 16 tables at stage2 entry, the total
number of page table levels used by the hardware for resolving N bits
is same as that for (N - 4) bits (with concatenation), as there cannot
be a level in between (N, N-4) as per the above rules.

Hence, we have

 STAGE2_PGTABLE_LEVELS = PGTABLE_LEVELS(KVM_PHYS_SHIFT - 4)

With the current IPA limit (40bit), for all supported translations
and VA_BITS, we have the following condition (even for 36bit VA with
16K page size):

 CONFIG_PGTABLE_LEVELS >= STAGE2_PGTABLE_LEVELS.

So, for e.g,  if PUD is present in stage2, it is present in the hyp(host).
Hence, we fall back to the host definition if we find that a level is not
folded. Otherwise we redefine it accordingly. A build time check is added
to make sure the above condition holds. If this condition breaks in future,
we can rearrange the host level helpers and fix our code easily.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_mmu.h              |  64 +-------------
 arch/arm64/include/asm/stage2_pgtable-nopmd.h |  42 +++++++++
 arch/arm64/include/asm/stage2_pgtable-nopud.h |  39 ++++++++
 arch/arm64/include/asm/stage2_pgtable.h       | 122 +++++++++++++++++++-------
 4 files changed, 172 insertions(+), 95 deletions(-)
 create mode 100644 arch/arm64/include/asm/stage2_pgtable-nopmd.h
 create mode 100644 arch/arm64/include/asm/stage2_pgtable-nopud.h

diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index a3c0d05..e3fee0a 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -45,18 +45,6 @@
  */
 #define TRAMPOLINE_VA		(HYP_PAGE_OFFSET_MASK & PAGE_MASK)
 
-/*
- * KVM_MMU_CACHE_MIN_PAGES is the number of stage2 page table translation
- * levels in addition to the PGD and potentially the PUD which are
- * pre-allocated (we pre-allocate the fake PGD and the PUD when the Stage-2
- * tables use one level of tables less than the kernel.
- */
-#ifdef CONFIG_ARM64_64K_PAGES
-#define KVM_MMU_CACHE_MIN_PAGES	1
-#else
-#define KVM_MMU_CACHE_MIN_PAGES	2
-#endif
-
 #ifdef __ASSEMBLY__
 
 #include <asm/alternative.h>
@@ -155,69 +143,21 @@ static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 
 static inline void *kvm_get_hwpgd(struct kvm *kvm)
 {
-	pgd_t *pgd = kvm->arch.pgd;
-	pud_t *pud;
-
-	if (KVM_PREALLOC_LEVEL == 0)
-		return pgd;
-
-	pud = pud_offset(pgd, 0);
-	if (KVM_PREALLOC_LEVEL == 1)
-		return pud;
-
-	BUG_ON(KVM_PREALLOC_LEVEL != 2);
-	return pmd_offset(pud, 0);
+	return kvm->arch.pgd;
 }
 
 static inline unsigned int kvm_get_hwpgd_size(void)
 {
-	if (KVM_PREALLOC_LEVEL > 0)
-		return PTRS_PER_S2_PGD * PAGE_SIZE;
 	return PTRS_PER_S2_PGD * sizeof(pgd_t);
 }
 
-/*
- * Allocate fake pgd for the host kernel page table macros to work.
- * This is not used by the hardware and we have no alignment
- * requirement for this allocation.
- */
 static inline pgd_t *kvm_setup_fake_pgd(pgd_t *hwpgd)
 {
-	int i;
-	pgd_t *pgd;
-
-	if (!KVM_PREALLOC_LEVEL)
-		return hwpgd;
-
-	/*
-	 * When KVM_PREALLOC_LEVEL==2, we allocate a single page for
-	 * the PMD and the kernel will use folded pud.
-	 * When KVM_PREALLOC_LEVEL==1, we allocate 2 consecutive PUD
-	 * pages.
-	 */
-
-	pgd = kmalloc(PTRS_PER_S2_PGD * sizeof(pgd_t),
-			GFP_KERNEL | __GFP_ZERO);
-	if (!pgd)
-		return ERR_PTR(-ENOMEM);
-
-	/* Plug the HW PGD into the fake one. */
-	for (i = 0; i < PTRS_PER_S2_PGD; i++) {
-		if (KVM_PREALLOC_LEVEL == 1)
-			pgd_populate(NULL, pgd + i,
-				     (pud_t *)hwpgd + i * PTRS_PER_PUD);
-		else if (KVM_PREALLOC_LEVEL == 2)
-			pud_populate(NULL, pud_offset(pgd, 0) + i,
-				     (pmd_t *)hwpgd + i * PTRS_PER_PMD);
-	}
-
-	return pgd;
+	return hwpgd;
 }
 
 static inline void kvm_free_fake_pgd(pgd_t *pgd)
 {
-	if (KVM_PREALLOC_LEVEL > 0)
-		kfree(pgd);
 }
 static inline bool kvm_page_empty(void *ptr)
 {
diff --git a/arch/arm64/include/asm/stage2_pgtable-nopmd.h b/arch/arm64/include/asm/stage2_pgtable-nopmd.h
new file mode 100644
index 0000000..2656a0f
--- /dev/null
+++ b/arch/arm64/include/asm/stage2_pgtable-nopmd.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2016 - ARM Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __ARM64_S2_PGTABLE_NOPMD_H_
+#define __ARM64_S2_PGTABLE_NOPMD_H_
+
+#include <asm/stage2_pgtable-nopud.h>
+
+#define __S2_PGTABLE_PMD_FOLDED
+
+#define S2_PMD_SHIFT		S2_PUD_SHIFT
+#define S2_PTRS_PER_PMD		1
+#define S2_PMD_SIZE		(1UL << S2_PMD_SHIFT)
+#define S2_PMD_MASK		(~(S2_PMD_SIZE-1))
+
+#define stage2_pud_none(pud)			(0)
+#define stage2_pud_present(pud)			(1)
+#define stage2_pud_clear(pud)			do { } while (0)
+#define stage2_pud_populate(pud, pmd)		do { } while (0)
+#define stage2_pmd_offset(pud, address)		((pmd_t *)(pud))
+
+#define stage2_pmd_free(pmd)			do { } while (0)
+
+#define stage2_pmd_addr_end(addr, end)		(end)
+
+#define stage2_pud_huge(pud)			(0)
+#define stage2_pmd_table_empty(pmdp)		(0)
+
+#endif
diff --git a/arch/arm64/include/asm/stage2_pgtable-nopud.h b/arch/arm64/include/asm/stage2_pgtable-nopud.h
new file mode 100644
index 0000000..5ee87b5
--- /dev/null
+++ b/arch/arm64/include/asm/stage2_pgtable-nopud.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2016 - ARM Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __ARM64_S2_PGTABLE_NOPUD_H_
+#define __ARM64_S2_PGTABLE_NOPUD_H_
+
+#define __S2_PGTABLE_PUD_FOLDED
+
+#define S2_PUD_SHIFT		S2_PGDIR_SHIFT
+#define S2_PTRS_PER_PUD		1
+#define S2_PUD_SIZE		(_AC(1, UL) << S2_PUD_SHIFT)
+#define S2_PUD_MASK		(~(S2_PUD_SIZE-1))
+
+#define stage2_pgd_none(pgd)			(0)
+#define stage2_pgd_present(pgd)			(1)
+#define stage2_pgd_clear(pgd)			do { } while (0)
+#define stage2_pgd_populate(pgd, pud)	do { } while (0)
+
+#define stage2_pud_offset(pgd, address)		((pud_t *)(pgd))
+
+#define stage2_pud_free(x)			do { } while (0)
+
+#define stage2_pud_addr_end(addr, end)		(end)
+#define stage2_pud_table_empty(pmdp)		(0)
+
+#endif
diff --git a/arch/arm64/include/asm/stage2_pgtable.h b/arch/arm64/include/asm/stage2_pgtable.h
index 0ec218f..8b68099 100644
--- a/arch/arm64/include/asm/stage2_pgtable.h
+++ b/arch/arm64/include/asm/stage2_pgtable.h
@@ -22,32 +22,61 @@
 #include <asm/pgtable.h>
 
 /*
- * In the case where PGDIR_SHIFT is larger than KVM_PHYS_SHIFT, we can address
- * the entire IPA input range with a single pgd entry, and we would only need
- * one pgd entry.  Note that in this case, the pgd is actually not used by
- * the MMU for Stage-2 translations, but is merely a fake pgd used as a data
- * structure for the kernel pgtable macros to work.
+ * The hardware supports concatenation of up to 16 tables at stage2 entry level
+ * and we use the feature whenever possible.
+ *
+ * Now, the minimum number of bits resolved at any level is (PAGE_SHIFT - 3).
+ * On arm64, the smallest PAGE_SIZE supported is 4k, which means
+ *             (PAGE_SHIFT - 3) > 4 holds for all page sizes.
+ * This implies, the total number of page table levels at stage2 expected
+ * by the hardware is actually the number of levels required for (KVM_PHYS_SHIFT - 4)
+ * in normal translations(e.g, stage1), since we cannot have another level in
+ * the range (KVM_PHYS_SHIFT, KVM_PHYS_SHIFT - 4).
  */
-#if PGDIR_SHIFT > KVM_PHYS_SHIFT
-#define PTRS_PER_S2_PGD_SHIFT	0
-#else
-#define PTRS_PER_S2_PGD_SHIFT	(KVM_PHYS_SHIFT - PGDIR_SHIFT)
-#endif
-#define PTRS_PER_S2_PGD		(1 << PTRS_PER_S2_PGD_SHIFT)
+#define STAGE2_PGTABLE_LEVELS		ARM64_HW_PGTABLE_LEVELS(KVM_PHYS_SHIFT - 4)
 
 /*
- * If we are concatenating first level stage-2 page tables, we would have less
- * than or equal to 16 pointers in the fake PGD, because that's what the
- * architecture allows.  In this case, (4 - CONFIG_PGTABLE_LEVELS)
- * represents the first level for the host, and we add 1 to go to the next
- * level (which uses contatenation) for the stage-2 tables.
+ * With all the supported VA_BITs and 40bit guest IPA, the following condition
+ * is always true:
+ *
+ *       STAGE2_PGTABLE_LEVELS <= CONFIG_PGTABLE_LEVELS
+ *
+ * We base our stage-2 page table walker helpers on this assumption and
+ * fall back to using the host version of the helper wherever possible.
+ * i.e, if a particular level is not folded (e.g, PUD) at stage2, we fall back
+ * to using the host version, since it is guaranteed it is not folded at host.
+ *
+ * If the condition breaks in the future, we can rearrange the host level
+ * definitions and reuse them for stage2. Till then...
  */
-#if PTRS_PER_S2_PGD <= 16
-#define KVM_PREALLOC_LEVEL	(4 - CONFIG_PGTABLE_LEVELS + 1)
-#else
-#define KVM_PREALLOC_LEVEL	(0)
+#if STAGE2_PGTABLE_LEVELS > CONFIG_PGTABLE_LEVELS
+#error "Unsupported combination of guest IPA and host VA_BITS."
 #endif
 
+/* S2_PGDIR_SHIFT is the size mapped by top-level stage2 entry */
+#define S2_PGDIR_SHIFT			ARM64_HW_PGTABLE_LEVEL_SHIFT(4 - STAGE2_PGTABLE_LEVELS)
+#define S2_PGDIR_SIZE			(_AC(1, UL) << S2_PGDIR_SHIFT)
+#define S2_PGDIR_MASK			(~(S2_PGDIR_SIZE - 1))
+
+/*
+ * The number of PTRS across all concatenated stage2 tables given by the
+ * number of bits resolved at the initial level.
+ */
+#define PTRS_PER_S2_PGD			(1 << (KVM_PHYS_SHIFT - S2_PGDIR_SHIFT))
+
+/*
+ * KVM_MMU_CACHE_MIN_PAGES is the number of stage2 page table translation
+ * levels in addition to the PGD.
+ */
+#define KVM_MMU_CACHE_MIN_PAGES		(STAGE2_PGTABLE_LEVELS - 1)
+
+
+#if STAGE2_PGTABLE_LEVELS > 3
+
+#define S2_PUD_SHIFT			ARM64_HW_PGTABLE_LEVEL_SHIFT(1)
+#define S2_PUD_SIZE			(_AC(1, UL) << S2_PUD_SHIFT)
+#define S2_PUD_MASK			(~(S2_PUD_SIZE - 1))
+
 #define stage2_pgd_none(pgd)				pgd_none(pgd)
 #define stage2_pgd_clear(pgd)				pgd_clear(pgd)
 #define stage2_pgd_present(pgd)				pgd_present(pgd)
@@ -55,6 +84,24 @@
 #define stage2_pud_offset(pgd, address)			pud_offset(pgd, address)
 #define stage2_pud_free(pud)				pud_free(NULL, pud)
 
+#define stage2_pud_table_empty(pudp)			kvm_page_empty(pudp)
+
+static inline phys_addr_t stage2_pud_addr_end(phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t boundary = (addr + S2_PUD_SIZE) & S2_PUD_MASK;
+
+	return (boundary - 1 < end - 1) ? boundary : end;
+}
+
+#endif		/* STAGE2_PGTABLE_LEVELS > 3 */
+
+
+#if STAGE2_PGTABLE_LEVELS > 2
+
+#define S2_PMD_SHIFT			ARM64_HW_PGTABLE_LEVEL_SHIFT(2)
+#define S2_PMD_SIZE			(_AC(1, UL) << S2_PMD_SHIFT)
+#define S2_PMD_MASK			(~(S2_PMD_SIZE - 1))
+
 #define stage2_pud_none(pud)				pud_none(pud)
 #define stage2_pud_clear(pud)				pud_clear(pud)
 #define stage2_pud_present(pud)				pud_present(pud)
@@ -63,24 +110,33 @@
 #define stage2_pmd_free(pmd)				pmd_free(NULL, pmd)
 
 #define stage2_pud_huge(pud)				pud_huge(pud)
+#define stage2_pmd_table_empty(pmdp)			kvm_page_empty(pmdp)
+
+static inline phys_addr_t stage2_pmd_addr_end(phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t boundary = (addr + S2_PMD_SIZE) & S2_PMD_MASK;
 
-#define stage2_pgd_addr_end(address, end)		pgd_addr_end(address, end)
-#define stage2_pud_addr_end(address, end)		pud_addr_end(address, end)
-#define stage2_pmd_addr_end(address, end)		pmd_addr_end(address, end)
+	return (boundary - 1 < end - 1) ? boundary : end;
+}
+
+#endif		/* STAGE2_PGTABLE_LEVELS > 2 */
 
 #define stage2_pte_table_empty(ptep)			kvm_page_empty(ptep)
-#ifdef __PGTABLE_PMD_FOLDED
-#define stage2_pmd_table_empty(pmdp)			(0)
-#else
-#define stage2_pmd_table_empty(pmdp)			((KVM_PREALLOC_LEVEL < 2) && kvm_page_empty(pmdp))
-#endif
 
-#ifdef __PGTABLE_PUD_FOLDED
-#define stage2_pud_table_empty(pudp)			(0)
-#else
-#define stage2_pud_table_empty(pudp)			((KVM_PREALLOC_LEVEL < 1) && kvm_page_empty(pudp))
+#if STAGE2_PGTABLE_LEVELS == 2
+#include <asm/stage2_pgtable-nopmd.h>
+#elif STAGE2_PGTABLE_LEVELS == 3
+#include <asm/stage2_pgtable-nopud.h>
 #endif
 
-#define stage2_pgd_index(addr)				(((addr) >> PGDIR_SHIFT) & (PTRS_PER_S2_PGD - 1))
+
+#define stage2_pgd_index(addr)				(((addr) >> S2_PGDIR_SHIFT) & (PTRS_PER_S2_PGD - 1))
+
+static inline phys_addr_t stage2_pgd_addr_end(phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t boundary = (addr + S2_PGDIR_SIZE) & S2_PGDIR_MASK;
+
+	return (boundary - 1 < end - 1) ? boundary : end;
+}
 
 #endif	/* __ARM64_S2_PGTABLE_H_ */
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 15/29] kvm: arm64: Get rid of fake page table levels
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

On arm64, the hardware supports concatenation of upto 16 tables,
at entry level for stage2 translations and we make use that whenever
possible. This could lead to reduced number of translation levels than
the normal (stage1 table) table. Also, since the IPA(40bit) is smaller
than the some of the supported VA_BITS (e.g, 48bit), there could be
different number of levels in stage-1 vs stage-2 tables. To reuse the
kernel host page table walker for stage2 we have been using a fake
software page table level, not known to the hardware. But with 16K
translations, there could be upto 2 fake software levels (with 48bit VA
and 40bit IPA), which complicates the code. Hence, we want to get rid of
the hack.

Now that we have explicit accessors for hyp vs stage2 page tables,
define the stage2 walker helpers accordingly based on the actual
table used by the hardware.

Once we know the number of translation levels used by the hardware,
it is merely a job of defining the helpers based on whether a
particular level is folded or not, looking at the number of levels.

Some facts before we calculate the translation levels:

1) Smallest page size supported by arm64 is 4K.
2) The minimum number of bits resolved at any page table level
   is (PAGE_SHIFT - 3) at intermediate levels.
Both of them implies, minimum number of bits required for a level
change is 9.

Since we can concatenate upto 16 tables at stage2 entry, the total
number of page table levels used by the hardware for resolving N bits
is same as that for (N - 4) bits (with concatenation), as there cannot
be a level in between (N, N-4) as per the above rules.

Hence, we have

 STAGE2_PGTABLE_LEVELS = PGTABLE_LEVELS(KVM_PHYS_SHIFT - 4)

With the current IPA limit (40bit), for all supported translations
and VA_BITS, we have the following condition (even for 36bit VA with
16K page size):

 CONFIG_PGTABLE_LEVELS >= STAGE2_PGTABLE_LEVELS.

So, for e.g,  if PUD is present in stage2, it is present in the hyp(host).
Hence, we fall back to the host definition if we find that a level is not
folded. Otherwise we redefine it accordingly. A build time check is added
to make sure the above condition holds. If this condition breaks in future,
we can rearrange the host level helpers and fix our code easily.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_mmu.h              |  64 +-------------
 arch/arm64/include/asm/stage2_pgtable-nopmd.h |  42 +++++++++
 arch/arm64/include/asm/stage2_pgtable-nopud.h |  39 ++++++++
 arch/arm64/include/asm/stage2_pgtable.h       | 122 +++++++++++++++++++-------
 4 files changed, 172 insertions(+), 95 deletions(-)
 create mode 100644 arch/arm64/include/asm/stage2_pgtable-nopmd.h
 create mode 100644 arch/arm64/include/asm/stage2_pgtable-nopud.h

diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index a3c0d05..e3fee0a 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -45,18 +45,6 @@
  */
 #define TRAMPOLINE_VA		(HYP_PAGE_OFFSET_MASK & PAGE_MASK)
 
-/*
- * KVM_MMU_CACHE_MIN_PAGES is the number of stage2 page table translation
- * levels in addition to the PGD and potentially the PUD which are
- * pre-allocated (we pre-allocate the fake PGD and the PUD when the Stage-2
- * tables use one level of tables less than the kernel.
- */
-#ifdef CONFIG_ARM64_64K_PAGES
-#define KVM_MMU_CACHE_MIN_PAGES	1
-#else
-#define KVM_MMU_CACHE_MIN_PAGES	2
-#endif
-
 #ifdef __ASSEMBLY__
 
 #include <asm/alternative.h>
@@ -155,69 +143,21 @@ static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 
 static inline void *kvm_get_hwpgd(struct kvm *kvm)
 {
-	pgd_t *pgd = kvm->arch.pgd;
-	pud_t *pud;
-
-	if (KVM_PREALLOC_LEVEL == 0)
-		return pgd;
-
-	pud = pud_offset(pgd, 0);
-	if (KVM_PREALLOC_LEVEL == 1)
-		return pud;
-
-	BUG_ON(KVM_PREALLOC_LEVEL != 2);
-	return pmd_offset(pud, 0);
+	return kvm->arch.pgd;
 }
 
 static inline unsigned int kvm_get_hwpgd_size(void)
 {
-	if (KVM_PREALLOC_LEVEL > 0)
-		return PTRS_PER_S2_PGD * PAGE_SIZE;
 	return PTRS_PER_S2_PGD * sizeof(pgd_t);
 }
 
-/*
- * Allocate fake pgd for the host kernel page table macros to work.
- * This is not used by the hardware and we have no alignment
- * requirement for this allocation.
- */
 static inline pgd_t *kvm_setup_fake_pgd(pgd_t *hwpgd)
 {
-	int i;
-	pgd_t *pgd;
-
-	if (!KVM_PREALLOC_LEVEL)
-		return hwpgd;
-
-	/*
-	 * When KVM_PREALLOC_LEVEL==2, we allocate a single page for
-	 * the PMD and the kernel will use folded pud.
-	 * When KVM_PREALLOC_LEVEL==1, we allocate 2 consecutive PUD
-	 * pages.
-	 */
-
-	pgd = kmalloc(PTRS_PER_S2_PGD * sizeof(pgd_t),
-			GFP_KERNEL | __GFP_ZERO);
-	if (!pgd)
-		return ERR_PTR(-ENOMEM);
-
-	/* Plug the HW PGD into the fake one. */
-	for (i = 0; i < PTRS_PER_S2_PGD; i++) {
-		if (KVM_PREALLOC_LEVEL == 1)
-			pgd_populate(NULL, pgd + i,
-				     (pud_t *)hwpgd + i * PTRS_PER_PUD);
-		else if (KVM_PREALLOC_LEVEL == 2)
-			pud_populate(NULL, pud_offset(pgd, 0) + i,
-				     (pmd_t *)hwpgd + i * PTRS_PER_PMD);
-	}
-
-	return pgd;
+	return hwpgd;
 }
 
 static inline void kvm_free_fake_pgd(pgd_t *pgd)
 {
-	if (KVM_PREALLOC_LEVEL > 0)
-		kfree(pgd);
 }
 static inline bool kvm_page_empty(void *ptr)
 {
diff --git a/arch/arm64/include/asm/stage2_pgtable-nopmd.h b/arch/arm64/include/asm/stage2_pgtable-nopmd.h
new file mode 100644
index 0000000..2656a0f
--- /dev/null
+++ b/arch/arm64/include/asm/stage2_pgtable-nopmd.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2016 - ARM Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __ARM64_S2_PGTABLE_NOPMD_H_
+#define __ARM64_S2_PGTABLE_NOPMD_H_
+
+#include <asm/stage2_pgtable-nopud.h>
+
+#define __S2_PGTABLE_PMD_FOLDED
+
+#define S2_PMD_SHIFT		S2_PUD_SHIFT
+#define S2_PTRS_PER_PMD		1
+#define S2_PMD_SIZE		(1UL << S2_PMD_SHIFT)
+#define S2_PMD_MASK		(~(S2_PMD_SIZE-1))
+
+#define stage2_pud_none(pud)			(0)
+#define stage2_pud_present(pud)			(1)
+#define stage2_pud_clear(pud)			do { } while (0)
+#define stage2_pud_populate(pud, pmd)		do { } while (0)
+#define stage2_pmd_offset(pud, address)		((pmd_t *)(pud))
+
+#define stage2_pmd_free(pmd)			do { } while (0)
+
+#define stage2_pmd_addr_end(addr, end)		(end)
+
+#define stage2_pud_huge(pud)			(0)
+#define stage2_pmd_table_empty(pmdp)		(0)
+
+#endif
diff --git a/arch/arm64/include/asm/stage2_pgtable-nopud.h b/arch/arm64/include/asm/stage2_pgtable-nopud.h
new file mode 100644
index 0000000..5ee87b5
--- /dev/null
+++ b/arch/arm64/include/asm/stage2_pgtable-nopud.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2016 - ARM Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __ARM64_S2_PGTABLE_NOPUD_H_
+#define __ARM64_S2_PGTABLE_NOPUD_H_
+
+#define __S2_PGTABLE_PUD_FOLDED
+
+#define S2_PUD_SHIFT		S2_PGDIR_SHIFT
+#define S2_PTRS_PER_PUD		1
+#define S2_PUD_SIZE		(_AC(1, UL) << S2_PUD_SHIFT)
+#define S2_PUD_MASK		(~(S2_PUD_SIZE-1))
+
+#define stage2_pgd_none(pgd)			(0)
+#define stage2_pgd_present(pgd)			(1)
+#define stage2_pgd_clear(pgd)			do { } while (0)
+#define stage2_pgd_populate(pgd, pud)	do { } while (0)
+
+#define stage2_pud_offset(pgd, address)		((pud_t *)(pgd))
+
+#define stage2_pud_free(x)			do { } while (0)
+
+#define stage2_pud_addr_end(addr, end)		(end)
+#define stage2_pud_table_empty(pmdp)		(0)
+
+#endif
diff --git a/arch/arm64/include/asm/stage2_pgtable.h b/arch/arm64/include/asm/stage2_pgtable.h
index 0ec218f..8b68099 100644
--- a/arch/arm64/include/asm/stage2_pgtable.h
+++ b/arch/arm64/include/asm/stage2_pgtable.h
@@ -22,32 +22,61 @@
 #include <asm/pgtable.h>
 
 /*
- * In the case where PGDIR_SHIFT is larger than KVM_PHYS_SHIFT, we can address
- * the entire IPA input range with a single pgd entry, and we would only need
- * one pgd entry.  Note that in this case, the pgd is actually not used by
- * the MMU for Stage-2 translations, but is merely a fake pgd used as a data
- * structure for the kernel pgtable macros to work.
+ * The hardware supports concatenation of up to 16 tables at stage2 entry level
+ * and we use the feature whenever possible.
+ *
+ * Now, the minimum number of bits resolved at any level is (PAGE_SHIFT - 3).
+ * On arm64, the smallest PAGE_SIZE supported is 4k, which means
+ *             (PAGE_SHIFT - 3) > 4 holds for all page sizes.
+ * This implies, the total number of page table levels at stage2 expected
+ * by the hardware is actually the number of levels required for (KVM_PHYS_SHIFT - 4)
+ * in normal translations(e.g, stage1), since we cannot have another level in
+ * the range (KVM_PHYS_SHIFT, KVM_PHYS_SHIFT - 4).
  */
-#if PGDIR_SHIFT > KVM_PHYS_SHIFT
-#define PTRS_PER_S2_PGD_SHIFT	0
-#else
-#define PTRS_PER_S2_PGD_SHIFT	(KVM_PHYS_SHIFT - PGDIR_SHIFT)
-#endif
-#define PTRS_PER_S2_PGD		(1 << PTRS_PER_S2_PGD_SHIFT)
+#define STAGE2_PGTABLE_LEVELS		ARM64_HW_PGTABLE_LEVELS(KVM_PHYS_SHIFT - 4)
 
 /*
- * If we are concatenating first level stage-2 page tables, we would have less
- * than or equal to 16 pointers in the fake PGD, because that's what the
- * architecture allows.  In this case, (4 - CONFIG_PGTABLE_LEVELS)
- * represents the first level for the host, and we add 1 to go to the next
- * level (which uses contatenation) for the stage-2 tables.
+ * With all the supported VA_BITs and 40bit guest IPA, the following condition
+ * is always true:
+ *
+ *       STAGE2_PGTABLE_LEVELS <= CONFIG_PGTABLE_LEVELS
+ *
+ * We base our stage-2 page table walker helpers on this assumption and
+ * fall back to using the host version of the helper wherever possible.
+ * i.e, if a particular level is not folded (e.g, PUD) at stage2, we fall back
+ * to using the host version, since it is guaranteed it is not folded@host.
+ *
+ * If the condition breaks in the future, we can rearrange the host level
+ * definitions and reuse them for stage2. Till then...
  */
-#if PTRS_PER_S2_PGD <= 16
-#define KVM_PREALLOC_LEVEL	(4 - CONFIG_PGTABLE_LEVELS + 1)
-#else
-#define KVM_PREALLOC_LEVEL	(0)
+#if STAGE2_PGTABLE_LEVELS > CONFIG_PGTABLE_LEVELS
+#error "Unsupported combination of guest IPA and host VA_BITS."
 #endif
 
+/* S2_PGDIR_SHIFT is the size mapped by top-level stage2 entry */
+#define S2_PGDIR_SHIFT			ARM64_HW_PGTABLE_LEVEL_SHIFT(4 - STAGE2_PGTABLE_LEVELS)
+#define S2_PGDIR_SIZE			(_AC(1, UL) << S2_PGDIR_SHIFT)
+#define S2_PGDIR_MASK			(~(S2_PGDIR_SIZE - 1))
+
+/*
+ * The number of PTRS across all concatenated stage2 tables given by the
+ * number of bits resolved@the initial level.
+ */
+#define PTRS_PER_S2_PGD			(1 << (KVM_PHYS_SHIFT - S2_PGDIR_SHIFT))
+
+/*
+ * KVM_MMU_CACHE_MIN_PAGES is the number of stage2 page table translation
+ * levels in addition to the PGD.
+ */
+#define KVM_MMU_CACHE_MIN_PAGES		(STAGE2_PGTABLE_LEVELS - 1)
+
+
+#if STAGE2_PGTABLE_LEVELS > 3
+
+#define S2_PUD_SHIFT			ARM64_HW_PGTABLE_LEVEL_SHIFT(1)
+#define S2_PUD_SIZE			(_AC(1, UL) << S2_PUD_SHIFT)
+#define S2_PUD_MASK			(~(S2_PUD_SIZE - 1))
+
 #define stage2_pgd_none(pgd)				pgd_none(pgd)
 #define stage2_pgd_clear(pgd)				pgd_clear(pgd)
 #define stage2_pgd_present(pgd)				pgd_present(pgd)
@@ -55,6 +84,24 @@
 #define stage2_pud_offset(pgd, address)			pud_offset(pgd, address)
 #define stage2_pud_free(pud)				pud_free(NULL, pud)
 
+#define stage2_pud_table_empty(pudp)			kvm_page_empty(pudp)
+
+static inline phys_addr_t stage2_pud_addr_end(phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t boundary = (addr + S2_PUD_SIZE) & S2_PUD_MASK;
+
+	return (boundary - 1 < end - 1) ? boundary : end;
+}
+
+#endif		/* STAGE2_PGTABLE_LEVELS > 3 */
+
+
+#if STAGE2_PGTABLE_LEVELS > 2
+
+#define S2_PMD_SHIFT			ARM64_HW_PGTABLE_LEVEL_SHIFT(2)
+#define S2_PMD_SIZE			(_AC(1, UL) << S2_PMD_SHIFT)
+#define S2_PMD_MASK			(~(S2_PMD_SIZE - 1))
+
 #define stage2_pud_none(pud)				pud_none(pud)
 #define stage2_pud_clear(pud)				pud_clear(pud)
 #define stage2_pud_present(pud)				pud_present(pud)
@@ -63,24 +110,33 @@
 #define stage2_pmd_free(pmd)				pmd_free(NULL, pmd)
 
 #define stage2_pud_huge(pud)				pud_huge(pud)
+#define stage2_pmd_table_empty(pmdp)			kvm_page_empty(pmdp)
+
+static inline phys_addr_t stage2_pmd_addr_end(phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t boundary = (addr + S2_PMD_SIZE) & S2_PMD_MASK;
 
-#define stage2_pgd_addr_end(address, end)		pgd_addr_end(address, end)
-#define stage2_pud_addr_end(address, end)		pud_addr_end(address, end)
-#define stage2_pmd_addr_end(address, end)		pmd_addr_end(address, end)
+	return (boundary - 1 < end - 1) ? boundary : end;
+}
+
+#endif		/* STAGE2_PGTABLE_LEVELS > 2 */
 
 #define stage2_pte_table_empty(ptep)			kvm_page_empty(ptep)
-#ifdef __PGTABLE_PMD_FOLDED
-#define stage2_pmd_table_empty(pmdp)			(0)
-#else
-#define stage2_pmd_table_empty(pmdp)			((KVM_PREALLOC_LEVEL < 2) && kvm_page_empty(pmdp))
-#endif
 
-#ifdef __PGTABLE_PUD_FOLDED
-#define stage2_pud_table_empty(pudp)			(0)
-#else
-#define stage2_pud_table_empty(pudp)			((KVM_PREALLOC_LEVEL < 1) && kvm_page_empty(pudp))
+#if STAGE2_PGTABLE_LEVELS == 2
+#include <asm/stage2_pgtable-nopmd.h>
+#elif STAGE2_PGTABLE_LEVELS == 3
+#include <asm/stage2_pgtable-nopud.h>
 #endif
 
-#define stage2_pgd_index(addr)				(((addr) >> PGDIR_SHIFT) & (PTRS_PER_S2_PGD - 1))
+
+#define stage2_pgd_index(addr)				(((addr) >> S2_PGDIR_SHIFT) & (PTRS_PER_S2_PGD - 1))
+
+static inline phys_addr_t stage2_pgd_addr_end(phys_addr_t addr, phys_addr_t end)
+{
+	phys_addr_t boundary = (addr + S2_PGDIR_SIZE) & S2_PGDIR_MASK;
+
+	return (boundary - 1 < end - 1) ? boundary : end;
+}
 
 #endif	/* __ARM64_S2_PGTABLE_H_ */
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 16/29] kvm-arm: Cleanup stage2 pgd handling
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Suzuki K Poulose

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Now that we don't have any fake page table levels for arm64,
cleanup the common code to get rid of the dead code.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/include/asm/kvm_mmu.h   | 19 -------------------
 arch/arm/kvm/arm.c               |  2 +-
 arch/arm/kvm/mmu.c               | 37 ++++++-------------------------------
 arch/arm64/include/asm/kvm_mmu.h | 18 ------------------
 4 files changed, 7 insertions(+), 69 deletions(-)

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index a7736d5..6344ea0 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -150,25 +150,6 @@ static inline bool kvm_page_empty(void *ptr)
 #define hyp_pmd_table_empty(pmdp) kvm_page_empty(pmdp)
 #define hyp_pud_table_empty(pudp) false
 
-static inline void *kvm_get_hwpgd(struct kvm *kvm)
-{
-	return kvm->arch.pgd;
-}
-
-static inline unsigned int kvm_get_hwpgd_size(void)
-{
-	return PTRS_PER_S2_PGD * sizeof(pgd_t);
-}
-
-static inline pgd_t *kvm_setup_fake_pgd(pgd_t *hwpgd)
-{
-	return hwpgd;
-}
-
-static inline void kvm_free_fake_pgd(pgd_t *pgd)
-{
-}
-
 struct kvm;
 
 #define kvm_flush_dcache_to_poc(a,l)	__cpuc_flush_dcache_area((a), (l))
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index dded1b7..be4b639 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -448,7 +448,7 @@ static void update_vttbr(struct kvm *kvm)
 	kvm_next_vmid &= (1 << kvm_vmid_bits) - 1;
 
 	/* update vttbr to be used with the new vmid */
-	pgd_phys = virt_to_phys(kvm_get_hwpgd(kvm));
+	pgd_phys = virt_to_phys(kvm->arch.pgd);
 	BUG_ON(pgd_phys & ~VTTBR_BADDR_MASK);
 	vmid = ((u64)(kvm->arch.vmid) << VTTBR_VMID_SHIFT) & VTTBR_VMID_MASK(kvm_vmid_bits);
 	kvm->arch.vttbr = pgd_phys | vmid;
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index d3fa96e..42eefab 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -43,6 +43,7 @@ static unsigned long hyp_idmap_start;
 static unsigned long hyp_idmap_end;
 static phys_addr_t hyp_idmap_vector;
 
+#define S2_PGD_SIZE	(PTRS_PER_S2_PGD * sizeof(pgd_t))
 #define hyp_pgd_order get_order(PTRS_PER_PGD * sizeof(pgd_t))
 
 #define KVM_S2PTE_FLAG_IS_IOMAP		(1UL << 0)
@@ -736,20 +737,6 @@ int create_hyp_io_mappings(void *from, void *to, phys_addr_t phys_addr)
 				     __phys_to_pfn(phys_addr), PAGE_HYP_DEVICE);
 }
 
-/* Free the HW pgd, one page at a time */
-static void kvm_free_hwpgd(void *hwpgd)
-{
-	free_pages_exact(hwpgd, kvm_get_hwpgd_size());
-}
-
-/* Allocate the HW PGD, making sure that each page gets its own refcount */
-static void *kvm_alloc_hwpgd(void)
-{
-	unsigned int size = kvm_get_hwpgd_size();
-
-	return alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO);
-}
-
 /**
  * kvm_alloc_stage2_pgd - allocate level-1 table for stage-2 translation.
  * @kvm:	The KVM struct pointer for the VM.
@@ -764,29 +751,17 @@ static void *kvm_alloc_hwpgd(void)
 int kvm_alloc_stage2_pgd(struct kvm *kvm)
 {
 	pgd_t *pgd;
-	void *hwpgd;
 
 	if (kvm->arch.pgd != NULL) {
 		kvm_err("kvm_arch already initialized?\n");
 		return -EINVAL;
 	}
 
-	hwpgd = kvm_alloc_hwpgd();
-	if (!hwpgd)
+	/* Allocate the HW PGD, making sure that each page gets its own refcount */
+	pgd = alloc_pages_exact(S2_PGD_SIZE, GFP_KERNEL | __GFP_ZERO);
+	if (!pgd)
 		return -ENOMEM;
 
-	/*
-	 * When the kernel uses more levels of page tables than the
-	 * guest, we allocate a fake PGD and pre-populate it to point
-	 * to the next-level page table, which will be the real
-	 * initial page table pointed to by the VTTBR.
-	 */
-	pgd = kvm_setup_fake_pgd(hwpgd);
-	if (IS_ERR(pgd)) {
-		kvm_free_hwpgd(hwpgd);
-		return PTR_ERR(pgd);
-	}
-
 	kvm_clean_pgd(pgd);
 	kvm->arch.pgd = pgd;
 	return 0;
@@ -874,8 +849,8 @@ void kvm_free_stage2_pgd(struct kvm *kvm)
 		return;
 
 	unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
-	kvm_free_hwpgd(kvm_get_hwpgd(kvm));
-	kvm_free_fake_pgd(kvm->arch.pgd);
+	/* Free the HW pgd, one page at a time */
+	free_pages_exact(kvm->arch.pgd, S2_PGD_SIZE);
 	kvm->arch.pgd = NULL;
 }
 
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index e3fee0a..249c4fc 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -141,24 +141,6 @@ static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 	return (pmd_val(*pmd) & PMD_S2_RDWR) == PMD_S2_RDONLY;
 }
 
-static inline void *kvm_get_hwpgd(struct kvm *kvm)
-{
-	return kvm->arch.pgd;
-}
-
-static inline unsigned int kvm_get_hwpgd_size(void)
-{
-	return PTRS_PER_S2_PGD * sizeof(pgd_t);
-}
-
-static inline pgd_t *kvm_setup_fake_pgd(pgd_t *hwpgd)
-{
-	return hwpgd;
-}
-
-static inline void kvm_free_fake_pgd(pgd_t *pgd)
-{
-}
 static inline bool kvm_page_empty(void *ptr)
 {
 	struct page *ptr_page = virt_to_page(ptr);
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 16/29] kvm-arm: Cleanup stage2 pgd handling
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Now that we don't have any fake page table levels for arm64,
cleanup the common code to get rid of the dead code.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm/include/asm/kvm_mmu.h   | 19 -------------------
 arch/arm/kvm/arm.c               |  2 +-
 arch/arm/kvm/mmu.c               | 37 ++++++-------------------------------
 arch/arm64/include/asm/kvm_mmu.h | 18 ------------------
 4 files changed, 7 insertions(+), 69 deletions(-)

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index a7736d5..6344ea0 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -150,25 +150,6 @@ static inline bool kvm_page_empty(void *ptr)
 #define hyp_pmd_table_empty(pmdp) kvm_page_empty(pmdp)
 #define hyp_pud_table_empty(pudp) false
 
-static inline void *kvm_get_hwpgd(struct kvm *kvm)
-{
-	return kvm->arch.pgd;
-}
-
-static inline unsigned int kvm_get_hwpgd_size(void)
-{
-	return PTRS_PER_S2_PGD * sizeof(pgd_t);
-}
-
-static inline pgd_t *kvm_setup_fake_pgd(pgd_t *hwpgd)
-{
-	return hwpgd;
-}
-
-static inline void kvm_free_fake_pgd(pgd_t *pgd)
-{
-}
-
 struct kvm;
 
 #define kvm_flush_dcache_to_poc(a,l)	__cpuc_flush_dcache_area((a), (l))
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index dded1b7..be4b639 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -448,7 +448,7 @@ static void update_vttbr(struct kvm *kvm)
 	kvm_next_vmid &= (1 << kvm_vmid_bits) - 1;
 
 	/* update vttbr to be used with the new vmid */
-	pgd_phys = virt_to_phys(kvm_get_hwpgd(kvm));
+	pgd_phys = virt_to_phys(kvm->arch.pgd);
 	BUG_ON(pgd_phys & ~VTTBR_BADDR_MASK);
 	vmid = ((u64)(kvm->arch.vmid) << VTTBR_VMID_SHIFT) & VTTBR_VMID_MASK(kvm_vmid_bits);
 	kvm->arch.vttbr = pgd_phys | vmid;
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index d3fa96e..42eefab 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -43,6 +43,7 @@ static unsigned long hyp_idmap_start;
 static unsigned long hyp_idmap_end;
 static phys_addr_t hyp_idmap_vector;
 
+#define S2_PGD_SIZE	(PTRS_PER_S2_PGD * sizeof(pgd_t))
 #define hyp_pgd_order get_order(PTRS_PER_PGD * sizeof(pgd_t))
 
 #define KVM_S2PTE_FLAG_IS_IOMAP		(1UL << 0)
@@ -736,20 +737,6 @@ int create_hyp_io_mappings(void *from, void *to, phys_addr_t phys_addr)
 				     __phys_to_pfn(phys_addr), PAGE_HYP_DEVICE);
 }
 
-/* Free the HW pgd, one page@a time */
-static void kvm_free_hwpgd(void *hwpgd)
-{
-	free_pages_exact(hwpgd, kvm_get_hwpgd_size());
-}
-
-/* Allocate the HW PGD, making sure that each page gets its own refcount */
-static void *kvm_alloc_hwpgd(void)
-{
-	unsigned int size = kvm_get_hwpgd_size();
-
-	return alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO);
-}
-
 /**
  * kvm_alloc_stage2_pgd - allocate level-1 table for stage-2 translation.
  * @kvm:	The KVM struct pointer for the VM.
@@ -764,29 +751,17 @@ static void *kvm_alloc_hwpgd(void)
 int kvm_alloc_stage2_pgd(struct kvm *kvm)
 {
 	pgd_t *pgd;
-	void *hwpgd;
 
 	if (kvm->arch.pgd != NULL) {
 		kvm_err("kvm_arch already initialized?\n");
 		return -EINVAL;
 	}
 
-	hwpgd = kvm_alloc_hwpgd();
-	if (!hwpgd)
+	/* Allocate the HW PGD, making sure that each page gets its own refcount */
+	pgd = alloc_pages_exact(S2_PGD_SIZE, GFP_KERNEL | __GFP_ZERO);
+	if (!pgd)
 		return -ENOMEM;
 
-	/*
-	 * When the kernel uses more levels of page tables than the
-	 * guest, we allocate a fake PGD and pre-populate it to point
-	 * to the next-level page table, which will be the real
-	 * initial page table pointed to by the VTTBR.
-	 */
-	pgd = kvm_setup_fake_pgd(hwpgd);
-	if (IS_ERR(pgd)) {
-		kvm_free_hwpgd(hwpgd);
-		return PTR_ERR(pgd);
-	}
-
 	kvm_clean_pgd(pgd);
 	kvm->arch.pgd = pgd;
 	return 0;
@@ -874,8 +849,8 @@ void kvm_free_stage2_pgd(struct kvm *kvm)
 		return;
 
 	unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
-	kvm_free_hwpgd(kvm_get_hwpgd(kvm));
-	kvm_free_fake_pgd(kvm->arch.pgd);
+	/* Free the HW pgd, one page at a time */
+	free_pages_exact(kvm->arch.pgd, S2_PGD_SIZE);
 	kvm->arch.pgd = NULL;
 }
 
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index e3fee0a..249c4fc 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -141,24 +141,6 @@ static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 	return (pmd_val(*pmd) & PMD_S2_RDWR) == PMD_S2_RDONLY;
 }
 
-static inline void *kvm_get_hwpgd(struct kvm *kvm)
-{
-	return kvm->arch.pgd;
-}
-
-static inline unsigned int kvm_get_hwpgd_size(void)
-{
-	return PTRS_PER_S2_PGD * sizeof(pgd_t);
-}
-
-static inline pgd_t *kvm_setup_fake_pgd(pgd_t *hwpgd)
-{
-	return hwpgd;
-}
-
-static inline void kvm_free_fake_pgd(pgd_t *pgd)
-{
-}
 static inline bool kvm_page_empty(void *ptr)
 {
 	struct page *ptr_page = virt_to_page(ptr);
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 17/29] arm64: kvm: Add support for 16K pages
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Suzuki K Poulose

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Now that we can handle stage-2 page tables independent
of the host page table levels, wire up the 16K page
support.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_arm.h | 13 +++++++++++--
 arch/arm64/kvm/Kconfig           |  1 -
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index 1281d98..c6cbb36 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -114,6 +114,7 @@
 #define VTCR_EL2_PS_MASK	TCR_EL2_PS_MASK
 #define VTCR_EL2_TG0_MASK	TCR_TG0_MASK
 #define VTCR_EL2_TG0_4K		TCR_TG0_4K
+#define VTCR_EL2_TG0_16K	TCR_TG0_16K
 #define VTCR_EL2_TG0_64K	TCR_TG0_64K
 #define VTCR_EL2_SH0_MASK	TCR_SH0_MASK
 #define VTCR_EL2_SH0_INNER	TCR_SH0_INNER
@@ -139,7 +140,7 @@
  * (see hyp-init.S).
  *
  * Note that when using 4K pages, we concatenate two first level page tables
- * together.
+ * together. With 16K pages, we concatenate 16 first level page tables.
  *
  * The magic numbers used for VTTBR_X in this patch can be found in Tables
  * D4-23 and D4-25 in ARM DDI 0487A.b.
@@ -157,7 +158,15 @@
  */
 #define VTCR_EL2_TGRAN_FLAGS		(VTCR_EL2_TG0_64K | VTCR_EL2_SL0_LVL1)
 #define VTTBR_X_TGRAN_MAGIC		38
-#else
+#elif defined(CONFIG_ARM64_16K_PAGES)
+/*
+ * Stage2 translation configuration:
+ * 16kB pages (TG0 = 2)
+ * 2 level page tables (SL = 1)
+ */
+#define VTCR_EL2_TGRAN_FLAGS		(VTCR_EL2_TG0_16K | VTCR_EL2_SL0_LVL1)
+#define VTTBR_X_TGRAN_MAGIC		42
+#else	/* 4K */
 /*
  * Stage2 translation configuration:
  * 4kB pages (TG0 = 0)
diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
index de7450d..aa2e34e 100644
--- a/arch/arm64/kvm/Kconfig
+++ b/arch/arm64/kvm/Kconfig
@@ -22,7 +22,6 @@ config KVM_ARM_VGIC_V3
 config KVM
 	bool "Kernel-based Virtual Machine (KVM) support"
 	depends on OF
-	depends on !ARM64_16K_PAGES
 	select MMU_NOTIFIER
 	select PREEMPT_NOTIFIERS
 	select ANON_INODES
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 17/29] arm64: kvm: Add support for 16K pages
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Suzuki K Poulose <suzuki.poulose@arm.com>

Now that we can handle stage-2 page tables independent
of the host page table levels, wire up the 16K page
support.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/kvm_arm.h | 13 +++++++++++--
 arch/arm64/kvm/Kconfig           |  1 -
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index 1281d98..c6cbb36 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -114,6 +114,7 @@
 #define VTCR_EL2_PS_MASK	TCR_EL2_PS_MASK
 #define VTCR_EL2_TG0_MASK	TCR_TG0_MASK
 #define VTCR_EL2_TG0_4K		TCR_TG0_4K
+#define VTCR_EL2_TG0_16K	TCR_TG0_16K
 #define VTCR_EL2_TG0_64K	TCR_TG0_64K
 #define VTCR_EL2_SH0_MASK	TCR_SH0_MASK
 #define VTCR_EL2_SH0_INNER	TCR_SH0_INNER
@@ -139,7 +140,7 @@
  * (see hyp-init.S).
  *
  * Note that when using 4K pages, we concatenate two first level page tables
- * together.
+ * together. With 16K pages, we concatenate 16 first level page tables.
  *
  * The magic numbers used for VTTBR_X in this patch can be found in Tables
  * D4-23 and D4-25 in ARM DDI 0487A.b.
@@ -157,7 +158,15 @@
  */
 #define VTCR_EL2_TGRAN_FLAGS		(VTCR_EL2_TG0_64K | VTCR_EL2_SL0_LVL1)
 #define VTTBR_X_TGRAN_MAGIC		38
-#else
+#elif defined(CONFIG_ARM64_16K_PAGES)
+/*
+ * Stage2 translation configuration:
+ * 16kB pages (TG0 = 2)
+ * 2 level page tables (SL = 1)
+ */
+#define VTCR_EL2_TGRAN_FLAGS		(VTCR_EL2_TG0_16K | VTCR_EL2_SL0_LVL1)
+#define VTTBR_X_TGRAN_MAGIC		42
+#else	/* 4K */
 /*
  * Stage2 translation configuration:
  * 4kB pages (TG0 = 0)
diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
index de7450d..aa2e34e 100644
--- a/arch/arm64/kvm/Kconfig
+++ b/arch/arm64/kvm/Kconfig
@@ -22,7 +22,6 @@ config KVM_ARM_VGIC_V3
 config KVM
 	bool "Kernel-based Virtual Machine (KVM) support"
 	depends on OF
-	depends on !ARM64_16K_PAGES
 	select MMU_NOTIFIER
 	select PREEMPT_NOTIFIERS
 	select ANON_INODES
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 18/29] arm/arm64: KVM: Enforce Break-Before-Make on Stage-2 page tables
  2016-05-11 13:29 ` Christoffer Dall
  (?)
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvm, Marc Zyngier, stable, linux-arm-kernel, kvmarm

From: Marc Zyngier <marc.zyngier@arm.com>

The ARM architecture mandates that when changing a page table entry
from a valid entry to another valid entry, an invalid entry is first
written, TLB invalidated, and only then the new entry being written.

The current code doesn't respect this, directly writing the new
entry and only then invalidating TLBs. Let's fix it up.

Cc: <stable@vger.kernel.org>
Reported-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 arch/arm/kvm/mmu.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 42eefab..74b5d19 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -910,11 +910,14 @@ static int stage2_set_pmd_huge(struct kvm *kvm, struct kvm_mmu_memory_cache
 	VM_BUG_ON(pmd_present(*pmd) && pmd_pfn(*pmd) != pmd_pfn(*new_pmd));
 
 	old_pmd = *pmd;
-	kvm_set_pmd(pmd, *new_pmd);
-	if (pmd_present(old_pmd))
+	if (pmd_present(old_pmd)) {
+		pmd_clear(pmd);
 		kvm_tlb_flush_vmid_ipa(kvm, addr);
-	else
+	} else {
 		get_page(virt_to_page(pmd));
+	}
+
+	kvm_set_pmd(pmd, *new_pmd);
 	return 0;
 }
 
@@ -963,12 +966,14 @@ static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
 
 	/* Create 2nd stage page table mapping - Level 3 */
 	old_pte = *pte;
-	kvm_set_pte(pte, *new_pte);
-	if (pte_present(old_pte))
+	if (pte_present(old_pte)) {
+		kvm_set_pte(pte, __pte(0));
 		kvm_tlb_flush_vmid_ipa(kvm, addr);
-	else
+	} else {
 		get_page(virt_to_page(pte));
+	}
 
+	kvm_set_pte(pte, *new_pte);
 	return 0;
 }
 
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 18/29] arm/arm64: KVM: Enforce Break-Before-Make on Stage-2 page tables
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Marc Zyngier <marc.zyngier@arm.com>

The ARM architecture mandates that when changing a page table entry
from a valid entry to another valid entry, an invalid entry is first
written, TLB invalidated, and only then the new entry being written.

The current code doesn't respect this, directly writing the new
entry and only then invalidating TLBs. Let's fix it up.

Cc: <stable@vger.kernel.org>
Reported-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 arch/arm/kvm/mmu.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 42eefab..74b5d19 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -910,11 +910,14 @@ static int stage2_set_pmd_huge(struct kvm *kvm, struct kvm_mmu_memory_cache
 	VM_BUG_ON(pmd_present(*pmd) && pmd_pfn(*pmd) != pmd_pfn(*new_pmd));
 
 	old_pmd = *pmd;
-	kvm_set_pmd(pmd, *new_pmd);
-	if (pmd_present(old_pmd))
+	if (pmd_present(old_pmd)) {
+		pmd_clear(pmd);
 		kvm_tlb_flush_vmid_ipa(kvm, addr);
-	else
+	} else {
 		get_page(virt_to_page(pmd));
+	}
+
+	kvm_set_pmd(pmd, *new_pmd);
 	return 0;
 }
 
@@ -963,12 +966,14 @@ static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
 
 	/* Create 2nd stage page table mapping - Level 3 */
 	old_pte = *pte;
-	kvm_set_pte(pte, *new_pte);
-	if (pte_present(old_pte))
+	if (pte_present(old_pte)) {
+		kvm_set_pte(pte, __pte(0));
 		kvm_tlb_flush_vmid_ipa(kvm, addr);
-	else
+	} else {
 		get_page(virt_to_page(pte));
+	}
 
+	kvm_set_pte(pte, *new_pte);
 	return 0;
 }
 
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 18/29] arm/arm64: KVM: Enforce Break-Before-Make on Stage-2 page tables
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, stable,
	Christoffer Dall

From: Marc Zyngier <marc.zyngier@arm.com>

The ARM architecture mandates that when changing a page table entry
from a valid entry to another valid entry, an invalid entry is first
written, TLB invalidated, and only then the new entry being written.

The current code doesn't respect this, directly writing the new
entry and only then invalidating TLBs. Let's fix it up.

Cc: <stable@vger.kernel.org>
Reported-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 arch/arm/kvm/mmu.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 42eefab..74b5d19 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -910,11 +910,14 @@ static int stage2_set_pmd_huge(struct kvm *kvm, struct kvm_mmu_memory_cache
 	VM_BUG_ON(pmd_present(*pmd) && pmd_pfn(*pmd) != pmd_pfn(*new_pmd));
 
 	old_pmd = *pmd;
-	kvm_set_pmd(pmd, *new_pmd);
-	if (pmd_present(old_pmd))
+	if (pmd_present(old_pmd)) {
+		pmd_clear(pmd);
 		kvm_tlb_flush_vmid_ipa(kvm, addr);
-	else
+	} else {
 		get_page(virt_to_page(pmd));
+	}
+
+	kvm_set_pmd(pmd, *new_pmd);
 	return 0;
 }
 
@@ -963,12 +966,14 @@ static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
 
 	/* Create 2nd stage page table mapping - Level 3 */
 	old_pte = *pte;
-	kvm_set_pte(pte, *new_pte);
-	if (pte_present(old_pte))
+	if (pte_present(old_pte)) {
+		kvm_set_pte(pte, __pte(0));
 		kvm_tlb_flush_vmid_ipa(kvm, addr);
-	else
+	} else {
 		get_page(virt_to_page(pte));
+	}
 
+	kvm_set_pte(pte, *new_pte);
 	return 0;
 }
 
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 19/29] clocksource: arm_arch_timer: Gather KVM specific information in a structure
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvm, Marc Zyngier, linux-arm-kernel, kvmarm

From: Julien Grall <julien.grall@arm.com>

Introduce a structure which are filled up by the arch timer driver and
used by the virtual timer in KVM.

The first member of this structure will be the timecounter. More members
will be added later.

A stub for the new helper isn't introduced because KVM requires the arch
timer for both ARM64 and ARM32.

The function arch_timer_get_timecounter is kept for the time being and
will be dropped in a subsequent patch.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/clocksource/arm_arch_timer.c | 12 +++++++++---
 include/clocksource/arm_arch_timer.h |  5 +++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 5152b38..62bdfe7 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -468,11 +468,16 @@ static struct cyclecounter cyclecounter = {
 	.mask	= CLOCKSOURCE_MASK(56),
 };
 
-static struct timecounter timecounter;
+static struct arch_timer_kvm_info arch_timer_kvm_info;
+
+struct arch_timer_kvm_info *arch_timer_get_kvm_info(void)
+{
+	return &arch_timer_kvm_info;
+}
 
 struct timecounter *arch_timer_get_timecounter(void)
 {
-	return &timecounter;
+	return &arch_timer_kvm_info.timecounter;
 }
 
 static void __init arch_counter_register(unsigned type)
@@ -500,7 +505,8 @@ static void __init arch_counter_register(unsigned type)
 	clocksource_register_hz(&clocksource_counter, arch_timer_rate);
 	cyclecounter.mult = clocksource_counter.mult;
 	cyclecounter.shift = clocksource_counter.shift;
-	timecounter_init(&timecounter, &cyclecounter, start_count);
+	timecounter_init(&arch_timer_kvm_info.timecounter,
+			 &cyclecounter, start_count);
 
 	/* 56 bits minimum, so we assume worst case rollover */
 	sched_clock_register(arch_timer_read_counter, 56, arch_timer_rate);
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index 25d0914..9101ed6b 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -49,11 +49,16 @@ enum arch_timer_reg {
 
 #define ARCH_TIMER_EVT_STREAM_FREQ	10000	/* 100us */
 
+struct arch_timer_kvm_info {
+	struct timecounter timecounter;
+};
+
 #ifdef CONFIG_ARM_ARCH_TIMER
 
 extern u32 arch_timer_get_rate(void);
 extern u64 (*arch_timer_read_counter)(void);
 extern struct timecounter *arch_timer_get_timecounter(void);
+extern struct arch_timer_kvm_info *arch_timer_get_kvm_info(void);
 
 #else
 
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 19/29] clocksource: arm_arch_timer: Gather KVM specific information in a structure
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julien Grall <julien.grall@arm.com>

Introduce a structure which are filled up by the arch timer driver and
used by the virtual timer in KVM.

The first member of this structure will be the timecounter. More members
will be added later.

A stub for the new helper isn't introduced because KVM requires the arch
timer for both ARM64 and ARM32.

The function arch_timer_get_timecounter is kept for the time being and
will be dropped in a subsequent patch.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/clocksource/arm_arch_timer.c | 12 +++++++++---
 include/clocksource/arm_arch_timer.h |  5 +++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 5152b38..62bdfe7 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -468,11 +468,16 @@ static struct cyclecounter cyclecounter = {
 	.mask	= CLOCKSOURCE_MASK(56),
 };
 
-static struct timecounter timecounter;
+static struct arch_timer_kvm_info arch_timer_kvm_info;
+
+struct arch_timer_kvm_info *arch_timer_get_kvm_info(void)
+{
+	return &arch_timer_kvm_info;
+}
 
 struct timecounter *arch_timer_get_timecounter(void)
 {
-	return &timecounter;
+	return &arch_timer_kvm_info.timecounter;
 }
 
 static void __init arch_counter_register(unsigned type)
@@ -500,7 +505,8 @@ static void __init arch_counter_register(unsigned type)
 	clocksource_register_hz(&clocksource_counter, arch_timer_rate);
 	cyclecounter.mult = clocksource_counter.mult;
 	cyclecounter.shift = clocksource_counter.shift;
-	timecounter_init(&timecounter, &cyclecounter, start_count);
+	timecounter_init(&arch_timer_kvm_info.timecounter,
+			 &cyclecounter, start_count);
 
 	/* 56 bits minimum, so we assume worst case rollover */
 	sched_clock_register(arch_timer_read_counter, 56, arch_timer_rate);
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index 25d0914..9101ed6b 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -49,11 +49,16 @@ enum arch_timer_reg {
 
 #define ARCH_TIMER_EVT_STREAM_FREQ	10000	/* 100us */
 
+struct arch_timer_kvm_info {
+	struct timecounter timecounter;
+};
+
 #ifdef CONFIG_ARM_ARCH_TIMER
 
 extern u32 arch_timer_get_rate(void);
 extern u64 (*arch_timer_read_counter)(void);
 extern struct timecounter *arch_timer_get_timecounter(void);
+extern struct arch_timer_kvm_info *arch_timer_get_kvm_info(void);
 
 #else
 
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 20/29] clocksource: arm_arch_timer: Extend arch_timer_kvm_info to get the virtual IRQ
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvm, Marc Zyngier, linux-arm-kernel, kvmarm

From: Julien Grall <julien.grall@arm.com>

Currently, the firmware table is parsed by the virtual timer code in
order to retrieve the virtual timer interrupt. However, this is already
done by the arch timer driver.

To avoid code duplication, extend arch_timer_kvm_info to get the virtual
IRQ.

Note that the KVM code will be modified in a subsequent patch.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/clocksource/arm_arch_timer.c | 2 ++
 include/clocksource/arm_arch_timer.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 62bdfe7..bb58224 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -750,6 +750,8 @@ static void __init arch_timer_init(void)
 
 	arch_timer_register();
 	arch_timer_common_init();
+
+	arch_timer_kvm_info.virtual_irq = arch_timer_ppi[VIRT_PPI];
 }
 
 static void __init arch_timer_of_init(struct device_node *np)
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index 9101ed6b..9dd996a 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -51,6 +51,7 @@ enum arch_timer_reg {
 
 struct arch_timer_kvm_info {
 	struct timecounter timecounter;
+	int virtual_irq;
 };
 
 #ifdef CONFIG_ARM_ARCH_TIMER
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 20/29] clocksource: arm_arch_timer: Extend arch_timer_kvm_info to get the virtual IRQ
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julien Grall <julien.grall@arm.com>

Currently, the firmware table is parsed by the virtual timer code in
order to retrieve the virtual timer interrupt. However, this is already
done by the arch timer driver.

To avoid code duplication, extend arch_timer_kvm_info to get the virtual
IRQ.

Note that the KVM code will be modified in a subsequent patch.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/clocksource/arm_arch_timer.c | 2 ++
 include/clocksource/arm_arch_timer.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 62bdfe7..bb58224 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -750,6 +750,8 @@ static void __init arch_timer_init(void)
 
 	arch_timer_register();
 	arch_timer_common_init();
+
+	arch_timer_kvm_info.virtual_irq = arch_timer_ppi[VIRT_PPI];
 }
 
 static void __init arch_timer_of_init(struct device_node *np)
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index 9101ed6b..9dd996a 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -51,6 +51,7 @@ enum arch_timer_reg {
 
 struct arch_timer_kvm_info {
 	struct timecounter timecounter;
+	int virtual_irq;
 };
 
 #ifdef CONFIG_ARM_ARCH_TIMER
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 21/29] irqchip/gic-v2: Gather ACPI specific data in a single structure
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Julien Grall,
	Christoffer Dall

From: Julien Grall <julien.grall@arm.com>

The ACPI code requires to use global variables in order to collect
information from the tables.

For now, a single global variable is used, but more will be added in a
subsequent patch. To make clear they are ACPI specific, gather all the
information in a single structure.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christofer Dall <christoffer.dall@linaro.org>
Acked-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/irqchip/irq-gic.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 282344b..7a73786 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1245,7 +1245,10 @@ IRQCHIP_DECLARE(pl390, "arm,pl390", gic_of_init);
 #endif
 
 #ifdef CONFIG_ACPI
-static phys_addr_t cpu_phy_base __initdata;
+static struct
+{
+	phys_addr_t cpu_phys_base;
+} acpi_data __initdata;
 
 static int __init
 gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
@@ -1265,10 +1268,10 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
 	 * All CPU interface addresses have to be the same.
 	 */
 	gic_cpu_base = processor->base_address;
-	if (cpu_base_assigned && gic_cpu_base != cpu_phy_base)
+	if (cpu_base_assigned && gic_cpu_base != acpi_data.cpu_phys_base)
 		return -EINVAL;
 
-	cpu_phy_base = gic_cpu_base;
+	acpi_data.cpu_phys_base = gic_cpu_base;
 	cpu_base_assigned = 1;
 	return 0;
 }
@@ -1316,7 +1319,7 @@ static int __init gic_v2_acpi_init(struct acpi_subtable_header *header,
 		return -EINVAL;
 	}
 
-	cpu_base = ioremap(cpu_phy_base, ACPI_GIC_CPU_IF_MEM_SIZE);
+	cpu_base = ioremap(acpi_data.cpu_phys_base, ACPI_GIC_CPU_IF_MEM_SIZE);
 	if (!cpu_base) {
 		pr_err("Unable to map GICC registers\n");
 		return -ENOMEM;
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 21/29] irqchip/gic-v2: Gather ACPI specific data in a single structure
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julien Grall <julien.grall@arm.com>

The ACPI code requires to use global variables in order to collect
information from the tables.

For now, a single global variable is used, but more will be added in a
subsequent patch. To make clear they are ACPI specific, gather all the
information in a single structure.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christofer Dall <christoffer.dall@linaro.org>
Acked-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/irqchip/irq-gic.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 282344b..7a73786 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1245,7 +1245,10 @@ IRQCHIP_DECLARE(pl390, "arm,pl390", gic_of_init);
 #endif
 
 #ifdef CONFIG_ACPI
-static phys_addr_t cpu_phy_base __initdata;
+static struct
+{
+	phys_addr_t cpu_phys_base;
+} acpi_data __initdata;
 
 static int __init
 gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
@@ -1265,10 +1268,10 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
 	 * All CPU interface addresses have to be the same.
 	 */
 	gic_cpu_base = processor->base_address;
-	if (cpu_base_assigned && gic_cpu_base != cpu_phy_base)
+	if (cpu_base_assigned && gic_cpu_base != acpi_data.cpu_phys_base)
 		return -EINVAL;
 
-	cpu_phy_base = gic_cpu_base;
+	acpi_data.cpu_phys_base = gic_cpu_base;
 	cpu_base_assigned = 1;
 	return 0;
 }
@@ -1316,7 +1319,7 @@ static int __init gic_v2_acpi_init(struct acpi_subtable_header *header,
 		return -EINVAL;
 	}
 
-	cpu_base = ioremap(cpu_phy_base, ACPI_GIC_CPU_IF_MEM_SIZE);
+	cpu_base = ioremap(acpi_data.cpu_phys_base, ACPI_GIC_CPU_IF_MEM_SIZE);
 	if (!cpu_base) {
 		pr_err("Unable to map GICC registers\n");
 		return -ENOMEM;
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 22/29] irqchip/gic-v2: Parse and export virtual GIC information
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvm, Marc Zyngier, linux-arm-kernel, kvmarm

From: Julien Grall <julien.grall@arm.com>

For now, the firmware tables are parsed 2 times: once in the GIC
drivers, the other timer when initializing the vGIC. It means code
duplication and make more tedious to add the support for another
firmware table (like ACPI).

Introduce a new structure and set of helpers to get/set the virtual GIC
information. Also fill up the structure for GICv2.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/irqchip/irq-gic-common.c       | 13 ++++++
 drivers/irqchip/irq-gic-common.h       |  3 ++
 drivers/irqchip/irq-gic.c              | 76 +++++++++++++++++++++++++++++++++-
 include/linux/irqchip/arm-gic-common.h | 33 +++++++++++++++
 4 files changed, 124 insertions(+), 1 deletion(-)
 create mode 100644 include/linux/irqchip/arm-gic-common.h

diff --git a/drivers/irqchip/irq-gic-common.c b/drivers/irqchip/irq-gic-common.c
index f174ce0..2e9443b 100644
--- a/drivers/irqchip/irq-gic-common.c
+++ b/drivers/irqchip/irq-gic-common.c
@@ -21,6 +21,19 @@
 
 #include "irq-gic-common.h"
 
+static const struct gic_kvm_info *gic_kvm_info;
+
+const struct gic_kvm_info *gic_get_kvm_info(void)
+{
+	return gic_kvm_info;
+}
+
+void gic_set_kvm_info(const struct gic_kvm_info *info)
+{
+	BUG_ON(gic_kvm_info != NULL);
+	gic_kvm_info = info;
+}
+
 void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks,
 		void *data)
 {
diff --git a/drivers/irqchip/irq-gic-common.h b/drivers/irqchip/irq-gic-common.h
index fff697d..205e5fd 100644
--- a/drivers/irqchip/irq-gic-common.h
+++ b/drivers/irqchip/irq-gic-common.h
@@ -19,6 +19,7 @@
 
 #include <linux/of.h>
 #include <linux/irqdomain.h>
+#include <linux/irqchip/arm-gic-common.h>
 
 struct gic_quirk {
 	const char *desc;
@@ -35,4 +36,6 @@ void gic_cpu_config(void __iomem *base, void (*sync_access)(void));
 void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks,
 		void *data);
 
+void gic_set_kvm_info(const struct gic_kvm_info *info);
+
 #endif /* _IRQ_GIC_COMMON_H */
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 7a73786..3f1d9fd 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -102,6 +102,8 @@ static struct static_key supports_deactivate = STATIC_KEY_INIT_TRUE;
 
 static struct gic_chip_data gic_data[CONFIG_ARM_GIC_MAX_NR] __read_mostly;
 
+static struct gic_kvm_info gic_v2_kvm_info;
+
 #ifdef CONFIG_GIC_NON_BANKED
 static void __iomem *gic_get_percpu_base(union gic_base *base)
 {
@@ -1189,6 +1191,29 @@ static bool gic_check_eoimode(struct device_node *node, void __iomem **base)
 	return true;
 }
 
+static void __init gic_of_setup_kvm_info(struct device_node *node)
+{
+	int ret;
+	struct resource *vctrl_res = &gic_v2_kvm_info.vctrl;
+	struct resource *vcpu_res = &gic_v2_kvm_info.vcpu;
+
+	gic_v2_kvm_info.type = GIC_V2;
+
+	gic_v2_kvm_info.maint_irq = irq_of_parse_and_map(node, 0);
+	if (!gic_v2_kvm_info.maint_irq)
+		return;
+
+	ret = of_address_to_resource(node, 2, vctrl_res);
+	if (ret)
+		return;
+
+	ret = of_address_to_resource(node, 3, vcpu_res);
+	if (ret)
+		return;
+
+	gic_set_kvm_info(&gic_v2_kvm_info);
+}
+
 int __init
 gic_of_init(struct device_node *node, struct device_node *parent)
 {
@@ -1218,8 +1243,10 @@ gic_of_init(struct device_node *node, struct device_node *parent)
 
 	__gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset,
 			 &node->fwnode);
-	if (!gic_cnt)
+	if (!gic_cnt) {
 		gic_init_physaddr(node);
+		gic_of_setup_kvm_info(node);
+	}
 
 	if (parent) {
 		irq = irq_of_parse_and_map(node, 0);
@@ -1248,6 +1275,10 @@ IRQCHIP_DECLARE(pl390, "arm,pl390", gic_of_init);
 static struct
 {
 	phys_addr_t cpu_phys_base;
+	u32 maint_irq;
+	int maint_irq_mode;
+	phys_addr_t vctrl_base;
+	phys_addr_t vcpu_base;
 } acpi_data __initdata;
 
 static int __init
@@ -1272,6 +1303,12 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
 		return -EINVAL;
 
 	acpi_data.cpu_phys_base = gic_cpu_base;
+	acpi_data.maint_irq = processor->vgic_interrupt;
+	acpi_data.maint_irq_mode = (processor->flags & ACPI_MADT_VGIC_IRQ_MODE) ?
+				    ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
+	acpi_data.vctrl_base = processor->gich_base_address;
+	acpi_data.vcpu_base = processor->gicv_base_address;
+
 	cpu_base_assigned = 1;
 	return 0;
 }
@@ -1302,6 +1339,41 @@ static bool __init gic_validate_dist(struct acpi_subtable_header *header,
 
 #define ACPI_GICV2_DIST_MEM_SIZE	(SZ_4K)
 #define ACPI_GIC_CPU_IF_MEM_SIZE	(SZ_8K)
+#define ACPI_GICV2_VCTRL_MEM_SIZE	(SZ_4K)
+#define ACPI_GICV2_VCPU_MEM_SIZE	(SZ_8K)
+
+static void __init gic_acpi_setup_kvm_info(void)
+{
+	int irq;
+	struct resource *vctrl_res = &gic_v2_kvm_info.vctrl;
+	struct resource *vcpu_res = &gic_v2_kvm_info.vcpu;
+
+	gic_v2_kvm_info.type = GIC_V2;
+
+	if (!acpi_data.vctrl_base)
+		return;
+
+	vctrl_res->flags = IORESOURCE_MEM;
+	vctrl_res->start = acpi_data.vctrl_base;
+	vctrl_res->end = vctrl_res->start + ACPI_GICV2_VCTRL_MEM_SIZE - 1;
+
+	if (!acpi_data.vcpu_base)
+		return;
+
+	vcpu_res->flags = IORESOURCE_MEM;
+	vcpu_res->start = acpi_data.vcpu_base;
+	vcpu_res->end = vcpu_res->start + ACPI_GICV2_VCPU_MEM_SIZE - 1;
+
+	irq = acpi_register_gsi(NULL, acpi_data.maint_irq,
+				acpi_data.maint_irq_mode,
+				ACPI_ACTIVE_HIGH);
+	if (irq <= 0)
+		return;
+
+	gic_v2_kvm_info.maint_irq = irq;
+
+	gic_set_kvm_info(&gic_v2_kvm_info);
+}
 
 static int __init gic_v2_acpi_init(struct acpi_subtable_header *header,
 				   const unsigned long end)
@@ -1359,6 +1431,8 @@ static int __init gic_v2_acpi_init(struct acpi_subtable_header *header,
 	if (IS_ENABLED(CONFIG_ARM_GIC_V2M))
 		gicv2m_init(NULL, gic_data[0].domain);
 
+	gic_acpi_setup_kvm_info();
+
 	return 0;
 }
 IRQCHIP_ACPI_DECLARE(gic_v2, ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR,
diff --git a/include/linux/irqchip/arm-gic-common.h b/include/linux/irqchip/arm-gic-common.h
new file mode 100644
index 0000000..ef34f6f
--- /dev/null
+++ b/include/linux/irqchip/arm-gic-common.h
@@ -0,0 +1,33 @@
+/*
+ * include/linux/irqchip/arm-gic-common.h
+ *
+ * Copyright (C) 2016 ARM Limited, All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef __LINUX_IRQCHIP_ARM_GIC_COMMON_H
+#define __LINUX_IRQCHIP_ARM_GIC_COMMON_H
+
+#include <linux/types.h>
+#include <linux/ioport.h>
+
+enum gic_type {
+	GIC_V2,
+};
+
+struct gic_kvm_info {
+	/* GIC type */
+	enum gic_type	type;
+	/* Virtual CPU interface */
+	struct resource vcpu;
+	/* Interrupt number */
+	unsigned int	maint_irq;
+	/* Virtual control interface */
+	struct resource vctrl;
+};
+
+const struct gic_kvm_info *gic_get_kvm_info(void);
+
+#endif /* __LINUX_IRQCHIP_ARM_GIC_COMMON_H */
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 22/29] irqchip/gic-v2: Parse and export virtual GIC information
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julien Grall <julien.grall@arm.com>

For now, the firmware tables are parsed 2 times: once in the GIC
drivers, the other timer when initializing the vGIC. It means code
duplication and make more tedious to add the support for another
firmware table (like ACPI).

Introduce a new structure and set of helpers to get/set the virtual GIC
information. Also fill up the structure for GICv2.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/irqchip/irq-gic-common.c       | 13 ++++++
 drivers/irqchip/irq-gic-common.h       |  3 ++
 drivers/irqchip/irq-gic.c              | 76 +++++++++++++++++++++++++++++++++-
 include/linux/irqchip/arm-gic-common.h | 33 +++++++++++++++
 4 files changed, 124 insertions(+), 1 deletion(-)
 create mode 100644 include/linux/irqchip/arm-gic-common.h

diff --git a/drivers/irqchip/irq-gic-common.c b/drivers/irqchip/irq-gic-common.c
index f174ce0..2e9443b 100644
--- a/drivers/irqchip/irq-gic-common.c
+++ b/drivers/irqchip/irq-gic-common.c
@@ -21,6 +21,19 @@
 
 #include "irq-gic-common.h"
 
+static const struct gic_kvm_info *gic_kvm_info;
+
+const struct gic_kvm_info *gic_get_kvm_info(void)
+{
+	return gic_kvm_info;
+}
+
+void gic_set_kvm_info(const struct gic_kvm_info *info)
+{
+	BUG_ON(gic_kvm_info != NULL);
+	gic_kvm_info = info;
+}
+
 void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks,
 		void *data)
 {
diff --git a/drivers/irqchip/irq-gic-common.h b/drivers/irqchip/irq-gic-common.h
index fff697d..205e5fd 100644
--- a/drivers/irqchip/irq-gic-common.h
+++ b/drivers/irqchip/irq-gic-common.h
@@ -19,6 +19,7 @@
 
 #include <linux/of.h>
 #include <linux/irqdomain.h>
+#include <linux/irqchip/arm-gic-common.h>
 
 struct gic_quirk {
 	const char *desc;
@@ -35,4 +36,6 @@ void gic_cpu_config(void __iomem *base, void (*sync_access)(void));
 void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks,
 		void *data);
 
+void gic_set_kvm_info(const struct gic_kvm_info *info);
+
 #endif /* _IRQ_GIC_COMMON_H */
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 7a73786..3f1d9fd 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -102,6 +102,8 @@ static struct static_key supports_deactivate = STATIC_KEY_INIT_TRUE;
 
 static struct gic_chip_data gic_data[CONFIG_ARM_GIC_MAX_NR] __read_mostly;
 
+static struct gic_kvm_info gic_v2_kvm_info;
+
 #ifdef CONFIG_GIC_NON_BANKED
 static void __iomem *gic_get_percpu_base(union gic_base *base)
 {
@@ -1189,6 +1191,29 @@ static bool gic_check_eoimode(struct device_node *node, void __iomem **base)
 	return true;
 }
 
+static void __init gic_of_setup_kvm_info(struct device_node *node)
+{
+	int ret;
+	struct resource *vctrl_res = &gic_v2_kvm_info.vctrl;
+	struct resource *vcpu_res = &gic_v2_kvm_info.vcpu;
+
+	gic_v2_kvm_info.type = GIC_V2;
+
+	gic_v2_kvm_info.maint_irq = irq_of_parse_and_map(node, 0);
+	if (!gic_v2_kvm_info.maint_irq)
+		return;
+
+	ret = of_address_to_resource(node, 2, vctrl_res);
+	if (ret)
+		return;
+
+	ret = of_address_to_resource(node, 3, vcpu_res);
+	if (ret)
+		return;
+
+	gic_set_kvm_info(&gic_v2_kvm_info);
+}
+
 int __init
 gic_of_init(struct device_node *node, struct device_node *parent)
 {
@@ -1218,8 +1243,10 @@ gic_of_init(struct device_node *node, struct device_node *parent)
 
 	__gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset,
 			 &node->fwnode);
-	if (!gic_cnt)
+	if (!gic_cnt) {
 		gic_init_physaddr(node);
+		gic_of_setup_kvm_info(node);
+	}
 
 	if (parent) {
 		irq = irq_of_parse_and_map(node, 0);
@@ -1248,6 +1275,10 @@ IRQCHIP_DECLARE(pl390, "arm,pl390", gic_of_init);
 static struct
 {
 	phys_addr_t cpu_phys_base;
+	u32 maint_irq;
+	int maint_irq_mode;
+	phys_addr_t vctrl_base;
+	phys_addr_t vcpu_base;
 } acpi_data __initdata;
 
 static int __init
@@ -1272,6 +1303,12 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
 		return -EINVAL;
 
 	acpi_data.cpu_phys_base = gic_cpu_base;
+	acpi_data.maint_irq = processor->vgic_interrupt;
+	acpi_data.maint_irq_mode = (processor->flags & ACPI_MADT_VGIC_IRQ_MODE) ?
+				    ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
+	acpi_data.vctrl_base = processor->gich_base_address;
+	acpi_data.vcpu_base = processor->gicv_base_address;
+
 	cpu_base_assigned = 1;
 	return 0;
 }
@@ -1302,6 +1339,41 @@ static bool __init gic_validate_dist(struct acpi_subtable_header *header,
 
 #define ACPI_GICV2_DIST_MEM_SIZE	(SZ_4K)
 #define ACPI_GIC_CPU_IF_MEM_SIZE	(SZ_8K)
+#define ACPI_GICV2_VCTRL_MEM_SIZE	(SZ_4K)
+#define ACPI_GICV2_VCPU_MEM_SIZE	(SZ_8K)
+
+static void __init gic_acpi_setup_kvm_info(void)
+{
+	int irq;
+	struct resource *vctrl_res = &gic_v2_kvm_info.vctrl;
+	struct resource *vcpu_res = &gic_v2_kvm_info.vcpu;
+
+	gic_v2_kvm_info.type = GIC_V2;
+
+	if (!acpi_data.vctrl_base)
+		return;
+
+	vctrl_res->flags = IORESOURCE_MEM;
+	vctrl_res->start = acpi_data.vctrl_base;
+	vctrl_res->end = vctrl_res->start + ACPI_GICV2_VCTRL_MEM_SIZE - 1;
+
+	if (!acpi_data.vcpu_base)
+		return;
+
+	vcpu_res->flags = IORESOURCE_MEM;
+	vcpu_res->start = acpi_data.vcpu_base;
+	vcpu_res->end = vcpu_res->start + ACPI_GICV2_VCPU_MEM_SIZE - 1;
+
+	irq = acpi_register_gsi(NULL, acpi_data.maint_irq,
+				acpi_data.maint_irq_mode,
+				ACPI_ACTIVE_HIGH);
+	if (irq <= 0)
+		return;
+
+	gic_v2_kvm_info.maint_irq = irq;
+
+	gic_set_kvm_info(&gic_v2_kvm_info);
+}
 
 static int __init gic_v2_acpi_init(struct acpi_subtable_header *header,
 				   const unsigned long end)
@@ -1359,6 +1431,8 @@ static int __init gic_v2_acpi_init(struct acpi_subtable_header *header,
 	if (IS_ENABLED(CONFIG_ARM_GIC_V2M))
 		gicv2m_init(NULL, gic_data[0].domain);
 
+	gic_acpi_setup_kvm_info();
+
 	return 0;
 }
 IRQCHIP_ACPI_DECLARE(gic_v2, ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR,
diff --git a/include/linux/irqchip/arm-gic-common.h b/include/linux/irqchip/arm-gic-common.h
new file mode 100644
index 0000000..ef34f6f
--- /dev/null
+++ b/include/linux/irqchip/arm-gic-common.h
@@ -0,0 +1,33 @@
+/*
+ * include/linux/irqchip/arm-gic-common.h
+ *
+ * Copyright (C) 2016 ARM Limited, All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef __LINUX_IRQCHIP_ARM_GIC_COMMON_H
+#define __LINUX_IRQCHIP_ARM_GIC_COMMON_H
+
+#include <linux/types.h>
+#include <linux/ioport.h>
+
+enum gic_type {
+	GIC_V2,
+};
+
+struct gic_kvm_info {
+	/* GIC type */
+	enum gic_type	type;
+	/* Virtual CPU interface */
+	struct resource vcpu;
+	/* Interrupt number */
+	unsigned int	maint_irq;
+	/* Virtual control interface */
+	struct resource vctrl;
+};
+
+const struct gic_kvm_info *gic_get_kvm_info(void);
+
+#endif /* __LINUX_IRQCHIP_ARM_GIC_COMMON_H */
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 23/29] irqchip/gic-v3: Prefix all pr_* messages by "GICv3: "
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvm, Marc Zyngier, linux-arm-kernel, kvmarm

From: Julien Grall <julien.grall@arm.com>

Currently, most of the pr_* messages in the GICv3 driver don't have a
prefix.  Add one to make clear where the messages come from.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/irqchip/irq-gic-v3.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 5b7d3c2..6dc6f03 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -15,6 +15,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define pr_fmt(fmt)	"GICv3: " fmt
+
 #include <linux/acpi.h>
 #include <linux/cpu.h>
 #include <linux/cpu_pm.h>
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 23/29] irqchip/gic-v3: Prefix all pr_* messages by "GICv3: "
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julien Grall <julien.grall@arm.com>

Currently, most of the pr_* messages in the GICv3 driver don't have a
prefix.  Add one to make clear where the messages come from.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/irqchip/irq-gic-v3.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 5b7d3c2..6dc6f03 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -15,6 +15,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define pr_fmt(fmt)	"GICv3: " fmt
+
 #include <linux/acpi.h>
 #include <linux/cpu.h>
 #include <linux/cpu_pm.h>
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 24/29] irqchip/gic-v3: Gather all ACPI specific data in a single structure
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvm, Marc Zyngier, linux-arm-kernel, kvmarm

From: Julien Grall <julien.grall@arm.com>

The ACPI code requires to use global variables in order to collect
information from the tables.

To make clear those variables are ACPI specific, gather all of them in a
single structure.

Furthermore, even if some of the variables are not marked with
__initdata, they are all only used during the initialization. Therefore,
the new variable, which hold the structure, can be marked with
__initdata.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/irqchip/irq-gic-v3.c | 60 ++++++++++++++++++++++++--------------------
 1 file changed, 33 insertions(+), 27 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 6dc6f03..6a9f5ff 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -970,19 +970,22 @@ out_unmap_dist:
 IRQCHIP_DECLARE(gic_v3, "arm,gic-v3", gic_of_init);
 
 #ifdef CONFIG_ACPI
-static void __iomem *dist_base;
-static struct redist_region *redist_regs __initdata;
-static u32 nr_redist_regions __initdata;
-static bool single_redist;
+static struct
+{
+	void __iomem *dist_base;
+	struct redist_region *redist_regs;
+	u32 nr_redist_regions;
+	bool single_redist;
+} acpi_data __initdata;
 
 static void __init
 gic_acpi_register_redist(phys_addr_t phys_base, void __iomem *redist_base)
 {
 	static int count = 0;
 
-	redist_regs[count].phys_base = phys_base;
-	redist_regs[count].redist_base = redist_base;
-	redist_regs[count].single_redist = single_redist;
+	acpi_data.redist_regs[count].phys_base = phys_base;
+	acpi_data.redist_regs[count].redist_base = redist_base;
+	acpi_data.redist_regs[count].single_redist = acpi_data.single_redist;
 	count++;
 }
 
@@ -1010,7 +1013,7 @@ gic_acpi_parse_madt_gicc(struct acpi_subtable_header *header,
 {
 	struct acpi_madt_generic_interrupt *gicc =
 				(struct acpi_madt_generic_interrupt *)header;
-	u32 reg = readl_relaxed(dist_base + GICD_PIDR2) & GIC_PIDR2_ARCH_MASK;
+	u32 reg = readl_relaxed(acpi_data.dist_base + GICD_PIDR2) & GIC_PIDR2_ARCH_MASK;
 	u32 size = reg == GIC_PIDR2_ARCH_GICv4 ? SZ_64K * 4 : SZ_64K * 2;
 	void __iomem *redist_base;
 
@@ -1027,7 +1030,7 @@ static int __init gic_acpi_collect_gicr_base(void)
 	acpi_tbl_entry_handler redist_parser;
 	enum acpi_madt_type type;
 
-	if (single_redist) {
+	if (acpi_data.single_redist) {
 		type = ACPI_MADT_TYPE_GENERIC_INTERRUPT;
 		redist_parser = gic_acpi_parse_madt_gicc;
 	} else {
@@ -1078,14 +1081,14 @@ static int __init gic_acpi_count_gicr_regions(void)
 	count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR,
 				      gic_acpi_match_gicr, 0);
 	if (count > 0) {
-		single_redist = false;
+		acpi_data.single_redist = false;
 		return count;
 	}
 
 	count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT,
 				      gic_acpi_match_gicc, 0);
 	if (count > 0)
-		single_redist = true;
+		acpi_data.single_redist = true;
 
 	return count;
 }
@@ -1105,7 +1108,7 @@ static bool __init acpi_validate_gic_table(struct acpi_subtable_header *header,
 	if (count <= 0)
 		return false;
 
-	nr_redist_regions = count;
+	acpi_data.nr_redist_regions = count;
 	return true;
 }
 
@@ -1116,25 +1119,28 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
 {
 	struct acpi_madt_generic_distributor *dist;
 	struct fwnode_handle *domain_handle;
+	size_t size;
 	int i, err;
 
 	/* Get distributor base address */
 	dist = (struct acpi_madt_generic_distributor *)header;
-	dist_base = ioremap(dist->base_address, ACPI_GICV3_DIST_MEM_SIZE);
-	if (!dist_base) {
+	acpi_data.dist_base = ioremap(dist->base_address,
+				      ACPI_GICV3_DIST_MEM_SIZE);
+	if (!acpi_data.dist_base) {
 		pr_err("Unable to map GICD registers\n");
 		return -ENOMEM;
 	}
 
-	err = gic_validate_dist_version(dist_base);
+	err = gic_validate_dist_version(acpi_data.dist_base);
 	if (err) {
-		pr_err("No distributor detected at @%p, giving up", dist_base);
+		pr_err("No distributor detected at @%p, giving up",
+		       acpi_data.dist_base);
 		goto out_dist_unmap;
 	}
 
-	redist_regs = kzalloc(sizeof(*redist_regs) * nr_redist_regions,
-			      GFP_KERNEL);
-	if (!redist_regs) {
+	size = sizeof(*acpi_data.redist_regs) * acpi_data.nr_redist_regions;
+	acpi_data.redist_regs = kzalloc(size, GFP_KERNEL);
+	if (!acpi_data.redist_regs) {
 		err = -ENOMEM;
 		goto out_dist_unmap;
 	}
@@ -1143,14 +1149,14 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
 	if (err)
 		goto out_redist_unmap;
 
-	domain_handle = irq_domain_alloc_fwnode(dist_base);
+	domain_handle = irq_domain_alloc_fwnode(acpi_data.dist_base);
 	if (!domain_handle) {
 		err = -ENOMEM;
 		goto out_redist_unmap;
 	}
 
-	err = gic_init_bases(dist_base, redist_regs, nr_redist_regions, 0,
-			     domain_handle);
+	err = gic_init_bases(acpi_data.dist_base, acpi_data.redist_regs,
+			     acpi_data.nr_redist_regions, 0, domain_handle);
 	if (err)
 		goto out_fwhandle_free;
 
@@ -1160,12 +1166,12 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
 out_fwhandle_free:
 	irq_domain_free_fwnode(domain_handle);
 out_redist_unmap:
-	for (i = 0; i < nr_redist_regions; i++)
-		if (redist_regs[i].redist_base)
-			iounmap(redist_regs[i].redist_base);
-	kfree(redist_regs);
+	for (i = 0; i < acpi_data.nr_redist_regions; i++)
+		if (acpi_data.redist_regs[i].redist_base)
+			iounmap(acpi_data.redist_regs[i].redist_base);
+	kfree(acpi_data.redist_regs);
 out_dist_unmap:
-	iounmap(dist_base);
+	iounmap(acpi_data.dist_base);
 	return err;
 }
 IRQCHIP_ACPI_DECLARE(gic_v3, ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR,
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 24/29] irqchip/gic-v3: Gather all ACPI specific data in a single structure
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julien Grall <julien.grall@arm.com>

The ACPI code requires to use global variables in order to collect
information from the tables.

To make clear those variables are ACPI specific, gather all of them in a
single structure.

Furthermore, even if some of the variables are not marked with
__initdata, they are all only used during the initialization. Therefore,
the new variable, which hold the structure, can be marked with
__initdata.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/irqchip/irq-gic-v3.c | 60 ++++++++++++++++++++++++--------------------
 1 file changed, 33 insertions(+), 27 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 6dc6f03..6a9f5ff 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -970,19 +970,22 @@ out_unmap_dist:
 IRQCHIP_DECLARE(gic_v3, "arm,gic-v3", gic_of_init);
 
 #ifdef CONFIG_ACPI
-static void __iomem *dist_base;
-static struct redist_region *redist_regs __initdata;
-static u32 nr_redist_regions __initdata;
-static bool single_redist;
+static struct
+{
+	void __iomem *dist_base;
+	struct redist_region *redist_regs;
+	u32 nr_redist_regions;
+	bool single_redist;
+} acpi_data __initdata;
 
 static void __init
 gic_acpi_register_redist(phys_addr_t phys_base, void __iomem *redist_base)
 {
 	static int count = 0;
 
-	redist_regs[count].phys_base = phys_base;
-	redist_regs[count].redist_base = redist_base;
-	redist_regs[count].single_redist = single_redist;
+	acpi_data.redist_regs[count].phys_base = phys_base;
+	acpi_data.redist_regs[count].redist_base = redist_base;
+	acpi_data.redist_regs[count].single_redist = acpi_data.single_redist;
 	count++;
 }
 
@@ -1010,7 +1013,7 @@ gic_acpi_parse_madt_gicc(struct acpi_subtable_header *header,
 {
 	struct acpi_madt_generic_interrupt *gicc =
 				(struct acpi_madt_generic_interrupt *)header;
-	u32 reg = readl_relaxed(dist_base + GICD_PIDR2) & GIC_PIDR2_ARCH_MASK;
+	u32 reg = readl_relaxed(acpi_data.dist_base + GICD_PIDR2) & GIC_PIDR2_ARCH_MASK;
 	u32 size = reg == GIC_PIDR2_ARCH_GICv4 ? SZ_64K * 4 : SZ_64K * 2;
 	void __iomem *redist_base;
 
@@ -1027,7 +1030,7 @@ static int __init gic_acpi_collect_gicr_base(void)
 	acpi_tbl_entry_handler redist_parser;
 	enum acpi_madt_type type;
 
-	if (single_redist) {
+	if (acpi_data.single_redist) {
 		type = ACPI_MADT_TYPE_GENERIC_INTERRUPT;
 		redist_parser = gic_acpi_parse_madt_gicc;
 	} else {
@@ -1078,14 +1081,14 @@ static int __init gic_acpi_count_gicr_regions(void)
 	count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR,
 				      gic_acpi_match_gicr, 0);
 	if (count > 0) {
-		single_redist = false;
+		acpi_data.single_redist = false;
 		return count;
 	}
 
 	count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT,
 				      gic_acpi_match_gicc, 0);
 	if (count > 0)
-		single_redist = true;
+		acpi_data.single_redist = true;
 
 	return count;
 }
@@ -1105,7 +1108,7 @@ static bool __init acpi_validate_gic_table(struct acpi_subtable_header *header,
 	if (count <= 0)
 		return false;
 
-	nr_redist_regions = count;
+	acpi_data.nr_redist_regions = count;
 	return true;
 }
 
@@ -1116,25 +1119,28 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
 {
 	struct acpi_madt_generic_distributor *dist;
 	struct fwnode_handle *domain_handle;
+	size_t size;
 	int i, err;
 
 	/* Get distributor base address */
 	dist = (struct acpi_madt_generic_distributor *)header;
-	dist_base = ioremap(dist->base_address, ACPI_GICV3_DIST_MEM_SIZE);
-	if (!dist_base) {
+	acpi_data.dist_base = ioremap(dist->base_address,
+				      ACPI_GICV3_DIST_MEM_SIZE);
+	if (!acpi_data.dist_base) {
 		pr_err("Unable to map GICD registers\n");
 		return -ENOMEM;
 	}
 
-	err = gic_validate_dist_version(dist_base);
+	err = gic_validate_dist_version(acpi_data.dist_base);
 	if (err) {
-		pr_err("No distributor detected at @%p, giving up", dist_base);
+		pr_err("No distributor detected at @%p, giving up",
+		       acpi_data.dist_base);
 		goto out_dist_unmap;
 	}
 
-	redist_regs = kzalloc(sizeof(*redist_regs) * nr_redist_regions,
-			      GFP_KERNEL);
-	if (!redist_regs) {
+	size = sizeof(*acpi_data.redist_regs) * acpi_data.nr_redist_regions;
+	acpi_data.redist_regs = kzalloc(size, GFP_KERNEL);
+	if (!acpi_data.redist_regs) {
 		err = -ENOMEM;
 		goto out_dist_unmap;
 	}
@@ -1143,14 +1149,14 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
 	if (err)
 		goto out_redist_unmap;
 
-	domain_handle = irq_domain_alloc_fwnode(dist_base);
+	domain_handle = irq_domain_alloc_fwnode(acpi_data.dist_base);
 	if (!domain_handle) {
 		err = -ENOMEM;
 		goto out_redist_unmap;
 	}
 
-	err = gic_init_bases(dist_base, redist_regs, nr_redist_regions, 0,
-			     domain_handle);
+	err = gic_init_bases(acpi_data.dist_base, acpi_data.redist_regs,
+			     acpi_data.nr_redist_regions, 0, domain_handle);
 	if (err)
 		goto out_fwhandle_free;
 
@@ -1160,12 +1166,12 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
 out_fwhandle_free:
 	irq_domain_free_fwnode(domain_handle);
 out_redist_unmap:
-	for (i = 0; i < nr_redist_regions; i++)
-		if (redist_regs[i].redist_base)
-			iounmap(redist_regs[i].redist_base);
-	kfree(redist_regs);
+	for (i = 0; i < acpi_data.nr_redist_regions; i++)
+		if (acpi_data.redist_regs[i].redist_base)
+			iounmap(acpi_data.redist_regs[i].redist_base);
+	kfree(acpi_data.redist_regs);
 out_dist_unmap:
-	iounmap(dist_base);
+	iounmap(acpi_data.dist_base);
 	return err;
 }
 IRQCHIP_ACPI_DECLARE(gic_v3, ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR,
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 25/29] irqchip/gic-v3: Parse and export virtual GIC information
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Julien Grall,
	Thomas Gleixner, Jason Cooper, Christoffer Dall

From: Julien Grall <julien.grall@arm.com>

Fill up the recently introduced gic_kvm_info with the hardware
information used for virtualization.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/irqchip/irq-gic-v3.c           | 114 ++++++++++++++++++++++++++++++++-
 include/linux/irqchip/arm-gic-common.h |   1 +
 2 files changed, 114 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 6a9f5ff..05a8560 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -30,6 +30,7 @@
 #include <linux/slab.h>
 
 #include <linux/irqchip.h>
+#include <linux/irqchip/arm-gic-common.h>
 #include <linux/irqchip/arm-gic-v3.h>
 
 #include <asm/cputype.h>
@@ -58,6 +59,8 @@ struct gic_chip_data {
 static struct gic_chip_data gic_data __read_mostly;
 static struct static_key supports_deactivate = STATIC_KEY_INIT_TRUE;
 
+static struct gic_kvm_info gic_v3_kvm_info;
+
 #define gic_data_rdist()		(this_cpu_ptr(gic_data.rdists.rdist))
 #define gic_data_rdist_rd_base()	(gic_data_rdist()->rd_base)
 #define gic_data_rdist_sgi_base()	(gic_data_rdist_rd_base() + SZ_64K)
@@ -903,6 +906,30 @@ static int __init gic_validate_dist_version(void __iomem *dist_base)
 	return 0;
 }
 
+static void __init gic_of_setup_kvm_info(struct device_node *node)
+{
+	int ret;
+	struct resource r;
+	u32 gicv_idx;
+
+	gic_v3_kvm_info.type = GIC_V3;
+
+	gic_v3_kvm_info.maint_irq = irq_of_parse_and_map(node, 0);
+	if (!gic_v3_kvm_info.maint_irq)
+		return;
+
+	if (of_property_read_u32(node, "#redistributor-regions",
+				 &gicv_idx))
+		gicv_idx = 1;
+
+	gicv_idx += 3;	/* Also skip GICD, GICC, GICH */
+	ret = of_address_to_resource(node, gicv_idx, &r);
+	if (!ret)
+		gic_v3_kvm_info.vcpu = r;
+
+	gic_set_kvm_info(&gic_v3_kvm_info);
+}
+
 static int __init gic_of_init(struct device_node *node, struct device_node *parent)
 {
 	void __iomem *dist_base;
@@ -954,8 +981,10 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare
 
 	err = gic_init_bases(dist_base, rdist_regs, nr_redist_regions,
 			     redist_stride, &node->fwnode);
-	if (!err)
+	if (!err) {
+		gic_of_setup_kvm_info(node);
 		return 0;
+	}
 
 out_unmap_rdist:
 	for (i = 0; i < nr_redist_regions; i++)
@@ -976,6 +1005,9 @@ static struct
 	struct redist_region *redist_regs;
 	u32 nr_redist_regions;
 	bool single_redist;
+	u32 maint_irq;
+	int maint_irq_mode;
+	phys_addr_t vcpu_base;
 } acpi_data __initdata;
 
 static void __init
@@ -1112,7 +1144,85 @@ static bool __init acpi_validate_gic_table(struct acpi_subtable_header *header,
 	return true;
 }
 
+static int __init gic_acpi_parse_virt_madt_gicc(struct acpi_subtable_header *header,
+						const unsigned long end)
+{
+	struct acpi_madt_generic_interrupt *gicc =
+		(struct acpi_madt_generic_interrupt *)header;
+	int maint_irq_mode;
+	static int first_madt = true;
+
+	/* Skip unusable CPUs */
+	if (!(gicc->flags & ACPI_MADT_ENABLED))
+		return 0;
+
+	maint_irq_mode = (gicc->flags & ACPI_MADT_VGIC_IRQ_MODE) ?
+		ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
+
+	if (first_madt) {
+		first_madt = false;
+
+		acpi_data.maint_irq = gicc->vgic_interrupt;
+		acpi_data.maint_irq_mode = maint_irq_mode;
+		acpi_data.vcpu_base = gicc->gicv_base_address;
+
+		return 0;
+	}
+
+	/*
+	 * The maintenance interrupt and GICV should be the same for every CPU
+	 */
+	if ((acpi_data.maint_irq != gicc->vgic_interrupt) ||
+	    (acpi_data.maint_irq_mode != maint_irq_mode) ||
+	    (acpi_data.vcpu_base != gicc->gicv_base_address))
+		return -EINVAL;
+
+	return 0;
+}
+
+static bool __init gic_acpi_collect_virt_info(void)
+{
+	int count;
+
+	count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT,
+				      gic_acpi_parse_virt_madt_gicc, 0);
+
+	return (count > 0);
+}
+
 #define ACPI_GICV3_DIST_MEM_SIZE (SZ_64K)
+#define ACPI_GICV2_VCTRL_MEM_SIZE	(SZ_4K)
+#define ACPI_GICV2_VCPU_MEM_SIZE	(SZ_8K)
+
+static void __init gic_acpi_setup_kvm_info(void)
+{
+	int irq;
+
+	if (!gic_acpi_collect_virt_info()) {
+		pr_warn("Unable to get hardware information used for virtualization\n");
+		return;
+	}
+
+	gic_v3_kvm_info.type = GIC_V3;
+
+	irq = acpi_register_gsi(NULL, acpi_data.maint_irq,
+				acpi_data.maint_irq_mode,
+				ACPI_ACTIVE_HIGH);
+	if (irq <= 0)
+		return;
+
+	gic_v3_kvm_info.maint_irq = irq;
+
+	if (acpi_data.vcpu_base) {
+		struct resource *vcpu = &gic_v3_kvm_info.vcpu;
+
+		vcpu->flags = IORESOURCE_MEM;
+		vcpu->start = acpi_data.vcpu_base;
+		vcpu->end = vcpu->start + ACPI_GICV2_VCPU_MEM_SIZE - 1;
+	}
+
+	gic_set_kvm_info(&gic_v3_kvm_info);
+}
 
 static int __init
 gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
@@ -1161,6 +1271,8 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
 		goto out_fwhandle_free;
 
 	acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle);
+	gic_acpi_setup_kvm_info();
+
 	return 0;
 
 out_fwhandle_free:
diff --git a/include/linux/irqchip/arm-gic-common.h b/include/linux/irqchip/arm-gic-common.h
index ef34f6f..c647b05 100644
--- a/include/linux/irqchip/arm-gic-common.h
+++ b/include/linux/irqchip/arm-gic-common.h
@@ -15,6 +15,7 @@
 
 enum gic_type {
 	GIC_V2,
+	GIC_V3,
 };
 
 struct gic_kvm_info {
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 25/29] irqchip/gic-v3: Parse and export virtual GIC information
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julien Grall <julien.grall@arm.com>

Fill up the recently introduced gic_kvm_info with the hardware
information used for virtualization.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/irqchip/irq-gic-v3.c           | 114 ++++++++++++++++++++++++++++++++-
 include/linux/irqchip/arm-gic-common.h |   1 +
 2 files changed, 114 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 6a9f5ff..05a8560 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -30,6 +30,7 @@
 #include <linux/slab.h>
 
 #include <linux/irqchip.h>
+#include <linux/irqchip/arm-gic-common.h>
 #include <linux/irqchip/arm-gic-v3.h>
 
 #include <asm/cputype.h>
@@ -58,6 +59,8 @@ struct gic_chip_data {
 static struct gic_chip_data gic_data __read_mostly;
 static struct static_key supports_deactivate = STATIC_KEY_INIT_TRUE;
 
+static struct gic_kvm_info gic_v3_kvm_info;
+
 #define gic_data_rdist()		(this_cpu_ptr(gic_data.rdists.rdist))
 #define gic_data_rdist_rd_base()	(gic_data_rdist()->rd_base)
 #define gic_data_rdist_sgi_base()	(gic_data_rdist_rd_base() + SZ_64K)
@@ -903,6 +906,30 @@ static int __init gic_validate_dist_version(void __iomem *dist_base)
 	return 0;
 }
 
+static void __init gic_of_setup_kvm_info(struct device_node *node)
+{
+	int ret;
+	struct resource r;
+	u32 gicv_idx;
+
+	gic_v3_kvm_info.type = GIC_V3;
+
+	gic_v3_kvm_info.maint_irq = irq_of_parse_and_map(node, 0);
+	if (!gic_v3_kvm_info.maint_irq)
+		return;
+
+	if (of_property_read_u32(node, "#redistributor-regions",
+				 &gicv_idx))
+		gicv_idx = 1;
+
+	gicv_idx += 3;	/* Also skip GICD, GICC, GICH */
+	ret = of_address_to_resource(node, gicv_idx, &r);
+	if (!ret)
+		gic_v3_kvm_info.vcpu = r;
+
+	gic_set_kvm_info(&gic_v3_kvm_info);
+}
+
 static int __init gic_of_init(struct device_node *node, struct device_node *parent)
 {
 	void __iomem *dist_base;
@@ -954,8 +981,10 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare
 
 	err = gic_init_bases(dist_base, rdist_regs, nr_redist_regions,
 			     redist_stride, &node->fwnode);
-	if (!err)
+	if (!err) {
+		gic_of_setup_kvm_info(node);
 		return 0;
+	}
 
 out_unmap_rdist:
 	for (i = 0; i < nr_redist_regions; i++)
@@ -976,6 +1005,9 @@ static struct
 	struct redist_region *redist_regs;
 	u32 nr_redist_regions;
 	bool single_redist;
+	u32 maint_irq;
+	int maint_irq_mode;
+	phys_addr_t vcpu_base;
 } acpi_data __initdata;
 
 static void __init
@@ -1112,7 +1144,85 @@ static bool __init acpi_validate_gic_table(struct acpi_subtable_header *header,
 	return true;
 }
 
+static int __init gic_acpi_parse_virt_madt_gicc(struct acpi_subtable_header *header,
+						const unsigned long end)
+{
+	struct acpi_madt_generic_interrupt *gicc =
+		(struct acpi_madt_generic_interrupt *)header;
+	int maint_irq_mode;
+	static int first_madt = true;
+
+	/* Skip unusable CPUs */
+	if (!(gicc->flags & ACPI_MADT_ENABLED))
+		return 0;
+
+	maint_irq_mode = (gicc->flags & ACPI_MADT_VGIC_IRQ_MODE) ?
+		ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
+
+	if (first_madt) {
+		first_madt = false;
+
+		acpi_data.maint_irq = gicc->vgic_interrupt;
+		acpi_data.maint_irq_mode = maint_irq_mode;
+		acpi_data.vcpu_base = gicc->gicv_base_address;
+
+		return 0;
+	}
+
+	/*
+	 * The maintenance interrupt and GICV should be the same for every CPU
+	 */
+	if ((acpi_data.maint_irq != gicc->vgic_interrupt) ||
+	    (acpi_data.maint_irq_mode != maint_irq_mode) ||
+	    (acpi_data.vcpu_base != gicc->gicv_base_address))
+		return -EINVAL;
+
+	return 0;
+}
+
+static bool __init gic_acpi_collect_virt_info(void)
+{
+	int count;
+
+	count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT,
+				      gic_acpi_parse_virt_madt_gicc, 0);
+
+	return (count > 0);
+}
+
 #define ACPI_GICV3_DIST_MEM_SIZE (SZ_64K)
+#define ACPI_GICV2_VCTRL_MEM_SIZE	(SZ_4K)
+#define ACPI_GICV2_VCPU_MEM_SIZE	(SZ_8K)
+
+static void __init gic_acpi_setup_kvm_info(void)
+{
+	int irq;
+
+	if (!gic_acpi_collect_virt_info()) {
+		pr_warn("Unable to get hardware information used for virtualization\n");
+		return;
+	}
+
+	gic_v3_kvm_info.type = GIC_V3;
+
+	irq = acpi_register_gsi(NULL, acpi_data.maint_irq,
+				acpi_data.maint_irq_mode,
+				ACPI_ACTIVE_HIGH);
+	if (irq <= 0)
+		return;
+
+	gic_v3_kvm_info.maint_irq = irq;
+
+	if (acpi_data.vcpu_base) {
+		struct resource *vcpu = &gic_v3_kvm_info.vcpu;
+
+		vcpu->flags = IORESOURCE_MEM;
+		vcpu->start = acpi_data.vcpu_base;
+		vcpu->end = vcpu->start + ACPI_GICV2_VCPU_MEM_SIZE - 1;
+	}
+
+	gic_set_kvm_info(&gic_v3_kvm_info);
+}
 
 static int __init
 gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
@@ -1161,6 +1271,8 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
 		goto out_fwhandle_free;
 
 	acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle);
+	gic_acpi_setup_kvm_info();
+
 	return 0;
 
 out_fwhandle_free:
diff --git a/include/linux/irqchip/arm-gic-common.h b/include/linux/irqchip/arm-gic-common.h
index ef34f6f..c647b05 100644
--- a/include/linux/irqchip/arm-gic-common.h
+++ b/include/linux/irqchip/arm-gic-common.h
@@ -15,6 +15,7 @@
 
 enum gic_type {
 	GIC_V2,
+	GIC_V3,
 };
 
 struct gic_kvm_info {
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 26/29] KVM: arm/arm64: arch_timer: Rely on the arch timer to parse the firmware tables
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Julien Grall,
	Christoffer Dall

From: Julien Grall <julien.grall@arm.com>

The firmware table is currently parsed by the virtual timer code in
order to retrieve the virtual timer interrupt. However, this is already
done by the arch timer driver.

To avoid code duplication, use the newly function arch_timer_get_kvm_info()
which return all the information required by the virtual timer code.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 virt/kvm/arm/arch_timer.c | 40 +++++++++++-----------------------------
 1 file changed, 11 insertions(+), 29 deletions(-)

diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 9aaa35d..409db33 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -17,7 +17,6 @@
  */
 
 #include <linux/cpu.h>
-#include <linux/of_irq.h>
 #include <linux/kvm.h>
 #include <linux/kvm_host.h>
 #include <linux/interrupt.h>
@@ -438,45 +437,29 @@ static struct notifier_block kvm_timer_cpu_nb = {
 	.notifier_call = kvm_timer_cpu_notify,
 };
 
-static const struct of_device_id arch_timer_of_match[] = {
-	{ .compatible	= "arm,armv7-timer",	},
-	{ .compatible	= "arm,armv8-timer",	},
-	{},
-};
-
 int kvm_timer_hyp_init(void)
 {
-	struct device_node *np;
-	unsigned int ppi;
+	struct arch_timer_kvm_info *info;
 	int err;
 
-	timecounter = arch_timer_get_timecounter();
-	if (!timecounter)
-		return -ENODEV;
+	info = arch_timer_get_kvm_info();
+	timecounter = &info->timecounter;
 
-	np = of_find_matching_node(NULL, arch_timer_of_match);
-	if (!np) {
-		kvm_err("kvm_arch_timer: can't find DT node\n");
+	if (info->virtual_irq <= 0) {
+		kvm_err("kvm_arch_timer: invalid virtual timer IRQ: %d\n",
+			info->virtual_irq);
 		return -ENODEV;
 	}
+	host_vtimer_irq = info->virtual_irq;
 
-	ppi = irq_of_parse_and_map(np, 2);
-	if (!ppi) {
-		kvm_err("kvm_arch_timer: no virtual timer interrupt\n");
-		err = -EINVAL;
-		goto out;
-	}
-
-	err = request_percpu_irq(ppi, kvm_arch_timer_handler,
+	err = request_percpu_irq(host_vtimer_irq, kvm_arch_timer_handler,
 				 "kvm guest timer", kvm_get_running_vcpus());
 	if (err) {
 		kvm_err("kvm_arch_timer: can't request interrupt %d (%d)\n",
-			ppi, err);
+			host_vtimer_irq, err);
 		goto out;
 	}
 
-	host_vtimer_irq = ppi;
-
 	err = __register_cpu_notifier(&kvm_timer_cpu_nb);
 	if (err) {
 		kvm_err("Cannot register timer CPU notifier\n");
@@ -489,14 +472,13 @@ int kvm_timer_hyp_init(void)
 		goto out_free;
 	}
 
-	kvm_info("%s IRQ%d\n", np->name, ppi);
+	kvm_info("virtual timer IRQ%d\n", host_vtimer_irq);
 	on_each_cpu(kvm_timer_init_interrupt, NULL, 1);
 
 	goto out;
 out_free:
-	free_percpu_irq(ppi, kvm_get_running_vcpus());
+	free_percpu_irq(host_vtimer_irq, kvm_get_running_vcpus());
 out:
-	of_node_put(np);
 	return err;
 }
 
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 26/29] KVM: arm/arm64: arch_timer: Rely on the arch timer to parse the firmware tables
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julien Grall <julien.grall@arm.com>

The firmware table is currently parsed by the virtual timer code in
order to retrieve the virtual timer interrupt. However, this is already
done by the arch timer driver.

To avoid code duplication, use the newly function arch_timer_get_kvm_info()
which return all the information required by the virtual timer code.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 virt/kvm/arm/arch_timer.c | 40 +++++++++++-----------------------------
 1 file changed, 11 insertions(+), 29 deletions(-)

diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 9aaa35d..409db33 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -17,7 +17,6 @@
  */
 
 #include <linux/cpu.h>
-#include <linux/of_irq.h>
 #include <linux/kvm.h>
 #include <linux/kvm_host.h>
 #include <linux/interrupt.h>
@@ -438,45 +437,29 @@ static struct notifier_block kvm_timer_cpu_nb = {
 	.notifier_call = kvm_timer_cpu_notify,
 };
 
-static const struct of_device_id arch_timer_of_match[] = {
-	{ .compatible	= "arm,armv7-timer",	},
-	{ .compatible	= "arm,armv8-timer",	},
-	{},
-};
-
 int kvm_timer_hyp_init(void)
 {
-	struct device_node *np;
-	unsigned int ppi;
+	struct arch_timer_kvm_info *info;
 	int err;
 
-	timecounter = arch_timer_get_timecounter();
-	if (!timecounter)
-		return -ENODEV;
+	info = arch_timer_get_kvm_info();
+	timecounter = &info->timecounter;
 
-	np = of_find_matching_node(NULL, arch_timer_of_match);
-	if (!np) {
-		kvm_err("kvm_arch_timer: can't find DT node\n");
+	if (info->virtual_irq <= 0) {
+		kvm_err("kvm_arch_timer: invalid virtual timer IRQ: %d\n",
+			info->virtual_irq);
 		return -ENODEV;
 	}
+	host_vtimer_irq = info->virtual_irq;
 
-	ppi = irq_of_parse_and_map(np, 2);
-	if (!ppi) {
-		kvm_err("kvm_arch_timer: no virtual timer interrupt\n");
-		err = -EINVAL;
-		goto out;
-	}
-
-	err = request_percpu_irq(ppi, kvm_arch_timer_handler,
+	err = request_percpu_irq(host_vtimer_irq, kvm_arch_timer_handler,
 				 "kvm guest timer", kvm_get_running_vcpus());
 	if (err) {
 		kvm_err("kvm_arch_timer: can't request interrupt %d (%d)\n",
-			ppi, err);
+			host_vtimer_irq, err);
 		goto out;
 	}
 
-	host_vtimer_irq = ppi;
-
 	err = __register_cpu_notifier(&kvm_timer_cpu_nb);
 	if (err) {
 		kvm_err("Cannot register timer CPU notifier\n");
@@ -489,14 +472,13 @@ int kvm_timer_hyp_init(void)
 		goto out_free;
 	}
 
-	kvm_info("%s IRQ%d\n", np->name, ppi);
+	kvm_info("virtual timer IRQ%d\n", host_vtimer_irq);
 	on_each_cpu(kvm_timer_init_interrupt, NULL, 1);
 
 	goto out;
 out_free:
-	free_percpu_irq(ppi, kvm_get_running_vcpus());
+	free_percpu_irq(host_vtimer_irq, kvm_get_running_vcpus());
 out:
-	of_node_put(np);
 	return err;
 }
 
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 27/29] KVM: arm/arm64: vgic: Rely on the GIC driver to parse the firmware tables
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Julien Grall,
	Christoffer Dall

From: Julien Grall <julien.grall@arm.com>

Currently, the firmware tables are parsed 2 times: once in the GIC
drivers, the other time when initializing the vGIC. It means code
duplication and make more tedious to add the support for another
firmware table (like ACPI).

Use the recently introduced helper gic_get_kvm_info() to get
information about the virtual GIC.

With this change, the virtual GIC becomes agnostic to the firmware
table and KVM will be able to initialize the vGIC on ACPI.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 include/kvm/arm_vgic.h |  7 +++---
 virt/kvm/arm/vgic-v2.c | 61 +++++++++++++++++++++-----------------------------
 virt/kvm/arm/vgic-v3.c | 47 +++++++++++++-------------------------
 virt/kvm/arm/vgic.c    | 50 ++++++++++++++++++++++-------------------
 4 files changed, 73 insertions(+), 92 deletions(-)

diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 281caf8..be6037a 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -25,6 +25,7 @@
 #include <linux/spinlock.h>
 #include <linux/types.h>
 #include <kvm/iodev.h>
+#include <linux/irqchip/arm-gic-common.h>
 
 #define VGIC_NR_IRQS_LEGACY	256
 #define VGIC_NR_SGIS		16
@@ -353,15 +354,15 @@ bool kvm_vgic_map_is_active(struct kvm_vcpu *vcpu, struct irq_phys_map *map);
 #define vgic_initialized(k)	(!!((k)->arch.vgic.nr_cpus))
 #define vgic_ready(k)		((k)->arch.vgic.ready)
 
-int vgic_v2_probe(struct device_node *vgic_node,
+int vgic_v2_probe(const struct gic_kvm_info *gic_kvm_info,
 		  const struct vgic_ops **ops,
 		  const struct vgic_params **params);
 #ifdef CONFIG_KVM_ARM_VGIC_V3
-int vgic_v3_probe(struct device_node *vgic_node,
+int vgic_v3_probe(const struct gic_kvm_info *gic_kvm_info,
 		  const struct vgic_ops **ops,
 		  const struct vgic_params **params);
 #else
-static inline int vgic_v3_probe(struct device_node *vgic_node,
+static inline int vgic_v3_probe(const struct gic_kvm_info *gic_kvm_info,
 				const struct vgic_ops **ops,
 				const struct vgic_params **params)
 {
diff --git a/virt/kvm/arm/vgic-v2.c b/virt/kvm/arm/vgic-v2.c
index 67ec334..7e826c9 100644
--- a/virt/kvm/arm/vgic-v2.c
+++ b/virt/kvm/arm/vgic-v2.c
@@ -20,9 +20,6 @@
 #include <linux/kvm_host.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
 
 #include <linux/irqchip/arm-gic.h>
 
@@ -186,38 +183,39 @@ static void vgic_cpu_init_lrs(void *params)
 }
 
 /**
- * vgic_v2_probe - probe for a GICv2 compatible interrupt controller in DT
- * @node:	pointer to the DT node
- * @ops: 	address of a pointer to the GICv2 operations
- * @params:	address of a pointer to HW-specific parameters
+ * vgic_v2_probe - probe for a GICv2 compatible interrupt controller
+ * @gic_kvm_info:	pointer to the GIC description
+ * @ops:		address of a pointer to the GICv2 operations
+ * @params:		address of a pointer to HW-specific parameters
  *
  * Returns 0 if a GICv2 has been found, with the low level operations
  * in *ops and the HW parameters in *params. Returns an error code
  * otherwise.
  */
-int vgic_v2_probe(struct device_node *vgic_node,
-		  const struct vgic_ops **ops,
-		  const struct vgic_params **params)
+int vgic_v2_probe(const struct gic_kvm_info *gic_kvm_info,
+		   const struct vgic_ops **ops,
+		   const struct vgic_params **params)
 {
 	int ret;
-	struct resource vctrl_res;
-	struct resource vcpu_res;
 	struct vgic_params *vgic = &vgic_v2_params;
+	const struct resource *vctrl_res = &gic_kvm_info->vctrl;
+	const struct resource *vcpu_res = &gic_kvm_info->vcpu;
 
-	vgic->maint_irq = irq_of_parse_and_map(vgic_node, 0);
-	if (!vgic->maint_irq) {
-		kvm_err("error getting vgic maintenance irq from DT\n");
+	if (!gic_kvm_info->maint_irq) {
+		kvm_err("error getting vgic maintenance irq\n");
 		ret = -ENXIO;
 		goto out;
 	}
+	vgic->maint_irq = gic_kvm_info->maint_irq;
 
-	ret = of_address_to_resource(vgic_node, 2, &vctrl_res);
-	if (ret) {
-		kvm_err("Cannot obtain GICH resource\n");
+	if (!gic_kvm_info->vctrl.start) {
+		kvm_err("GICH not present in the firmware table\n");
+		ret = -ENXIO;
 		goto out;
 	}
 
-	vgic->vctrl_base = of_iomap(vgic_node, 2);
+	vgic->vctrl_base = ioremap(gic_kvm_info->vctrl.start,
+				   resource_size(&gic_kvm_info->vctrl));
 	if (!vgic->vctrl_base) {
 		kvm_err("Cannot ioremap GICH\n");
 		ret = -ENOMEM;
@@ -228,29 +226,23 @@ int vgic_v2_probe(struct device_node *vgic_node,
 	vgic->nr_lr = (vgic->nr_lr & 0x3f) + 1;
 
 	ret = create_hyp_io_mappings(vgic->vctrl_base,
-				     vgic->vctrl_base + resource_size(&vctrl_res),
-				     vctrl_res.start);
+				     vgic->vctrl_base + resource_size(vctrl_res),
+				     vctrl_res->start);
 	if (ret) {
 		kvm_err("Cannot map VCTRL into hyp\n");
 		goto out_unmap;
 	}
 
-	if (of_address_to_resource(vgic_node, 3, &vcpu_res)) {
-		kvm_err("Cannot obtain GICV resource\n");
-		ret = -ENXIO;
-		goto out_unmap;
-	}
-
-	if (!PAGE_ALIGNED(vcpu_res.start)) {
+	if (!PAGE_ALIGNED(vcpu_res->start)) {
 		kvm_err("GICV physical address 0x%llx not page aligned\n",
-			(unsigned long long)vcpu_res.start);
+			(unsigned long long)vcpu_res->start);
 		ret = -ENXIO;
 		goto out_unmap;
 	}
 
-	if (!PAGE_ALIGNED(resource_size(&vcpu_res))) {
+	if (!PAGE_ALIGNED(resource_size(vcpu_res))) {
 		kvm_err("GICV size 0x%llx not a multiple of page size 0x%lx\n",
-			(unsigned long long)resource_size(&vcpu_res),
+			(unsigned long long)resource_size(vcpu_res),
 			PAGE_SIZE);
 		ret = -ENXIO;
 		goto out_unmap;
@@ -259,10 +251,10 @@ int vgic_v2_probe(struct device_node *vgic_node,
 	vgic->can_emulate_gicv2 = true;
 	kvm_register_device_ops(&kvm_arm_vgic_v2_ops, KVM_DEV_TYPE_ARM_VGIC_V2);
 
-	vgic->vcpu_base = vcpu_res.start;
+	vgic->vcpu_base = vcpu_res->start;
 
-	kvm_info("%s@%llx IRQ%d\n", vgic_node->name,
-		 vctrl_res.start, vgic->maint_irq);
+	kvm_info("GICH base=0x%llx, GICV base=0x%llx, IRQ=%d\n",
+		 gic_kvm_info->vctrl.start, vgic->vcpu_base, vgic->maint_irq);
 
 	vgic->type = VGIC_V2;
 	vgic->max_gic_vcpus = VGIC_V2_MAX_CPUS;
@@ -276,6 +268,5 @@ int vgic_v2_probe(struct device_node *vgic_node,
 out_unmap:
 	iounmap(vgic->vctrl_base);
 out:
-	of_node_put(vgic_node);
 	return ret;
 }
diff --git a/virt/kvm/arm/vgic-v3.c b/virt/kvm/arm/vgic-v3.c
index 999bdc6..c02a1b1 100644
--- a/virt/kvm/arm/vgic-v3.c
+++ b/virt/kvm/arm/vgic-v3.c
@@ -20,11 +20,9 @@
 #include <linux/kvm_host.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
 
 #include <linux/irqchip/arm-gic-v3.h>
+#include <linux/irqchip/arm-gic-common.h>
 
 #include <asm/kvm_emulate.h>
 #include <asm/kvm_arm.h>
@@ -222,30 +220,24 @@ static void vgic_cpu_init_lrs(void *params)
 }
 
 /**
- * vgic_v3_probe - probe for a GICv3 compatible interrupt controller in DT
- * @node:	pointer to the DT node
- * @ops: 	address of a pointer to the GICv3 operations
- * @params:	address of a pointer to HW-specific parameters
+ * vgic_v3_probe - probe for a GICv3 compatible interrupt controller
+ * @gic_kvm_info:	pointer to the GIC description
+ * @ops:		address of a pointer to the GICv3 operations
+ * @params:		address of a pointer to HW-specific parameters
  *
  * Returns 0 if a GICv3 has been found, with the low level operations
  * in *ops and the HW parameters in *params. Returns an error code
  * otherwise.
  */
-int vgic_v3_probe(struct device_node *vgic_node,
+int vgic_v3_probe(const struct gic_kvm_info *gic_kvm_info,
 		  const struct vgic_ops **ops,
 		  const struct vgic_params **params)
 {
 	int ret = 0;
-	u32 gicv_idx;
-	struct resource vcpu_res;
 	struct vgic_params *vgic = &vgic_v3_params;
+	const struct resource *vcpu_res = &gic_kvm_info->vcpu;
 
-	vgic->maint_irq = irq_of_parse_and_map(vgic_node, 0);
-	if (!vgic->maint_irq) {
-		kvm_err("error getting vgic maintenance irq from DT\n");
-		ret = -ENXIO;
-		goto out;
-	}
+	vgic->maint_irq = gic_kvm_info->maint_irq;
 
 	ich_vtr_el2 = kvm_call_hyp(__vgic_v3_get_ich_vtr_el2);
 
@@ -256,24 +248,19 @@ int vgic_v3_probe(struct device_node *vgic_node,
 	vgic->nr_lr = (ich_vtr_el2 & 0xf) + 1;
 	vgic->can_emulate_gicv2 = false;
 
-	if (of_property_read_u32(vgic_node, "#redistributor-regions", &gicv_idx))
-		gicv_idx = 1;
-
-	gicv_idx += 3; /* Also skip GICD, GICC, GICH */
-	if (of_address_to_resource(vgic_node, gicv_idx, &vcpu_res)) {
+	if (!vcpu_res->start) {
 		kvm_info("GICv3: no GICV resource entry\n");
 		vgic->vcpu_base = 0;
-	} else if (!PAGE_ALIGNED(vcpu_res.start)) {
+	} else if (!PAGE_ALIGNED(vcpu_res->start)) {
 		pr_warn("GICV physical address 0x%llx not page aligned\n",
-			(unsigned long long)vcpu_res.start);
+			(unsigned long long)vcpu_res->start);
 		vgic->vcpu_base = 0;
-	} else if (!PAGE_ALIGNED(resource_size(&vcpu_res))) {
+	} else if (!PAGE_ALIGNED(resource_size(vcpu_res))) {
 		pr_warn("GICV size 0x%llx not a multiple of page size 0x%lx\n",
-			(unsigned long long)resource_size(&vcpu_res),
+			(unsigned long long)resource_size(vcpu_res),
 			PAGE_SIZE);
-		vgic->vcpu_base = 0;
 	} else {
-		vgic->vcpu_base = vcpu_res.start;
+		vgic->vcpu_base = vcpu_res->start;
 		vgic->can_emulate_gicv2 = true;
 		kvm_register_device_ops(&kvm_arm_vgic_v2_ops,
 					KVM_DEV_TYPE_ARM_VGIC_V2);
@@ -286,15 +273,13 @@ int vgic_v3_probe(struct device_node *vgic_node,
 	vgic->type = VGIC_V3;
 	vgic->max_gic_vcpus = VGIC_V3_MAX_CPUS;
 
-	kvm_info("%s@%llx IRQ%d\n", vgic_node->name,
-		 vcpu_res.start, vgic->maint_irq);
+	kvm_info("GICV base=0x%llx, IRQ=%d\n",
+		 vgic->vcpu_base, vgic->maint_irq);
 
 	on_each_cpu(vgic_cpu_init_lrs, vgic, 1);
 
 	*ops = &vgic_v3_ops;
 	*params = vgic;
 
-out:
-	of_node_put(vgic_node);
 	return ret;
 }
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index 00429b3..60668a7 100644
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -21,9 +21,7 @@
 #include <linux/kvm_host.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
+#include <linux/irq.h>
 #include <linux/rculist.h>
 #include <linux/uaccess.h>
 
@@ -33,6 +31,7 @@
 #include <trace/events/kvm.h>
 #include <asm/kvm.h>
 #include <kvm/iodev.h>
+#include <linux/irqchip/arm-gic-common.h>
 
 #define CREATE_TRACE_POINTS
 #include "trace.h"
@@ -2389,33 +2388,38 @@ static struct notifier_block vgic_cpu_nb = {
 	.notifier_call = vgic_cpu_notify,
 };
 
-static const struct of_device_id vgic_ids[] = {
-	{ .compatible = "arm,cortex-a15-gic",	.data = vgic_v2_probe, },
-	{ .compatible = "arm,cortex-a7-gic",	.data = vgic_v2_probe, },
-	{ .compatible = "arm,gic-400",		.data = vgic_v2_probe, },
-	{ .compatible = "arm,gic-v3",		.data = vgic_v3_probe, },
-	{},
-};
-
-int kvm_vgic_hyp_init(void)
+static int kvm_vgic_probe(void)
 {
-	const struct of_device_id *matched_id;
-	const int (*vgic_probe)(struct device_node *,const struct vgic_ops **,
-				const struct vgic_params **);
-	struct device_node *vgic_node;
+	const struct gic_kvm_info *gic_kvm_info;
 	int ret;
 
-	vgic_node = of_find_matching_node_and_match(NULL,
-						    vgic_ids, &matched_id);
-	if (!vgic_node) {
-		kvm_err("error: no compatible GIC node found\n");
+	gic_kvm_info = gic_get_kvm_info();
+	if (!gic_kvm_info)
 		return -ENODEV;
+
+	switch (gic_kvm_info->type) {
+	case GIC_V2:
+		ret = vgic_v2_probe(gic_kvm_info, &vgic_ops, &vgic);
+		break;
+	case GIC_V3:
+		ret = vgic_v3_probe(gic_kvm_info, &vgic_ops, &vgic);
+		break;
+	default:
+		ret = -ENODEV;
 	}
 
-	vgic_probe = matched_id->data;
-	ret = vgic_probe(vgic_node, &vgic_ops, &vgic);
-	if (ret)
+	return ret;
+}
+
+int kvm_vgic_hyp_init(void)
+{
+	int ret;
+
+	ret = kvm_vgic_probe();
+	if (ret) {
+		kvm_err("error: KVM vGIC probing failed\n");
 		return ret;
+	}
 
 	ret = request_percpu_irq(vgic->maint_irq, vgic_maintenance_handler,
 				 "vgic", kvm_get_running_vcpus());
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 27/29] KVM: arm/arm64: vgic: Rely on the GIC driver to parse the firmware tables
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julien Grall <julien.grall@arm.com>

Currently, the firmware tables are parsed 2 times: once in the GIC
drivers, the other time when initializing the vGIC. It means code
duplication and make more tedious to add the support for another
firmware table (like ACPI).

Use the recently introduced helper gic_get_kvm_info() to get
information about the virtual GIC.

With this change, the virtual GIC becomes agnostic to the firmware
table and KVM will be able to initialize the vGIC on ACPI.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 include/kvm/arm_vgic.h |  7 +++---
 virt/kvm/arm/vgic-v2.c | 61 +++++++++++++++++++++-----------------------------
 virt/kvm/arm/vgic-v3.c | 47 +++++++++++++-------------------------
 virt/kvm/arm/vgic.c    | 50 ++++++++++++++++++++++-------------------
 4 files changed, 73 insertions(+), 92 deletions(-)

diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 281caf8..be6037a 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -25,6 +25,7 @@
 #include <linux/spinlock.h>
 #include <linux/types.h>
 #include <kvm/iodev.h>
+#include <linux/irqchip/arm-gic-common.h>
 
 #define VGIC_NR_IRQS_LEGACY	256
 #define VGIC_NR_SGIS		16
@@ -353,15 +354,15 @@ bool kvm_vgic_map_is_active(struct kvm_vcpu *vcpu, struct irq_phys_map *map);
 #define vgic_initialized(k)	(!!((k)->arch.vgic.nr_cpus))
 #define vgic_ready(k)		((k)->arch.vgic.ready)
 
-int vgic_v2_probe(struct device_node *vgic_node,
+int vgic_v2_probe(const struct gic_kvm_info *gic_kvm_info,
 		  const struct vgic_ops **ops,
 		  const struct vgic_params **params);
 #ifdef CONFIG_KVM_ARM_VGIC_V3
-int vgic_v3_probe(struct device_node *vgic_node,
+int vgic_v3_probe(const struct gic_kvm_info *gic_kvm_info,
 		  const struct vgic_ops **ops,
 		  const struct vgic_params **params);
 #else
-static inline int vgic_v3_probe(struct device_node *vgic_node,
+static inline int vgic_v3_probe(const struct gic_kvm_info *gic_kvm_info,
 				const struct vgic_ops **ops,
 				const struct vgic_params **params)
 {
diff --git a/virt/kvm/arm/vgic-v2.c b/virt/kvm/arm/vgic-v2.c
index 67ec334..7e826c9 100644
--- a/virt/kvm/arm/vgic-v2.c
+++ b/virt/kvm/arm/vgic-v2.c
@@ -20,9 +20,6 @@
 #include <linux/kvm_host.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
 
 #include <linux/irqchip/arm-gic.h>
 
@@ -186,38 +183,39 @@ static void vgic_cpu_init_lrs(void *params)
 }
 
 /**
- * vgic_v2_probe - probe for a GICv2 compatible interrupt controller in DT
- * @node:	pointer to the DT node
- * @ops: 	address of a pointer to the GICv2 operations
- * @params:	address of a pointer to HW-specific parameters
+ * vgic_v2_probe - probe for a GICv2 compatible interrupt controller
+ * @gic_kvm_info:	pointer to the GIC description
+ * @ops:		address of a pointer to the GICv2 operations
+ * @params:		address of a pointer to HW-specific parameters
  *
  * Returns 0 if a GICv2 has been found, with the low level operations
  * in *ops and the HW parameters in *params. Returns an error code
  * otherwise.
  */
-int vgic_v2_probe(struct device_node *vgic_node,
-		  const struct vgic_ops **ops,
-		  const struct vgic_params **params)
+int vgic_v2_probe(const struct gic_kvm_info *gic_kvm_info,
+		   const struct vgic_ops **ops,
+		   const struct vgic_params **params)
 {
 	int ret;
-	struct resource vctrl_res;
-	struct resource vcpu_res;
 	struct vgic_params *vgic = &vgic_v2_params;
+	const struct resource *vctrl_res = &gic_kvm_info->vctrl;
+	const struct resource *vcpu_res = &gic_kvm_info->vcpu;
 
-	vgic->maint_irq = irq_of_parse_and_map(vgic_node, 0);
-	if (!vgic->maint_irq) {
-		kvm_err("error getting vgic maintenance irq from DT\n");
+	if (!gic_kvm_info->maint_irq) {
+		kvm_err("error getting vgic maintenance irq\n");
 		ret = -ENXIO;
 		goto out;
 	}
+	vgic->maint_irq = gic_kvm_info->maint_irq;
 
-	ret = of_address_to_resource(vgic_node, 2, &vctrl_res);
-	if (ret) {
-		kvm_err("Cannot obtain GICH resource\n");
+	if (!gic_kvm_info->vctrl.start) {
+		kvm_err("GICH not present in the firmware table\n");
+		ret = -ENXIO;
 		goto out;
 	}
 
-	vgic->vctrl_base = of_iomap(vgic_node, 2);
+	vgic->vctrl_base = ioremap(gic_kvm_info->vctrl.start,
+				   resource_size(&gic_kvm_info->vctrl));
 	if (!vgic->vctrl_base) {
 		kvm_err("Cannot ioremap GICH\n");
 		ret = -ENOMEM;
@@ -228,29 +226,23 @@ int vgic_v2_probe(struct device_node *vgic_node,
 	vgic->nr_lr = (vgic->nr_lr & 0x3f) + 1;
 
 	ret = create_hyp_io_mappings(vgic->vctrl_base,
-				     vgic->vctrl_base + resource_size(&vctrl_res),
-				     vctrl_res.start);
+				     vgic->vctrl_base + resource_size(vctrl_res),
+				     vctrl_res->start);
 	if (ret) {
 		kvm_err("Cannot map VCTRL into hyp\n");
 		goto out_unmap;
 	}
 
-	if (of_address_to_resource(vgic_node, 3, &vcpu_res)) {
-		kvm_err("Cannot obtain GICV resource\n");
-		ret = -ENXIO;
-		goto out_unmap;
-	}
-
-	if (!PAGE_ALIGNED(vcpu_res.start)) {
+	if (!PAGE_ALIGNED(vcpu_res->start)) {
 		kvm_err("GICV physical address 0x%llx not page aligned\n",
-			(unsigned long long)vcpu_res.start);
+			(unsigned long long)vcpu_res->start);
 		ret = -ENXIO;
 		goto out_unmap;
 	}
 
-	if (!PAGE_ALIGNED(resource_size(&vcpu_res))) {
+	if (!PAGE_ALIGNED(resource_size(vcpu_res))) {
 		kvm_err("GICV size 0x%llx not a multiple of page size 0x%lx\n",
-			(unsigned long long)resource_size(&vcpu_res),
+			(unsigned long long)resource_size(vcpu_res),
 			PAGE_SIZE);
 		ret = -ENXIO;
 		goto out_unmap;
@@ -259,10 +251,10 @@ int vgic_v2_probe(struct device_node *vgic_node,
 	vgic->can_emulate_gicv2 = true;
 	kvm_register_device_ops(&kvm_arm_vgic_v2_ops, KVM_DEV_TYPE_ARM_VGIC_V2);
 
-	vgic->vcpu_base = vcpu_res.start;
+	vgic->vcpu_base = vcpu_res->start;
 
-	kvm_info("%s@%llx IRQ%d\n", vgic_node->name,
-		 vctrl_res.start, vgic->maint_irq);
+	kvm_info("GICH base=0x%llx, GICV base=0x%llx, IRQ=%d\n",
+		 gic_kvm_info->vctrl.start, vgic->vcpu_base, vgic->maint_irq);
 
 	vgic->type = VGIC_V2;
 	vgic->max_gic_vcpus = VGIC_V2_MAX_CPUS;
@@ -276,6 +268,5 @@ int vgic_v2_probe(struct device_node *vgic_node,
 out_unmap:
 	iounmap(vgic->vctrl_base);
 out:
-	of_node_put(vgic_node);
 	return ret;
 }
diff --git a/virt/kvm/arm/vgic-v3.c b/virt/kvm/arm/vgic-v3.c
index 999bdc6..c02a1b1 100644
--- a/virt/kvm/arm/vgic-v3.c
+++ b/virt/kvm/arm/vgic-v3.c
@@ -20,11 +20,9 @@
 #include <linux/kvm_host.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
 
 #include <linux/irqchip/arm-gic-v3.h>
+#include <linux/irqchip/arm-gic-common.h>
 
 #include <asm/kvm_emulate.h>
 #include <asm/kvm_arm.h>
@@ -222,30 +220,24 @@ static void vgic_cpu_init_lrs(void *params)
 }
 
 /**
- * vgic_v3_probe - probe for a GICv3 compatible interrupt controller in DT
- * @node:	pointer to the DT node
- * @ops: 	address of a pointer to the GICv3 operations
- * @params:	address of a pointer to HW-specific parameters
+ * vgic_v3_probe - probe for a GICv3 compatible interrupt controller
+ * @gic_kvm_info:	pointer to the GIC description
+ * @ops:		address of a pointer to the GICv3 operations
+ * @params:		address of a pointer to HW-specific parameters
  *
  * Returns 0 if a GICv3 has been found, with the low level operations
  * in *ops and the HW parameters in *params. Returns an error code
  * otherwise.
  */
-int vgic_v3_probe(struct device_node *vgic_node,
+int vgic_v3_probe(const struct gic_kvm_info *gic_kvm_info,
 		  const struct vgic_ops **ops,
 		  const struct vgic_params **params)
 {
 	int ret = 0;
-	u32 gicv_idx;
-	struct resource vcpu_res;
 	struct vgic_params *vgic = &vgic_v3_params;
+	const struct resource *vcpu_res = &gic_kvm_info->vcpu;
 
-	vgic->maint_irq = irq_of_parse_and_map(vgic_node, 0);
-	if (!vgic->maint_irq) {
-		kvm_err("error getting vgic maintenance irq from DT\n");
-		ret = -ENXIO;
-		goto out;
-	}
+	vgic->maint_irq = gic_kvm_info->maint_irq;
 
 	ich_vtr_el2 = kvm_call_hyp(__vgic_v3_get_ich_vtr_el2);
 
@@ -256,24 +248,19 @@ int vgic_v3_probe(struct device_node *vgic_node,
 	vgic->nr_lr = (ich_vtr_el2 & 0xf) + 1;
 	vgic->can_emulate_gicv2 = false;
 
-	if (of_property_read_u32(vgic_node, "#redistributor-regions", &gicv_idx))
-		gicv_idx = 1;
-
-	gicv_idx += 3; /* Also skip GICD, GICC, GICH */
-	if (of_address_to_resource(vgic_node, gicv_idx, &vcpu_res)) {
+	if (!vcpu_res->start) {
 		kvm_info("GICv3: no GICV resource entry\n");
 		vgic->vcpu_base = 0;
-	} else if (!PAGE_ALIGNED(vcpu_res.start)) {
+	} else if (!PAGE_ALIGNED(vcpu_res->start)) {
 		pr_warn("GICV physical address 0x%llx not page aligned\n",
-			(unsigned long long)vcpu_res.start);
+			(unsigned long long)vcpu_res->start);
 		vgic->vcpu_base = 0;
-	} else if (!PAGE_ALIGNED(resource_size(&vcpu_res))) {
+	} else if (!PAGE_ALIGNED(resource_size(vcpu_res))) {
 		pr_warn("GICV size 0x%llx not a multiple of page size 0x%lx\n",
-			(unsigned long long)resource_size(&vcpu_res),
+			(unsigned long long)resource_size(vcpu_res),
 			PAGE_SIZE);
-		vgic->vcpu_base = 0;
 	} else {
-		vgic->vcpu_base = vcpu_res.start;
+		vgic->vcpu_base = vcpu_res->start;
 		vgic->can_emulate_gicv2 = true;
 		kvm_register_device_ops(&kvm_arm_vgic_v2_ops,
 					KVM_DEV_TYPE_ARM_VGIC_V2);
@@ -286,15 +273,13 @@ int vgic_v3_probe(struct device_node *vgic_node,
 	vgic->type = VGIC_V3;
 	vgic->max_gic_vcpus = VGIC_V3_MAX_CPUS;
 
-	kvm_info("%s@%llx IRQ%d\n", vgic_node->name,
-		 vcpu_res.start, vgic->maint_irq);
+	kvm_info("GICV base=0x%llx, IRQ=%d\n",
+		 vgic->vcpu_base, vgic->maint_irq);
 
 	on_each_cpu(vgic_cpu_init_lrs, vgic, 1);
 
 	*ops = &vgic_v3_ops;
 	*params = vgic;
 
-out:
-	of_node_put(vgic_node);
 	return ret;
 }
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index 00429b3..60668a7 100644
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -21,9 +21,7 @@
 #include <linux/kvm_host.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
+#include <linux/irq.h>
 #include <linux/rculist.h>
 #include <linux/uaccess.h>
 
@@ -33,6 +31,7 @@
 #include <trace/events/kvm.h>
 #include <asm/kvm.h>
 #include <kvm/iodev.h>
+#include <linux/irqchip/arm-gic-common.h>
 
 #define CREATE_TRACE_POINTS
 #include "trace.h"
@@ -2389,33 +2388,38 @@ static struct notifier_block vgic_cpu_nb = {
 	.notifier_call = vgic_cpu_notify,
 };
 
-static const struct of_device_id vgic_ids[] = {
-	{ .compatible = "arm,cortex-a15-gic",	.data = vgic_v2_probe, },
-	{ .compatible = "arm,cortex-a7-gic",	.data = vgic_v2_probe, },
-	{ .compatible = "arm,gic-400",		.data = vgic_v2_probe, },
-	{ .compatible = "arm,gic-v3",		.data = vgic_v3_probe, },
-	{},
-};
-
-int kvm_vgic_hyp_init(void)
+static int kvm_vgic_probe(void)
 {
-	const struct of_device_id *matched_id;
-	const int (*vgic_probe)(struct device_node *,const struct vgic_ops **,
-				const struct vgic_params **);
-	struct device_node *vgic_node;
+	const struct gic_kvm_info *gic_kvm_info;
 	int ret;
 
-	vgic_node = of_find_matching_node_and_match(NULL,
-						    vgic_ids, &matched_id);
-	if (!vgic_node) {
-		kvm_err("error: no compatible GIC node found\n");
+	gic_kvm_info = gic_get_kvm_info();
+	if (!gic_kvm_info)
 		return -ENODEV;
+
+	switch (gic_kvm_info->type) {
+	case GIC_V2:
+		ret = vgic_v2_probe(gic_kvm_info, &vgic_ops, &vgic);
+		break;
+	case GIC_V3:
+		ret = vgic_v3_probe(gic_kvm_info, &vgic_ops, &vgic);
+		break;
+	default:
+		ret = -ENODEV;
 	}
 
-	vgic_probe = matched_id->data;
-	ret = vgic_probe(vgic_node, &vgic_ops, &vgic);
-	if (ret)
+	return ret;
+}
+
+int kvm_vgic_hyp_init(void)
+{
+	int ret;
+
+	ret = kvm_vgic_probe();
+	if (ret) {
+		kvm_err("error: KVM vGIC probing failed\n");
 		return ret;
+	}
 
 	ret = request_percpu_irq(vgic->maint_irq, vgic_maintenance_handler,
 				 "vgic", kvm_get_running_vcpus());
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 28/29] clocksource: arm_arch_timer: Remove arch_timer_get_timecounter
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvm, Marc Zyngier, linux-arm-kernel, kvmarm

From: Julien Grall <julien.grall@arm.com>

The only call of arch_timer_get_timecounter (in KVM) has been removed.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/clocksource/arm_arch_timer.c | 5 -----
 include/clocksource/arm_arch_timer.h | 6 ------
 2 files changed, 11 deletions(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index bb58224..4814446 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -475,11 +475,6 @@ struct arch_timer_kvm_info *arch_timer_get_kvm_info(void)
 	return &arch_timer_kvm_info;
 }
 
-struct timecounter *arch_timer_get_timecounter(void)
-{
-	return &arch_timer_kvm_info.timecounter;
-}
-
 static void __init arch_counter_register(unsigned type)
 {
 	u64 start_count;
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index 9dd996a..caedb74 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -58,7 +58,6 @@ struct arch_timer_kvm_info {
 
 extern u32 arch_timer_get_rate(void);
 extern u64 (*arch_timer_read_counter)(void);
-extern struct timecounter *arch_timer_get_timecounter(void);
 extern struct arch_timer_kvm_info *arch_timer_get_kvm_info(void);
 
 #else
@@ -73,11 +72,6 @@ static inline u64 arch_timer_read_counter(void)
 	return 0;
 }
 
-static inline struct timecounter *arch_timer_get_timecounter(void)
-{
-	return NULL;
-}
-
 #endif
 
 #endif
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 28/29] clocksource: arm_arch_timer: Remove arch_timer_get_timecounter
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julien Grall <julien.grall@arm.com>

The only call of arch_timer_get_timecounter (in KVM) has been removed.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 drivers/clocksource/arm_arch_timer.c | 5 -----
 include/clocksource/arm_arch_timer.h | 6 ------
 2 files changed, 11 deletions(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index bb58224..4814446 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -475,11 +475,6 @@ struct arch_timer_kvm_info *arch_timer_get_kvm_info(void)
 	return &arch_timer_kvm_info;
 }
 
-struct timecounter *arch_timer_get_timecounter(void)
-{
-	return &arch_timer_kvm_info.timecounter;
-}
-
 static void __init arch_counter_register(unsigned type)
 {
 	u64 start_count;
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index 9dd996a..caedb74 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -58,7 +58,6 @@ struct arch_timer_kvm_info {
 
 extern u32 arch_timer_get_rate(void);
 extern u64 (*arch_timer_read_counter)(void);
-extern struct timecounter *arch_timer_get_timecounter(void);
 extern struct arch_timer_kvm_info *arch_timer_get_kvm_info(void);
 
 #else
@@ -73,11 +72,6 @@ static inline u64 arch_timer_read_counter(void)
 	return 0;
 }
 
-static inline struct timecounter *arch_timer_get_timecounter(void)
-{
-	return NULL;
-}
-
 #endif
 
 #endif
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 29/29] kvm: arm64: Enable hardware updates of the Access Flag for Stage 2 page tables
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 13:30   ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier, Catalin Marinas,
	Christoffer Dall

From: Catalin Marinas <catalin.marinas@arm.com>

The ARMv8.1 architecture extensions introduce support for hardware
updates of the access and dirty information in page table entries. With
VTCR_EL2.HA enabled (bit 21), when the CPU accesses an IPA with the
PTE_AF bit cleared in the stage 2 page table, instead of raising an
Access Flag fault to EL2 the CPU sets the actual page table entry bit
(10). To ensure that kernel modifications to the page table do not
inadvertently revert a bit set by hardware updates, certain Stage 2
software pte/pmd operations must be performed atomically.

The main user of the AF bit is the kvm_age_hva() mechanism. The
kvm_age_hva_handler() function performs a "test and clear young" action
on the pte/pmd. This needs to be atomic in respect of automatic hardware
updates of the AF bit. Since the AF bit is in the same position for both
Stage 1 and Stage 2, the patch reuses the existing
ptep_test_and_clear_young() functionality if
__HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG is defined. Otherwise, the
existing pte_young/pte_mkold mechanism is preserved.

The kvm_set_s2pte_readonly() (and the corresponding pmd equivalent) have
to perform atomic modifications in order to avoid a race with updates of
the AF bit. The arm64 implementation has been re-written using
exclusives.

Currently, kvm_set_s2pte_writable() (and pmd equivalent) take a pointer
argument and modify the pte/pmd in place. However, these functions are
only used on local variables rather than actual page table entries, so
it makes more sense to follow the pte_mkwrite() approach for stage 1
attributes. The change to kvm_s2pte_mkwrite() makes it clear that these
functions do not modify the actual page table entries.

The (pte|pmd)_mkyoung() uses on Stage 2 entries (setting the AF bit
explicitly) do not need to be modified since hardware updates of the
dirty status are not supported by KVM, so there is no possibility of
losing such information.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 arch/arm/include/asm/kvm_mmu.h   | 10 +++++----
 arch/arm/kvm/mmu.c               | 46 +++++++++++++++++++++++++---------------
 arch/arm64/include/asm/kvm_arm.h |  2 ++
 arch/arm64/include/asm/kvm_mmu.h | 27 +++++++++++++++++------
 arch/arm64/include/asm/pgtable.h | 13 ++++++++----
 arch/arm64/kvm/hyp/s2-setup.c    |  8 +++++++
 6 files changed, 74 insertions(+), 32 deletions(-)

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index 6344ea0..ef0b276 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -106,14 +106,16 @@ static inline void kvm_clean_pte(pte_t *pte)
 	clean_pte_table(pte);
 }
 
-static inline void kvm_set_s2pte_writable(pte_t *pte)
+static inline pte_t kvm_s2pte_mkwrite(pte_t pte)
 {
-	pte_val(*pte) |= L_PTE_S2_RDWR;
+	pte_val(pte) |= L_PTE_S2_RDWR;
+	return pte;
 }
 
-static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
+static inline pmd_t kvm_s2pmd_mkwrite(pmd_t pmd)
 {
-	pmd_val(*pmd) |= L_PMD_S2_RDWR;
+	pmd_val(pmd) |= L_PMD_S2_RDWR;
+	return pmd;
 }
 
 static inline void kvm_set_s2pte_readonly(pte_t *pte)
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 74b5d19..783e5ff 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -977,6 +977,27 @@ static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
 	return 0;
 }
 
+#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+static int stage2_ptep_test_and_clear_young(pte_t *pte)
+{
+	if (pte_young(*pte)) {
+		*pte = pte_mkold(*pte);
+		return 1;
+	}
+	return 0;
+}
+#else
+static int stage2_ptep_test_and_clear_young(pte_t *pte)
+{
+	return __ptep_test_and_clear_young(pte);
+}
+#endif
+
+static int stage2_pmdp_test_and_clear_young(pmd_t *pmd)
+{
+	return stage2_ptep_test_and_clear_young((pte_t *)pmd);
+}
+
 /**
  * kvm_phys_addr_ioremap - map a device range to guest IPA
  *
@@ -1000,7 +1021,7 @@ int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa,
 		pte_t pte = pfn_pte(pfn, PAGE_S2_DEVICE);
 
 		if (writable)
-			kvm_set_s2pte_writable(&pte);
+			pte = kvm_s2pte_mkwrite(pte);
 
 		ret = mmu_topup_memory_cache(&cache, KVM_MMU_CACHE_MIN_PAGES,
 						KVM_NR_MEM_OBJS);
@@ -1342,7 +1363,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 		pmd_t new_pmd = pfn_pmd(pfn, mem_type);
 		new_pmd = pmd_mkhuge(new_pmd);
 		if (writable) {
-			kvm_set_s2pmd_writable(&new_pmd);
+			new_pmd = kvm_s2pmd_mkwrite(new_pmd);
 			kvm_set_pfn_dirty(pfn);
 		}
 		coherent_cache_guest_page(vcpu, pfn, PMD_SIZE, fault_ipa_uncached);
@@ -1351,7 +1372,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 		pte_t new_pte = pfn_pte(pfn, mem_type);
 
 		if (writable) {
-			kvm_set_s2pte_writable(&new_pte);
+			new_pte = kvm_s2pte_mkwrite(new_pte);
 			kvm_set_pfn_dirty(pfn);
 			mark_page_dirty(kvm, gfn);
 		}
@@ -1370,6 +1391,8 @@ out_unlock:
  * Resolve the access fault by making the page young again.
  * Note that because the faulting entry is guaranteed not to be
  * cached in the TLB, we don't need to invalidate anything.
+ * Only the HW Access Flag updates are supported for Stage 2 (no DBM),
+ * so there is no need for atomic (pte|pmd)_mkyoung operations.
  */
 static void handle_access_fault(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa)
 {
@@ -1610,25 +1633,14 @@ static int kvm_age_hva_handler(struct kvm *kvm, gpa_t gpa, void *data)
 	if (!pmd || pmd_none(*pmd))	/* Nothing there */
 		return 0;
 
-	if (pmd_thp_or_huge(*pmd)) {	/* THP, HugeTLB */
-		if (pmd_young(*pmd)) {
-			*pmd = pmd_mkold(*pmd);
-			return 1;
-		}
-
-		return 0;
-	}
+	if (pmd_thp_or_huge(*pmd))	/* THP, HugeTLB */
+		return stage2_pmdp_test_and_clear_young(pmd);
 
 	pte = pte_offset_kernel(pmd, gpa);
 	if (pte_none(*pte))
 		return 0;
 
-	if (pte_young(*pte)) {
-		*pte = pte_mkold(*pte);	/* Just a page... */
-		return 1;
-	}
-
-	return 0;
+	return stage2_ptep_test_and_clear_young(pte);
 }
 
 static int kvm_test_age_hva_handler(struct kvm *kvm, gpa_t gpa, void *data)
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index c6cbb36..ffde15f 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -111,6 +111,8 @@
 
 /* VTCR_EL2 Registers bits */
 #define VTCR_EL2_RES1		(1 << 31)
+#define VTCR_EL2_HD		(1 << 22)
+#define VTCR_EL2_HA		(1 << 21)
 #define VTCR_EL2_PS_MASK	TCR_EL2_PS_MASK
 #define VTCR_EL2_TG0_MASK	TCR_TG0_MASK
 #define VTCR_EL2_TG0_4K		TCR_TG0_4K
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 249c4fc..844fe5d 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -111,19 +111,32 @@ static inline void kvm_clean_pmd_entry(pmd_t *pmd) {}
 static inline void kvm_clean_pte(pte_t *pte) {}
 static inline void kvm_clean_pte_entry(pte_t *pte) {}
 
-static inline void kvm_set_s2pte_writable(pte_t *pte)
+static inline pte_t kvm_s2pte_mkwrite(pte_t pte)
 {
-	pte_val(*pte) |= PTE_S2_RDWR;
+	pte_val(pte) |= PTE_S2_RDWR;
+	return pte;
 }
 
-static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
+static inline pmd_t kvm_s2pmd_mkwrite(pmd_t pmd)
 {
-	pmd_val(*pmd) |= PMD_S2_RDWR;
+	pmd_val(pmd) |= PMD_S2_RDWR;
+	return pmd;
 }
 
 static inline void kvm_set_s2pte_readonly(pte_t *pte)
 {
-	pte_val(*pte) = (pte_val(*pte) & ~PTE_S2_RDWR) | PTE_S2_RDONLY;
+	pteval_t pteval;
+	unsigned long tmp;
+
+	asm volatile("//	kvm_set_s2pte_readonly\n"
+	"	prfm	pstl1strm, %2\n"
+	"1:	ldxr	%0, %2\n"
+	"	and	%0, %0, %3		// clear PTE_S2_RDWR\n"
+	"	orr	%0, %0, %4		// set PTE_S2_RDONLY\n"
+	"	stxr	%w1, %0, %2\n"
+	"	cbnz	%w1, 1b\n"
+	: "=&r" (pteval), "=&r" (tmp), "+Q" (pte_val(*pte))
+	: "L" (~PTE_S2_RDWR), "L" (PTE_S2_RDONLY));
 }
 
 static inline bool kvm_s2pte_readonly(pte_t *pte)
@@ -133,12 +146,12 @@ static inline bool kvm_s2pte_readonly(pte_t *pte)
 
 static inline void kvm_set_s2pmd_readonly(pmd_t *pmd)
 {
-	pmd_val(*pmd) = (pmd_val(*pmd) & ~PMD_S2_RDWR) | PMD_S2_RDONLY;
+	kvm_set_s2pte_readonly((pte_t *)pmd);
 }
 
 static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 {
-	return (pmd_val(*pmd) & PMD_S2_RDWR) == PMD_S2_RDONLY;
+	return kvm_s2pte_readonly((pte_t *)pmd);
 }
 
 static inline bool kvm_page_empty(void *ptr)
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index dda4aa9..f1d5afd 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -532,14 +532,12 @@ static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
  * Atomic pte/pmd modifications.
  */
 #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
-static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
-					    unsigned long address,
-					    pte_t *ptep)
+static inline int __ptep_test_and_clear_young(pte_t *ptep)
 {
 	pteval_t pteval;
 	unsigned int tmp, res;
 
-	asm volatile("//	ptep_test_and_clear_young\n"
+	asm volatile("//	__ptep_test_and_clear_young\n"
 	"	prfm	pstl1strm, %2\n"
 	"1:	ldxr	%0, %2\n"
 	"	ubfx	%w3, %w0, %5, #1	// extract PTE_AF (young)\n"
@@ -552,6 +550,13 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
 	return res;
 }
 
+static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
+					    unsigned long address,
+					    pte_t *ptep)
+{
+	return __ptep_test_and_clear_young(ptep);
+}
+
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 #define __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG
 static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
diff --git a/arch/arm64/kvm/hyp/s2-setup.c b/arch/arm64/kvm/hyp/s2-setup.c
index bcbe761..b81f409 100644
--- a/arch/arm64/kvm/hyp/s2-setup.c
+++ b/arch/arm64/kvm/hyp/s2-setup.c
@@ -66,6 +66,14 @@ u32 __hyp_text __init_stage2_translation(void)
 	val |= 64 - (parange > 40 ? 40 : parange);
 
 	/*
+	 * Check the availability of Hardware Access Flag / Dirty Bit
+	 * Management in ID_AA64MMFR1_EL1 and enable the feature in VTCR_EL2.
+	 */
+	tmp = (read_sysreg(id_aa64mmfr1_el1) >> ID_AA64MMFR1_HADBS_SHIFT) & 0xf;
+	if (IS_ENABLED(CONFIG_ARM64_HW_AFDBM) && tmp)
+		val |= VTCR_EL2_HA;
+
+	/*
 	 * Read the VMIDBits bits from ID_AA64MMFR1_EL1 and set the VS
 	 * bit in VTCR_EL2.
 	 */
-- 
2.1.2.330.g565301e.dirty


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PULL 29/29] kvm: arm64: Enable hardware updates of the Access Flag for Stage 2 page tables
@ 2016-05-11 13:30   ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Catalin Marinas <catalin.marinas@arm.com>

The ARMv8.1 architecture extensions introduce support for hardware
updates of the access and dirty information in page table entries. With
VTCR_EL2.HA enabled (bit 21), when the CPU accesses an IPA with the
PTE_AF bit cleared in the stage 2 page table, instead of raising an
Access Flag fault to EL2 the CPU sets the actual page table entry bit
(10). To ensure that kernel modifications to the page table do not
inadvertently revert a bit set by hardware updates, certain Stage 2
software pte/pmd operations must be performed atomically.

The main user of the AF bit is the kvm_age_hva() mechanism. The
kvm_age_hva_handler() function performs a "test and clear young" action
on the pte/pmd. This needs to be atomic in respect of automatic hardware
updates of the AF bit. Since the AF bit is in the same position for both
Stage 1 and Stage 2, the patch reuses the existing
ptep_test_and_clear_young() functionality if
__HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG is defined. Otherwise, the
existing pte_young/pte_mkold mechanism is preserved.

The kvm_set_s2pte_readonly() (and the corresponding pmd equivalent) have
to perform atomic modifications in order to avoid a race with updates of
the AF bit. The arm64 implementation has been re-written using
exclusives.

Currently, kvm_set_s2pte_writable() (and pmd equivalent) take a pointer
argument and modify the pte/pmd in place. However, these functions are
only used on local variables rather than actual page table entries, so
it makes more sense to follow the pte_mkwrite() approach for stage 1
attributes. The change to kvm_s2pte_mkwrite() makes it clear that these
functions do not modify the actual page table entries.

The (pte|pmd)_mkyoung() uses on Stage 2 entries (setting the AF bit
explicitly) do not need to be modified since hardware updates of the
dirty status are not supported by KVM, so there is no possibility of
losing such information.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 arch/arm/include/asm/kvm_mmu.h   | 10 +++++----
 arch/arm/kvm/mmu.c               | 46 +++++++++++++++++++++++++---------------
 arch/arm64/include/asm/kvm_arm.h |  2 ++
 arch/arm64/include/asm/kvm_mmu.h | 27 +++++++++++++++++------
 arch/arm64/include/asm/pgtable.h | 13 ++++++++----
 arch/arm64/kvm/hyp/s2-setup.c    |  8 +++++++
 6 files changed, 74 insertions(+), 32 deletions(-)

diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index 6344ea0..ef0b276 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -106,14 +106,16 @@ static inline void kvm_clean_pte(pte_t *pte)
 	clean_pte_table(pte);
 }
 
-static inline void kvm_set_s2pte_writable(pte_t *pte)
+static inline pte_t kvm_s2pte_mkwrite(pte_t pte)
 {
-	pte_val(*pte) |= L_PTE_S2_RDWR;
+	pte_val(pte) |= L_PTE_S2_RDWR;
+	return pte;
 }
 
-static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
+static inline pmd_t kvm_s2pmd_mkwrite(pmd_t pmd)
 {
-	pmd_val(*pmd) |= L_PMD_S2_RDWR;
+	pmd_val(pmd) |= L_PMD_S2_RDWR;
+	return pmd;
 }
 
 static inline void kvm_set_s2pte_readonly(pte_t *pte)
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 74b5d19..783e5ff 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -977,6 +977,27 @@ static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
 	return 0;
 }
 
+#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+static int stage2_ptep_test_and_clear_young(pte_t *pte)
+{
+	if (pte_young(*pte)) {
+		*pte = pte_mkold(*pte);
+		return 1;
+	}
+	return 0;
+}
+#else
+static int stage2_ptep_test_and_clear_young(pte_t *pte)
+{
+	return __ptep_test_and_clear_young(pte);
+}
+#endif
+
+static int stage2_pmdp_test_and_clear_young(pmd_t *pmd)
+{
+	return stage2_ptep_test_and_clear_young((pte_t *)pmd);
+}
+
 /**
  * kvm_phys_addr_ioremap - map a device range to guest IPA
  *
@@ -1000,7 +1021,7 @@ int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa,
 		pte_t pte = pfn_pte(pfn, PAGE_S2_DEVICE);
 
 		if (writable)
-			kvm_set_s2pte_writable(&pte);
+			pte = kvm_s2pte_mkwrite(pte);
 
 		ret = mmu_topup_memory_cache(&cache, KVM_MMU_CACHE_MIN_PAGES,
 						KVM_NR_MEM_OBJS);
@@ -1342,7 +1363,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 		pmd_t new_pmd = pfn_pmd(pfn, mem_type);
 		new_pmd = pmd_mkhuge(new_pmd);
 		if (writable) {
-			kvm_set_s2pmd_writable(&new_pmd);
+			new_pmd = kvm_s2pmd_mkwrite(new_pmd);
 			kvm_set_pfn_dirty(pfn);
 		}
 		coherent_cache_guest_page(vcpu, pfn, PMD_SIZE, fault_ipa_uncached);
@@ -1351,7 +1372,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 		pte_t new_pte = pfn_pte(pfn, mem_type);
 
 		if (writable) {
-			kvm_set_s2pte_writable(&new_pte);
+			new_pte = kvm_s2pte_mkwrite(new_pte);
 			kvm_set_pfn_dirty(pfn);
 			mark_page_dirty(kvm, gfn);
 		}
@@ -1370,6 +1391,8 @@ out_unlock:
  * Resolve the access fault by making the page young again.
  * Note that because the faulting entry is guaranteed not to be
  * cached in the TLB, we don't need to invalidate anything.
+ * Only the HW Access Flag updates are supported for Stage 2 (no DBM),
+ * so there is no need for atomic (pte|pmd)_mkyoung operations.
  */
 static void handle_access_fault(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa)
 {
@@ -1610,25 +1633,14 @@ static int kvm_age_hva_handler(struct kvm *kvm, gpa_t gpa, void *data)
 	if (!pmd || pmd_none(*pmd))	/* Nothing there */
 		return 0;
 
-	if (pmd_thp_or_huge(*pmd)) {	/* THP, HugeTLB */
-		if (pmd_young(*pmd)) {
-			*pmd = pmd_mkold(*pmd);
-			return 1;
-		}
-
-		return 0;
-	}
+	if (pmd_thp_or_huge(*pmd))	/* THP, HugeTLB */
+		return stage2_pmdp_test_and_clear_young(pmd);
 
 	pte = pte_offset_kernel(pmd, gpa);
 	if (pte_none(*pte))
 		return 0;
 
-	if (pte_young(*pte)) {
-		*pte = pte_mkold(*pte);	/* Just a page... */
-		return 1;
-	}
-
-	return 0;
+	return stage2_ptep_test_and_clear_young(pte);
 }
 
 static int kvm_test_age_hva_handler(struct kvm *kvm, gpa_t gpa, void *data)
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index c6cbb36..ffde15f 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -111,6 +111,8 @@
 
 /* VTCR_EL2 Registers bits */
 #define VTCR_EL2_RES1		(1 << 31)
+#define VTCR_EL2_HD		(1 << 22)
+#define VTCR_EL2_HA		(1 << 21)
 #define VTCR_EL2_PS_MASK	TCR_EL2_PS_MASK
 #define VTCR_EL2_TG0_MASK	TCR_TG0_MASK
 #define VTCR_EL2_TG0_4K		TCR_TG0_4K
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 249c4fc..844fe5d 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -111,19 +111,32 @@ static inline void kvm_clean_pmd_entry(pmd_t *pmd) {}
 static inline void kvm_clean_pte(pte_t *pte) {}
 static inline void kvm_clean_pte_entry(pte_t *pte) {}
 
-static inline void kvm_set_s2pte_writable(pte_t *pte)
+static inline pte_t kvm_s2pte_mkwrite(pte_t pte)
 {
-	pte_val(*pte) |= PTE_S2_RDWR;
+	pte_val(pte) |= PTE_S2_RDWR;
+	return pte;
 }
 
-static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
+static inline pmd_t kvm_s2pmd_mkwrite(pmd_t pmd)
 {
-	pmd_val(*pmd) |= PMD_S2_RDWR;
+	pmd_val(pmd) |= PMD_S2_RDWR;
+	return pmd;
 }
 
 static inline void kvm_set_s2pte_readonly(pte_t *pte)
 {
-	pte_val(*pte) = (pte_val(*pte) & ~PTE_S2_RDWR) | PTE_S2_RDONLY;
+	pteval_t pteval;
+	unsigned long tmp;
+
+	asm volatile("//	kvm_set_s2pte_readonly\n"
+	"	prfm	pstl1strm, %2\n"
+	"1:	ldxr	%0, %2\n"
+	"	and	%0, %0, %3		// clear PTE_S2_RDWR\n"
+	"	orr	%0, %0, %4		// set PTE_S2_RDONLY\n"
+	"	stxr	%w1, %0, %2\n"
+	"	cbnz	%w1, 1b\n"
+	: "=&r" (pteval), "=&r" (tmp), "+Q" (pte_val(*pte))
+	: "L" (~PTE_S2_RDWR), "L" (PTE_S2_RDONLY));
 }
 
 static inline bool kvm_s2pte_readonly(pte_t *pte)
@@ -133,12 +146,12 @@ static inline bool kvm_s2pte_readonly(pte_t *pte)
 
 static inline void kvm_set_s2pmd_readonly(pmd_t *pmd)
 {
-	pmd_val(*pmd) = (pmd_val(*pmd) & ~PMD_S2_RDWR) | PMD_S2_RDONLY;
+	kvm_set_s2pte_readonly((pte_t *)pmd);
 }
 
 static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
 {
-	return (pmd_val(*pmd) & PMD_S2_RDWR) == PMD_S2_RDONLY;
+	return kvm_s2pte_readonly((pte_t *)pmd);
 }
 
 static inline bool kvm_page_empty(void *ptr)
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index dda4aa9..f1d5afd 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -532,14 +532,12 @@ static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
  * Atomic pte/pmd modifications.
  */
 #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
-static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
-					    unsigned long address,
-					    pte_t *ptep)
+static inline int __ptep_test_and_clear_young(pte_t *ptep)
 {
 	pteval_t pteval;
 	unsigned int tmp, res;
 
-	asm volatile("//	ptep_test_and_clear_young\n"
+	asm volatile("//	__ptep_test_and_clear_young\n"
 	"	prfm	pstl1strm, %2\n"
 	"1:	ldxr	%0, %2\n"
 	"	ubfx	%w3, %w0, %5, #1	// extract PTE_AF (young)\n"
@@ -552,6 +550,13 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
 	return res;
 }
 
+static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
+					    unsigned long address,
+					    pte_t *ptep)
+{
+	return __ptep_test_and_clear_young(ptep);
+}
+
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 #define __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG
 static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
diff --git a/arch/arm64/kvm/hyp/s2-setup.c b/arch/arm64/kvm/hyp/s2-setup.c
index bcbe761..b81f409 100644
--- a/arch/arm64/kvm/hyp/s2-setup.c
+++ b/arch/arm64/kvm/hyp/s2-setup.c
@@ -66,6 +66,14 @@ u32 __hyp_text __init_stage2_translation(void)
 	val |= 64 - (parange > 40 ? 40 : parange);
 
 	/*
+	 * Check the availability of Hardware Access Flag / Dirty Bit
+	 * Management in ID_AA64MMFR1_EL1 and enable the feature in VTCR_EL2.
+	 */
+	tmp = (read_sysreg(id_aa64mmfr1_el1) >> ID_AA64MMFR1_HADBS_SHIFT) & 0xf;
+	if (IS_ENABLED(CONFIG_ARM64_HW_AFDBM) && tmp)
+		val |= VTCR_EL2_HA;
+
+	/*
 	 * Read the VMIDBits bits from ID_AA64MMFR1_EL1 and set the VS
 	 * bit in VTCR_EL2.
 	 */
-- 
2.1.2.330.g565301e.dirty

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-11 13:29 ` Christoffer Dall
@ 2016-05-11 15:23   ` Paolo Bonzini
  -1 siblings, 0 replies; 80+ messages in thread
From: Paolo Bonzini @ 2016-05-11 15:23 UTC (permalink / raw)
  To: Christoffer Dall, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm, Marc Zyngier



On 11/05/2016 15:29, Christoffer Dall wrote:
> Hi Paolo and Radim,
> 
> Here is the initial set of changes for KVM/ARM for v4.7.
> 
> Sorry I'm a bit late with these, but we were trying to get the new vgic
> implementation in as part of this, but I have decided to send this pull
> request now, and we can follow up with another for the new VGIC,
> assuming we feel like we have that in place in a few days.

Don't worry, you're not late at all.  I've pulled this to kvm/queue.

> There are a few changes in this pull request touching things outside
> KVM, but they should all carry the necessary acks and it made the
> merge process much easier to do it this way.

The following are properly acked:

    arm64: Reuse TCR field definitions for EL1 and EL2
    arm64: Introduce pmd_thp_or_huge

I wouldn't have minded more explicit Acked-bys for the following:

    irqchip/gic-v2: Gather ACPI specific data in a single structure
    irqchip/gic-v2: Parse and export virtual GIC information
    irqchip/gic-v3: Prefix all pr_* messages by "GICv3: "
    irqchip/gic-v3: Gather all ACPI specific data in a single structure
    irqchip/gic-v3: Parse and export virtual GIC information

I guess it's fine since Marc Zyngier is maintainer for both KVM and
irqchip, still it's never wrong to get more acks. :)

Thanks,

Paolo

> Hope this works for you guys.
> 
> For a description of the content, see below; otherwise:
> 
> The following changes since commit 06a71a24bae57a07afee9cda6b00495347d8a448:
> 
>   arm64: KVM: unregister notifiers in hyp mode teardown path (2016-04-06 13:47:52 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvm-arm-for-4.7
> 
> for you to fetch changes up to 06485053244480f5f403d8f89b8617bd7d549113:
> 
>   kvm: arm64: Enable hardware updates of the Access Flag for Stage 2 page tables (2016-05-09 22:23:08 +0200)

^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PULL 00/29] KVM/ARM Changes for v4.7
@ 2016-05-11 15:23   ` Paolo Bonzini
  0 siblings, 0 replies; 80+ messages in thread
From: Paolo Bonzini @ 2016-05-11 15:23 UTC (permalink / raw)
  To: linux-arm-kernel



On 11/05/2016 15:29, Christoffer Dall wrote:
> Hi Paolo and Radim,
> 
> Here is the initial set of changes for KVM/ARM for v4.7.
> 
> Sorry I'm a bit late with these, but we were trying to get the new vgic
> implementation in as part of this, but I have decided to send this pull
> request now, and we can follow up with another for the new VGIC,
> assuming we feel like we have that in place in a few days.

Don't worry, you're not late at all.  I've pulled this to kvm/queue.

> There are a few changes in this pull request touching things outside
> KVM, but they should all carry the necessary acks and it made the
> merge process much easier to do it this way.

The following are properly acked:

    arm64: Reuse TCR field definitions for EL1 and EL2
    arm64: Introduce pmd_thp_or_huge

I wouldn't have minded more explicit Acked-bys for the following:

    irqchip/gic-v2: Gather ACPI specific data in a single structure
    irqchip/gic-v2: Parse and export virtual GIC information
    irqchip/gic-v3: Prefix all pr_* messages by "GICv3: "
    irqchip/gic-v3: Gather all ACPI specific data in a single structure
    irqchip/gic-v3: Parse and export virtual GIC information

I guess it's fine since Marc Zyngier is maintainer for both KVM and
irqchip, still it's never wrong to get more acks. :)

Thanks,

Paolo

> Hope this works for you guys.
> 
> For a description of the content, see below; otherwise:
> 
> The following changes since commit 06a71a24bae57a07afee9cda6b00495347d8a448:
> 
>   arm64: KVM: unregister notifiers in hyp mode teardown path (2016-04-06 13:47:52 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvm-arm-for-4.7
> 
> for you to fetch changes up to 06485053244480f5f403d8f89b8617bd7d549113:
> 
>   kvm: arm64: Enable hardware updates of the Access Flag for Stage 2 page tables (2016-05-09 22:23:08 +0200)

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-11 15:23   ` Paolo Bonzini
@ 2016-05-11 15:37     ` Marc Zyngier
  -1 siblings, 0 replies; 80+ messages in thread
From: Marc Zyngier @ 2016-05-11 15:37 UTC (permalink / raw)
  To: Paolo Bonzini, Christoffer Dall, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm

On 11/05/16 16:23, Paolo Bonzini wrote:
> 
> 
> On 11/05/2016 15:29, Christoffer Dall wrote:
>> Hi Paolo and Radim,
>>
>> Here is the initial set of changes for KVM/ARM for v4.7.
>>
>> Sorry I'm a bit late with these, but we were trying to get the new vgic
>> implementation in as part of this, but I have decided to send this pull
>> request now, and we can follow up with another for the new VGIC,
>> assuming we feel like we have that in place in a few days.
> 
> Don't worry, you're not late at all.  I've pulled this to kvm/queue.
> 
>> There are a few changes in this pull request touching things outside
>> KVM, but they should all carry the necessary acks and it made the
>> merge process much easier to do it this way.
> 
> The following are properly acked:
> 
>     arm64: Reuse TCR field definitions for EL1 and EL2
>     arm64: Introduce pmd_thp_or_huge
> 
> I wouldn't have minded more explicit Acked-bys for the following:
> 
>     irqchip/gic-v2: Gather ACPI specific data in a single structure
>     irqchip/gic-v2: Parse and export virtual GIC information
>     irqchip/gic-v3: Prefix all pr_* messages by "GICv3: "
>     irqchip/gic-v3: Gather all ACPI specific data in a single structure
>     irqchip/gic-v3: Parse and export virtual GIC information
> 
> I guess it's fine since Marc Zyngier is maintainer for both KVM and
> irqchip, still it's never wrong to get more acks. :)

Ah, I really thought I acked them. The email must have been stuck in my
head...

So more formally and for documentation purposes:

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PULL 00/29] KVM/ARM Changes for v4.7
@ 2016-05-11 15:37     ` Marc Zyngier
  0 siblings, 0 replies; 80+ messages in thread
From: Marc Zyngier @ 2016-05-11 15:37 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/05/16 16:23, Paolo Bonzini wrote:
> 
> 
> On 11/05/2016 15:29, Christoffer Dall wrote:
>> Hi Paolo and Radim,
>>
>> Here is the initial set of changes for KVM/ARM for v4.7.
>>
>> Sorry I'm a bit late with these, but we were trying to get the new vgic
>> implementation in as part of this, but I have decided to send this pull
>> request now, and we can follow up with another for the new VGIC,
>> assuming we feel like we have that in place in a few days.
> 
> Don't worry, you're not late at all.  I've pulled this to kvm/queue.
> 
>> There are a few changes in this pull request touching things outside
>> KVM, but they should all carry the necessary acks and it made the
>> merge process much easier to do it this way.
> 
> The following are properly acked:
> 
>     arm64: Reuse TCR field definitions for EL1 and EL2
>     arm64: Introduce pmd_thp_or_huge
> 
> I wouldn't have minded more explicit Acked-bys for the following:
> 
>     irqchip/gic-v2: Gather ACPI specific data in a single structure
>     irqchip/gic-v2: Parse and export virtual GIC information
>     irqchip/gic-v3: Prefix all pr_* messages by "GICv3: "
>     irqchip/gic-v3: Gather all ACPI specific data in a single structure
>     irqchip/gic-v3: Parse and export virtual GIC information
> 
> I guess it's fine since Marc Zyngier is maintainer for both KVM and
> irqchip, still it's never wrong to get more acks. :)

Ah, I really thought I acked them. The email must have been stuck in my
head...

So more formally and for documentation purposes:

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-11 15:37     ` Marc Zyngier
@ 2016-05-11 15:41       ` Paolo Bonzini
  -1 siblings, 0 replies; 80+ messages in thread
From: Paolo Bonzini @ 2016-05-11 15:41 UTC (permalink / raw)
  To: Marc Zyngier, Christoffer Dall, Radim Krčmář
  Cc: kvmarm, linux-arm-kernel, kvm



On 11/05/2016 17:37, Marc Zyngier wrote:
> Ah, I really thought I acked them. The email must have been stuck in my
> head...
> 
> So more formally and for documentation purposes:
> 
> Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Good, I'll add a note in the tag message when sending my own pull
request to Linus.

Thanks,

Paolo

^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PULL 00/29] KVM/ARM Changes for v4.7
@ 2016-05-11 15:41       ` Paolo Bonzini
  0 siblings, 0 replies; 80+ messages in thread
From: Paolo Bonzini @ 2016-05-11 15:41 UTC (permalink / raw)
  To: linux-arm-kernel



On 11/05/2016 17:37, Marc Zyngier wrote:
> Ah, I really thought I acked them. The email must have been stuck in my
> head...
> 
> So more formally and for documentation purposes:
> 
> Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Good, I'll add a note in the tag message when sending my own pull
request to Linus.

Thanks,

Paolo

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-11 15:23   ` Paolo Bonzini
@ 2016-05-11 15:42     ` Christoffer Dall
  -1 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 15:42 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Marc Zyngier, kvm, kvmarm, linux-arm-kernel

On Wed, May 11, 2016 at 05:23:30PM +0200, Paolo Bonzini wrote:
> 
> 
> On 11/05/2016 15:29, Christoffer Dall wrote:
> > Hi Paolo and Radim,
> > 
> > Here is the initial set of changes for KVM/ARM for v4.7.
> > 
> > Sorry I'm a bit late with these, but we were trying to get the new vgic
> > implementation in as part of this, but I have decided to send this pull
> > request now, and we can follow up with another for the new VGIC,
> > assuming we feel like we have that in place in a few days.
> 
> Don't worry, you're not late at all.  I've pulled this to kvm/queue.
> 
> > There are a few changes in this pull request touching things outside
> > KVM, but they should all carry the necessary acks and it made the
> > merge process much easier to do it this way.
> 
> The following are properly acked:
> 
>     arm64: Reuse TCR field definitions for EL1 and EL2
>     arm64: Introduce pmd_thp_or_huge
> 
> I wouldn't have minded more explicit Acked-bys for the following:
> 
>     irqchip/gic-v2: Gather ACPI specific data in a single structure
>     irqchip/gic-v2: Parse and export virtual GIC information
>     irqchip/gic-v3: Prefix all pr_* messages by "GICv3: "
>     irqchip/gic-v3: Gather all ACPI specific data in a single structure
>     irqchip/gic-v3: Parse and export virtual GIC information
> 
> I guess it's fine since Marc Zyngier is maintainer for both KVM and
> irqchip, still it's never wrong to get more acks. :)
> 
Jason Cooper also acked them all; I swear I intended to add his acks to
all of these specifically, but I must've forgotten.

I have forwarded you his ack for reference.  Let me know if you need me
to do anything else.

Thanks,
-Christoffer

^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PULL 00/29] KVM/ARM Changes for v4.7
@ 2016-05-11 15:42     ` Christoffer Dall
  0 siblings, 0 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-11 15:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, May 11, 2016 at 05:23:30PM +0200, Paolo Bonzini wrote:
> 
> 
> On 11/05/2016 15:29, Christoffer Dall wrote:
> > Hi Paolo and Radim,
> > 
> > Here is the initial set of changes for KVM/ARM for v4.7.
> > 
> > Sorry I'm a bit late with these, but we were trying to get the new vgic
> > implementation in as part of this, but I have decided to send this pull
> > request now, and we can follow up with another for the new VGIC,
> > assuming we feel like we have that in place in a few days.
> 
> Don't worry, you're not late at all.  I've pulled this to kvm/queue.
> 
> > There are a few changes in this pull request touching things outside
> > KVM, but they should all carry the necessary acks and it made the
> > merge process much easier to do it this way.
> 
> The following are properly acked:
> 
>     arm64: Reuse TCR field definitions for EL1 and EL2
>     arm64: Introduce pmd_thp_or_huge
> 
> I wouldn't have minded more explicit Acked-bys for the following:
> 
>     irqchip/gic-v2: Gather ACPI specific data in a single structure
>     irqchip/gic-v2: Parse and export virtual GIC information
>     irqchip/gic-v3: Prefix all pr_* messages by "GICv3: "
>     irqchip/gic-v3: Gather all ACPI specific data in a single structure
>     irqchip/gic-v3: Parse and export virtual GIC information
> 
> I guess it's fine since Marc Zyngier is maintainer for both KVM and
> irqchip, still it's never wrong to get more acks. :)
> 
Jason Cooper also acked them all; I swear I intended to add his acks to
all of these specifically, but I must've forgotten.

I have forwarded you his ack for reference.  Let me know if you need me
to do anything else.

Thanks,
-Christoffer

^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PULL 00/29] KVM/ARM Changes for v4.7
@ 2016-05-14 14:58 Itaru Kitayama
  2016-05-15  7:08 ` Christoffer Dall
  0 siblings, 1 reply; 80+ messages in thread
From: Itaru Kitayama @ 2016-05-14 14:58 UTC (permalink / raw)
  To: kvmarm

Hi,

The tag kvm-arm-for-4.7 fails to boot on Mustang. Has anyone verified 
this tag on Mustang? The F/W I'm using is 3.05.05-beta_rc.

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-14 14:58 Itaru Kitayama
@ 2016-05-15  7:08 ` Christoffer Dall
  2016-05-15  9:37   ` Itaru Kitayama
  0 siblings, 1 reply; 80+ messages in thread
From: Christoffer Dall @ 2016-05-15  7:08 UTC (permalink / raw)
  To: Itaru Kitayama; +Cc: kvmarm@lists.cs.columbia.edu


[-- Attachment #1.1: Type: text/plain, Size: 535 bytes --]

Yes, I test this for every release.

What's your config? What are the symptoms?

Are you booting with UEFI or u-boot on your mustang?

Thanks,
-Christoffer

On Saturday, May 14, 2016, Itaru Kitayama <itaru.kitayama@riken.jp> wrote:

> Hi,
>
> The tag kvm-arm-for-4.7 fails to boot on Mustang. Has anyone verified this
> tag on Mustang? The F/W I'm using is 3.05.05-beta_rc.
> _______________________________________________
> kvmarm mailing list
> kvmarm@lists.cs.columbia.edu
> https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
>

[-- Attachment #1.2: Type: text/html, Size: 912 bytes --]

[-- Attachment #2: Type: text/plain, Size: 151 bytes --]

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-15  7:08 ` Christoffer Dall
@ 2016-05-15  9:37   ` Itaru Kitayama
  2016-05-15 11:19     ` Christoffer Dall
  0 siblings, 1 reply; 80+ messages in thread
From: Itaru Kitayama @ 2016-05-15  9:37 UTC (permalink / raw)
  To: Christoffer Dall; +Cc: kvmarm@lists.cs.columbia.edu

[-- Attachment #1: Type: text/plain, Size: 31533 bytes --]

Below is the boot (with UEFI) log. I'm attaching the .config I'm using.
I've been trying to test Julien's ACPI support patch set recently merged 
in the kvmarm tree on Mustang.

EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services and installing virtual address map...
L3C: 8MB
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.6.0-rc1 (itaru.kitayama@r2-a11) (gcc 
version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC) ) #8 SMP PREEMPT Sat May 
14 09:04:47 CDT 2016
[    0.000000] Boot CPU: AArch64 Processor [500f0000]
[    0.000000] earlycon: uart0 at MMIO32 0x000000001c020000 (options '')
[    0.000000] bootconsole [uart0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] EFI v2.40 by X-Gene Mustang Board EFI Jan 27 2016 18:27:58
[    0.000000] efi:  ACPI=0x43fa859000  ACPI 2.0=0x43fa859014  SMBIOS 
3.0=0x43fa857000
[    0.000000] cma: Reserved 512 MiB at 0x00000040e0000000
[    0.000000] ACPI: Early table checksum verification enabled
[    0.000000] ACPI: RSDP 0x00000043FA859014 000024 (v02 APM   )
[    0.000000] ACPI: XSDT 0x00000043FA8580E8 00007C (v01 APM    XGENE 
00000003      01000013)
[    0.000000] ACPI: FACP 0x00000043FA850000 00010C (v05 APM    XGENE 
00000003 INTL 20140724)
[    0.000000] ACPI: DSDT 0x00000043FA851000 003A00 (v05 APM    APM88xxx 
00000001 INTL 20140724)
[    0.000000] ACPI: DBG2 0x00000043FA855000 0000AA (v00 APMC0D XGENEDBG 
00000000 INTL 20140724)
[    0.000000] ACPI: GTDT 0x00000043FA84E000 0000E0 (v02 APM    XGENE 
00000001 INTL 20140724)
[    0.000000] ACPI: MCFG 0x00000043FA84D000 00003C (v01 APM    XGENE 
00000002 INTL 20140724)
[    0.000000] ACPI: SPCR 0x00000043FA84C000 000050 (v02 APMC0D XGENESPC 
00000000 INTL 20140724)
[    0.000000] ACPI: SSDT 0x00000043FA84B000 00002D (v02 APM    XGENE 
00000001 INTL 20140724)
[    0.000000] ACPI: BERT 0x00000043FA84A000 000030 (v01 APM    XGENE 
00000002 INTL 20140724)
[    0.000000] ACPI: HEST 0x00000043FA849000 0002A8 (v01 APM    XGENE 
00000002 INTL 20140724)
[    0.000000] ACPI: APIC 0x00000043FA848000 0002A4 (v03 APM    XGENE 
00000003      01000013)
[    0.000000] ACPI: SSDT 0x00000043FA847000 000063 (v02 REDHAT MACADDRS 
00000001      01000013)
[    0.000000] ACPI: SSDT 0x00000043FA846000 000032 (v02 REDHAT UARTCLKS 
00000001      01000013)
[    0.000000] On node 0 totalpages: 262144
[    0.000000]   DMA zone: 64 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 65536 pages, LIFO batch:1
[    0.000000]   Normal zone: 192 pages used for memmap
[    0.000000]   Normal zone: 196608 pages, LIFO batch:1
[    0.000000] psci: is not implemented in ACPI.
[    0.000000] percpu: Embedded 3 pages/cpu @ffff8003ffde0000 s110464 
r8192 d77952 u196608
[    0.000000] pcpu-alloc: s110464 r8192 d77952 u196608 alloc=3*65536
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on. 
Total pages: 261888
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-4.6.0-rc1 
root=UUID=ac9f9264-7572-48c3-97d2-042ea95f7640 ro acpi=force 
acpi_force_table_verification earlycon=uart,mmio32,0x1c020000 
console=ttyS0,115200 loglevel=8 LANG=en_US.UTF-8
[    0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[    0.000000] log_buf_len total cpu_extra contributions: 28672 bytes
[    0.000000] log_buf_len min size: 16384 bytes
[    0.000000] log_buf_len: 65536 bytes
[    0.000000] early log buf free: 13100(79%)
[    0.000000] PID hash table entries: 4096 (order: -1, 32768 bytes)
[    0.000000] Dentry cache hash table entries: 2097152 (order: 8, 
16777216 bytes)
[    0.000000] Inode-cache hash table entries: 1048576 (order: 7, 
8388608 bytes)
[    0.000000] software IO TLB [mem 0x40dbff0000-0x40dfff0000] (64MB) 
mapped at [ffff8000dbff0000-ffff8000dffeffff]
[    0.000000] Memory: 16070528K/16777216K available (22848K kernel 
code, 8676K rwdata, 7552K rodata, 1856K init, 16521K bss, 182400K 
reserved, 524288K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     modules : 0xffff000000000000 - 0xffff000008000000   ( 
   128 MB)
[    0.000000]     vmalloc : 0xffff000008000000 - 0xffff77ffffff0000 
(122879 GB)
[    0.000000]       .text : 0xffff000008080000 - 0xffff0000096d0000   ( 
22848 KB)
[    0.000000]     .rodata : 0xffff0000096d0000 - 0xffff000009e40000   ( 
  7616 KB)
[    0.000000]       .init : 0xffff000009e40000 - 0xffff00000a010000   ( 
  1856 KB)
[    0.000000]       .data : 0xffff00000a010000 - 0xffff00000a889000   ( 
  8676 KB)
[    0.000000]     vmemmap : 0xffff780000000000 - 0xffff7c0000000000   ( 
  4096 GB maximum)
[    0.000000]               0xffff780000000000 - 0xffff780001000000   ( 
    16 MB actual)
[    0.000000]     fixed   : 0xffff7ffffe7d0000 - 0xffff7ffffec00000   ( 
  4288 KB)
[    0.000000]     PCI I/O : 0xffff7ffffee00000 - 0xffff7fffffe00000   ( 
    16 MB)
[    0.000000]     memory  : 0xffff800000000000 - 0xffff800400000000   ( 
16384 MB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] 	Build-time adjustment of leaf fanout to 64.
[    0.000000] 	RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=8.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=8
[    0.000000] NR_IRQS:64 nr_irqs:64 0
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: No distributor detected at @ffff000008060000, 
giving up
[    0.000000] Architected cp15 timer(s) running at 50.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff 
max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
[    0.000005] sched_clock: 56 bits at 50MHz, resolution 20ns, wraps 
every 4398046511100ns
[    0.008526] Console: colour dummy device 80x25
[    0.013156] Lock dependency validator: Copyright (c) 2006 Red Hat, 
Inc., Ingo Molnar
[    0.021178] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.025455] ... MAX_LOCK_DEPTH:          48
[    0.029791] ... MAX_LOCKDEP_KEYS:        8191
[    0.034352] ... CLASSHASH_SIZE:          4096
[    0.038913] ... MAX_LOCKDEP_ENTRIES:     32768
[    0.043517] ... MAX_LOCKDEP_CHAINS:      65536
[    0.048121] ... CHAINHASH_SIZE:          32768
[    0.052708]  memory used by lock dependency info: 8127 kB
[    0.058340]  per task-struct memory footprint: 1920 bytes
[    0.063902] Calibrating delay loop (skipped), value calculated using 
timer frequency.. 100.00 BogoMIPS (lpj=200000)
[    0.074799] pid_max: default: 32768 minimum: 301
[    0.079632] ACPI: Core revision 20160108
[    0.111734] ACPI: 4 ACPI AML tables successfully acquired and loaded
[    0.118405]
[    0.120114] Security Framework initialized
[    0.124409] Mount-cache hash table entries: 32768 (order: 2, 262144 
bytes)
[    0.131569] Mountpoint-cache hash table entries: 32768 (order: 2, 
262144 bytes)
[    0.140440] ftrace: allocating 29344 entries in 8 pages
[    0.234935] ASID allocator initialised with 65536 entries
[    0.242853] Remapping and enabling EFI services.
[    0.247783]   EFI remap 0x0000000010510000 => 0000000020000000
[    0.253870]   EFI remap 0x0000000010548000 => 0000000020018000
[    0.259941]   EFI remap 0x0000000017000000 => 0000000020020000
[    0.266027]   EFI remap 0x000000001c025000 => 0000000020035000
[    0.272086]   EFI remap 0x000000007c0c0000 => 0000000020040000
[    0.278187]   EFI remap 0x000000007c1c0000 => 0000000020050000
[    0.284228]   EFI remap 0x000000007c2c0000 => 0000000020060000
[    0.290303]   EFI remap 0x000000007c3c0000 => 0000000020070000
[    0.296440]   EFI remap 0x000000007c4c0000 => 0000000020080000
[    0.302514]   EFI remap 0x000000007c5c0000 => 0000000020090000
[    0.308607]   EFI remap 0x000000007c6c0000 => 00000000200a0000
[    0.314605]   EFI remap 0x000000007c7c0000 => 00000000200b0000
[    0.320656]   EFI remap 0x00000043fa813000 => 00000000200c3000
[    0.326707]   EFI remap 0x00000043fa85a000 => 00000000200da000
[    0.332800]   EFI remap 0x00000043ffa02000 => 00000000202c2000
[    0.338833]   EFI remap 0x00000043ffa16000 => 00000000202d6000
[    0.346722] Detected PIPT I-cache on CPU1
[    0.346777] CPU1: Booted secondary processor [500f0000]
[    0.348055] Detected PIPT I-cache on CPU2
[    0.348101] CPU2: Booted secondary processor [500f0000]
[    0.349445] Detected PIPT I-cache on CPU3
[    0.349487] CPU3: Booted secondary processor [500f0000]
[    0.350755] Detected PIPT I-cache on CPU4
[    0.350804] CPU4: Booted secondary processor [500f0000]
[    0.352092] Detected PIPT I-cache on CPU5
[    0.352139] CPU5: Booted secondary processor [500f0000]
[    0.353453] Detected PIPT I-cache on CPU6
[    0.353503] CPU6: Booted secondary processor [500f0000]
[    0.354760] Detected PIPT I-cache on CPU7
[    0.354805] CPU7: Booted secondary processor [500f0000]
[    0.355016] Brought up 8 CPUs
[    0.424443] SMP: Total of 8 processors activated.
[    0.429596] CPU: All CPU(s) started at EL2
[    0.435912] devtmpfs: initialized
[    0.440366] gcov: version magic: 0x35303352
[    0.446684] SMBIOS 3.0.0 present.
[    0.451123] clocksource: jiffies: mask: 0xffffffff max_cycles: 
0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.462909] pinctrl core: initialized pinctrl subsystem
[    0.472249] NET: Registered protocol family 16
[    0.480839] PCCT header not found.
[    0.484751] vdso: 2 pages (1 code @ ffff0000096f0000, 1 data @ 
ffff00000a020000)
[    0.492673] hw-breakpoint: found 4 breakpoint and 4 watchpoint registers.
[    0.514667] DMA: preallocated 256 KiB pool for atomic allocations
[    0.521478] ACPI: bus type PCI registered
[    0.526136] Serial: AMBA PL011 UART driver
[    0.588382] HugeTLB registered 512 MB page size, pre-allocated 0 pages
[    0.598785] ACPI: Added _OSI(Module Device)
[    0.603442] ACPI: Added _OSI(Processor Device)
[    0.607997] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.612881] ACPI: Added _OSI(Processor Aggregator Device)
[    0.666107] ACPI: Interpreter enabled
[    0.670015] ACPI: Using GIC for interrupt routing
[    0.702600] ACPI: Power Resource [SCVR] (off)
[    0.769224] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    0.775864] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM 
ClockPM Segments MSI]
[    0.786707] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME 
AER PCIeCapability]
[    0.794901] acpi PNP0A08:00: Bus 0000:00 not present in PCI namespace
[    0.808595] vgaarb: loaded
[    0.811960] SCSI subsystem initialized
[    0.816527] libata version 3.00 loaded.
[    0.821579] ACPI: bus type USB registered
[    0.826051] usbcore: registered new interface driver usbfs
[    0.831972] usbcore: registered new interface driver hub
[    0.838079] usbcore: registered new device driver usb
[    0.843666] pps_core: LinuxPPS API ver. 1 registered
[    0.848778] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 
Rodolfo Giometti <giometti@linux.it>
[    0.858139] PTP clock support registered
[    0.863697] Advanced Linux Sound Architecture Driver Initialized.
[    0.872329] clocksource: Switched to clocksource arch_sys_counter
[    0.891969] Warning: could not register all branches stats
[    0.897857] Warning: could not register annotated branches stats
[    1.014772] VFS: Disk quotas dquot_6.6.0
[    1.018869] VFS: Dquot-cache hash table entries: 8192 (order 0, 65536 
bytes)
[    1.026998] pnp: PnP ACPI init
[    1.034494] pnp: PnP ACPI: found 0 devices
[    1.076859] NET: Registered protocol family 2
[    1.082304] TCP established hash table entries: 131072 (order: 4, 
1048576 bytes)
[    1.090249] TCP bind hash table entries: 65536 (order: 6, 4194304 bytes)
[    1.102699] TCP: Hash tables configured (established 131072 bind 65536)
[    1.109673] UDP hash table entries: 8192 (order: 4, 1310720 bytes)
[    1.117621] UDP-Lite hash table entries: 8192 (order: 4, 1310720 bytes)
[    1.126338] NET: Registered protocol family 1
[    1.131621] RPC: Registered named UNIX socket transport module.
[    1.137591] RPC: Registered udp transport module.
[    1.142513] RPC: Registered tcp transport module.
[    1.147396] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.154556] PCI: CLS 0 bytes, default 128
[    1.159531] Unpacking initramfs...
[    1.163011] Unable to handle kernel paging request at virtual address 
ffff8003f9a7f000
[    1.171709] pgd = ffff00000b8e0000
[    1.175160] [ffff8003f9a7f000] *pgd=00000043fffc0003, 
*pud=00000043fffc0003, *pmd=00000043fffa0003, *pte=0000000000000000
[    1.186396] Internal error: Oops: 96000007 [#1] PREEMPT SMP
[    1.192489] Modules linked in:
[    1.195821] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.6.0-rc1 #8
[    1.201970] Hardware name: AppliedMicro Mustang/Mustang, BIOS 
3.05.05-beta_rc Jan 27 2016
[    1.210125] task: ffff8003c0360000 ti: ffff8003c0400000 task.ti: 
ffff8003c0400000
[    1.218309] PC is at unpack_to_rootfs+0x1fc/0x664
[    1.223448] LR is at unpack_to_rootfs+0xa8/0x664
[    1.228492] pc : [<ffff000009e43e90>] lr : [<ffff000009e43d3c>] 
pstate: 60000045
[    1.236567] sp : ffff8003c0403ca0
[    1.239864] x29: ffff8003c0403ca0 x28: ffff000009fc3708
[    1.245179] x27: ffff000009ce4e18 x26: ffff00000a3fa148
[    1.250977] x25: ffff00000b3c5998 x24: 0000000000a381dd
[    1.256757] x23: ffff8003f9a7f000 x22: ffff00000a3f9f90
[    1.262253] x21: ffff000009f1d000 x20: ffff00000a8c1000
[    1.267869] x19: ffff00000a8c1548 x18: 0000000005f5e0ff
[    1.273174] x17: ffff000008abf468 x16: 0000000000000000
[    1.278669] x15: ffff00000a447ce0 x14: 00000000000000b0
[    1.284294] x13: 00000000000000b4 x12: 00000000000000b4
[    1.290084] x11: 0000000000000001 x10: ffff8003c0400000
[    1.295389] x9 : 00000000000487d1 x8 : 0000000000000003
[    1.300702] x7 : 0000000000000000 x6 : ffff00000a032000
[    1.306327] x5 : ffff00000b385a28 x4 : 0000000000000002
[    1.311641] x3 : ffff000009f1dc10 x2 : 0000000000000002
[    1.316955] x1 : 0000000000000001 x0 : ffff00000a8c1548
[    1.322588]
[    1.324072] Process swapper/0 (pid: 1, stack limit = 0xffff8003c0400020)
[    1.331379] Stack: (0xffff8003c0403ca0 to 0xffff8003c0404000)
[    1.337660] 3ca0: ffff8003c0403d20 ffff000009e456ec ffff00000a8c1aa8 
ffff00000a8c1000
[    1.345452] 3cc0: ffff00000a3f9000 ffff00000a8c1000 ffff00000a8c1000 
ffff00000a3fa788
[    1.354012] 3ce0: ffff00000a8c1000 ffff00000a03a1a0 ffff00000a8c0a38 
ffff000009fc3708
[    1.362564] 3d00: 0000000000877237 ffff00000b385a28 ffff00000a032000 
0000000000000000
[    1.371107] 3d20: ffff8003c0403d70 ffff00000809256c ffff00000a8c07d8 
ffff8003c1a44b80
[    1.379668] 3d40: ffff00000a8c0000 ffff00000a03a1a0 ffff000009f1dbc0 
ffff00000a8c0878
[    1.388228] 3d60: ffff000009f1db50 ffff00000a39e000 ffff8003c0403e30 
ffff000009e41d24
[    1.396789] 3d80: ffff00000a8c0000 00000000000000fb ffff00000a8c0000 
0000000000000005
[    1.404589] 3da0: ffff000009f1dbc0 ffff000009e25660 ffff000009f1db50 
ffff000009e402e0
[    1.412380] 3dc0: ffff00000a8c0a38 ffff000009fc3708 ffff00000a42c350 
ffff000009d14e90
[    1.420182] 3de0: ffff000009e455d0 000000000a9043f0 0000000100000000 
0000000000000000
[    1.428743] 3e00: 0000000100000001 ffff00000a42c3c8 0000000000000038 
0000000000000040
[    1.436534] 3e20: 0000000100000000 0000000000000608 ffff8003c0403e90 
ffff000009693ea4
[    1.445094] 3e40: ffff00000a8c0000 ffff00000a3f8000 ffff00000a8c0000 
0000000000000000
[    1.453646] 3e60: ffff00000a8c0b30 0000000000000000 0000000000000000 
0000000000000000
[    1.462206] 3e80: 0000000000000000 0000000000000000 0000000000000000 
ffff000008097e10
[    1.470007] 3ea0: ffff000009693e68 0000000000000000 0000000000000000 
0000000000000000
[    1.478567] 3ec0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.486358] 3ee0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.494910] 3f00: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.502701] 3f20: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.510492] 3f40: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.519052] 3f60: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.527612] 3f80: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.536163] 3fa0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.544715] 3fc0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000005
[    1.553276] 3fe0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.561065] Call trace:
[    1.563501] Exception stack(0xffff8003c0403ad0 to 0xffff8003c0403bf0)
[    1.570522] 3ac0:                                   ffff00000a8c1548 
ffff00000a8c1000
[    1.578349] 3ae0: ffff8003c0403ca0 ffff000009e43e90 0000000060000045 
ffff000008241108
[    1.586909] 3b00: ffff00000b2db218 ffff00000a449590 0000000000000000 
ffff00000a0867d8
[    1.595469] 3b20: ffff00000a0867e0 0000000000000040 ffff8003c0403bb0 
ffff0000081b604c
[    1.604030] 3b40: ffff00000a909000 ffff00000a90a770 ffff00000853cfa8 
ffff00000a42ff98
[    1.612590] 3b60: 0000000000000001 ffff00000b2d5000 ffff00000a37f000 
ffff8003c0400000
[    1.620381] 3b80: ffff00000a8c1548 0000000000000001 0000000000000002 
ffff000009f1dc10
[    1.628941] 3ba0: 0000000000000002 ffff00000b385a28 ffff00000a032000 
0000000000000000
[    1.636732] 3bc0: 0000000000000003 00000000000487d1 ffff8003c0400000 
0000000000000001
[    1.644522] 3be0: 00000000000000b4 00000000000000b4
[    1.649844] [<ffff000009e43e90>] unpack_to_rootfs+0x1fc/0x664
[    1.656125] [<ffff000009e456ec>] populate_rootfs+0x11c/0x22c
[    1.661758] [<ffff00000809256c>] do_one_initcall+0x1d4/0x520
[    1.667399] [<ffff000009e41d24>] kernel_init_freeable+0x2b4/0x4b0
[    1.674061] [<ffff000009693ea4>] kernel_init+0x3c/0x368
[    1.679486] [<ffff000008097e10>] ret_from_fork+0x10/0x40
[    1.684774] Code: 91000421 f900a401 b4fffe18 f940a801 (394002e2)
[    1.690902] ---[ end trace 13152abe1ac10cde ]---
[    1.696013] Kernel panic - not syncing: Attempted to kill init! 
exitcode=0x0000000b
[    1.696013]
[    1.705870] CPU6: stopping
[    1.708700] CPU: 6 PID: 0 Comm: swapper/6 Tainted: G      D 
4.6.0-rc1 #8
[    1.716398] Hardware name: AppliedMicro Mustang/Mustang, BIOS 
3.05.05-beta_rc Jan 27 2016
[    1.724871] Call trace:
[    1.727399] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
[    1.733017] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
[    1.738246] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
[    1.743656] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
[    1.749065] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
[    1.754836] Exception stack(0xffff8003fff03fa0 to 0xffff8003fff040c0)
[    1.761497] 3fa0: ffff8003c0443da0 ffff00000a8c29e0 ffff8003c0443ec0 
ffff000008099964
[    1.769601] 3fc0: 0000000060000045 ffff00000a030000 ffff8003fff00020 
ffff8003fff04010
[    1.777740] 3fe0: 0000000000000001 ffff8003c0440000 ffff00000800f000 
ffff8003c0443da0
[    1.785852] 4000: ffff8003c0443ec0 ffff8003c0443da0 0000000000000000 
0000000000000000
[    1.793982] 4020: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.802095] 4040: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.810225] 4060: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.818329] 4080: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.826416] 40a0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.834520] [<ffff000008097724>] el1_irq+0xa4/0x114
[    1.839619] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
[    1.845177] [<ffff000008209598>] default_idle_call+0xd0/0xf8
[    1.851010] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
[    1.857024] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
[    1.863522] [<00000040002921fc>] 0x40002921fc
[    1.868054] CPU5: stopping
[    1.870880] CPU: 5 PID: 0 Comm: swapper/5 Tainted: G      D 
4.6.0-rc1 #8
[    1.878585] Hardware name: AppliedMicro Mustang/Mustang, BIOS 
3.05.05-beta_rc Jan 27 2016
[    1.887085] Call trace:
[    1.889672] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
[    1.895264] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
[    1.900492] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
[    1.905892] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
[    1.911336] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
[    1.917072] Exception stack(0xffff8003ffed3fa0 to 0xffff8003ffed40c0)
[    1.923742] 3fa0: ffff8003c043fda0 ffff00000a8c29e0 ffff8003c043fec0 
ffff000008099964
[    1.931873] 3fc0: 0000000060000045 ffff00000a030000 ffff8003ffed0020 
ffff8003ffed4010
[    1.939994] 3fe0: 0000000000000001 ffff8003c043c000 ffff00000800f000 
ffff8003c043fda0
[    1.948133] 4000: ffff8003c043fec0 ffff8003c043fda0 0000000000000000 
0000000000000000
[    1.956202] 4020: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.964375] 4040: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.972462] 4060: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.980644] 4080: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.988782] 40a0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    1.996843] [<ffff000008097724>] el1_irq+0xa4/0x114
[    2.001899] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
[    2.007473] [<ffff000008209598>] default_idle_call+0xd0/0xf8
[    2.013358] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
[    2.019415] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
[    2.025877] [<00000040002921fc>] 0x40002921fc
[    2.030417] CPU3: stopping
[    2.033243] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G      D 
4.6.0-rc1 #8
[    2.040862] Hardware name: AppliedMicro Mustang/Mustang, BIOS 
3.05.05-beta_rc Jan 27 2016
[    2.049354] Call trace:
[    2.051890] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
[    2.057507] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
[    2.062752] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
[    2.068144] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
[    2.073544] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
[    2.079315] Exception stack(0xffff8003ffe73fa0 to 0xffff8003ffe740c0)
[    2.085968] 3fa0: ffff8003c0437da0 ffff00000a8c29e0 ffff8003c0437ec0 
ffff000008099964
[    2.094064] 3fc0: 0000000060000045 ffff00000a030000 ffff8003ffe70020 
ffff8003ffe74010
[    2.102212] 3fe0: 0000000000000001 ffff8003c0434000 ffff00000800f000 
ffff8003c0437da0
[    2.110272] 4000: ffff8003c0437ec0 ffff8003c0437da0 0000000000000000 
0000000000000000
[    2.118359] 4020: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.126480] 4040: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.134636] 4060: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.142731] 4080: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.150818] 40a0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.158905] [<ffff000008097724>] el1_irq+0xa4/0x114
[    2.163951] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
[    2.169534] [<ffff000008209598>] default_idle_call+0xd0/0xf8
[    2.175392] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
[    2.181424] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
[    2.187946] [<00000040002921fc>] 0x40002921fc
[    2.192458] CPU0: stopping
[    2.195280] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D 
4.6.0-rc1 #8
[    2.202968] Hardware name: AppliedMicro Mustang/Mustang, BIOS 
3.05.05-beta_rc Jan 27 2016
[    2.211441] Call trace:
[    2.213992] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
[    2.219558] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
[    2.224785] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
[    2.230210] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
[    2.235645] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
[    2.241398] Exception stack(0xffff8003ffde3fa0 to 0xffff8003ffde40c0)
[    2.248085] 3fa0: ffff00000a013d70 ffff00000a8c29e0 ffff00000a013e90 
ffff000008099964
[    2.256188] 3fc0: 0000000060000045 ffff00000a030000 ffff8003ffde0020 
ffff8003ffde4010
[    2.264309] 3fe0: 0000000000000001 ffff00000a010000 ffff00000800f000 
ffff00000a013d70
[    2.272386] 4000: ffff00000a013e90 ffff00000a013d70 0000000000000000 
0000000000000000
[    2.280481] 4020: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.288584] 4040: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.296704] 4060: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.304746] 4080: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.312814] 40a0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.320840] [<ffff000008097724>] el1_irq+0xa4/0x114
[    2.325842] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
[    2.331468] [<ffff000008209598>] default_idle_call+0xd0/0xf8
[    2.337274] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
[    2.343279] [<ffff000009693e48>] rest_init+0x168/0x188
[    2.348644] [<ffff000009e41a4c>] start_kernel+0xb70/0xb94
[    2.354250] [<ffff0000080811c8>] 0xffff0000080811c8
[    2.359279] CPU2: stopping
[    2.362048] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G      D 
4.6.0-rc1 #8
[    2.369745] Hardware name: AppliedMicro Mustang/Mustang, BIOS 
3.05.05-beta_rc Jan 27 2016
[    2.378261] Call trace:
[    2.380811] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
[    2.386298] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
[    2.391550] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
[    2.396846] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
[    2.402237] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
[    2.408058] Exception stack(0xffff8003ffe43fa0 to 0xffff8003ffe440c0)
[    2.414598] 3fa0: ffff8003c0433da0 ffff00000a8c29e0 ffff8003c0433ec0 
ffff000008099964
[    2.422813] 3fc0: 0000000060000045 ffff00000a030000 ffff8003ffe40020 
ffff8003ffe44010
[    2.430968] 3fe0: 0000000000000001 ffff8003c0430000 ffff00000800f000 
ffff8003c0433da0
[    2.439028] 4000: ffff8003c0433ec0 ffff8003c0433da0 0000000000000000 
0000000000000000
[    2.447096] 4020: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.455199] 4040: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.463138] 4060: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.471309] 4080: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.479455] 40a0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.487550] [<ffff000008097724>] el1_irq+0xa4/0x114
[    2.492655] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
[    2.498271] [<ffff000008209598>] default_idle_call+0xd0/0xf8
[    2.504103] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
[    2.510288] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
[    2.516870] [<00000040002921fc>] 0x40002921fc
[    2.521329] CPU4: stopping
[    2.524132] CPU: 4 PID: 0 Comm: swapper/4 Tainted: G      D 
4.6.0-rc1 #8
[    2.532010] Hardware name: AppliedMicro Mustang/Mustang, BIOS 
3.05.05-beta_rc Jan 27 2016
[    2.540301] Call trace:
[    2.542816] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
[    2.548441] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
[    2.553719] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
[    2.559195] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
[    2.564655] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
[    2.570433] Exception stack(0xffff8003ffea3fa0 to 0xffff8003ffea40c0)
[    2.576998] 3fa0: ffff8003c043bda0 ffff00000a8c29e0 ffff8003c043bec0 
ffff000008099964
[    2.584989] 3fc0: 0000000060000045 ffff00000a030000 ffff8003ffea0020 
ffff8003ffea4010
[    2.593049] 3fe0: 0000000000000001 ffff8003c0438000 ffff00000800f000 
ffff8003c043bda0
[    2.601057] 4000: ffff8003c043bec0 ffff8003c043bda0 0000000000000000 
0000000000000000
[    2.609099] 4020: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.617479] 4040: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.625581] 4060: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.633529] 4080: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.641683] 40a0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.649821] [<ffff000008097724>] el1_irq+0xa4/0x114
[    2.654797] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
[    2.660300] [<ffff000008209598>] default_idle_call+0xd0/0xf8
[    2.666149] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
[    2.672144] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
[    2.678562] [<00000040002921fc>] 0x40002921fc
[    2.683011] CPU7: stopping
[    2.685710] CPU: 7 PID: 0 Comm: swapper/7 Tainted: G      D 
4.6.0-rc1 #8
[    2.693069] Hardware name: AppliedMicro Mustang/Mustang, BIOS 
3.05.05-beta_rc Jan 27 2016
[    2.701395] Call trace:
[    2.703858] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
[    2.709231] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
[    2.714267] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
[    2.719700] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
[    2.724900] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
[    2.730782] Exception stack(0xffff8003fff33fa0 to 0xffff8003fff340c0)
[    2.737261] 3fa0: ffff8003c0447da0 ffff00000a8c29e0 ffff8003c0447ec0 
ffff000008099964
[    2.745061] 3fc0: 0000000060000045 ffff00000a030000 ffff8003fff30020 
ffff8003fff34010
[    2.752922] 3fe0: 0000000000000001 ffff8003c0444000 ffff00000800f000 
ffff8003c0447da0
[    2.760731] 4000: ffff8003c0447ec0 ffff8003c0447da0 0000000000000000 
0000000000000000
[    2.768756] 4020: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.777143] 4040: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.785298] 4060: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.793366] 4080: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.801217] 40a0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    2.809406] [<ffff000008097724>] el1_irq+0xa4/0x114
[    2.814486] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
[    2.819859] [<ffff000008209598>] default_idle_call+0xd0/0xf8
[    2.825500] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
[    2.831556] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
[    2.837792] [<00000040002921fc>] 0x40002921fc
[    2.842501] ---[ end Kernel panic - not syncing: Attempted to kill 
init! exitcode=0x0000000b
[    2.842501]

On 5/15/16 4:08 PM, Christoffer Dall wrote:
> Yes, I test this for every release.
>
> What's your config? What are the symptoms?
>
> Are you booting with UEFI or u-boot on your mustang?
>
> Thanks,
> -Christoffer
>
> On Saturday, May 14, 2016, Itaru Kitayama <itaru.kitayama@riken.jp
> <mailto:itaru.kitayama@riken.jp>> wrote:
>
>     Hi,
>
>     The tag kvm-arm-for-4.7 fails to boot on Mustang. Has anyone
>     verified this tag on Mustang? The F/W I'm using is 3.05.05-beta_rc.
>     _______________________________________________
>     kvmarm mailing list
>     kvmarm@lists.cs.columbia.edu
>     https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
>

[-- Attachment #2: config20160515 --]
[-- Type: text/plain, Size: 95294 bytes --]

#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 4.6.0-rc1 Kernel Configuration
#
CONFIG_ARM64=y
CONFIG_64BIT=y
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_MMU=y
CONFIG_ARCH_MMAP_RND_BITS_MIN=14
CONFIG_ARCH_MMAP_RND_BITS_MAX=29
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=7
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CSUM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ZONE_DMA=y
CONFIG_HAVE_GENERIC_RCU_GUP=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_SMP=y
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
CONFIG_KERNEL_MODE_NEON=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_PGTABLE_LEVELS=3
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_CONSTRUCTORS=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_FHANDLE=y
# CONFIG_USELIB is not set
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_WATCH=y
CONFIG_AUDIT_TREE=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_GENERIC_IRQ_CHIP=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_GENERIC_MSI_IRQ=y
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
CONFIG_HANDLE_DOMAIN_IRQ=y
CONFIG_IRQ_DOMAIN_DEBUG=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_ARCH_HAS_TICK_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
# CONFIG_NO_HZ is not set
CONFIG_HIGH_RES_TIMERS=y

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
# CONFIG_IRQ_TIME_ACCOUNTING is not set
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y

#
# RCU Subsystem
#
CONFIG_PREEMPT_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_SRCU=y
# CONFIG_TASKS_RCU is not set
CONFIG_RCU_STALL_COMMON=y
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_RCU_EXPEDITE_BOOT is not set
CONFIG_BUILD_BIN2C=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=14
CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
CONFIG_GENERIC_SCHED_CLOCK=y
CONFIG_CGROUPS=y
CONFIG_PAGE_COUNTER=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
CONFIG_MEMCG_SWAP_ENABLED=y
# CONFIG_BLK_CGROUP is not set
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_CFS_BANDWIDTH is not set
# CONFIG_RT_GROUP_SCHED is not set
# CONFIG_CGROUP_PIDS is not set
# CONFIG_CGROUP_FREEZER is not set
CONFIG_CGROUP_HUGETLB=y
# CONFIG_CPUSETS is not set
# CONFIG_CGROUP_DEVICE is not set
# CONFIG_CGROUP_CPUACCT is not set
# CONFIG_CGROUP_PERF is not set
# CONFIG_CGROUP_DEBUG is not set
# CONFIG_CHECKPOINT_RESTORE is not set
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
# CONFIG_IPC_NS is not set
# CONFIG_USER_NS is not set
CONFIG_PID_NS=y
# CONFIG_NET_NS is not set
CONFIG_SCHED_AUTOGROUP=y
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_HAVE_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_BPF=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_MULTIUSER=y
# CONFIG_SGETMASK_SYSCALL is not set
CONFIG_SYSFS_SYSCALL=y
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set
CONFIG_KALLSYMS_BASE_RELATIVE=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_BPF_SYSCALL=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_ADVISE_SYSCALLS=y
# CONFIG_USERFAULTFD is not set
CONFIG_PCI_QUIRKS=y
CONFIG_MEMBARRIER=y
CONFIG_EMBEDDED=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_USE_VMALLOC=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
CONFIG_DEBUG_PERF_USE_VMALLOC=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_SLUB_CPU_PARTIAL=y
# CONFIG_SYSTEM_DATA_VERIFICATION is not set
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_JUMP_LABEL=y
# CONFIG_STATIC_KEYS_SELFTEST is not set
# CONFIG_UPROBES is not set
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_CONTIGUOUS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_IDLE_POLL_SETUP=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_RCU_TABLE_FREE=y
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_HAVE_CC_STACKPROTECTOR=y
# CONFIG_CC_STACKPROTECTOR is not set
CONFIG_CC_STACKPROTECTOR_NONE=y
# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
# CONFIG_CC_STACKPROTECTOR_STRONG is not set
CONFIG_HAVE_CONTEXT_TRACKING=y
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_HUGE_VMAP=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
CONFIG_ARCH_MMAP_RND_BITS=18
CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y
CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11
CONFIG_CLONE_BACKWARDS=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_COMPAT_OLD_SIGACTION=y

#
# GCOV-based kernel profiling
#
CONFIG_GCOV_KERNEL=y
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
CONFIG_GCOV_PROFILE_ALL=y
CONFIG_GCOV_FORMAT_AUTODETECT=y
# CONFIG_GCOV_FORMAT_3_4 is not set
# CONFIG_GCOV_FORMAT_4_7 is not set
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
# CONFIG_MODULE_SIG is not set
# CONFIG_MODULE_COMPRESS is not set
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_BLK_DEV_BSGLIB is not set
# CONFIG_BLK_DEV_INTEGRITY is not set
# CONFIG_BLK_CMDLINE_PARSER is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_BLOCK_COMPAT=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_DEADLINE is not set
CONFIG_IOSCHED_CFQ=y
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"
CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_LOCK_SPIN_ON_OWNER=y
CONFIG_FREEZER=y

#
# Platform selection
#
# CONFIG_ARCH_SUNXI is not set
# CONFIG_ARCH_ALPINE is not set
CONFIG_ARCH_BCM_IPROC=y
CONFIG_ARCH_BERLIN=y
CONFIG_ARCH_EXYNOS=y
CONFIG_ARCH_LAYERSCAPE=y
CONFIG_ARCH_HISI=y
CONFIG_ARCH_MEDIATEK=y
# CONFIG_ARCH_MESON is not set
# CONFIG_ARCH_MVEBU is not set
CONFIG_ARCH_QCOM=y
CONFIG_ARCH_ROCKCHIP=y
CONFIG_ARCH_SEATTLE=y
CONFIG_ARCH_SHMOBILE=y
CONFIG_ARCH_RENESAS=y
CONFIG_ARCH_R8A7795=y
CONFIG_ARCH_STRATIX10=y
CONFIG_ARCH_TEGRA=y
CONFIG_ARCH_SPRD=y
CONFIG_ARCH_THUNDER=y
CONFIG_ARCH_UNIPHIER=y
CONFIG_ARCH_VEXPRESS=y
# CONFIG_ARCH_VULCAN is not set
CONFIG_ARCH_XGENE=y
CONFIG_ARCH_ZYNQMP=y

#
# Bus support
#
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DOMAINS_GENERIC=y
CONFIG_PCI_SYSCALL=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCIEAER=y
# CONFIG_PCIE_ECRC is not set
# CONFIG_PCIEAER_INJECT is not set
CONFIG_PCIEASPM=y
# CONFIG_PCIEASPM_DEBUG is not set
CONFIG_PCIEASPM_DEFAULT=y
# CONFIG_PCIEASPM_POWERSAVE is not set
# CONFIG_PCIEASPM_PERFORMANCE is not set
CONFIG_PCIE_PME=y
CONFIG_PCI_BUS_ADDR_T_64BIT=y
CONFIG_PCI_MSI=y
CONFIG_PCI_MSI_IRQ_DOMAIN=y
# CONFIG_PCI_DEBUG is not set
# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set
# CONFIG_PCI_STUB is not set
CONFIG_PCI_ATS=y
CONFIG_PCI_IOV=y
# CONFIG_PCI_PRI is not set
# CONFIG_PCI_PASID is not set
CONFIG_PCI_LABEL=y
# CONFIG_HOTPLUG_PCI is not set

#
# PCI host controller drivers
#
# CONFIG_PCIE_XILINX_NWL is not set
# CONFIG_PCIE_DW_PLAT is not set
CONFIG_PCIE_DW=y
CONFIG_PCI_RCAR_GEN2_PCIE=y
CONFIG_PCI_HOST_COMMON=y
CONFIG_PCI_HOST_GENERIC=y
CONFIG_PCI_XGENE=y
CONFIG_PCI_XGENE_MSI=y
CONFIG_PCI_LAYERSCAPE=y
CONFIG_PCIE_IPROC=y
CONFIG_PCIE_IPROC_PLATFORM=y
CONFIG_PCIE_IPROC_MSI=y
CONFIG_PCI_HISI=y
CONFIG_PCIE_QCOM=y
# CONFIG_PCI_HOST_THUNDER_PEM is not set
# CONFIG_PCI_HOST_THUNDER_ECAM is not set

#
# Kernel Features
#

#
# ARM errata workarounds via the alternatives framework
#
CONFIG_ARM64_ERRATUM_826319=y
CONFIG_ARM64_ERRATUM_827319=y
CONFIG_ARM64_ERRATUM_824069=y
CONFIG_ARM64_ERRATUM_819472=y
CONFIG_ARM64_ERRATUM_832075=y
CONFIG_ARM64_ERRATUM_834220=y
CONFIG_ARM64_ERRATUM_845719=y
CONFIG_ARM64_ERRATUM_843419=y
CONFIG_CAVIUM_ERRATUM_22375=y
CONFIG_CAVIUM_ERRATUM_23154=y
CONFIG_CAVIUM_ERRATUM_27456=y
# CONFIG_ARM64_4K_PAGES is not set
# CONFIG_ARM64_16K_PAGES is not set
CONFIG_ARM64_64K_PAGES=y
# CONFIG_ARM64_VA_BITS_42 is not set
CONFIG_ARM64_VA_BITS_48=y
CONFIG_ARM64_VA_BITS=48
# CONFIG_CPU_BIG_ENDIAN is not set
CONFIG_SCHED_MC=y
CONFIG_SCHED_SMT=y
CONFIG_NR_CPUS=8
CONFIG_HOTPLUG_CPU=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_COUNT=y
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250
CONFIG_SCHED_HRTICK=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_HAVE_ARCH_PFN_VALID=y
CONFIG_HW_PERF_EVENTS=y
CONFIG_SYS_SUPPORTS_HUGETLBFS=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_NO_BOOTMEM=y
CONFIG_MEMORY_ISOLATION=y
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_MEMORY_BALLOON=y
CONFIG_BALLOON_COMPACTION=y
CONFIG_COMPACTION=y
CONFIG_MIGRATION=y
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
# CONFIG_CLEANCACHE is not set
# CONFIG_FRONTSWAP is not set
CONFIG_CMA=y
# CONFIG_CMA_DEBUG is not set
# CONFIG_CMA_DEBUGFS is not set
CONFIG_CMA_AREAS=7
# CONFIG_ZPOOL is not set
# CONFIG_ZBUD is not set
# CONFIG_ZSMALLOC is not set
CONFIG_GENERIC_EARLY_IOREMAP=y
# CONFIG_IDLE_PAGE_TRACKING is not set
# CONFIG_SECCOMP is not set
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
# CONFIG_XEN is not set
CONFIG_FORCE_MAX_ZONEORDER=14
# CONFIG_ARMV8_DEPRECATED is not set

#
# ARMv8.1 architectural features
#
CONFIG_ARM64_HW_AFDBM=y
CONFIG_ARM64_PAN=y
# CONFIG_ARM64_LSE_ATOMICS is not set
CONFIG_ARM64_VHE=y

#
# ARMv8.2 architectural features
#
CONFIG_ARM64_UAO=y
CONFIG_ARM64_MODULE_CMODEL_LARGE=y
# CONFIG_RANDOMIZE_BASE is not set

#
# Boot options
#
CONFIG_ARM64_ACPI_PARKING_PROTOCOL=y
CONFIG_CMDLINE="console=ttyAMA0"
# CONFIG_CMDLINE_FORCE is not set
CONFIG_EFI_STUB=y
CONFIG_EFI=y
CONFIG_DMI=y

#
# Userspace binary formats
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_BINFMT_SCRIPT=y
# CONFIG_HAVE_AOUT is not set
# CONFIG_BINFMT_MISC is not set
CONFIG_COREDUMP=y
CONFIG_COMPAT=y
CONFIG_SYSVIPC_COMPAT=y

#
# Power management options
#
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
# CONFIG_SUSPEND_SKIP_SYNC is not set
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
CONFIG_PM_CLK=y
CONFIG_PM_GENERIC_DOMAINS=y
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
CONFIG_PM_GENERIC_DOMAINS_OF=y
CONFIG_CPU_PM=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y

#
# CPU Power Management
#

#
# CPU Idle
#
# CONFIG_CPU_IDLE is not set
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

#
# CPU frequency scaling drivers
#
# CONFIG_CPUFREQ_DT is not set
# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set
# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
# CONFIG_ARM_MT8173_CPUFREQ is not set
# CONFIG_ARM_TEGRA20_CPUFREQ is not set
CONFIG_ACPI_CPPC_CPUFREQ=y
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_DIAG is not set
CONFIG_UNIX=y
# CONFIG_UNIX_DIAG is not set
CONFIG_XFRM=y
# CONFIG_XFRM_USER is not set
# CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_XFRM_MIGRATE is not set
# CONFIG_XFRM_STATISTICS is not set
# CONFIG_NET_KEY is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE_DEMUX is not set
# CONFIG_NET_IP_TUNNEL is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_NET_IPVTI is not set
# CONFIG_NET_UDP_TUNNEL is not set
# CONFIG_NET_FOU is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
CONFIG_INET_XFRM_MODE_TRANSPORT=y
CONFIG_INET_XFRM_MODE_TUNNEL=y
CONFIG_INET_XFRM_MODE_BEET=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_INET_UDP_DIAG is not set
# CONFIG_INET_DIAG_DESTROY is not set
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set
# CONFIG_NETLABEL is not set
# CONFIG_NETWORK_SECMARK is not set
CONFIG_NET_PTP_CLASSIFY=y
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
# CONFIG_NETFILTER is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_RDS is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_L2TP is not set
# CONFIG_BRIDGE is not set
CONFIG_HAVE_NET_DSA=y
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
# CONFIG_NET_SCHED is not set
# CONFIG_DCB is not set
CONFIG_DNS_RESOLVER=y
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
# CONFIG_VSOCKETS is not set
# CONFIG_NETLINK_DIAG is not set
# CONFIG_MPLS is not set
# CONFIG_HSR is not set
# CONFIG_NET_SWITCHDEV is not set
# CONFIG_NET_L3_MASTER_DEV is not set
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
CONFIG_XPS=y
# CONFIG_SOCK_CGROUP_DATA is not set
# CONFIG_CGROUP_NET_PRIO is not set
# CONFIG_CGROUP_NET_CLASSID is not set
CONFIG_NET_RX_BUSY_POLL=y
CONFIG_BQL=y
CONFIG_BPF_JIT=y
CONFIG_NET_FLOW_LIMIT=y

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NET_DROP_MONITOR is not set
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set
# CONFIG_AF_KCM is not set
# CONFIG_WIRELESS is not set
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
# CONFIG_RFKILL_REGULATOR is not set
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
# CONFIG_NET_9P_DEBUG is not set
# CONFIG_CAIF is not set
# CONFIG_CEPH_LIB is not set
# CONFIG_NFC is not set
# CONFIG_LWTUNNEL is not set
# CONFIG_DST_CACHE is not set
# CONFIG_NET_DEVLINK is not set
CONFIG_MAY_USE_DEVLINK=y
CONFIG_HAVE_BPF_JIT=y

#
# Device Drivers
#
CONFIG_ARM_AMBA=y
CONFIG_TEGRA_AHB=y

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
CONFIG_ALLOW_DEV_COREDUMP=y
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_GENERIC_CPU_DEVICES is not set
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_MMIO=y
# CONFIG_DMA_SHARED_BUFFER is not set
CONFIG_DMA_CMA=y

#
# Default contiguous memory area size:
#
CONFIG_CMA_SIZE_MBYTES=16
CONFIG_CMA_SIZE_SEL_MBYTES=y
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
# CONFIG_CMA_SIZE_SEL_MIN is not set
# CONFIG_CMA_SIZE_SEL_MAX is not set
CONFIG_CMA_ALIGNMENT=8

#
# Bus devices
#
# CONFIG_ARM_CCI400_PMU is not set
# CONFIG_ARM_CCI5xx_PMU is not set
# CONFIG_ARM_CCN is not set
# CONFIG_SIMPLE_PM_BUS is not set
CONFIG_UNIPHIER_SYSTEM_BUS=y
CONFIG_VEXPRESS_CONFIG=y
# CONFIG_CONNECTOR is not set
# CONFIG_MTD is not set
CONFIG_DTC=y
CONFIG_OF=y
# CONFIG_OF_UNITTEST is not set
CONFIG_OF_FLATTREE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_ADDRESS_PCI=y
CONFIG_OF_IRQ=y
CONFIG_OF_NET=y
CONFIG_OF_MDIO=y
CONFIG_OF_PCI=y
CONFIG_OF_PCI_IRQ=y
CONFIG_OF_RESERVED_MEM=y
# CONFIG_OF_OVERLAY is not set
# CONFIG_PARPORT is not set
CONFIG_PNP=y
CONFIG_PNP_DEBUG_MESSAGES=y

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_NULL_BLK is not set
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_DRBD is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_SKD is not set
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
CONFIG_VIRTIO_BLK=y
# CONFIG_BLK_DEV_RBD is not set
# CONFIG_BLK_DEV_RSXX is not set
# CONFIG_BLK_DEV_NVME is not set

#
# Misc devices
#
# CONFIG_SENSORS_LIS3LV02D is not set
# CONFIG_AD525X_DPOT is not set
# CONFIG_DUMMY_IRQ is not set
# CONFIG_PHANTOM is not set
# CONFIG_SGI_IOC4 is not set
# CONFIG_TIFM_CORE is not set
# CONFIG_ICS932S401 is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HP_ILO is not set
# CONFIG_APDS9802ALS is not set
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
# CONFIG_SENSORS_TSL2550 is not set
# CONFIG_SENSORS_BH1780 is not set
# CONFIG_SENSORS_BH1770 is not set
# CONFIG_SENSORS_APDS990X is not set
# CONFIG_HMC6352 is not set
# CONFIG_DS1682 is not set
# CONFIG_TI_DAC7512 is not set
# CONFIG_BMP085_I2C is not set
# CONFIG_BMP085_SPI is not set
# CONFIG_USB_SWITCH_FSA9480 is not set
# CONFIG_LATTICE_ECP3_CONFIG is not set
# CONFIG_SRAM is not set
CONFIG_VEXPRESS_SYSCFG=y
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_AT24 is not set
# CONFIG_EEPROM_AT25 is not set
# CONFIG_EEPROM_LEGACY is not set
# CONFIG_EEPROM_MAX6875 is not set
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_EEPROM_93XX46 is not set
# CONFIG_CB710_CORE is not set

#
# Texas Instruments shared transport line discipline
#
# CONFIG_TI_ST is not set
# CONFIG_SENSORS_LIS3_I2C is not set

#
# Altera FPGA firmware download module
#
# CONFIG_ALTERA_STAPL is not set

#
# Intel MIC Bus Driver
#

#
# SCIF Bus Driver
#

#
# VOP Bus Driver
#

#
# Intel MIC Host Driver
#

#
# Intel MIC Card Driver
#

#
# SCIF Driver
#

#
# Intel MIC Coprocessor State Management (COSM) Drivers
#

#
# VOP Driver
#
# CONFIG_GENWQE is not set
# CONFIG_ECHO is not set
# CONFIG_CXL_BASE is not set
# CONFIG_CXL_KERNEL_API is not set
# CONFIG_CXL_EEH is not set

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
# CONFIG_SCSI_NETLINK is not set
# CONFIG_SCSI_MQ_DEFAULT is not set
# CONFIG_SCSI_PROC_FS is not set

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
# CONFIG_BLK_DEV_SR is not set
# CONFIG_CHR_DEV_SG is not set
# CONFIG_CHR_DEV_SCH is not set
# CONFIG_SCSI_CONSTANTS is not set
# CONFIG_SCSI_LOGGING is not set
# CONFIG_SCSI_SCAN_ASYNC is not set

#
# SCSI Transports
#
# CONFIG_SCSI_SPI_ATTRS is not set
# CONFIG_SCSI_FC_ATTRS is not set
# CONFIG_SCSI_ISCSI_ATTRS is not set
# CONFIG_SCSI_SAS_ATTRS is not set
# CONFIG_SCSI_SAS_LIBSAS is not set
# CONFIG_SCSI_SRP_ATTRS is not set
# CONFIG_SCSI_LOWLEVEL is not set
# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
# CONFIG_SCSI_DH is not set
# CONFIG_SCSI_OSD_INITIATOR is not set
CONFIG_HAVE_PATA_PLATFORM=y
CONFIG_ATA=y
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_ATA_ACPI=y
# CONFIG_SATA_ZPODD is not set
CONFIG_SATA_PMP=y

#
# Controllers with non-SFF native interface
#
CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y
CONFIG_AHCI_CEVA=y
# CONFIG_AHCI_TEGRA is not set
CONFIG_AHCI_XGENE=y
# CONFIG_AHCI_QORIQ is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_SATA_ACARD_AHCI is not set
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y

#
# SFF controllers with custom DMA interface
#
# CONFIG_PDC_ADMA is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_SX4 is not set
CONFIG_ATA_BMDMA=y

#
# SATA SFF controllers with BMDMA
#
# CONFIG_ATA_PIIX is not set
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_SATA_PROMISE is not set
CONFIG_SATA_RCAR=y
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_SVW is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set

#
# PATA SFF controllers with BMDMA
#
# CONFIG_PATA_ALI is not set
# CONFIG_PATA_AMD is not set
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87415 is not set
# CONFIG_PATA_OLDPIIX is not set
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
# CONFIG_PATA_SCH is not set
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set

#
# PIO-only SFF controllers
#
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_OPTI is not set
CONFIG_PATA_PLATFORM=y
CONFIG_PATA_OF_PLATFORM=y
# CONFIG_PATA_RZ1000 is not set

#
# Generic fallback / legacy drivers
#
# CONFIG_PATA_ACPI is not set
# CONFIG_ATA_GENERIC is not set
# CONFIG_PATA_LEGACY is not set
# CONFIG_MD is not set
# CONFIG_TARGET_CORE is not set
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#
# CONFIG_FIREWIRE is not set
# CONFIG_FIREWIRE_NOSY is not set
CONFIG_NETDEVICES=y
CONFIG_MII=y
CONFIG_NET_CORE=y
# CONFIG_BONDING is not set
# CONFIG_DUMMY is not set
# CONFIG_EQUALIZER is not set
# CONFIG_NET_FC is not set
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_VXLAN is not set
# CONFIG_MACSEC is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
CONFIG_TUN=y
# CONFIG_TUN_VNET_CROSS_LE is not set
# CONFIG_VETH is not set
CONFIG_VIRTIO_NET=y
# CONFIG_NLMON is not set
# CONFIG_ARCNET is not set

#
# CAIF transport drivers
#
CONFIG_VHOST_NET=m
CONFIG_VHOST_RING=m
CONFIG_VHOST=m
# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set

#
# Distributed Switch Architecture drivers
#
# CONFIG_NET_DSA_MV88E6XXX is not set
# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set
CONFIG_ETHERNET=y
CONFIG_NET_VENDOR_3COM=y
# CONFIG_VORTEX is not set
# CONFIG_TYPHOON is not set
CONFIG_NET_VENDOR_ADAPTEC=y
# CONFIG_ADAPTEC_STARFIRE is not set
CONFIG_NET_VENDOR_AGERE=y
# CONFIG_ET131X is not set
CONFIG_NET_VENDOR_ALTEON=y
# CONFIG_ACENIC is not set
# CONFIG_ALTERA_TSE is not set
CONFIG_NET_VENDOR_AMD=y
# CONFIG_AMD8111_ETH is not set
# CONFIG_PCNET32 is not set
CONFIG_AMD_XGBE=y
CONFIG_NET_XGENE=y
CONFIG_NET_VENDOR_ARC=y
# CONFIG_ARC_EMAC is not set
# CONFIG_EMAC_ROCKCHIP is not set
CONFIG_NET_VENDOR_ATHEROS=y
# CONFIG_ATL2 is not set
# CONFIG_ATL1 is not set
# CONFIG_ATL1E is not set
# CONFIG_ATL1C is not set
# CONFIG_ALX is not set
# CONFIG_NET_VENDOR_AURORA is not set
CONFIG_NET_CADENCE=y
# CONFIG_MACB is not set
CONFIG_NET_VENDOR_BROADCOM=y
# CONFIG_B44 is not set
# CONFIG_BCMGENET is not set
# CONFIG_BNX2 is not set
# CONFIG_CNIC is not set
# CONFIG_TIGON3 is not set
# CONFIG_BNX2X is not set
# CONFIG_SYSTEMPORT is not set
# CONFIG_BNXT is not set
CONFIG_NET_VENDOR_BROCADE=y
# CONFIG_BNA is not set
CONFIG_NET_VENDOR_CAVIUM=y
# CONFIG_THUNDER_NIC_PF is not set
# CONFIG_THUNDER_NIC_VF is not set
# CONFIG_THUNDER_NIC_BGX is not set
# CONFIG_LIQUIDIO is not set
CONFIG_NET_VENDOR_CHELSIO=y
# CONFIG_CHELSIO_T1 is not set
# CONFIG_CHELSIO_T3 is not set
# CONFIG_CHELSIO_T4 is not set
# CONFIG_CHELSIO_T4VF is not set
CONFIG_NET_VENDOR_CISCO=y
# CONFIG_ENIC is not set
# CONFIG_DNET is not set
CONFIG_NET_VENDOR_DEC=y
# CONFIG_NET_TULIP is not set
CONFIG_NET_VENDOR_DLINK=y
# CONFIG_DL2K is not set
# CONFIG_SUNDANCE is not set
CONFIG_NET_VENDOR_EMULEX=y
# CONFIG_BE2NET is not set
CONFIG_NET_VENDOR_EZCHIP=y
# CONFIG_EZCHIP_NPS_MANAGEMENT_ENET is not set
CONFIG_NET_VENDOR_EXAR=y
# CONFIG_S2IO is not set
# CONFIG_VXGE is not set
CONFIG_NET_VENDOR_FREESCALE=y
# CONFIG_FSL_PQ_MDIO is not set
# CONFIG_FSL_XGMAC_MDIO is not set
# CONFIG_GIANFAR is not set
CONFIG_NET_VENDOR_HISILICON=y
# CONFIG_HIX5HD2_GMAC is not set
# CONFIG_HIP04_ETH is not set
# CONFIG_HNS is not set
# CONFIG_HNS_DSAF is not set
# CONFIG_HNS_ENET is not set
CONFIG_NET_VENDOR_HP=y
# CONFIG_HP100 is not set
CONFIG_NET_VENDOR_INTEL=y
# CONFIG_E100 is not set
# CONFIG_E1000 is not set
CONFIG_E1000E=y
CONFIG_IGB=y
CONFIG_IGBVF=y
# CONFIG_IXGB is not set
# CONFIG_IXGBE is not set
# CONFIG_IXGBEVF is not set
# CONFIG_I40E is not set
# CONFIG_I40EVF is not set
# CONFIG_FM10K is not set
CONFIG_NET_VENDOR_I825XX=y
# CONFIG_JME is not set
CONFIG_NET_VENDOR_MARVELL=y
# CONFIG_MVMDIO is not set
# CONFIG_MVNETA_BM is not set
# CONFIG_PXA168_ETH is not set
# CONFIG_SKGE is not set
CONFIG_SKY2=y
# CONFIG_SKY2_DEBUG is not set
# CONFIG_NET_VENDOR_MEDIATEK is not set
CONFIG_NET_VENDOR_MELLANOX=y
# CONFIG_MLX4_EN is not set
# CONFIG_MLX4_CORE is not set
# CONFIG_MLX5_CORE is not set
# CONFIG_MLXSW_CORE is not set
CONFIG_NET_VENDOR_MICREL=y
# CONFIG_KS8842 is not set
# CONFIG_KS8851 is not set
# CONFIG_KS8851_MLL is not set
# CONFIG_KSZ884X_PCI is not set
CONFIG_NET_VENDOR_MICROCHIP=y
# CONFIG_ENC28J60 is not set
# CONFIG_ENCX24J600 is not set
CONFIG_NET_VENDOR_MYRI=y
# CONFIG_MYRI10GE is not set
# CONFIG_FEALNX is not set
CONFIG_NET_VENDOR_NATSEMI=y
# CONFIG_NATSEMI is not set
# CONFIG_NS83820 is not set
CONFIG_NET_VENDOR_NETRONOME=y
# CONFIG_NFP_NETVF is not set
CONFIG_NET_VENDOR_8390=y
# CONFIG_NE2K_PCI is not set
CONFIG_NET_VENDOR_NVIDIA=y
# CONFIG_FORCEDETH is not set
CONFIG_NET_VENDOR_OKI=y
# CONFIG_ETHOC is not set
CONFIG_NET_PACKET_ENGINE=y
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
CONFIG_NET_VENDOR_QLOGIC=y
# CONFIG_QLA3XXX is not set
# CONFIG_QLCNIC is not set
# CONFIG_QLGE is not set
# CONFIG_NETXEN_NIC is not set
# CONFIG_QED is not set
CONFIG_NET_VENDOR_QUALCOMM=y
# CONFIG_QCA7000 is not set
CONFIG_NET_VENDOR_REALTEK=y
# CONFIG_8139CP is not set
# CONFIG_8139TOO is not set
# CONFIG_R8169 is not set
CONFIG_NET_VENDOR_RENESAS=y
# CONFIG_SH_ETH is not set
CONFIG_RAVB=y
CONFIG_NET_VENDOR_RDC=y
# CONFIG_R6040 is not set
CONFIG_NET_VENDOR_ROCKER=y
CONFIG_NET_VENDOR_SAMSUNG=y
# CONFIG_SXGBE_ETH is not set
CONFIG_NET_VENDOR_SEEQ=y
CONFIG_NET_VENDOR_SILAN=y
# CONFIG_SC92031 is not set
CONFIG_NET_VENDOR_SIS=y
# CONFIG_SIS900 is not set
# CONFIG_SIS190 is not set
# CONFIG_SFC is not set
CONFIG_NET_VENDOR_SMSC=y
CONFIG_SMC91X=y
# CONFIG_EPIC100 is not set
CONFIG_SMSC911X=y
# CONFIG_SMSC911X_ARCH_HOOKS is not set
# CONFIG_SMSC9420 is not set
CONFIG_NET_VENDOR_STMICRO=y
# CONFIG_STMMAC_ETH is not set
CONFIG_NET_VENDOR_SUN=y
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_CASSINI is not set
# CONFIG_NIU is not set
CONFIG_NET_VENDOR_SYNOPSYS=y
# CONFIG_SYNOPSYS_DWC_ETH_QOS is not set
CONFIG_NET_VENDOR_TEHUTI=y
# CONFIG_TEHUTI is not set
CONFIG_NET_VENDOR_TI=y
# CONFIG_TI_CPSW_ALE is not set
# CONFIG_TLAN is not set
CONFIG_NET_VENDOR_VIA=y
# CONFIG_VIA_RHINE is not set
# CONFIG_VIA_VELOCITY is not set
CONFIG_NET_VENDOR_WIZNET=y
# CONFIG_WIZNET_W5100 is not set
# CONFIG_WIZNET_W5300 is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_NET_SB1000 is not set
CONFIG_PHYLIB=y

#
# MII PHY device drivers
#
# CONFIG_AQUANTIA_PHY is not set
# CONFIG_AT803X_PHY is not set
# CONFIG_AMD_PHY is not set
# CONFIG_MARVELL_PHY is not set
# CONFIG_DAVICOM_PHY is not set
# CONFIG_QSEMI_PHY is not set
# CONFIG_LXT_PHY is not set
# CONFIG_CICADA_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_TERANETICS_PHY is not set
# CONFIG_SMSC_PHY is not set
# CONFIG_BROADCOM_PHY is not set
# CONFIG_BCM7XXX_PHY is not set
# CONFIG_BCM87XX_PHY is not set
# CONFIG_ICPLUS_PHY is not set
# CONFIG_REALTEK_PHY is not set
# CONFIG_NATIONAL_PHY is not set
# CONFIG_STE10XP is not set
# CONFIG_LSI_ET1011C_PHY is not set
CONFIG_MICREL_PHY=y
# CONFIG_DP83848_PHY is not set
# CONFIG_DP83867_PHY is not set
# CONFIG_MICROCHIP_PHY is not set
# CONFIG_FIXED_PHY is not set
CONFIG_MDIO_BITBANG=y
# CONFIG_MDIO_GPIO is not set
# CONFIG_MDIO_OCTEON is not set
# CONFIG_MDIO_THUNDER is not set
# CONFIG_MDIO_BUS_MUX_GPIO is not set
# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
# CONFIG_MDIO_BCM_UNIMAC is not set
# CONFIG_MDIO_BCM_IPROC is not set
# CONFIG_MICREL_KS8995MA is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
CONFIG_USB_NET_DRIVERS=y
# CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_RTL8152 is not set
# CONFIG_USB_LAN78XX is not set
# CONFIG_USB_USBNET is not set
# CONFIG_USB_IPHETH is not set
# CONFIG_WLAN is not set

#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#
# CONFIG_WAN is not set
# CONFIG_VMXNET3 is not set
# CONFIG_FUJITSU_ES is not set
# CONFIG_ISDN is not set
# CONFIG_NVM is not set

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_LEDS=y
# CONFIG_INPUT_FF_MEMLESS is not set
# CONFIG_INPUT_POLLDEV is not set
# CONFIG_INPUT_SPARSEKMAP is not set
# CONFIG_INPUT_MATRIXKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ADP5588 is not set
# CONFIG_KEYBOARD_ADP5589 is not set
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_QT1070 is not set
# CONFIG_KEYBOARD_QT2160 is not set
# CONFIG_KEYBOARD_LKKBD is not set
CONFIG_KEYBOARD_GPIO=y
# CONFIG_KEYBOARD_GPIO_POLLED is not set
# CONFIG_KEYBOARD_TCA6416 is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_MATRIX is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_LM8333 is not set
# CONFIG_KEYBOARD_MAX7359 is not set
# CONFIG_KEYBOARD_MCS is not set
# CONFIG_KEYBOARD_MPR121 is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_TEGRA is not set
# CONFIG_KEYBOARD_OPENCORES is not set
# CONFIG_KEYBOARD_SAMSUNG is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_SH_KEYSC is not set
# CONFIG_KEYBOARD_OMAP4 is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_CAP11XX is not set
# CONFIG_KEYBOARD_BCM is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=y
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_BYD=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_CYPRESS=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
# CONFIG_MOUSE_PS2_ELANTECH is not set
# CONFIG_MOUSE_PS2_SENTELIC is not set
# CONFIG_MOUSE_PS2_TOUCHKIT is not set
CONFIG_MOUSE_PS2_FOCALTECH=y
# CONFIG_MOUSE_SERIAL is not set
# CONFIG_MOUSE_APPLETOUCH is not set
# CONFIG_MOUSE_BCM5974 is not set
# CONFIG_MOUSE_CYAPA is not set
# CONFIG_MOUSE_ELAN_I2C is not set
# CONFIG_MOUSE_VSXXXAA is not set
# CONFIG_MOUSE_GPIO is not set
# CONFIG_MOUSE_SYNAPTICS_I2C is not set
# CONFIG_MOUSE_SYNAPTICS_USB is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set
# CONFIG_RMI4_CORE is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
# CONFIG_SERIO_SERPORT is not set
CONFIG_SERIO_AMBAKMI=y
# CONFIG_SERIO_PCIPS2 is not set
CONFIG_SERIO_LIBPS2=y
# CONFIG_SERIO_RAW is not set
# CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_SERIO_PS2MULT is not set
# CONFIG_SERIO_ARC_PS2 is not set
# CONFIG_SERIO_APBPS2 is not set
# CONFIG_USERIO is not set
# CONFIG_GAMEPORT is not set

#
# Character devices
#
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=16
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_NOZOMI is not set
# CONFIG_N_GSM is not set
# CONFIG_TRACE_SINK is not set
CONFIG_DEVMEM=y
CONFIG_DEVKMEM=y

#
# Serial drivers
#
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set
CONFIG_SERIAL_8250_FSL=y
CONFIG_SERIAL_8250_DW=y
# CONFIG_SERIAL_8250_FINTEK is not set
CONFIG_SERIAL_8250_MT6577=y
CONFIG_SERIAL_8250_UNIPHIER=y
# CONFIG_SERIAL_8250_MID is not set
# CONFIG_SERIAL_8250_MOXA is not set
CONFIG_SERIAL_OF_PLATFORM=y

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_AMBA_PL010 is not set
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set
CONFIG_SERIAL_SAMSUNG=y
CONFIG_SERIAL_SAMSUNG_UARTS_4=y
CONFIG_SERIAL_SAMSUNG_UARTS=4
CONFIG_SERIAL_SAMSUNG_CONSOLE=y
CONFIG_SERIAL_TEGRA=y
# CONFIG_SERIAL_MAX3100 is not set
# CONFIG_SERIAL_MAX310X is not set
# CONFIG_SERIAL_UARTLITE is not set
CONFIG_SERIAL_SH_SCI=y
CONFIG_SERIAL_SH_SCI_NR_UARTS=11
CONFIG_SERIAL_SH_SCI_CONSOLE=y
# CONFIG_SERIAL_SH_SCI_EARLYCON is not set
# CONFIG_SERIAL_SH_SCI_DMA is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
CONFIG_SERIAL_MSM=y
CONFIG_SERIAL_MSM_CONSOLE=y
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_SC16IS7XX is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_IFX6X60 is not set
CONFIG_SERIAL_XILINX_PS_UART=y
CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_RP2 is not set
# CONFIG_SERIAL_FSL_LPUART is not set
# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
# CONFIG_SERIAL_SPRD is not set
# CONFIG_SERIAL_MVEBU_UART is not set
# CONFIG_TTY_PRINTK is not set
CONFIG_HVC_DRIVER=y
# CONFIG_HVC_DCC is not set
CONFIG_VIRTIO_CONSOLE=y
# CONFIG_IPMI_HANDLER is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set

#
# PCMCIA character devices
#
# CONFIG_RAW_DRIVER is not set
# CONFIG_HPET is not set
# CONFIG_TCG_TPM is not set
CONFIG_DEVPORT=y
# CONFIG_XILLYBUS is not set

#
# I2C support
#
CONFIG_I2C=y
CONFIG_ACPI_I2C_OPREGION=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
# CONFIG_I2C_CHARDEV is not set
# CONFIG_I2C_MUX is not set
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=y

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_I801 is not set
# CONFIG_I2C_ISCH is not set
# CONFIG_I2C_PIIX4 is not set
# CONFIG_I2C_NFORCE2 is not set
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set

#
# ACPI drivers
#
# CONFIG_I2C_SCMI is not set

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
CONFIG_I2C_BCM_IPROC=y
# CONFIG_I2C_CADENCE is not set
# CONFIG_I2C_CBUS_GPIO is not set
# CONFIG_I2C_DESIGNWARE_PLATFORM is not set
# CONFIG_I2C_DESIGNWARE_PCI is not set
# CONFIG_I2C_EMEV2 is not set
CONFIG_I2C_EXYNOS5=y
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_IMX is not set
# CONFIG_I2C_MT65XX is not set
# CONFIG_I2C_NOMADIK is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_PXA_PCI is not set
CONFIG_I2C_QUP=y
# CONFIG_I2C_RIIC is not set
# CONFIG_I2C_RK3X is not set
# CONFIG_I2C_SH_MOBILE is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_TEGRA is not set
# CONFIG_I2C_UNIPHIER is not set
CONFIG_I2C_UNIPHIER_F=y
# CONFIG_I2C_VERSATILE is not set
# CONFIG_I2C_XILINX is not set
CONFIG_I2C_RCAR=y

#
# External I2C/SMBus adapter drivers
#
# CONFIG_I2C_DIOLAN_U2C is not set
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_ROBOTFUZZ_OSIF is not set
# CONFIG_I2C_TAOS_EVM is not set
# CONFIG_I2C_TINY_USB is not set

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_XGENE_SLIMPRO is not set
# CONFIG_I2C_STUB is not set
CONFIG_I2C_SLAVE=y
# CONFIG_I2C_SLAVE_EEPROM is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_AXI_SPI_ENGINE is not set
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_CADENCE is not set
# CONFIG_SPI_DESIGNWARE is not set
# CONFIG_SPI_GPIO is not set
# CONFIG_SPI_FSL_SPI is not set
# CONFIG_SPI_FSL_DSPI is not set
# CONFIG_SPI_MT65XX is not set
# CONFIG_SPI_OC_TINY is not set
CONFIG_SPI_PL022=y
# CONFIG_SPI_PXA2XX is not set
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_ROCKCHIP is not set
# CONFIG_SPI_RSPI is not set
CONFIG_SPI_QUP=y
# CONFIG_SPI_S3C64XX is not set
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_SH_MSIOF is not set
# CONFIG_SPI_SH_HSPI is not set
# CONFIG_SPI_TEGRA114 is not set
# CONFIG_SPI_TEGRA20_SFLASH is not set
# CONFIG_SPI_TEGRA20_SLINK is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_ZYNQMP_GQSPI is not set

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_LOOPBACK_TEST is not set
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_SPMI is not set
# CONFIG_HSI is not set

#
# PPS support
#
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set
# CONFIG_NTP_PPS is not set

#
# PPS clients support
#
# CONFIG_PPS_CLIENT_KTIMER is not set
# CONFIG_PPS_CLIENT_LDISC is not set
# CONFIG_PPS_CLIENT_GPIO is not set

#
# PPS generators support
#

#
# PTP clock support
#
CONFIG_PTP_1588_CLOCK=y

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
CONFIG_PINCTRL=y

#
# Pin controllers
#
CONFIG_PINMUX=y
CONFIG_PINCONF=y
CONFIG_GENERIC_PINCONF=y
# CONFIG_DEBUG_PINCTRL is not set
# CONFIG_PINCTRL_AMD is not set
CONFIG_PINCTRL_ROCKCHIP=y
# CONFIG_PINCTRL_SINGLE is not set
CONFIG_PINCTRL_IPROC_GPIO=y
# CONFIG_PINCTRL_BERLIN_BG2 is not set
# CONFIG_PINCTRL_BERLIN_BG2CD is not set
# CONFIG_PINCTRL_BERLIN_BG2Q is not set
# CONFIG_PINCTRL_BERLIN_BG4CT is not set
# CONFIG_PINCTRL_BAYTRAIL is not set
# CONFIG_PINCTRL_CHERRYVIEW is not set
# CONFIG_PINCTRL_BROXTON is not set
# CONFIG_PINCTRL_SUNRISEPOINT is not set
CONFIG_PINCTRL_MSM=y
# CONFIG_PINCTRL_APQ8064 is not set
# CONFIG_PINCTRL_APQ8084 is not set
# CONFIG_PINCTRL_IPQ4019 is not set
# CONFIG_PINCTRL_IPQ8064 is not set
# CONFIG_PINCTRL_MSM8660 is not set
# CONFIG_PINCTRL_MSM8960 is not set
# CONFIG_PINCTRL_MSM8X74 is not set
CONFIG_PINCTRL_MSM8916=y
# CONFIG_PINCTRL_MSM8996 is not set
# CONFIG_PINCTRL_QDF2XXX is not set
# CONFIG_PINCTRL_QCOM_SSBI_PMIC is not set
CONFIG_PINCTRL_SAMSUNG=y
CONFIG_PINCTRL_EXYNOS=y
CONFIG_PINCTRL_SH_PFC=y
CONFIG_PINCTRL_PFC_R8A7795=y
CONFIG_PINCTRL_TEGRA_XUSB=y
CONFIG_PINCTRL_UNIPHIER=y
CONFIG_PINCTRL_UNIPHIER_LD4=y
CONFIG_PINCTRL_UNIPHIER_PRO4=y
CONFIG_PINCTRL_UNIPHIER_SLD8=y
CONFIG_PINCTRL_UNIPHIER_PRO5=y
CONFIG_PINCTRL_UNIPHIER_PXS2=y
CONFIG_PINCTRL_UNIPHIER_LD6B=y
CONFIG_PINCTRL_MTK=y
# CONFIG_PINCTRL_MT2701 is not set
# CONFIG_PINCTRL_MT7623 is not set
# CONFIG_PINCTRL_MT8135 is not set
# CONFIG_PINCTRL_MT8127 is not set
CONFIG_PINCTRL_MT8173=y
# CONFIG_PINCTRL_MT6397 is not set
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_ARCH_REQUIRE_GPIOLIB=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_DEVRES=y
CONFIG_OF_GPIO=y
CONFIG_GPIO_ACPI=y
CONFIG_GPIOLIB_IRQCHIP=y
# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_SYSFS is not set
CONFIG_GPIO_GENERIC=y

#
# Memory mapped GPIO drivers
#
# CONFIG_GPIO_74XX_MMIO is not set
# CONFIG_GPIO_ALTERA is not set
# CONFIG_GPIO_AMDPT is not set
# CONFIG_GPIO_DWAPB is not set
CONFIG_GPIO_GENERIC_PLATFORM=y
# CONFIG_GPIO_GRGPIO is not set
# CONFIG_GPIO_MPC8XXX is not set
CONFIG_GPIO_PL061=y
CONFIG_GPIO_RCAR=y
# CONFIG_GPIO_SYSCON is not set
# CONFIG_GPIO_VX855 is not set
CONFIG_GPIO_XGENE=y
# CONFIG_GPIO_XGENE_SB is not set
# CONFIG_GPIO_XILINX is not set
# CONFIG_GPIO_ZYNQ is not set
# CONFIG_GPIO_ZX is not set

#
# I2C GPIO expanders
#
# CONFIG_GPIO_ADP5588 is not set
# CONFIG_GPIO_ADNP is not set
# CONFIG_GPIO_MAX7300 is not set
# CONFIG_GPIO_MAX732X is not set
# CONFIG_GPIO_PCA953X is not set
# CONFIG_GPIO_PCF857X is not set
# CONFIG_GPIO_SX150X is not set
# CONFIG_GPIO_TPIC2810 is not set

#
# MFD GPIO expanders
#

#
# PCI GPIO expanders
#
# CONFIG_GPIO_AMD8111 is not set
# CONFIG_GPIO_BT8XX is not set
# CONFIG_GPIO_ML_IOH is not set
# CONFIG_GPIO_RDC321X is not set

#
# SPI GPIO expanders
#
# CONFIG_GPIO_74X164 is not set
# CONFIG_GPIO_MAX7301 is not set
# CONFIG_GPIO_MC33880 is not set
# CONFIG_GPIO_PISOSR is not set

#
# SPI or I2C GPIO expanders
#
# CONFIG_GPIO_MCP23S08 is not set

#
# USB GPIO expanders
#
# CONFIG_W1 is not set
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
# CONFIG_PDA_POWER is not set
# CONFIG_TEST_POWER is not set
# CONFIG_BATTERY_DS2780 is not set
# CONFIG_BATTERY_DS2781 is not set
# CONFIG_BATTERY_DS2782 is not set
# CONFIG_BATTERY_SBS is not set
# CONFIG_BATTERY_BQ27XXX is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
# CONFIG_CHARGER_MAX8903 is not set
# CONFIG_CHARGER_LP8727 is not set
# CONFIG_CHARGER_GPIO is not set
# CONFIG_CHARGER_MANAGER is not set
# CONFIG_CHARGER_BQ2415X is not set
# CONFIG_CHARGER_BQ24190 is not set
# CONFIG_CHARGER_BQ24257 is not set
# CONFIG_CHARGER_BQ24735 is not set
# CONFIG_CHARGER_BQ25890 is not set
# CONFIG_CHARGER_SMB347 is not set
# CONFIG_BATTERY_GAUGE_LTC2941 is not set
# CONFIG_CHARGER_RT9455 is not set
CONFIG_POWER_RESET=y
# CONFIG_POWER_RESET_GPIO is not set
# CONFIG_POWER_RESET_GPIO_RESTART is not set
# CONFIG_POWER_RESET_HISI is not set
# CONFIG_POWER_RESET_MSM is not set
# CONFIG_POWER_RESET_LTC2952 is not set
# CONFIG_POWER_RESET_RESTART is not set
CONFIG_POWER_RESET_VEXPRESS=y
CONFIG_POWER_RESET_XGENE=y
CONFIG_POWER_RESET_SYSCON=y
# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set
# CONFIG_POWER_AVS is not set
# CONFIG_HWMON is not set
CONFIG_THERMAL=y
CONFIG_THERMAL_OF=y
# CONFIG_THERMAL_WRITABLE_TRIPS is not set
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
# CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR is not set
# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
CONFIG_THERMAL_GOV_STEP_WISE=y
# CONFIG_THERMAL_GOV_BANG_BANG is not set
# CONFIG_THERMAL_GOV_USER_SPACE is not set
# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set
# CONFIG_CPU_THERMAL is not set
# CONFIG_THERMAL_EMULATION is not set
# CONFIG_ROCKCHIP_THERMAL is not set
# CONFIG_RCAR_THERMAL is not set
# CONFIG_TEGRA_SOCTHERM is not set
CONFIG_MTK_THERMAL=y

#
# Samsung thermal drivers
#
# CONFIG_EXYNOS_THERMAL is not set
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set
CONFIG_BCMA_POSSIBLE=y

#
# Broadcom specific AMBA
#
# CONFIG_BCMA is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_ACT8945A is not set
# CONFIG_MFD_AS3711 is not set
# CONFIG_MFD_AS3722 is not set
# CONFIG_PMIC_ADP5520 is not set
# CONFIG_MFD_AAT2870_CORE is not set
# CONFIG_MFD_ATMEL_FLEXCOM is not set
# CONFIG_MFD_ATMEL_HLCDC is not set
# CONFIG_MFD_BCM590XX is not set
# CONFIG_MFD_AXP20X_I2C is not set
# CONFIG_PMIC_DA903X is not set
# CONFIG_MFD_DA9052_SPI is not set
# CONFIG_MFD_DA9052_I2C is not set
# CONFIG_MFD_DA9055 is not set
# CONFIG_MFD_DA9062 is not set
# CONFIG_MFD_DA9063 is not set
# CONFIG_MFD_DA9150 is not set
# CONFIG_MFD_DLN2 is not set
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_MFD_HI6421_PMIC is not set
# CONFIG_HTC_PASIC3 is not set
# CONFIG_HTC_I2CPLD is not set
# CONFIG_LPC_ICH is not set
# CONFIG_LPC_SCH is not set
# CONFIG_INTEL_SOC_PMIC is not set
# CONFIG_MFD_JANZ_CMODIO is not set
# CONFIG_MFD_KEMPLD is not set
# CONFIG_MFD_88PM800 is not set
# CONFIG_MFD_88PM805 is not set
# CONFIG_MFD_88PM860X is not set
# CONFIG_MFD_MAX14577 is not set
# CONFIG_MFD_MAX77686 is not set
# CONFIG_MFD_MAX77693 is not set
# CONFIG_MFD_MAX77843 is not set
# CONFIG_MFD_MAX8907 is not set
# CONFIG_MFD_MAX8925 is not set
# CONFIG_MFD_MAX8997 is not set
# CONFIG_MFD_MAX8998 is not set
# CONFIG_MFD_MT6397 is not set
# CONFIG_MFD_MENF21BMC is not set
# CONFIG_EZX_PCAP is not set
# CONFIG_MFD_VIPERBOARD is not set
# CONFIG_MFD_RETU is not set
# CONFIG_MFD_PCF50633 is not set
# CONFIG_MFD_QCOM_RPM is not set
# CONFIG_MFD_RDC321X is not set
# CONFIG_MFD_RTSX_PCI is not set
# CONFIG_MFD_RT5033 is not set
# CONFIG_MFD_RTSX_USB is not set
# CONFIG_MFD_RC5T583 is not set
# CONFIG_MFD_RK808 is not set
# CONFIG_MFD_RN5T618 is not set
# CONFIG_MFD_SEC_CORE is not set
# CONFIG_MFD_SI476X_CORE is not set
# CONFIG_MFD_SM501 is not set
# CONFIG_MFD_SKY81452 is not set
# CONFIG_MFD_SMSC is not set
# CONFIG_ABX500_CORE is not set
# CONFIG_MFD_STMPE is not set
CONFIG_MFD_SYSCON=y
# CONFIG_MFD_TI_AM335X_TSCADC is not set
# CONFIG_MFD_LP3943 is not set
# CONFIG_MFD_LP8788 is not set
# CONFIG_MFD_PALMAS is not set
# CONFIG_TPS6105X is not set
# CONFIG_TPS65010 is not set
# CONFIG_TPS6507X is not set
# CONFIG_MFD_TPS65086 is not set
# CONFIG_MFD_TPS65090 is not set
# CONFIG_MFD_TPS65217 is not set
# CONFIG_MFD_TPS65218 is not set
# CONFIG_MFD_TPS6586X is not set
# CONFIG_MFD_TPS65910 is not set
# CONFIG_MFD_TPS65912_I2C is not set
# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_TPS80031 is not set
# CONFIG_TWL4030_CORE is not set
# CONFIG_TWL6040_CORE is not set
# CONFIG_MFD_WL1273_CORE is not set
# CONFIG_MFD_LM3533 is not set
# CONFIG_MFD_TC3589X is not set
# CONFIG_MFD_TMIO is not set
# CONFIG_MFD_VX855 is not set
# CONFIG_MFD_ARIZONA_I2C is not set
# CONFIG_MFD_ARIZONA_SPI is not set
# CONFIG_MFD_WM8400 is not set
# CONFIG_MFD_WM831X_I2C is not set
# CONFIG_MFD_WM831X_SPI is not set
# CONFIG_MFD_WM8350_I2C is not set
# CONFIG_MFD_WM8994 is not set
CONFIG_MFD_VEXPRESS_SYSREG=y
CONFIG_REGULATOR=y
# CONFIG_REGULATOR_DEBUG is not set
CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
# CONFIG_REGULATOR_ACT8865 is not set
# CONFIG_REGULATOR_AD5398 is not set
# CONFIG_REGULATOR_ANATOP is not set
# CONFIG_REGULATOR_DA9210 is not set
# CONFIG_REGULATOR_DA9211 is not set
# CONFIG_REGULATOR_FAN53555 is not set
# CONFIG_REGULATOR_GPIO is not set
# CONFIG_REGULATOR_ISL9305 is not set
# CONFIG_REGULATOR_ISL6271A is not set
# CONFIG_REGULATOR_LP3971 is not set
# CONFIG_REGULATOR_LP3972 is not set
# CONFIG_REGULATOR_LP872X is not set
# CONFIG_REGULATOR_LP8755 is not set
# CONFIG_REGULATOR_LTC3589 is not set
# CONFIG_REGULATOR_MAX1586 is not set
# CONFIG_REGULATOR_MAX8649 is not set
# CONFIG_REGULATOR_MAX8660 is not set
# CONFIG_REGULATOR_MAX8952 is not set
# CONFIG_REGULATOR_MAX8973 is not set
# CONFIG_REGULATOR_MT6311 is not set
# CONFIG_REGULATOR_PFUZE100 is not set
# CONFIG_REGULATOR_PV88060 is not set
# CONFIG_REGULATOR_PV88090 is not set
# CONFIG_REGULATOR_TPS51632 is not set
# CONFIG_REGULATOR_TPS62360 is not set
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
# CONFIG_REGULATOR_TPS6524X is not set
# CONFIG_REGULATOR_VEXPRESS is not set
# CONFIG_MEDIA_SUPPORT is not set

#
# Graphics support
#
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
# CONFIG_TEGRA_HOST1X is not set
# CONFIG_DRM is not set

#
# ACP Configuration
#
# CONFIG_DRM_AMD_ACP is not set

#
# Frame buffer Devices
#
CONFIG_FB=y
# CONFIG_FIRMWARE_EDID is not set
CONFIG_FB_CMDLINE=y
CONFIG_FB_NOTIFY=y
# CONFIG_FB_DDC is not set
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
# CONFIG_FB_SYS_FILLRECT is not set
# CONFIG_FB_SYS_COPYAREA is not set
# CONFIG_FB_SYS_IMAGEBLIT is not set
# CONFIG_FB_FOREIGN_ENDIAN is not set
# CONFIG_FB_SYS_FOPS is not set
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
CONFIG_FB_MODE_HELPERS=y
# CONFIG_FB_TILEBLITTING is not set

#
# Frame buffer hardware drivers
#
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
CONFIG_FB_ARMCLCD=y
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
# CONFIG_FB_OPENCORES is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_NVIDIA is not set
# CONFIG_FB_RIVA is not set
# CONFIG_FB_I740 is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_S3 is not set
# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_CARMINE is not set
# CONFIG_FB_SH_MOBILE_LCDC is not set
# CONFIG_FB_S3C is not set
# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_IBM_GXT4500 is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_BROADSHEET is not set
# CONFIG_FB_AUO_K190X is not set
# CONFIG_FB_SIMPLE is not set
# CONFIG_EXYNOS_VIDEO is not set
# CONFIG_FB_SH_MOBILE_MERAM is not set
# CONFIG_FB_SSD1307 is not set
# CONFIG_FB_SM712 is not set
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
# CONFIG_VGASTATE is not set
CONFIG_VIDEOMODE_HELPERS=y

#
# Console display driver support
#
CONFIG_DUMMY_CONSOLE=y
CONFIG_DUMMY_CONSOLE_COLUMNS=80
CONFIG_DUMMY_CONSOLE_ROWS=25
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_LOGO_LINUX_CLUT224=y
CONFIG_SOUND=y
# CONFIG_SOUND_OSS_CORE is not set
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_JACK=y
CONFIG_SND_JACK_INPUT_DEV=y
# CONFIG_SND_SEQUENCER is not set
# CONFIG_SND_MIXER_OSS is not set
# CONFIG_SND_PCM_OSS is not set
CONFIG_SND_PCM_TIMER=y
# CONFIG_SND_HRTIMER is not set
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_PROC_FS=y
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
# CONFIG_SND_RAWMIDI_SEQ is not set
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_ALOOP is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
# CONFIG_SND_AU8820 is not set
# CONFIG_SND_AU8830 is not set
# CONFIG_SND_AW2 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_OXYGEN is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
# CONFIG_SND_GINA20 is not set
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
# CONFIG_SND_INDIGO is not set
# CONFIG_SND_INDIGOIO is not set
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_EMU10K1X is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_FM801 is not set
# CONFIG_SND_HDSP is not set
# CONFIG_SND_HDSPM is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
# CONFIG_SND_INTEL8X0 is not set
# CONFIG_SND_INTEL8X0M is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_LOLA is not set
# CONFIG_SND_LX6464ES is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_SE6X is not set
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VIA82XX_MODEM is not set
# CONFIG_SND_VIRTUOSO is not set
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set

#
# HD-Audio
#
# CONFIG_SND_HDA_INTEL is not set
# CONFIG_SND_HDA_TEGRA is not set
CONFIG_SND_HDA_PREALLOC_SIZE=64
CONFIG_SND_SPI=y
CONFIG_SND_USB=y
# CONFIG_SND_USB_AUDIO is not set
# CONFIG_SND_USB_UA101 is not set
# CONFIG_SND_USB_CAIAQ is not set
# CONFIG_SND_USB_6FIRE is not set
# CONFIG_SND_USB_HIFACE is not set
# CONFIG_SND_BCD2000 is not set
# CONFIG_SND_USB_POD is not set
# CONFIG_SND_USB_PODHD is not set
# CONFIG_SND_USB_TONEPORT is not set
# CONFIG_SND_USB_VARIAX is not set
CONFIG_SND_SOC=y
# CONFIG_SND_SOC_AMD_ACP is not set
# CONFIG_SND_ATMEL_SOC is not set
# CONFIG_SND_DESIGNWARE_I2S is not set

#
# SoC Audio for Freescale CPUs
#

#
# Common SoC Audio options for Freescale CPUs:
#
# CONFIG_SND_SOC_FSL_ASRC is not set
# CONFIG_SND_SOC_FSL_SAI is not set
# CONFIG_SND_SOC_FSL_SSI is not set
# CONFIG_SND_SOC_FSL_SPDIF is not set
# CONFIG_SND_SOC_FSL_ESAI is not set
# CONFIG_SND_SOC_IMX_AUDMUX is not set
# CONFIG_SND_SOC_IMG is not set
# CONFIG_SND_SOC_MEDIATEK is not set
# CONFIG_SND_SOC_QCOM is not set
# CONFIG_SND_SOC_ROCKCHIP is not set
# CONFIG_SND_SOC_SAMSUNG is not set

#
# SoC Audio support for SuperH
#
# CONFIG_SND_SOC_SH4_FSI is not set
CONFIG_SND_SOC_RCAR=y
# CONFIG_SND_SOC_RSRC_CARD is not set

#
# Allwinner SoC Audio support
#
# CONFIG_SND_SUN4I_CODEC is not set
# CONFIG_SND_SUN4I_SPDIF is not set
# CONFIG_SND_SOC_TEGRA is not set
# CONFIG_SND_SOC_XTFPGA_I2S is not set
CONFIG_SND_SOC_I2C_AND_SPI=y

#
# CODEC drivers
#
# CONFIG_SND_SOC_AC97_CODEC is not set
# CONFIG_SND_SOC_ADAU1701 is not set
# CONFIG_SND_SOC_AK4104 is not set
# CONFIG_SND_SOC_AK4554 is not set
CONFIG_SND_SOC_AK4613=y
# CONFIG_SND_SOC_AK4642 is not set
# CONFIG_SND_SOC_AK5386 is not set
# CONFIG_SND_SOC_ALC5623 is not set
# CONFIG_SND_SOC_CS35L32 is not set
# CONFIG_SND_SOC_CS42L51_I2C is not set
# CONFIG_SND_SOC_CS42L52 is not set
# CONFIG_SND_SOC_CS42L56 is not set
# CONFIG_SND_SOC_CS42L73 is not set
# CONFIG_SND_SOC_CS4265 is not set
# CONFIG_SND_SOC_CS4270 is not set
# CONFIG_SND_SOC_CS4271_I2C is not set
# CONFIG_SND_SOC_CS4271_SPI is not set
# CONFIG_SND_SOC_CS42XX8_I2C is not set
# CONFIG_SND_SOC_CS4349 is not set
# CONFIG_SND_SOC_ES8328 is not set
# CONFIG_SND_SOC_GTM601 is not set
# CONFIG_SND_SOC_INNO_RK3036 is not set
# CONFIG_SND_SOC_PCM1681 is not set
# CONFIG_SND_SOC_PCM179X_I2C is not set
# CONFIG_SND_SOC_PCM179X_SPI is not set
# CONFIG_SND_SOC_PCM3168A_I2C is not set
# CONFIG_SND_SOC_PCM3168A_SPI is not set
# CONFIG_SND_SOC_PCM512x_I2C is not set
# CONFIG_SND_SOC_PCM512x_SPI is not set
# CONFIG_SND_SOC_RT5616 is not set
# CONFIG_SND_SOC_RT5631 is not set
# CONFIG_SND_SOC_RT5677_SPI is not set
# CONFIG_SND_SOC_SGTL5000 is not set
# CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set
# CONFIG_SND_SOC_SPDIF is not set
# CONFIG_SND_SOC_SSM2602_SPI is not set
# CONFIG_SND_SOC_SSM2602_I2C is not set
# CONFIG_SND_SOC_SSM4567 is not set
# CONFIG_SND_SOC_STA32X is not set
# CONFIG_SND_SOC_STA350 is not set
# CONFIG_SND_SOC_STI_SAS is not set
# CONFIG_SND_SOC_TAS2552 is not set
# CONFIG_SND_SOC_TAS5086 is not set
# CONFIG_SND_SOC_TAS571X is not set
# CONFIG_SND_SOC_TFA9879 is not set
# CONFIG_SND_SOC_TLV320AIC23_I2C is not set
# CONFIG_SND_SOC_TLV320AIC23_SPI is not set
# CONFIG_SND_SOC_TLV320AIC31XX is not set
# CONFIG_SND_SOC_TLV320AIC3X is not set
# CONFIG_SND_SOC_TS3A227E is not set
# CONFIG_SND_SOC_WM8510 is not set
# CONFIG_SND_SOC_WM8523 is not set
# CONFIG_SND_SOC_WM8580 is not set
# CONFIG_SND_SOC_WM8711 is not set
# CONFIG_SND_SOC_WM8728 is not set
# CONFIG_SND_SOC_WM8731 is not set
# CONFIG_SND_SOC_WM8737 is not set
# CONFIG_SND_SOC_WM8741 is not set
# CONFIG_SND_SOC_WM8750 is not set
# CONFIG_SND_SOC_WM8753 is not set
# CONFIG_SND_SOC_WM8770 is not set
# CONFIG_SND_SOC_WM8776 is not set
# CONFIG_SND_SOC_WM8804_I2C is not set
# CONFIG_SND_SOC_WM8804_SPI is not set
# CONFIG_SND_SOC_WM8903 is not set
# CONFIG_SND_SOC_WM8962 is not set
# CONFIG_SND_SOC_WM8974 is not set
# CONFIG_SND_SOC_WM8978 is not set
# CONFIG_SND_SOC_TPA6130A2 is not set
CONFIG_SND_SIMPLE_CARD=y
# CONFIG_SOUND_PRIME is not set

#
# HID support
#
CONFIG_HID=y
# CONFIG_HID_BATTERY_STRENGTH is not set
# CONFIG_HIDRAW is not set
# CONFIG_UHID is not set
CONFIG_HID_GENERIC=y

#
# Special HID drivers
#
CONFIG_HID_A4TECH=y
# CONFIG_HID_ACRUX is not set
CONFIG_HID_APPLE=y
# CONFIG_HID_APPLEIR is not set
# CONFIG_HID_AUREAL is not set
CONFIG_HID_BELKIN=y
# CONFIG_HID_BETOP_FF is not set
CONFIG_HID_CHERRY=y
CONFIG_HID_CHICONY=y
# CONFIG_HID_CORSAIR is not set
# CONFIG_HID_PRODIKEYS is not set
# CONFIG_HID_CMEDIA is not set
# CONFIG_HID_CP2112 is not set
CONFIG_HID_CYPRESS=y
# CONFIG_HID_DRAGONRISE is not set
# CONFIG_HID_EMS_FF is not set
# CONFIG_HID_ELECOM is not set
# CONFIG_HID_ELO is not set
CONFIG_HID_EZKEY=y
# CONFIG_HID_GEMBIRD is not set
# CONFIG_HID_GFRM is not set
# CONFIG_HID_HOLTEK is not set
# CONFIG_HID_GT683R is not set
# CONFIG_HID_KEYTOUCH is not set
# CONFIG_HID_KYE is not set
# CONFIG_HID_UCLOGIC is not set
# CONFIG_HID_WALTOP is not set
# CONFIG_HID_GYRATION is not set
# CONFIG_HID_ICADE is not set
# CONFIG_HID_TWINHAN is not set
CONFIG_HID_KENSINGTON=y
# CONFIG_HID_LCPOWER is not set
# CONFIG_HID_LENOVO is not set
CONFIG_HID_LOGITECH=y
# CONFIG_HID_LOGITECH_HIDPP is not set
# CONFIG_LOGITECH_FF is not set
# CONFIG_LOGIRUMBLEPAD2_FF is not set
# CONFIG_LOGIG940_FF is not set
# CONFIG_LOGIWHEELS_FF is not set
# CONFIG_HID_MAGICMOUSE is not set
CONFIG_HID_MICROSOFT=y
CONFIG_HID_MONTEREY=y
# CONFIG_HID_MULTITOUCH is not set
# CONFIG_HID_NTRIG is not set
# CONFIG_HID_ORTEK is not set
# CONFIG_HID_PANTHERLORD is not set
# CONFIG_HID_PENMOUNT is not set
# CONFIG_HID_PETALYNX is not set
# CONFIG_HID_PICOLCD is not set
# CONFIG_HID_PLANTRONICS is not set
# CONFIG_HID_PRIMAX is not set
# CONFIG_HID_ROCCAT is not set
# CONFIG_HID_SAITEK is not set
# CONFIG_HID_SAMSUNG is not set
# CONFIG_HID_SONY is not set
# CONFIG_HID_SPEEDLINK is not set
# CONFIG_HID_STEELSERIES is not set
# CONFIG_HID_SUNPLUS is not set
# CONFIG_HID_RMI is not set
# CONFIG_HID_GREENASIA is not set
# CONFIG_HID_SMARTJOYPLUS is not set
# CONFIG_HID_TIVO is not set
# CONFIG_HID_TOPSEED is not set
# CONFIG_HID_THINGM is not set
# CONFIG_HID_THRUSTMASTER is not set
# CONFIG_HID_WACOM is not set
# CONFIG_HID_WIIMOTE is not set
# CONFIG_HID_XINMO is not set
# CONFIG_HID_ZEROPLUS is not set
# CONFIG_HID_ZYDACRON is not set
# CONFIG_HID_SENSOR_HUB is not set

#
# USB HID support
#
CONFIG_USB_HID=y
# CONFIG_HID_PID is not set
# CONFIG_USB_HIDDEV is not set

#
# I2C HID support
#
# CONFIG_I2C_HID is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set

#
# Miscellaneous USB options
#
CONFIG_USB_DEFAULT_PERSIST=y
# CONFIG_USB_DYNAMIC_MINORS is not set
# CONFIG_USB_OTG is not set
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
# CONFIG_USB_ULPI_BUS is not set
# CONFIG_USB_MON is not set
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
# CONFIG_USB_C67X00_HCD is not set
# CONFIG_USB_XHCI_HCD is not set
CONFIG_USB_EHCI_HCD=y
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
# CONFIG_USB_EHCI_MSM is not set
# CONFIG_USB_EHCI_TEGRA is not set
# CONFIG_USB_EHCI_EXYNOS is not set
CONFIG_USB_EHCI_HCD_PLATFORM=y
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
# CONFIG_USB_FOTG210_HCD is not set
# CONFIG_USB_MAX3421_HCD is not set
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PCI=y
# CONFIG_USB_OHCI_EXYNOS is not set
CONFIG_USB_OHCI_HCD_PLATFORM=y
# CONFIG_USB_UHCI_HCD is not set
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set
# CONFIG_USB_HCD_TEST_MODE is not set

#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
# CONFIG_USB_PRINTER is not set
# CONFIG_USB_WDM is not set
# CONFIG_USB_TMC is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=y
# CONFIG_USB_STORAGE_DEBUG is not set
# CONFIG_USB_STORAGE_REALTEK is not set
# CONFIG_USB_STORAGE_DATAFAB is not set
# CONFIG_USB_STORAGE_FREECOM is not set
# CONFIG_USB_STORAGE_ISD200 is not set
# CONFIG_USB_STORAGE_USBAT is not set
# CONFIG_USB_STORAGE_SDDR09 is not set
# CONFIG_USB_STORAGE_SDDR55 is not set
# CONFIG_USB_STORAGE_JUMPSHOT is not set
# CONFIG_USB_STORAGE_ALAUDA is not set
# CONFIG_USB_STORAGE_ONETOUCH is not set
# CONFIG_USB_STORAGE_KARMA is not set
# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
# CONFIG_USB_STORAGE_ENE_UB6250 is not set
# CONFIG_USB_UAS is not set

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set
# CONFIG_USBIP_CORE is not set
# CONFIG_USB_MUSB_HDRC is not set
# CONFIG_USB_DWC3 is not set
# CONFIG_USB_DWC2 is not set
# CONFIG_USB_CHIPIDEA is not set
CONFIG_USB_ISP1760=y
CONFIG_USB_ISP1760_HCD=y
CONFIG_USB_ISP1760_HOST_ROLE=y

#
# USB port drivers
#
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_SEVSEG is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set
# CONFIG_USB_CYPRESS_CY7C63 is not set
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_IDMOUSE is not set
# CONFIG_USB_FTDI_ELAN is not set
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_SISUSBVGA is not set
# CONFIG_USB_LD is not set
# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_IOWARRIOR is not set
# CONFIG_USB_TEST is not set
# CONFIG_USB_EHSET_TEST_FIXTURE is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_YUREX is not set
# CONFIG_USB_EZUSB_FX2 is not set
# CONFIG_USB_HSIC_USB3503 is not set
# CONFIG_USB_LINK_LAYER_TEST is not set

#
# USB Physical Layer drivers
#
# CONFIG_USB_PHY is not set
# CONFIG_NOP_USB_XCEIV is not set
# CONFIG_USB_GPIO_VBUS is not set
# CONFIG_USB_ISP1301 is not set
CONFIG_USB_ULPI=y
CONFIG_USB_ULPI_VIEWPORT=y
# CONFIG_USB_GADGET is not set
# CONFIG_USB_LED_TRIG is not set
# CONFIG_UWB is not set
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_MINORS=8
CONFIG_MMC_BLOCK_BOUNCE=y
# CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
CONFIG_MMC_ARMMMCI=y
CONFIG_MMC_QCOM_DML=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_IO_ACCESSORS=y
# CONFIG_MMC_SDHCI_PCI is not set
# CONFIG_MMC_SDHCI_ACPI is not set
CONFIG_MMC_SDHCI_PLTFM=y
# CONFIG_MMC_SDHCI_OF_ARASAN is not set
# CONFIG_MMC_SDHCI_OF_AT91 is not set
# CONFIG_MMC_SDHCI_OF_ESDHC is not set
CONFIG_MMC_SDHCI_TEGRA=y
# CONFIG_MMC_SDHCI_PXAV3 is not set
# CONFIG_MMC_SDHCI_F_SDH30 is not set
CONFIG_MMC_SDHCI_IPROC=y
# CONFIG_MMC_SDHCI_MSM is not set
# CONFIG_MMC_TIFM_SD is not set
CONFIG_MMC_SPI=y
# CONFIG_MMC_SDHI is not set
# CONFIG_MMC_CB710 is not set
# CONFIG_MMC_VIA_SDMMC is not set
CONFIG_MMC_DW=y
CONFIG_MMC_DW_PLTFM=y
CONFIG_MMC_DW_EXYNOS=y
# CONFIG_MMC_DW_K3 is not set
# CONFIG_MMC_DW_PCI is not set
# CONFIG_MMC_DW_ROCKCHIP is not set
# CONFIG_MMC_SH_MMCIF is not set
# CONFIG_MMC_VUB300 is not set
# CONFIG_MMC_USHC is not set
# CONFIG_MMC_USDHI6ROL0 is not set
# CONFIG_MMC_TOSHIBA_PCI is not set
# CONFIG_MMC_MTK is not set
# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
# CONFIG_LEDS_CLASS_FLASH is not set

#
# LED drivers
#
# CONFIG_LEDS_BCM6328 is not set
# CONFIG_LEDS_BCM6358 is not set
# CONFIG_LEDS_LM3530 is not set
# CONFIG_LEDS_LM3642 is not set
# CONFIG_LEDS_PCA9532 is not set
# CONFIG_LEDS_GPIO is not set
# CONFIG_LEDS_LP3944 is not set
# CONFIG_LEDS_LP5521 is not set
# CONFIG_LEDS_LP5523 is not set
# CONFIG_LEDS_LP5562 is not set
# CONFIG_LEDS_LP8501 is not set
# CONFIG_LEDS_LP8860 is not set
# CONFIG_LEDS_PCA955X is not set
# CONFIG_LEDS_PCA963X is not set
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_REGULATOR is not set
# CONFIG_LEDS_BD2802 is not set
# CONFIG_LEDS_INTEL_SS4200 is not set
# CONFIG_LEDS_LT3593 is not set
# CONFIG_LEDS_TCA6507 is not set
# CONFIG_LEDS_TLC591XX is not set
# CONFIG_LEDS_LM355x is not set
# CONFIG_LEDS_IS31FL32XX is not set

#
# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)
#
# CONFIG_LEDS_BLINKM is not set
CONFIG_LEDS_SYSCON=y

#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
# CONFIG_LEDS_TRIGGER_TIMER is not set
# CONFIG_LEDS_TRIGGER_ONESHOT is not set
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
CONFIG_LEDS_TRIGGER_CPU=y
# CONFIG_LEDS_TRIGGER_GPIO is not set
# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_LEDS_TRIGGER_TRANSIENT is not set
# CONFIG_LEDS_TRIGGER_CAMERA is not set
# CONFIG_ACCESSIBILITY is not set
# CONFIG_INFINIBAND is not set
CONFIG_EDAC_SUPPORT=y
# CONFIG_EDAC is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
CONFIG_RTC_SYSTOHC=y
CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
# CONFIG_RTC_DRV_ABB5ZES3 is not set
# CONFIG_RTC_DRV_ABX80X is not set
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_HYM8563 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_ISL12057 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8523 is not set
# CONFIG_RTC_DRV_PCF85063 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8010 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set
# CONFIG_RTC_DRV_RV8803 is not set

#
# SPI RTC drivers
#
# CONFIG_RTC_DRV_M41T93 is not set
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1305 is not set
# CONFIG_RTC_DRV_DS1343 is not set
# CONFIG_RTC_DRV_DS1347 is not set
# CONFIG_RTC_DRV_DS1390 is not set
# CONFIG_RTC_DRV_R9701 is not set
# CONFIG_RTC_DRV_RX4581 is not set
# CONFIG_RTC_DRV_RX6110 is not set
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_MAX6902 is not set
# CONFIG_RTC_DRV_PCF2123 is not set
# CONFIG_RTC_DRV_MCP795 is not set
CONFIG_RTC_I2C_AND_SPI=y

#
# SPI and I2C RTC drivers
#
# CONFIG_RTC_DRV_DS3232 is not set
# CONFIG_RTC_DRV_PCF2127 is not set

#
# Platform RTC drivers
#
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1685_FAMILY is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_DS2404 is not set
CONFIG_RTC_DRV_EFI=y
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_V3020 is not set
# CONFIG_RTC_DRV_ZYNQMP is not set

#
# on-CPU RTC drivers
#
CONFIG_HAVE_S3C_RTC=y
# CONFIG_RTC_DRV_S3C is not set
# CONFIG_RTC_DRV_PL030 is not set
CONFIG_RTC_DRV_PL031=y
# CONFIG_RTC_DRV_TEGRA is not set
# CONFIG_RTC_DRV_SNVS is not set
CONFIG_RTC_DRV_XGENE=y

#
# HID Sensor RTC drivers
#
# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set
CONFIG_DMADEVICES=y
# CONFIG_DMADEVICES_DEBUG is not set

#
# DMA Devices
#
CONFIG_DMA_ENGINE=y
CONFIG_DMA_VIRTUAL_CHANNELS=y
CONFIG_DMA_ACPI=y
CONFIG_DMA_OF=y
# CONFIG_AMBA_PL08X is not set
# CONFIG_FSL_EDMA is not set
# CONFIG_INTEL_IDMA64 is not set
# CONFIG_PL330_DMA is not set
CONFIG_TEGRA20_APB_DMA=y
# CONFIG_XGENE_DMA is not set
CONFIG_QCOM_BAM_DMA=y
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_HIDMA is not set
# CONFIG_DW_DMAC is not set
# CONFIG_DW_DMAC_PCI is not set
CONFIG_RENESAS_DMA=y
CONFIG_SH_DMAE_BASE=y
# CONFIG_SH_DMAE is not set
CONFIG_RCAR_DMAC=y
# CONFIG_RENESAS_USB_DMAC is not set
# CONFIG_SUDMAC is not set

#
# DMA Clients
#
# CONFIG_ASYNC_TX_DMA is not set
# CONFIG_DMATEST is not set
# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set
CONFIG_VFIO_IOMMU_TYPE1=y
CONFIG_VFIO_VIRQFD=y
CONFIG_VFIO=y
# CONFIG_VFIO_NOIOMMU is not set
CONFIG_VFIO_PCI=y
CONFIG_VFIO_PCI_MMAP=y
CONFIG_VFIO_PCI_INTX=y
# CONFIG_VFIO_PLATFORM is not set
CONFIG_IRQ_BYPASS_MANAGER=y
CONFIG_VIRT_DRIVERS=y
CONFIG_VIRTIO=y

#
# Virtio drivers
#
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_BALLOON=y
# CONFIG_VIRTIO_INPUT is not set
CONFIG_VIRTIO_MMIO=y
# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set

#
# Microsoft Hyper-V guest support
#
# CONFIG_STAGING is not set
# CONFIG_GOLDFISH is not set
# CONFIG_CHROME_PLATFORMS is not set
CONFIG_CLKDEV_LOOKUP=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_COMMON_CLK=y

#
# Common Clock Framework
#
CONFIG_COMMON_CLK_VERSATILE=y
CONFIG_CLK_SP810=y
CONFIG_CLK_VEXPRESS_OSC=y
# CONFIG_COMMON_CLK_SI5351 is not set
# CONFIG_COMMON_CLK_SI514 is not set
# CONFIG_COMMON_CLK_SI570 is not set
# CONFIG_COMMON_CLK_CDCE706 is not set
# CONFIG_COMMON_CLK_CDCE925 is not set
CONFIG_COMMON_CLK_CS2000_CP=y
# CONFIG_CLK_QORIQ is not set
CONFIG_COMMON_CLK_XGENE=y
# CONFIG_COMMON_CLK_NXP is not set
# CONFIG_COMMON_CLK_PXA is not set
CONFIG_COMMON_CLK_IPROC=y
CONFIG_COMMON_CLK_HI6220=y
# CONFIG_STUB_CLK_HI6220 is not set
CONFIG_QCOM_GDSC=y
CONFIG_COMMON_CLK_QCOM=y
# CONFIG_APQ_GCC_8084 is not set
# CONFIG_APQ_MMCC_8084 is not set
# CONFIG_IPQ_GCC_4019 is not set
# CONFIG_IPQ_GCC_806X is not set
# CONFIG_IPQ_LCC_806X is not set
# CONFIG_MSM_GCC_8660 is not set
CONFIG_MSM_GCC_8916=y
# CONFIG_MSM_GCC_8960 is not set
# CONFIG_MSM_LCC_8960 is not set
# CONFIG_MSM_MMCC_8960 is not set
# CONFIG_MSM_GCC_8974 is not set
# CONFIG_MSM_MMCC_8974 is not set
# CONFIG_MSM_GCC_8996 is not set
# CONFIG_MSM_MMCC_8996 is not set
CONFIG_COMMON_CLK_SAMSUNG=y
CONFIG_EXYNOS_ARM64_COMMON_CLK=y

#
# Hardware Spinlock drivers
#
# CONFIG_HWSPINLOCK_QCOM is not set

#
# Clock Source drivers
#
CONFIG_CLKSRC_OF=y
CONFIG_CLKSRC_ACPI=y
CONFIG_CLKSRC_PROBE=y
CONFIG_CLKSRC_MMIO=y
CONFIG_ROCKCHIP_TIMER=y
CONFIG_ARM_ARCH_TIMER=y
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
# CONFIG_ARM_TIMER_SP804 is not set
# CONFIG_ATMEL_PIT is not set
CONFIG_MTK_TIMER=y
# CONFIG_SH_TIMER_CMT is not set
# CONFIG_SH_TIMER_MTU2 is not set
# CONFIG_SH_TIMER_TMU is not set
# CONFIG_EM_TIMER_STI is not set
CONFIG_MAILBOX=y
# CONFIG_ARM_MHU is not set
# CONFIG_PL320_MBOX is not set
# CONFIG_ROCKCHIP_MBOX is not set
CONFIG_PCC=y
# CONFIG_ALTERA_MBOX is not set
# CONFIG_HI6220_MBOX is not set
# CONFIG_MAILBOX_TEST is not set
# CONFIG_XGENE_SLIMPRO_MBOX is not set
CONFIG_IOMMU_API=y
CONFIG_IOMMU_SUPPORT=y

#
# Generic IOMMU Pagetable Support
#
CONFIG_IOMMU_IO_PGTABLE=y
CONFIG_IOMMU_IO_PGTABLE_LPAE=y
# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set
# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set
CONFIG_IOMMU_IOVA=y
CONFIG_OF_IOMMU=y
CONFIG_IOMMU_DMA=y
# CONFIG_EXYNOS_IOMMU is not set
CONFIG_ARM_SMMU=y
CONFIG_ARM_SMMU_V3=y
# CONFIG_MTK_IOMMU is not set

#
# Remoteproc drivers
#
# CONFIG_STE_MODEM_RPROC is not set

#
# Rpmsg drivers
#

#
# SOC (System On Chip) specific Drivers
#
# CONFIG_MTK_INFRACFG is not set
# CONFIG_MTK_PMIC_WRAP is not set
# CONFIG_MTK_SCPSYS is not set
# CONFIG_QCOM_GSBI is not set
# CONFIG_ROCKCHIP_PM_DOMAINS is not set
# CONFIG_SUNXI_SRAM is not set
# CONFIG_ARCH_TEGRA_132_SOC is not set
# CONFIG_ARCH_TEGRA_210_SOC is not set
# CONFIG_SOC_TI is not set
# CONFIG_PM_DEVFREQ is not set
# CONFIG_EXTCON is not set
# CONFIG_MEMORY is not set
# CONFIG_IIO is not set
# CONFIG_NTB is not set
# CONFIG_VME_BUS is not set
# CONFIG_PWM is not set
CONFIG_IRQCHIP=y
CONFIG_ARM_GIC=y
CONFIG_ARM_GIC_MAX_NR=1
CONFIG_ARM_GIC_V2M=y
CONFIG_ARM_GIC_V3=y
CONFIG_ARM_GIC_V3_ITS=y
CONFIG_DW_APB_ICTL=y
CONFIG_HISILICON_IRQ_MBIGEN=y
CONFIG_RENESAS_IRQC=y
# CONFIG_IPACK_BUS is not set
CONFIG_ARCH_HAS_RESET_CONTROLLER=y
CONFIG_RESET_CONTROLLER=y
# CONFIG_COMMON_RESET_HI6220 is not set
# CONFIG_FMC is not set

#
# PHY Subsystem
#
CONFIG_GENERIC_PHY=y
# CONFIG_PHY_BERLIN_USB is not set
# CONFIG_PHY_BERLIN_SATA is not set
CONFIG_PHY_EXYNOS_MIPI_VIDEO=y
# CONFIG_PHY_PXA_28NM_HSIC is not set
# CONFIG_PHY_PXA_28NM_USB2 is not set
# CONFIG_PHY_RCAR_GEN2 is not set
# CONFIG_PHY_RCAR_GEN3_USB2 is not set
CONFIG_PHY_EXYNOS_DP_VIDEO=y
# CONFIG_BCM_KONA_USB2_PHY is not set
# CONFIG_PHY_MT65XX_USB3 is not set
# CONFIG_PHY_HI6220_USB is not set
# CONFIG_PHY_QCOM_APQ8064_SATA is not set
# CONFIG_PHY_QCOM_IPQ806X_SATA is not set
# CONFIG_PHY_ROCKCHIP_USB is not set
# CONFIG_PHY_ROCKCHIP_EMMC is not set
# CONFIG_PHY_ROCKCHIP_DP is not set
CONFIG_PHY_XGENE=y
# CONFIG_PHY_QCOM_UFS is not set
# CONFIG_POWERCAP is not set
# CONFIG_MCB is not set

#
# Performance monitor support
#
CONFIG_ARM_PMU=y
CONFIG_RAS=y
# CONFIG_THUNDERBOLT is not set

#
# Android
#
# CONFIG_ANDROID is not set
# CONFIG_LIBNVDIMM is not set
# CONFIG_NVMEM is not set
# CONFIG_STM is not set
# CONFIG_INTEL_TH is not set

#
# FPGA Configuration Support
#
# CONFIG_FPGA is not set

#
# Firmware Drivers
#
CONFIG_ARM_PSCI_FW=y
# CONFIG_FIRMWARE_MEMMAP is not set
CONFIG_DMIID=y
# CONFIG_DMI_SYSFS is not set
# CONFIG_FW_CFG_SYSFS is not set
CONFIG_HAVE_ARM_SMCCC=y

#
# EFI (Extensible Firmware Interface) Support
#
# CONFIG_EFI_VARS is not set
CONFIG_EFI_ESRT=y
CONFIG_EFI_PARAMS_FROM_FDT=y
CONFIG_EFI_RUNTIME_WRAPPERS=y
CONFIG_EFI_ARMSTUB=y
CONFIG_ACPI=y
CONFIG_ACPI_GENERIC_GSI=y
CONFIG_ACPI_CCA_REQUIRED=y
CONFIG_ACPI_DEBUGGER=y
CONFIG_ACPI_DEBUGGER_USER=y
CONFIG_ACPI_EC_DEBUGFS=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_FAN=y
# CONFIG_ACPI_DOCK is not set
CONFIG_ACPI_CPPC_LIB=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_ACPI_THERMAL=y
# CONFIG_ACPI_CUSTOM_DSDT is not set
CONFIG_ACPI_DEBUG=y
CONFIG_ACPI_PCI_SLOT=y
CONFIG_ACPI_CONTAINER=y
# CONFIG_ACPI_HED is not set
CONFIG_ACPI_CUSTOM_METHOD=m
CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y
CONFIG_PMIC_OPREGION=y

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
CONFIG_EXT3_FS=y
# CONFIG_EXT3_FS_POSIX_ACL is not set
# CONFIG_EXT3_FS_SECURITY is not set
CONFIG_EXT4_FS=y
# CONFIG_EXT4_FS_POSIX_ACL is not set
# CONFIG_EXT4_FS_SECURITY is not set
# CONFIG_EXT4_ENCRYPTION is not set
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
# CONFIG_F2FS_FS is not set
# CONFIG_FS_DAX is not set
# CONFIG_FS_POSIX_ACL is not set
CONFIG_EXPORTFS=y
CONFIG_FILE_LOCKING=y
CONFIG_MANDATORY_FILE_LOCKING=y
# CONFIG_FS_ENCRYPTION is not set
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
# CONFIG_QUOTA_NETLINK_INTERFACE is not set
CONFIG_PRINT_QUOTA_WARNING=y
# CONFIG_QUOTA_DEBUG is not set
# CONFIG_QFMT_V1 is not set
# CONFIG_QFMT_V2 is not set
CONFIG_QUOTACTL=y
CONFIG_AUTOFS4_FS=y
CONFIG_FUSE_FS=y
CONFIG_CUSE=y
# CONFIG_OVERLAY_FS is not set

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=y
# CONFIG_MSDOS_FS is not set
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_FAT_DEFAULT_UTF8 is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
# CONFIG_PROC_KCORE is not set
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
# CONFIG_PROC_CHILDREN is not set
CONFIG_KERNFS=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
# CONFIG_TMPFS_XATTR is not set
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
# CONFIG_CONFIGFS_FS is not set
CONFIG_EFIVAR_FS=y
CONFIG_MISC_FILESYSTEMS=y
# CONFIG_ORANGEFS_FS is not set
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_ECRYPT_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_LOGFS is not set
# CONFIG_CRAMFS is not set
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_FILE_CACHE=y
# CONFIG_SQUASHFS_FILE_DIRECT is not set
CONFIG_SQUASHFS_DECOMP_SINGLE=y
# CONFIG_SQUASHFS_DECOMP_MULTI is not set
# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set
# CONFIG_SQUASHFS_XATTR is not set
CONFIG_SQUASHFS_ZLIB=y
# CONFIG_SQUASHFS_LZ4 is not set
# CONFIG_SQUASHFS_LZO is not set
# CONFIG_SQUASHFS_XZ is not set
# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
# CONFIG_VXFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_OMFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX6FS_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_PSTORE is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
CONFIG_NFS_V4=y
# CONFIG_NFS_SWAP is not set
# CONFIG_NFS_V4_1 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFSD is not set
CONFIG_GRACE_PERIOD=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_CEPH_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_9P_FS=y
# CONFIG_9P_FS_POSIX_ACL is not set
# CONFIG_9P_FS_SECURITY is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=y
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_MAC_ROMAN is not set
# CONFIG_NLS_MAC_CELTIC is not set
# CONFIG_NLS_MAC_CENTEURO is not set
# CONFIG_NLS_MAC_CROATIAN is not set
# CONFIG_NLS_MAC_CYRILLIC is not set
# CONFIG_NLS_MAC_GAELIC is not set
# CONFIG_NLS_MAC_GREEK is not set
# CONFIG_NLS_MAC_ICELAND is not set
# CONFIG_NLS_MAC_INUIT is not set
# CONFIG_NLS_MAC_ROMANIAN is not set
# CONFIG_NLS_MAC_TURKISH is not set
# CONFIG_NLS_UTF8 is not set
CONFIG_HAVE_KVM_IRQFD=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_MMIO=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_KVM_VFIO=y
CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_COMPAT=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM_ARM_VGIC_V3=y
CONFIG_KVM=y
CONFIG_KVM_ARM_HOST=y
CONFIG_KVM_ARM_PMU=y

#
# Kernel hacking
#

#
# printk and dmesg options
#
CONFIG_PRINTK_TIME=y
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
# CONFIG_BOOT_PRINTK_DELAY is not set
# CONFIG_DYNAMIC_DEBUG is not set

#
# Compile-time checks and compiler options
#
CONFIG_DEBUG_INFO=y
# CONFIG_DEBUG_INFO_REDUCED is not set
# CONFIG_DEBUG_INFO_SPLIT is not set
# CONFIG_DEBUG_INFO_DWARF4 is not set
# CONFIG_GDB_SCRIPTS is not set
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=2048
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
# CONFIG_UNUSED_SYMBOLS is not set
# CONFIG_PAGE_OWNER is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_SECTION_MISMATCH_WARN_ONLY=y
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
CONFIG_DEBUG_KERNEL=y

#
# Memory Debugging
#
# CONFIG_PAGE_EXTENSION is not set
# CONFIG_DEBUG_PAGEALLOC is not set
# CONFIG_PAGE_POISONING is not set
# CONFIG_DEBUG_PAGE_REF is not set
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_SLUB_DEBUG_ON is not set
# CONFIG_SLUB_STATS is not set
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_MEMORY_INIT is not set
# CONFIG_DEBUG_PER_CPU_MAPS is not set
CONFIG_HAVE_ARCH_KASAN=y
# CONFIG_KASAN is not set
CONFIG_DEBUG_SHIRQ=y

#
# Debug Lockups and Hangs
#
CONFIG_LOCKUP_DETECTOR=y
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=1
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=1
CONFIG_WQ_WATCHDOG=y
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
CONFIG_PANIC_TIMEOUT=0
CONFIG_SCHED_DEBUG=y
CONFIG_SCHED_INFO=y
CONFIG_SCHEDSTATS=y
CONFIG_SCHED_STACK_END_CHECK=y
CONFIG_DEBUG_TIMEKEEPING=y
CONFIG_TIMER_STATS=y
CONFIG_DEBUG_PREEMPT=y

#
# Lock Debugging (spinlocks, mutexes, etc...)
#
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
CONFIG_DEBUG_LOCK_ALLOC=y
# CONFIG_PROVE_LOCKING is not set
CONFIG_LOCKDEP=y
# CONFIG_LOCK_STAT is not set
# CONFIG_DEBUG_LOCKDEP is not set
CONFIG_DEBUG_ATOMIC_SLEEP=y
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_LOCK_TORTURE_TEST is not set
CONFIG_TRACE_IRQFLAGS=y
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_HAVE_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_LIST is not set
# CONFIG_DEBUG_PI_LIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set

#
# RCU Debugging
#
# CONFIG_PROVE_RCU is not set
# CONFIG_SPARSE_RCU_POINTER is not set
# CONFIG_TORTURE_TEST is not set
# CONFIG_RCU_TORTURE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=21
# CONFIG_RCU_TRACE is not set
# CONFIG_RCU_EQS_DEBUG is not set
# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_TRACER_MAX_TRACE=y
CONFIG_TRACE_CLOCK=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_RING_BUFFER_ALLOW_SWAP=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
CONFIG_IRQSOFF_TRACER=y
CONFIG_PREEMPT_TRACER=y
CONFIG_SCHED_TRACER=y
CONFIG_FTRACE_SYSCALLS=y
CONFIG_TRACER_SNAPSHOT=y
CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP=y
CONFIG_TRACE_BRANCH_PROFILING=y
# CONFIG_BRANCH_PROFILE_NONE is not set
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
CONFIG_PROFILE_ALL_BRANCHES=y
# CONFIG_BRANCH_TRACER is not set
CONFIG_STACK_TRACER=y
CONFIG_BLK_DEV_IO_TRACE=y
# CONFIG_PROBE_EVENTS is not set
CONFIG_DYNAMIC_FTRACE=y
CONFIG_FUNCTION_PROFILER=y
CONFIG_FTRACE_MCOUNT_RECORD=y
# CONFIG_FTRACE_STARTUP_TEST is not set
# CONFIG_TRACEPOINT_BENCHMARK is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_RING_BUFFER_STARTUP_TEST is not set
CONFIG_TRACE_ENUM_MAP_FILE=y
# CONFIG_TRACING_EVENTS_GPIO is not set

#
# Runtime Testing
#
# CONFIG_LKDTM is not set
# CONFIG_TEST_LIST_SORT is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_PERCPU_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_TEST_HEXDUMP is not set
# CONFIG_TEST_STRING_HELPERS is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_TEST_PRINTF is not set
# CONFIG_TEST_BITMAP is not set
# CONFIG_TEST_RHASHTABLE is not set
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_TEST_LKM is not set
# CONFIG_TEST_USER_COPY is not set
# CONFIG_TEST_BPF is not set
# CONFIG_TEST_FIRMWARE is not set
# CONFIG_TEST_UDELAY is not set
# CONFIG_MEMTEST is not set
# CONFIG_TEST_STATIC_KEYS is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
# CONFIG_UBSAN is not set
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
CONFIG_STRICT_DEVMEM=y
CONFIG_IO_STRICT_DEVMEM=y
# CONFIG_ARM64_PTDUMP is not set
# CONFIG_PID_IN_CONTEXTIDR is not set
# CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set
# CONFIG_DEBUG_SET_MODULE_RONX is not set
CONFIG_DEBUG_RODATA=y
# CONFIG_CORESIGHT is not set

#
# Security options
#
CONFIG_KEYS=y
# CONFIG_PERSISTENT_KEYRINGS is not set
# CONFIG_BIG_KEYS is not set
# CONFIG_ENCRYPTED_KEYS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
CONFIG_SECURITY=y
# CONFIG_SECURITYFS is not set
# CONFIG_SECURITY_NETWORK is not set
# CONFIG_SECURITY_PATH is not set
# CONFIG_SECURITY_SMACK is not set
# CONFIG_SECURITY_TOMOYO is not set
# CONFIG_SECURITY_APPARMOR is not set
# CONFIG_SECURITY_YAMA is not set
CONFIG_INTEGRITY=y
# CONFIG_INTEGRITY_SIGNATURE is not set
CONFIG_INTEGRITY_AUDIT=y
# CONFIG_IMA is not set
# CONFIG_EVM is not set
CONFIG_DEFAULT_SECURITY_DAC=y
CONFIG_DEFAULT_SECURITY=""
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_RNG_DEFAULT=y
CONFIG_CRYPTO_AKCIPHER2=y
# CONFIG_CRYPTO_RSA is not set
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
# CONFIG_CRYPTO_USER is not set
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
# CONFIG_CRYPTO_GF128MUL is not set
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_NULL2=y
# CONFIG_CRYPTO_PCRYPT is not set
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=y
# CONFIG_CRYPTO_MCRYPTD is not set
# CONFIG_CRYPTO_AUTHENC is not set
# CONFIG_CRYPTO_TEST is not set
CONFIG_CRYPTO_ABLK_HELPER=y

#
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
# CONFIG_CRYPTO_CHACHA20POLY1305 is not set
# CONFIG_CRYPTO_SEQIV is not set
CONFIG_CRYPTO_ECHAINIV=y

#
# Block modes
#
# CONFIG_CRYPTO_CBC is not set
# CONFIG_CRYPTO_CTR is not set
# CONFIG_CRYPTO_CTS is not set
# CONFIG_CRYPTO_ECB is not set
# CONFIG_CRYPTO_LRW is not set
# CONFIG_CRYPTO_PCBC is not set
# CONFIG_CRYPTO_XTS is not set
# CONFIG_CRYPTO_KEYWRAP is not set

#
# Hash modes
#
# CONFIG_CRYPTO_CMAC is not set
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
CONFIG_CRYPTO_CRC32C=y
# CONFIG_CRYPTO_CRC32 is not set
# CONFIG_CRYPTO_CRCT10DIF is not set
# CONFIG_CRYPTO_GHASH is not set
# CONFIG_CRYPTO_POLY1305 is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
# CONFIG_CRYPTO_RMD256 is not set
# CONFIG_CRYPTO_RMD320 is not set
# CONFIG_CRYPTO_SHA1 is not set
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set

#
# Ciphers
#
CONFIG_CRYPTO_AES=y
# CONFIG_CRYPTO_ANUBIS is not set
# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_CHACHA20 is not set
# CONFIG_CRYPTO_SEED is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_TWOFISH is not set

#
# Compression
#
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_LZO is not set
# CONFIG_CRYPTO_842 is not set
# CONFIG_CRYPTO_LZ4 is not set
# CONFIG_CRYPTO_LZ4HC is not set

#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_DRBG_MENU=y
CONFIG_CRYPTO_DRBG_HMAC=y
# CONFIG_CRYPTO_DRBG_HASH is not set
# CONFIG_CRYPTO_DRBG_CTR is not set
CONFIG_CRYPTO_DRBG=y
CONFIG_CRYPTO_JITTERENTROPY=y
# CONFIG_CRYPTO_USER_API_HASH is not set
# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
# CONFIG_CRYPTO_USER_API_RNG is not set
# CONFIG_CRYPTO_USER_API_AEAD is not set
CONFIG_CRYPTO_HW=y
# CONFIG_CRYPTO_DEV_S5P is not set
# CONFIG_CRYPTO_DEV_CCP is not set
# CONFIG_CRYPTO_DEV_QCE is not set
# CONFIG_CRYPTO_DEV_ROCKCHIP is not set
# CONFIG_ASYMMETRIC_KEY_TYPE is not set

#
# Certificates for signature checking
#
# CONFIG_SYSTEM_TRUSTED_KEYRING is not set
CONFIG_ARM64_CRYPTO=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y
CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_AES_ARM64_CE=y
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
CONFIG_CRYPTO_CRC32_ARM64=y
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_HAVE_ARCH_BITREVERSE=y
CONFIG_RATIONAL=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_NET_UTILS=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IO=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
# CONFIG_CRC_CCITT is not set
CONFIG_CRC16=y
# CONFIG_CRC_T10DIF is not set
CONFIG_CRC_ITU_T=y
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
CONFIG_CRC7=y
# CONFIG_LIBCRC32C is not set
# CONFIG_CRC8 is not set
CONFIG_AUDIT_GENERIC=y
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
CONFIG_AUDIT_COMPAT_GENERIC=y
# CONFIG_RANDOM32_SELFTEST is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_LZ4_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
CONFIG_XZ_DEC_POWERPC=y
CONFIG_XZ_DEC_IA64=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_XZ=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_DECOMPRESS_LZ4=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_ASSOCIATIVE_ARRAY=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_HAS_DMA=y
CONFIG_CPU_RMAP=y
CONFIG_DQL=y
CONFIG_GLOB=y
# CONFIG_GLOB_SELFTEST is not set
CONFIG_NLATTR=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
# CONFIG_CORDIC is not set
# CONFIG_DDR is not set
# CONFIG_IRQ_POLL is not set
CONFIG_LIBFDT=y
CONFIG_OID_REGISTRY=y
CONFIG_UCS2_STRING=y
CONFIG_FONT_SUPPORT=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
# CONFIG_SG_SPLIT is not set
CONFIG_ARCH_HAS_SG_CHAIN=y

[-- Attachment #3: Type: text/plain, Size: 151 bytes --]

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-15  9:37   ` Itaru Kitayama
@ 2016-05-15 11:19     ` Christoffer Dall
  2016-05-15 11:42       ` Julien Grall
  0 siblings, 1 reply; 80+ messages in thread
From: Christoffer Dall @ 2016-05-15 11:19 UTC (permalink / raw)
  To: Itaru Kitayama; +Cc: kvmarm@lists.cs.columbia.edu


[-- Attachment #1.1: Type: text/plain, Size: 32626 bytes --]

On Sunday, May 15, 2016, Itaru Kitayama <itaru.kitayama@riken.jp> wrote:
>
> Below is the boot (with UEFI) log. I'm attaching the .config I'm using.
> I've been trying to test Julien's ACPI support patch set recently merged
in the kvmarm tree on Mustang.


I don't run anything with ACPI, so haven't tested that particular aspect.

This doesn't immediately look like it's related to the kvmarm patches.

Perhaps you could try with Linux-next as well to see if this was already
fixed?

Julien, did you test mustang with your ACPI patches?


>
>
> EFI stub: Booting Linux Kernel...
> EFI stub: Using DTB from configuration table
> EFI stub: Exiting boot services and installing virtual address map...
> L3C: 8MB
> [    0.000000] Booting Linux on physical CPU 0x0
> [    0.000000] Linux version 4.6.0-rc1 (itaru.kitayama@r2-a11) (gcc
version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC) ) #8 SMP PREEMPT Sat May 14
09:04:47 CDT 2016
> [    0.000000] Boot CPU: AArch64 Processor [500f0000]
> [    0.000000] earlycon: uart0 at MMIO32 0x000000001c020000 (options '')
> [    0.000000] bootconsole [uart0] enabled
> [    0.000000] efi: Getting EFI parameters from FDT:
> [    0.000000] EFI v2.40 by X-Gene Mustang Board EFI Jan 27 2016 18:27:58
> [    0.000000] efi:  ACPI=0x43fa859000  ACPI 2.0=0x43fa859014  SMBIOS
3.0=0x43fa857000
> [    0.000000] cma: Reserved 512 MiB at 0x00000040e0000000
> [    0.000000] ACPI: Early table checksum verification enabled
> [    0.000000] ACPI: RSDP 0x00000043FA859014 000024 (v02 APM   )
> [    0.000000] ACPI: XSDT 0x00000043FA8580E8 00007C (v01 APM    XGENE
00000003      01000013)
> [    0.000000] ACPI: FACP 0x00000043FA850000 00010C (v05 APM    XGENE
00000003 INTL 20140724)
> [    0.000000] ACPI: DSDT 0x00000043FA851000 003A00 (v05 APM    APM88xxx
00000001 INTL 20140724)
> [    0.000000] ACPI: DBG2 0x00000043FA855000 0000AA (v00 APMC0D XGENEDBG
00000000 INTL 20140724)
> [    0.000000] ACPI: GTDT 0x00000043FA84E000 0000E0 (v02 APM    XGENE
00000001 INTL 20140724)
> [    0.000000] ACPI: MCFG 0x00000043FA84D000 00003C (v01 APM    XGENE
00000002 INTL 20140724)
> [    0.000000] ACPI: SPCR 0x00000043FA84C000 000050 (v02 APMC0D XGENESPC
00000000 INTL 20140724)
> [    0.000000] ACPI: SSDT 0x00000043FA84B000 00002D (v02 APM    XGENE
00000001 INTL 20140724)
> [    0.000000] ACPI: BERT 0x00000043FA84A000 000030 (v01 APM    XGENE
00000002 INTL 20140724)
> [    0.000000] ACPI: HEST 0x00000043FA849000 0002A8 (v01 APM    XGENE
00000002 INTL 20140724)
> [    0.000000] ACPI: APIC 0x00000043FA848000 0002A4 (v03 APM    XGENE
00000003      01000013)
> [    0.000000] ACPI: SSDT 0x00000043FA847000 000063 (v02 REDHAT MACADDRS
00000001      01000013)
> [    0.000000] ACPI: SSDT 0x00000043FA846000 000032 (v02 REDHAT UARTCLKS
00000001      01000013)
> [    0.000000] On node 0 totalpages: 262144
> [    0.000000]   DMA zone: 64 pages used for memmap
> [    0.000000]   DMA zone: 0 pages reserved
> [    0.000000]   DMA zone: 65536 pages, LIFO batch:1
> [    0.000000]   Normal zone: 192 pages used for memmap
> [    0.000000]   Normal zone: 196608 pages, LIFO batch:1
> [    0.000000] psci: is not implemented in ACPI.
> [    0.000000] percpu: Embedded 3 pages/cpu @ffff8003ffde0000 s110464
r8192 d77952 u196608
> [    0.000000] pcpu-alloc: s110464 r8192 d77952 u196608 alloc=3*65536
> [    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7
> [    0.000000] Detected PIPT I-cache on CPU0
> [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 261888
> [    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-4.6.0-rc1
root=UUID=ac9f9264-7572-48c3-97d2-042ea95f7640 ro acpi=force
acpi_force_table_verification earlycon=uart,mmio32,0x1c020000
console=ttyS0,115200 loglevel=8 LANG=en_US.UTF-8
> [    0.000000] log_buf_len individual max cpu contribution: 4096 bytes
> [    0.000000] log_buf_len total cpu_extra contributions: 28672 bytes
> [    0.000000] log_buf_len min size: 16384 bytes
> [    0.000000] log_buf_len: 65536 bytes
> [    0.000000] early log buf free: 13100(79%)
> [    0.000000] PID hash table entries: 4096 (order: -1, 32768 bytes)
> [    0.000000] Dentry cache hash table entries: 2097152 (order: 8,
16777216 bytes)
> [    0.000000] Inode-cache hash table entries: 1048576 (order: 7, 8388608
bytes)
> [    0.000000] software IO TLB [mem 0x40dbff0000-0x40dfff0000] (64MB)
mapped at [ffff8000dbff0000-ffff8000dffeffff]
> [    0.000000] Memory: 16070528K/16777216K available (22848K kernel code,
8676K rwdata, 7552K rodata, 1856K init, 16521K bss, 182400K reserved,
524288K cma-reserved)
> [    0.000000] Virtual kernel memory layout:
> [    0.000000]     modules : 0xffff000000000000 - 0xffff000008000000   (
  128 MB)
> [    0.000000]     vmalloc : 0xffff000008000000 - 0xffff77ffffff0000
(122879 GB)
> [    0.000000]       .text : 0xffff000008080000 - 0xffff0000096d0000   (
22848 KB)
> [    0.000000]     .rodata : 0xffff0000096d0000 - 0xffff000009e40000   (
 7616 KB)
> [    0.000000]       .init : 0xffff000009e40000 - 0xffff00000a010000   (
 1856 KB)
> [    0.000000]       .data : 0xffff00000a010000 - 0xffff00000a889000   (
 8676 KB)
> [    0.000000]     vmemmap : 0xffff780000000000 - 0xffff7c0000000000   (
 4096 GB maximum)
> [    0.000000]               0xffff780000000000 - 0xffff780001000000   (
   16 MB actual)
> [    0.000000]     fixed   : 0xffff7ffffe7d0000 - 0xffff7ffffec00000   (
 4288 KB)
> [    0.000000]     PCI I/O : 0xffff7ffffee00000 - 0xffff7fffffe00000   (
   16 MB)
> [    0.000000]     memory  : 0xffff800000000000 - 0xffff800400000000   (
16384 MB)
> [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
> [    0.000000] Preemptible hierarchical RCU implementation.
> [    0.000000]  Build-time adjustment of leaf fanout to 64.
> [    0.000000]  RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=8.
> [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64,
nr_cpu_ids=8
> [    0.000000] NR_IRQS:64 nr_irqs:64 0
> [    0.000000] GIC: Using split EOI/Deactivate mode
> [    0.000000] GICv3: No distributor detected at @ffff000008060000,
giving up
> [    0.000000] Architected cp15 timer(s) running at 50.00MHz (phys).
> [    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff
max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
> [    0.000005] sched_clock: 56 bits at 50MHz, resolution 20ns, wraps
every 4398046511100ns
> [    0.008526] Console: colour dummy device 80x25
> [    0.013156] Lock dependency validator: Copyright (c) 2006 Red Hat,
Inc., Ingo Molnar
> [    0.021178] ... MAX_LOCKDEP_SUBCLASSES:  8
> [    0.025455] ... MAX_LOCK_DEPTH:          48
> [    0.029791] ... MAX_LOCKDEP_KEYS:        8191
> [    0.034352] ... CLASSHASH_SIZE:          4096
> [    0.038913] ... MAX_LOCKDEP_ENTRIES:     32768
> [    0.043517] ... MAX_LOCKDEP_CHAINS:      65536
> [    0.048121] ... CHAINHASH_SIZE:          32768
> [    0.052708]  memory used by lock dependency info: 8127 kB
> [    0.058340]  per task-struct memory footprint: 1920 bytes
> [    0.063902] Calibrating delay loop (skipped), value calculated using
timer frequency.. 100.00 BogoMIPS (lpj=200000)
> [    0.074799] pid_max: default: 32768 minimum: 301
> [    0.079632] ACPI: Core revision 20160108
> [    0.111734] ACPI: 4 ACPI AML tables successfully acquired and loaded
> [    0.118405]
> [    0.120114] Security Framework initialized
> [    0.124409] Mount-cache hash table entries: 32768 (order: 2, 262144
bytes)
> [    0.131569] Mountpoint-cache hash table entries: 32768 (order: 2,
262144 bytes)
> [    0.140440] ftrace: allocating 29344 entries in 8 pages
> [    0.234935] ASID allocator initialised with 65536 entries
> [    0.242853] Remapping and enabling EFI services.
> [    0.247783]   EFI remap 0x0000000010510000 => 0000000020000000
> [    0.253870]   EFI remap 0x0000000010548000 => 0000000020018000
> [    0.259941]   EFI remap 0x0000000017000000 => 0000000020020000
> [    0.266027]   EFI remap 0x000000001c025000 => 0000000020035000
> [    0.272086]   EFI remap 0x000000007c0c0000 => 0000000020040000
> [    0.278187]   EFI remap 0x000000007c1c0000 => 0000000020050000
> [    0.284228]   EFI remap 0x000000007c2c0000 => 0000000020060000
> [    0.290303]   EFI remap 0x000000007c3c0000 => 0000000020070000
> [    0.296440]   EFI remap 0x000000007c4c0000 => 0000000020080000
> [    0.302514]   EFI remap 0x000000007c5c0000 => 0000000020090000
> [    0.308607]   EFI remap 0x000000007c6c0000 => 00000000200a0000
> [    0.314605]   EFI remap 0x000000007c7c0000 => 00000000200b0000
> [    0.320656]   EFI remap 0x00000043fa813000 => 00000000200c3000
> [    0.326707]   EFI remap 0x00000043fa85a000 => 00000000200da000
> [    0.332800]   EFI remap 0x00000043ffa02000 => 00000000202c2000
> [    0.338833]   EFI remap 0x00000043ffa16000 => 00000000202d6000
> [    0.346722] Detected PIPT I-cache on CPU1
> [    0.346777] CPU1: Booted secondary processor [500f0000]
> [    0.348055] Detected PIPT I-cache on CPU2
> [    0.348101] CPU2: Booted secondary processor [500f0000]
> [    0.349445] Detected PIPT I-cache on CPU3
> [    0.349487] CPU3: Booted secondary processor [500f0000]
> [    0.350755] Detected PIPT I-cache on CPU4
> [    0.350804] CPU4: Booted secondary processor [500f0000]
> [    0.352092] Detected PIPT I-cache on CPU5
> [    0.352139] CPU5: Booted secondary processor [500f0000]
> [    0.353453] Detected PIPT I-cache on CPU6
> [    0.353503] CPU6: Booted secondary processor [500f0000]
> [    0.354760] Detected PIPT I-cache on CPU7
> [    0.354805] CPU7: Booted secondary processor [500f0000]
> [    0.355016] Brought up 8 CPUs
> [    0.424443] SMP: Total of 8 processors activated.
> [    0.429596] CPU: All CPU(s) started at EL2
> [    0.435912] devtmpfs: initialized
> [    0.440366] gcov: version magic: 0x35303352
> [    0.446684] SMBIOS 3.0.0 present.
> [    0.451123] clocksource: jiffies: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 7645041785100000 ns
> [    0.462909] pinctrl core: initialized pinctrl subsystem
> [    0.472249] NET: Registered protocol family 16
> [    0.480839] PCCT header not found.
> [    0.484751] vdso: 2 pages (1 code @ ffff0000096f0000, 1 data @
ffff00000a020000)
> [    0.492673] hw-breakpoint: found 4 breakpoint and 4 watchpoint
registers.
> [    0.514667] DMA: preallocated 256 KiB pool for atomic allocations
> [    0.521478] ACPI: bus type PCI registered
> [    0.526136] Serial: AMBA PL011 UART driver
> [    0.588382] HugeTLB registered 512 MB page size, pre-allocated 0 pages
> [    0.598785] ACPI: Added _OSI(Module Device)
> [    0.603442] ACPI: Added _OSI(Processor Device)
> [    0.607997] ACPI: Added _OSI(3.0 _SCP Extensions)
> [    0.612881] ACPI: Added _OSI(Processor Aggregator Device)
> [    0.666107] ACPI: Interpreter enabled
> [    0.670015] ACPI: Using GIC for interrupt routing
> [    0.702600] ACPI: Power Resource [SCVR] (off)
> [    0.769224] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
> [    0.775864] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM
ClockPM Segments MSI]
> [    0.786707] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME
AER PCIeCapability]
> [    0.794901] acpi PNP0A08:00: Bus 0000:00 not present in PCI namespace
> [    0.808595] vgaarb: loaded
> [    0.811960] SCSI subsystem initialized
> [    0.816527] libata version 3.00 loaded.
> [    0.821579] ACPI: bus type USB registered
> [    0.826051] usbcore: registered new interface driver usbfs
> [    0.831972] usbcore: registered new interface driver hub
> [    0.838079] usbcore: registered new device driver usb
> [    0.843666] pps_core: LinuxPPS API ver. 1 registered
> [    0.848778] pps_core: Software ver. 5.3.6 - Copyright 2005-2007
Rodolfo Giometti <giometti@linux.it>
> [    0.858139] PTP clock support registered
> [    0.863697] Advanced Linux Sound Architecture Driver Initialized.
> [    0.872329] clocksource: Switched to clocksource arch_sys_counter
> [    0.891969] Warning: could not register all branches stats
> [    0.897857] Warning: could not register annotated branches stats
> [    1.014772] VFS: Disk quotas dquot_6.6.0
> [    1.018869] VFS: Dquot-cache hash table entries: 8192 (order 0, 65536
bytes)
> [    1.026998] pnp: PnP ACPI init
> [    1.034494] pnp: PnP ACPI: found 0 devices
> [    1.076859] NET: Registered protocol family 2
> [    1.082304] TCP established hash table entries: 131072 (order: 4,
1048576 bytes)
> [    1.090249] TCP bind hash table entries: 65536 (order: 6, 4194304
bytes)
> [    1.102699] TCP: Hash tables configured (established 131072 bind 65536)
> [    1.109673] UDP hash table entries: 8192 (order: 4, 1310720 bytes)
> [    1.117621] UDP-Lite hash table entries: 8192 (order: 4, 1310720 bytes)
> [    1.126338] NET: Registered protocol family 1
> [    1.131621] RPC: Registered named UNIX socket transport module.
> [    1.137591] RPC: Registered udp transport module.
> [    1.142513] RPC: Registered tcp transport module.
> [    1.147396] RPC: Registered tcp NFSv4.1 backchannel transport module.
> [    1.154556] PCI: CLS 0 bytes, default 128
> [    1.159531] Unpacking initramfs...
> [    1.163011] Unable to handle kernel paging request at virtual address
ffff8003f9a7f000
> [    1.171709] pgd = ffff00000b8e0000
> [    1.175160] [ffff8003f9a7f000] *pgd=00000043fffc0003,
*pud=00000043fffc0003, *pmd=00000043fffa0003, *pte=0000000000000000
> [    1.186396] Internal error: Oops: 96000007 [#1] PREEMPT SMP
> [    1.192489] Modules linked in:
> [    1.195821] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.6.0-rc1 #8
> [    1.201970] Hardware name: AppliedMicro Mustang/Mustang, BIOS
3.05.05-beta_rc Jan 27 2016
> [    1.210125] task: ffff8003c0360000 ti: ffff8003c0400000 task.ti:
ffff8003c0400000
> [    1.218309] PC is at unpack_to_rootfs+0x1fc/0x664
> [    1.223448] LR is at unpack_to_rootfs+0xa8/0x664
> [    1.228492] pc : [<ffff000009e43e90>] lr : [<ffff000009e43d3c>]
pstate: 60000045
> [    1.236567] sp : ffff8003c0403ca0
> [    1.239864] x29: ffff8003c0403ca0 x28: ffff000009fc3708
> [    1.245179] x27: ffff000009ce4e18 x26: ffff00000a3fa148
> [    1.250977] x25: ffff00000b3c5998 x24: 0000000000a381dd
> [    1.256757] x23: ffff8003f9a7f000 x22: ffff00000a3f9f90
> [    1.262253] x21: ffff000009f1d000 x20: ffff00000a8c1000
> [    1.267869] x19: ffff00000a8c1548 x18: 0000000005f5e0ff
> [    1.273174] x17: ffff000008abf468 x16: 0000000000000000
> [    1.278669] x15: ffff00000a447ce0 x14: 00000000000000b0
> [    1.284294] x13: 00000000000000b4 x12: 00000000000000b4
> [    1.290084] x11: 0000000000000001 x10: ffff8003c0400000
> [    1.295389] x9 : 00000000000487d1 x8 : 0000000000000003
> [    1.300702] x7 : 0000000000000000 x6 : ffff00000a032000
> [    1.306327] x5 : ffff00000b385a28 x4 : 0000000000000002
> [    1.311641] x3 : ffff000009f1dc10 x2 : 0000000000000002
> [    1.316955] x1 : 0000000000000001 x0 : ffff00000a8c1548
> [    1.322588]
> [    1.324072] Process swapper/0 (pid: 1, stack limit =
0xffff8003c0400020)
> [    1.331379] Stack: (0xffff8003c0403ca0 to 0xffff8003c0404000)
> [    1.337660] 3ca0: ffff8003c0403d20 ffff000009e456ec ffff00000a8c1aa8
ffff00000a8c1000
> [    1.345452] 3cc0: ffff00000a3f9000 ffff00000a8c1000 ffff00000a8c1000
ffff00000a3fa788
> [    1.354012] 3ce0: ffff00000a8c1000 ffff00000a03a1a0 ffff00000a8c0a38
ffff000009fc3708
> [    1.362564] 3d00: 0000000000877237 ffff00000b385a28 ffff00000a032000
0000000000000000
> [    1.371107] 3d20: ffff8003c0403d70 ffff00000809256c ffff00000a8c07d8
ffff8003c1a44b80
> [    1.379668] 3d40: ffff00000a8c0000 ffff00000a03a1a0 ffff000009f1dbc0
ffff00000a8c0878
> [    1.388228] 3d60: ffff000009f1db50 ffff00000a39e000 ffff8003c0403e30
ffff000009e41d24
> [    1.396789] 3d80: ffff00000a8c0000 00000000000000fb ffff00000a8c0000
0000000000000005
> [    1.404589] 3da0: ffff000009f1dbc0 ffff000009e25660 ffff000009f1db50
ffff000009e402e0
> [    1.412380] 3dc0: ffff00000a8c0a38 ffff000009fc3708 ffff00000a42c350
ffff000009d14e90
> [    1.420182] 3de0: ffff000009e455d0 000000000a9043f0 0000000100000000
0000000000000000
> [    1.428743] 3e00: 0000000100000001 ffff00000a42c3c8 0000000000000038
0000000000000040
> [    1.436534] 3e20: 0000000100000000 0000000000000608 ffff8003c0403e90
ffff000009693ea4
> [    1.445094] 3e40: ffff00000a8c0000 ffff00000a3f8000 ffff00000a8c0000
0000000000000000
> [    1.453646] 3e60: ffff00000a8c0b30 0000000000000000 0000000000000000
0000000000000000
> [    1.462206] 3e80: 0000000000000000 0000000000000000 0000000000000000
ffff000008097e10
> [    1.470007] 3ea0: ffff000009693e68 0000000000000000 0000000000000000
0000000000000000
> [    1.478567] 3ec0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.486358] 3ee0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.494910] 3f00: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.502701] 3f20: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.510492] 3f40: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.519052] 3f60: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.527612] 3f80: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.536163] 3fa0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.544715] 3fc0: 0000000000000000 0000000000000000 0000000000000000
0000000000000005
> [    1.553276] 3fe0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.561065] Call trace:
> [    1.563501] Exception stack(0xffff8003c0403ad0 to 0xffff8003c0403bf0)
> [    1.570522] 3ac0:                                   ffff00000a8c1548
ffff00000a8c1000
> [    1.578349] 3ae0: ffff8003c0403ca0 ffff000009e43e90 0000000060000045
ffff000008241108
> [    1.586909] 3b00: ffff00000b2db218 ffff00000a449590 0000000000000000
ffff00000a0867d8
> [    1.595469] 3b20: ffff00000a0867e0 0000000000000040 ffff8003c0403bb0
ffff0000081b604c
> [    1.604030] 3b40: ffff00000a909000 ffff00000a90a770 ffff00000853cfa8
ffff00000a42ff98
> [    1.612590] 3b60: 0000000000000001 ffff00000b2d5000 ffff00000a37f000
ffff8003c0400000
> [    1.620381] 3b80: ffff00000a8c1548 0000000000000001 0000000000000002
ffff000009f1dc10
> [    1.628941] 3ba0: 0000000000000002 ffff00000b385a28 ffff00000a032000
0000000000000000
> [    1.636732] 3bc0: 0000000000000003 00000000000487d1 ffff8003c0400000
0000000000000001
> [    1.644522] 3be0: 00000000000000b4 00000000000000b4
> [    1.649844] [<ffff000009e43e90>] unpack_to_rootfs+0x1fc/0x664
> [    1.656125] [<ffff000009e456ec>] populate_rootfs+0x11c/0x22c
> [    1.661758] [<ffff00000809256c>] do_one_initcall+0x1d4/0x520
> [    1.667399] [<ffff000009e41d24>] kernel_init_freeable+0x2b4/0x4b0
> [    1.674061] [<ffff000009693ea4>] kernel_init+0x3c/0x368
> [    1.679486] [<ffff000008097e10>] ret_from_fork+0x10/0x40
> [    1.684774] Code: 91000421 f900a401 b4fffe18 f940a801 (394002e2)
> [    1.690902] ---[ end trace 13152abe1ac10cde ]---
> [    1.696013] Kernel panic - not syncing: Attempted to kill init!
exitcode=0x0000000b
> [    1.696013]
> [    1.705870] CPU6: stopping
> [    1.708700] CPU: 6 PID: 0 Comm: swapper/6 Tainted: G      D 4.6.0-rc1
#8
> [    1.716398] Hardware name: AppliedMicro Mustang/Mustang, BIOS
3.05.05-beta_rc Jan 27 2016
> [    1.724871] Call trace:
> [    1.727399] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
> [    1.733017] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
> [    1.738246] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
> [    1.743656] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
> [    1.749065] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
> [    1.754836] Exception stack(0xffff8003fff03fa0 to 0xffff8003fff040c0)
> [    1.761497] 3fa0: ffff8003c0443da0 ffff00000a8c29e0 ffff8003c0443ec0
ffff000008099964
> [    1.769601] 3fc0: 0000000060000045 ffff00000a030000 ffff8003fff00020
ffff8003fff04010
> [    1.777740] 3fe0: 0000000000000001 ffff8003c0440000 ffff00000800f000
ffff8003c0443da0
> [    1.785852] 4000: ffff8003c0443ec0 ffff8003c0443da0 0000000000000000
0000000000000000
> [    1.793982] 4020: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.802095] 4040: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.810225] 4060: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.818329] 4080: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.826416] 40a0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.834520] [<ffff000008097724>] el1_irq+0xa4/0x114
> [    1.839619] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
> [    1.845177] [<ffff000008209598>] default_idle_call+0xd0/0xf8
> [    1.851010] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
> [    1.857024] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
> [    1.863522] [<00000040002921fc>] 0x40002921fc
> [    1.868054] CPU5: stopping
> [    1.870880] CPU: 5 PID: 0 Comm: swapper/5 Tainted: G      D 4.6.0-rc1
#8
> [    1.878585] Hardware name: AppliedMicro Mustang/Mustang, BIOS
3.05.05-beta_rc Jan 27 2016
> [    1.887085] Call trace:
> [    1.889672] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
> [    1.895264] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
> [    1.900492] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
> [    1.905892] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
> [    1.911336] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
> [    1.917072] Exception stack(0xffff8003ffed3fa0 to 0xffff8003ffed40c0)
> [    1.923742] 3fa0: ffff8003c043fda0 ffff00000a8c29e0 ffff8003c043fec0
ffff000008099964
> [    1.931873] 3fc0: 0000000060000045 ffff00000a030000 ffff8003ffed0020
ffff8003ffed4010
> [    1.939994] 3fe0: 0000000000000001 ffff8003c043c000 ffff00000800f000
ffff8003c043fda0
> [    1.948133] 4000: ffff8003c043fec0 ffff8003c043fda0 0000000000000000
0000000000000000
> [    1.956202] 4020: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.964375] 4040: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.972462] 4060: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.980644] 4080: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.988782] 40a0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    1.996843] [<ffff000008097724>] el1_irq+0xa4/0x114
> [    2.001899] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
> [    2.007473] [<ffff000008209598>] default_idle_call+0xd0/0xf8
> [    2.013358] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
> [    2.019415] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
> [    2.025877] [<00000040002921fc>] 0x40002921fc
> [    2.030417] CPU3: stopping
> [    2.033243] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G      D 4.6.0-rc1
#8
> [    2.040862] Hardware name: AppliedMicro Mustang/Mustang, BIOS
3.05.05-beta_rc Jan 27 2016
> [    2.049354] Call trace:
> [    2.051890] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
> [    2.057507] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
> [    2.062752] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
> [    2.068144] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
> [    2.073544] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
> [    2.079315] Exception stack(0xffff8003ffe73fa0 to 0xffff8003ffe740c0)
> [    2.085968] 3fa0: ffff8003c0437da0 ffff00000a8c29e0 ffff8003c0437ec0
ffff000008099964
> [    2.094064] 3fc0: 0000000060000045 ffff00000a030000 ffff8003ffe70020
ffff8003ffe74010
> [    2.102212] 3fe0: 0000000000000001 ffff8003c0434000 ffff00000800f000
ffff8003c0437da0
> [    2.110272] 4000: ffff8003c0437ec0 ffff8003c0437da0 0000000000000000
0000000000000000
> [    2.118359] 4020: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.126480] 4040: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.134636] 4060: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.142731] 4080: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.150818] 40a0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.158905] [<ffff000008097724>] el1_irq+0xa4/0x114
> [    2.163951] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
> [    2.169534] [<ffff000008209598>] default_idle_call+0xd0/0xf8
> [    2.175392] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
> [    2.181424] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
> [    2.187946] [<00000040002921fc>] 0x40002921fc
> [    2.192458] CPU0: stopping
> [    2.195280] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D 4.6.0-rc1
#8
> [    2.202968] Hardware name: AppliedMicro Mustang/Mustang, BIOS
3.05.05-beta_rc Jan 27 2016
> [    2.211441] Call trace:
> [    2.213992] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
> [    2.219558] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
> [    2.224785] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
> [    2.230210] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
> [    2.235645] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
> [    2.241398] Exception stack(0xffff8003ffde3fa0 to 0xffff8003ffde40c0)
> [    2.248085] 3fa0: ffff00000a013d70 ffff00000a8c29e0 ffff00000a013e90
ffff000008099964
> [    2.256188] 3fc0: 0000000060000045 ffff00000a030000 ffff8003ffde0020
ffff8003ffde4010
> [    2.264309] 3fe0: 0000000000000001 ffff00000a010000 ffff00000800f000
ffff00000a013d70
> [    2.272386] 4000: ffff00000a013e90 ffff00000a013d70 0000000000000000
0000000000000000
> [    2.280481] 4020: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.288584] 4040: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.296704] 4060: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.304746] 4080: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.312814] 40a0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.320840] [<ffff000008097724>] el1_irq+0xa4/0x114
> [    2.325842] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
> [    2.331468] [<ffff000008209598>] default_idle_call+0xd0/0xf8
> [    2.337274] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
> [    2.343279] [<ffff000009693e48>] rest_init+0x168/0x188
> [    2.348644] [<ffff000009e41a4c>] start_kernel+0xb70/0xb94
> [    2.354250] [<ffff0000080811c8>] 0xffff0000080811c8
> [    2.359279] CPU2: stopping
> [    2.362048] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G      D 4.6.0-rc1
#8
> [    2.369745] Hardware name: AppliedMicro Mustang/Mustang, BIOS
3.05.05-beta_rc Jan 27 2016
> [    2.378261] Call trace:
> [    2.380811] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
> [    2.386298] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
> [    2.391550] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
> [    2.396846] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
> [    2.402237] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
> [    2.408058] Exception stack(0xffff8003ffe43fa0 to 0xffff8003ffe440c0)
> [    2.414598] 3fa0: ffff8003c0433da0 ffff00000a8c29e0 ffff8003c0433ec0
ffff000008099964
> [    2.422813] 3fc0: 0000000060000045 ffff00000a030000 ffff8003ffe40020
ffff8003ffe44010
> [    2.430968] 3fe0: 0000000000000001 ffff8003c0430000 ffff00000800f000
ffff8003c0433da0
> [    2.439028] 4000: ffff8003c0433ec0 ffff8003c0433da0 0000000000000000
0000000000000000
> [    2.447096] 4020: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.455199] 4040: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.463138] 4060: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.471309] 4080: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.479455] 40a0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.487550] [<ffff000008097724>] el1_irq+0xa4/0x114
> [    2.492655] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
> [    2.498271] [<ffff000008209598>] default_idle_call+0xd0/0xf8
> [    2.504103] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
> [    2.510288] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
> [    2.516870] [<00000040002921fc>] 0x40002921fc
> [    2.521329] CPU4: stopping
> [    2.524132] CPU: 4 PID: 0 Comm: swapper/4 Tainted: G      D 4.6.0-rc1
#8
> [    2.532010] Hardware name: AppliedMicro Mustang/Mustang, BIOS
3.05.05-beta_rc Jan 27 2016
> [    2.540301] Call trace:
> [    2.542816] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
> [    2.548441] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
> [    2.553719] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
> [    2.559195] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
> [    2.564655] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
> [    2.570433] Exception stack(0xffff8003ffea3fa0 to 0xffff8003ffea40c0)
> [    2.576998] 3fa0: ffff8003c043bda0 ffff00000a8c29e0 ffff8003c043bec0
ffff000008099964
> [    2.584989] 3fc0: 0000000060000045 ffff00000a030000 ffff8003ffea0020
ffff8003ffea4010
> [    2.593049] 3fe0: 0000000000000001 ffff8003c0438000 ffff00000800f000
ffff8003c043bda0
> [    2.601057] 4000: ffff8003c043bec0 ffff8003c043bda0 0000000000000000
0000000000000000
> [    2.609099] 4020: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.617479] 4040: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.625581] 4060: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.633529] 4080: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.641683] 40a0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.649821] [<ffff000008097724>] el1_irq+0xa4/0x114
> [    2.654797] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
> [    2.660300] [<ffff000008209598>] default_idle_call+0xd0/0xf8
> [    2.666149] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
> [    2.672144] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
> [    2.678562] [<00000040002921fc>] 0x40002921fc
> [    2.683011] CPU7: stopping
> [    2.685710] CPU: 7 PID: 0 Comm: swapper/7 Tainted: G      D 4.6.0-rc1
#8
> [    2.693069] Hardware name: AppliedMicro Mustang/Mustang, BIOS
3.05.05-beta_rc Jan 27 2016
> [    2.701395] Call trace:
> [    2.703858] [<ffff0000080a4ad0>] dump_backtrace+0x0/0x4b0
> [    2.709231] [<ffff0000080a4fbc>] show_stack+0x3c/0x60
> [    2.714267] [<ffff000008aa172c>] dump_stack+0x1dc/0x2c8
> [    2.719700] [<ffff0000080b2120>] handle_IPI+0xa08/0xa40
> [    2.724900] [<ffff000008090cfc>] gic_handle_irq+0x164/0x260
> [    2.730782] Exception stack(0xffff8003fff33fa0 to 0xffff8003fff340c0)
> [    2.737261] 3fa0: ffff8003c0447da0 ffff00000a8c29e0 ffff8003c0447ec0
ffff000008099964
> [    2.745061] 3fc0: 0000000060000045 ffff00000a030000 ffff8003fff30020
ffff8003fff34010
> [    2.752922] 3fe0: 0000000000000001 ffff8003c0444000 ffff00000800f000
ffff8003c0447da0
> [    2.760731] 4000: ffff8003c0447ec0 ffff8003c0447da0 0000000000000000
0000000000000000
> [    2.768756] 4020: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.777143] 4040: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.785298] 4060: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.793366] 4080: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.801217] 40a0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
> [    2.809406] [<ffff000008097724>] el1_irq+0xa4/0x114
> [    2.814486] [<ffff000008099964>] arch_cpu_idle+0x94/0x508
> [    2.819859] [<ffff000008209598>] default_idle_call+0xd0/0xf8
> [    2.825500] [<ffff000008209e04>] cpu_startup_entry+0x844/0xa30
> [    2.831556] [<ffff0000080b0c6c>] secondary_start_kernel+0x3dc/0x468
> [    2.837792] [<00000040002921fc>] 0x40002921fc
> [    2.842501] ---[ end Kernel panic - not syncing: Attempted to kill
init! exitcode=0x0000000b
> [    2.842501]
>
> On 5/15/16 4:08 PM, Christoffer Dall wrote:
>>
>> Yes, I test this for every release.
>>
>> What's your config? What are the symptoms?
>>
>> Are you booting with UEFI or u-boot on your mustang?
>>
>> Thanks,
>> -Christoffer
>>
>> On Saturday, May 14, 2016, Itaru Kitayama <itaru.kitayama@riken.jp
>> <mailto:itaru.kitayama@riken.jp>> wrote:
>>
>>     Hi,
>>
>>     The tag kvm-arm-for-4.7 fails to boot on Mustang. Has anyone
>>     verified this tag on Mustang? The F/W I'm using is 3.05.05-beta_rc.
>>     _______________________________________________
>>     kvmarm mailing list
>>     kvmarm@lists.cs.columbia.edu
>>     https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

[-- Attachment #1.2: Type: text/html, Size: 37554 bytes --]

[-- Attachment #2: Type: text/plain, Size: 151 bytes --]

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-15 11:19     ` Christoffer Dall
@ 2016-05-15 11:42       ` Julien Grall
  2016-05-15 13:30         ` Itaru Kitayama
  0 siblings, 1 reply; 80+ messages in thread
From: Julien Grall @ 2016-05-15 11:42 UTC (permalink / raw)
  To: Christoffer Dall, Itaru Kitayama; +Cc: kvmarm@lists.cs.columbia.edu

Hello,

On 15/05/2016 12:19, Christoffer Dall wrote:
> On Sunday, May 15, 2016, Itaru Kitayama <itaru.kitayama@riken.jp
> <mailto:itaru.kitayama@riken.jp>> wrote:
>>
>> Below is the boot (with UEFI) log. I'm attaching the .config I'm using.
>> I've been trying to test Julien's ACPI support patch set recently
> merged in the kvmarm tree on Mustang.
>
>
> I don't run anything with ACPI, so haven't tested that particular aspect.
>
> This doesn't immediately look like it's related to the kvmarm patches.
>
> Perhaps you could try with Linux-next as well to see if this was already
> fixed?
>
> Julien, did you test mustang with your ACPI patches?

No, the patch has been tested on Juno-r2 and Seattle.

However, the logs looks very similar to a bug that Steve Capper was 
hunting in Linux 4.6.0-rc3. I believe this has been fixed in a later RC.

kvm-arm-for-4.7 seems to be based on Linux 4.6-rc1 so I would recommend 
you to try Linux-next.

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-15 11:42       ` Julien Grall
@ 2016-05-15 13:30         ` Itaru Kitayama
  2016-05-16  7:19           ` Christoffer Dall
  0 siblings, 1 reply; 80+ messages in thread
From: Itaru Kitayama @ 2016-05-15 13:30 UTC (permalink / raw)
  To: Julien Grall, Christoffer Dall; +Cc: kvmarm@lists.cs.columbia.edu

Julien, Christoffer,

Below is the boot log of linux-next.


EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services and installing virtual address map...
L3C: 8MB
Booting Linux on physical CPU 0x0
Linux version 4.6.0-rc7-next-20160513 (itaru.kitayama@r2-a11) (gcc 
version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC) ) #6 SMP PREEMPT Sun May 
15 08:21:01 CDT 2016
Boot CPU: AArch64 Processor [500f0000]
earlycon: uart0 at MMIO32 0x000000001c020000 (options '')
bootconsole [uart0] enabled
efi: Getting EFI parameters from FDT:
efi: EFI v2.40 by X-Gene Mustang Board EFI Jan 27 2016 18:27:58
efi:  ACPI=0x43fa859000  ACPI 2.0=0x43fa859014  SMBIOS 3.0=0x43fa857000
cma: Reserved 512 MiB at 0x00000040e0000000
ACPI: Early table checksum verification enabled
ACPI: RSDP 0x00000043FA859014 000024 (v02 APM   )
ACPI: XSDT 0x00000043FA8580E8 00007C (v01 APM    XGENE    00000003 
01000013)
ACPI: FACP 0x00000043FA850000 00010C (v05 APM    XGENE    00000003 INTL 
20140724)
ACPI: DSDT 0x00000043FA851000 003A00 (v05 APM    APM88xxx 00000001 INTL 
20140724)
ACPI: DBG2 0x00000043FA855000 0000AA (v00 APMC0D XGENEDBG 00000000 INTL 
20140724)
ACPI: GTDT 0x00000043FA84E000 0000E0 (v02 APM    XGENE    00000001 INTL 
20140724)
ACPI: MCFG 0x00000043FA84D000 00003C (v01 APM    XGENE    00000002 INTL 
20140724)
ACPI: SPCR 0x00000043FA84C000 000050 (v02 APMC0D XGENESPC 00000000 INTL 
20140724)
ACPI: SSDT 0x00000043FA84B000 00002D (v02 APM    XGENE    00000001 INTL 
20140724)
ACPI: BERT 0x00000043FA84A000 000030 (v01 APM    XGENE    00000002 INTL 
20140724)
ACPI: HEST 0x00000043FA849000 0002A8 (v01 APM    XGENE    00000002 INTL 
20140724)
ACPI: APIC 0x00000043FA848000 0002A4 (v03 APM    XGENE    00000003 
01000013)
ACPI: SSDT 0x00000043FA847000 000063 (v02 REDHAT MACADDRS 00000001 
01000013)
ACPI: SSDT 0x00000043FA846000 000032 (v02 REDHAT UARTCLKS 00000001 
01000013)
On node 0 totalpages: 262144
   DMA zone: 64 pages used for memmap
   DMA zone: 0 pages reserved
   DMA zone: 65536 pages, LIFO batch:1
   Normal zone: 192 pages used for memmap
   Normal zone: 196608 pages, LIFO batch:1
psci: is not implemented in ACPI.
percpu: Embedded 3 pages/cpu @ffff8003ffde0000 s110208 r8192 d78208 u196608
pcpu-alloc: s110208 r8192 d78208 u196608 alloc=3*65536
pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7
Detected PIPT I-cache on CPU0
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 261888
Kernel command line: BOOT_IMAGE=/vmlinuz-4.6.0-rc7-next-20160513 
root=UUID=ac9f9264-7572-48c3-97d2-042ea95f7640 ro acpi=force 
acpi_force_table_verification earlycon=uart,mmio32,0x1c020000 
console=ttyS0,115200 loglevel=8 LANG=en_US.UTF-8
log_buf_len individual max cpu contribution: 4096 bytes
log_buf_len total cpu_extra contributions: 28672 bytes
log_buf_len min size: 16384 bytes
log_buf_len: 65536 bytes
early log buf free: 13072(79%)
PID hash table entries: 4096 (order: -1, 32768 bytes)
Dentry cache hash table entries: 2097152 (order: 8, 16777216 bytes)
Inode-cache hash table entries: 1048576 (order: 7, 8388608 bytes)
software IO TLB [mem 0x40dbff0000-0x40dfff0000] (64MB) mapped at 
[ffff8000dbff0000-ffff8000dffeffff]
Memory: 16070272K/16777216K available (22780K kernel code, 8781K rwdata, 
7680K rodata, 1920K init, 16628K bss, 182656K reserved, 524288K 
cma-reserved)
Virtual kernel memory layout:
     modules : 0xffff000000000000 - 0xffff000008000000   (   128 MB)
     vmalloc : 0xffff000008000000 - 0xffff7bdfffff0000   (126847 GB)
       .text : 0xffff000008080000 - 0xffff0000096b0000   ( 22720 KB)
     .rodata : 0xffff0000096b0000 - 0xffff000009e40000   (  7744 KB)
       .init : 0xffff000009e40000 - 0xffff00000a020000   (  1920 KB)
       .data : 0xffff00000a020000 - 0xffff00000a8b3600   (  8782 KB)
        .bss : 0xffff00000a8b3600 - 0xffff00000b8f0760   ( 16629 KB)
     fixed   : 0xffff7fdffe7d0000 - 0xffff7fdffec00000   (  4288 KB)
     PCI I/O : 0xffff7fdffee00000 - 0xffff7fdfffe00000   (    16 MB)
     vmemmap : 0xffff7fe000000000 - 0xffff800000000000   (   128 GB maximum)
               0xffff7fe000000000 - 0xffff7fe001000000   (    16 MB actual)
     memory  : 0xffff800000000000 - 0xffff800400000000   ( 16384 MB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
Preemptible hierarchical RCU implementation.
	Build-time adjustment of leaf fanout to 64.
NR_IRQS:64 nr_irqs:64 0
GIC: Using split EOI/Deactivate mode
GICv3: No distributor detected at @ffff000008060000, giving up
Architected cp15 timer(s) running at 50.00MHz (phys).
clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 
0xb8812736b, max_idle_ns: 440795202655 ns
sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
Console: colour dummy device 80x25
Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
... MAX_LOCKDEP_SUBCLASSES:  8
... MAX_LOCK_DEPTH:          48
... MAX_LOCKDEP_KEYS:        8191
... CLASSHASH_SIZE:          4096
... MAX_LOCKDEP_ENTRIES:     32768
... MAX_LOCKDEP_CHAINS:      65536
... CHAINHASH_SIZE:          32768
  memory used by lock dependency info: 8127 kB
  per task-struct memory footprint: 1920 bytes
Calibrating delay loop (skipped), value calculated using timer 
frequency.. 100.00 BogoMIPS (lpj=200000)
pid_max: default: 32768 minimum: 301
ACPI: Core revision 20160422
Security Framework initialized
Mount-cache hash table entries: 32768 (order: 2, 262144 bytes)
Mountpoint-cache hash table entries: 32768 (order: 2, 262144 bytes)
ftrace: allocating 29581 entries in 8 pages
ASID allocator initialised with 65536 entries
Remapping and enabling EFI services.
   EFI remap 0x0000000010510000 => 0000000020000000
   EFI remap 0x0000000010548000 => 0000000020018000
   EFI remap 0x0000000017000000 => 0000000020020000
   EFI remap 0x000000001c025000 => 0000000020035000
   EFI remap 0x000000007c0c0000 => 0000000020040000
   EFI remap 0x000000007c1c0000 => 0000000020050000
   EFI remap 0x000000007c2c0000 => 0000000020060000
   EFI remap 0x000000007c3c0000 => 0000000020070000
   EFI remap 0x000000007c4c0000 => 0000000020080000
   EFI remap 0x000000007c5c0000 => 0000000020090000
   EFI remap 0x000000007c6c0000 => 00000000200a0000
   EFI remap 0x000000007c7c0000 => 00000000200b0000
UEFI Runtime regions are not aligned to 64 KB -- buggy firmware?
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at arch/arm64/kernel/efi.c:34 
efi_create_mapping+0x1a0/0x3b8
Modules linked in:

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.6.0-rc7-next-20160513 #6
Hardware name: APM X-Gene Mustang board (DT)
task: ffff8003c0340000 ti: ffff8003c0400000 task.ti: ffff8003c0400000
PC is at efi_create_mapping+0x1a0/0x3b8
LR is at efi_create_mapping+0x194/0x3b8
pc : [<ffff000009e4a5a8>] lr : [<ffff000009e4a59c>] pstate: 60000245
sp : ffff8003c0403cb0
x29: ffff8003c0403cb0 x28: ffff00000a390000
x27: ffff8003f9a77468 x26: 0000000000003000
x25: 800000000000000f x24: ffff00000a2de390
x23: 0000000000000005 x22: 0000000000000001
x21: ffff00000a41d000 x20: ffff00000a8fc000
x19: ffff00000a8fc198 x18: ffff0000097fe000
x17: 0000000000000001 x16: 0000000000000000
x15: 0000000000000056 x14: 3f657261776d7269
x13: ffff00000a464f28 x12: ffff00000a465b30
x11: 0000000000000001 x10: ffff8003c0400000
x9 : 00000000000085f1 x8 : 0000000000000003
x7 : 0000000000000000 x6 : ffff00000a042000
x5 : ffff00000b3b4c58 x4 : 00000000001c115c
x3 : ffff8003c0340000 x2 : 0000000000000132
x1 : 0000000000000099 x0 : 0000000000000001

---[ end trace a2cb2e24ff35d5f8 ]---
Call trace:
Exception stack(0xffff8003c0403ac0 to 0xffff8003c0403be0)
3ac0: ffff00000a8fc198 ffff00000a8fc000 ffff8003c0403cb0 ffff000009e4a5a8
3ae0: 0000000060000245 000000000000003d 800000000000000f 0000000000003000
3b00: ffff8003f9a77468 0000000000000001 0000000000000005 ffff00000a2de390
3b20: 800000000000000f 0000000000003000 ffff8003f9a77468 ffff00000a390000
3b40: ffff00000a465ab8 0000000000000000 ffff8003c0403bd0 ffff000009cdcf70
3b60: 000000000b3071a8 0000000000000000 ffff000000000000 00000000ffffffff
3b80: ffff8003c0403cb0 ffff8003c0403cb0 0000000000000001 0000000000000099
3ba0: 0000000000000132 ffff8003c0340000 00000000001c115c ffff00000b3b4c58
3bc0: ffff00000a042000 0000000000000000 0000000000000003 00000000000085f1
[<ffff000009e4a5a8>] efi_create_mapping+0x1a0/0x3b8
[<ffff000009ee82b0>] arm_enable_runtime_services+0x26c/0x57c
[<ffff00000808366c>] do_one_initcall+0xac/0x360
[<ffff000009e41d10>] kernel_init_freeable+0xd4/0x4a8
[<ffff0000096772bc>] kernel_init+0x3c/0x368
[<ffff000008088e10>] ret_from_fork+0x10/0x40
   EFI remap 0x00000043fa813000 => 00000000200c3000
   EFI remap 0x00000043fa85a000 => 00000000200da000
   EFI remap 0x00000043ffa02000 => 00000000202c2000
   EFI remap 0x00000043ffa16000 => 00000000202d6000
Detected PIPT I-cache on CPU1
CPU1: Booted secondary processor [500f0000]
Detected PIPT I-cache on CPU2
CPU2: Booted secondary processor [500f0000]
Detected PIPT I-cache on CPU3
CPU3: Booted secondary processor [500f0000]
Detected PIPT I-cache on CPU4
CPU4: Booted secondary processor [500f0000]
Detected PIPT I-cache on CPU5
CPU5: Booted secondary processor [500f0000]
Detected PIPT I-cache on CPU6
CPU6: Booted secondary processor [500f0000]
Detected PIPT I-cache on CPU7
CPU7: Booted secondary processor [500f0000]
Brought up 8 CPUs
SMP: Total of 8 processors activated.
CPU features: detected feature: 32-bit EL0 Support
CPU: All CPU(s) started at EL2
devtmpfs: initialized
gcov: version magic: 0x35303352
SMBIOS 3.0.0 present.
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, 
max_idle_ns: 7645041785100000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
PCCT header not found.
vdso: 2 pages (1 code @ ffff0000096d0000, 1 data @ ffff00000a030000)
hw-breakpoint: found 4 breakpoint and 4 watchpoint registers.
DMA: preallocated 256 KiB pool for atomic allocations
ACPI: bus type PCI registered
Serial: AMBA PL011 UART driver
HugeTLB registered 512 MB page size, pre-allocated 0 pages
ACPI: Added _OSI(Module Device)
ACPI: Added _OSI(Processor Device)
ACPI: Added _OSI(3.0 _SCP Extensions)
ACPI: Added _OSI(Processor Aggregator Device)
ACPI: 4 ACPI AML tables successfully acquired and loaded

ACPI: Interpreter enabled
ACPI: Using GIC for interrupt routing
ACPI: Power Resource [SCVR] (off)
ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments 
MSI]
acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
acpi PNP0A08:00: Bus 0000:00 not present in PCI namespace
vgaarb: loaded
SCSI subsystem initialized
libata version 3.00 loaded.
ACPI: bus type USB registered
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti 
<giometti@linux.it>
PTP clock support registered
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arch_sys_counter
Warning: could not register all branches stats
Warning: could not register annotated branches stats
VFS: Disk quotas dquot_6.6.0
VFS: Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
pnp: PnP ACPI init
pnp: PnP ACPI: found 0 devices
NET: Registered protocol family 2
TCP established hash table entries: 131072 (order: 4, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 6, 4194304 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
UDP hash table entries: 8192 (order: 4, 1310720 bytes)
UDP-Lite hash table entries: 8192 (order: 4, 1310720 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PCI: CLS 0 bytes, default 128
Unpacking initramfs...
Freeing initrd memory: 10432K (ffff8003f9a80000 - ffff8003fa4b0000)
kvm [1]: 8-bit VMID
kvm [1]: Hyp mode initialized successfully
INFO: rcu_preempt detected stalls on CPUs/tasks:
	0-...: (113 GPs behind) idle=1f9/1/0 softirq=86/86 fqs=0
	2-...: (107 GPs behind) idle=559/1/0 softirq=120/120 fqs=0
	4-...: (107 GPs behind) idle=33b/1/0 softirq=106/106 fqs=0
	5-...: (108 GPs behind) idle=333/1/0 softirq=130/130 fqs=0
	6-...: (105 GPs behind) idle=2f7/1/0 softirq=120/120 fqs=0
	7-...: (105 GPs behind) idle=327/1/0 softirq=131/131 fqs=0
	(detected by 1, t=5252 jiffies, g=-135, c=-136, q=8)
Task dump for CPU 0:
swapper/0       R  running task        0     0      0 0x00000000
Call trace:
[<ffff00000808ba20>] __switch_to+0x1c8/0x240
[<ffff00000a6276b8>] ______f.8076+0x10/0x28
Task dump for CPU 2:
swapper/2       R  running task        0     0      1 0x00000000
Call trace:
[<ffff00000808ba20>] __switch_to+0x1c8/0x240
[<000000000006a42a>] 0x6a42a
Task dump for CPU 4:
swapper/4       R  running task        0     0      1 0x00000000
Call trace:
[<ffff00000808ba20>] __switch_to+0x1c8/0x240
[<0000000000048555>] 0x48555
Task dump for CPU 5:
swapper/5       R  running task        0     0      1 0x00000000
Call trace:
[<ffff00000808ba20>] __switch_to+0x1c8/0x240
[<0000000000048554>] 0x48554
Task dump for CPU 6:
swapper/6       R  running task        0     0      1 0x00000000
Call trace:
[<ffff00000808ba20>] __switch_to+0x1c8/0x240
[<000000000004855b>] 0x4855b
Task dump for CPU 7:
swapper/7       R  running task        0     0      1 0x00000000
Call trace:
[<ffff00000808ba20>] __switch_to+0x1c8/0x240
[<000000000004855a>] 0x4855a
rcu_preempt kthread starved for 5252 jiffies! g18446744073709551481 
c18446744073709551480 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1
rcu_preempt     S ffff00000808ba20     0     7      2 0x00000000
Call trace:
[<ffff00000808ba20>] __switch_to+0x1c8/0x240
[<ffff00000967cfa8>] __schedule+0xb68/0x2558
[<ffff00000967f57c>] schedule+0xc4/0x230
[<ffff00000968d130>] schedule_timeout+0x430/0x858
[<ffff00000825dd50>] rcu_gp_kthread+0x1138/0x1ed0
[<ffff000008190744>] kthread+0x1cc/0x1e0
[<ffff000008088e10>] ret_from_fork+0x10/0x40
NMI watchdog: BUG: soft lockup - CPU#1 stuck for 22s! [swapper/0:1]
Modules linked in:

CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W 
4.6.0-rc7-next-20160513 #6
Hardware name: AppliedMicro Mustang/Mustang, BIOS 3.05.05-beta_rc Jan 27 
2016
task: ffff8003c0340000 ti: ffff8003c0400000 task.ti: ffff8003c0400000
PC is at smp_call_function_many+0x780/0x7b0
LR is at smp_call_function_many+0x73c/0x7b0
pc : [<ffff0000082b6390>] lr : [<ffff0000082b634c>] pstate: 80000045
sp : ffff8003c0403b50
x29: ffff8003c0403b50 x28: ffff00000a482540
x27: ffff00000a482550 x26: ffff000009ffa000
x25: ffff00000b34e7c0 x24: ffff00000a041dd0
x23: ffff00000b34e7c0 x22: ffff8003ffe2aa08
x21: ffff00000b34e7c0 x20: ffff8003ffe2aa00
x19: ffff00000b34e240 x18: 0000000005f5e0ff
x17: 0000000000000000 x16: 0000000000000000
x15: 00000000000000c4 x14: ffff8003fff79500
x13: ffff00000a464f28 x12: ffff00000b59cd10
x11: 0000000000000000 x10: ffff00000a62eef8
x9 : ffff00000b59ccd0 x8 : ffff8003c0400000
x7 : 0000000000000000 x6 : ffff00000b59ccd0
x5 : ffffffffffffffff x4 : 0000000000000000
x3 : ffff8003ffdfdc18 x2 : 0000000000000000
x1 : ffff00000a043548 x0 : 0000000000000003

Kernel panic - not syncing: softlockup: hung tasks
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W    L 
4.6.0-rc7-next-20160513 #6
Hardware name: AppliedMicro Mustang/Mustang, BIOS 3.05.05-beta_rc Jan 27 
2016
Call trace:
[<ffff000008095bb0>] dump_backtrace+0x0/0x4b0
[<ffff00000809609c>] show_stack+0x3c/0x60
[<ffff000008a8f05c>] dump_stack+0x1dc/0x2c8
[<ffff0000083fd494>] panic+0x264/0x5fc
[<ffff00000831b914>] watchdog_timer_fn+0x804/0x840
[<ffff000008274044>] __hrtimer_run_queues+0x4b4/0xf50
[<ffff000008276864>] hrtimer_interrupt+0x174/0x478
[<ffff000009289e94>] arch_timer_handler_phys+0xac/0xc8
[<ffff00000823e4c4>] handle_percpu_devid_irq+0x214/0x8b0
[<ffff00000822f6a4>] generic_handle_irq+0x8c/0xb0
[<ffff00000822ff20>] __handle_domain_irq+0x178/0x288
[<ffff000008081e40>] gic_handle_irq+0x1e8/0x270
Exception stack(0xffff8003ffe13fa0 to 0xffff8003ffe140c0)
3fa0: ffff8003c0403a30 ffff8003ffe2aa00 ffff8003c0403b50 ffff0000082b6390
3fc0: 0000000080000045 ffff00000a041dd0 ffff8003ffe10020 ffff8003ffe14010
3fe0: ffff00000a482550 ffff8003c0400000 ffff00000800f000 ffff8003c0403a30
4000: ffff8003c0403b50 ffff8003c0403a30 0000000000000000 0000000000000000
4020: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
4040: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
4060: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
4080: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
40a0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[<ffff000008088724>] el1_irq+0xa4/0x114
[<ffff0000082b6390>] smp_call_function_many+0x780/0x7b0
[<ffff0000082b6714>] smp_call_function+0x7c/0x1c8
[<ffff0000082b693c>] on_each_cpu+0x74/0x280
[<ffff0000080e9528>] kvm_arch_init+0x8c0/0xe60
[<ffff0000080ccb60>] kvm_init+0x58/0x740
[<ffff0000080e3e48>] arm_init+0x40/0x58
[<ffff00000808366c>] do_one_initcall+0xac/0x360
[<ffff000009e41ee8>] kernel_init_freeable+0x2ac/0x4a8
[<ffff0000096772bc>] kernel_init+0x3c/0x368
[<ffff000008088e10>] ret_from_fork+0x10/0x40
SMP: stopping secondary CPUs
SMP: failed to stop secondary CPUs 0-7
Kernel Offset: disabled
Memory Limit: none
---[ end Kernel panic - not syncing: softlockup: hung tasks

On 5/15/16 8:42 PM, Julien Grall wrote:
> Hello,
>
> On 15/05/2016 12:19, Christoffer Dall wrote:
>> On Sunday, May 15, 2016, Itaru Kitayama <itaru.kitayama@riken.jp
>> <mailto:itaru.kitayama@riken.jp>> wrote:
>>>
>>> Below is the boot (with UEFI) log. I'm attaching the .config I'm using.
>>> I've been trying to test Julien's ACPI support patch set recently
>> merged in the kvmarm tree on Mustang.
>>
>>
>> I don't run anything with ACPI, so haven't tested that particular aspect.
>>
>> This doesn't immediately look like it's related to the kvmarm patches.
>>
>> Perhaps you could try with Linux-next as well to see if this was already
>> fixed?
>>
>> Julien, did you test mustang with your ACPI patches?
>
> No, the patch has been tested on Juno-r2 and Seattle.
>
> However, the logs looks very similar to a bug that Steve Capper was
> hunting in Linux 4.6.0-rc3. I believe this has been fixed in a later RC.
>
> kvm-arm-for-4.7 seems to be based on Linux 4.6-rc1 so I would recommend
> you to try Linux-next.
>
> Regards,
>

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-15 13:30         ` Itaru Kitayama
@ 2016-05-16  7:19           ` Christoffer Dall
  2016-05-16 23:28             ` Itaru Kitayama
  2016-05-17 16:04             ` Shanker Donthineni
  0 siblings, 2 replies; 80+ messages in thread
From: Christoffer Dall @ 2016-05-16  7:19 UTC (permalink / raw)
  To: Itaru Kitayama; +Cc: kvmarm@lists.cs.columbia.edu

Hi Itaru,

I'm afraid I don't know would be causing this nor do I have an easy
way to reproduce.

I suggest you try with v4.6 which was just released, and if it still
doesn't work, report it as a bug on linux-arm-kernel.

Thanks,
-Christoffer

On Sun, May 15, 2016 at 3:30 PM, Itaru Kitayama <itaru.kitayama@riken.jp> wrote:
> Julien, Christoffer,
>
> Below is the boot log of linux-next.
>
>
> EFI stub: Booting Linux Kernel...
> EFI stub: Using DTB from configuration table
> EFI stub: Exiting boot services and installing virtual address map...
> L3C: 8MB
> Booting Linux on physical CPU 0x0
> Linux version 4.6.0-rc7-next-20160513 (itaru.kitayama@r2-a11) (gcc version
> 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC) ) #6 SMP PREEMPT Sun May 15 08:21:01
> CDT 2016
> Boot CPU: AArch64 Processor [500f0000]
> earlycon: uart0 at MMIO32 0x000000001c020000 (options '')
> bootconsole [uart0] enabled
> efi: Getting EFI parameters from FDT:
> efi: EFI v2.40 by X-Gene Mustang Board EFI Jan 27 2016 18:27:58
> efi:  ACPI=0x43fa859000  ACPI 2.0=0x43fa859014  SMBIOS 3.0=0x43fa857000
> cma: Reserved 512 MiB at 0x00000040e0000000
> ACPI: Early table checksum verification enabled
> ACPI: RSDP 0x00000043FA859014 000024 (v02 APM   )
> ACPI: XSDT 0x00000043FA8580E8 00007C (v01 APM    XGENE    00000003 01000013)
> ACPI: FACP 0x00000043FA850000 00010C (v05 APM    XGENE    00000003 INTL
> 20140724)
> ACPI: DSDT 0x00000043FA851000 003A00 (v05 APM    APM88xxx 00000001 INTL
> 20140724)
> ACPI: DBG2 0x00000043FA855000 0000AA (v00 APMC0D XGENEDBG 00000000 INTL
> 20140724)
> ACPI: GTDT 0x00000043FA84E000 0000E0 (v02 APM    XGENE    00000001 INTL
> 20140724)
> ACPI: MCFG 0x00000043FA84D000 00003C (v01 APM    XGENE    00000002 INTL
> 20140724)
> ACPI: SPCR 0x00000043FA84C000 000050 (v02 APMC0D XGENESPC 00000000 INTL
> 20140724)
> ACPI: SSDT 0x00000043FA84B000 00002D (v02 APM    XGENE    00000001 INTL
> 20140724)
> ACPI: BERT 0x00000043FA84A000 000030 (v01 APM    XGENE    00000002 INTL
> 20140724)
> ACPI: HEST 0x00000043FA849000 0002A8 (v01 APM    XGENE    00000002 INTL
> 20140724)
> ACPI: APIC 0x00000043FA848000 0002A4 (v03 APM    XGENE    00000003 01000013)
> ACPI: SSDT 0x00000043FA847000 000063 (v02 REDHAT MACADDRS 00000001 01000013)
> ACPI: SSDT 0x00000043FA846000 000032 (v02 REDHAT UARTCLKS 00000001 01000013)
> On node 0 totalpages: 262144
>   DMA zone: 64 pages used for memmap
>   DMA zone: 0 pages reserved
>   DMA zone: 65536 pages, LIFO batch:1
>   Normal zone: 192 pages used for memmap
>   Normal zone: 196608 pages, LIFO batch:1
> psci: is not implemented in ACPI.
> percpu: Embedded 3 pages/cpu @ffff8003ffde0000 s110208 r8192 d78208 u196608
> pcpu-alloc: s110208 r8192 d78208 u196608 alloc=3*65536
> pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7
> Detected PIPT I-cache on CPU0
> Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 261888
> Kernel command line: BOOT_IMAGE=/vmlinuz-4.6.0-rc7-next-20160513
> root=UUID=ac9f9264-7572-48c3-97d2-042ea95f7640 ro acpi=force
> acpi_force_table_verification earlycon=uart,mmio32,0x1c020000
> console=ttyS0,115200 loglevel=8 LANG=en_US.UTF-8
> log_buf_len individual max cpu contribution: 4096 bytes
> log_buf_len total cpu_extra contributions: 28672 bytes
> log_buf_len min size: 16384 bytes
> log_buf_len: 65536 bytes
> early log buf free: 13072(79%)
> PID hash table entries: 4096 (order: -1, 32768 bytes)
> Dentry cache hash table entries: 2097152 (order: 8, 16777216 bytes)
> Inode-cache hash table entries: 1048576 (order: 7, 8388608 bytes)
> software IO TLB [mem 0x40dbff0000-0x40dfff0000] (64MB) mapped at
> [ffff8000dbff0000-ffff8000dffeffff]
> Memory: 16070272K/16777216K available (22780K kernel code, 8781K rwdata,
> 7680K rodata, 1920K init, 16628K bss, 182656K reserved, 524288K
> cma-reserved)
> Virtual kernel memory layout:
>     modules : 0xffff000000000000 - 0xffff000008000000   (   128 MB)
>     vmalloc : 0xffff000008000000 - 0xffff7bdfffff0000   (126847 GB)
>       .text : 0xffff000008080000 - 0xffff0000096b0000   ( 22720 KB)
>     .rodata : 0xffff0000096b0000 - 0xffff000009e40000   (  7744 KB)
>       .init : 0xffff000009e40000 - 0xffff00000a020000   (  1920 KB)
>       .data : 0xffff00000a020000 - 0xffff00000a8b3600   (  8782 KB)
>        .bss : 0xffff00000a8b3600 - 0xffff00000b8f0760   ( 16629 KB)
>     fixed   : 0xffff7fdffe7d0000 - 0xffff7fdffec00000   (  4288 KB)
>     PCI I/O : 0xffff7fdffee00000 - 0xffff7fdfffe00000   (    16 MB)
>     vmemmap : 0xffff7fe000000000 - 0xffff800000000000   (   128 GB maximum)
>               0xffff7fe000000000 - 0xffff7fe001000000   (    16 MB actual)
>     memory  : 0xffff800000000000 - 0xffff800400000000   ( 16384 MB)
> SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
> Preemptible hierarchical RCU implementation.
>         Build-time adjustment of leaf fanout to 64.
> NR_IRQS:64 nr_irqs:64 0
> GIC: Using split EOI/Deactivate mode
> GICv3: No distributor detected at @ffff000008060000, giving up
> Architected cp15 timer(s) running at 50.00MHz (phys).
> clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles:
> 0xb8812736b, max_idle_ns: 440795202655 ns
> sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
> Console: colour dummy device 80x25
> Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
> ... MAX_LOCKDEP_SUBCLASSES:  8
> ... MAX_LOCK_DEPTH:          48
> ... MAX_LOCKDEP_KEYS:        8191
> ... CLASSHASH_SIZE:          4096
> ... MAX_LOCKDEP_ENTRIES:     32768
> ... MAX_LOCKDEP_CHAINS:      65536
> ... CHAINHASH_SIZE:          32768
>  memory used by lock dependency info: 8127 kB
>  per task-struct memory footprint: 1920 bytes
> Calibrating delay loop (skipped), value calculated using timer frequency..
> 100.00 BogoMIPS (lpj=200000)
> pid_max: default: 32768 minimum: 301
> ACPI: Core revision 20160422
> Security Framework initialized
> Mount-cache hash table entries: 32768 (order: 2, 262144 bytes)
> Mountpoint-cache hash table entries: 32768 (order: 2, 262144 bytes)
> ftrace: allocating 29581 entries in 8 pages
> ASID allocator initialised with 65536 entries
> Remapping and enabling EFI services.
>   EFI remap 0x0000000010510000 => 0000000020000000
>   EFI remap 0x0000000010548000 => 0000000020018000
>   EFI remap 0x0000000017000000 => 0000000020020000
>   EFI remap 0x000000001c025000 => 0000000020035000
>   EFI remap 0x000000007c0c0000 => 0000000020040000
>   EFI remap 0x000000007c1c0000 => 0000000020050000
>   EFI remap 0x000000007c2c0000 => 0000000020060000
>   EFI remap 0x000000007c3c0000 => 0000000020070000
>   EFI remap 0x000000007c4c0000 => 0000000020080000
>   EFI remap 0x000000007c5c0000 => 0000000020090000
>   EFI remap 0x000000007c6c0000 => 00000000200a0000
>   EFI remap 0x000000007c7c0000 => 00000000200b0000
> UEFI Runtime regions are not aligned to 64 KB -- buggy firmware?
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 1 at arch/arm64/kernel/efi.c:34
> efi_create_mapping+0x1a0/0x3b8
> Modules linked in:
>
> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.6.0-rc7-next-20160513 #6
> Hardware name: APM X-Gene Mustang board (DT)
> task: ffff8003c0340000 ti: ffff8003c0400000 task.ti: ffff8003c0400000
> PC is at efi_create_mapping+0x1a0/0x3b8
> LR is at efi_create_mapping+0x194/0x3b8
> pc : [<ffff000009e4a5a8>] lr : [<ffff000009e4a59c>] pstate: 60000245
> sp : ffff8003c0403cb0
> x29: ffff8003c0403cb0 x28: ffff00000a390000
> x27: ffff8003f9a77468 x26: 0000000000003000
> x25: 800000000000000f x24: ffff00000a2de390
> x23: 0000000000000005 x22: 0000000000000001
> x21: ffff00000a41d000 x20: ffff00000a8fc000
> x19: ffff00000a8fc198 x18: ffff0000097fe000
> x17: 0000000000000001 x16: 0000000000000000
> x15: 0000000000000056 x14: 3f657261776d7269
> x13: ffff00000a464f28 x12: ffff00000a465b30
> x11: 0000000000000001 x10: ffff8003c0400000
> x9 : 00000000000085f1 x8 : 0000000000000003
> x7 : 0000000000000000 x6 : ffff00000a042000
> x5 : ffff00000b3b4c58 x4 : 00000000001c115c
> x3 : ffff8003c0340000 x2 : 0000000000000132
> x1 : 0000000000000099 x0 : 0000000000000001
>
> ---[ end trace a2cb2e24ff35d5f8 ]---
> Call trace:
> Exception stack(0xffff8003c0403ac0 to 0xffff8003c0403be0)
> 3ac0: ffff00000a8fc198 ffff00000a8fc000 ffff8003c0403cb0 ffff000009e4a5a8
> 3ae0: 0000000060000245 000000000000003d 800000000000000f 0000000000003000
> 3b00: ffff8003f9a77468 0000000000000001 0000000000000005 ffff00000a2de390
> 3b20: 800000000000000f 0000000000003000 ffff8003f9a77468 ffff00000a390000
> 3b40: ffff00000a465ab8 0000000000000000 ffff8003c0403bd0 ffff000009cdcf70
> 3b60: 000000000b3071a8 0000000000000000 ffff000000000000 00000000ffffffff
> 3b80: ffff8003c0403cb0 ffff8003c0403cb0 0000000000000001 0000000000000099
> 3ba0: 0000000000000132 ffff8003c0340000 00000000001c115c ffff00000b3b4c58
> 3bc0: ffff00000a042000 0000000000000000 0000000000000003 00000000000085f1
> [<ffff000009e4a5a8>] efi_create_mapping+0x1a0/0x3b8
> [<ffff000009ee82b0>] arm_enable_runtime_services+0x26c/0x57c
> [<ffff00000808366c>] do_one_initcall+0xac/0x360
> [<ffff000009e41d10>] kernel_init_freeable+0xd4/0x4a8
> [<ffff0000096772bc>] kernel_init+0x3c/0x368
> [<ffff000008088e10>] ret_from_fork+0x10/0x40
>   EFI remap 0x00000043fa813000 => 00000000200c3000
>   EFI remap 0x00000043fa85a000 => 00000000200da000
>   EFI remap 0x00000043ffa02000 => 00000000202c2000
>   EFI remap 0x00000043ffa16000 => 00000000202d6000
> Detected PIPT I-cache on CPU1
> CPU1: Booted secondary processor [500f0000]
> Detected PIPT I-cache on CPU2
> CPU2: Booted secondary processor [500f0000]
> Detected PIPT I-cache on CPU3
> CPU3: Booted secondary processor [500f0000]
> Detected PIPT I-cache on CPU4
> CPU4: Booted secondary processor [500f0000]
> Detected PIPT I-cache on CPU5
> CPU5: Booted secondary processor [500f0000]
> Detected PIPT I-cache on CPU6
> CPU6: Booted secondary processor [500f0000]
> Detected PIPT I-cache on CPU7
> CPU7: Booted secondary processor [500f0000]
> Brought up 8 CPUs
> SMP: Total of 8 processors activated.
> CPU features: detected feature: 32-bit EL0 Support
> CPU: All CPU(s) started at EL2
> devtmpfs: initialized
> gcov: version magic: 0x35303352
> SMBIOS 3.0.0 present.
> clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns:
> 7645041785100000 ns
> pinctrl core: initialized pinctrl subsystem
> NET: Registered protocol family 16
> PCCT header not found.
> vdso: 2 pages (1 code @ ffff0000096d0000, 1 data @ ffff00000a030000)
> hw-breakpoint: found 4 breakpoint and 4 watchpoint registers.
> DMA: preallocated 256 KiB pool for atomic allocations
> ACPI: bus type PCI registered
> Serial: AMBA PL011 UART driver
> HugeTLB registered 512 MB page size, pre-allocated 0 pages
> ACPI: Added _OSI(Module Device)
> ACPI: Added _OSI(Processor Device)
> ACPI: Added _OSI(3.0 _SCP Extensions)
> ACPI: Added _OSI(Processor Aggregator Device)
> ACPI: 4 ACPI AML tables successfully acquired and loaded
>
> ACPI: Interpreter enabled
> ACPI: Using GIC for interrupt routing
> ACPI: Power Resource [SCVR] (off)
> ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
> acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments
> MSI]
> acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
> acpi PNP0A08:00: Bus 0000:00 not present in PCI namespace
> vgaarb: loaded
> SCSI subsystem initialized
> libata version 3.00 loaded.
> ACPI: bus type USB registered
> usbcore: registered new interface driver usbfs
> usbcore: registered new interface driver hub
> usbcore: registered new device driver usb
> pps_core: LinuxPPS API ver. 1 registered
> pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti
> <giometti@linux.it>
> PTP clock support registered
> Advanced Linux Sound Architecture Driver Initialized.
> clocksource: Switched to clocksource arch_sys_counter
> Warning: could not register all branches stats
> Warning: could not register annotated branches stats
> VFS: Disk quotas dquot_6.6.0
> VFS: Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
> pnp: PnP ACPI init
> pnp: PnP ACPI: found 0 devices
> NET: Registered protocol family 2
> TCP established hash table entries: 131072 (order: 4, 1048576 bytes)
> TCP bind hash table entries: 65536 (order: 6, 4194304 bytes)
> TCP: Hash tables configured (established 131072 bind 65536)
> UDP hash table entries: 8192 (order: 4, 1310720 bytes)
> UDP-Lite hash table entries: 8192 (order: 4, 1310720 bytes)
> NET: Registered protocol family 1
> RPC: Registered named UNIX socket transport module.
> RPC: Registered udp transport module.
> RPC: Registered tcp transport module.
> RPC: Registered tcp NFSv4.1 backchannel transport module.
> PCI: CLS 0 bytes, default 128
> Unpacking initramfs...
> Freeing initrd memory: 10432K (ffff8003f9a80000 - ffff8003fa4b0000)
> kvm [1]: 8-bit VMID
> kvm [1]: Hyp mode initialized successfully
> INFO: rcu_preempt detected stalls on CPUs/tasks:
>         0-...: (113 GPs behind) idle=1f9/1/0 softirq=86/86 fqs=0
>         2-...: (107 GPs behind) idle=559/1/0 softirq=120/120 fqs=0
>         4-...: (107 GPs behind) idle=33b/1/0 softirq=106/106 fqs=0
>         5-...: (108 GPs behind) idle=333/1/0 softirq=130/130 fqs=0
>         6-...: (105 GPs behind) idle=2f7/1/0 softirq=120/120 fqs=0
>         7-...: (105 GPs behind) idle=327/1/0 softirq=131/131 fqs=0
>         (detected by 1, t=5252 jiffies, g=-135, c=-136, q=8)
> Task dump for CPU 0:
> swapper/0       R  running task        0     0      0 0x00000000
> Call trace:
> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
> [<ffff00000a6276b8>] ______f.8076+0x10/0x28
> Task dump for CPU 2:
> swapper/2       R  running task        0     0      1 0x00000000
> Call trace:
> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
> [<000000000006a42a>] 0x6a42a
> Task dump for CPU 4:
> swapper/4       R  running task        0     0      1 0x00000000
> Call trace:
> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
> [<0000000000048555>] 0x48555
> Task dump for CPU 5:
> swapper/5       R  running task        0     0      1 0x00000000
> Call trace:
> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
> [<0000000000048554>] 0x48554
> Task dump for CPU 6:
> swapper/6       R  running task        0     0      1 0x00000000
> Call trace:
> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
> [<000000000004855b>] 0x4855b
> Task dump for CPU 7:
> swapper/7       R  running task        0     0      1 0x00000000
> Call trace:
> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
> [<000000000004855a>] 0x4855a
> rcu_preempt kthread starved for 5252 jiffies! g18446744073709551481
> c18446744073709551480 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1
> rcu_preempt     S ffff00000808ba20     0     7      2 0x00000000
> Call trace:
> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
> [<ffff00000967cfa8>] __schedule+0xb68/0x2558
> [<ffff00000967f57c>] schedule+0xc4/0x230
> [<ffff00000968d130>] schedule_timeout+0x430/0x858
> [<ffff00000825dd50>] rcu_gp_kthread+0x1138/0x1ed0
> [<ffff000008190744>] kthread+0x1cc/0x1e0
> [<ffff000008088e10>] ret_from_fork+0x10/0x40
> NMI watchdog: BUG: soft lockup - CPU#1 stuck for 22s! [swapper/0:1]
> Modules linked in:
>
> CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W 4.6.0-rc7-next-20160513 #6
> Hardware name: AppliedMicro Mustang/Mustang, BIOS 3.05.05-beta_rc Jan 27
> 2016
> task: ffff8003c0340000 ti: ffff8003c0400000 task.ti: ffff8003c0400000
> PC is at smp_call_function_many+0x780/0x7b0
> LR is at smp_call_function_many+0x73c/0x7b0
> pc : [<ffff0000082b6390>] lr : [<ffff0000082b634c>] pstate: 80000045
> sp : ffff8003c0403b50
> x29: ffff8003c0403b50 x28: ffff00000a482540
> x27: ffff00000a482550 x26: ffff000009ffa000
> x25: ffff00000b34e7c0 x24: ffff00000a041dd0
> x23: ffff00000b34e7c0 x22: ffff8003ffe2aa08
> x21: ffff00000b34e7c0 x20: ffff8003ffe2aa00
> x19: ffff00000b34e240 x18: 0000000005f5e0ff
> x17: 0000000000000000 x16: 0000000000000000
> x15: 00000000000000c4 x14: ffff8003fff79500
> x13: ffff00000a464f28 x12: ffff00000b59cd10
> x11: 0000000000000000 x10: ffff00000a62eef8
> x9 : ffff00000b59ccd0 x8 : ffff8003c0400000
> x7 : 0000000000000000 x6 : ffff00000b59ccd0
> x5 : ffffffffffffffff x4 : 0000000000000000
> x3 : ffff8003ffdfdc18 x2 : 0000000000000000
> x1 : ffff00000a043548 x0 : 0000000000000003
>
> Kernel panic - not syncing: softlockup: hung tasks
> CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W    L
> 4.6.0-rc7-next-20160513 #6
> Hardware name: AppliedMicro Mustang/Mustang, BIOS 3.05.05-beta_rc Jan 27
> 2016
> Call trace:
> [<ffff000008095bb0>] dump_backtrace+0x0/0x4b0
> [<ffff00000809609c>] show_stack+0x3c/0x60
> [<ffff000008a8f05c>] dump_stack+0x1dc/0x2c8
> [<ffff0000083fd494>] panic+0x264/0x5fc
> [<ffff00000831b914>] watchdog_timer_fn+0x804/0x840
> [<ffff000008274044>] __hrtimer_run_queues+0x4b4/0xf50
> [<ffff000008276864>] hrtimer_interrupt+0x174/0x478
> [<ffff000009289e94>] arch_timer_handler_phys+0xac/0xc8
> [<ffff00000823e4c4>] handle_percpu_devid_irq+0x214/0x8b0
> [<ffff00000822f6a4>] generic_handle_irq+0x8c/0xb0
> [<ffff00000822ff20>] __handle_domain_irq+0x178/0x288
> [<ffff000008081e40>] gic_handle_irq+0x1e8/0x270
> Exception stack(0xffff8003ffe13fa0 to 0xffff8003ffe140c0)
> 3fa0: ffff8003c0403a30 ffff8003ffe2aa00 ffff8003c0403b50 ffff0000082b6390
> 3fc0: 0000000080000045 ffff00000a041dd0 ffff8003ffe10020 ffff8003ffe14010
> 3fe0: ffff00000a482550 ffff8003c0400000 ffff00000800f000 ffff8003c0403a30
> 4000: ffff8003c0403b50 ffff8003c0403a30 0000000000000000 0000000000000000
> 4020: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> 4040: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> 4060: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> 4080: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> 40a0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> [<ffff000008088724>] el1_irq+0xa4/0x114
> [<ffff0000082b6390>] smp_call_function_many+0x780/0x7b0
> [<ffff0000082b6714>] smp_call_function+0x7c/0x1c8
> [<ffff0000082b693c>] on_each_cpu+0x74/0x280
> [<ffff0000080e9528>] kvm_arch_init+0x8c0/0xe60
> [<ffff0000080ccb60>] kvm_init+0x58/0x740
> [<ffff0000080e3e48>] arm_init+0x40/0x58
> [<ffff00000808366c>] do_one_initcall+0xac/0x360
> [<ffff000009e41ee8>] kernel_init_freeable+0x2ac/0x4a8
> [<ffff0000096772bc>] kernel_init+0x3c/0x368
> [<ffff000008088e10>] ret_from_fork+0x10/0x40
> SMP: stopping secondary CPUs
> SMP: failed to stop secondary CPUs 0-7
> Kernel Offset: disabled
> Memory Limit: none
> ---[ end Kernel panic - not syncing: softlockup: hung tasks
>
>
> On 5/15/16 8:42 PM, Julien Grall wrote:
>>
>> Hello,
>>
>> On 15/05/2016 12:19, Christoffer Dall wrote:
>>>
>>> On Sunday, May 15, 2016, Itaru Kitayama <itaru.kitayama@riken.jp
>>> <mailto:itaru.kitayama@riken.jp>> wrote:
>>>>
>>>>
>>>> Below is the boot (with UEFI) log. I'm attaching the .config I'm using.
>>>> I've been trying to test Julien's ACPI support patch set recently
>>>
>>> merged in the kvmarm tree on Mustang.
>>>
>>>
>>> I don't run anything with ACPI, so haven't tested that particular aspect.
>>>
>>> This doesn't immediately look like it's related to the kvmarm patches.
>>>
>>> Perhaps you could try with Linux-next as well to see if this was already
>>> fixed?
>>>
>>> Julien, did you test mustang with your ACPI patches?
>>
>>
>> No, the patch has been tested on Juno-r2 and Seattle.
>>
>> However, the logs looks very similar to a bug that Steve Capper was
>> hunting in Linux 4.6.0-rc3. I believe this has been fixed in a later RC.
>>
>> kvm-arm-for-4.7 seems to be based on Linux 4.6-rc1 so I would recommend
>> you to try Linux-next.
>>
>> Regards,
>>
>

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-16  7:19           ` Christoffer Dall
@ 2016-05-16 23:28             ` Itaru Kitayama
  2016-05-17  8:00               ` Julien Grall
  2016-05-17 16:04             ` Shanker Donthineni
  1 sibling, 1 reply; 80+ messages in thread
From: Itaru Kitayama @ 2016-05-16 23:28 UTC (permalink / raw)
  To: Christoffer Dall; +Cc: kvmarm@lists.cs.columbia.edu

Christoffer,
The new v4.6 upstream kernel gets to the prompt on Mustang (Rev A3).

On 5/16/16 4:19 PM, Christoffer Dall wrote:
> Hi Itaru,
>
> I'm afraid I don't know would be causing this nor do I have an easy
> way to reproduce.
>
> I suggest you try with v4.6 which was just released, and if it still
> doesn't work, report it as a bug on linux-arm-kernel.
>
> Thanks,
> -Christoffer
>
> On Sun, May 15, 2016 at 3:30 PM, Itaru Kitayama <itaru.kitayama@riken.jp> wrote:
>> Julien, Christoffer,
>>
>> Below is the boot log of linux-next.
>>
>>
>> EFI stub: Booting Linux Kernel...
>> EFI stub: Using DTB from configuration table
>> EFI stub: Exiting boot services and installing virtual address map...
>> L3C: 8MB
>> Booting Linux on physical CPU 0x0
>> Linux version 4.6.0-rc7-next-20160513 (itaru.kitayama@r2-a11) (gcc version
>> 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC) ) #6 SMP PREEMPT Sun May 15 08:21:01
>> CDT 2016
>> Boot CPU: AArch64 Processor [500f0000]
>> earlycon: uart0 at MMIO32 0x000000001c020000 (options '')
>> bootconsole [uart0] enabled
>> efi: Getting EFI parameters from FDT:
>> efi: EFI v2.40 by X-Gene Mustang Board EFI Jan 27 2016 18:27:58
>> efi:  ACPI=0x43fa859000  ACPI 2.0=0x43fa859014  SMBIOS 3.0=0x43fa857000
>> cma: Reserved 512 MiB at 0x00000040e0000000
>> ACPI: Early table checksum verification enabled
>> ACPI: RSDP 0x00000043FA859014 000024 (v02 APM   )
>> ACPI: XSDT 0x00000043FA8580E8 00007C (v01 APM    XGENE    00000003 01000013)
>> ACPI: FACP 0x00000043FA850000 00010C (v05 APM    XGENE    00000003 INTL
>> 20140724)
>> ACPI: DSDT 0x00000043FA851000 003A00 (v05 APM    APM88xxx 00000001 INTL
>> 20140724)
>> ACPI: DBG2 0x00000043FA855000 0000AA (v00 APMC0D XGENEDBG 00000000 INTL
>> 20140724)
>> ACPI: GTDT 0x00000043FA84E000 0000E0 (v02 APM    XGENE    00000001 INTL
>> 20140724)
>> ACPI: MCFG 0x00000043FA84D000 00003C (v01 APM    XGENE    00000002 INTL
>> 20140724)
>> ACPI: SPCR 0x00000043FA84C000 000050 (v02 APMC0D XGENESPC 00000000 INTL
>> 20140724)
>> ACPI: SSDT 0x00000043FA84B000 00002D (v02 APM    XGENE    00000001 INTL
>> 20140724)
>> ACPI: BERT 0x00000043FA84A000 000030 (v01 APM    XGENE    00000002 INTL
>> 20140724)
>> ACPI: HEST 0x00000043FA849000 0002A8 (v01 APM    XGENE    00000002 INTL
>> 20140724)
>> ACPI: APIC 0x00000043FA848000 0002A4 (v03 APM    XGENE    00000003 01000013)
>> ACPI: SSDT 0x00000043FA847000 000063 (v02 REDHAT MACADDRS 00000001 01000013)
>> ACPI: SSDT 0x00000043FA846000 000032 (v02 REDHAT UARTCLKS 00000001 01000013)
>> On node 0 totalpages: 262144
>>   DMA zone: 64 pages used for memmap
>>   DMA zone: 0 pages reserved
>>   DMA zone: 65536 pages, LIFO batch:1
>>   Normal zone: 192 pages used for memmap
>>   Normal zone: 196608 pages, LIFO batch:1
>> psci: is not implemented in ACPI.
>> percpu: Embedded 3 pages/cpu @ffff8003ffde0000 s110208 r8192 d78208 u196608
>> pcpu-alloc: s110208 r8192 d78208 u196608 alloc=3*65536
>> pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7
>> Detected PIPT I-cache on CPU0
>> Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 261888
>> Kernel command line: BOOT_IMAGE=/vmlinuz-4.6.0-rc7-next-20160513
>> root=UUID=ac9f9264-7572-48c3-97d2-042ea95f7640 ro acpi=force
>> acpi_force_table_verification earlycon=uart,mmio32,0x1c020000
>> console=ttyS0,115200 loglevel=8 LANG=en_US.UTF-8
>> log_buf_len individual max cpu contribution: 4096 bytes
>> log_buf_len total cpu_extra contributions: 28672 bytes
>> log_buf_len min size: 16384 bytes
>> log_buf_len: 65536 bytes
>> early log buf free: 13072(79%)
>> PID hash table entries: 4096 (order: -1, 32768 bytes)
>> Dentry cache hash table entries: 2097152 (order: 8, 16777216 bytes)
>> Inode-cache hash table entries: 1048576 (order: 7, 8388608 bytes)
>> software IO TLB [mem 0x40dbff0000-0x40dfff0000] (64MB) mapped at
>> [ffff8000dbff0000-ffff8000dffeffff]
>> Memory: 16070272K/16777216K available (22780K kernel code, 8781K rwdata,
>> 7680K rodata, 1920K init, 16628K bss, 182656K reserved, 524288K
>> cma-reserved)
>> Virtual kernel memory layout:
>>     modules : 0xffff000000000000 - 0xffff000008000000   (   128 MB)
>>     vmalloc : 0xffff000008000000 - 0xffff7bdfffff0000   (126847 GB)
>>       .text : 0xffff000008080000 - 0xffff0000096b0000   ( 22720 KB)
>>     .rodata : 0xffff0000096b0000 - 0xffff000009e40000   (  7744 KB)
>>       .init : 0xffff000009e40000 - 0xffff00000a020000   (  1920 KB)
>>       .data : 0xffff00000a020000 - 0xffff00000a8b3600   (  8782 KB)
>>        .bss : 0xffff00000a8b3600 - 0xffff00000b8f0760   ( 16629 KB)
>>     fixed   : 0xffff7fdffe7d0000 - 0xffff7fdffec00000   (  4288 KB)
>>     PCI I/O : 0xffff7fdffee00000 - 0xffff7fdfffe00000   (    16 MB)
>>     vmemmap : 0xffff7fe000000000 - 0xffff800000000000   (   128 GB maximum)
>>               0xffff7fe000000000 - 0xffff7fe001000000   (    16 MB actual)
>>     memory  : 0xffff800000000000 - 0xffff800400000000   ( 16384 MB)
>> SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
>> Preemptible hierarchical RCU implementation.
>>         Build-time adjustment of leaf fanout to 64.
>> NR_IRQS:64 nr_irqs:64 0
>> GIC: Using split EOI/Deactivate mode
>> GICv3: No distributor detected at @ffff000008060000, giving up
>> Architected cp15 timer(s) running at 50.00MHz (phys).
>> clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles:
>> 0xb8812736b, max_idle_ns: 440795202655 ns
>> sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
>> Console: colour dummy device 80x25
>> Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
>> ... MAX_LOCKDEP_SUBCLASSES:  8
>> ... MAX_LOCK_DEPTH:          48
>> ... MAX_LOCKDEP_KEYS:        8191
>> ... CLASSHASH_SIZE:          4096
>> ... MAX_LOCKDEP_ENTRIES:     32768
>> ... MAX_LOCKDEP_CHAINS:      65536
>> ... CHAINHASH_SIZE:          32768
>>  memory used by lock dependency info: 8127 kB
>>  per task-struct memory footprint: 1920 bytes
>> Calibrating delay loop (skipped), value calculated using timer frequency..
>> 100.00 BogoMIPS (lpj=200000)
>> pid_max: default: 32768 minimum: 301
>> ACPI: Core revision 20160422
>> Security Framework initialized
>> Mount-cache hash table entries: 32768 (order: 2, 262144 bytes)
>> Mountpoint-cache hash table entries: 32768 (order: 2, 262144 bytes)
>> ftrace: allocating 29581 entries in 8 pages
>> ASID allocator initialised with 65536 entries
>> Remapping and enabling EFI services.
>>   EFI remap 0x0000000010510000 => 0000000020000000
>>   EFI remap 0x0000000010548000 => 0000000020018000
>>   EFI remap 0x0000000017000000 => 0000000020020000
>>   EFI remap 0x000000001c025000 => 0000000020035000
>>   EFI remap 0x000000007c0c0000 => 0000000020040000
>>   EFI remap 0x000000007c1c0000 => 0000000020050000
>>   EFI remap 0x000000007c2c0000 => 0000000020060000
>>   EFI remap 0x000000007c3c0000 => 0000000020070000
>>   EFI remap 0x000000007c4c0000 => 0000000020080000
>>   EFI remap 0x000000007c5c0000 => 0000000020090000
>>   EFI remap 0x000000007c6c0000 => 00000000200a0000
>>   EFI remap 0x000000007c7c0000 => 00000000200b0000
>> UEFI Runtime regions are not aligned to 64 KB -- buggy firmware?
>> ------------[ cut here ]------------
>> WARNING: CPU: 0 PID: 1 at arch/arm64/kernel/efi.c:34
>> efi_create_mapping+0x1a0/0x3b8
>> Modules linked in:
>>
>> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.6.0-rc7-next-20160513 #6
>> Hardware name: APM X-Gene Mustang board (DT)
>> task: ffff8003c0340000 ti: ffff8003c0400000 task.ti: ffff8003c0400000
>> PC is at efi_create_mapping+0x1a0/0x3b8
>> LR is at efi_create_mapping+0x194/0x3b8
>> pc : [<ffff000009e4a5a8>] lr : [<ffff000009e4a59c>] pstate: 60000245
>> sp : ffff8003c0403cb0
>> x29: ffff8003c0403cb0 x28: ffff00000a390000
>> x27: ffff8003f9a77468 x26: 0000000000003000
>> x25: 800000000000000f x24: ffff00000a2de390
>> x23: 0000000000000005 x22: 0000000000000001
>> x21: ffff00000a41d000 x20: ffff00000a8fc000
>> x19: ffff00000a8fc198 x18: ffff0000097fe000
>> x17: 0000000000000001 x16: 0000000000000000
>> x15: 0000000000000056 x14: 3f657261776d7269
>> x13: ffff00000a464f28 x12: ffff00000a465b30
>> x11: 0000000000000001 x10: ffff8003c0400000
>> x9 : 00000000000085f1 x8 : 0000000000000003
>> x7 : 0000000000000000 x6 : ffff00000a042000
>> x5 : ffff00000b3b4c58 x4 : 00000000001c115c
>> x3 : ffff8003c0340000 x2 : 0000000000000132
>> x1 : 0000000000000099 x0 : 0000000000000001
>>
>> ---[ end trace a2cb2e24ff35d5f8 ]---
>> Call trace:
>> Exception stack(0xffff8003c0403ac0 to 0xffff8003c0403be0)
>> 3ac0: ffff00000a8fc198 ffff00000a8fc000 ffff8003c0403cb0 ffff000009e4a5a8
>> 3ae0: 0000000060000245 000000000000003d 800000000000000f 0000000000003000
>> 3b00: ffff8003f9a77468 0000000000000001 0000000000000005 ffff00000a2de390
>> 3b20: 800000000000000f 0000000000003000 ffff8003f9a77468 ffff00000a390000
>> 3b40: ffff00000a465ab8 0000000000000000 ffff8003c0403bd0 ffff000009cdcf70
>> 3b60: 000000000b3071a8 0000000000000000 ffff000000000000 00000000ffffffff
>> 3b80: ffff8003c0403cb0 ffff8003c0403cb0 0000000000000001 0000000000000099
>> 3ba0: 0000000000000132 ffff8003c0340000 00000000001c115c ffff00000b3b4c58
>> 3bc0: ffff00000a042000 0000000000000000 0000000000000003 00000000000085f1
>> [<ffff000009e4a5a8>] efi_create_mapping+0x1a0/0x3b8
>> [<ffff000009ee82b0>] arm_enable_runtime_services+0x26c/0x57c
>> [<ffff00000808366c>] do_one_initcall+0xac/0x360
>> [<ffff000009e41d10>] kernel_init_freeable+0xd4/0x4a8
>> [<ffff0000096772bc>] kernel_init+0x3c/0x368
>> [<ffff000008088e10>] ret_from_fork+0x10/0x40
>>   EFI remap 0x00000043fa813000 => 00000000200c3000
>>   EFI remap 0x00000043fa85a000 => 00000000200da000
>>   EFI remap 0x00000043ffa02000 => 00000000202c2000
>>   EFI remap 0x00000043ffa16000 => 00000000202d6000
>> Detected PIPT I-cache on CPU1
>> CPU1: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU2
>> CPU2: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU3
>> CPU3: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU4
>> CPU4: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU5
>> CPU5: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU6
>> CPU6: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU7
>> CPU7: Booted secondary processor [500f0000]
>> Brought up 8 CPUs
>> SMP: Total of 8 processors activated.
>> CPU features: detected feature: 32-bit EL0 Support
>> CPU: All CPU(s) started at EL2
>> devtmpfs: initialized
>> gcov: version magic: 0x35303352
>> SMBIOS 3.0.0 present.
>> clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns:
>> 7645041785100000 ns
>> pinctrl core: initialized pinctrl subsystem
>> NET: Registered protocol family 16
>> PCCT header not found.
>> vdso: 2 pages (1 code @ ffff0000096d0000, 1 data @ ffff00000a030000)
>> hw-breakpoint: found 4 breakpoint and 4 watchpoint registers.
>> DMA: preallocated 256 KiB pool for atomic allocations
>> ACPI: bus type PCI registered
>> Serial: AMBA PL011 UART driver
>> HugeTLB registered 512 MB page size, pre-allocated 0 pages
>> ACPI: Added _OSI(Module Device)
>> ACPI: Added _OSI(Processor Device)
>> ACPI: Added _OSI(3.0 _SCP Extensions)
>> ACPI: Added _OSI(Processor Aggregator Device)
>> ACPI: 4 ACPI AML tables successfully acquired and loaded
>>
>> ACPI: Interpreter enabled
>> ACPI: Using GIC for interrupt routing
>> ACPI: Power Resource [SCVR] (off)
>> ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
>> acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments
>> MSI]
>> acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
>> acpi PNP0A08:00: Bus 0000:00 not present in PCI namespace
>> vgaarb: loaded
>> SCSI subsystem initialized
>> libata version 3.00 loaded.
>> ACPI: bus type USB registered
>> usbcore: registered new interface driver usbfs
>> usbcore: registered new interface driver hub
>> usbcore: registered new device driver usb
>> pps_core: LinuxPPS API ver. 1 registered
>> pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti
>> <giometti@linux.it>
>> PTP clock support registered
>> Advanced Linux Sound Architecture Driver Initialized.
>> clocksource: Switched to clocksource arch_sys_counter
>> Warning: could not register all branches stats
>> Warning: could not register annotated branches stats
>> VFS: Disk quotas dquot_6.6.0
>> VFS: Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
>> pnp: PnP ACPI init
>> pnp: PnP ACPI: found 0 devices
>> NET: Registered protocol family 2
>> TCP established hash table entries: 131072 (order: 4, 1048576 bytes)
>> TCP bind hash table entries: 65536 (order: 6, 4194304 bytes)
>> TCP: Hash tables configured (established 131072 bind 65536)
>> UDP hash table entries: 8192 (order: 4, 1310720 bytes)
>> UDP-Lite hash table entries: 8192 (order: 4, 1310720 bytes)
>> NET: Registered protocol family 1
>> RPC: Registered named UNIX socket transport module.
>> RPC: Registered udp transport module.
>> RPC: Registered tcp transport module.
>> RPC: Registered tcp NFSv4.1 backchannel transport module.
>> PCI: CLS 0 bytes, default 128
>> Unpacking initramfs...
>> Freeing initrd memory: 10432K (ffff8003f9a80000 - ffff8003fa4b0000)
>> kvm [1]: 8-bit VMID
>> kvm [1]: Hyp mode initialized successfully
>> INFO: rcu_preempt detected stalls on CPUs/tasks:
>>         0-...: (113 GPs behind) idle=1f9/1/0 softirq=86/86 fqs=0
>>         2-...: (107 GPs behind) idle=559/1/0 softirq=120/120 fqs=0
>>         4-...: (107 GPs behind) idle=33b/1/0 softirq=106/106 fqs=0
>>         5-...: (108 GPs behind) idle=333/1/0 softirq=130/130 fqs=0
>>         6-...: (105 GPs behind) idle=2f7/1/0 softirq=120/120 fqs=0
>>         7-...: (105 GPs behind) idle=327/1/0 softirq=131/131 fqs=0
>>         (detected by 1, t=5252 jiffies, g=-135, c=-136, q=8)
>> Task dump for CPU 0:
>> swapper/0       R  running task        0     0      0 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<ffff00000a6276b8>] ______f.8076+0x10/0x28
>> Task dump for CPU 2:
>> swapper/2       R  running task        0     0      1 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<000000000006a42a>] 0x6a42a
>> Task dump for CPU 4:
>> swapper/4       R  running task        0     0      1 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<0000000000048555>] 0x48555
>> Task dump for CPU 5:
>> swapper/5       R  running task        0     0      1 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<0000000000048554>] 0x48554
>> Task dump for CPU 6:
>> swapper/6       R  running task        0     0      1 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<000000000004855b>] 0x4855b
>> Task dump for CPU 7:
>> swapper/7       R  running task        0     0      1 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<000000000004855a>] 0x4855a
>> rcu_preempt kthread starved for 5252 jiffies! g18446744073709551481
>> c18446744073709551480 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1
>> rcu_preempt     S ffff00000808ba20     0     7      2 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<ffff00000967cfa8>] __schedule+0xb68/0x2558
>> [<ffff00000967f57c>] schedule+0xc4/0x230
>> [<ffff00000968d130>] schedule_timeout+0x430/0x858
>> [<ffff00000825dd50>] rcu_gp_kthread+0x1138/0x1ed0
>> [<ffff000008190744>] kthread+0x1cc/0x1e0
>> [<ffff000008088e10>] ret_from_fork+0x10/0x40
>> NMI watchdog: BUG: soft lockup - CPU#1 stuck for 22s! [swapper/0:1]
>> Modules linked in:
>>
>> CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W 4.6.0-rc7-next-20160513 #6
>> Hardware name: AppliedMicro Mustang/Mustang, BIOS 3.05.05-beta_rc Jan 27
>> 2016
>> task: ffff8003c0340000 ti: ffff8003c0400000 task.ti: ffff8003c0400000
>> PC is at smp_call_function_many+0x780/0x7b0
>> LR is at smp_call_function_many+0x73c/0x7b0
>> pc : [<ffff0000082b6390>] lr : [<ffff0000082b634c>] pstate: 80000045
>> sp : ffff8003c0403b50
>> x29: ffff8003c0403b50 x28: ffff00000a482540
>> x27: ffff00000a482550 x26: ffff000009ffa000
>> x25: ffff00000b34e7c0 x24: ffff00000a041dd0
>> x23: ffff00000b34e7c0 x22: ffff8003ffe2aa08
>> x21: ffff00000b34e7c0 x20: ffff8003ffe2aa00
>> x19: ffff00000b34e240 x18: 0000000005f5e0ff
>> x17: 0000000000000000 x16: 0000000000000000
>> x15: 00000000000000c4 x14: ffff8003fff79500
>> x13: ffff00000a464f28 x12: ffff00000b59cd10
>> x11: 0000000000000000 x10: ffff00000a62eef8
>> x9 : ffff00000b59ccd0 x8 : ffff8003c0400000
>> x7 : 0000000000000000 x6 : ffff00000b59ccd0
>> x5 : ffffffffffffffff x4 : 0000000000000000
>> x3 : ffff8003ffdfdc18 x2 : 0000000000000000
>> x1 : ffff00000a043548 x0 : 0000000000000003
>>
>> Kernel panic - not syncing: softlockup: hung tasks
>> CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W    L
>> 4.6.0-rc7-next-20160513 #6
>> Hardware name: AppliedMicro Mustang/Mustang, BIOS 3.05.05-beta_rc Jan 27
>> 2016
>> Call trace:
>> [<ffff000008095bb0>] dump_backtrace+0x0/0x4b0
>> [<ffff00000809609c>] show_stack+0x3c/0x60
>> [<ffff000008a8f05c>] dump_stack+0x1dc/0x2c8
>> [<ffff0000083fd494>] panic+0x264/0x5fc
>> [<ffff00000831b914>] watchdog_timer_fn+0x804/0x840
>> [<ffff000008274044>] __hrtimer_run_queues+0x4b4/0xf50
>> [<ffff000008276864>] hrtimer_interrupt+0x174/0x478
>> [<ffff000009289e94>] arch_timer_handler_phys+0xac/0xc8
>> [<ffff00000823e4c4>] handle_percpu_devid_irq+0x214/0x8b0
>> [<ffff00000822f6a4>] generic_handle_irq+0x8c/0xb0
>> [<ffff00000822ff20>] __handle_domain_irq+0x178/0x288
>> [<ffff000008081e40>] gic_handle_irq+0x1e8/0x270
>> Exception stack(0xffff8003ffe13fa0 to 0xffff8003ffe140c0)
>> 3fa0: ffff8003c0403a30 ffff8003ffe2aa00 ffff8003c0403b50 ffff0000082b6390
>> 3fc0: 0000000080000045 ffff00000a041dd0 ffff8003ffe10020 ffff8003ffe14010
>> 3fe0: ffff00000a482550 ffff8003c0400000 ffff00000800f000 ffff8003c0403a30
>> 4000: ffff8003c0403b50 ffff8003c0403a30 0000000000000000 0000000000000000
>> 4020: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
>> 4040: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
>> 4060: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
>> 4080: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
>> 40a0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
>> [<ffff000008088724>] el1_irq+0xa4/0x114
>> [<ffff0000082b6390>] smp_call_function_many+0x780/0x7b0
>> [<ffff0000082b6714>] smp_call_function+0x7c/0x1c8
>> [<ffff0000082b693c>] on_each_cpu+0x74/0x280
>> [<ffff0000080e9528>] kvm_arch_init+0x8c0/0xe60
>> [<ffff0000080ccb60>] kvm_init+0x58/0x740
>> [<ffff0000080e3e48>] arm_init+0x40/0x58
>> [<ffff00000808366c>] do_one_initcall+0xac/0x360
>> [<ffff000009e41ee8>] kernel_init_freeable+0x2ac/0x4a8
>> [<ffff0000096772bc>] kernel_init+0x3c/0x368
>> [<ffff000008088e10>] ret_from_fork+0x10/0x40
>> SMP: stopping secondary CPUs
>> SMP: failed to stop secondary CPUs 0-7
>> Kernel Offset: disabled
>> Memory Limit: none
>> ---[ end Kernel panic - not syncing: softlockup: hung tasks
>>
>>
>> On 5/15/16 8:42 PM, Julien Grall wrote:
>>>
>>> Hello,
>>>
>>> On 15/05/2016 12:19, Christoffer Dall wrote:
>>>>
>>>> On Sunday, May 15, 2016, Itaru Kitayama <itaru.kitayama@riken.jp
>>>> <mailto:itaru.kitayama@riken.jp>> wrote:
>>>>>
>>>>>
>>>>> Below is the boot (with UEFI) log. I'm attaching the .config I'm using.
>>>>> I've been trying to test Julien's ACPI support patch set recently
>>>>
>>>> merged in the kvmarm tree on Mustang.
>>>>
>>>>
>>>> I don't run anything with ACPI, so haven't tested that particular aspect.
>>>>
>>>> This doesn't immediately look like it's related to the kvmarm patches.
>>>>
>>>> Perhaps you could try with Linux-next as well to see if this was already
>>>> fixed?
>>>>
>>>> Julien, did you test mustang with your ACPI patches?
>>>
>>>
>>> No, the patch has been tested on Juno-r2 and Seattle.
>>>
>>> However, the logs looks very similar to a bug that Steve Capper was
>>> hunting in Linux 4.6.0-rc3. I believe this has been fixed in a later RC.
>>>
>>> kvm-arm-for-4.7 seems to be based on Linux 4.6-rc1 so I would recommend
>>> you to try Linux-next.
>>>
>>> Regards,
>>>
>>

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-16 23:28             ` Itaru Kitayama
@ 2016-05-17  8:00               ` Julien Grall
  2016-05-17 16:16                 ` Shanker Donthineni
  0 siblings, 1 reply; 80+ messages in thread
From: Julien Grall @ 2016-05-17  8:00 UTC (permalink / raw)
  To: Itaru Kitayama, Christoffer Dall; +Cc: kvmarm@lists.cs.columbia.edu

Hello,

On 17/05/2016 00:28, Itaru Kitayama wrote:
> The new v4.6 upstream kernel gets to the prompt on Mustang (Rev A3).

I would recommend you to bissect Linux and finger one or multiple 
commits which break booting on your board.

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-16  7:19           ` Christoffer Dall
  2016-05-16 23:28             ` Itaru Kitayama
@ 2016-05-17 16:04             ` Shanker Donthineni
  1 sibling, 0 replies; 80+ messages in thread
From: Shanker Donthineni @ 2016-05-17 16:04 UTC (permalink / raw)
  To: Christoffer Dall, Itaru Kitayama; +Cc: kvmarm

Hi Itaru,

I have tested kvmram patches (v4.6 and next-20160513) with ACPI/DTB
firmware on Qualcomm platforms without any issue.

Seems this problem could be related to memory region attributes and
typethat contains runtime service code/data and EFI system table.

Make sure EFI system table marked as runtime service with right arrtinutes.

On 05/16/2016 02:19 AM, Christoffer Dall wrote:
> Hi Itaru,
>
> I'm afraid I don't know would be causing this nor do I have an easy
> way to reproduce.
>
> I suggest you try with v4.6 which was just released, and if it still
> doesn't work, report it as a bug on linux-arm-kernel.
>
> Thanks,
> -Christoffer
>
> On Sun, May 15, 2016 at 3:30 PM, Itaru Kitayama <itaru.kitayama@riken.jp>
> wrote:
>> Julien, Christoffer,
>>
>> Below is the boot log of linux-next.
>>
>>
>> EFI stub: Booting Linux Kernel...
>> EFI stub: Using DTB from configuration table
>> EFI stub: Exiting boot services and installing virtual address map...
>> L3C: 8MB
>> Booting Linux on physical CPU 0x0
>> Linux version 4.6.0-rc7-next-20160513 (itaru.kitayama@r2-a11) (gcc
> version
>> 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC) ) #6 SMP PREEMPT Sun May 15
> 08:21:01
>> CDT 2016
>> Boot CPU: AArch64 Processor [500f0000]
>> earlycon: uart0 at MMIO32 0x000000001c020000 (options '')
>> bootconsole [uart0] enabled
>> efi: Getting EFI parameters from FDT:
>> efi: EFI v2.40 by X-Gene Mustang Board EFI Jan 27 2016 18:27:58
>> efi:  ACPI=0x43fa859000  ACPI 2.0=0x43fa859014  SMBIOS 3.0=0x43fa857000
>> cma: Reserved 512 MiB at 0x00000040e0000000
>> ACPI: Early table checksum verification enabled
>> ACPI: RSDP 0x00000043FA859014 000024 (v02 APM   )
>> ACPI: XSDT 0x00000043FA8580E8 00007C (v01 APM    XGENE    00000003
> 01000013)
>> ACPI: FACP 0x00000043FA850000 00010C (v05 APM    XGENE    00000003 INTL
>> 20140724)
>> ACPI: DSDT 0x00000043FA851000 003A00 (v05 APM    APM88xxx 00000001 INTL
>> 20140724)
>> ACPI: DBG2 0x00000043FA855000 0000AA (v00 APMC0D XGENEDBG 00000000 INTL
>> 20140724)
>> ACPI: GTDT 0x00000043FA84E000 0000E0 (v02 APM    XGENE    00000001 INTL
>> 20140724)
>> ACPI: MCFG 0x00000043FA84D000 00003C (v01 APM    XGENE    00000002 INTL
>> 20140724)
>> ACPI: SPCR 0x00000043FA84C000 000050 (v02 APMC0D XGENESPC 00000000 INTL
>> 20140724)
>> ACPI: SSDT 0x00000043FA84B000 00002D (v02 APM    XGENE    00000001 INTL
>> 20140724)
>> ACPI: BERT 0x00000043FA84A000 000030 (v01 APM    XGENE    00000002 INTL
>> 20140724)
>> ACPI: HEST 0x00000043FA849000 0002A8 (v01 APM    XGENE    00000002 INTL
>> 20140724)
>> ACPI: APIC 0x00000043FA848000 0002A4 (v03 APM    XGENE    00000003
> 01000013)
>> ACPI: SSDT 0x00000043FA847000 000063 (v02 REDHAT MACADDRS 00000001
> 01000013)
>> ACPI: SSDT 0x00000043FA846000 000032 (v02 REDHAT UARTCLKS 00000001
> 01000013)
>> On node 0 totalpages: 262144
>>   DMA zone: 64 pages used for memmap
>>   DMA zone: 0 pages reserved
>>   DMA zone: 65536 pages, LIFO batch:1
>>   Normal zone: 192 pages used for memmap
>>   Normal zone: 196608 pages, LIFO batch:1
>> psci: is not implemented in ACPI.
>> percpu: Embedded 3 pages/cpu @ffff8003ffde0000 s110208 r8192 d78208
> u196608
>> pcpu-alloc: s110208 r8192 d78208 u196608 alloc=3*65536
>> pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7
>> Detected PIPT I-cache on CPU0
>> Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
> 261888
>> Kernel command line: BOOT_IMAGE=/vmlinuz-4.6.0-rc7-next-20160513
>> root=UUID=ac9f9264-7572-48c3-97d2-042ea95f7640 ro acpi=force
>> acpi_force_table_verification earlycon=uart,mmio32,0x1c020000
>> console=ttyS0,115200 loglevel=8 LANG=en_US.UTF-8
>> log_buf_len individual max cpu contribution: 4096 bytes
>> log_buf_len total cpu_extra contributions: 28672 bytes
>> log_buf_len min size: 16384 bytes
>> log_buf_len: 65536 bytes
>> early log buf free: 13072(79%)
>> PID hash table entries: 4096 (order: -1, 32768 bytes)
>> Dentry cache hash table entries: 2097152 (order: 8, 16777216 bytes)
>> Inode-cache hash table entries: 1048576 (order: 7, 8388608 bytes)
>> software IO TLB [mem 0x40dbff0000-0x40dfff0000] (64MB) mapped at
>> [ffff8000dbff0000-ffff8000dffeffff]
>> Memory: 16070272K/16777216K available (22780K kernel code, 8781K rwdata,
>> 7680K rodata, 1920K init, 16628K bss, 182656K reserved, 524288K
>> cma-reserved)
>> Virtual kernel memory layout:
>>     modules : 0xffff000000000000 - 0xffff000008000000   (   128 MB)
>>     vmalloc : 0xffff000008000000 - 0xffff7bdfffff0000   (126847 GB)
>>       .text : 0xffff000008080000 - 0xffff0000096b0000   ( 22720 KB)
>>     .rodata : 0xffff0000096b0000 - 0xffff000009e40000   (  7744 KB)
>>       .init : 0xffff000009e40000 - 0xffff00000a020000   (  1920 KB)
>>       .data : 0xffff00000a020000 - 0xffff00000a8b3600   (  8782 KB)
>>        .bss : 0xffff00000a8b3600 - 0xffff00000b8f0760   ( 16629 KB)
>>     fixed   : 0xffff7fdffe7d0000 - 0xffff7fdffec00000   (  4288 KB)
>>     PCI I/O : 0xffff7fdffee00000 - 0xffff7fdfffe00000   (    16 MB)
>>     vmemmap : 0xffff7fe000000000 - 0xffff800000000000   (   128 GB
> maximum)
>>               0xffff7fe000000000 - 0xffff7fe001000000   (    16 MB
> actual)
>>     memory  : 0xffff800000000000 - 0xffff800400000000   ( 16384 MB)
>> SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
>> Preemptible hierarchical RCU implementation.
>>         Build-time adjustment of leaf fanout to 64.
>> NR_IRQS:64 nr_irqs:64 0
>> GIC: Using split EOI/Deactivate mode
>> GICv3: No distributor detected at @ffff000008060000, giving up
>> Architected cp15 timer(s) running at 50.00MHz (phys).
>> clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles:
>> 0xb8812736b, max_idle_ns: 440795202655 ns
>> sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every
> 4398046511100ns
>> Console: colour dummy device 80x25
>> Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
>> ... MAX_LOCKDEP_SUBCLASSES:  8
>> ... MAX_LOCK_DEPTH:          48
>> ... MAX_LOCKDEP_KEYS:        8191
>> ... CLASSHASH_SIZE:          4096
>> ... MAX_LOCKDEP_ENTRIES:     32768
>> ... MAX_LOCKDEP_CHAINS:      65536
>> ... CHAINHASH_SIZE:          32768
>>  memory used by lock dependency info: 8127 kB
>>  per task-struct memory footprint: 1920 bytes
>> Calibrating delay loop (skipped), value calculated using timer
> frequency..
>> 100.00 BogoMIPS (lpj=200000)
>> pid_max: default: 32768 minimum: 301
>> ACPI: Core revision 20160422
>> Security Framework initialized
>> Mount-cache hash table entries: 32768 (order: 2, 262144 bytes)
>> Mountpoint-cache hash table entries: 32768 (order: 2, 262144 bytes)
>> ftrace: allocating 29581 entries in 8 pages
>> ASID allocator initialised with 65536 entries
>> Remapping and enabling EFI services.
>>   EFI remap 0x0000000010510000 => 0000000020000000
>>   EFI remap 0x0000000010548000 => 0000000020018000
>>   EFI remap 0x0000000017000000 => 0000000020020000
>>   EFI remap 0x000000001c025000 => 0000000020035000
>>   EFI remap 0x000000007c0c0000 => 0000000020040000
>>   EFI remap 0x000000007c1c0000 => 0000000020050000
>>   EFI remap 0x000000007c2c0000 => 0000000020060000
>>   EFI remap 0x000000007c3c0000 => 0000000020070000
>>   EFI remap 0x000000007c4c0000 => 0000000020080000
>>   EFI remap 0x000000007c5c0000 => 0000000020090000
>>   EFI remap 0x000000007c6c0000 => 00000000200a0000
>>   EFI remap 0x000000007c7c0000 => 00000000200b0000
>> UEFI Runtime regions are not aligned to 64 KB -- buggy firmware?
>> ------------[ cut here ]------------
>> WARNING: CPU: 0 PID: 1 at arch/arm64/kernel/efi.c:34
>> efi_create_mapping+0x1a0/0x3b8
>> Modules linked in:
>>
>> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.6.0-rc7-next-20160513 #6
>> Hardware name: APM X-Gene Mustang board (DT)
>> task: ffff8003c0340000 ti: ffff8003c0400000 task.ti: ffff8003c0400000
>> PC is at efi_create_mapping+0x1a0/0x3b8
>> LR is at efi_create_mapping+0x194/0x3b8
>> pc : [<ffff000009e4a5a8>] lr : [<ffff000009e4a59c>] pstate: 60000245
>> sp : ffff8003c0403cb0
>> x29: ffff8003c0403cb0 x28: ffff00000a390000
>> x27: ffff8003f9a77468 x26: 0000000000003000
>> x25: 800000000000000f x24: ffff00000a2de390
>> x23: 0000000000000005 x22: 0000000000000001
>> x21: ffff00000a41d000 x20: ffff00000a8fc000
>> x19: ffff00000a8fc198 x18: ffff0000097fe000
>> x17: 0000000000000001 x16: 0000000000000000
>> x15: 0000000000000056 x14: 3f657261776d7269
>> x13: ffff00000a464f28 x12: ffff00000a465b30
>> x11: 0000000000000001 x10: ffff8003c0400000
>> x9 : 00000000000085f1 x8 : 0000000000000003
>> x7 : 0000000000000000 x6 : ffff00000a042000
>> x5 : ffff00000b3b4c58 x4 : 00000000001c115c
>> x3 : ffff8003c0340000 x2 : 0000000000000132
>> x1 : 0000000000000099 x0 : 0000000000000001
>>
>> ---[ end trace a2cb2e24ff35d5f8 ]---
>> Call trace:
>> Exception stack(0xffff8003c0403ac0 to 0xffff8003c0403be0)
>> 3ac0: ffff00000a8fc198 ffff00000a8fc000 ffff8003c0403cb0
> ffff000009e4a5a8
>> 3ae0: 0000000060000245 000000000000003d 800000000000000f
> 0000000000003000
>> 3b00: ffff8003f9a77468 0000000000000001 0000000000000005
> ffff00000a2de390
>> 3b20: 800000000000000f 0000000000003000 ffff8003f9a77468
> ffff00000a390000
>> 3b40: ffff00000a465ab8 0000000000000000 ffff8003c0403bd0
> ffff000009cdcf70
>> 3b60: 000000000b3071a8 0000000000000000 ffff000000000000
> 00000000ffffffff
>> 3b80: ffff8003c0403cb0 ffff8003c0403cb0 0000000000000001
> 0000000000000099
>> 3ba0: 0000000000000132 ffff8003c0340000 00000000001c115c
> ffff00000b3b4c58
>> 3bc0: ffff00000a042000 0000000000000000 0000000000000003
> 00000000000085f1
>> [<ffff000009e4a5a8>] efi_create_mapping+0x1a0/0x3b8
>> [<ffff000009ee82b0>] arm_enable_runtime_services+0x26c/0x57c
>> [<ffff00000808366c>] do_one_initcall+0xac/0x360
>> [<ffff000009e41d10>] kernel_init_freeable+0xd4/0x4a8
>> [<ffff0000096772bc>] kernel_init+0x3c/0x368
>> [<ffff000008088e10>] ret_from_fork+0x10/0x40
>>   EFI remap 0x00000043fa813000 => 00000000200c3000
>>   EFI remap 0x00000043fa85a000 => 00000000200da000
>>   EFI remap 0x00000043ffa02000 => 00000000202c2000
>>   EFI remap 0x00000043ffa16000 => 00000000202d6000
>> Detected PIPT I-cache on CPU1
>> CPU1: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU2
>> CPU2: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU3
>> CPU3: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU4
>> CPU4: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU5
>> CPU5: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU6
>> CPU6: Booted secondary processor [500f0000]
>> Detected PIPT I-cache on CPU7
>> CPU7: Booted secondary processor [500f0000]
>> Brought up 8 CPUs
>> SMP: Total of 8 processors activated.
>> CPU features: detected feature: 32-bit EL0 Support
>> CPU: All CPU(s) started at EL2
>> devtmpfs: initialized
>> gcov: version magic: 0x35303352
>> SMBIOS 3.0.0 present.
>> clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff,
> max_idle_ns:
>> 7645041785100000 ns
>> pinctrl core: initialized pinctrl subsystem
>> NET: Registered protocol family 16
>> PCCT header not found.
>> vdso: 2 pages (1 code @ ffff0000096d0000, 1 data @ ffff00000a030000)
>> hw-breakpoint: found 4 breakpoint and 4 watchpoint registers.
>> DMA: preallocated 256 KiB pool for atomic allocations
>> ACPI: bus type PCI registered
>> Serial: AMBA PL011 UART driver
>> HugeTLB registered 512 MB page size, pre-allocated 0 pages
>> ACPI: Added _OSI(Module Device)
>> ACPI: Added _OSI(Processor Device)
>> ACPI: Added _OSI(3.0 _SCP Extensions)
>> ACPI: Added _OSI(Processor Aggregator Device)
>> ACPI: 4 ACPI AML tables successfully acquired and loaded
>>
>> ACPI: Interpreter enabled
>> ACPI: Using GIC for interrupt routing
>> ACPI: Power Resource [SCVR] (off)
>> ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
>> acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments
>> MSI]
>> acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME AER
> PCIeCapability]
>> acpi PNP0A08:00: Bus 0000:00 not present in PCI namespace
>> vgaarb: loaded
>> SCSI subsystem initialized
>> libata version 3.00 loaded.
>> ACPI: bus type USB registered
>> usbcore: registered new interface driver usbfs
>> usbcore: registered new interface driver hub
>> usbcore: registered new device driver usb
>> pps_core: LinuxPPS API ver. 1 registered
>> pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti
>> <giometti@linux.it>
>> PTP clock support registered
>> Advanced Linux Sound Architecture Driver Initialized.
>> clocksource: Switched to clocksource arch_sys_counter
>> Warning: could not register all branches stats
>> Warning: could not register annotated branches stats
>> VFS: Disk quotas dquot_6.6.0
>> VFS: Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
>> pnp: PnP ACPI init
>> pnp: PnP ACPI: found 0 devices
>> NET: Registered protocol family 2
>> TCP established hash table entries: 131072 (order: 4, 1048576 bytes)
>> TCP bind hash table entries: 65536 (order: 6, 4194304 bytes)
>> TCP: Hash tables configured (established 131072 bind 65536)
>> UDP hash table entries: 8192 (order: 4, 1310720 bytes)
>> UDP-Lite hash table entries: 8192 (order: 4, 1310720 bytes)
>> NET: Registered protocol family 1
>> RPC: Registered named UNIX socket transport module.
>> RPC: Registered udp transport module.
>> RPC: Registered tcp transport module.
>> RPC: Registered tcp NFSv4.1 backchannel transport module.
>> PCI: CLS 0 bytes, default 128
>> Unpacking initramfs...
>> Freeing initrd memory: 10432K (ffff8003f9a80000 - ffff8003fa4b0000)
>> kvm [1]: 8-bit VMID
>> kvm [1]: Hyp mode initialized successfully
>> INFO: rcu_preempt detected stalls on CPUs/tasks:
>>         0-...: (113 GPs behind) idle=1f9/1/0 softirq=86/86 fqs=0
>>         2-...: (107 GPs behind) idle=559/1/0 softirq=120/120 fqs=0
>>         4-...: (107 GPs behind) idle=33b/1/0 softirq=106/106 fqs=0
>>         5-...: (108 GPs behind) idle=333/1/0 softirq=130/130 fqs=0
>>         6-...: (105 GPs behind) idle=2f7/1/0 softirq=120/120 fqs=0
>>         7-...: (105 GPs behind) idle=327/1/0 softirq=131/131 fqs=0
>>         (detected by 1, t=5252 jiffies, g=-135, c=-136, q=8)
>> Task dump for CPU 0:
>> swapper/0       R  running task        0     0      0 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<ffff00000a6276b8>] ______f.8076+0x10/0x28
>> Task dump for CPU 2:
>> swapper/2       R  running task        0     0      1 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<000000000006a42a>] 0x6a42a
>> Task dump for CPU 4:
>> swapper/4       R  running task        0     0      1 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<0000000000048555>] 0x48555
>> Task dump for CPU 5:
>> swapper/5       R  running task        0     0      1 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<0000000000048554>] 0x48554
>> Task dump for CPU 6:
>> swapper/6       R  running task        0     0      1 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<000000000004855b>] 0x4855b
>> Task dump for CPU 7:
>> swapper/7       R  running task        0     0      1 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<000000000004855a>] 0x4855a
>> rcu_preempt kthread starved for 5252 jiffies! g18446744073709551481
>> c18446744073709551480 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1
>> rcu_preempt     S ffff00000808ba20     0     7      2 0x00000000
>> Call trace:
>> [<ffff00000808ba20>] __switch_to+0x1c8/0x240
>> [<ffff00000967cfa8>] __schedule+0xb68/0x2558
>> [<ffff00000967f57c>] schedule+0xc4/0x230
>> [<ffff00000968d130>] schedule_timeout+0x430/0x858
>> [<ffff00000825dd50>] rcu_gp_kthread+0x1138/0x1ed0
>> [<ffff000008190744>] kthread+0x1cc/0x1e0
>> [<ffff000008088e10>] ret_from_fork+0x10/0x40
>> NMI watchdog: BUG: soft lockup - CPU#1 stuck for 22s! [swapper/0:1]
>> Modules linked in:
>>
>> CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W
> 4.6.0-rc7-next-20160513 #6
>> Hardware name: AppliedMicro Mustang/Mustang, BIOS 3.05.05-beta_rc Jan 27
>> 2016
>> task: ffff8003c0340000 ti: ffff8003c0400000 task.ti: ffff8003c0400000
>> PC is at smp_call_function_many+0x780/0x7b0
>> LR is at smp_call_function_many+0x73c/0x7b0
>> pc : [<ffff0000082b6390>] lr : [<ffff0000082b634c>] pstate: 80000045
>> sp : ffff8003c0403b50
>> x29: ffff8003c0403b50 x28: ffff00000a482540
>> x27: ffff00000a482550 x26: ffff000009ffa000
>> x25: ffff00000b34e7c0 x24: ffff00000a041dd0
>> x23: ffff00000b34e7c0 x22: ffff8003ffe2aa08
>> x21: ffff00000b34e7c0 x20: ffff8003ffe2aa00
>> x19: ffff00000b34e240 x18: 0000000005f5e0ff
>> x17: 0000000000000000 x16: 0000000000000000
>> x15: 00000000000000c4 x14: ffff8003fff79500
>> x13: ffff00000a464f28 x12: ffff00000b59cd10
>> x11: 0000000000000000 x10: ffff00000a62eef8
>> x9 : ffff00000b59ccd0 x8 : ffff8003c0400000
>> x7 : 0000000000000000 x6 : ffff00000b59ccd0
>> x5 : ffffffffffffffff x4 : 0000000000000000
>> x3 : ffff8003ffdfdc18 x2 : 0000000000000000
>> x1 : ffff00000a043548 x0 : 0000000000000003
>>
>> Kernel panic - not syncing: softlockup: hung tasks
>> CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W    L
>> 4.6.0-rc7-next-20160513 #6
>> Hardware name: AppliedMicro Mustang/Mustang, BIOS 3.05.05-beta_rc Jan 27
>> 2016
>> Call trace:
>> [<ffff000008095bb0>] dump_backtrace+0x0/0x4b0
>> [<ffff00000809609c>] show_stack+0x3c/0x60
>> [<ffff000008a8f05c>] dump_stack+0x1dc/0x2c8
>> [<ffff0000083fd494>] panic+0x264/0x5fc
>> [<ffff00000831b914>] watchdog_timer_fn+0x804/0x840
>> [<ffff000008274044>] __hrtimer_run_queues+0x4b4/0xf50
>> [<ffff000008276864>] hrtimer_interrupt+0x174/0x478
>> [<ffff000009289e94>] arch_timer_handler_phys+0xac/0xc8
>> [<ffff00000823e4c4>] handle_percpu_devid_irq+0x214/0x8b0
>> [<ffff00000822f6a4>] generic_handle_irq+0x8c/0xb0
>> [<ffff00000822ff20>] __handle_domain_irq+0x178/0x288
>> [<ffff000008081e40>] gic_handle_irq+0x1e8/0x270
>> Exception stack(0xffff8003ffe13fa0 to 0xffff8003ffe140c0)
>> 3fa0: ffff8003c0403a30 ffff8003ffe2aa00 ffff8003c0403b50
> ffff0000082b6390
>> 3fc0: 0000000080000045 ffff00000a041dd0 ffff8003ffe10020
> ffff8003ffe14010
>> 3fe0: ffff00000a482550 ffff8003c0400000 ffff00000800f000
> ffff8003c0403a30
>> 4000: ffff8003c0403b50 ffff8003c0403a30 0000000000000000
> 0000000000000000
>> 4020: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
>> 4040: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
>> 4060: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
>> 4080: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
>> 40a0: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
>> [<ffff000008088724>] el1_irq+0xa4/0x114
>> [<ffff0000082b6390>] smp_call_function_many+0x780/0x7b0
>> [<ffff0000082b6714>] smp_call_function+0x7c/0x1c8
>> [<ffff0000082b693c>] on_each_cpu+0x74/0x280
>> [<ffff0000080e9528>] kvm_arch_init+0x8c0/0xe60
>> [<ffff0000080ccb60>] kvm_init+0x58/0x740
>> [<ffff0000080e3e48>] arm_init+0x40/0x58
>> [<ffff00000808366c>] do_one_initcall+0xac/0x360
>> [<ffff000009e41ee8>] kernel_init_freeable+0x2ac/0x4a8
>> [<ffff0000096772bc>] kernel_init+0x3c/0x368
>> [<ffff000008088e10>] ret_from_fork+0x10/0x40
>> SMP: stopping secondary CPUs
>> SMP: failed to stop secondary CPUs 0-7
>> Kernel Offset: disabled
>> Memory Limit: none
>> ---[ end Kernel panic - not syncing: softlockup: hung tasks
>>
>>
>> On 5/15/16 8:42 PM, Julien Grall wrote:
>>> Hello,
>>>
>>> On 15/05/2016 12:19, Christoffer Dall wrote:
>>>> On Sunday, May 15, 2016, Itaru Kitayama <itaru.kitayama@riken.jp
>>>> <mailto:itaru.kitayama@riken.jp>> wrote:
>>>>>
>>>>> Below is the boot (with UEFI) log. I'm attaching the .config I'm
> using.
>>>>> I've been trying to test Julien's ACPI support patch set recently
>>>> merged in the kvmarm tree on Mustang.
>>>>
>>>>
>>>> I don't run anything with ACPI, so haven't tested that particular
> aspect.
>>>> This doesn't immediately look like it's related to the kvmarm patches.
>>>>
>>>> Perhaps you could try with Linux-next as well to see if this was
> already
>>>> fixed?
>>>>
>>>> Julien, did you test mustang with your ACPI patches?
>>>
>>> No, the patch has been tested on Juno-r2 and Seattle.
>>>
>>> However, the logs looks very similar to a bug that Steve Capper was
>>> hunting in Linux 4.6.0-rc3. I believe this has been fixed in a later
> RC.
>>> kvm-arm-for-4.7 seems to be based on Linux 4.6-rc1 so I would recommend
>>> you to try Linux-next.
>>>
>>> Regards,
>>>
> _______________________________________________
> kvmarm mailing list
> kvmarm@lists.cs.columbia.edu
> https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

-- 
Shanker Donthineni
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PULL 00/29] KVM/ARM Changes for v4.7
  2016-05-17  8:00               ` Julien Grall
@ 2016-05-17 16:16                 ` Shanker Donthineni
  0 siblings, 0 replies; 80+ messages in thread
From: Shanker Donthineni @ 2016-05-17 16:16 UTC (permalink / raw)
  To: Julien Grall, Itaru Kitayama, Christoffer Dall; +Cc: kvmarm

Hi Itaru,

Look at this commit that might be causing the problem.

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/drivers/firmware/efi/arm-runtime.c?id=14c43be60166981f0b1f034ad9c59252c6f99e0d

Review your EFI system table and runtime service region attributes.

On 05/17/2016 03:00 AM, Julien Grall wrote:
> Hello,
>
> On 17/05/2016 00:28, Itaru Kitayama wrote:
>> The new v4.6 upstream kernel gets to the prompt on Mustang (Rev A3).
>
> I would recommend you to bissect Linux and finger one or multiple commits which break booting on your board.
>
> Regards,
>

-- 
Shanker Donthineni
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 80+ messages in thread

end of thread, other threads:[~2016-05-17 16:13 UTC | newest]

Thread overview: 80+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-11 13:29 [PULL 00/29] KVM/ARM Changes for v4.7 Christoffer Dall
2016-05-11 13:29 ` Christoffer Dall
2016-05-11 13:29 ` [PULL 01/29] arm64: Reuse TCR field definitions for EL1 and EL2 Christoffer Dall
2016-05-11 13:29   ` Christoffer Dall
2016-05-11 13:29 ` [PULL 02/29] arm64: Cleanup VTCR_EL2 and VTTBR field values Christoffer Dall
2016-05-11 13:29   ` Christoffer Dall
2016-05-11 13:29 ` [PULL 03/29] kvm arm: Move fake PGD handling to arch specific files Christoffer Dall
2016-05-11 13:29   ` Christoffer Dall
2016-05-11 13:29 ` [PULL 04/29] arm64: Introduce pmd_thp_or_huge Christoffer Dall
2016-05-11 13:29   ` Christoffer Dall
2016-05-11 13:29 ` [PULL 05/29] kvm-arm: Replace kvm_pmd_huge with pmd_thp_or_huge Christoffer Dall
2016-05-11 13:29   ` Christoffer Dall
2016-05-11 13:29 ` [PULL 06/29] kvm-arm: Remove kvm_pud_huge() Christoffer Dall
2016-05-11 13:29   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 07/29] kvm-arm: arm32: Introduce stage2 page table helpers Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 08/29] kvm-arm: arm: Introduce hyp page table empty checks Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 09/29] kvm-arm: arm64: Introduce stage2 page table helpers Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 10/29] kvm-arm: arm64: Introduce hyp page table empty checks Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 11/29] kvm-arm: Use explicit stage2 helper routines Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 12/29] kvm-arm: Add explicit hyp page table modifiers Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 13/29] kvm-arm: Add stage2 " Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 14/29] kvm-arm: Cleanup kvm_* wrappers Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 15/29] kvm: arm64: Get rid of fake page table levels Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 16/29] kvm-arm: Cleanup stage2 pgd handling Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 17/29] arm64: kvm: Add support for 16K pages Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 18/29] arm/arm64: KVM: Enforce Break-Before-Make on Stage-2 page tables Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 19/29] clocksource: arm_arch_timer: Gather KVM specific information in a structure Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 20/29] clocksource: arm_arch_timer: Extend arch_timer_kvm_info to get the virtual IRQ Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 21/29] irqchip/gic-v2: Gather ACPI specific data in a single structure Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 22/29] irqchip/gic-v2: Parse and export virtual GIC information Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 23/29] irqchip/gic-v3: Prefix all pr_* messages by "GICv3: " Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 24/29] irqchip/gic-v3: Gather all ACPI specific data in a single structure Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 25/29] irqchip/gic-v3: Parse and export virtual GIC information Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 26/29] KVM: arm/arm64: arch_timer: Rely on the arch timer to parse the firmware tables Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 27/29] KVM: arm/arm64: vgic: Rely on the GIC driver " Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 28/29] clocksource: arm_arch_timer: Remove arch_timer_get_timecounter Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 13:30 ` [PULL 29/29] kvm: arm64: Enable hardware updates of the Access Flag for Stage 2 page tables Christoffer Dall
2016-05-11 13:30   ` Christoffer Dall
2016-05-11 15:23 ` [PULL 00/29] KVM/ARM Changes for v4.7 Paolo Bonzini
2016-05-11 15:23   ` Paolo Bonzini
2016-05-11 15:37   ` Marc Zyngier
2016-05-11 15:37     ` Marc Zyngier
2016-05-11 15:41     ` Paolo Bonzini
2016-05-11 15:41       ` Paolo Bonzini
2016-05-11 15:42   ` Christoffer Dall
2016-05-11 15:42     ` Christoffer Dall
  -- strict thread matches above, loose matches on Subject: below --
2016-05-14 14:58 Itaru Kitayama
2016-05-15  7:08 ` Christoffer Dall
2016-05-15  9:37   ` Itaru Kitayama
2016-05-15 11:19     ` Christoffer Dall
2016-05-15 11:42       ` Julien Grall
2016-05-15 13:30         ` Itaru Kitayama
2016-05-16  7:19           ` Christoffer Dall
2016-05-16 23:28             ` Itaru Kitayama
2016-05-17  8:00               ` Julien Grall
2016-05-17 16:16                 ` Shanker Donthineni
2016-05-17 16:04             ` Shanker Donthineni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.