qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 17/18] modules: check arch and block load on mismatch


From: Gerd Hoffmann
Subject: Re: [PATCH v2 17/18] modules: check arch and block load on mismatch
Date: Thu, 10 Jun 2021 14:57:21 +0200

  Hi,

> >      for (modlist = modinfo->list; modlist != NULL; modlist = 
> > modlist->next) {
> > +        if (modlist->value->has_arch) {
> > +            if (strcmp(modlist->value->name, module_name) == 0) {
> > +                if (!module_arch ||
> > +                    strcmp(modlist->value->arch, module_arch) != 0) {
> > +                    return false;
> > +                }
> > +            }
> > +        }
> 
> I have a little hard time following the code paths, but IIUC, with this
> change, instead of "module.so" we would have multiple copies of something
> like "module-$arch.so" ?

Not yet with this series, but easily doable on top of this (see other
patch series sent today).

> Then we load them all, read their modinfo section
> and discard the ones with non-matching arch ?

No.  There is a utility reading the modinfo section (patch #2), write
out the info as json (patch #2 has the schema), then qemu will read that
json file (patch #13) ...

> for arch specific modules. That would let us load only the modules we know
> are applicable for the system target arch and not need this post-load
> filtering from metadata.

... so it's pre-load filtering, not post-load.

take care,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]