All of lore.kernel.org
 help / color / mirror / Atom feed
From: m.smarduch@samsung.com (Mario Smarduch)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging
Date: Fri, 07 Nov 2014 12:49:21 -0800	[thread overview]
Message-ID: <545D3051.90800@samsung.com> (raw)
In-Reply-To: <20141107202022.GF22848@cbox>

On 11/07/2014 12:20 PM, Christoffer Dall wrote:
> On Thu, Oct 09, 2014 at 07:34:05PM -0700, Mario Smarduch wrote:
>> This patch introduces header updates for ARMv8 dirty page logging.
> 
> hm, header updates,
> 
> it introduces functions to write protect pages on arm64 and adds a
> prototype for blah blah blah.
> 
> Perhaps you can be just slightly more explanatory in your commit
> message.

Yep, my descriptions have been lacking :)
> 
>>
>> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
>> ---
>>  arch/arm64/include/asm/kvm_asm.h       |  1 +
>>  arch/arm64/include/asm/kvm_host.h      |  1 +
>>  arch/arm64/include/asm/kvm_mmu.h       | 20 ++++++++++++++++++++
>>  arch/arm64/include/asm/pgtable-hwdef.h |  1 +
>>  4 files changed, 23 insertions(+)
>>
>> diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h
>> index 9fcd54b..bb1a870 100644
>> --- a/arch/arm64/include/asm/kvm_asm.h
>> +++ b/arch/arm64/include/asm/kvm_asm.h
>> @@ -101,6 +101,7 @@ extern char __kvm_hyp_code_end[];
>>  
>>  extern void __kvm_flush_vm_context(void);
>>  extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
>> +extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
>>  
>>  extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
>>  #endif
>> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
>> index 92242ce..5714706 100644
>> --- a/arch/arm64/include/asm/kvm_host.h
>> +++ b/arch/arm64/include/asm/kvm_host.h
>> @@ -180,6 +180,7 @@ struct kvm_vcpu *kvm_arm_get_running_vcpu(void);
>>  struct kvm_vcpu __percpu **kvm_get_running_vcpus(void);
>>  
>>  u64 kvm_call_hyp(void *hypfn, ...);
>> +void kvm_mmu_wp_memory_region(struct kvm *kvm, int slot);
>>  
>>  int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
>>  		int exception_index);
>> diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
>> index 8e138c7..8b0ffe3 100644
>> --- a/arch/arm64/include/asm/kvm_mmu.h
>> +++ b/arch/arm64/include/asm/kvm_mmu.h
>> @@ -121,6 +121,26 @@ static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
>>  	pmd_val(*pmd) |= PMD_S2_RDWR;
>>  }
>>  
>> +static inline void kvm_set_s2pte_readonly(pte_t *pte)
>> +{
>> +	pte_val(*pte) = (pte_val(*pte) & ~PTE_S2_RDWR) | PTE_S2_RDONLY;
>> +}
>> +
>> +static inline bool kvm_s2pte_readonly(pte_t *pte)
>> +{
>> +	return (pte_val(*pte) & PTE_S2_RDWR) == PTE_S2_RDONLY;
>> +}
>> +
>> +static inline void kvm_set_s2pmd_readonly(pmd_t *pmd)
>> +{
>> +	pmd_val(*pmd) = (pmd_val(*pmd) & ~PMD_S2_RDWR) | PMD_S2_RDONLY;
>> +}
>> +
>> +static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
>> +{
>> +	return (pmd_val(*pmd) & PMD_S2_RDWR) == PMD_S2_RDONLY;
>> +}
>> +
>>  #define kvm_pgd_addr_end(addr, end)	pgd_addr_end(addr, end)
>>  #define kvm_pud_addr_end(addr, end)	pud_addr_end(addr, end)
>>  #define kvm_pmd_addr_end(addr, end)	pmd_addr_end(addr, end)
>> diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
>> index 955e8c5..21771f6 100644
>> --- a/arch/arm64/include/asm/pgtable-hwdef.h
>> +++ b/arch/arm64/include/asm/pgtable-hwdef.h
>> @@ -87,6 +87,7 @@
>>  #define PTE_S2_RDONLY		(_AT(pteval_t, 1) << 6)   /* HAP[2:1] */
>>  #define PTE_S2_RDWR		(_AT(pteval_t, 3) << 6)   /* HAP[2:1] */
>>  
>> +#define PMD_S2_RDONLY		(_AT(pmdval_t, 1) << 6)   /* HAP[2:1] */
>>  #define PMD_S2_RDWR		(_AT(pmdval_t, 3) << 6)   /* HAP[2:1] */
>>  
>>  /*
>> -- 
>> 1.9.1
>>
> I assume you'll provide a rebased version of these once you respin the
> ARM series, but this looks overall fine to me.

Yes defintelly.

Thanks.
> 
> -Christoffer
> 

WARNING: multiple messages have this Message-ID (diff)
From: Mario Smarduch <m.smarduch@samsung.com>
To: Christoffer Dall <christoffer.dall@linaro.org>
Cc: kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com,
	catalin.marinas@arm.com, pbonzini@redhat.com, gleb@kernel.org,
	kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging
Date: Fri, 07 Nov 2014 12:49:21 -0800	[thread overview]
Message-ID: <545D3051.90800@samsung.com> (raw)
In-Reply-To: <20141107202022.GF22848@cbox>

On 11/07/2014 12:20 PM, Christoffer Dall wrote:
> On Thu, Oct 09, 2014 at 07:34:05PM -0700, Mario Smarduch wrote:
>> This patch introduces header updates for ARMv8 dirty page logging.
> 
> hm, header updates,
> 
> it introduces functions to write protect pages on arm64 and adds a
> prototype for blah blah blah.
> 
> Perhaps you can be just slightly more explanatory in your commit
> message.

Yep, my descriptions have been lacking :)
> 
>>
>> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
>> ---
>>  arch/arm64/include/asm/kvm_asm.h       |  1 +
>>  arch/arm64/include/asm/kvm_host.h      |  1 +
>>  arch/arm64/include/asm/kvm_mmu.h       | 20 ++++++++++++++++++++
>>  arch/arm64/include/asm/pgtable-hwdef.h |  1 +
>>  4 files changed, 23 insertions(+)
>>
>> diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h
>> index 9fcd54b..bb1a870 100644
>> --- a/arch/arm64/include/asm/kvm_asm.h
>> +++ b/arch/arm64/include/asm/kvm_asm.h
>> @@ -101,6 +101,7 @@ extern char __kvm_hyp_code_end[];
>>  
>>  extern void __kvm_flush_vm_context(void);
>>  extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
>> +extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
>>  
>>  extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
>>  #endif
>> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
>> index 92242ce..5714706 100644
>> --- a/arch/arm64/include/asm/kvm_host.h
>> +++ b/arch/arm64/include/asm/kvm_host.h
>> @@ -180,6 +180,7 @@ struct kvm_vcpu *kvm_arm_get_running_vcpu(void);
>>  struct kvm_vcpu __percpu **kvm_get_running_vcpus(void);
>>  
>>  u64 kvm_call_hyp(void *hypfn, ...);
>> +void kvm_mmu_wp_memory_region(struct kvm *kvm, int slot);
>>  
>>  int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
>>  		int exception_index);
>> diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
>> index 8e138c7..8b0ffe3 100644
>> --- a/arch/arm64/include/asm/kvm_mmu.h
>> +++ b/arch/arm64/include/asm/kvm_mmu.h
>> @@ -121,6 +121,26 @@ static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
>>  	pmd_val(*pmd) |= PMD_S2_RDWR;
>>  }
>>  
>> +static inline void kvm_set_s2pte_readonly(pte_t *pte)
>> +{
>> +	pte_val(*pte) = (pte_val(*pte) & ~PTE_S2_RDWR) | PTE_S2_RDONLY;
>> +}
>> +
>> +static inline bool kvm_s2pte_readonly(pte_t *pte)
>> +{
>> +	return (pte_val(*pte) & PTE_S2_RDWR) == PTE_S2_RDONLY;
>> +}
>> +
>> +static inline void kvm_set_s2pmd_readonly(pmd_t *pmd)
>> +{
>> +	pmd_val(*pmd) = (pmd_val(*pmd) & ~PMD_S2_RDWR) | PMD_S2_RDONLY;
>> +}
>> +
>> +static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
>> +{
>> +	return (pmd_val(*pmd) & PMD_S2_RDWR) == PMD_S2_RDONLY;
>> +}
>> +
>>  #define kvm_pgd_addr_end(addr, end)	pgd_addr_end(addr, end)
>>  #define kvm_pud_addr_end(addr, end)	pud_addr_end(addr, end)
>>  #define kvm_pmd_addr_end(addr, end)	pmd_addr_end(addr, end)
>> diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
>> index 955e8c5..21771f6 100644
>> --- a/arch/arm64/include/asm/pgtable-hwdef.h
>> +++ b/arch/arm64/include/asm/pgtable-hwdef.h
>> @@ -87,6 +87,7 @@
>>  #define PTE_S2_RDONLY		(_AT(pteval_t, 1) << 6)   /* HAP[2:1] */
>>  #define PTE_S2_RDWR		(_AT(pteval_t, 3) << 6)   /* HAP[2:1] */
>>  
>> +#define PMD_S2_RDONLY		(_AT(pmdval_t, 1) << 6)   /* HAP[2:1] */
>>  #define PMD_S2_RDWR		(_AT(pmdval_t, 3) << 6)   /* HAP[2:1] */
>>  
>>  /*
>> -- 
>> 1.9.1
>>
> I assume you'll provide a rebased version of these once you respin the
> ARM series, but this looks overall fine to me.

Yes defintelly.

Thanks.
> 
> -Christoffer
> 


  reply	other threads:[~2014-11-07 20:49 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  2:34 [PATCH 0/3] arm/arm64: Add dirty page logging for ARMv8 Mario Smarduch
2014-10-10  2:34 ` Mario Smarduch
2014-10-10  2:34 ` [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging Mario Smarduch
2014-10-10  2:34   ` Mario Smarduch
2014-11-07 20:20   ` Christoffer Dall
2014-11-07 20:20     ` Christoffer Dall
2014-11-07 20:49     ` Mario Smarduch [this message]
2014-11-07 20:49       ` Mario Smarduch
2014-10-10  2:34 ` [PATCH 2/3] arm64: Add HYP interface to flush VM Stage 1/2 TLB entires Mario Smarduch
2014-10-10  2:34   ` Mario Smarduch
2014-11-07 20:20   ` Christoffer Dall
2014-11-07 20:20     ` Christoffer Dall
2014-11-07 20:50     ` Mario Smarduch
2014-11-07 20:50       ` Mario Smarduch
2014-10-10  2:34 ` [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code Mario Smarduch
2014-10-10  2:34   ` Mario Smarduch
2014-11-07 20:20   ` Christoffer Dall
2014-11-07 20:20     ` Christoffer Dall
2014-11-07 20:51     ` Mario Smarduch
2014-11-07 20:51       ` Mario Smarduch
2014-11-19 14:39       ` Christoffer Dall
2014-11-19 14:39         ` Christoffer Dall
2014-11-19 20:15         ` Mario Smarduch
2014-11-19 20:15           ` Mario Smarduch
2014-11-21 10:09           ` Christoffer Dall
2014-11-21 10:09             ` Christoffer Dall
2014-11-22  0:42             ` Mario Smarduch
2014-11-22  0:42               ` Mario Smarduch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=545D3051.90800@samsung.com \
    --to=m.smarduch@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.