qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Wu, Wentong" <wentong.wu@intel.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Marek Vasut <marex@denx.de>, Chris Wulff <crwulff@gmail.com>
Subject: Re: [RFC] hw: nios2: update interrupt_request when STATUS_PIE disabled
Date: Fri, 5 Jun 2020 09:06:56 +0200	[thread overview]
Message-ID: <e816a581-2bca-a1d3-a5d3-512200298623@redhat.com> (raw)
In-Reply-To: <DM5PR11MB18339389B4BD1BB2B4B5AB7A8D860@DM5PR11MB1833.namprd11.prod.outlook.com>

On 05/06/2020 07.59, Wu, Wentong wrote:
> Hi all,
> 
> I’m running icount mode on qemu_nios2 with customized  platform(almost
> same with 10m50_devboard),
> 
> but cpu abort happened(qemu: fatal: Raised interrupt while not in I/O
> function) when guest code changes
> 
> state register with wrctl instruction, add some debug code finding that
> it’s caused by the interrupt_request
> 
> mismatch, so I made a patch as below, not sure if it’s right, hope I can
> have some discussion with maintainers

 Hi,

please have a look at the MAINTAINERS file in the main directory of the
sources, you can find the corresponding maintainers there. Thus if you
have questions related to nios2, please make sure to put Chris and Marek
into CC: so that your patch gets the right attention!

 Thanks,
  Thomas



> commit efdb3da4e145a7a34ba8b3ab1cdcfc346ae20a11 (HEAD -> master)
> 
> Author: Wentong Wu <wentong.wu@intel.com>
> 
> Date:   Fri Jun 5 09:29:43 2020 -0400
> 
>  
> 
>     hw: nios2: update interrupt_request when CR_STATUS_PIE disabled
> 
>  
> 
>     Update interrupt_request when external interupt pends for STATUS_PIE
> 
>     disabled. Otherwise on icount enabled nios2 target there will be cpu
> 
>     abort when guest code changes state register with wrctl instruction.
> 
>  
> 
>     Signed-off-by: Wentong Wu <wentong.wu@intel.com>
> 
>  
> 
> diff --git a/hw/nios2/cpu_pic.c b/hw/nios2/cpu_pic.c
> 
> index 1c1989d5..b04db4d7 100644
> 
> --- a/hw/nios2/cpu_pic.c
> 
> +++ b/hw/nios2/cpu_pic.c
> 
> @@ -42,7 +42,9 @@ static void nios2_pic_cpu_handler(void *opaque, int
> irq, int level)
> 
>          } else if (!level) {
> 
>              env->irq_pending = 0;
> 
>              cpu_reset_interrupt(cs, type);
> 
> -        }
> 
> +        } else {
> 
> +            cs->interrupt_request |= type;
> 
> +       }
> 
>      } else {
> 
>          if (level) {
> 
>              cpu_interrupt(cs, type);
> 



  reply	other threads:[~2020-06-05  7:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05  5:59 [RFC] hw: nios2: update interrupt_request when STATUS_PIE disabled Wu, Wentong
2020-06-05  7:06 ` Thomas Huth [this message]
2020-06-05  7:14   ` Wu, Wentong
2020-06-08  1:00   ` Wu, Wentong
2020-06-09  8:39   ` Wu, Wentong
2020-06-10 13:29     ` Thomas Huth
2020-06-11  6:05       ` Wu, Wentong

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=e816a581-2bca-a1d3-a5d3-512200298623@redhat.com \
    --to=thuth@redhat.com \
    --cc=crwulff@gmail.com \
    --cc=marex@denx.de \
    --cc=qemu-devel@nongnu.org \
    --cc=wentong.wu@intel.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).