qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Roman Kagan <rkagan@virtuozzo.com>, qemu-devel@nongnu.org
Cc: Vijayabhaskar Balakrishna <vijay.balakrishna@oracle.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Venu Busireddy <venu.busireddy@oracle.com>,
	Liran Alon <liran.alon@oracle.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Si-Wei Liu <si-wei.liu@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Karl Heubaum <karl.heubaum@oracle.com>
Subject: Re: [Qemu-devel] [PATCH 05/10] hyperv: add synic message delivery
Date: Wed, 3 Oct 2018 13:06:58 +0200	[thread overview]
Message-ID: <47ed971a-71c8-4a95-c1e0-697c68a7a82c@redhat.com> (raw)
In-Reply-To: <20180921082217.29481-6-rkagan@virtuozzo.com>

On 21/09/2018 10:22, Roman Kagan wrote:
> +typedef struct HvSintStagedMesage {
> +    /* message content staged by hyperv_post_msg */
> +    struct hyperv_message msg;
> +    /* callback + data (r/o) to complete the processing in a BH */
> +    HvSintMsgCb cb;
> +    void *cb_data;
> +    /* message posting status filled by cpu_post_msg */
> +    int status;
> +    /* passing the buck: */
> +    enum {
> +        /* initial state */
> +        HV_STAGED_MSG_FREE,
> +        /*
> +         * hyperv_post_msg (e.g. in main loop) grabs the staged area (FREE ->
> +         * BUSY), copies msg, and schedules cpu_post_msg on the assigned cpu
> +         */
> +        HV_STAGED_MSG_BUSY,
> +        /*
> +         * cpu_post_msg (vcpu thread) tries to copy staged msg to msg slot,
> +         * notify the guest, records the status, marks the posting done (BUSY
> +         * -> POSTED), and schedules sint_msg_bh BH
> +         */
> +        HV_STAGED_MSG_POSTED,
> +        /*
> +         * sint_msg_bh (BH) verifies that the posting is done, runs the
> +         * callback, and starts over (POSTED -> FREE)
> +         */
> +    } state;
> +} HvSintStagedMesage;

s/Mesage/Message/

> +    if (atomic_read(&staged_msg->state) != HV_STAGED_MSG_POSTED) {
> +        /* status nor ready yet (spurious ack from guest?), ignore */
> +        return;
> +    }
> +

Can this actually happen?  It seems scary...

Paolo

       reply	other threads:[~2018-10-03 11:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180921082217.29481-1-rkagan@virtuozzo.com>
     [not found] ` <20180921082217.29481-6-rkagan@virtuozzo.com>
2018-10-03 11:06   ` Paolo Bonzini [this message]
2018-10-03 13:01     ` [Qemu-devel] [PATCH 05/10] hyperv: add synic message delivery Roman Kagan
2018-10-03 11:12 ` [Qemu-devel] [PATCH 00/10] hyperv: add connection infrastructure Paolo Bonzini
2018-10-03 14:25   ` Roman Kagan
2018-10-03 14:35     ` Paolo Bonzini
     [not found] ` <20180921082217.29481-4-rkagan@virtuozzo.com>
2018-11-20 13:41   ` [Qemu-devel] [PATCH 03/10] hyperv: only add SynIC in compatible configurations Eduardo Habkost
2018-11-26 14:45   ` Igor Mammedov
2018-11-26 15:17     ` Roman Kagan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47ed971a-71c8-4a95-c1e0-697c68a7a82c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=karl.heubaum@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=liran.alon@oracle.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkagan@virtuozzo.com \
    --cc=si-wei.liu@oracle.com \
    --cc=venu.busireddy@oracle.com \
    --cc=vijay.balakrishna@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).