[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0bce2df3-79ac-599b-19fa-8ebeaff23623@redhat.com>
Date: Thu, 24 Aug 2017 15:40:04 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Yu Zhang <yu.c.zhang@...ux.intel.com>, kvm@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, rkrcmar@...hat.com,
tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
xiaoguangrong@...cent.com, joro@...tes.org
Subject: Re: [PATCH v3 2/5] KVM: MMU: check guest CR3 reserved bits based on
its physical address width.
On 24/08/2017 14:27, Yu Zhang wrote:
> diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h
> index 3ed6192..67e7ec2 100644
> --- a/arch/x86/kvm/mmu.h
> +++ b/arch/x86/kvm/mmu.h
> @@ -48,6 +48,9 @@
>
> static inline u64 rsvd_bits(int s, int e)
> {
> + if (e < s)
> + return 0;
> +
> return ((1ULL << (e - s + 1)) - 1) << s;
> }
e = s - 1 is already supported; why do you need e <= s - 2?
Paolo
Powered by blists - more mailing lists