All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio-balloon: Disable free page hinting/reporting if page poison is disabled
@ 2020-04-16 19:30 ` Alexander Duyck
  0 siblings, 0 replies; 54+ messages in thread
From: Alexander Duyck @ 2020-04-16 19:30 UTC (permalink / raw)
  To: jasowang, david, mst; +Cc: virtio-dev, virtualization

From: Alexander Duyck <alexander.h.duyck@linux.intel.com>

If we have free page hinting or page reporting enabled we should disable it
if the pages are poisoned or initialized on free and we cannot notify the
hypervisor.

Fixes: 5d757c8d518d ("virtio-balloon: add support for providing free page reports to host")

Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
---
 drivers/virtio/virtio_balloon.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 95d9c2f0a7be..08bc86a6e468 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -1110,8 +1110,12 @@ static int virtballoon_validate(struct virtio_device *vdev)
 	/* Tell the host whether we care about poisoned pages. */
 	if (!want_init_on_free() &&
 	    (IS_ENABLED(CONFIG_PAGE_POISONING_NO_SANITY) ||
-	     !page_poisoning_enabled()))
+	     !page_poisoning_enabled())) {
 		__virtio_clear_bit(vdev, VIRTIO_BALLOON_F_PAGE_POISON);
+	} else if (!virtio_has_feature(vdev, VIRTIO_BALLOON_F_PAGE_POISON)) {
+		__virtio_clear_bit(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT);
+		__virtio_clear_bit(vdev, VIRTIO_BALLOON_F_REPORTING);
+	}
 
 	__virtio_clear_bit(vdev, VIRTIO_F_IOMMU_PLATFORM);
 	return 0;

^ permalink raw reply related	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2020-04-22 15:50 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 19:30 [PATCH] virtio-balloon: Disable free page hinting/reporting if page poison is disabled Alexander Duyck
2020-04-16 19:30 ` [virtio-dev] " Alexander Duyck
2020-04-16 22:13 ` Michael S. Tsirkin
2020-04-16 22:13   ` [virtio-dev] " Michael S. Tsirkin
2020-04-16 23:52   ` Alexander Duyck
2020-04-16 23:52     ` [virtio-dev] " Alexander Duyck
2020-04-17  6:28     ` Michael S. Tsirkin
2020-04-17  6:28       ` [virtio-dev] " Michael S. Tsirkin
2020-04-17  7:49       ` David Hildenbrand
2020-04-17  7:49         ` David Hildenbrand
2020-04-17  8:50         ` Michael S. Tsirkin
2020-04-17  8:50           ` [virtio-dev] " Michael S. Tsirkin
2020-04-17  9:07           ` David Hildenbrand
2020-04-17  9:07             ` [virtio-dev] " David Hildenbrand
2020-04-17  9:21             ` Michael S. Tsirkin
2020-04-17  9:21               ` [virtio-dev] " Michael S. Tsirkin
2020-04-17  9:51               ` David Hildenbrand
2020-04-17  9:51                 ` [virtio-dev] " David Hildenbrand
2020-04-17  9:59                 ` Michael S. Tsirkin
2020-04-17  9:59                   ` [virtio-dev] " Michael S. Tsirkin
2020-04-17 10:09                   ` David Hildenbrand
2020-04-17 10:09                     ` [virtio-dev] " David Hildenbrand
2020-04-17 10:19                     ` Michael S. Tsirkin
2020-04-17 10:19                       ` Michael S. Tsirkin
2020-04-17 10:26                       ` David Hildenbrand
2020-04-17 10:26                         ` [virtio-dev] " David Hildenbrand
2020-04-17 10:29                         ` Michael S. Tsirkin
2020-04-17 10:29                           ` [virtio-dev] " Michael S. Tsirkin
2020-04-17 10:31                           ` David Hildenbrand
2020-04-17 10:31                             ` [virtio-dev] " David Hildenbrand
2020-04-17 11:02                             ` Michael S. Tsirkin
2020-04-17 11:02                               ` [virtio-dev] " Michael S. Tsirkin
2020-04-17 11:18                               ` David Hildenbrand
2020-04-17 11:18                                 ` [virtio-dev] " David Hildenbrand
2020-04-17 16:22                     ` Alexander Duyck
2020-04-17 16:22                       ` [virtio-dev] " Alexander Duyck
2020-04-20 13:28                       ` David Hildenbrand
2020-04-20 13:28                         ` [virtio-dev] " David Hildenbrand
2020-04-20 18:32                         ` Alexander Duyck
2020-04-20 18:32                           ` [virtio-dev] " Alexander Duyck
2020-04-21  7:29                           ` David Hildenbrand
2020-04-21  7:29                             ` [virtio-dev] " David Hildenbrand
2020-04-21 15:05                             ` Alexander Duyck
2020-04-21 15:05                               ` [virtio-dev] " Alexander Duyck
2020-04-21 15:18                               ` David Hildenbrand
2020-04-21 15:18                                 ` David Hildenbrand
2020-04-21 15:50                                 ` Alexander Duyck
2020-04-21 15:50                                   ` [virtio-dev] " Alexander Duyck
2020-04-22 10:24                                   ` David Hildenbrand
2020-04-22 10:24                                     ` [virtio-dev] " David Hildenbrand
2020-04-22 15:49                                     ` Alexander Duyck
2020-04-22 15:49                                       ` [virtio-dev] " Alexander Duyck
2020-04-17  7:46 ` David Hildenbrand
2020-04-17  7:46   ` [virtio-dev] " David Hildenbrand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.