From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-ppc@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 6/6] xics/kvm: Add proper rollback to xics_kvm_init()
Date: Thu, 20 Jun 2019 18:32:57 +1000 [thread overview]
Message-ID: <20190620083257.GD8232@umbus.BigPond> (raw)
In-Reply-To: <156077922319.433243.609897156640506891.stgit@bahia.lan>
[-- Attachment #1: Type: text/plain, Size: 1815 bytes --]
On Mon, Jun 17, 2019 at 03:47:03PM +0200, Greg Kurz wrote:
> Make xics_kvm_disconnect() able to undo the changes of a partial execution
> of xics_kvm_connect() and use it to perform rollback.
>
> Note that kvmppc_define_rtas_kernel_token(0) never fails, no matter the
> RTAS call has been defined or not.
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
Applied, thanks.
> ---
> hw/intc/xics_kvm.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
> index 4bfbe1a84092..51433b19b076 100644
> --- a/hw/intc/xics_kvm.c
> +++ b/hw/intc/xics_kvm.c
> @@ -421,10 +421,7 @@ int xics_kvm_connect(SpaprMachineState *spapr, Error **errp)
>
> fail:
> error_propagate(errp, local_err);
> - kvmppc_define_rtas_kernel_token(0, "ibm,set-xive");
> - kvmppc_define_rtas_kernel_token(0, "ibm,get-xive");
> - kvmppc_define_rtas_kernel_token(0, "ibm,int-on");
> - kvmppc_define_rtas_kernel_token(0, "ibm,int-off");
> + xics_kvm_disconnect(spapr, NULL);
> return -1;
> }
>
> @@ -448,8 +445,10 @@ void xics_kvm_disconnect(SpaprMachineState *spapr, Error **errp)
> * removed from the list of devices of the VM. The VCPU presenters
> * are also detached from the device.
> */
> - close(kernel_xics_fd);
> - kernel_xics_fd = -1;
> + if (kernel_xics_fd != -1) {
> + close(kernel_xics_fd);
> + kernel_xics_fd = -1;
> + }
>
> kvmppc_define_rtas_kernel_token(0, "ibm,set-xive");
> kvmppc_define_rtas_kernel_token(0, "ibm,get-xive");
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2019-06-20 8:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 13:46 [Qemu-devel] [PATCH 0/6] xics/kvm: Improve error handling Greg Kurz
2019-06-17 13:46 ` [Qemu-devel] [PATCH 1/6] xics/spapr: Drop unused function declaration Greg Kurz
2019-06-17 14:18 ` Cédric Le Goater
2019-06-20 8:00 ` David Gibson
2019-06-17 13:46 ` [Qemu-devel] [PATCH 2/6] xics/spapr: Rename xics_kvm_init() Greg Kurz
2019-06-17 14:18 ` Cédric Le Goater
2019-06-20 8:02 ` David Gibson
2019-06-17 13:46 ` [Qemu-devel] [PATCH 3/6] xics/kvm: Skip rollback when KVM XICS is absent Greg Kurz
2019-06-17 14:18 ` Cédric Le Goater
2019-06-20 8:04 ` David Gibson
2019-06-17 13:46 ` [Qemu-devel] [PATCH 4/6] xics/kvm: Always use local_err in xics_kvm_init() Greg Kurz
2019-06-17 14:19 ` Cédric Le Goater
2019-06-20 8:05 ` David Gibson
2019-06-17 13:46 ` [Qemu-devel] [PATCH 5/6] xics/kvm: Add error propagation to ic*_set_kvm_state() functions Greg Kurz
2019-06-18 7:16 ` Cédric Le Goater
2019-06-20 8:31 ` David Gibson
2019-06-17 13:47 ` [Qemu-devel] [PATCH 6/6] xics/kvm: Add proper rollback to xics_kvm_init() Greg Kurz
2019-06-18 7:18 ` Cédric Le Goater
2019-06-20 8:32 ` David Gibson [this message]
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=20190620083257.GD8232@umbus.BigPond \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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).