Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1712670 > unrolled thread
| Started by | David Miller <davem@davemloft.net> |
|---|---|
| First post | 2017-08-16 07:00 +0200 |
| Last post | 2017-08-16 16:50 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity) David Miller <davem@davemloft.net> - 2017-08-16 07:00 +0200
Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity) Khalid Aziz <khalid.aziz@oracle.com> - 2017-08-16 16:50 +0200
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-08-16 07:00 +0200 |
| Subject | Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity) |
| Message-ID | <ueYAW-2vJ-21@gated-at.bofh.it> |
From: Khalid Aziz <khalid.aziz@oracle.com>
Date: Wed, 9 Aug 2017 15:26:02 -0600
> +void adi_restore_tags(struct mm_struct *mm, struct vm_area_struct *vma,
> + unsigned long addr, pte_t pte)
> +{
...
> + tag = tag_start(addr, tag_desc);
> + paddr = pte_val(pte) & _PAGE_PADDR_4V;
> + for (tmp = paddr; tmp < (paddr+PAGE_SIZE); tmp += adi_blksize()) {
> + version1 = (*tag) >> 4;
> + version2 = (*tag) & 0x0f;
> + *tag++ = 0;
> + asm volatile("stxa %0, [%1] %2\n\t"
> + :
> + : "r" (version1), "r" (tmp),
> + "i" (ASI_MCD_REAL));
> + tmp += adi_blksize();
> + asm volatile("stxa %0, [%1] %2\n\t"
> + :
> + : "r" (version2), "r" (tmp),
> + "i" (ASI_MCD_REAL));
> + }
> + asm volatile("membar #Sync\n\t");
You do a membar here.
> + for (i = pfrom; i < (pfrom + PAGE_SIZE); i += adi_blksize()) {
> + asm volatile("ldxa [%1] %2, %0\n\t"
> + : "=r" (adi_tag)
> + : "r" (i), "i" (ASI_MCD_REAL));
> + asm volatile("stxa %0, [%1] %2\n\t"
> + :
> + : "r" (adi_tag), "r" (pto),
> + "i" (ASI_MCD_REAL));
But not here.
Is this OK? I suspect you need to add a membar this this second piece
of MCD tag storing code.
[toc] | [next] | [standalone]
| From | Khalid Aziz <khalid.aziz@oracle.com> |
|---|---|
| Date | 2017-08-16 16:50 +0200 |
| Message-ID | <uf7NU-8hY-29@gated-at.bofh.it> |
| In reply to | #1712670 |
On 08/15/2017 10:58 PM, David Miller wrote:
> From: Khalid Aziz <khalid.aziz@oracle.com>
> Date: Wed, 9 Aug 2017 15:26:02 -0600
>
>> +void adi_restore_tags(struct mm_struct *mm, struct vm_area_struct *vma,
>> + unsigned long addr, pte_t pte)
>> +{
> ...
>> + tag = tag_start(addr, tag_desc);
>> + paddr = pte_val(pte) & _PAGE_PADDR_4V;
>> + for (tmp = paddr; tmp < (paddr+PAGE_SIZE); tmp += adi_blksize()) {
>> + version1 = (*tag) >> 4;
>> + version2 = (*tag) & 0x0f;
>> + *tag++ = 0;
>> + asm volatile("stxa %0, [%1] %2\n\t"
>> + :
>> + : "r" (version1), "r" (tmp),
>> + "i" (ASI_MCD_REAL));
>> + tmp += adi_blksize();
>> + asm volatile("stxa %0, [%1] %2\n\t"
>> + :
>> + : "r" (version2), "r" (tmp),
>> + "i" (ASI_MCD_REAL));
>> + }
>> + asm volatile("membar #Sync\n\t");
>
> You do a membar here.
>
>> + for (i = pfrom; i < (pfrom + PAGE_SIZE); i += adi_blksize()) {
>> + asm volatile("ldxa [%1] %2, %0\n\t"
>> + : "=r" (adi_tag)
>> + : "r" (i), "i" (ASI_MCD_REAL));
>> + asm volatile("stxa %0, [%1] %2\n\t"
>> + :
>> + : "r" (adi_tag), "r" (pto),
>> + "i" (ASI_MCD_REAL));
>
> But not here.
>
> Is this OK? I suspect you need to add a membar this this second piece
> of MCD tag storing code.
Hi Dave,
You are right. This tag storing code needs membar as well. I will add that.
Thanks,
Khalid
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web