From 86594e00804f681a8b9a4f12c624b3d93ab6f1e6 Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Fri, 1 Sep 2023 17:27:01 +0800 Subject: [PATCH] vsock: diable VIRTIO_F_ACCESS_PLATFORM feature Currently, we don't support VIRTIO_F_ACCESS_PLATFORM feature. So, disable it. Signed-off-by: Yan Wang (cherry picked from commit 4b462a75f5e6a912880b039479df51c9f01fed66) --- stratovirt.spec | 6 ++- ...ble-VIRTIO_F_ACCESS_PLATFORM-feature.patch | 42 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 vsock-diable-VIRTIO_F_ACCESS_PLATFORM-feature.patch diff --git a/stratovirt.spec b/stratovirt.spec index 18372a6..b570652 100644 --- a/stratovirt.spec +++ b/stratovirt.spec @@ -6,7 +6,7 @@ Name: stratovirt Version: 2.2.0 -Release: 13 +Release: 14 Summary: StratoVirt is an opensource VMM(Virtual Machine Manager) which aims to perform next generation virtualization. License: MulanPSL-2.0 @@ -17,6 +17,7 @@ Source0: https://gitee.com/openeuler/stratovirt/releases/download/v%{vers ExclusiveArch: x86_64 aarch64 Patch001: util-byte_code-Fix-UT-failure-under-high-version-rus.patch +Patch002: vsock-diable-VIRTIO_F_ACCESS_PLATFORM-feature.patch Requires: pixman Requires: pixman-devel @@ -109,6 +110,9 @@ install -D -m555 ./target/%{rust_musl_target}/release/stratovirt %{buildroot}%{_ install -D -m555 ./target/%{rust_musl_target}/release/vhost_user_fs %{buildroot}%{_libdir}/stratovirt/static %changelog +* Fri Sep 1 2023 Yan Wang - 2.2.0-14 +- Diable VIRTIO_F_ACCESS_PLATFORM feature in vsock + * Sat Mar 11 2023 liuxiangdong - 2.2.0-13 - add -static-pie for musl diff --git a/vsock-diable-VIRTIO_F_ACCESS_PLATFORM-feature.patch b/vsock-diable-VIRTIO_F_ACCESS_PLATFORM-feature.patch new file mode 100644 index 0000000..1d3a9f1 --- /dev/null +++ b/vsock-diable-VIRTIO_F_ACCESS_PLATFORM-feature.patch @@ -0,0 +1,42 @@ +From 7e8d64b3c21f606dd0b030f324b098444d489bc3 Mon Sep 17 00:00:00 2001 +From: Yan Wang +Date: Fri, 1 Sep 2023 17:19:26 +0800 +Subject: [PATCH] vsock: diable VIRTIO_F_ACCESS_PLATFORM feature + +Currently, we don't support VIRTIO_F_ACCESS_PLATFORM feature. +So, disable it. + +Signed-off-by: Yan Wang +--- + virtio/src/vhost/kernel/vsock.rs | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/virtio/src/vhost/kernel/vsock.rs b/virtio/src/vhost/kernel/vsock.rs +index 17bc342..2b05fd0 100644 +--- a/virtio/src/vhost/kernel/vsock.rs ++++ b/virtio/src/vhost/kernel/vsock.rs +@@ -30,7 +30,8 @@ use crate::VirtioError; + use anyhow::{anyhow, bail, Context, Result}; + + use super::super::super::{ +- Queue, VirtioDevice, VirtioInterrupt, VirtioInterruptType, VIRTIO_TYPE_VSOCK, ++ Queue, VirtioDevice, VirtioInterrupt, VirtioInterruptType, VIRTIO_F_ACCESS_PLATFORM, ++ VIRTIO_TYPE_VSOCK, + }; + use super::super::{VhostNotify, VhostOps}; + use super::{VhostBackend, VhostIoHandler, VHOST_VSOCK_SET_GUEST_CID, VHOST_VSOCK_SET_RUNNING}; +@@ -174,9 +175,10 @@ impl VirtioDevice for Vsock { + backend + .set_owner() + .with_context(|| "Failed to set owner for vsock")?; +- self.state.device_features = backend ++ let features = backend + .get_features() + .with_context(|| "Failed to get features for vsock")?; ++ self.state.device_features = features & !(1_u64 << VIRTIO_F_ACCESS_PLATFORM); + self.backend = Some(backend); + + Ok(()) +-- +2.34.1 +