All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Guang <lig.fnst@cn.fujitsu.com>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] hw/misc/blob-loader: add a generic blob loader
Date: Mon, 06 Jan 2014 12:22:57 +0800	[thread overview]
Message-ID: <52CA2FA1.6080002@cn.fujitsu.com> (raw)
In-Reply-To: <CAEgOgz6Kx=HWJ1zTn7=ORXG+UW8TN17P=KZ8mnJAesLk6vyDJA@mail.gmail.com>

Peter Crosthwaite wrote:
> On Mon, Jan 6, 2014 at 1:55 PM, Li Guang<lig.fnst@cn.fujitsu.com>  wrote:
>    
>> Li Guang wrote:
>>      
>>> Paolo Bonzini wrote:
>>>        
>>>> Il 02/01/2014 11:51, Peter Crosthwaite ha scritto:
>>>>          
>>>>>>> No, please use "realize" and avoid init.  This way you can use an
>>>>>>> Error*
>>>>>>> to report the error.
>>>>>>>
>>>>>>> Also, the actual load_image_targphys call probably should be done in a
>>>>>>> reset handler, not at realize time.
>>>>>>>
>>>>>>>                
>>>>> Ok I think that settles it. The actual blobbing needs to happen at
>>>>> reset time. Perhaps the correct approach is to do as much as possible
>>>>> (file-path / address sanitsation etc) at realize time, then only the
>>>>> actual blob load happens at reset. Going on what Paolo said, I think
>>>>> for this device ::init is actually a nop.
>>>>>            
>>>> Yeah, also because init is in fact a legacy interface to realize.
>>>>
>>>> Paolo
>>>>
>>>>          
>>> Ok, thanks!
>>>
>>>
>>>        
>> Sorry, seems load blob at reset handler can't do the right job,
>> while the same action can play very well at init or realize.
>>      
> What's the exact problem with the reset idea?
>
>
>    
code snippet:
static void blob_loader_reset(DeviceState *dev)
{
     BlobLoaderState *s = BLOB_LOADER(dev);

     if (load_image_targphys(s->file, s->hwaddr, MAX_BLOB_SIZE) < 0) {
         error_report("can't load %s\n", s->file);
         exit(1);
     }
}

if it is device reset handler, no result,
kernel doesn't find and parse blob,
if it is called at device realize phase,
it works.

Thanks!

>> any suggestion to figure out this problem?
>>
>> Thanks!
>>
>>
>>
>>      
>
>    

  reply	other threads:[~2014-01-06  4:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-02  5:35 [Qemu-devel] [PATCH] hw/misc/blob-loader: add a generic blob loader Li Guang
2014-01-02  5:50 ` Peter Crosthwaite
2014-01-02  6:51   ` Li Guang
2014-01-02  8:21   ` Paolo Bonzini
2014-01-02 10:51     ` Peter Crosthwaite
2014-01-02 12:16       ` Paolo Bonzini
2014-01-06  0:52         ` Li Guang
2014-01-06  3:55           ` Li Guang
2014-01-06  4:00             ` Peter Crosthwaite
2014-01-06  4:22               ` Li Guang [this message]
2014-01-06  4:32                 ` Peter Crosthwaite
2014-01-06  4:52                   ` Li Guang
2014-01-06  5:24                     ` Li Guang
2014-01-06  5:28                       ` Peter Crosthwaite
2014-01-06  5:36                         ` Li Guang
2014-01-06 12:11                           ` Paolo Bonzini
2014-01-06  7:41   ` Peter Maydell
2014-01-06  7:56     ` Peter Crosthwaite
2014-01-06  8:16       ` Peter Maydell
2014-01-06 12:13       ` Paolo Bonzini
2014-01-06 13:06         ` Peter Crosthwaite
2014-01-08  7:38           ` Li Guang

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=52CA2FA1.6080002@cn.fujitsu.com \
    --to=lig.fnst@cn.fujitsu.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --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.