Linux-HyperV Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH RFC] kconfig: add hvconfig for Linux on Hyper-V
@ 2019-10-08 13:15 Wei Liu
  2019-10-08 16:03 ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2019-10-08 13:15 UTC (permalink / raw)
  To: Linux on Hyper-V List; +Cc: Linux Kernel List, Linux Kconfig List, Wei Liu

From: Wei Liu <liuwe@microsoft.com>

Add an config file snippet which enalbes additional options useful for
running the kernel in a Hyper-V guest.

The expected use case is a user provides an existing config file then
executes `make hvconfig`. It will merge those options with the
provided config file.

Based on similar concept for Xen and KVM.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
---
RFC: I only tested this on x86.  Although the config options included in
hv_guest.config don't seem to be arch-specific, we should probably
move the ones not yet implemented on Arm to an x86 specific config
file.
---
 Documentation/admin-guide/README.rst |  3 +++
 kernel/configs/hv_guest.config       | 33 ++++++++++++++++++++++++++++
 scripts/kconfig/Makefile             |  5 +++++
 3 files changed, 41 insertions(+)
 create mode 100644 kernel/configs/hv_guest.config

diff --git a/Documentation/admin-guide/README.rst b/Documentation/admin-guide/README.rst
index cc6151fc0845..d5f4389a7a2f 100644
--- a/Documentation/admin-guide/README.rst
+++ b/Documentation/admin-guide/README.rst
@@ -224,6 +224,9 @@ Configuring the kernel
      "make xenconfig"   Enable additional options for xen dom0 guest kernel
                         support.
 
+     "make hvconfig"    Enable additional options for Hyper-V guest kernel
+                        support.
+
      "make tinyconfig"  Configure the tiniest possible kernel.
 
    You can find more information on using the Linux kernel config tools
diff --git a/kernel/configs/hv_guest.config b/kernel/configs/hv_guest.config
new file mode 100644
index 000000000000..0e71e34a2d4d
--- /dev/null
+++ b/kernel/configs/hv_guest.config
@@ -0,0 +1,33 @@
+CONFIG_NET=y
+CONFIG_NET_CORE=y
+CONFIG_NETDEVICES=y
+CONFIG_BLOCK=y
+CONFIG_BLK_DEV=y
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_INET=y
+CONFIG_TTY=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_BINFMT_ELF=y
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_VIRTUALIZATION=y
+CONFIG_HYPERVISOR_GUEST=y
+CONFIG_PARAVIRT=y
+CONFIG_HYPERV=y
+CONFIG_HYPERV_VSOCKETS=y
+CONFIG_PCI_HYPERV=y
+CONFIG_PCI_HYPERV_INTERFACE=y
+CONFIG_HYPERV_STORAGE=y
+CONFIG_HYPERV_NET=y
+CONFIG_HYPERV_KEYBOARD=y
+CONFIG_FB_HYPERV=y
+CONFIG_HID_HYPERV_MOUSE=y
+CONFIG_HYPERV=y
+CONFIG_HYPERV_TIMER=y
+CONFIG_HYPERV_UTILS=y
+CONFIG_HYPERV_BALLOON=y
+CONFIG_HYPERV_IOMMU=y
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index ef2f2336c469..2ee46301b22e 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -104,6 +104,10 @@ PHONY += xenconfig
 xenconfig: xen.config
 	@:
 
+PHONY += hvconfig
+hvconfig: hv_guest.config
+	@:
+
 PHONY += tinyconfig
 tinyconfig:
 	$(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config
@@ -138,6 +142,7 @@ help:
 	@echo  '                    default value without prompting'
 	@echo  '  kvmconfig	  - Enable additional options for kvm guest kernel support'
 	@echo  '  xenconfig       - Enable additional options for xen dom0 and guest kernel support'
+	@echo  '  hvconfig        - Enable additional options for Hyper-V guest kernel support'
 	@echo  '  tinyconfig	  - Configure the tiniest possible kernel'
 	@echo  '  testconfig	  - Run Kconfig unit tests (requires python3 and pytest)'
 
-- 
2.20.1


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

* Re: [PATCH RFC] kconfig: add hvconfig for Linux on Hyper-V
  2019-10-08 13:15 [PATCH RFC] kconfig: add hvconfig for Linux on Hyper-V Wei Liu
@ 2019-10-08 16:03 ` Masahiro Yamada
  2019-10-08 16:10   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2019-10-08 16:03 UTC (permalink / raw)
  To: Wei Liu
  Cc: Linux on Hyper-V List, Linux Kernel List, Linux Kconfig List, Wei Liu

On Tue, Oct 8, 2019 at 10:15 PM Wei Liu <wei.liu@kernel.org> wrote:
>
> From: Wei Liu <liuwe@microsoft.com>
>
> Add an config file snippet which enalbes additional options useful for
> running the kernel in a Hyper-V guest.
>
> The expected use case is a user provides an existing config file then
> executes `make hvconfig`. It will merge those options with the
> provided config file.
>
> Based on similar concept for Xen and KVM.
>
> Signed-off-by: Wei Liu <liuwe@microsoft.com>
> ---
> RFC: I only tested this on x86.  Although the config options included in
> hv_guest.config don't seem to be arch-specific, we should probably
> move the ones not yet implemented on Arm to an x86 specific config
> file.
> ---
>  Documentation/admin-guide/README.rst |  3 +++
>  kernel/configs/hv_guest.config       | 33 ++++++++++++++++++++++++++++
>  scripts/kconfig/Makefile             |  5 +++++
>  3 files changed, 41 insertions(+)
>  create mode 100644 kernel/configs/hv_guest.config
>
> diff --git a/Documentation/admin-guide/README.rst b/Documentation/admin-guide/README.rst
> index cc6151fc0845..d5f4389a7a2f 100644
> --- a/Documentation/admin-guide/README.rst
> +++ b/Documentation/admin-guide/README.rst
> @@ -224,6 +224,9 @@ Configuring the kernel
>       "make xenconfig"   Enable additional options for xen dom0 guest kernel
>                          support.
>
> +     "make hvconfig"    Enable additional options for Hyper-V guest kernel
> +                        support.
> +
>       "make tinyconfig"  Configure the tiniest possible kernel.
>
>     You can find more information on using the Linux kernel config tools
> diff --git a/kernel/configs/hv_guest.config b/kernel/configs/hv_guest.config
> new file mode 100644
> index 000000000000..0e71e34a2d4d
> --- /dev/null
> +++ b/kernel/configs/hv_guest.config
> @@ -0,0 +1,33 @@
> +CONFIG_NET=y
> +CONFIG_NET_CORE=y
> +CONFIG_NETDEVICES=y
> +CONFIG_BLOCK=y
> +CONFIG_BLK_DEV=y
> +CONFIG_NETWORK_FILESYSTEMS=y
> +CONFIG_INET=y
> +CONFIG_TTY=y
> +CONFIG_SERIAL_8250=y
> +CONFIG_SERIAL_8250_CONSOLE=y
> +CONFIG_IP_PNP=y
> +CONFIG_IP_PNP_DHCP=y
> +CONFIG_BINFMT_ELF=y
> +CONFIG_PCI=y
> +CONFIG_PCI_MSI=y
> +CONFIG_DEBUG_KERNEL=y
> +CONFIG_VIRTUALIZATION=y
> +CONFIG_HYPERVISOR_GUEST=y
> +CONFIG_PARAVIRT=y
> +CONFIG_HYPERV=y
> +CONFIG_HYPERV_VSOCKETS=y
> +CONFIG_PCI_HYPERV=y
> +CONFIG_PCI_HYPERV_INTERFACE=y
> +CONFIG_HYPERV_STORAGE=y
> +CONFIG_HYPERV_NET=y
> +CONFIG_HYPERV_KEYBOARD=y
> +CONFIG_FB_HYPERV=y
> +CONFIG_HID_HYPERV_MOUSE=y
> +CONFIG_HYPERV=y
> +CONFIG_HYPERV_TIMER=y
> +CONFIG_HYPERV_UTILS=y
> +CONFIG_HYPERV_BALLOON=y
> +CONFIG_HYPERV_IOMMU=y
> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> index ef2f2336c469..2ee46301b22e 100644
> --- a/scripts/kconfig/Makefile
> +++ b/scripts/kconfig/Makefile
> @@ -104,6 +104,10 @@ PHONY += xenconfig
>  xenconfig: xen.config
>         @:
>
> +PHONY += hvconfig
> +hvconfig: hv_guest.config
> +       @:
> +


Does this need to be hooked up to kconfig Makefile?

In my understanding, this code provides
"make hvconfig" as a shorthand for "make hv_guest.config"

Please do not do this.


See "xenconfig" as a bad example.

"make xenconfig" is a shorthand of "make xen.config".
This exists to save just one character typing.


If I allow this, people would push more and more random pointless shorthands,
which are essentially unrelated to kconfig.


kvmconfig and xenconfig are just historical mistakes.


Please drop the changes to scripts/kconfig/Makefile.

Also, please do not use misleading "kconfig:" for the subject prefix.
You can use the subject prefix "hyper-v:" or something.


Thanks.


>  PHONY += tinyconfig
>  tinyconfig:
>         $(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config
> @@ -138,6 +142,7 @@ help:
>         @echo  '                    default value without prompting'
>         @echo  '  kvmconfig       - Enable additional options for kvm guest kernel support'
>         @echo  '  xenconfig       - Enable additional options for xen dom0 and guest kernel support'
> +       @echo  '  hvconfig        - Enable additional options for Hyper-V guest kernel support'
>         @echo  '  tinyconfig      - Configure the tiniest possible kernel'
>         @echo  '  testconfig      - Run Kconfig unit tests (requires python3 and pytest)'
>
> --
> 2.20.1
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH RFC] kconfig: add hvconfig for Linux on Hyper-V
  2019-10-08 16:03 ` Masahiro Yamada
@ 2019-10-08 16:10   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2019-10-08 16:10 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Wei Liu, Linux on Hyper-V List, Linux Kernel List,
	Linux Kconfig List, Wei Liu

On Wed, Oct 09, 2019 at 01:03:19AM +0900, Masahiro Yamada wrote:
[...]
> > diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> > index ef2f2336c469..2ee46301b22e 100644
> > --- a/scripts/kconfig/Makefile
> > +++ b/scripts/kconfig/Makefile
> > @@ -104,6 +104,10 @@ PHONY += xenconfig
> >  xenconfig: xen.config
> >         @:
> >
> > +PHONY += hvconfig
> > +hvconfig: hv_guest.config
> > +       @:
> > +
> 
> 
> Does this need to be hooked up to kconfig Makefile?
> 

It is not strictly necessary. Just thought it would be nice to follow
existing examples.

> In my understanding, this code provides
> "make hvconfig" as a shorthand for "make hv_guest.config"
> 

Yes that's correct.

> Please do not do this.
> 
> 
> See "xenconfig" as a bad example.
> 
> "make xenconfig" is a shorthand of "make xen.config".
> This exists to save just one character typing.
> 
> 
> If I allow this, people would push more and more random pointless shorthands,
> which are essentially unrelated to kconfig.
> 
> 
> kvmconfig and xenconfig are just historical mistakes.
> 
> 
> Please drop the changes to scripts/kconfig/Makefile.

OK.

> 
> Also, please do not use misleading "kconfig:" for the subject prefix.
> You can use the subject prefix "hyper-v:" or something.
> 

OK.

Wei.

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08 13:15 [PATCH RFC] kconfig: add hvconfig for Linux on Hyper-V Wei Liu
2019-10-08 16:03 ` Masahiro Yamada
2019-10-08 16:10   ` Wei Liu

Linux-HyperV Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hyperv/0 linux-hyperv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hyperv linux-hyperv/ https://lore.kernel.org/linux-hyperv \
		linux-hyperv@vger.kernel.org linux-hyperv@archiver.kernel.org
	public-inbox-index linux-hyperv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hyperv


AGPL code for this site: git clone https://public-inbox.org/ public-inbox