All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Enhance kvmconfig
@ 2016-04-23 17:26 Andrey Utkin
  2016-04-24 16:30 ` Borislav Petkov
  0 siblings, 1 reply; 10+ messages in thread
From: Andrey Utkin @ 2016-04-23 17:26 UTC (permalink / raw)
  To: linux-kernel, x86
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Borislav Petkov,
	Andrey Utkin

Dropped BALLOON entries as suggested by Borislav Petkov. Tested.

This was tested only on Hetzner CX10 VPS. I don't know how recent KVM
server stuff they use.
Tests & reports from anybody else are appreciated.
I guess some of added options may be not strictly necessary or make not
that lot of sense as enabled by default, feel free to ask me to drop
some and test how it works.
Thanks.
---8<---
"make defconfig kvmconfig" is supposed to end up with usable kernel for
KVM guest. In practice, it won't work for e.g. Hetzner VPS (KVM-based)
unless you add these options.

Signed-off-by: Andrey Utkin <andrey_utkin@fastmail.com>
---
 arch/x86/configs/kvm_guest.config | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/configs/kvm_guest.config b/arch/x86/configs/kvm_guest.config
index f9affcc..9c78145 100644
--- a/arch/x86/configs/kvm_guest.config
+++ b/arch/x86/configs/kvm_guest.config
@@ -26,3 +26,8 @@ CONFIG_VIRTIO_NET=y
 CONFIG_9P_FS=y
 CONFIG_NET_9P=y
 CONFIG_NET_9P_VIRTIO=y
+CONFIG_SCSI_LOWLEVEL=y
+CONFIG_SCSI_VIRTIO=y
+CONFIG_VIRTIO_INPUT=y
+CONFIG_VIRTIO_MMIO=y
+CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
-- 
2.8.1

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

* Re: [PATCH v2] Enhance kvmconfig
  2016-04-23 17:26 [PATCH v2] Enhance kvmconfig Andrey Utkin
@ 2016-04-24 16:30 ` Borislav Petkov
  2016-04-24 19:57   ` Andrey Utkin
  2016-05-09 12:16   ` Paolo Bonzini
  0 siblings, 2 replies; 10+ messages in thread
From: Borislav Petkov @ 2016-04-24 16:30 UTC (permalink / raw)
  To: Andrey Utkin, Paolo Bonzini
  Cc: linux-kernel, x86, Thomas Gleixner, Ingo Molnar, H. Peter Anvin

On Sat, Apr 23, 2016 at 08:26:48PM +0300, Andrey Utkin wrote:
> Dropped BALLOON entries as suggested by Borislav Petkov. Tested.
> 
> This was tested only on Hetzner CX10 VPS. I don't know how recent KVM
> server stuff they use.
> Tests & reports from anybody else are appreciated.
> I guess some of added options may be not strictly necessary or make not
> that lot of sense as enabled by default, feel free to ask me to drop
> some and test how it works.
> Thanks.
> ---8<---
> "make defconfig kvmconfig" is supposed to end up with usable kernel for
> KVM guest. In practice, it won't work for e.g. Hetzner VPS (KVM-based)
> unless you add these options.
> 
> Signed-off-by: Andrey Utkin <andrey_utkin@fastmail.com>
> ---
>  arch/x86/configs/kvm_guest.config | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/x86/configs/kvm_guest.config b/arch/x86/configs/kvm_guest.config
> index f9affcc..9c78145 100644
> --- a/arch/x86/configs/kvm_guest.config
> +++ b/arch/x86/configs/kvm_guest.config
> @@ -26,3 +26,8 @@ CONFIG_VIRTIO_NET=y
>  CONFIG_9P_FS=y
>  CONFIG_NET_9P=y
>  CONFIG_NET_9P_VIRTIO=y
> +CONFIG_SCSI_LOWLEVEL=y
> +CONFIG_SCSI_VIRTIO=y
> +CONFIG_VIRTIO_INPUT=y
> +CONFIG_VIRTIO_MMIO=y
> +CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
> --

Frankly, I'm still not sure we want to do this. Apparently, virtio is
the way to go on kvm but it is not absolutely necessary to get a booting
guest.

Paolo, what do you think?

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

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

* Re: [PATCH v2] Enhance kvmconfig
  2016-04-24 16:30 ` Borislav Petkov
@ 2016-04-24 19:57   ` Andrey Utkin
  2016-04-24 20:18     ` Borislav Petkov
  2016-05-09 12:16   ` Paolo Bonzini
  1 sibling, 1 reply; 10+ messages in thread
From: Andrey Utkin @ 2016-04-24 19:57 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Paolo Bonzini, linux-kernel, x86, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin

On Sun, Apr 24, 2016 at 06:30:46PM +0200, Borislav Petkov wrote:
> Frankly, I'm still not sure we want to do this. Apparently, virtio is
> the way to go on kvm but it is not absolutely necessary to get a booting
> guest.

So current "make defconfig kvmconfig" works for you?

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

* Re: [PATCH v2] Enhance kvmconfig
  2016-04-24 19:57   ` Andrey Utkin
@ 2016-04-24 20:18     ` Borislav Petkov
  2016-04-24 20:35       ` Andrey Utkin
  0 siblings, 1 reply; 10+ messages in thread
From: Borislav Petkov @ 2016-04-24 20:18 UTC (permalink / raw)
  To: Andrey Utkin
  Cc: Paolo Bonzini, linux-kernel, x86, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin

On Sun, Apr 24, 2016 at 10:57:37PM +0300, Andrey Utkin wrote:
> So current "make defconfig kvmconfig" works for you?

I don't do that - I do

make oldconfig
make kvmconfig

and the second one adds the options which are not set in my .config.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

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

* Re: [PATCH v2] Enhance kvmconfig
  2016-04-24 20:18     ` Borislav Petkov
@ 2016-04-24 20:35       ` Andrey Utkin
  2016-04-24 20:51         ` Borislav Petkov
  0 siblings, 1 reply; 10+ messages in thread
From: Andrey Utkin @ 2016-04-24 20:35 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Paolo Bonzini, linux-kernel, x86, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin

On Sun, Apr 24, 2016 at 10:18:35PM +0200, Borislav Petkov wrote:
> On Sun, Apr 24, 2016 at 10:57:37PM +0300, Andrey Utkin wrote:
> > So current "make defconfig kvmconfig" works for you?
> 
> I don't do that - I do
> 
> make oldconfig
> make kvmconfig
> 
> and the second one adds the options which are not set in my .config.

Could you please test "make defconfig kvmconfig" how it boots?
The point of my patch is to enable user to end up with working kernel
for KVM guest without previously having any config, and without having
to configure anything manually.

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

* Re: [PATCH v2] Enhance kvmconfig
  2016-04-24 20:35       ` Andrey Utkin
@ 2016-04-24 20:51         ` Borislav Petkov
  2016-04-25  0:49           ` Andrey Utkin
  0 siblings, 1 reply; 10+ messages in thread
From: Borislav Petkov @ 2016-04-24 20:51 UTC (permalink / raw)
  To: Andrey Utkin
  Cc: Paolo Bonzini, linux-kernel, x86, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin

On Sun, Apr 24, 2016 at 11:35:53PM +0300, Andrey Utkin wrote:
> Could you please test "make defconfig kvmconfig" how it boots?
> The point of my patch is to enable user to end up with working kernel
> for KVM guest without previously having any config,

That doesn't work as you need to control the qemu options too.

The purpose of kvmconfig is to give you the bare minimum and thus
to save you a lot of time wasted searching for all those options in
Kconfig. You'd still need to tweak your guest kernel .config after that.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

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

* Re: [PATCH v2] Enhance kvmconfig
  2016-04-24 20:51         ` Borislav Petkov
@ 2016-04-25  0:49           ` Andrey Utkin
  2016-04-25 10:52             ` Borislav Petkov
  0 siblings, 1 reply; 10+ messages in thread
From: Andrey Utkin @ 2016-04-25  0:49 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Paolo Bonzini, linux-kernel, x86, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin

On Sun, Apr 24, 2016 at 10:51:29PM +0200, Borislav Petkov wrote:
> On Sun, Apr 24, 2016 at 11:35:53PM +0300, Andrey Utkin wrote:
> > Could you please test "make defconfig kvmconfig" how it boots?
> > The point of my patch is to enable user to end up with working kernel
> > for KVM guest without previously having any config,
> 
> That doesn't work as you need to control the qemu options too.

Could you please point, which ones?
I haven't changed any, and yet my host is running fine.

> The purpose of kvmconfig is to give you the bare minimum and thus
> to save you a lot of time wasted searching for all those options in
> Kconfig. You'd still need to tweak your guest kernel .config after that.

IMO current kvmconfig doesn't fulfill this purpose, because trying

- "make defconfig kvmconfig"
- "make localmodconfig kvmconfig"
- "gunzip -c /proc/config.gz > .config && make olddefconfig" (rescue
  system had way too old kernel I guess)

didn't save me a lot of hours wasted searching for all those options to
make it boot.

IMO "bare minimum" term makes sense if it boots. If it doesn't, then
"bare minimum" for what we are talking about?

Borislav, could you please tell, which options from this patch are you
using in your configs? Sorry to bother you.

Thank you for your interest.

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

* Re: [PATCH v2] Enhance kvmconfig
  2016-04-25  0:49           ` Andrey Utkin
@ 2016-04-25 10:52             ` Borislav Petkov
  0 siblings, 0 replies; 10+ messages in thread
From: Borislav Petkov @ 2016-04-25 10:52 UTC (permalink / raw)
  To: Andrey Utkin
  Cc: Paolo Bonzini, linux-kernel, x86, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin

On Mon, Apr 25, 2016 at 03:49:04AM +0300, Andrey Utkin wrote:
> IMO "bare minimum" term makes sense if it boots.

Boots where? On every system? You know that won't fly.

This bare minimum is trying to be of help only. No one says you should
be able to boot *every* guest kernel config with this.

For example, if your guest root fs image is ext4, then you must enable
ext4 support in the guest kernel. But that doesn't mean we need to carry
everything in kvmconfig. If we did, then we don't need it at all -
people can simply do "make allmodconfig" and have it all.

The idea of kvmconfig is to OR in the bare minimum of options into your
current .config and thus make the kernel more useful when booted as a
kvm guest - you'd still need to go and adjust it to your particular qemu
invocation.

In any case, here's how I'm booting my guests. You can see, for example,
that I'm using rtl8139 nic in the guest and for that I have it enabled
in my guest kernel .config.

$ qemu-system-x86_64
-enable-kvm
-gdb tcp::1234
-cpu Opteron_G5
-m 2048
-hda /home/boris/kvm/debian/sid-x86_64.img
-boot menu=off,order=c
-localtime
-net nic,model=rtl8139,macaddr=12:34:56:78:12:34
-net user,hostfwd=tcp::1235-:22
-usbdevice tablet
-kernel /home/boris/kernel/linux-2.6/arch/x86/boot/bzImage
-append "root=/dev/sda1 resume=/dev/sdb1 debug ignore_loglevel log_buf_len=16M earlyprintk=ttyS0,115200 console=ttyS0,115200 console=tty0 "
-monitor pty
-soundhw hda
-serial file:/home/boris/kvm/test-x86_64-1235.log
-snapshot
-smp 8
-virtfs local,path=/tmp,mount_tag=tmp,security_model=none

HTH.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

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

* Re: [PATCH v2] Enhance kvmconfig
  2016-04-24 16:30 ` Borislav Petkov
  2016-04-24 19:57   ` Andrey Utkin
@ 2016-05-09 12:16   ` Paolo Bonzini
  2016-05-09 15:13     ` Andrey Utkin
  1 sibling, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2016-05-09 12:16 UTC (permalink / raw)
  To: Borislav Petkov, Andrey Utkin
  Cc: linux-kernel, x86, Thomas Gleixner, Ingo Molnar, H. Peter Anvin



On 24/04/2016 18:30, Borislav Petkov wrote:
>> > +CONFIG_SCSI_VIRTIO=y
>> > +CONFIG_VIRTIO_INPUT=y
>> > +CONFIG_VIRTIO_MMIO=y
>> > +CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
>> > --
> Frankly, I'm still not sure we want to do this. Apparently, virtio is
> the way to go on kvm but it is not absolutely necessary to get a booting
> guest.
> 
> Paolo, what do you think?

I think adding virtio storage is a good idea for "make kvmconfig".

virtio-input is not _that_ useful on x86, but it's getting more useful
(recent QEMU can pass evdev events directly to a VM via virtio-input).
I'm ambivalent about it.

VIRTIO_MMIO should only be added by some ARM thing though.

Paolo

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

* Re: [PATCH v2] Enhance kvmconfig
  2016-05-09 12:16   ` Paolo Bonzini
@ 2016-05-09 15:13     ` Andrey Utkin
  0 siblings, 0 replies; 10+ messages in thread
From: Andrey Utkin @ 2016-05-09 15:13 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Borislav Petkov, linux-kernel, x86, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin

On Mon, May 09, 2016 at 02:16:55PM +0200, Paolo Bonzini wrote:
> I think adding virtio storage is a good idea for "make kvmconfig".
> 
> virtio-input is not _that_ useful on x86, but it's getting more useful
> (recent QEMU can pass evdev events directly to a VM via virtio-input).
> I'm ambivalent about it.
> 
> VIRTIO_MMIO should only be added by some ARM thing though.

Thank you for feedback. Have tested no-MMIO-stuff variant, works,
submitted patch v3.

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

end of thread, other threads:[~2016-05-09 15:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-23 17:26 [PATCH v2] Enhance kvmconfig Andrey Utkin
2016-04-24 16:30 ` Borislav Petkov
2016-04-24 19:57   ` Andrey Utkin
2016-04-24 20:18     ` Borislav Petkov
2016-04-24 20:35       ` Andrey Utkin
2016-04-24 20:51         ` Borislav Petkov
2016-04-25  0:49           ` Andrey Utkin
2016-04-25 10:52             ` Borislav Petkov
2016-05-09 12:16   ` Paolo Bonzini
2016-05-09 15:13     ` Andrey Utkin

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.