	.file	"extr_vgic-v3.c_vgic_v3_probe.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"en"
.LC1:
	.string	"dis"
.LC2:
	.string	"G0"
.LC3:
	.string	""
.LC4:
	.string	"C"
.LC5:
	.string	"G1"
.LC6:
	.string	"GICv4 support %sabled\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC7:
	.string	"GICv3: no GICV resource entry\n"
	.align 8
.LC8:
	.string	"GICV physical address 0x%llx not page aligned\n"
	.align 8
.LC9:
	.string	"Cannot register GICv2 KVM device.\n"
	.section	.rodata.str1.1
.LC10:
	.string	"vgic-v2@%llx\n"
	.section	.rodata.str1.8
	.align 8
.LC11:
	.string	"Cannot register GICv3 KVM device.\n"
	.section	.rodata.str1.1
.LC12:
	.string	"disabling GICv2 emulation\n"
	.section	.rodata.str1.8
	.align 8
.LC13:
	.string	"GICv3 sysreg trapping enabled ([%s%s%s], reduced performance)\n"
	.text
	.p2align 4
	.globl	vgic_v3_probe
	.type	vgic_v3_probe, @function
vgic_v3_probe:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	edi, DWORD PTR __vgic_v3_get_ich_vtr_el2[rip]
	call	kvm_call_hyp_ret@PLT
	mov	DWORD PTR kvm_vgic_global_state[rip+4], 0
	mov	edx, eax
	mov	DWORD PTR kvm_vgic_global_state[rip+8], eax
	and	edx, 15
	add	edx, 1
	cmp	QWORD PTR 8[rbx], 0
	mov	DWORD PTR kvm_vgic_global_state[rip], edx
	je	.L2
	mov	rax, QWORD PTR gicv4_enable[rip]
	lea	rsi, .LC0[rip]
	lea	rdi, .LC6[rip]
	test	rax, rax
	mov	QWORD PTR kvm_vgic_global_state[rip+40], rax
	lea	rax, .LC1[rip]
	cmove	rsi, rax
	xor	eax, eax
	call	kvm_info@PLT
.L2:
	mov	rdi, QWORD PTR [rbx]
	test	rdi, rdi
	jne	.L4
	lea	rdi, .LC7[rip]
	xor	eax, eax
	call	kvm_info@PLT
	mov	QWORD PTR kvm_vgic_global_state[rip+16], 0
.L5:
	mov	edi, DWORD PTR KVM_DEV_TYPE_ARM_VGIC_V3[rip]
	call	kvm_register_vgic_device@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L27
	cmp	QWORD PTR kvm_vgic_global_state[rip+16], 0
	je	.L28
.L10:
	mov	ecx, DWORD PTR group0_trap[rip]
	mov	eax, DWORD PTR group1_trap[rip]
	mov	rdx, QWORD PTR common_trap[rip]
	test	ecx, ecx
	je	.L29
	test	rdx, rdx
	jne	.L30
	lea	rcx, .LC3[rip]
	lea	r8, .LC5[rip]
	lea	rsi, .LC2[rip]
	test	eax, eax
	jne	.L17
	mov	r8, rcx
.L18:
	lea	rsi, .LC2[rip]
.L17:
	lea	rdi, .LC13[rip]
	mov	rdx, r8
	xor	eax, eax
	call	kvm_info@PLT
	lea	rdi, vgic_v3_cpuif_trap[rip]
	call	static_branch_enable@PLT
.L14:
	mov	eax, DWORD PTR VGIC_V3[rip]
	mov	QWORD PTR kvm_vgic_global_state[rip+32], 0
	mov	DWORD PTR kvm_vgic_global_state[rip+28], eax
	mov	eax, DWORD PTR VGIC_V3_MAX_CPUS[rip]
	mov	DWORD PTR kvm_vgic_global_state[rip+24], eax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	test	eax, eax
	jne	.L12
	test	rdx, rdx
	je	.L14
	lea	rcx, .LC4[rip]
	lea	r8, .LC3[rip]
.L13:
	lea	rsi, .LC3[rip]
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L28:
	lea	rdi, .LC12[rip]
	xor	eax, eax
	call	kvm_info@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L4:
	call	PAGE_ALIGNED@PLT
	test	eax, eax
	jne	.L6
	mov	rsi, QWORD PTR [rbx]
	lea	rdi, .LC8[rip]
	call	pr_warn@PLT
	mov	QWORD PTR kvm_vgic_global_state[rip+16], 0
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rax, QWORD PTR [rbx]
	mov	edi, DWORD PTR KVM_DEV_TYPE_ARM_VGIC_V2[rip]
	mov	DWORD PTR kvm_vgic_global_state[rip+4], 1
	mov	QWORD PTR kvm_vgic_global_state[rip+16], rax
	call	kvm_register_vgic_device@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L31
	mov	rsi, QWORD PTR [rbx]
	lea	rdi, .LC10[rip]
	xor	eax, eax
	call	kvm_info@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L12:
	lea	rcx, .LC4[rip]
	lea	r8, .LC5[rip]
	lea	rsi, .LC3[rip]
	test	rdx, rdx
	jne	.L17
	mov	rcx, rsi
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L31:
	lea	rdi, .LC9[rip]
	call	kvm_err@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L27:
	lea	rdi, .LC11[rip]
	call	kvm_err@PLT
	mov	edi, DWORD PTR KVM_DEV_TYPE_ARM_VGIC_V2[rip]
	call	kvm_unregister_device_ops@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	lea	rcx, .LC4[rip]
	lea	r8, .LC3[rip]
	lea	rsi, .LC2[rip]
	test	eax, eax
	je	.L17
	lea	r8, .LC5[rip]
	jmp	.L18
	.cfi_endproc
.LFE0:
	.size	vgic_v3_probe, .-vgic_v3_probe
	.comm	vgic_v3_cpuif_trap,4,4
	.comm	kvm_vgic_global_state,48,32
	.comm	group1_trap,4,4
	.comm	group0_trap,4,4
	.comm	gicv4_enable,8,8
	.comm	common_trap,8,8
	.comm	__vgic_v3_get_ich_vtr_el2,4,4
	.comm	VGIC_V3_MAX_CPUS,4,4
	.comm	VGIC_V3,4,4
	.comm	KVM_DEV_TYPE_ARM_VGIC_V3,4,4
	.comm	KVM_DEV_TYPE_ARM_VGIC_V2,4,4
	.comm	ARM64_WORKAROUND_CAVIUM_30115,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_vgic-v3.c_vgic_v3_probe.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"en\000"
	.align	2
.LC1:
	.ascii	"dis\000"
	.align	2
.LC2:
	.ascii	"\000"
	.align	2
.LC3:
	.ascii	"G1\000"
	.align	2
.LC4:
	.ascii	"G0\000"
	.align	2
.LC5:
	.ascii	"C\000"
	.align	2
.LC6:
	.ascii	"GICv4 support %sabled\012\000"
	.align	2
.LC7:
	.ascii	"GICv3: no GICV resource entry\012\000"
	.align	2
.LC8:
	.ascii	"GICV physical address 0x%llx not page aligned\012\000"
	.align	2
.LC9:
	.ascii	"Cannot register GICv2 KVM device.\012\000"
	.align	2
.LC10:
	.ascii	"vgic-v2@%llx\012\000"
	.align	2
.LC11:
	.ascii	"Cannot register GICv3 KVM device.\012\000"
	.align	2
.LC12:
	.ascii	"disabling GICv2 emulation\012\000"
	.align	2
.LC13:
	.ascii	"GICv3 sysreg trapping enabled ([%s%s%s], reduced pe"
	.ascii	"rformance)\012\000"
	.text
	.align	2
	.global	vgic_v3_probe
	.syntax unified
	.arm
	.fpu softvfp
	.type	vgic_v3_probe, %function
vgic_v3_probe:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L29
	push	{r4, r5, r6, lr}
	mov	r5, r0
	ldr	r0, [r3]
	bl	kvm_call_hyp_ret
	mov	r2, #0
	ldr	r1, [r5, #4]
	ldr	r4, .L29+4
	and	r3, r0, #15
	add	r3, r3, #1
	cmp	r1, r2
	str	r3, [r4]
	str	r0, [r4, #8]
	str	r2, [r4, #4]
	beq	.L2
	ldr	r3, .L29+8
	ldr	r2, .L29+12
	ldr	r3, [r3]
	ldr	r1, .L29+16
	cmp	r3, #0
	moveq	r1, r2
	ldr	r0, .L29+20
	str	r3, [r4, #28]
	bl	kvm_info
.L2:
	ldr	r6, [r5]
	cmp	r6, #0
	bne	.L4
	ldr	r0, .L29+24
	bl	kvm_info
	str	r6, [r4, #12]
.L5:
	ldr	r3, .L29+28
	ldr	r0, [r3]
	bl	kvm_register_vgic_device
	subs	r6, r0, #0
	bne	.L25
	ldr	r3, [r4, #12]
	cmp	r3, #0
	beq	.L26
.L10:
	ldr	r3, .L29+32
	ldr	r2, .L29+36
	ldr	r1, [r3]
	ldr	r3, .L29+40
	cmp	r1, #0
	ldr	ip, [r2]
	ldr	r0, [r3]
	beq	.L27
	ldr	r3, .L29+44
	cmp	ip, #0
	ldr	r2, .L29+48
	moveq	r2, r3
	ldr	r1, .L29+52
.L12:
	ldr	ip, .L29+44
	cmp	r0, #0
	ldr	r3, .L29+56
	moveq	r3, ip
.L13:
	ldr	r0, .L29+60
	bl	kvm_info
	ldr	r0, .L29+64
	bl	static_branch_enable
.L14:
	mov	r3, #0
	ldr	r1, .L29+68
	ldr	r2, .L29+72
	ldr	r1, [r1]
	ldr	r2, [r2]
	str	r1, [r4, #20]
	str	r2, [r4, #16]
	str	r3, [r4, #24]
.L1:
	mov	r0, r6
	pop	{r4, r5, r6, pc}
.L27:
	cmp	ip, #0
	bne	.L16
	cmp	r0, #0
	beq	.L14
	ldr	r1, .L29+44
	ldr	r3, .L29+56
	mov	r2, r1
	b	.L13
.L26:
	ldr	r0, .L29+76
	bl	kvm_info
	b	.L10
.L4:
	mov	r0, r6
	bl	PAGE_ALIGNED
	subs	r6, r0, #0
	bne	.L6
	ldr	r2, [r5]
	ldr	r0, .L29+80
	asr	r3, r2, #31
	bl	pr_warn
	str	r6, [r4, #12]
	b	.L5
.L6:
	mov	r2, #1
	ldr	r1, .L29+84
	ldr	r3, [r5]
	ldr	r0, [r1]
	str	r2, [r4, #4]
	str	r3, [r4, #12]
	bl	kvm_register_vgic_device
	subs	r6, r0, #0
	bne	.L28
	ldr	r1, [r5]
	ldr	r0, .L29+88
	bl	kvm_info
	b	.L5
.L16:
	ldr	r1, .L29+44
	ldr	r2, .L29+48
	b	.L12
.L28:
	ldr	r0, .L29+92
	bl	kvm_err
	b	.L1
.L25:
	ldr	r0, .L29+96
	bl	kvm_err
	ldr	r3, .L29+84
	ldr	r0, [r3]
	bl	kvm_unregister_device_ops
	mov	r0, r6
	pop	{r4, r5, r6, pc}
.L30:
	.align	2
.L29:
	.word	__vgic_v3_get_ich_vtr_el2
	.word	kvm_vgic_global_state
	.word	gicv4_enable
	.word	.LC1
	.word	.LC0
	.word	.LC6
	.word	.LC7
	.word	KVM_DEV_TYPE_ARM_VGIC_V3
	.word	group0_trap
	.word	group1_trap
	.word	common_trap
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC13
	.word	vgic_v3_cpuif_trap
	.word	VGIC_V3
	.word	VGIC_V3_MAX_CPUS
	.word	.LC12
	.word	.LC8
	.word	KVM_DEV_TYPE_ARM_VGIC_V2
	.word	.LC10
	.word	.LC9
	.word	.LC11
	.size	vgic_v3_probe, .-vgic_v3_probe
	.comm	vgic_v3_cpuif_trap,4,4
	.comm	kvm_vgic_global_state,32,4
	.comm	group1_trap,4,4
	.comm	group0_trap,4,4
	.comm	gicv4_enable,4,4
	.comm	common_trap,4,4
	.comm	__vgic_v3_get_ich_vtr_el2,4,4
	.comm	VGIC_V3_MAX_CPUS,4,4
	.comm	VGIC_V3,4,4
	.comm	KVM_DEV_TYPE_ARM_VGIC_V3,4,4
	.comm	KVM_DEV_TYPE_ARM_VGIC_V2,4,4
	.comm	ARM64_WORKAROUND_CAVIUM_30115,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
