<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/virt, branch v5.15.2</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2021-07-27T14:48:45Z</updated>
<entry>
<title>virt: acrn: Do hcall_destroy_vm() before resource release</title>
<updated>2021-07-27T14:48:45Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-07-22T06:27:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4c4c1257b844ffe5d0933684e612f92c4b78e120'/>
<id>urn:sha1:4c4c1257b844ffe5d0933684e612f92c4b78e120</id>
<content type='text'>
The ACRN hypervisor has scenarios which could run a real-time guest VM.
The real-time guest VM occupies dedicated CPU cores, be assigned with
dedicated PCI devices. It can run without the Service VM after boot up.
hcall_destroy_vm() returns failure when a real-time guest VM refuses.
The clearing of flag ACRN_VM_FLAG_DESTROYED causes some kernel resource
double-freed in a later acrn_vm_destroy().

Do hcall_destroy_vm() before resource release to drop this chance to
destroy the VM if hypercall fails.

Fixes: 9c5137aedd11 ("virt: acrn: Introduce VM management interfaces")
Cc: stable &lt;stable@vger.kernel.org&gt;
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/20210722062736.15050-1-fei1.li@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nitro_enclaves: Set Bus Master for the NE PCI device</title>
<updated>2021-06-24T13:48:27Z</updated>
<author>
<name>Longpeng(Mike)</name>
<email>longpeng2@huawei.com</email>
</author>
<published>2021-06-21T00:40:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d874742f6a734c73c22235f9d56b8f10bcf17c5f'/>
<id>urn:sha1:d874742f6a734c73c22235f9d56b8f10bcf17c5f</id>
<content type='text'>
Enable Bus Master for the NE PCI device, according to the PCI spec
for submitting memory or I/O requests:

 Master Enable – Controls the ability of a PCI Express
  Endpoint to issue Memory and I/O Read/Write Requests, and
  the ability of a Root or Switch Port to forward Memory and
  I/O Read/Write Requests in the Upstream direction

Cc: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Cc: Alexandru Vasile &lt;lexnv@amazon.com&gt;
Cc: Alexandru Ciobotaru &lt;alcioa@amazon.com&gt;
Reviewed-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Signed-off-by: Longpeng(Mike) &lt;longpeng2@huawei.com&gt;
Link: https://lore.kernel.org/r/20210621004046.1419-1-longpeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nitro_enclaves: Fix stale file descriptors on failed usercopy</title>
<updated>2021-04-29T17:06:49Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@grsecurity.net</email>
</author>
<published>2021-04-29T16:59:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f1ce3986baa62cffc3c5be156994de87524bab99'/>
<id>urn:sha1:f1ce3986baa62cffc3c5be156994de87524bab99</id>
<content type='text'>
A failing usercopy of the slot uid will lead to a stale entry in the
file descriptor table as put_unused_fd() won't release it. This enables
userland to refer to a dangling 'file' object through that still valid
file descriptor, leading to all kinds of use-after-free exploitation
scenarios.

Exchanging put_unused_fd() for close_fd(), ksys_close() or alike won't
solve the underlying issue, as the file descriptor might have been
replaced in the meantime, e.g. via userland calling close() on it
(leading to a NULL pointer dereference in the error handling code as
'fget(enclave_fd)' will return a NULL pointer) or by dup2()'ing a
completely different file object to that very file descriptor, leading
to the same situation: a dangling file descriptor pointing to a freed
object -- just in this case to a file object of user's choosing.

Generally speaking, after the call to fd_install() the file descriptor
is live and userland is free to do whatever with it. We cannot rely on
it to still refer to our enclave object afterwards. In fact, by abusing
userfaultfd() userland can hit the condition without any racing and
abuse the error handling in the nitro code as it pleases.

To fix the above issues, defer the call to fd_install() until all
possible errors are handled. In this case it's just the usercopy, so do
it directly in ne_create_vm_ioctl() itself.

Signed-off-by: Mathias Krause &lt;minipli@grsecurity.net&gt;
Signed-off-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20210429165941.27020-2-andraprs@amazon.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Fix document of acrn_msi_inject()</title>
<updated>2021-03-24T07:26:30Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-03-11T01:52:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1c15b334ca34dd22a19e1c595908fc860523be64'/>
<id>urn:sha1:1c15b334ca34dd22a19e1c595908fc860523be64</id>
<content type='text'>
This fixes below build warning with extra build checks.

$ make W=1

../drivers/virt/acrn/vm.c:105: warning: expecting prototype for
acrn_inject_msi(). Prototype was for acrn_msi_inject() instead

Fixes: c7cf8d27244f ("virt: acrn: Introduce interrupt injection interfaces")
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210311015206.19715-1-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Correct type casting of argument of copy_from_user()</title>
<updated>2021-03-10T15:59:50Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-03-10T15:37:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1201d68f4781141411e734315f22457e6ea2cfcb'/>
<id>urn:sha1:1201d68f4781141411e734315f22457e6ea2cfcb</id>
<content type='text'>
hsm.c:336:50: warning: incorrect type in argument 2 (different address spaces)
hsm.c:336:50:    expected void const [noderef] __user *from
hsm.c:336:50:    got void *

This patch fixes above sparse warning.

Fixes: 3d679d5aec64 ("virt: acrn: Introduce interfaces to query C-states and P-states allowed by hypervisor")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210310153708.17451-1-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Use EPOLLIN instead of POLLIN</title>
<updated>2021-03-10T08:50:23Z</updated>
<author>
<name>Yejune Deng</name>
<email>yejune.deng@gmail.com</email>
</author>
<published>2021-03-10T07:49:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a758b7c4c6f21f8e117fc8097c56fd9967363c15'/>
<id>urn:sha1:a758b7c4c6f21f8e117fc8097c56fd9967363c15</id>
<content type='text'>
This fixes the following sparse warning:
"sparse warnings: (new ones prefixed by &gt;&gt;)"
&gt;&gt; drivers/virt/acrn/irqfd.c:163:13: sparse: sparse: restricted __poll_t
 degrades to integer

Fixes: dcf9625f2adf ("virt: acrn: Use vfs_poll() instead of f_op-&gt;poll()")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Acked-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Signed-off-by: Yejune Deng &lt;yejune.deng@gmail.com&gt;
Link: https://lore.kernel.org/r/20210310074901.7486-1-yejune.deng@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Use vfs_poll() instead of f_op-&gt;poll()</title>
<updated>2021-03-10T08:16:09Z</updated>
<author>
<name>Yejune Deng</name>
<email>yejune.deng@gmail.com</email>
</author>
<published>2021-02-21T13:33:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dcf9625f2adf33cf3ea14c72b436b7c212807e51'/>
<id>urn:sha1:dcf9625f2adf33cf3ea14c72b436b7c212807e51</id>
<content type='text'>
Use a more advanced function vfs_poll() in acrn_irqfd_assign().
At the same time, modify the definition of events.

Signed-off-by: Yejune Deng &lt;yejune.deng@gmail.com&gt;
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210221133306.33530-1-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Make remove_cpu sysfs invisible with !CONFIG_HOTPLUG_CPU</title>
<updated>2021-03-10T08:16:09Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-02-21T13:43:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e54b78886949e16301e8ac3cc4b2b43969bfe5fa'/>
<id>urn:sha1:e54b78886949e16301e8ac3cc4b2b43969bfe5fa</id>
<content type='text'>
Without cpu hotplug support, vCPU cannot be removed from a Service VM.
Don't expose remove_cpu sysfs when CONFIG_HOTPLUG_CPU disabled.

Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Qais Yousef &lt;qais.yousef@arm.com&gt;
Acked-by: Randy Dunlap &lt;rdunlap@infradead.org&gt; # build-tested
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210221134339.57851-2-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Introduce an interface for Service VM to control vCPU</title>
<updated>2021-02-09T09:58:19Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-02-07T03:10:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=279dcf693ac76c9d16b91ffc41280babaff26bb2'/>
<id>urn:sha1:279dcf693ac76c9d16b91ffc41280babaff26bb2</id>
<content type='text'>
ACRN supports partition mode to achieve real-time requirements. In
partition mode, a CPU core can be dedicated to a vCPU of User VM. The
local APIC of the dedicated CPU core can be passthrough to the User VM.
The Service VM controls the assignment of the CPU cores.

Introduce an interface for the Service VM to remove the control of CPU
core from hypervisor perspective so that the CPU core can be a dedicated
CPU core of User VM.

Cc: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Cc: Zhenyu Wang &lt;zhenyuw@linux.intel.com&gt;
Cc: Yu Wang &lt;yu1.wang@intel.com&gt;
Cc: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Reviewed-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210207031040.49576-18-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Introduce irqfd</title>
<updated>2021-02-09T09:58:19Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-02-07T03:10:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=aa3b483ff1d71c50b33db154048dff9a8f08ac71'/>
<id>urn:sha1:aa3b483ff1d71c50b33db154048dff9a8f08ac71</id>
<content type='text'>
irqfd is a mechanism to inject a specific interrupt to a User VM using a
decoupled eventfd mechanism.

Vhost is a kernel-level virtio server which uses eventfd for interrupt
injection. To support vhost on ACRN, irqfd is introduced in HSM.

HSM provides ioctls to associate a virtual Message Signaled Interrupt
(MSI) with an eventfd. The corresponding virtual MSI will be injected
into a User VM once the eventfd got signal.

Cc: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Cc: Zhenyu Wang &lt;zhenyuw@linux.intel.com&gt;
Cc: Yu Wang &lt;yu1.wang@intel.com&gt;
Cc: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Reviewed-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210207031040.49576-17-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
