From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH retry] arch/ia64/kvm/kvm-ia64.c: Add local_irq_restore
Date: Thu, 24 Jul 2008 11:35:58 +0000 [thread overview]
Message-ID: <4888691E.5000103@bfs.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0807222137350.2670@ask.diku.dk>
local_irq_save(saved_psr);
slot = ia64_itr_entry(0x3, KVM_VMM_BASE, pte, KVM_VMM_SHIFT);
local_irq_restore(saved_psr);
maybe it is posible to move that local_irq_save() into ia64_itr_entry() directly ?
re,
wh
Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> There is a call to local_irq_restore in the normal exit case, so it would
> seem that there should be one on an error return as well.
>
> The semantic patch that finds this problem is as follows:
> (http://www.emn.fr/x-info/coccinelle/)
>
> // <smpl>
> @@
> expression l;
> expression E,E1,E2;
> @@
>
> local_irq_save(l);
> ... when != local_irq_restore(l)
> when != spin_unlock_irqrestore(E,l)
> when any
> when strict
> (
> if (...) { ... when != local_irq_restore(l)
> when != spin_unlock_irqrestore(E1,l)
> + local_irq_restore(l);
> return ...;
> }
> |
> if (...)
> + {local_irq_restore(l);
> return ...;
> + }
> |
> spin_unlock_irqrestore(E2,l);
> |
> local_irq_restore(l);
> )
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
>
> ---
> .../julia/linuxcopy}/arch/ia64/kvm/kvm-ia64.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/home/julia/linux-2.6/arch/ia64/kvm/kvm-ia64.c b/var/julia/linuxcopy/arch/ia64/kvm/kvm-ia64.c
> index 2672f4d..7a37d06 100644
> --- a/home/julia/linux-2.6/arch/ia64/kvm/kvm-ia64.c
> +++ b/var/julia/linuxcopy/arch/ia64/kvm/kvm-ia64.c
> @@ -125,9 +125,9 @@ void kvm_arch_hardware_enable(void *garbage)
> PAGE_KERNEL));
> local_irq_save(saved_psr);
> slot = ia64_itr_entry(0x3, KVM_VMM_BASE, pte, KVM_VMM_SHIFT);
> + local_irq_restore(saved_psr);
> if (slot < 0)
> return;
> - local_irq_restore(saved_psr);
>
> spin_lock(&vp_lock);
> status = ia64_pal_vp_init_env(kvm_vsa_base ?
> @@ -160,9 +160,9 @@ void kvm_arch_hardware_disable(void *garbage)
>
> local_irq_save(saved_psr);
> slot = ia64_itr_entry(0x3, KVM_VMM_BASE, pte, KVM_VMM_SHIFT);
> + local_irq_restore(saved_psr);
> if (slot < 0)
> return;
> - local_irq_restore(saved_psr);
>
> status = ia64_pal_vp_exit_env(host_iva);
> if (status)
> @@ -1253,6 +1253,7 @@ static int vti_vcpu_setup(struct kvm_vcpu *vcpu, int id)
> uninit:
> kvm_vcpu_uninit(vcpu);
> fail:
> + local_irq_restore(psr);
> return r;
> }
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
next prev parent reply other threads:[~2008-07-24 11:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-22 19:38 [PATCH retry] arch/ia64/kvm/kvm-ia64.c: Add local_irq_restore in Julia Lawall
2008-07-22 19:38 ` [PATCH retry] arch/ia64/kvm/kvm-ia64.c: Add local_irq_restore in error handling code Julia Lawall
2008-07-22 19:53 ` Matthew Wilcox
2008-07-22 19:53 ` Matthew Wilcox
2008-07-23 1:26 ` Zhang, Xiantao
2008-07-23 1:26 ` Zhang, Xiantao
2008-07-24 11:35 ` walter harms [this message]
2008-07-24 12:27 ` [PATCH retry] arch/ia64/kvm/kvm-ia64.c: Add local_irq_restore Julia Lawall
2008-07-26 9:10 ` Avi Kivity
2008-07-26 9:10 ` [PATCH retry] arch/ia64/kvm/kvm-ia64.c: Add local_irq_restore in error handling code Avi Kivity
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=4888691E.5000103@bfs.de \
--to=wharms@bfs.de \
--cc=kernel-janitors@vger.kernel.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 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.