Re: [Qemu-devel] [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net
On 6/11/2018 7:17 PM, Michael S. Tsirkin wrote: On Tue, Jun 12, 2018 at 09:54:44AM +0800, Jason Wang wrote: On 2018年06月12日 01:26, Michael S. Tsirkin wrote: On Mon, May 07, 2018 at 04:09:54PM -0700, Sridhar Samudrala wrote: This feature bit can be used by hypervisor to indicate virtio_net device to act as a standby for another device with the same MAC address. I tested this with a small change to the patch to mark the STANDBY feature 'true' by default as i am using libvirt to start the VMs. Is there a way to pass the newly added feature bit 'standby' to qemu via libvirt XML file? Signed-off-by: Sridhar Samudrala So I do not think we can commit to this interface: we really need to control visibility of the primary device. The problem is legacy guest won't use primary device at all if we do this. And that's by design - I think it's the only way to ensure the legacy guest isn't confused. Yes. I think so. But i am not sure if Qemu is the right place to control the visibility of the primary device. The primary device may not be specified as an argument to Qemu. It may be plugged in later. The cloud service provider is providing a feature that enables low latency datapath and live migration capability. A tenant can use this feature only if he is running a VM that has virtio-net with failover support. I think Qemu should check if guest virtio-net supports this feature and provide a mechanism for an upper layer indicating if the STANDBY feature is successfully negotiated or not. The upper layer can then decide if it should hot plug a VF with the same MAC and manage the 2 links. If VF is successfully hot plugged, virtio-net link should be disabled. How about control the visibility of standby device? Thanks standy the always there to guarantee no downtime. However just for testing purposes, we could add a non-stable interface "x-standby" with the understanding that as any x- prefix it's unstable and will be changed down the road, likely in the next release. --- hw/net/virtio-net.c | 2 ++ include/standard-headers/linux/virtio_net.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 90502fca7c..38b3140670 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -2198,6 +2198,8 @@ static Property virtio_net_properties[] = { true), DEFINE_PROP_INT32("speed", VirtIONet, net_conf.speed, SPEED_UNKNOWN), DEFINE_PROP_STRING("duplex", VirtIONet, net_conf.duplex_str), +DEFINE_PROP_BIT64("standby", VirtIONet, host_features, VIRTIO_NET_F_STANDBY, + false), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/standard-headers/linux/virtio_net.h b/include/standard-headers/linux/virtio_net.h index e9f255ea3f..01ec09684c 100644 --- a/include/standard-headers/linux/virtio_net.h +++ b/include/standard-headers/linux/virtio_net.h @@ -57,6 +57,9 @@ * Steering */ #define VIRTIO_NET_F_CTRL_MAC_ADDR 23/* Set MAC address */ +#define VIRTIO_NET_F_STANDBY 62/* Act as standby for another device + * with the same MAC. + */ #define VIRTIO_NET_F_SPEED_DUPLEX 63 /* Device set linkspeed and duplex */ #ifndef VIRTIO_NET_NO_LEGACY -- 2.14.3 ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH 1/2] Convert target drivers to use sbitmap
On Mon, Jun 11, 2018 at 07:18:55PM -0600, Jens Axboe wrote: > Are you going to push this further? I really think we should. Yes, I'll resubmit it tomorrow. Sorry for dropping the ball on this one. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [Qemu-devel] [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net
On Tue, Jun 12, 2018 at 09:54:44AM +0800, Jason Wang wrote: > > > On 2018年06月12日 01:26, Michael S. Tsirkin wrote: > > On Mon, May 07, 2018 at 04:09:54PM -0700, Sridhar Samudrala wrote: > > > This feature bit can be used by hypervisor to indicate virtio_net device > > > to > > > act as a standby for another device with the same MAC address. > > > > > > I tested this with a small change to the patch to mark the STANDBY > > > feature 'true' > > > by default as i am using libvirt to start the VMs. > > > Is there a way to pass the newly added feature bit 'standby' to qemu via > > > libvirt > > > XML file? > > > > > > Signed-off-by: Sridhar Samudrala > > So I do not think we can commit to this interface: we > > really need to control visibility of the primary device. > > The problem is legacy guest won't use primary device at all if we do this. And that's by design - I think it's the only way to ensure the legacy guest isn't confused. > How about control the visibility of standby device? > > Thanks standy the always there to guarantee no downtime. > > However just for testing purposes, we could add a non-stable > > interface "x-standby" with the understanding that as any > > x- prefix it's unstable and will be changed down the road, > > likely in the next release. > > > > > > > --- > > > hw/net/virtio-net.c | 2 ++ > > > include/standard-headers/linux/virtio_net.h | 3 +++ > > > 2 files changed, 5 insertions(+) > > > > > > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c > > > index 90502fca7c..38b3140670 100644 > > > --- a/hw/net/virtio-net.c > > > +++ b/hw/net/virtio-net.c > > > @@ -2198,6 +2198,8 @@ static Property virtio_net_properties[] = { > > >true), > > > DEFINE_PROP_INT32("speed", VirtIONet, net_conf.speed, > > > SPEED_UNKNOWN), > > > DEFINE_PROP_STRING("duplex", VirtIONet, net_conf.duplex_str), > > > +DEFINE_PROP_BIT64("standby", VirtIONet, host_features, > > > VIRTIO_NET_F_STANDBY, > > > + false), > > > DEFINE_PROP_END_OF_LIST(), > > > }; > > > diff --git a/include/standard-headers/linux/virtio_net.h > > > b/include/standard-headers/linux/virtio_net.h > > > index e9f255ea3f..01ec09684c 100644 > > > --- a/include/standard-headers/linux/virtio_net.h > > > +++ b/include/standard-headers/linux/virtio_net.h > > > @@ -57,6 +57,9 @@ > > >* Steering */ > > > #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ > > > +#define VIRTIO_NET_F_STANDBY 62/* Act as standby for another > > > device > > > + * with the same MAC. > > > + */ > > > #define VIRTIO_NET_F_SPEED_DUPLEX 63/* Device set linkspeed and > > > duplex */ > > > #ifndef VIRTIO_NET_NO_LEGACY > > > -- > > > 2.14.3 ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PULL] vhost: cleanups and fixes
On Mon, Jun 11, 2018 at 6:36 PM Michael S. Tsirkin wrote: > > Maybe it will help to have GFP_NONE which will make any allocation > fail if attempted. Linus, would this address your comment? It would definitely have helped me initially overlook that call chain. But then when I started looking at the whole dma_map_page() thing, it just raised my hackles again. I would seriously suggest having a much simpler version for the "no allocation, no dma mapping" case, so that it's *obvious* that that never happens. So instead of having virtio_balloon_send_free_pages() call a really generic complex chain of functions that in _some_ cases can do memory allocation, why isn't there a short-circuited "vitruque_add_datum()" that is guaranteed to never do anything like that? Honestly, I look at "add_one_sg()" and it really doesn't make me happy. It looks hacky as hell. If I read the code right, you're really trying to just queue up a simple tuple of , except you encode it as a page pointer in order to play games with the SG logic, and then you hmap that to the ring, except in this case it's all a fake ring that just adds the cpu-physical address instead. And to figuer that out, it's like five layers of indirection through different helper functions that *can* do more generic things but in this case don't. And you do all of this from a core VM callback function with some _really_ core VM locks held. That makes no sense to me. How about this: - get rid of all that code - make the core VM callback save the "these are the free memory regions" in a fixed and limited array. One that DOES JUST THAT. No crazy "SG IO dma-mapping function crap". Just a plain array of a fixed size, pre-allocated for that virtio instance. - make it obvious that what you do in that sequence is ten instructions and no allocations ("Look ma, I wrote a value to an array and incremented the array idex, and I'M DONE") - then in that workqueue entry that you start *anyway*, you empty the array and do all the crazy virtio stuff. In fact, while at it, just simplify the VM interface too. Instead of traversing a random number of buddy lists, just trraverse *one* - the top-level one. Are you seriously ever going to shrink or mark read-only anythin *but* something big enough to be in the maximum order? MAX_ORDER is what, 11? So we're talking 8MB blocks. Do you *really* want the balloon code to work on smaller things, particularly since the whole interface is fundamentally racy and opportunistic to begin with? The whole sequence of events really looks "this is too much complexity, and way too fragile" to me at so many levels. Linus ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PULL] vhost: cleanups and fixes
On Mon, Jun 11, 2018 at 11:32:41AM -0700, Linus Torvalds wrote: > On Mon, Jun 11, 2018 at 9:24 AM Michael S. Tsirkin wrote: > > > > virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT > > Is this really a good idea? Well knowing which pages are unused does seem to be useful. Do you refer to this generally or to the idea of scanning the free list, or to the specific implementation issues you listed below? > Plus it seems entirely broken. > > The report_pfn_range() callback is done under the zone lock, but > virtio_balloon_send_free_pages() (which is the only callback used that > I can find) does add_one_sg(), which does virtqueue_add_inbuf(vq, , > 1, vq, GFP_KERNEL); > > So now we apparently do a GFP_KERNEL allocation insider the mm zone > lock, which is broken on just _so_ many levels. > > Pulled and then unpulled again. > > Either somebody needs to explain why I'm wrong and you can re-submit > this, or this kind of garbage needs to go away. > > I do *not* want to be in the situation where I pull stuff from the > virtio people that adds completely broken core VM functionality. > > Because if I'm in that situation, I will stop pulling from you guys. > Seriously. You have *no* place sending me broken shit that is outside > the virtio layer. > > Subsystems that break code MM will get shunned. You just aren't > important enough to allow you breaking code VM. > > Linus So no, it doesn't do any allocations - GFP_KERNEL or otherwise, but I agree how it might be confusing. So I'll drop this for now, but it would be nice if there is a bit more direction on this feature since I know several people are trying to work on this. -- MST ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [Qemu-devel] [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net
On 2018年06月12日 01:26, Michael S. Tsirkin wrote: On Mon, May 07, 2018 at 04:09:54PM -0700, Sridhar Samudrala wrote: This feature bit can be used by hypervisor to indicate virtio_net device to act as a standby for another device with the same MAC address. I tested this with a small change to the patch to mark the STANDBY feature 'true' by default as i am using libvirt to start the VMs. Is there a way to pass the newly added feature bit 'standby' to qemu via libvirt XML file? Signed-off-by: Sridhar Samudrala So I do not think we can commit to this interface: we really need to control visibility of the primary device. The problem is legacy guest won't use primary device at all if we do this. How about control the visibility of standby device? Thanks However just for testing purposes, we could add a non-stable interface "x-standby" with the understanding that as any x- prefix it's unstable and will be changed down the road, likely in the next release. --- hw/net/virtio-net.c | 2 ++ include/standard-headers/linux/virtio_net.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 90502fca7c..38b3140670 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -2198,6 +2198,8 @@ static Property virtio_net_properties[] = { true), DEFINE_PROP_INT32("speed", VirtIONet, net_conf.speed, SPEED_UNKNOWN), DEFINE_PROP_STRING("duplex", VirtIONet, net_conf.duplex_str), +DEFINE_PROP_BIT64("standby", VirtIONet, host_features, VIRTIO_NET_F_STANDBY, + false), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/standard-headers/linux/virtio_net.h b/include/standard-headers/linux/virtio_net.h index e9f255ea3f..01ec09684c 100644 --- a/include/standard-headers/linux/virtio_net.h +++ b/include/standard-headers/linux/virtio_net.h @@ -57,6 +57,9 @@ * Steering */ #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ +#define VIRTIO_NET_F_STANDBY 62/* Act as standby for another device + * with the same MAC. + */ #define VIRTIO_NET_F_SPEED_DUPLEX 63 /* Device set linkspeed and duplex */ #ifndef VIRTIO_NET_NO_LEGACY -- 2.14.3 ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PULL] vhost: cleanups and fixes
On Mon, Jun 11, 2018 at 11:44:05AM -0700, Linus Torvalds wrote: > On Mon, Jun 11, 2018 at 11:32 AM Linus Torvalds > wrote: > > > > So now we apparently do a GFP_KERNEL allocation insider the mm zone > > lock, which is broken on just _so_ many levels. > > Oh, I see the comment about how it doesn't actually do an allocation > at all because it's a single-entry. > > Still too damn ugly to live, and much too fragile. No way in hell do > we even _hint_ at a GFP_KERNEL when we're inside a context that can't > do any memory allocation at all. > > Plus I'm not convinced it's a "no allocation" path even despite that > comment, because it also does a "dma_map_page()" etc, which can cause > allocations to do the dma mapping thing afaik. No? Well no because DMA is triggered by the IOMMU flag and that is always off for the balloon. But I hear what you are saying about it being fragile. > Maybe there's some reason why that doesn't happen either, but > basically this whole callchain looks *way* to complicated to be used > under a core VM spinlock. > > Linus Maybe it will help to have GFP_NONE which will make any allocation fail if attempted. Linus, would this address your comment? -- MST ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH 1/2] Convert target drivers to use sbitmap
On 5/15/18 10:11 AM, Jens Axboe wrote: > On 5/15/18 10:00 AM, Matthew Wilcox wrote: >> From: Matthew Wilcox >> >> The sbitmap and the percpu_ida perform essentially the same task, >> allocating tags for commands. Since the sbitmap is more used than >> the percpu_ida, convert the percpu_ida users to the sbitmap API. > > It should also be the same performance as percpu_ida in light use, and > performs much better at > 50% utilization of the tag space. I think > that's better justification than "more used than". > >> diff --git a/drivers/target/iscsi/iscsi_target_util.c >> b/drivers/target/iscsi/iscsi_target_util.c >> index 4435bf374d2d..28bcffae609f 100644 >> --- a/drivers/target/iscsi/iscsi_target_util.c >> +++ b/drivers/target/iscsi/iscsi_target_util.c >> @@ -17,7 +17,7 @@ >> >> **/ >> >> #include >> -#include >> +#include >> #include /* ipv6_addr_equal() */ >> #include >> #include >> @@ -147,6 +147,28 @@ void iscsit_free_r2ts_from_list(struct iscsi_cmd *cmd) >> spin_unlock_bh(>r2t_lock); >> } >> >> +int iscsit_wait_for_tag(struct se_session *se_sess, int state, int *cpup) >> +{ >> +int tag = -1; >> +DEFINE_WAIT(wait); >> +struct sbq_wait_state *ws; >> + >> +if (state == TASK_RUNNING) >> +return tag; >> + >> +ws = _sess->sess_tag_pool.ws[0]; >> +for (;;) { >> +prepare_to_wait_exclusive(>wait, , state); >> +if (signal_pending_state(state, current)) >> +break; >> +schedule(); >> +tag = sbitmap_queue_get(_sess->sess_tag_pool, cpup); >> +} >> + >> +finish_wait(>wait, ); >> +return tag; >> +} > > Seems like that should be: > > > ws = _sess->sess_tag_pool.ws[0]; > for (;;) { > prepare_to_wait_exclusive(>wait, , state); > if (signal_pending_state(state, current)) > break; > tag = sbitmap_queue_get(_sess->sess_tag_pool, cpup); > if (tag != -1) > break; > schedule(); > } > > finish_wait(>wait, ); > return tag; > >> /* >> * May be called from software interrupt (timer) context for allocating >> * iSCSI NopINs. >> @@ -155,9 +177,11 @@ struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn >> *conn, int state) >> { >> struct iscsi_cmd *cmd; >> struct se_session *se_sess = conn->sess->se_sess; >> -int size, tag; >> +int size, tag, cpu; >> >> -tag = percpu_ida_alloc(_sess->sess_tag_pool, state); >> +tag = sbitmap_queue_get(_sess->sess_tag_pool, ); >> +if (tag < 0) >> +tag = iscsit_wait_for_tag(se_sess, state, ); >> if (tag < 0) >> return NULL; > > Might make sense to just roll the whole thing into iscsi_get_tag(), that > would be cleaner. > > sbitmap should provide a helper for that, but we can do that cleanup > later. That would encapsulate things like the per-cpu caching hint too, > for instance. > > Rest looks fine to me. Are you going to push this further? I really think we should. -- Jens Axboe ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PULL] vhost: cleanups and fixes
On Mon, Jun 11, 2018 at 11:32 AM Linus Torvalds wrote: > > So now we apparently do a GFP_KERNEL allocation insider the mm zone > lock, which is broken on just _so_ many levels. Oh, I see the comment about how it doesn't actually do an allocation at all because it's a single-entry. Still too damn ugly to live, and much too fragile. No way in hell do we even _hint_ at a GFP_KERNEL when we're inside a context that can't do any memory allocation at all. Plus I'm not convinced it's a "no allocation" path even despite that comment, because it also does a "dma_map_page()" etc, which can cause allocations to do the dma mapping thing afaik. No? Maybe there's some reason why that doesn't happen either, but basically this whole callchain looks *way* to complicated to be used under a core VM spinlock. Linus ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PULL] vhost: cleanups and fixes
On Mon, Jun 11, 2018 at 9:24 AM Michael S. Tsirkin wrote: > > virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT Is this really a good idea? Plus it seems entirely broken. The report_pfn_range() callback is done under the zone lock, but virtio_balloon_send_free_pages() (which is the only callback used that I can find) does add_one_sg(), which does virtqueue_add_inbuf(vq, , 1, vq, GFP_KERNEL); So now we apparently do a GFP_KERNEL allocation insider the mm zone lock, which is broken on just _so_ many levels. Pulled and then unpulled again. Either somebody needs to explain why I'm wrong and you can re-submit this, or this kind of garbage needs to go away. I do *not* want to be in the situation where I pull stuff from the virtio people that adds completely broken core VM functionality. Because if I'm in that situation, I will stop pulling from you guys. Seriously. You have *no* place sending me broken shit that is outside the virtio layer. Subsystems that break code MM will get shunned. You just aren't important enough to allow you breaking code VM. Linus ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net
On Mon, May 07, 2018 at 04:09:54PM -0700, Sridhar Samudrala wrote: > This feature bit can be used by hypervisor to indicate virtio_net device to > act as a standby for another device with the same MAC address. > > I tested this with a small change to the patch to mark the STANDBY feature > 'true' > by default as i am using libvirt to start the VMs. > Is there a way to pass the newly added feature bit 'standby' to qemu via > libvirt > XML file? > > Signed-off-by: Sridhar Samudrala So I do not think we can commit to this interface: we really need to control visibility of the primary device. However just for testing purposes, we could add a non-stable interface "x-standby" with the understanding that as any x- prefix it's unstable and will be changed down the road, likely in the next release. > --- > hw/net/virtio-net.c | 2 ++ > include/standard-headers/linux/virtio_net.h | 3 +++ > 2 files changed, 5 insertions(+) > > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c > index 90502fca7c..38b3140670 100644 > --- a/hw/net/virtio-net.c > +++ b/hw/net/virtio-net.c > @@ -2198,6 +2198,8 @@ static Property virtio_net_properties[] = { > true), > DEFINE_PROP_INT32("speed", VirtIONet, net_conf.speed, SPEED_UNKNOWN), > DEFINE_PROP_STRING("duplex", VirtIONet, net_conf.duplex_str), > +DEFINE_PROP_BIT64("standby", VirtIONet, host_features, > VIRTIO_NET_F_STANDBY, > + false), > DEFINE_PROP_END_OF_LIST(), > }; > > diff --git a/include/standard-headers/linux/virtio_net.h > b/include/standard-headers/linux/virtio_net.h > index e9f255ea3f..01ec09684c 100644 > --- a/include/standard-headers/linux/virtio_net.h > +++ b/include/standard-headers/linux/virtio_net.h > @@ -57,6 +57,9 @@ >* Steering */ > #define VIRTIO_NET_F_CTRL_MAC_ADDR 23/* Set MAC address */ > > +#define VIRTIO_NET_F_STANDBY 62/* Act as standby for another device > + * with the same MAC. > + */ > #define VIRTIO_NET_F_SPEED_DUPLEX 63 /* Device set linkspeed and duplex */ > > #ifndef VIRTIO_NET_NO_LEGACY > -- > 2.14.3 ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
[PULL] vhost: cleanups and fixes
The following changes since commit 29dcea88779c856c7dc92040a0c01233263101d4: Linux 4.17 (2018-06-03 14:15:21 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus for you to fetch changes up to aa15783ee62d57d69433101ede3e3ed11e48161d: virtio: update the comments for transport features (2018-06-07 22:17:40 +0300) virtio, vhost: features, fixes VF support for virtio. Free page hint request support for VM migration. DMA barriers for virtio strong barriers. Bugfixes. Signed-off-by: Michael S. Tsirkin Michael S. Tsirkin (2): virtio_ring: switch to dma_XX barriers for rpmsg vhost: fix info leak due to uninitialized memory Tiwei Bie (2): virtio_pci: support enabling VFs virtio: update the comments for transport features Wei Wang (4): mm: support reporting free page blocks virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT mm/page_poison: expose page_poisoning_enabled to kernel modules virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON drivers/vhost/vhost.c | 3 + drivers/virtio/virtio_balloon.c | 298 +++- drivers/virtio/virtio_pci_common.c | 30 drivers/virtio/virtio_pci_modern.c | 14 ++ include/linux/mm.h | 6 + include/linux/virtio_ring.h | 4 +- include/uapi/linux/virtio_balloon.h | 7 + include/uapi/linux/virtio_config.h | 16 +- mm/page_alloc.c | 97 mm/page_poison.c| 6 + 10 files changed, 439 insertions(+), 42 deletions(-) ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH v3 6/9] x86: prevent inline distortion by paravirt ops
On Sun, Jun 10, 2018 at 07:19:08AM -0700, Nadav Amit wrote: > +/* > + * This generates an indirect call based on the operation type number. > + * The type number, computed in PARAVIRT_PATCH, is derived from the > + * offset into the paravirt_patch_template structure, and can therefore be > + * freely converted back into a structure offset. > + */ > +.macro PARAVIRT_ALT type:req clobber:req pv_opptr:req Unlike the marcro maze you replaced, this has the CALL hardcoded in. So maybe name this PARAVIRT_CALL instead of PARAVIRT_ALT ? > +771: ANNOTATE_RETPOLINE_SAFE > + call *\pv_opptr > +772: .pushsection .parainstructions,"a" > + _ASM_ALIGN > + _ASM_PTR 771b > + .byte \type > + .byte 772b-771b > + .short \clobber > + .popsection > +.endm ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization