	.file	"extr_mmio.c_intel_vgpu_emulate_mmio_write.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"fail to emulate MMIO write %08x len %d\n"
	.text
	.p2align 4
	.globl	intel_vgpu_emulate_mmio_write
	.type	intel_vgpu_emulate_mmio_write, @function
intel_vgpu_emulate_mmio_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	cmp	QWORD PTR 8[rdi], 0
	jne	.L12
	mov	rax, QWORD PTR 16[rdi]
	mov	QWORD PTR 8[rsp], rax
	call	mutex_lock@PLT
	mov	rdi, r14
	mov	esi, ebp
	call	intel_vgpu_gpa_to_mmio_offset@PLT
	xor	edi, edi
	cmp	r13d, 8
	seta	dil
	mov	r15d, eax
	call	WARN_ON@PLT
	test	rax, rax
	je	.L13
.L4:
	mov	edx, r13d
	mov	esi, r15d
	lea	rdi, .LC0[rip]
	call	gvt_vgpu_err@PLT
.L7:
	mov	rdi, r14
	call	mutex_unlock@PLT
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	rdi, QWORD PTR 8[rsp]
	mov	esi, r15d
	call	reg_is_gtt@PLT
	test	rax, rax
	je	.L5
	mov	edi, r15d
	mov	esi, 4
	call	IS_ALIGNED@PLT
	xor	edi, edi
	test	eax, eax
	je	.L14
.L6:
	call	WARN_ON@PLT
	test	rax, rax
	jne	.L4
	lea	eax, -4[r13]
	xor	edi, edi
	and	eax, -5
	setne	dil
	call	WARN_ON@PLT
	test	rax, rax
	jne	.L4
	mov	rdi, QWORD PTR 8[rsp]
	lea	esi, -1[r15+r13]
	call	reg_is_gtt@PLT
	xor	edi, edi
	test	rax, rax
	sete	dil
	call	WARN_ON@PLT
	test	rax, rax
	jne	.L4
	mov	ecx, r13d
	mov	rdx, rbx
	mov	esi, r15d
	mov	rdi, r14
	call	intel_vgpu_emulate_ggtt_mmio_write@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L4
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	xor	r8d, r8d
	xor	r12d, r12d
	call	failsafe_emulate_mmio_rw@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rdi, QWORD PTR 8[rsp]
	mov	esi, r15d
	call	reg_is_mmio@PLT
	xor	edi, edi
	test	eax, eax
	sete	dil
	call	WARN_ON_ONCE@PLT
	test	rax, rax
	jne	.L15
	xor	r8d, r8d
	mov	ecx, r13d
	mov	rdx, rbx
	mov	esi, r15d
	mov	rdi, r14
	call	intel_vgpu_mmio_reg_rw@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L4
	mov	rdi, QWORD PTR 8[rsp]
	mov	esi, r15d
	xor	r12d, r12d
	call	intel_gvt_mmio_set_accessed@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L15:
	mov	ecx, r13d
	mov	rdx, rbx
	mov	esi, ebp
	mov	rdi, r14
	call	intel_gvt_hypervisor_write_gpa@PLT
	mov	r12d, eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L14:
	mov	edi, r15d
	mov	esi, 8
	call	IS_ALIGNED@PLT
	xor	edi, edi
	test	eax, eax
	sete	dil
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	intel_vgpu_emulate_mmio_write, .-intel_vgpu_emulate_mmio_write
	.comm	EINVAL,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_mmio.c_intel_vgpu_emulate_mmio_write.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"fail to emulate MMIO write %08x len %d\012\000"
	.text
	.align	2
	.global	intel_vgpu_emulate_mmio_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	intel_vgpu_emulate_mmio_write, %function
intel_vgpu_emulate_mmio_write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	ip, [r0, #4]
	ldr	lr, .L15
	cmp	ip, #0
	ldr	r5, [lr]
	sub	sp, sp, #12
	bne	.L11
	mov	r4, r0
	mov	r7, r1
	mov	r6, r3
	mov	r9, r2
	ldr	r10, [r0, #8]
	bl	mutex_lock
	mov	r1, r7
	mov	r0, r4
	bl	intel_vgpu_gpa_to_mmio_offset
	cmp	r6, #8
	mov	r8, r0
	movls	r0, #0
	movhi	r0, #1
	bl	WARN_ON
	subs	fp, r0, #0
	rsb	r5, r5, #0
	beq	.L12
.L4:
	mov	r2, r6
	mov	r1, r8
	ldr	r0, .L15+4
	bl	gvt_vgpu_err
.L7:
	mov	r0, r4
	bl	mutex_unlock
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	mov	r1, r8
	mov	r0, r10
	bl	reg_is_gtt
	cmp	r0, #0
	beq	.L5
	mov	r1, #4
	mov	r0, r8
	bl	IS_ALIGNED
	cmp	r0, #0
	beq	.L13
.L6:
	mov	r0, fp
	bl	WARN_ON
	cmp	r0, #0
	bne	.L4
	sub	r3, r6, #4
	bics	r3, r3, #4
	movne	r0, #1
	moveq	r0, #0
	bl	WARN_ON
	cmp	r0, #0
	bne	.L4
	sub	r1, r6, #1
	add	r1, r1, r8
	mov	r0, r10
	bl	reg_is_gtt
	clz	r0, r0
	lsr	r0, r0, #5
	bl	WARN_ON
	cmp	r0, #0
	bne	.L4
	mov	r2, r9
	mov	r3, r6
	mov	r1, r8
	mov	r0, r4
	bl	intel_vgpu_emulate_ggtt_mmio_write
	subs	r5, r0, #0
	bne	.L4
	b	.L7
.L11:
	mov	r5, #0
	str	r5, [sp]
	bl	failsafe_emulate_mmio_rw
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	mov	r1, r8
	mov	r0, r10
	bl	reg_is_mmio
	clz	r0, r0
	lsr	r0, r0, #5
	bl	WARN_ON_ONCE
	subs	fp, r0, #0
	bne	.L14
	mov	r2, r9
	mov	r3, r6
	mov	r1, r8
	mov	r0, r4
	str	fp, [sp]
	bl	intel_vgpu_mmio_reg_rw
	subs	r5, r0, #0
	blt	.L4
	mov	r1, r8
	mov	r0, r10
	bl	intel_gvt_mmio_set_accessed
	mov	r5, fp
	b	.L7
.L14:
	mov	r3, r6
	mov	r2, r9
	mov	r1, r7
	mov	r0, r4
	bl	intel_gvt_hypervisor_write_gpa
	mov	r5, r0
	b	.L7
.L13:
	mov	r1, #8
	mov	r0, r8
	bl	IS_ALIGNED
	clz	fp, r0
	lsr	fp, fp, #5
	b	.L6
.L16:
	.align	2
.L15:
	.word	EINVAL
	.word	.LC0
	.size	intel_vgpu_emulate_mmio_write, .-intel_vgpu_emulate_mmio_write
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
