Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3d63ef4d
Commit
3d63ef4d
authored
Apr 13, 2021
by
Marc Zyngier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'kvm-arm64/memslot-fixes' into kvmarm-master/next
Signed-off-by:
Marc Zyngier
<
maz@kernel.org
>
parents
ac5ce245
10ba2d17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
arch/arm64/include/asm/kvm_host.h
arch/arm64/include/asm/kvm_host.h
+0
-1
arch/arm64/kvm/mmu.c
arch/arm64/kvm/mmu.c
+14
-7
No files found.
arch/arm64/include/asm/kvm_host.h
View file @
3d63ef4d
...
...
@@ -644,7 +644,6 @@ void kvm_arm_resume_guest(struct kvm *kvm);
#endif
/* __KVM_NVHE_HYPERVISOR__ */
void
force_vm_exit
(
const
cpumask_t
*
mask
);
void
kvm_mmu_wp_memory_region
(
struct
kvm
*
kvm
,
int
slot
);
int
handle_exit
(
struct
kvm_vcpu
*
vcpu
,
int
exception_index
);
void
handle_exit_early
(
struct
kvm_vcpu
*
vcpu
,
int
exception_index
);
...
...
arch/arm64/kvm/mmu.c
View file @
3d63ef4d
...
...
@@ -504,10 +504,11 @@ static void stage2_unmap_memslot(struct kvm *kvm,
* +--------------------------------------------+
*/
do
{
struct
vm_area_struct
*
vma
=
find_vma
(
current
->
mm
,
hva
)
;
struct
vm_area_struct
*
vma
;
hva_t
vm_start
,
vm_end
;
if
(
!
vma
||
vma
->
vm_start
>=
reg_end
)
vma
=
find_vma_intersection
(
current
->
mm
,
hva
,
reg_end
);
if
(
!
vma
)
break
;
/*
...
...
@@ -638,7 +639,7 @@ static void stage2_wp_range(struct kvm_s2_mmu *mmu, phys_addr_t addr, phys_addr_
* Acquires kvm_mmu_lock. Called with kvm->slots_lock mutex acquired,
* serializing operations for VM memory regions.
*/
void
kvm_mmu_wp_memory_region
(
struct
kvm
*
kvm
,
int
slot
)
static
void
kvm_mmu_wp_memory_region
(
struct
kvm
*
kvm
,
int
slot
)
{
struct
kvm_memslots
*
slots
=
kvm_memslots
(
kvm
);
struct
kvm_memory_slot
*
memslot
=
id_to_memslot
(
slots
,
slot
);
...
...
@@ -925,10 +926,15 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
* unmapped afterwards, the call to kvm_unmap_hva will take it away
* from us again properly. This smp_rmb() interacts with the smp_wmb()
* in kvm_mmu_notifier_invalidate_<page|range_end>.
*
* Besides, __gfn_to_pfn_memslot() instead of gfn_to_pfn_prot() is
* used to avoid unnecessary overhead introduced to locate the memory
* slot because it's always fixed even @gfn is adjusted for huge pages.
*/
smp_rmb
();
pfn
=
gfn_to_pfn_prot
(
kvm
,
gfn
,
write_fault
,
&
writable
);
pfn
=
__gfn_to_pfn_memslot
(
memslot
,
gfn
,
false
,
NULL
,
write_fault
,
&
writable
,
NULL
);
if
(
pfn
==
KVM_PFN_ERR_HWPOISON
)
{
kvm_send_hwpoison_signal
(
hva
,
vma_shift
);
return
0
;
...
...
@@ -994,7 +1000,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
/* Mark the page dirty only if the fault is handled successfully */
if
(
writable
&&
!
ret
)
{
kvm_set_pfn_dirty
(
pfn
);
mark_page_dirty
(
kvm
,
gfn
);
mark_page_dirty
_in_slot
(
kvm
,
memslot
,
gfn
);
}
out_unlock:
...
...
@@ -1424,10 +1430,11 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
* +--------------------------------------------+
*/
do
{
struct
vm_area_struct
*
vma
=
find_vma
(
current
->
mm
,
hva
)
;
struct
vm_area_struct
*
vma
;
hva_t
vm_start
,
vm_end
;
if
(
!
vma
||
vma
->
vm_start
>=
reg_end
)
vma
=
find_vma_intersection
(
current
->
mm
,
hva
,
reg_end
);
if
(
!
vma
)
break
;
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment