On Fri, Jun 08, 2018 at 05:49:26AM +0300, Michael S. Tsirkin wrote: > On Fri, Jun 08, 2018 at 10:34:25AM +0800, Peter Xu wrote: > > On Fri, Jun 08, 2018 at 04:58:21AM +0300, Michael S. Tsirkin wrote: > > > On Fri, Jun 08, 2018 at 09:37:23AM +0800, Peter Xu wrote: > > > > > > Asked since I see this in virtio spec (v1.0, though I guess it won't > > > > > > change) in chapter "2.2.1 Driver Requirements: Feature Bits": > > > > > > > > > > > > "The driver MUST NOT accept a feature which the device did not > > > > > > offer" > > > > > > > > > > > > Then I'm curious what would happen if: > > > > > > > > > > > > - a emulator (not QEMU) only offered F_FREE_PAGE_HINT, not F_POISON > > > > > > - a guest that enabled PAGE_POISON > > > > > > > > > > > > Then how the driver could tell the host that PAGE_POISON is enabled > > > > > > considering that guest should never set that feature bit if the > > > > > > emulation code didn't provide it? > > > > > > It wouldn't. It just has to deal with the fact that host can discard > > > writes to hinted pages. Right now driver deals with it simply by > > > disabling F_FREE_PAGE_HINT. > > > > Ah I see. Thanks Michael. > > > > Then it seems to me that it's more important to implement the F_POISON > > along with where it is declared since otherwise it'll be a real broken > > (device declares F_POISON, guest assumes it can handle the POISON so > > guest will enable FREE_PAGE_HINT, however the device can't really > > handle that). > > It seems to handle it fine, it just ignores the hints.
Ok I misunderstood. Then that's fine. The message in the commit message is a bit misleading: "TODO: - handle the case when page poisoning is in use" It seems to me that: "Now we handle the page poisoning by dropping the page hints directly. In the future we might do something better." Regards, -- Peter Xu