<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/virt, branch v5.17.1</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.17.1</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.17.1'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-01-23T04:20:44Z</updated>
<entry>
<title>Merge tag 'bitmap-5.17-rc1' of git://github.com/norov/linux</title>
<updated>2022-01-23T04:20:44Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-01-23T04:20:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3689f9f8b0c52dfd8f5995e4b58917f8f3ac3ee3'/>
<id>urn:sha1:3689f9f8b0c52dfd8f5995e4b58917f8f3ac3ee3</id>
<content type='text'>
Pull bitmap updates from Yury Norov:

 - introduce for_each_set_bitrange()

 - use find_first_*_bit() instead of find_next_*_bit() where possible

 - unify for_each_bit() macros

* tag 'bitmap-5.17-rc1' of git://github.com/norov/linux:
  vsprintf: rework bitmap_list_string
  lib: bitmap: add performance test for bitmap_print_to_pagebuf
  bitmap: unify find_bit operations
  mm/percpu: micro-optimize pcpu_is_populated()
  Replace for_each_*_bit_from() with for_each_*_bit() where appropriate
  find: micro-optimize for_each_{set,clear}_bit()
  include/linux: move for_each_bit() macros from bitops.h to find.h
  cpumask: replace cpumask_next_* with cpumask_first_* where appropriate
  tools: sync tools/bitmap with mother linux
  all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate
  cpumask: use find_first_and_bit()
  lib: add find_first_and_bit()
  arch: remove GENERIC_FIND_FIRST_BIT entirely
  include: move find.h from asm_generic to linux
  bitops: move find_bit_*_le functions from le.h to find.h
  bitops: protect find_first_{,zero}_bit properly
</content>
</entry>
<entry>
<title>all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate</title>
<updated>2022-01-15T16:47:31Z</updated>
<author>
<name>Yury Norov</name>
<email>yury.norov@gmail.com</email>
</author>
<published>2021-08-14T21:17:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b5c7e7ec7d3418af2544452b45cc67297c857a86'/>
<id>urn:sha1:b5c7e7ec7d3418af2544452b45cc67297c857a86</id>
<content type='text'>
find_first{,_zero}_bit is a more effective analogue of 'next' version if
start == 0. This patch replaces 'next' with 'first' where things look
trivial.

Signed-off-by: Yury Norov &lt;yury.norov@gmail.com&gt;
Tested-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
</content>
</entry>
<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.stealer.net/cgit.cgi/user/sven/linux.git/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.stealer.net/cgit.cgi/user/sven/linux.git/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.stealer.net/cgit.cgi/user/sven/linux.git/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.stealer.net/cgit.cgi/user/sven/linux.git/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.stealer.net/cgit.cgi/user/sven/linux.git/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.stealer.net/cgit.cgi/user/sven/linux.git/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.stealer.net/cgit.cgi/user/sven/linux.git/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>virt: acrn: Introduce interfaces for virtual device creating/destroying</title>
<updated>2021-10-05T14:14:10Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-09-23T08:41:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=424f1ac2d832f31a2814c799bd50decf6a9f8e74'/>
<id>urn:sha1:424f1ac2d832f31a2814c799bd50decf6a9f8e74</id>
<content type='text'>
The ACRN hypervisor can emulate a virtual device within hypervisor for a
Guest VM. The emulated virtual device can work without the ACRN
userspace after creation. The hypervisor do the emulation of that device.

To support the virtual device creating/destroying, HSM provides the
following ioctls:
  - ACRN_IOCTL_CREATE_VDEV
    Pass data struct acrn_vdev from userspace to the hypervisor, and inform
    the hypervisor to create a virtual device for a User VM.
  - ACRN_IOCTL_DESTROY_VDEV
    Pass data struct acrn_vdev from userspace to the hypervisor, and inform
    the hypervisor to destroy a virtual device of a User VM.

These new APIs will be used by user space code vm_add_hv_vdev and
vm_remove_hv_vdev in
https://github.com/projectacrn/acrn-hypervisor/blob/master/devicemodel/core/vmmapi.c

Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Signed-off-by: Fei Li &lt;fei1.li@intel.com&gt;
Link: https://lore.kernel.org/r/20210923084128.18902-3-fei1.li@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
