projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
KVM: MMU: unnecessary NX state assignment
[platform/adaptation/renesas_rcar/renesas_kernel.git]
/
arch
/
x86
/
kvm
/
mmu.c
diff --git
a/arch/x86/kvm/mmu.c
b/arch/x86/kvm/mmu.c
index
224b02c
..
0a11468
100644
(file)
--- a/
arch/x86/kvm/mmu.c
+++ b/
arch/x86/kvm/mmu.c
@@
-1391,11
+1391,6
@@
struct kvm_mmu_pages {
unsigned int nr;
};
unsigned int nr;
};
-#define for_each_unsync_children(bitmap, idx) \
- for (idx = find_first_bit(bitmap, 512); \
- idx < 512; \
- idx = find_next_bit(bitmap, 512, idx+1))
-
static int mmu_pages_add(struct kvm_mmu_pages *pvec, struct kvm_mmu_page *sp,
int idx)
{
static int mmu_pages_add(struct kvm_mmu_pages *pvec, struct kvm_mmu_page *sp,
int idx)
{
@@
-1417,7
+1412,7
@@
static int __mmu_unsync_walk(struct kvm_mmu_page *sp,
{
int i, ret, nr_unsync_leaf = 0;
{
int i, ret, nr_unsync_leaf = 0;
- for_each_
unsync_children(sp->unsync_child_bitmap, i
) {
+ for_each_
set_bit(i, sp->unsync_child_bitmap, 512
) {
struct kvm_mmu_page *child;
u64 ent = sp->spt[i];
struct kvm_mmu_page *child;
u64 ent = sp->spt[i];
@@
-1803,6
+1798,7
@@
static void drop_large_spte(struct kvm_vcpu *vcpu, u64 *sptep)
{
if (is_large_pte(*sptep)) {
drop_spte(vcpu->kvm, sptep);
{
if (is_large_pte(*sptep)) {
drop_spte(vcpu->kvm, sptep);
+ --vcpu->kvm->stat.lpages;
kvm_flush_remote_tlbs(vcpu->kvm);
}
}
kvm_flush_remote_tlbs(vcpu->kvm);
}
}
@@
-3325,7
+3321,6
@@
static int init_kvm_tdp_mmu(struct kvm_vcpu *vcpu)
context->get_cr3 = get_cr3;
context->get_pdptr = kvm_pdptr_read;
context->inject_page_fault = kvm_inject_page_fault;
context->get_cr3 = get_cr3;
context->get_pdptr = kvm_pdptr_read;
context->inject_page_fault = kvm_inject_page_fault;
- context->nx = is_nx(vcpu);
if (!is_paging(vcpu)) {
context->nx = false;
if (!is_paging(vcpu)) {
context->nx = false;
@@
-3555,7
+3550,7
@@
static u64 mmu_pte_write_fetch_gpte(struct kvm_vcpu *vcpu, gpa_t *gpa,
* If we're seeing too many writes to a page, it may no longer be a page table,
* or we may be forking, in which case it is better to unmap the page.
*/
* If we're seeing too many writes to a page, it may no longer be a page table,
* or we may be forking, in which case it is better to unmap the page.
*/
-static bool detect_write_flooding(struct kvm_mmu_page *sp
, u64 *spte
)
+static bool detect_write_flooding(struct kvm_mmu_page *sp)
{
/*
* Skip write-flooding detected for the sp whose level is 1, because
{
/*
* Skip write-flooding detected for the sp whose level is 1, because
@@
-3664,10
+3659,8
@@
void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
mask.cr0_wp = mask.cr4_pae = mask.nxe = 1;
for_each_gfn_indirect_valid_sp(vcpu->kvm, sp, gfn, node) {
mask.cr0_wp = mask.cr4_pae = mask.nxe = 1;
for_each_gfn_indirect_valid_sp(vcpu->kvm, sp, gfn, node) {
- spte = get_written_sptes(sp, gpa, &npte);
-
if (detect_write_misaligned(sp, gpa, bytes) ||
if (detect_write_misaligned(sp, gpa, bytes) ||
- detect_write_flooding(sp
, spte
)) {
+ detect_write_flooding(sp)) {
zap_page |= !!kvm_mmu_prepare_zap_page(vcpu->kvm, sp,
&invalid_list);
++vcpu->kvm->stat.mmu_flooded;
zap_page |= !!kvm_mmu_prepare_zap_page(vcpu->kvm, sp,
&invalid_list);
++vcpu->kvm->stat.mmu_flooded;