Re: [PATCH 1/5] mmu: mark spte present if the x bit is set

2016-07-05 Thread Wanpeng Li
2016-07-05 18:50 GMT+08:00 Paolo Bonzini : > > > On 05/07/2016 05:06, Wanpeng Li wrote: >> 2016-06-29 4:49 GMT+08:00 Paolo Bonzini : >> [...] >>> >>> I think another way to write it is "(pte & 0xull) && >>> !is_mmio_spte(pte)", since non-present/non-MMIO SPTEs never use bits >> >> I misunde

Re: [PATCH 1/5] mmu: mark spte present if the x bit is set

2016-07-05 Thread Paolo Bonzini
On 05/07/2016 05:06, Wanpeng Li wrote: > 2016-06-29 4:49 GMT+08:00 Paolo Bonzini : > [...] >> >> I think another way to write it is "(pte & 0xull) && >> !is_mmio_spte(pte)", since non-present/non-MMIO SPTEs never use bits > > I misunderstand it here, this will also treat -W- EPT SPTEs as

Re: [PATCH 1/5] mmu: mark spte present if the x bit is set

2016-07-04 Thread Wanpeng Li
2016-06-29 4:49 GMT+08:00 Paolo Bonzini : [...] > > I think another way to write it is "(pte & 0xull) && > !is_mmio_spte(pte)", since non-present/non-MMIO SPTEs never use bits I misunderstand it here, this will also treat -W- EPT SPTEs as present, right? Regards, Wanpeng Li

Re: [PATCH 1/5] mmu: mark spte present if the x bit is set

2016-06-28 Thread Xiao Guangrong
On 06/29/2016 04:49 AM, Paolo Bonzini wrote: On 28/06/2016 22:37, Bandan Das wrote: Paolo Bonzini writes: On 28/06/2016 19:33, Bandan Das wrote: static int is_shadow_present_pte(u64 pte) { - return pte & PT_PRESENT_MASK && !is_mmio_spte(pte); + return pte & (PT_PRESENT_MA

Re: [PATCH 1/5] mmu: mark spte present if the x bit is set

2016-06-28 Thread Bandan Das
Paolo Bonzini writes: > On 28/06/2016 22:37, Bandan Das wrote: >> Paolo Bonzini writes: >> >>> On 28/06/2016 19:33, Bandan Das wrote: static int is_shadow_present_pte(u64 pte) { - return pte & PT_PRESENT_MASK && !is_mmio_spte(pte); + return pte &

Re: [PATCH 1/5] mmu: mark spte present if the x bit is set

2016-06-28 Thread Paolo Bonzini
On 28/06/2016 22:37, Bandan Das wrote: > Paolo Bonzini writes: > >> On 28/06/2016 19:33, Bandan Das wrote: >>> static int is_shadow_present_pte(u64 pte) >>> { >>> - return pte & PT_PRESENT_MASK && !is_mmio_spte(pte); >>> + return pte & (PT_PRESENT_MASK | shadow_x_m

Re: [PATCH 1/5] mmu: mark spte present if the x bit is set

2016-06-28 Thread Bandan Das
Paolo Bonzini writes: > On 28/06/2016 19:33, Bandan Das wrote: >> static int is_shadow_present_pte(u64 pte) >> { >> - return pte & PT_PRESENT_MASK && !is_mmio_spte(pte); >> + return pte & (PT_PRESENT_MASK | shadow_x_mask) && >> + !is_mmio_spte(

Re: [PATCH 1/5] mmu: mark spte present if the x bit is set

2016-06-28 Thread Paolo Bonzini
On 28/06/2016 19:33, Bandan Das wrote: >>> >> static int is_shadow_present_pte(u64 pte) >>> >> { >>> >> -return pte & PT_PRESENT_MASK && !is_mmio_spte(pte); >>> >> +return pte & (PT_PRESENT_MASK | shadow_x_mask) && >>> >> +!is_mmio_spte(pte); >> > >> > This shoul

Re: [PATCH 1/5] mmu: mark spte present if the x bit is set

2016-06-28 Thread Bandan Das
Paolo Bonzini writes: > On 28/06/2016 06:32, Bandan Das wrote: >> This is safe because is_shadow_present_pte() is called >> on host controlled page table and we know the spte is >> valid >> >> Signed-off-by: Bandan Das >> --- >> arch/x86/kvm/mmu.c | 3 ++- >> 1 file changed, 2 insertions(+), 1

Re: [PATCH 1/5] mmu: mark spte present if the x bit is set

2016-06-28 Thread Paolo Bonzini
On 28/06/2016 06:32, Bandan Das wrote: > This is safe because is_shadow_present_pte() is called > on host controlled page table and we know the spte is > valid > > Signed-off-by: Bandan Das > --- > arch/x86/kvm/mmu.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/a

[PATCH 1/5] mmu: mark spte present if the x bit is set

2016-06-27 Thread Bandan Das
This is safe because is_shadow_present_pte() is called on host controlled page table and we know the spte is valid Signed-off-by: Bandan Das --- arch/x86/kvm/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index def97b3..a50af79