All of lore.kernel.org
 help / color / mirror / Atom feed
* Compiling KVM/ARM as a separate kernel module.
@ 2018-04-10  8:23 Mike Bazov
  2018-04-10  9:48 ` James Morse
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Bazov @ 2018-04-10  8:23 UTC (permalink / raw)
  To: kvmarm


[-- Attachment #1.1: Type: text/plain, Size: 726 bytes --]

Greetings,

I hope i have reached the correct mailing list(referred here:
https://www.linux-kvm.org/page/Lists,_IRC)

I'm trying to compile the KVM/ARM as a separate kernel module, just like
the x86 modules. When i compile the x86 modules, i get the "kvm.ko" and
"kvm-intel.ko" as an output. Is there any way of compiling the KVM/ARM as
modules as well?

I have tried this approach:
$ make M=arch/arm64/kvm/

This does compile all of the source files to object files, but doesn't
create any kernel modules at the end:

>   Building modules, stage 2.
>   MODPOST 0 modules


There is also no option for specifying "M" (modular) in the menuconfig when
choosing the virtualization and KVM option, like in x86.

Thank you,

Mike.

[-- Attachment #1.2: Type: text/html, Size: 1183 bytes --]

[-- Attachment #2: Type: text/plain, Size: 151 bytes --]

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compiling KVM/ARM as a separate kernel module.
  2018-04-10  8:23 Compiling KVM/ARM as a separate kernel module Mike Bazov
@ 2018-04-10  9:48 ` James Morse
  2018-04-10 13:19   ` Mike Bazov
  0 siblings, 1 reply; 4+ messages in thread
From: James Morse @ 2018-04-10  9:48 UTC (permalink / raw)
  To: Mike Bazov, kvmarm

Hi Mike,

On 10/04/18 09:23, Mike Bazov wrote:
> I'm trying to compile the KVM/ARM as a separate kernel module, just like
> the x86 modules. When i compile the x86 modules, i get the "kvm.ko" and
> "kvm-intel.ko" as an output. Is there any way of compiling the KVM/ARM as
> modules as well?

Not today. KVM has to map its code to run in a different CPU mode, the code that
does this assumes its physically contiguous and part of the kernel text.


> There is also no option for specifying "M" (modular) in the menuconfig when
> choosing the virtualization and KVM option, like in x86.

No, because its not supported. On arm/arm64 KVM is either built as part of the
kernel, or not.

Why do you need KVM as a loadable module?


Thanks,

James

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compiling KVM/ARM as a separate kernel module.
  2018-04-10  9:48 ` James Morse
@ 2018-04-10 13:19   ` Mike Bazov
  2018-04-10 14:29     ` Marc Zyngier
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Bazov @ 2018-04-10 13:19 UTC (permalink / raw)
  To: James Morse, kvmarm


[-- Attachment #1.1: Type: text/plain, Size: 1311 bytes --]

Greetings,

I'm developing a product based on KVM/ARM, in which i need to modify the
code that is responsible for entering
into guest mode(i.e. EL1?) and i don't really want to recompile the kernel
and flash it again as part of my development. I need to run
on baremetal(on the board itself) when testing my code.

Any plans for supporting this in the near future? or any other suggestions
on a less painful development process?

Thanks,
Mike.

On Tue, Apr 10, 2018 at 12:48 PM, James Morse <james.morse@arm.com> wrote:

> Hi Mike,
>
> On 10/04/18 09:23, Mike Bazov wrote:
> > I'm trying to compile the KVM/ARM as a separate kernel module, just like
> > the x86 modules. When i compile the x86 modules, i get the "kvm.ko" and
> > "kvm-intel.ko" as an output. Is there any way of compiling the KVM/ARM as
> > modules as well?
>
> Not today. KVM has to map its code to run in a different CPU mode, the
> code that
> does this assumes its physically contiguous and part of the kernel text.
>
>
> > There is also no option for specifying "M" (modular) in the menuconfig
> when
> > choosing the virtualization and KVM option, like in x86.
>
> No, because its not supported. On arm/arm64 KVM is either built as part of
> the
> kernel, or not.
>
> Why do you need KVM as a loadable module?
>
>
> Thanks,
>
> James
>
>

[-- Attachment #1.2: Type: text/html, Size: 1888 bytes --]

[-- Attachment #2: Type: text/plain, Size: 151 bytes --]

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compiling KVM/ARM as a separate kernel module.
  2018-04-10 13:19   ` Mike Bazov
@ 2018-04-10 14:29     ` Marc Zyngier
  0 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2018-04-10 14:29 UTC (permalink / raw)
  To: Mike Bazov, James Morse, kvmarm

Hi Mike,

On 10/04/18 14:19, Mike Bazov wrote:
> Greetings,
> 
> I'm developing a product based on KVM/ARM, in which i need to modify
> the code that is responsible for entering into guest mode(i.e. EL1?)
> and i don't really want to recompile the kernel and flash it again as
> part of my development. I need to run on baremetal(on the board
> itself) when testing my code.

Recompiling the kernel is par for the course. You're probably changing
fundamental structures in the kernel, and KVM is not exactly independent
of the rest of the code base.

> Any plans for supporting this in the near future? or any other
> suggestions on a less painful development process?

There are no plans to support this in general. As James pointed out, KVM
needs to directly map the kernel at EL2, and requires to be part of the
kernel text (see how kern_hyp_va works with respect to the kernel mappings).

We *could* make it modular if we only had VHE, but we want a single
kernel image a lot more than we'll ever want a modular KVM. So built in
it will stay for the foreseeable future.

As for a more civilized development model, you have two alternatives:

- Use a proper boot loader that will load the kernel from a file system,
- Use kexec to boot from one kernel to another.

I use both every day.

Hope this helps,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-10 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10  8:23 Compiling KVM/ARM as a separate kernel module Mike Bazov
2018-04-10  9:48 ` James Morse
2018-04-10 13:19   ` Mike Bazov
2018-04-10 14:29     ` Marc Zyngier

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.