All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huacai Chen <chenhuacai@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>,
	Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [PATCH 2/2] target/mips/kvm: Assert unreachable code is not used
Date: Wed, 25 Nov 2020 09:16:52 +0800	[thread overview]
Message-ID: <CAAhV-H5QAizhSiAv4DprtuzdJp+ga0QCyWzqbRxg-i=W7gVUAw@mail.gmail.com> (raw)
In-Reply-To: <b938bfae-cc2b-e43b-36ef-8ac4b5f78eb4@amsat.org>

Reviewed-by: Huacai Chen <chenhc@lemote.com>

On Tue, Nov 24, 2020 at 6:42 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Huacai, ping?
>
> On 5/12/20 9:09 AM, Philippe Mathieu-Daudé wrote:
> > +Paolo
> >
> > On 4/29/20 10:29 AM, Philippe Mathieu-Daudé wrote:
> >> This code must not be used outside of KVM. Abort if it is.
> >>
> >> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> >> ---
> >>   target/mips/kvm.c | 8 ++------
> >>   1 file changed, 2 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/target/mips/kvm.c b/target/mips/kvm.c
> >> index de3e26ef1f..050bfbd7fa 100644
> >> --- a/target/mips/kvm.c
> >> +++ b/target/mips/kvm.c
> >> @@ -196,9 +196,7 @@ int kvm_mips_set_interrupt(MIPSCPU *cpu, int irq,
> >> int level)
> >>       CPUState *cs = CPU(cpu);
> >>       struct kvm_mips_interrupt intr;
> >>   -    if (!kvm_enabled()) {
> >> -        return 0;
> >> -    }
> >> +    assert(kvm_enabled());
> >>         intr.cpu = -1;
> >>   @@ -219,9 +217,7 @@ int kvm_mips_set_ipi_interrupt(MIPSCPU *cpu, int
> >> irq, int level)
> >>       CPUState *dest_cs = CPU(cpu);
> >>       struct kvm_mips_interrupt intr;
> >>   -    if (!kvm_enabled()) {
> >> -        return 0;
> >> -    }
> >> +    assert(kvm_enabled());
> >>         intr.cpu = dest_cs->cpu_index;
> >>
> >


  parent reply	other threads:[~2020-11-25  1:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29  8:29 [PATCH 0/2] mips: Minor simplifications for KVM use Philippe Mathieu-Daudé
2020-04-29  8:29 ` [PATCH 1/2] hw/mips/mips_int: De-duplicate KVM interrupt delivery Philippe Mathieu-Daudé
2020-04-29  8:48   ` chen huacai
2020-05-12  7:08     ` Philippe Mathieu-Daudé
2020-05-26  7:57       ` Thomas Huth
2020-05-26  8:17         ` Philippe Mathieu-Daudé
2020-04-29  8:29 ` [PATCH 2/2] target/mips/kvm: Assert unreachable code is not used Philippe Mathieu-Daudé
2020-05-12  7:09   ` Philippe Mathieu-Daudé
2020-11-24 10:41     ` Philippe Mathieu-Daudé
2020-11-24 11:02       ` Paolo Bonzini
2020-12-07 22:23         ` Philippe Mathieu-Daudé
2020-11-25  1:16       ` Huacai Chen [this message]
2020-05-26  7:52 ` [PATCH 0/2] mips: Minor simplifications for KVM use Philippe Mathieu-Daudé

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='CAAhV-H5QAizhSiAv4DprtuzdJp+ga0QCyWzqbRxg-i=W7gVUAw@mail.gmail.com' \
    --to=chenhuacai@gmail.com \
    --cc=aleksandar.qemu.devel@gmail.com \
    --cc=aleksandar.rikalo@rt-rk.com \
    --cc=aurelien@aurel32.net \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@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 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.