<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/virt/nitro_enclaves, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/virt/nitro_enclaves?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/virt/nitro_enclaves?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-01-03T12:44:38Z</updated>
<entry>
<title>Merge 5.16-rc8 into char-misc-next</title>
<updated>2022-01-03T12:44:38Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2022-01-03T12:44:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=824adf37ee9ddf3ecba1bc245507bc5953dda268'/>
<id>urn:sha1:824adf37ee9ddf3ecba1bc245507bc5953dda268</id>
<content type='text'>
We need the fixes in here as well for testing.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nitro_enclaves: Use get_user_pages_unlocked() call to handle mmap assert</title>
<updated>2021-12-21T10:08:19Z</updated>
<author>
<name>Andra Paraschiv</name>
<email>andraprs@amazon.com</email>
</author>
<published>2021-12-20T19:58:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=3a0152b219523227c2a62a0a122cf99608287176'/>
<id>urn:sha1:3a0152b219523227c2a62a0a122cf99608287176</id>
<content type='text'>
After commit 5b78ed24e8ec ("mm/pagemap: add mmap_assert_locked()
annotations to find_vma*()"), the call to get_user_pages() will trigger
the mmap assert.

static inline void mmap_assert_locked(struct mm_struct *mm)
{
	lockdep_assert_held(&amp;mm-&gt;mmap_lock);
	VM_BUG_ON_MM(!rwsem_is_locked(&amp;mm-&gt;mmap_lock), mm);
}

[   62.521410] kernel BUG at include/linux/mmap_lock.h:156!
...........................................................
[   62.538938] RIP: 0010:find_vma+0x32/0x80
...........................................................
[   62.605889] Call Trace:
[   62.608502]  &lt;TASK&gt;
[   62.610956]  ? lock_timer_base+0x61/0x80
[   62.614106]  find_extend_vma+0x19/0x80
[   62.617195]  __get_user_pages+0x9b/0x6a0
[   62.620356]  __gup_longterm_locked+0x42d/0x450
[   62.623721]  ? finish_wait+0x41/0x80
[   62.626748]  ? __kmalloc+0x178/0x2f0
[   62.629768]  ne_set_user_memory_region_ioctl.isra.0+0x225/0x6a0 [nitro_enclaves]
[   62.635776]  ne_enclave_ioctl+0x1cf/0x6d7 [nitro_enclaves]
[   62.639541]  __x64_sys_ioctl+0x82/0xb0
[   62.642620]  do_syscall_64+0x3b/0x90
[   62.645642]  entry_SYSCALL_64_after_hwframe+0x44/0xae

Use get_user_pages_unlocked() when setting the enclave memory regions.
That's a similar pattern as mmap_read_lock() used together with
get_user_pages().

Fixes: 5b78ed24e8ec ("mm/pagemap: add mmap_assert_locked() annotations to find_vma*()")
Cc: stable@vger.kernel.org
Signed-off-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Link: https://lore.kernel.org/r/20211220195856.6549-1-andraprs@amazon.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nitro_enclaves: Add KUnit tests for contiguous physical memory regions merging</title>
<updated>2021-11-17T15:11:09Z</updated>
<author>
<name>Longpeng</name>
<email>longpeng2@huawei.com</email>
</author>
<published>2021-11-07T14:09:17Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=fbf3443f77503f68f244cd7afa050c19ac78511c'/>
<id>urn:sha1:fbf3443f77503f68f244cd7afa050c19ac78511c</id>
<content type='text'>
Add KUnit tests for the contiguous physical memory regions merging
functionality from the Nitro Enclaves misc device logic.

We can build the test binary with the following configuration:
  CONFIG_KUNIT=y
  CONFIG_NITRO_ENCLAVES=m
  CONFIG_NITRO_ENCLAVES_MISC_DEV_TEST=y
and install the nitro_enclaves module to run the testcases.

We'll see the following message using dmesg if everything goes well:

[...]     # Subtest: ne_misc_dev_test
[...]     1..1
[...] (NULL device *): Physical mem region address is not 2 MiB aligned
[...] (NULL device *): Physical mem region size is not multiple of 2 MiB
[...] (NULL device *): Physical mem region address is not 2 MiB aligned
[...]     ok 1 - ne_misc_dev_test_merge_phys_contig_memory_regions
[...] ok 1 - ne_misc_dev_test

Reviewed-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Signed-off-by: Longpeng &lt;longpeng2@huawei.com&gt;
Link: https://lore.kernel.org/r/20211107140918.2106-5-longpeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nitro_enclaves: Add KUnit tests setup for the misc device functionality</title>
<updated>2021-11-17T15:11:09Z</updated>
<author>
<name>Longpeng</name>
<email>longpeng2@huawei.com</email>
</author>
<published>2021-11-07T14:09:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=07503b3c1e13fdeb66d4531c5dcba335eed9602a'/>
<id>urn:sha1:07503b3c1e13fdeb66d4531c5dcba335eed9602a</id>
<content type='text'>
Add the initial setup for the KUnit tests that will target the Nitro
Enclaves misc device functionality.

Reviewed-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Signed-off-by: Longpeng &lt;longpeng2@huawei.com&gt;
Link: https://lore.kernel.org/r/20211107140918.2106-4-longpeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nitro_enclaves: Sanity check physical memory regions during merging</title>
<updated>2021-11-17T15:11:09Z</updated>
<author>
<name>Longpeng</name>
<email>longpeng2@huawei.com</email>
</author>
<published>2021-11-07T14:09:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=090ce7831d340e8be92e5f2a90617cca6e92156e'/>
<id>urn:sha1:090ce7831d340e8be92e5f2a90617cca6e92156e</id>
<content type='text'>
Sanity check the physical memory regions during the merge of contiguous
regions. Thus we can test the physical memory regions setup logic
individually, including the error cases coming from the sanity checks.

Reviewed-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Signed-off-by: Longpeng &lt;longpeng2@huawei.com&gt;
Link: https://lore.kernel.org/r/20211107140918.2106-3-longpeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nitro_enclaves: Merge contiguous physical memory regions</title>
<updated>2021-11-17T15:11:09Z</updated>
<author>
<name>Longpeng</name>
<email>longpeng2@huawei.com</email>
</author>
<published>2021-11-07T14:09:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f6bdc0aafe88cf4c727e7bb00da1f480ecd80bee'/>
<id>urn:sha1:f6bdc0aafe88cf4c727e7bb00da1f480ecd80bee</id>
<content type='text'>
There can be cases when there are more memory regions that need to be
set for an enclave than the maximum supported number of memory regions
per enclave. One example can be when the memory regions are backed by 2
MiB hugepages (the minimum supported hugepage size).

Let's merge the adjacent regions if they are physically contiguous. This
way the final number of memory regions is less than before merging and
could potentially avoid reaching maximum.

Reviewed-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Signed-off-by: Longpeng &lt;longpeng2@huawei.com&gt;
Link: https://lore.kernel.org/r/20211107140918.2106-2-longpeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nitro_enclaves: Remove redundant 'flush_workqueue()' calls</title>
<updated>2021-11-17T15:10:26Z</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2021-11-12T17:09:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=dc74e8cf2324ad61b050a55ec0ffa9db6f4fce33'/>
<id>urn:sha1:dc74e8cf2324ad61b050a55ec0ffa9db6f4fce33</id>
<content type='text'>
'destroy_workqueue()' already drains the queue before destroying it, so
there is no need to flush it explicitly.

Remove the redundant 'flush_workqueue()' calls.

This was generated with coccinelle:

@@
expression E;
@@
- 	flush_workqueue(E);
	destroy_workqueue(E);

Reviewed-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Link: https://lore.kernel.org/r/d57f5c7e362837a8dfcde0d726a76b56f114e619.1636736947.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nitro_enclaves: Add fixes for checkpatch match open parenthesis reports</title>
<updated>2021-09-14T09:11:20Z</updated>
<author>
<name>Andra Paraschiv</name>
<email>andraprs@amazon.com</email>
</author>
<published>2021-08-27T15:49:28Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=02bba596de19c0b951b2843ebcd7a9da6e0938d4'/>
<id>urn:sha1:02bba596de19c0b951b2843ebcd7a9da6e0938d4</id>
<content type='text'>
Update the codebase formatting to fix the reports from the checkpatch
script, to match the open parenthesis.

Reviewed-by: George-Aurelian Popescu &lt;popegeo@amazon.com&gt;
Signed-off-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Link: https://lore.kernel.org/r/20210827154930.40608-6-andraprs@amazon.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nitro_enclaves: Update copyright statement to include 2021</title>
<updated>2021-09-14T09:11:20Z</updated>
<author>
<name>Andra Paraschiv</name>
<email>andraprs@amazon.com</email>
</author>
<published>2021-08-27T15:49:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e3cba4d2454c2e4034147ca53b75c6592ded7c5a'/>
<id>urn:sha1:e3cba4d2454c2e4034147ca53b75c6592ded7c5a</id>
<content type='text'>
Update the copyright statement to include 2021, as a change has been
made over this year.

Check commit d874742f6a73 ("nitro_enclaves: Set Bus Master for the NE
PCI device") for the codebase update from this file (ne_pci_dev.c).

Reviewed-by: George-Aurelian Popescu &lt;popegeo@amazon.com&gt;
Signed-off-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Link: https://lore.kernel.org/r/20210827154930.40608-5-andraprs@amazon.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nitro_enclaves: Add fix for the kernel-doc report</title>
<updated>2021-09-14T09:11:20Z</updated>
<author>
<name>Andra Paraschiv</name>
<email>andraprs@amazon.com</email>
</author>
<published>2021-08-27T15:49:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e16a30a419c89d71e68f4da348b48918944fd49c'/>
<id>urn:sha1:e16a30a419c89d71e68f4da348b48918944fd49c</id>
<content type='text'>
Fix the reported issue from the kernel-doc script, to have a comment per
identifier.

Reviewed-by: George-Aurelian Popescu &lt;popegeo@amazon.com&gt;
Signed-off-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Link: https://lore.kernel.org/r/20210827154930.40608-4-andraprs@amazon.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
