Port-xen archive

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

Re: merge bouyer-xenpvh to HEAD

Le 27/04/2020 à 14:26, Manuel Bouyer a écrit :
On Mon, Apr 27, 2020 at 01:36:10PM +0200, Maxime Villard wrote:
Don't have time to look at that immediately, but after a very quick glance,
it seems clear the problem is in the definition of struct cpu_info. There
is an early #ifdef XEN that is true in the kernel but false in the module,
leading to serious bugs. Try compiling the module with CFLAGS+=-DXEN, you'll
probably see it works.

The ifdef should be moved to the end of the structure, like the rest.

If struct cpu_info is part of the module ABI, there's others #ifdef that
should be removed, isn't it ?

Not necessarily, the other #ifdefs are at the end of the structure, and they
deal with fields that modules are not "expected" to access. The problem we
see here is caused by the fact that the XEN #ifdef is at the _beginning_ of
the structure, and so the offset of several public fields will differ between
modules and the kernel.

I would suggest that the field be moved down; quickly, if possible, because
NVMM is not the only module that accesses some parts of curcpu(), and chances
are that many other modules are broken too.

Le 27/04/2020 à 15:32, Chavdar Ivanov a écrit :
Compilation with CFLAGS+=XEN fails with:
In file included from ./machine/intr.h:3,
                  from /home/sysbuild/src/sys/sys/intr.h:97,
                  from /home/sysbuild/src/sys/sys/mutex.h:174,
                  from ./machine/vmparam.h:42,
                  from /home/sysbuild/src/sys/uvm/uvm_param.h:76,
                  from /home/sysbuild/src/sys/sys/param.h:149,
                  from /tmp/genassym.cYoGAh/assym.c:13:
./x86/intr.h:52:10: fatal error: xen/include/public/xen.h: No such
file or directory
  #include <xen/include/public/xen.h>
so probably there is more to it than this.

Then there is an additional include problem with XEN.

Try to build NVMM directly in the kernel, by uncommenting its entry from your
config. The bug will probably be gone, and that would confirm my #ifdef point.


Home | Main Index | Thread Index | Old Index