[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49CF60D8.1060305@redhat.com>
Date: Sun, 29 Mar 2009 14:51:52 +0300
From: Avi Kivity <avi@...hat.com>
To: Joerg Roedel <joerg.roedel@....com>
CC: Marcelo Tosatti <mtosatti@...hat.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/7] kvm mmu: enabling 1GB pages by extending backing_size
funtion
Joerg Roedel wrote:
> This patch enables support for 1GB pages in KVM by implementing
> the support in backing_size().
>
> @@ -490,18 +492,30 @@ static enum kvm_page_size host_page_size(struct kvm *kvm, gfn_t gfn)
> static enum kvm_page_size backing_size(struct kvm_vcpu *vcpu, gfn_t gfn)
> {
> struct kvm_memory_slot *slot;
> -
> - if (has_wrprotected_page(vcpu->kvm, gfn))
> - return KVM_PAGE_SIZE_4k;
> -
> - if (host_page_size(vcpu->kvm, gfn) < KVM_PAGE_SIZE_2M)
> - return KVM_PAGE_SIZE_4k;
> + enum kvm_page_size host_size, ret;
>
> slot = gfn_to_memslot(vcpu->kvm, gfn);
> if (slot && slot->dirty_bitmap)
> return KVM_PAGE_SIZE_4k;
>
> - return KVM_PAGE_SIZE_2M;
> + host_size = host_page_size(vcpu->kvm, gfn);
> +
> + switch (host_size) {
> + case KVM_PAGE_SIZE_1G:
> + if (!has_wrprotected_largepage(vcpu->kvm, gfn)) {
> + ret = KVM_PAGE_SIZE_1G;
> + break;
> + }
>
What if there's a wrprotected_page in there?
> + case KVM_PAGE_SIZE_2M:
> + if (!has_wrprotected_page(vcpu->kvm, gfn)) {
> + ret = KVM_PAGE_SIZE_2M;
> + break;
> + }
> + default:
> + ret = KVM_PAGE_SIZE_4k;
> + }
> +
> + return ret;
> }
>
> /*
>
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists