All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU
@ 2018-12-27  6:33 Yang Zhong
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 01/25] build: actually use CONFIG_PAM Yang Zhong
                   ` (25 more replies)
  0 siblings, 26 replies; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

Happy Christmas && Happy New Year!

This Kconfig implementation is rebased from Paolo's branch
https://github.com/bonzini/qemu/commits/kconfig

I only rebased the x86 platform related arch and extended devices
definitions
https://github.com/yangzhon/qemu/commits/topic/upstream/Kconfig

The current RFC patches only support
(*) x86_64 platform
    Once design is fixed, we can do other archs.

(*) defconfig
    "randconfig" build has some issues, which are mostly related
    with CONFIG* in Kconfig.host abd configure. In randconfig mode,
    some CONFIG* has different setting value in config-host.mak and
    %/config-device.mak, which make QEMU build failure.

(*) Kconfig in hw/ directory

The current configure and build command are same with previous
commands and if we want to disable or enable some features, like
"tcg", we still need add "--enable/--disable-tcg" in configure
command line. If we want to disable one emulation device, we can
disable this in related Kconfig file in hw/ directory.

The current build command
(*) ./configure --target-list=x86_64-softmmu
(*) make


Since the Kconfig language replace traditional CONFIG_* in
default-config/%-softmmu.mak, the %-softmmu.mak file only
define embeded boards or machines, like 440fx and Q35 in x86_64
platform. The Kconfig has already defined dependency topology
between different Kconfig files, but there are still some issues

(*) Kconfig for configure(config-host.mak)
    Some CONFIG* in configure  need some logic to generate, those
    are hard to input this CONFIG* in Kconfig.host or Kconfig* file.

(*) Kconfig for %config-target.mak
    The CONFIG* in %/config-target.mak file, this is still related
    with configure.

(*) randconfig support issue.

Before this RFC patches, we have talked Kconfig in another thread
http://lists.nongnu.org/archive/html/qemu-devel/2018-09/msg02827.html

Please give your comments on this RFC thread, many thanks!

Paolo Bonzini (18):
  build: actually use CONFIG_PAM
  hw/i386/Makefile.objs: Build pc_piix* and pc_q35 boards
  minikconfig: add parser skeleton
  minikconfig: add AST
  minikconfig: add semantic analysis
  kconfig: introduce kconfig files
  build: switch to Kconfig
  ide: express dependencies with Kconfig
  build: convert pci.mak to Kconfig
  build: convert sound.mak to Kconfig
  build: convert usb.mak to Kconfig
  scsi: express dependencies with Kconfig
  bluetooth: express dependencies with Kconfig
  isa: express dependencies with kconfig
  i386: express dependencies with Kconfig
  i2c: express dependencies with Kconfig
  ptimer: express dependencies with Kconfig
  minikconf: implement allyesconfig, allnoconfig, randconfig, defconfig

Yang Zhong (7):
  hw/display: make edid configurable
  edid: express dependencies with kconfig
  hyperv: express dependencies with kconfig
  virtio: make virtio dependencies with Kconfig
  i386-softmmu.mak: remove all CONFIG_* except boards definitions
  x86_64-softmmu.mak: remove i386-softmmu.mak include
  Makefile: only support defconfig

 Kconfig.host                       |  24 +
 Makefile                           |  19 +-
 Makefile.target                    |   7 +-
 default-configs/hyperv.mak         |   2 -
 default-configs/i386-softmmu.mak   |  72 +--
 default-configs/pci.mak            |  49 ---
 default-configs/sound.mak          |   4 -
 default-configs/usb.mak            |  11 -
 default-configs/x86_64-softmmu.mak |   6 +-
 hw/9pfs/Kconfig                    |   4 +
 hw/Kconfig                         |  50 +++
 hw/Makefile.objs                   |   4 +-
 hw/acpi/Kconfig                    |  26 ++
 hw/adc/Kconfig                     |   2 +
 hw/audio/Kconfig                   |  52 +++
 hw/block/Kconfig                   |  37 ++
 hw/bt/Kconfig                      |   2 +
 hw/char/Kconfig                    |  41 ++
 hw/core/Kconfig                    |  11 +
 hw/cpu/Kconfig                     |   8 +
 hw/display/Kconfig                 | 106 +++++
 hw/display/Makefile.objs           |   4 +-
 hw/dma/Kconfig                     |  20 +
 hw/gpio/Kconfig                    |   9 +
 hw/hyperv/Kconfig                  |   6 +
 hw/i2c/Kconfig                     |  27 ++
 hw/i2c/Makefile.objs               |   7 +-
 hw/i386/Kconfig                    |  99 +++++
 hw/i386/Makefile.objs              |   4 +-
 hw/ide/Kconfig                     |  53 +++
 hw/input/Kconfig                   |  28 ++
 hw/intc/Kconfig                    |  55 +++
 hw/ipack/Kconfig                   |   4 +
 hw/ipmi/Kconfig                    |  14 +
 hw/isa/Kconfig                     |  30 ++
 hw/mem/Kconfig                     |   8 +
 hw/misc/Kconfig                    | 106 +++++
 hw/misc/macio/Kconfig              |  11 +
 hw/net/Kconfig                     | 120 +++++
 hw/nvram/Kconfig                   |   8 +
 hw/pci-bridge/Kconfig              |  20 +
 hw/pci-host/Kconfig                |  44 ++
 hw/pci-host/Makefile.objs          |   2 +-
 hw/pci/Kconfig                     |   2 +
 hw/pcmcia/Kconfig                  |   2 +
 hw/scsi/Kconfig                    |  51 +++
 hw/scsi/Makefile.objs              |   2 +-
 hw/sd/Kconfig                      |  14 +
 hw/smbios/Kconfig                  |   2 +
 hw/ssi/Kconfig                     |  14 +
 hw/timer/Kconfig                   |  62 +++
 hw/tpm/Kconfig                     |  20 +
 hw/usb/Kconfig                     |  90 ++++
 hw/vfio/Kconfig                    |  11 +
 hw/virtio/Kconfig                  |  28 ++
 hw/watchdog/Kconfig                |  15 +
 rules.mak                          |   2 +-
 scripts/make_device_config.sh      |  30 --
 scripts/minikconf.py               | 682 +++++++++++++++++++++++++++++
 59 files changed, 2064 insertions(+), 179 deletions(-)
 create mode 100644 Kconfig.host
 delete mode 100644 default-configs/hyperv.mak
 delete mode 100644 default-configs/pci.mak
 delete mode 100644 default-configs/sound.mak
 delete mode 100644 default-configs/usb.mak
 create mode 100644 hw/9pfs/Kconfig
 create mode 100644 hw/Kconfig
 create mode 100644 hw/acpi/Kconfig
 create mode 100644 hw/adc/Kconfig
 create mode 100644 hw/audio/Kconfig
 create mode 100644 hw/block/Kconfig
 create mode 100644 hw/bt/Kconfig
 create mode 100644 hw/char/Kconfig
 create mode 100644 hw/core/Kconfig
 create mode 100644 hw/cpu/Kconfig
 create mode 100644 hw/display/Kconfig
 create mode 100644 hw/dma/Kconfig
 create mode 100644 hw/gpio/Kconfig
 create mode 100644 hw/hyperv/Kconfig
 create mode 100644 hw/i2c/Kconfig
 create mode 100644 hw/i386/Kconfig
 create mode 100644 hw/ide/Kconfig
 create mode 100644 hw/input/Kconfig
 create mode 100644 hw/intc/Kconfig
 create mode 100644 hw/ipack/Kconfig
 create mode 100644 hw/ipmi/Kconfig
 create mode 100644 hw/isa/Kconfig
 create mode 100644 hw/mem/Kconfig
 create mode 100644 hw/misc/Kconfig
 create mode 100644 hw/misc/macio/Kconfig
 create mode 100644 hw/net/Kconfig
 create mode 100644 hw/nvram/Kconfig
 create mode 100644 hw/pci-bridge/Kconfig
 create mode 100644 hw/pci-host/Kconfig
 create mode 100644 hw/pci/Kconfig
 create mode 100644 hw/pcmcia/Kconfig
 create mode 100644 hw/scsi/Kconfig
 create mode 100644 hw/sd/Kconfig
 create mode 100644 hw/smbios/Kconfig
 create mode 100644 hw/ssi/Kconfig
 create mode 100644 hw/timer/Kconfig
 create mode 100644 hw/tpm/Kconfig
 create mode 100644 hw/usb/Kconfig
 create mode 100644 hw/vfio/Kconfig
 create mode 100644 hw/virtio/Kconfig
 create mode 100644 hw/watchdog/Kconfig
 delete mode 100644 scripts/make_device_config.sh
 create mode 100644 scripts/minikconf.py

-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 01/25] build: actually use CONFIG_PAM
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
@ 2018-12-27  6:33 ` Yang Zhong
  2019-01-03 14:15   ` Thomas Huth
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 02/25] hw/i386/Makefile.objs: Build pc_piix* and pc_q35 boards Yang Zhong
                   ` (24 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

Do not link it unconditionally into all binaries.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/pci-host/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/pci-host/Makefile.objs b/hw/pci-host/Makefile.objs
index 6d6597c065..9d7e7cd1b8 100644
--- a/hw/pci-host/Makefile.objs
+++ b/hw/pci-host/Makefile.objs
@@ -1,4 +1,4 @@
-common-obj-y += pam.o
+common-obj-$(CONFIG_PAM) += pam.o
 
 # PPC devices
 common-obj-$(CONFIG_PREP_PCI) += prep.o
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 02/25] hw/i386/Makefile.objs: Build pc_piix* and pc_q35 boards
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 01/25] build: actually use CONFIG_PAM Yang Zhong
@ 2018-12-27  6:33 ` Yang Zhong
  2019-01-03 14:30   ` Thomas Huth
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 03/25] minikconfig: add parser skeleton Yang Zhong
                   ` (23 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong,
	Ákos Kovács

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1236 bytes --]

From: Paolo Bonzini <pbonzini@redhat.com>

CONFIG_PIIX and CONFIG_Q35 created for the pc board object files. These
are enabled automatically at default-configs/i386-softmmu.mak and
default-configs/x86_64-softmmu.mak

Signed-off-by: Ákos Kovács <akoskovacs@gmx.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 default-configs/i386-softmmu.mak | 2 ++
 hw/i386/Makefile.objs            | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 64c998c4c8..65ef98be18 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -67,3 +67,5 @@ CONFIG_I2C=y
 CONFIG_SEV=$(CONFIG_KVM)
 CONFIG_VTD=y
 CONFIG_AMD_IOMMU=y
+CONFIG_I440FX=y
+CONFIG_Q35=y
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index fa87a14152..3de7ca2bb9 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -1,6 +1,8 @@
 obj-$(CONFIG_KVM) += kvm/
 obj-y += multiboot.o
-obj-y += pc.o pc_piix.o pc_q35.o
+obj-y += pc.o
+obj-$(CONFIG_I440FX) += pc_piix.o
+obj-$(CONFIG_Q35) += pc_q35.o
 obj-y += pc_sysfw.o
 obj-$(CONFIG_VTD) += x86-iommu.o intel_iommu.o
 obj-$(CONFIG_AMD_IOMMU) += x86-iommu.o amd_iommu.o
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 03/25] minikconfig: add parser skeleton
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 01/25] build: actually use CONFIG_PAM Yang Zhong
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 02/25] hw/i386/Makefile.objs: Build pc_piix* and pc_q35 boards Yang Zhong
@ 2018-12-27  6:33 ` Yang Zhong
  2019-01-04 13:36   ` Paolo Bonzini
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 04/25] minikconfig: add AST Yang Zhong
                   ` (22 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 15578 bytes --]

From: Paolo Bonzini <pbonzini@redhat.com>

This implements a scanner and recursive descent parser for Kconfig-like
configuration files.  The only "action" of the parser is for now to
detect undefined variables and process include files.

The main differences between Kconfig and this are:

* only the "bool" type is supported

* variables can only be defined once

* choices are not supported (but they could be added as syntactic
sugar for multiple Boolean values)

* menus and other graphical concepts (prompts, help text) are not
supported

* assignments ("CONFIG_FOO=y", "CONFIG_FOO=n") are parsed as part
of the Kconfig language, not as a separate file.

The idea was originally by Ákos Kovács, but I could not find his
implementation so I had to redo it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/minikconf.py | 425 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 425 insertions(+)
 create mode 100644 scripts/minikconf.py

diff --git a/scripts/minikconf.py b/scripts/minikconf.py
new file mode 100644
index 0000000000..9e33d80514
--- /dev/null
+++ b/scripts/minikconf.py
@@ -0,0 +1,425 @@
+#
+# Mini-Kconfig parser
+#
+# Copyright (c) 2015 Red Hat Inc.
+#
+# Authors:
+#  Paolo Bonzini <pbonzini@redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2
+# or, at your option, any later version.  See the COPYING file in
+# the top-level directory.
+
+import os
+import sys
+
+__all__ = [ 'KconfigParserError', 'KconfigData', 'KconfigParser' ]
+
+# -------------------------------------------
+# KconfigData implements the Kconfig semantics.  For now it can only
+# detect undefined symbols, i.e. symbols that were referenced in
+# assignments or dependencies but were not declared with "config FOO".
+#
+# Semantic actions are represented by methods called do_*.  The do_var
+# method return the semantic value of a variable (which right now is
+# just its name).
+# -------------------------------------------
+
+class KconfigData:
+    def __init__(self):
+        self.previously_included = []
+        self.incl_info = None
+        self.defined_vars = set()
+        self.referenced_vars = set()
+
+    # semantic analysis -------------
+
+    def check_undefined(self):
+        undef = False
+        for i in self.referenced_vars:
+            if not (i in self.defined_vars):
+                print "undefined symbol %s" % (i)
+                undef = True
+        return undef
+
+    # semantic actions -------------
+
+    def do_declaration(self, var):
+        if (var in self.defined_vars):
+            raise Exception('variable "' + var + '" defined twice')
+
+        self.defined_vars.add(var)
+
+    # var is a string with the variable's name.
+    #
+    # For now this just returns the variable's name itself.
+    def do_var(self, var):
+        self.referenced_vars.add(var)
+        return var
+
+    def do_assignment(self, var, val):
+        pass
+
+    def do_default(self, var, val, cond=None):
+        pass
+
+    def do_depends_on(self, var, expr):
+        pass
+
+    def do_select(self, var, symbol, cond=None):
+        pass
+
+# -------------------------------------------
+# KconfigParser implements a recursive descent parser for (simplified)
+# Kconfig syntax.  The static parse() method returns a KconfigData
+# object, from which it is possible to build a BDD and compute a
+# configuration
+# -------------------------------------------
+
+# tokens table
+TOKENS = {}
+TOK_NONE = -1
+TOK_LPAREN = 0;   TOKENS[TOK_LPAREN] = '"("';
+TOK_RPAREN = 1;   TOKENS[TOK_RPAREN] = '")"';
+TOK_EQUAL = 2;    TOKENS[TOK_EQUAL] = '"="';
+TOK_AND = 3;      TOKENS[TOK_AND] = '"&&"';
+TOK_OR = 4;       TOKENS[TOK_OR] = '"||"';
+TOK_NOT = 5;      TOKENS[TOK_NOT] = '"!"';
+TOK_DEPENDS = 6;  TOKENS[TOK_DEPENDS] = '"depends"';
+TOK_ON = 7;       TOKENS[TOK_ON] = '"on"';
+TOK_SELECT = 8;   TOKENS[TOK_SELECT] = '"select"';
+TOK_CONFIG = 9;   TOKENS[TOK_CONFIG] = '"config"';
+TOK_DEFAULT = 10; TOKENS[TOK_DEFAULT] = '"default"';
+TOK_Y = 11;       TOKENS[TOK_Y] = '"y"';
+TOK_N = 12;       TOKENS[TOK_N] = '"n"';
+TOK_SOURCE = 13;  TOKENS[TOK_SOURCE] = '"source"';
+TOK_BOOL = 14;    TOKENS[TOK_BOOL] = '"bool"';
+TOK_IF = 15;      TOKENS[TOK_IF] = '"if"';
+TOK_ID = 16;      TOKENS[TOK_ID] = 'identifier';
+TOK_EOF = 17;     TOKENS[TOK_EOF] = 'end of file';
+
+class KconfigParserError(Exception):
+    def __init__(self, parser, msg, tok=None):
+        self.loc = parser.location()
+        tok = tok or parser.tok
+        if tok != TOK_NONE:
+            msg = '%s before %s' %(msg, TOKENS[tok])
+        self.msg = msg
+
+    def __str__(self):
+        return "%s: %s" % (self.loc, self.msg)
+
+class KconfigParser:
+    @classmethod
+    def parse(self, fp):
+        data = KconfigData()
+        parser = KconfigParser(data)
+        parser.parse_file(fp)
+        if data.check_undefined():
+            raise KconfigParserError(parser, "there were undefined symbols")
+
+        return data
+
+    def __init__(self, data):
+        self.data = data
+
+    def parse_file(self, fp):
+        self.abs_fname = os.path.abspath(fp.name)
+        self.fname = fp.name
+        self.data.previously_included.append(self.abs_fname)
+        self.src = fp.read()
+        if self.src == '' or self.src[-1] != '\n':
+            self.src += '\n'
+        self.cursor = 0
+        self.line = 1
+        self.line_pos = 0
+        self.get_token()
+        self.parse_config()
+
+    # file management -----
+
+    def error_path(self):
+        inf = self.data.incl_info
+        res = ""
+        while inf:
+            res = ("In file included from %s:%d:\n" % (inf['file'],
+                                                       inf['line'])) + res
+            inf = inf['parent']
+        return res
+
+    def location(self):
+        col = 1
+        for ch in self.src[self.line_pos:self.pos]:
+            if ch == '\t':
+                col += 8 - ((col - 1) % 8)
+            else:
+                col += 1
+        return '%s%s:%d:%d' %(self.error_path(), self.fname, self.line, col)
+
+    def do_include(self, include):
+        incl_abs_fname = os.path.join(os.path.dirname(self.abs_fname),
+                                      include)
+        # catch inclusion cycle
+        inf = self.data.incl_info
+        while inf:
+            if incl_abs_fname == os.path.abspath(inf['file']):
+                raise KconfigParserError(self, "Inclusion loop for %s"
+                                    % include)
+            inf = inf['parent']
+
+        # skip multiple include of the same file
+        if incl_abs_fname in self.data.previously_included:
+            return
+        try:
+            fp = open(incl_abs_fname, 'r')
+        except IOError, e:
+            raise KconfigParserError(self,
+                                '%s: %s' % (e.strerror, include))
+
+        inf = self.data.incl_info
+        self.data.incl_info = { 'file': self.fname, 'line': self.line,
+                'parent': inf }
+        KconfigParser(self.data).parse_file(fp)
+        self.data.incl_info = inf
+
+    # recursive descent parser -----
+
+    # y_or_n: Y | N
+    def parse_y_or_n(self):
+        if self.tok == TOK_Y:
+            self.get_token()
+            return True
+        if self.tok == TOK_N:
+            self.get_token()
+            return False
+        raise KconfigParserError(self, 'Expected "y" or "n"')
+
+    # var: ID
+    def parse_var(self):
+        if self.tok == TOK_ID:
+            val = self.val
+            self.get_token()
+            return self.data.do_var(val)
+        else:
+            raise KconfigParserError(self, 'Expected identifier')
+
+    # assignment_var: ID (starting with "CONFIG_")
+    def parse_assignment_var(self):
+        if self.tok == TOK_ID:
+            val = self.val
+            if not val.startswith("CONFIG_"):
+                raise KconfigParserError(self,
+                           'Expected identifier starting with "CONFIG_"', TOK_NONE)
+            self.get_token()
+            return self.data.do_var(val[7:])
+        else:
+            raise KconfigParserError(self, 'Expected identifier')
+
+    # assignment: var EQUAL y_or_n
+    def parse_assignment(self):
+        var = self.parse_assignment_var()
+        if self.tok != TOK_EQUAL:
+            raise KconfigParserError(self, 'Expected "="')
+        self.get_token()
+        self.data.do_assignment(var, self.parse_y_or_n())
+
+    # primary: NOT primary
+    #       | LPAREN expr RPAREN
+    #       | var
+    def parse_primary(self):
+        if self.tok == TOK_NOT:
+            self.get_token()
+            self.parse_primary()
+        elif self.tok == TOK_LPAREN:
+            self.get_token()
+            self.parse_expr()
+            if self.tok != TOK_RPAREN:
+                raise KconfigParserError(self, 'Expected ")"')
+            self.get_token()
+        elif self.tok == TOK_ID:
+            self.parse_var()
+        else:
+            raise KconfigParserError(self, 'Expected "!" or "(" or identifier')
+
+    # disj: primary (OR primary)*
+    def parse_disj(self):
+        self.parse_primary()
+        while self.tok == TOK_OR:
+            self.get_token()
+            self.parse_primary()
+
+    # expr: disj (AND disj)*
+    def parse_expr(self):
+        self.parse_disj()
+        while self.tok == TOK_AND:
+            self.get_token()
+            self.parse_disj()
+
+    # condition: IF expr
+    #       | empty
+    def parse_condition(self):
+        if self.tok == TOK_IF:
+            self.get_token()
+            return self.parse_expr()
+        else:
+            return None
+
+    # property: DEFAULT y_or_n condition
+    #       | DEPENDS ON expr
+    #       | SELECT var condition
+    #       | BOOL
+    def parse_property(self, var):
+        if self.tok == TOK_DEFAULT:
+            self.get_token()
+            val = self.parse_y_or_n()
+            cond = self.parse_condition()
+            self.data.do_default(var, val, cond)
+        elif self.tok == TOK_DEPENDS:
+            self.get_token()
+            if self.tok != TOK_ON:
+                raise KconfigParserError(self, 'Expected "on"')
+            self.get_token()
+            self.data.do_depends_on(var, self.parse_expr())
+        elif self.tok == TOK_SELECT:
+            self.get_token()
+            symbol = self.parse_var()
+            cond = self.parse_condition()
+            self.data.do_select(var, symbol, cond)
+        elif self.tok == TOK_BOOL:
+            self.get_token()
+        else:
+            raise KconfigParserError(self, 'Error in recursive descent?')
+
+    # properties: properties property
+    #       | /* empty */
+    def parse_properties(self, var):
+        had_default = False
+        while self.tok == TOK_DEFAULT or self.tok == TOK_DEPENDS or \
+              self.tok == TOK_SELECT or self.tok == TOK_BOOL:
+            self.parse_property(var)
+        self.data.do_default(var, False)
+
+        # for nicer error message
+        if self.tok != TOK_SOURCE and self.tok != TOK_CONFIG and \
+           self.tok != TOK_ID and self.tok != TOK_EOF:
+            raise KconfigParserError(self, 'expected "source", "config", identifier, '
+                    + '"default", "depends on" or "select"')
+
+    # declaration: config var properties
+    def parse_declaration(self):
+        if self.tok == TOK_CONFIG:
+            self.get_token()
+            var = self.parse_var()
+            self.data.do_declaration(var)
+            self.parse_properties(var)
+        else:
+            raise KconfigParserError(self, 'Error in recursive descent?')
+
+    # clause: SOURCE
+    #       | declaration
+    #       | assignment
+    def parse_clause(self):
+        if self.tok == TOK_SOURCE:
+            val = self.val
+            self.get_token()
+            self.do_include(val)
+        elif self.tok == TOK_CONFIG:
+            self.parse_declaration()
+        elif self.tok == TOK_ID:
+            self.parse_assignment()
+        else:
+            raise KconfigParserError(self, 'expected "source", "config" or identifier')
+
+    # config: clause+ EOF
+    def parse_config(self):
+        while self.tok != TOK_EOF:
+            self.parse_clause()
+        return self.data
+
+    # scanner -----
+
+    def get_token(self):
+        while True:
+            self.tok = self.src[self.cursor]
+            self.pos = self.cursor
+            self.cursor += 1
+
+            self.val = None
+            self.tok = self.scan_token()
+            if self.tok is not None:
+                return
+
+    def check_keyword(self, rest):
+        if not self.src.startswith(rest, self.cursor):
+            return False
+        length = len(rest)
+        if self.src[self.cursor + length].isalnum() or self.src[self.cursor + length] == '|':
+            return False
+        self.cursor += length
+        return True
+
+    def scan_token(self):
+        if self.tok == '#':
+            self.cursor = self.src.find('\n', self.cursor)
+            return None
+        elif self.tok == '=':
+            return TOK_EQUAL
+        elif self.tok == '(':
+            return TOK_LPAREN
+        elif self.tok == ')':
+            return TOK_RPAREN
+        elif self.tok == '&' and self.src[self.pos+1] == '&':
+            self.cursor += 1
+            return TOK_AND
+        elif self.tok == '|' and self.src[self.pos+1] == '|':
+            self.cursor += 1
+            return TOK_OR
+        elif self.tok == '!':
+            return TOK_NOT
+        elif self.tok == 'd' and self.check_keyword("epends"):
+            return TOK_DEPENDS
+        elif self.tok == 'o' and self.check_keyword("n"):
+            return TOK_ON
+        elif self.tok == 's' and self.check_keyword("elect"):
+            return TOK_SELECT
+        elif self.tok == 'c' and self.check_keyword("onfig"):
+            return TOK_CONFIG
+        elif self.tok == 'd' and self.check_keyword("efault"):
+            return TOK_DEFAULT
+        elif self.tok == 'b' and self.check_keyword("ool"):
+            return TOK_BOOL
+        elif self.tok == 'i' and self.check_keyword("f"):
+            return TOK_IF
+        elif self.tok == 'y' and self.check_keyword(""):
+            return TOK_Y
+        elif self.tok == 'n' and self.check_keyword(""):
+            return TOK_N
+        elif (self.tok == 's' and self.check_keyword("ource")) or \
+              self.tok == 'i' and self.check_keyword("nclude"):
+            # source FILENAME
+            # include FILENAME
+            while self.src[self.cursor].isspace():
+                self.cursor += 1
+            start = self.cursor
+            self.cursor = self.src.find('\n', self.cursor)
+            self.val = self.src[start:self.cursor]
+            return TOK_SOURCE
+        elif self.tok.isalpha():
+            # identifier
+            while self.src[self.cursor].isalnum() or self.src[self.cursor] == '_':
+                self.cursor += 1
+            self.val = self.src[self.pos:self.cursor]
+            return TOK_ID
+        elif self.tok == '\n':
+            if self.cursor == len(self.src):
+                return TOK_EOF
+            self.line += 1
+            self.line_pos = self.cursor
+        elif not self.tok.isspace():
+            raise KconfigParserError(self, 'Stray "%s"' % self.tok)
+
+        return None
+
+if __name__ == '__main__':
+    fname = len(sys.argv) > 1 and sys.argv[1] or 'Kconfig.test'
+    KconfigParser.parse(open(fname, 'r'))
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 04/25] minikconfig: add AST
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (2 preceding siblings ...)
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 03/25] minikconfig: add parser skeleton Yang Zhong
@ 2018-12-27  6:33 ` Yang Zhong
  2019-01-04 14:13   ` Paolo Bonzini
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 05/25] minikconfig: add semantic analysis Yang Zhong
                   ` (21 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

Add Python classes that represent the Kconfig abstract syntax tree.
The abstract syntax tree is stored as a list of clauses.  For example:

    config FOO
        depends on BAR
        select BAZ

is represented as three clauses:

    FOO depends on BAR
    FOO default n
    select BAZ if FOO

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/minikconf.py | 116 ++++++++++++++++++++++++++++++++++++-------
 1 file changed, 98 insertions(+), 18 deletions(-)

diff --git a/scripts/minikconf.py b/scripts/minikconf.py
index 9e33d80514..f1851c3570 100644
--- a/scripts/minikconf.py
+++ b/scripts/minikconf.py
@@ -26,11 +26,84 @@ __all__ = [ 'KconfigParserError', 'KconfigData', 'KconfigParser' ]
 # -------------------------------------------
 
 class KconfigData:
+    class Expr:
+        def __and__(self, rhs):
+            return KconfigData.AND(self, rhs)
+        def __or__(self, rhs):
+            return KconfigData.OR(self, rhs)
+        def __invert__(self):
+            return KconfigData.NOT(self)
+
+    class AND(Expr):
+        def __init__(self, lhs, rhs):
+            self.lhs = lhs
+            self.rhs = rhs
+        def __str__(self):
+            return "(%s && %s)" % (self.lhs, self.rhs)
+
+    class OR(Expr):
+        def __init__(self, lhs, rhs):
+            self.lhs = lhs
+            self.rhs = rhs
+        def __str__(self):
+            return "(%s || %s)" % (self.lhs, self.rhs)
+
+    class NOT(Expr):
+        def __init__(self, lhs):
+            self.lhs = lhs
+        def __str__(self):
+            return "!%s" % (self.lhs)
+
+    class Var(Expr):
+        def __init__(self, name):
+            self.name = name
+            self.value = None
+        def __str__(self):
+            return self.name
+
+    class Clause:
+        def __init__(self, dest):
+            self.dest = dest
+
+    class AssignmentClause(Clause):
+        def __init__(self, dest, value):
+            KconfigData.Clause.__init__(self, dest)
+            self.value = value
+        def __str__(self):
+            return "%s=%s" % (self.dest, 'y' if self.value else 'n')
+
+    class DefaultClause(Clause):
+        def __init__(self, dest, value, cond=None):
+            KconfigData.Clause.__init__(self, dest)
+            self.value = value
+            self.cond = cond
+        def __str__(self):
+            value = 'y' if self.value else 'n'
+            if self.cond is None:
+                return "config %s default %s" % (self.dest, value)
+            else:
+                return "config %s default %s if %s" % (self.dest, value, self.cond)
+
+    class DependsOnClause(Clause):
+        def __init__(self, dest, expr):
+            KconfigData.Clause.__init__(self, dest)
+            self.expr = expr
+        def __str__(self):
+            return "config %s depends on %s" % (self.dest, self.expr)
+
+    class SelectClause(Clause):
+        def __init__(self, dest, cond):
+            KconfigData.Clause.__init__(self, dest)
+            self.cond = cond
+        def __str__(self):
+            return "select %s if %s" % (self.dest, self.cond)
+
     def __init__(self):
         self.previously_included = []
         self.incl_info = None
         self.defined_vars = set()
-        self.referenced_vars = set()
+        self.referenced_vars = dict()
+        self.clauses = list()
 
     # semantic analysis -------------
 
@@ -48,26 +121,28 @@ class KconfigData:
         if (var in self.defined_vars):
             raise Exception('variable "' + var + '" defined twice')
 
-        self.defined_vars.add(var)
+        self.defined_vars.add(var.name)
 
     # var is a string with the variable's name.
-    #
-    # For now this just returns the variable's name itself.
     def do_var(self, var):
-        self.referenced_vars.add(var)
-        return var
+        if (var in self.referenced_vars):
+            return self.referenced_vars[var]
+
+        var_obj = self.referenced_vars[var] = KconfigData.Var(var)
+        return var_obj
 
     def do_assignment(self, var, val):
-        pass
+        self.clauses.append(KconfigData.AssignmentClause(var, val))
 
     def do_default(self, var, val, cond=None):
-        pass
+        self.clauses.append(KconfigData.DefaultClause(var, val, cond))
 
     def do_depends_on(self, var, expr):
-        pass
+        self.clauses.append(KconfigData.DependsOnClause(var, expr))
 
     def do_select(self, var, symbol, cond=None):
-        pass
+        cond = (cond & var) if not (cond is None) else var
+        self.clauses.append(KconfigData.SelectClause(symbol, cond))
 
 # -------------------------------------------
 # KconfigParser implements a recursive descent parser for (simplified)
@@ -229,31 +304,34 @@ class KconfigParser:
     def parse_primary(self):
         if self.tok == TOK_NOT:
             self.get_token()
-            self.parse_primary()
+            val = ~self.parse_primary()
         elif self.tok == TOK_LPAREN:
             self.get_token()
-            self.parse_expr()
+            val = self.parse_expr()
             if self.tok != TOK_RPAREN:
                 raise KconfigParserError(self, 'Expected ")"')
             self.get_token()
         elif self.tok == TOK_ID:
-            self.parse_var()
+            val = self.parse_var()
         else:
             raise KconfigParserError(self, 'Expected "!" or "(" or identifier')
+        return val
 
     # disj: primary (OR primary)*
     def parse_disj(self):
-        self.parse_primary()
+        lhs = self.parse_primary()
         while self.tok == TOK_OR:
             self.get_token()
-            self.parse_primary()
+            lhs = lhs | self.parse_primary()
+        return lhs
 
     # expr: disj (AND disj)*
     def parse_expr(self):
-        self.parse_disj()
+        lhs = self.parse_disj()
         while self.tok == TOK_AND:
             self.get_token()
-            self.parse_disj()
+            lhs = lhs & self.parse_disj()
+        return lhs
 
     # condition: IF expr
     #       | empty
@@ -422,4 +500,6 @@ class KconfigParser:
 
 if __name__ == '__main__':
     fname = len(sys.argv) > 1 and sys.argv[1] or 'Kconfig.test'
-    KconfigParser.parse(open(fname, 'r'))
+    data = KconfigParser.parse(open(fname, 'r'))
+    for i in data.clauses:
+        print i
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 05/25] minikconfig: add semantic analysis
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (3 preceding siblings ...)
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 04/25] minikconfig: add AST Yang Zhong
@ 2018-12-27  6:33 ` Yang Zhong
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 06/25] hw/display: make edid configurable Yang Zhong
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

There are three parts in the semantic analysis:

1) evaluating expressions.  This is done as a simple visit
of the Expr nodes.

2) ordering clauses.  This is done by constructing a graph of variables.
There is an edge from X to Y if Y depends on X, if X selects Y, or if
X appears in a conditional selection of Y; in other words, if the value
of X can affect the value of Y.  Each clause has a "destination" variable
whose value can be affected by the clause, and clauses will be processed
according to a topological sorting of their destination variables.
Defaults are processed after all other clauses with the same destination.

3) deriving the value of the variables.  This is done by processing
the clauses in the topological order provided by the previous step.
A "depends on" clause will force a variable to False, a "select" clause
will force a variable to True, an assignment will force a variable
to its RHS.  A default will set a variable to its RHS if it has not
been set before.  Because all variables have a default, after visiting
all clauses all variables will have been set.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/minikconf.py | 129 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 124 insertions(+), 5 deletions(-)

diff --git a/scripts/minikconf.py b/scripts/minikconf.py
index f1851c3570..1697dd653f 100644
--- a/scripts/minikconf.py
+++ b/scripts/minikconf.py
@@ -15,6 +15,10 @@ import sys
 
 __all__ = [ 'KconfigParserError', 'KconfigData', 'KconfigParser' ]
 
+def debug_print(*args):
+    #print ' '.join(str(x) for x in args)
+    pass
+
 # -------------------------------------------
 # KconfigData implements the Kconfig semantics.  For now it can only
 # detect undefined symbols, i.e. symbols that were referenced in
@@ -34,6 +38,12 @@ class KconfigData:
         def __invert__(self):
             return KconfigData.NOT(self)
 
+        # Abstract methods
+        def add_edges_to(self, var):
+            pass
+        def evaluate(self):
+            assert False
+
     class AND(Expr):
         def __init__(self, lhs, rhs):
             self.lhs = lhs
@@ -41,6 +51,12 @@ class KconfigData:
         def __str__(self):
             return "(%s && %s)" % (self.lhs, self.rhs)
 
+        def add_edges_to(self, var):
+            self.lhs.add_edges_to(var)
+            self.rhs.add_edges_to(var)
+        def evaluate(self):
+            return self.lhs.evaluate() and self.rhs.evaluate()
+
     class OR(Expr):
         def __init__(self, lhs, rhs):
             self.lhs = lhs
@@ -48,22 +64,62 @@ class KconfigData:
         def __str__(self):
             return "(%s || %s)" % (self.lhs, self.rhs)
 
+        def add_edges_to(self, var):
+            self.lhs.add_edges_to(var)
+            self.rhs.add_edges_to(var)
+        def evaluate(self):
+            return self.lhs.evaluate() or self.rhs.evaluate()
+
     class NOT(Expr):
         def __init__(self, lhs):
             self.lhs = lhs
         def __str__(self):
             return "!%s" % (self.lhs)
 
+        def add_edges_to(self, var):
+            self.lhs.add_edges_to(var)
+        def evaluate(self):
+            return not self.lhs.evaluate()
+
     class Var(Expr):
         def __init__(self, name):
             self.name = name
             self.value = None
+            self.outgoing = set()
         def __str__(self):
             return self.name
 
+        def has_value(self):
+            return not (self.value is None)
+        def set_value(self, val):
+            if self.has_value() and self.value != val:
+                raise Exception('contradiction between clauses when setting %s' % self)
+            debug_print("=> %s is now %s" % (self.name, val))
+            self.value = val
+
+        # depth first search of the dependency graph
+        def dfs(self, visited, f):
+            if self in visited:
+                return
+            visited.add(self)
+            for v in self.outgoing:
+                v.dfs(visited, f)
+            f(self)
+
+        def add_edges_to(self, var):
+            self.outgoing.add(var)
+        def evaluate(self):
+            if not self.has_value():
+                raise Exception('cycle found including %s' % self)
+            return self.value
+
     class Clause:
         def __init__(self, dest):
             self.dest = dest
+        def priority(self):
+            return 0
+        def process(self):
+            pass
 
     class AssignmentClause(Clause):
         def __init__(self, dest, value):
@@ -72,11 +128,16 @@ class KconfigData:
         def __str__(self):
             return "%s=%s" % (self.dest, 'y' if self.value else 'n')
 
+        def process(self):
+            self.dest.set_value(self.value)
+
     class DefaultClause(Clause):
         def __init__(self, dest, value, cond=None):
             KconfigData.Clause.__init__(self, dest)
             self.value = value
             self.cond = cond
+            if not (self.cond is None):
+                self.cond.add_edges_to(self.dest)
         def __str__(self):
             value = 'y' if self.value else 'n'
             if self.cond is None:
@@ -84,20 +145,38 @@ class KconfigData:
             else:
                 return "config %s default %s if %s" % (self.dest, value, self.cond)
 
+        def priority(self):
+            # Defaults are processed just before leaving the variable
+            return -1
+        def process(self):
+            if not self.dest.has_value() and \
+                    (self.cond is None or self.cond.evaluate()):
+                self.dest.set_value(self.value)
+
     class DependsOnClause(Clause):
         def __init__(self, dest, expr):
             KconfigData.Clause.__init__(self, dest)
             self.expr = expr
+            self.expr.add_edges_to(self.dest)
         def __str__(self):
             return "config %s depends on %s" % (self.dest, self.expr)
 
+        def process(self):
+            if not self.expr.evaluate():
+                self.dest.set_value(False)
+
     class SelectClause(Clause):
         def __init__(self, dest, cond):
             KconfigData.Clause.__init__(self, dest)
             self.cond = cond
+            self.cond.add_edges_to(self.dest)
         def __str__(self):
             return "select %s if %s" % (self.dest, self.cond)
 
+        def process(self):
+            if self.cond.evaluate():
+                self.dest.set_value(True)
+
     def __init__(self):
         self.previously_included = []
         self.incl_info = None
@@ -115,6 +194,50 @@ class KconfigData:
                 undef = True
         return undef
 
+    def compute_config(self):
+        if self.check_undefined():
+            raise Exception(parser, "there were undefined symbols")
+            return None
+
+        debug_print("Input:")
+        for clause in self.clauses:
+            debug_print(clause)
+
+        debug_print("\nDependency graph:")
+        for i in self.referenced_vars:
+            debug_print(i, "->", [str(x) for x in self.referenced_vars[i].outgoing])
+
+        # The reverse of the depth-first order is the topological sort
+        dfo = dict()
+        visited = set()
+        debug_print("\n")
+        def visit_fn(var):
+            debug_print(var, "has DFS number", len(dfo))
+            dfo[var] = len(dfo)
+
+        for name in self.referenced_vars:
+            v = self.referenced_vars[name]
+            v.dfs(visited, visit_fn)
+
+        # Put higher DFS numbers and higher priorities first.  This
+        # places the clauses in topological order and places defaults
+        # after assignments and dependencies.
+        self.clauses.sort(key=lambda x: (-dfo[x.dest], -x.priority()))
+
+        debug_print("\nSorted clauses:")
+        for clause in self.clauses:
+            debug_print(clause)
+            clause.process()
+
+        debug_print("")
+        values = dict()
+        for name in self.referenced_vars:
+            debug_print("Evaluating", name)
+            v = self.referenced_vars[name]
+            values[name] = v.evaluate()
+
+        return values
+
     # semantic actions -------------
 
     def do_declaration(self, var):
@@ -190,9 +313,6 @@ class KconfigParser:
         data = KconfigData()
         parser = KconfigParser(data)
         parser.parse_file(fp)
-        if data.check_undefined():
-            raise KconfigParserError(parser, "there were undefined symbols")
-
         return data
 
     def __init__(self, data):
@@ -501,5 +621,4 @@ class KconfigParser:
 if __name__ == '__main__':
     fname = len(sys.argv) > 1 and sys.argv[1] or 'Kconfig.test'
     data = KconfigParser.parse(open(fname, 'r'))
-    for i in data.clauses:
-        print i
+    print data.compute_config()
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 06/25] hw/display: make edid configurable
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (4 preceding siblings ...)
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 05/25] minikconfig: add semantic analysis Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-03 14:49   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 07/25] kconfig: introduce kconfig files Yang Zhong
                   ` (19 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

Use CONFIG_EDID to make edid-generate.c and edid-region.c
configurable.

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 default-configs/pci.mak  | 1 +
 hw/display/Makefile.objs | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/default-configs/pci.mak b/default-configs/pci.mak
index 6c7be12779..171bdf48bc 100644
--- a/default-configs/pci.mak
+++ b/default-configs/pci.mak
@@ -47,3 +47,4 @@ CONFIG_VGA_PCI=y
 CONFIG_BOCHS_DISPLAY=y
 CONFIG_IVSHMEM_DEVICE=$(CONFIG_IVSHMEM)
 CONFIG_ROCKER=y
+CONFIG_EDID=y
diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
index 97acd5b6cb..a8e23c8501 100644
--- a/hw/display/Makefile.objs
+++ b/hw/display/Makefile.objs
@@ -1,4 +1,4 @@
-common-obj-y += edid-generate.o
+common-obj-$(CONFIG_EDID) += edid-generate.o edid-region.o
 
 common-obj-$(CONFIG_FW_CFG_DMA) += ramfb.o
 common-obj-$(CONFIG_FW_CFG_DMA) += ramfb-standalone.o
@@ -15,12 +15,10 @@ common-obj-$(CONFIG_SSD0323) += ssd0323.o
 common-obj-$(CONFIG_XEN) += xenfb.o
 
 common-obj-$(CONFIG_VGA_PCI) += vga-pci.o
-common-obj-$(CONFIG_VGA_PCI) += edid-region.o
 common-obj-$(CONFIG_VGA_ISA) += vga-isa.o
 common-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
 common-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
 common-obj-$(CONFIG_BOCHS_DISPLAY) += bochs-display.o
-common-obj-$(CONFIG_BOCHS_DISPLAY) += edid-region.o
 
 common-obj-$(CONFIG_BLIZZARD) += blizzard.o
 common-obj-$(CONFIG_EXYNOS4) += exynos4210_fimd.o
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 07/25] kconfig: introduce kconfig files
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (5 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 06/25] hw/display: make edid configurable Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-03 15:04   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 08/25] build: switch to Kconfig Yang Zhong
                   ` (18 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

The Kconfig files were generated mostly with this script:

  for i in `grep -ho CONFIG_[A-Z0-9_]* default-configs/* | sort -u`; do
    set fnord `git grep -lw $i -- 'hw/*/Makefile.objs' `
    shift
    if test $# = 1; then
      cat >> $(dirname $1)/Kconfig << EOF
config ${i#CONFIG_}
    bool

EOF
      git add $(dirname $1)/Kconfig
    else
      echo $i $*
    fi
  done
  sed -i '$d' hw/*/Kconfig
  for i in hw/*; do
    if test -d $i && ! test -f $i/Kconfig; then
      touch $i/Kconfig
      git add $i/Kconfig
    fi
  done

Whenever a symbol is referenced from multiple subdirectories, the
script prints the list of directories that reference the symbol.
These symbols have to be added manually to the Kconfig files.

Kconfig.host and hw/Kconfig were created manually.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 Kconfig.host          | 17 ++++++++
 hw/9pfs/Kconfig       |  2 +
 hw/Kconfig            | 48 ++++++++++++++++++++++
 hw/acpi/Kconfig       | 23 +++++++++++
 hw/adc/Kconfig        |  2 +
 hw/audio/Kconfig      | 35 ++++++++++++++++
 hw/block/Kconfig      | 29 ++++++++++++++
 hw/bt/Kconfig         |  2 +
 hw/char/Kconfig       | 32 +++++++++++++++
 hw/core/Kconfig       | 11 ++++++
 hw/cpu/Kconfig        |  8 ++++
 hw/display/Kconfig    | 77 ++++++++++++++++++++++++++++++++++++
 hw/dma/Kconfig        | 20 ++++++++++
 hw/gpio/Kconfig       |  8 ++++
 hw/hyperv/Kconfig     |  5 +++
 hw/i2c/Kconfig        | 20 ++++++++++
 hw/i386/Kconfig       | 23 +++++++++++
 hw/ide/Kconfig        | 35 ++++++++++++++++
 hw/input/Kconfig      | 23 +++++++++++
 hw/intc/Kconfig       | 47 ++++++++++++++++++++++
 hw/ipack/Kconfig      |  2 +
 hw/ipmi/Kconfig       | 14 +++++++
 hw/isa/Kconfig        | 23 +++++++++++
 hw/mem/Kconfig        |  8 ++++
 hw/misc/Kconfig       | 92 +++++++++++++++++++++++++++++++++++++++++++
 hw/misc/macio/Kconfig | 11 ++++++
 hw/net/Kconfig        | 92 +++++++++++++++++++++++++++++++++++++++++++
 hw/nvram/Kconfig      |  8 ++++
 hw/pci-bridge/Kconfig | 20 ++++++++++
 hw/pci-host/Kconfig   | 35 ++++++++++++++++
 hw/pci/Kconfig        |  2 +
 hw/pcmcia/Kconfig     |  2 +
 hw/scsi/Kconfig       | 29 ++++++++++++++
 hw/sd/Kconfig         | 11 ++++++
 hw/smbios/Kconfig     |  2 +
 hw/ssi/Kconfig        | 14 +++++++
 hw/timer/Kconfig      | 53 +++++++++++++++++++++++++
 hw/tpm/Kconfig        | 14 +++++++
 hw/usb/Kconfig        | 53 +++++++++++++++++++++++++
 hw/vfio/Kconfig       | 11 ++++++
 hw/virtio/Kconfig     | 17 ++++++++
 hw/watchdog/Kconfig   | 11 ++++++
 42 files changed, 991 insertions(+)
 create mode 100644 Kconfig.host
 create mode 100644 hw/9pfs/Kconfig
 create mode 100644 hw/Kconfig
 create mode 100644 hw/acpi/Kconfig
 create mode 100644 hw/adc/Kconfig
 create mode 100644 hw/audio/Kconfig
 create mode 100644 hw/block/Kconfig
 create mode 100644 hw/bt/Kconfig
 create mode 100644 hw/char/Kconfig
 create mode 100644 hw/core/Kconfig
 create mode 100644 hw/cpu/Kconfig
 create mode 100644 hw/display/Kconfig
 create mode 100644 hw/dma/Kconfig
 create mode 100644 hw/gpio/Kconfig
 create mode 100644 hw/hyperv/Kconfig
 create mode 100644 hw/i2c/Kconfig
 create mode 100644 hw/i386/Kconfig
 create mode 100644 hw/ide/Kconfig
 create mode 100644 hw/input/Kconfig
 create mode 100644 hw/intc/Kconfig
 create mode 100644 hw/ipack/Kconfig
 create mode 100644 hw/ipmi/Kconfig
 create mode 100644 hw/isa/Kconfig
 create mode 100644 hw/mem/Kconfig
 create mode 100644 hw/misc/Kconfig
 create mode 100644 hw/misc/macio/Kconfig
 create mode 100644 hw/net/Kconfig
 create mode 100644 hw/nvram/Kconfig
 create mode 100644 hw/pci-bridge/Kconfig
 create mode 100644 hw/pci-host/Kconfig
 create mode 100644 hw/pci/Kconfig
 create mode 100644 hw/pcmcia/Kconfig
 create mode 100644 hw/scsi/Kconfig
 create mode 100644 hw/sd/Kconfig
 create mode 100644 hw/smbios/Kconfig
 create mode 100644 hw/ssi/Kconfig
 create mode 100644 hw/timer/Kconfig
 create mode 100644 hw/tpm/Kconfig
 create mode 100644 hw/usb/Kconfig
 create mode 100644 hw/vfio/Kconfig
 create mode 100644 hw/virtio/Kconfig
 create mode 100644 hw/watchdog/Kconfig

diff --git a/Kconfig.host b/Kconfig.host
new file mode 100644
index 0000000000..2136a4c3ec
--- /dev/null
+++ b/Kconfig.host
@@ -0,0 +1,17 @@
+# These are "proxy" symbols used to pass config-host.mak values
+# down to Kconfig.
+
+config KVM
+    bool
+
+config OPENGL
+    bool
+
+config SPICE
+    bool
+
+config TPM
+    bool
+
+config XEN
+    bool
diff --git a/hw/9pfs/Kconfig b/hw/9pfs/Kconfig
new file mode 100644
index 0000000000..a4750999d9
--- /dev/null
+++ b/hw/9pfs/Kconfig
@@ -0,0 +1,2 @@
+config VIRTIO_9P
+    bool
diff --git a/hw/Kconfig b/hw/Kconfig
new file mode 100644
index 0000000000..b27290d332
--- /dev/null
+++ b/hw/Kconfig
@@ -0,0 +1,48 @@
+# devices Kconfig
+source 9pfs/Kconfig
+source acpi/Kconfig
+source audio/Kconfig
+source block/Kconfig
+source bt/Kconfig
+source char/Kconfig
+source core/Kconfig
+source display/Kconfig
+source dma/Kconfig
+source gpio/Kconfig
+source i2c/Kconfig
+source ide/Kconfig
+source input/Kconfig
+source intc/Kconfig
+source ipack/Kconfig
+source isa/Kconfig
+source mem/Kconfig
+source misc/Kconfig
+source net/Kconfig
+source nvram/Kconfig
+source pci-bridge/Kconfig
+source pci-host/Kconfig
+source pci/Kconfig
+source scsi/Kconfig
+source sd/Kconfig
+source ssi/Kconfig
+source timer/Kconfig
+source tpm/Kconfig
+source usb/Kconfig
+source virtio/Kconfig
+source watchdog/Kconfig
+source smbios/Kconfig
+source ipmi/Kconfig
+source vfio/Kconfig
+source adc/Kconfig
+source pcmcia/Kconfig
+source hyperv/Kconfig
+
+# arch Kconfig
+source i386/Kconfig
+
+# Symbols used by multiple targets
+config XILINX
+    bool
+
+config XILINX_AXI
+    bool
diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig
new file mode 100644
index 0000000000..2f4871c10a
--- /dev/null
+++ b/hw/acpi/Kconfig
@@ -0,0 +1,23 @@
+config ACPI
+    bool
+
+config ACPI_X86
+    bool
+
+config ACPI_X86_ICH
+    bool
+
+config ACPI_CPU_HOTPLUG
+    bool
+
+config ACPI_MEMORY_HOTPLUG
+    bool
+
+config ACPI_NVDIMM
+    bool
+
+config ACPI_VMGENID
+    bool
+
+config IPMI
+    bool
diff --git a/hw/adc/Kconfig b/hw/adc/Kconfig
new file mode 100644
index 0000000000..25d2229fb8
--- /dev/null
+++ b/hw/adc/Kconfig
@@ -0,0 +1,2 @@
+config STM32F2XX_ADC
+    bool
diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig
new file mode 100644
index 0000000000..207baee6e1
--- /dev/null
+++ b/hw/audio/Kconfig
@@ -0,0 +1,35 @@
+config SB16
+    bool
+
+config ES1370
+    bool
+
+config AC97
+    bool
+
+config ADLIB
+    bool
+
+config GUS
+    bool
+
+config CS4231A
+    bool
+
+config HDA
+    bool
+
+config PCSPK
+    bool
+
+config WM8750
+    bool
+
+config PL041
+    bool
+
+config CS4231
+    bool
+
+config MARVELL_88W8618
+    bool
diff --git a/hw/block/Kconfig b/hw/block/Kconfig
new file mode 100644
index 0000000000..9d418bce4d
--- /dev/null
+++ b/hw/block/Kconfig
@@ -0,0 +1,29 @@
+config FDC
+    bool
+
+config SSI_M25P80
+    bool
+
+config NAND
+    bool
+
+config PFLASH_CFI01
+    bool
+
+config PFLASH_CFI02
+    bool
+
+config ECC
+    bool
+
+config ONENAND
+    bool
+
+config NVME_PCI
+    bool
+
+config VIRTIO_BLK
+    bool
+
+config VHOST_USER_BLK
+    bool
diff --git a/hw/bt/Kconfig b/hw/bt/Kconfig
new file mode 100644
index 0000000000..554a9ee75e
--- /dev/null
+++ b/hw/bt/Kconfig
@@ -0,0 +1,2 @@
+config BLUETOOTH
+    bool
diff --git a/hw/char/Kconfig b/hw/char/Kconfig
new file mode 100644
index 0000000000..26c13243cf
--- /dev/null
+++ b/hw/char/Kconfig
@@ -0,0 +1,32 @@
+config ESCC
+    bool
+
+config PARALLEL
+    bool
+
+config PL011
+    bool
+
+config SERIAL
+    bool
+
+config SERIAL_ISA
+    bool
+
+config SERIAL_PCI
+    bool
+
+config VIRTIO_SERIAL
+    bool
+
+config STM32F2XX_USART
+    bool
+
+config CMSDK_APB_UART
+    bool
+
+config SCLPCONSOLE
+    bool
+
+config TERMINAL3270
+    bool
diff --git a/hw/core/Kconfig b/hw/core/Kconfig
new file mode 100644
index 0000000000..c2a1ae8122
--- /dev/null
+++ b/hw/core/Kconfig
@@ -0,0 +1,11 @@
+config EMPTY_SLOT
+    bool
+
+config PTIMER
+    bool
+
+config FITLOADER
+    bool
+
+config PLATFORM_BUS
+    bool
diff --git a/hw/cpu/Kconfig b/hw/cpu/Kconfig
new file mode 100644
index 0000000000..1767d028ac
--- /dev/null
+++ b/hw/cpu/Kconfig
@@ -0,0 +1,8 @@
+config ARM11MPCORE
+    bool
+
+config A9MPCORE
+    bool
+
+config A15MPCORE
+    bool
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
new file mode 100644
index 0000000000..d5c022c886
--- /dev/null
+++ b/hw/display/Kconfig
@@ -0,0 +1,77 @@
+config EDID
+    bool
+
+config FW_CFG_DMA
+    bool
+
+config ADS7846
+    bool
+
+config VGA_CIRRUS
+    bool
+
+config G364FB
+    bool
+
+config JAZZ_LED
+    bool
+
+config PL110
+    bool
+
+config SII9022
+    bool
+
+config SSD0303
+    bool
+
+config SSD0323
+    bool
+
+config VGA_PCI
+    bool
+
+config VGA_ISA
+    bool
+
+config VGA_ISA_MM
+    bool
+
+config VMWARE_VGA
+    bool
+
+config BOCHS_DISPLAY
+    bool
+
+config BLIZZARD
+    bool
+
+config FRAMEBUFFER
+    bool
+
+config MILKYMIST_TMU2
+    bool
+
+config SM501
+    bool
+
+config TCX
+    bool
+
+config CG3
+    bool
+
+config VGA
+    bool
+
+config QXL
+    bool
+
+config VIRTIO_GPU
+    bool
+
+config VIRTIO_VGA
+    bool
+
+config DPCD
+    bool
diff --git a/hw/dma/Kconfig b/hw/dma/Kconfig
new file mode 100644
index 0000000000..b9ce1c58c4
--- /dev/null
+++ b/hw/dma/Kconfig
@@ -0,0 +1,20 @@
+config RC4030
+    bool
+
+config PL080
+    bool
+
+config PL330
+    bool
+
+config I82374
+    bool
+
+config I8257
+    bool
+
+config ZYNQ_DEVCFG
+    bool
+
+config STP2000
+    bool
diff --git a/hw/gpio/Kconfig b/hw/gpio/Kconfig
new file mode 100644
index 0000000000..d0a4abf93f
--- /dev/null
+++ b/hw/gpio/Kconfig
@@ -0,0 +1,8 @@
+config MAX7310
+    bool
+
+config PL061
+    bool
+
+config GPIO_KEY
+    bool
diff --git a/hw/hyperv/Kconfig b/hw/hyperv/Kconfig
new file mode 100644
index 0000000000..be724b7f8b
--- /dev/null
+++ b/hw/hyperv/Kconfig
@@ -0,0 +1,5 @@
+config HYPERV
+    bool
+
+config HYPERV_TESTDEV
+    bool
diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig
new file mode 100644
index 0000000000..d6d4402608
--- /dev/null
+++ b/hw/i2c/Kconfig
@@ -0,0 +1,20 @@
+config I2C
+    bool
+
+config SMBUS_EEPROM
+    bool
+
+config DDC
+    bool
+
+config VERSATILE_I2C
+    bool
+
+config ACPI_SMBUS
+    bool
+
+config BITBANG_I2C
+    bool
+
+config IMX_I2C
+    bool
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
new file mode 100644
index 0000000000..2dbe2b5d3e
--- /dev/null
+++ b/hw/i386/Kconfig
@@ -0,0 +1,23 @@
+config KVM
+    bool
+
+config I440FX
+    bool
+
+config ISAPC
+    bool
+
+config Q35
+    bool
+
+config VTD
+    bool
+
+config AMD_IOMMU
+    bool
+
+config VMPORT
+    bool
+
+config VMMOUSE
+    bool
diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig
new file mode 100644
index 0000000000..5ec449525f
--- /dev/null
+++ b/hw/ide/Kconfig
@@ -0,0 +1,35 @@
+config IDE_CORE
+    bool
+
+config IDE_QDEV
+    bool
+
+config IDE_PCI
+    bool
+
+config IDE_ISA
+    bool
+
+config IDE_PIIX
+    bool
+
+config IDE_CMD646
+    bool
+
+config IDE_MACIO
+    bool
+
+config IDE_MMIO
+    bool
+
+config IDE_VIA
+    bool
+
+config MICRODRIVE
+    bool
+
+config AHCI
+    bool
+
+config IDE_SII3112
+    bool
diff --git a/hw/input/Kconfig b/hw/input/Kconfig
new file mode 100644
index 0000000000..91bae47498
--- /dev/null
+++ b/hw/input/Kconfig
@@ -0,0 +1,23 @@
+config ADB
+    bool
+
+config LM832X
+    bool
+
+config PCKBD
+    bool
+
+config PL050
+    bool
+
+config STELLARIS_INPUT
+    bool
+
+config TSC2005
+    bool
+
+config VIRTIO_INPUT
+    bool
+
+config TSC210X
+    bool
diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig
new file mode 100644
index 0000000000..69adbd135f
--- /dev/null
+++ b/hw/intc/Kconfig
@@ -0,0 +1,47 @@
+config HEATHROW_PIC
+    bool
+
+config I8259
+    bool
+
+config PL190
+    bool
+
+config IOAPIC
+    bool
+
+config ARM_GIC
+    bool
+
+config OPENPIC
+    bool
+
+config APIC
+    bool
+
+config ARM_GIC_KVM
+    bool
+
+config OPENPIC_KVM
+    bool
+
+config XICS
+    bool
+
+config XICS_SPAPR
+    bool
+
+config XICS_KVM
+    bool
+
+config ALLWINNER_A10_PIC
+    bool
+
+config S390_FLIC
+    bool
+
+config S390_FLIC_KVM
+    bool
+
+config OMPIC
+    bool
diff --git a/hw/ipack/Kconfig b/hw/ipack/Kconfig
new file mode 100644
index 0000000000..481e0d2e64
--- /dev/null
+++ b/hw/ipack/Kconfig
@@ -0,0 +1,2 @@
+config IPACK
+    bool
diff --git a/hw/ipmi/Kconfig b/hw/ipmi/Kconfig
new file mode 100644
index 0000000000..68f8ba1a54
--- /dev/null
+++ b/hw/ipmi/Kconfig
@@ -0,0 +1,14 @@
+config IPMI
+    bool
+
+config IPMI_LOCAL
+    bool
+
+config IPMI_EXTERN
+    bool
+
+config ISA_IPMI_KCS
+    bool
+
+config ISA_IPMI_BT
+    bool
diff --git a/hw/isa/Kconfig b/hw/isa/Kconfig
new file mode 100644
index 0000000000..b59d074453
--- /dev/null
+++ b/hw/isa/Kconfig
@@ -0,0 +1,23 @@
+config ISA_BUS
+    bool
+
+config APM
+    bool
+
+config I82378
+    bool
+
+config PC87312
+    bool
+
+config PIIX4
+    bool
+
+config VT82C686
+    bool
+
+config SMC37C669
+    bool
+
+config LPC_ICH9
+    bool
diff --git a/hw/mem/Kconfig b/hw/mem/Kconfig
new file mode 100644
index 0000000000..a3a4372fa7
--- /dev/null
+++ b/hw/mem/Kconfig
@@ -0,0 +1,8 @@
+config DIMM
+    bool
+
+config MEM_DEVICE
+    bool
+
+config NVDIMM
+    bool
diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig
new file mode 100644
index 0000000000..c006b046d4
--- /dev/null
+++ b/hw/misc/Kconfig
@@ -0,0 +1,92 @@
+config APPLESMC
+    bool
+
+config MAX111X
+    bool
+
+config TMP105
+    bool
+
+config TMP421
+    bool
+
+config ISA_DEBUG
+    bool
+
+config SGA
+    bool
+
+config ISA_TESTDEV
+    bool
+
+config PCI_TESTDEV
+    bool
+
+config EDU
+    bool
+
+config PCA9552
+    bool
+
+config PL310
+    bool
+
+config INTEGRATOR_DEBUG
+    bool
+
+config A9SCU
+    bool
+
+config ARM11SCU
+    bool
+
+config MOS6522
+    bool
+
+config MACIO
+    bool
+
+config IVSHMEM_DEVICE
+    bool
+
+config ECCMEMCTL
+    bool
+
+config IMX
+    bool
+
+config STM32F2XX_SYSCFG
+    bool
+
+config MIPS_ITU
+    bool
+
+config MPS2_FPGAIO
+    bool
+
+config MPS2_SCC
+    bool
+
+config TZ_MPC
+    bool
+
+config TZ_MSC
+    bool
+
+config TZ_PPC
+    bool
+
+config IOTKIT_SECCTL
+    bool
+
+config IOTKIT_SYSCTL
+    bool
+
+config IOTKIT_SYSINFO
+    bool
+
+config PVPANIC
+    bool
+
+config AUX
+    bool
diff --git a/hw/misc/macio/Kconfig b/hw/misc/macio/Kconfig
new file mode 100644
index 0000000000..c6caeb672f
--- /dev/null
+++ b/hw/misc/macio/Kconfig
@@ -0,0 +1,11 @@
+config CUDA
+    bool
+
+config MAC_PMU
+    bool
+
+config MAC_DBDMA
+    bool
+
+config MACIO_GPIO
+    bool
diff --git a/hw/net/Kconfig b/hw/net/Kconfig
new file mode 100644
index 0000000000..6b2ec971b5
--- /dev/null
+++ b/hw/net/Kconfig
@@ -0,0 +1,92 @@
+config DP8393X
+    bool
+
+config NE2000_PCI
+    bool
+
+config EEPRO100_PCI
+    bool
+
+config PCNET_PCI
+    bool
+
+config PCNET_COMMON
+    bool
+
+config E1000_PCI
+    bool
+
+config E1000E_PCI
+    bool
+
+config RTL8139_PCI
+    bool
+
+config VMXNET3_PCI
+    bool
+
+config SMC91C111
+    bool
+
+config LAN9118
+    bool
+
+config NE2000_ISA
+    bool
+
+config OPENCORES_ETH
+    bool
+
+config XGMAC
+    bool
+
+config MIPSNET
+    bool
+
+config ALLWINNER_EMAC
+    bool
+
+config IMX_FEC
+    bool
+
+config CADENCE
+    bool
+
+config STELLARIS_ENET
+    bool
+
+config LANCE
+    bool
+
+config SUNHME
+    bool
+
+config FTGMAC100
+    bool
+
+config SUNGEM
+    bool
+
+config COLDFIRE
+    bool
+
+config XILINX_ETHLITE
+    bool
+
+config VIRTIO_NET
+   bool
+
+config ETSEC
+    bool
+
+config ROCKER
+    bool
+
+config CAN_BUS
+    bool
+
+config CAN_PCI
+    bool
+
+config CAN_SJA1000
+    bool
diff --git a/hw/nvram/Kconfig b/hw/nvram/Kconfig
new file mode 100644
index 0000000000..1f5ec95d8b
--- /dev/null
+++ b/hw/nvram/Kconfig
@@ -0,0 +1,8 @@
+config DS1225Y
+    bool
+
+config AT24C
+    bool
+
+config MAC_NVRAM
+    bool
diff --git a/hw/pci-bridge/Kconfig b/hw/pci-bridge/Kconfig
new file mode 100644
index 0000000000..bb19b7aac1
--- /dev/null
+++ b/hw/pci-bridge/Kconfig
@@ -0,0 +1,20 @@
+config PCIE_PORT
+    bool
+
+config PXB
+    bool
+
+config XIO3130
+    bool
+
+config IOH3420
+    bool
+
+config I82801B11
+    bool
+
+config DEC_PCI
+    bool
+
+config SIMBA
+    bool
diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig
new file mode 100644
index 0000000000..359df1d239
--- /dev/null
+++ b/hw/pci-host/Kconfig
@@ -0,0 +1,35 @@
+config PAM
+    bool
+
+config PREP_PCI
+    bool
+
+config GRACKLE_PCI
+    bool
+
+config UNIN_PCI
+    bool
+
+config PPCE500_PCI
+    bool
+
+config VERSATILE_PCI
+    bool
+
+config PCI_SABRE
+    bool
+
+config PCI_PIIX
+    bool
+
+config PCI_Q35
+    bool
+
+config PCI_GENERIC
+    bool
+
+config PCI_XILINX
+    bool
+
+config PCI_DESIGNWARE
+    bool
diff --git a/hw/pci/Kconfig b/hw/pci/Kconfig
new file mode 100644
index 0000000000..d3d2205577
--- /dev/null
+++ b/hw/pci/Kconfig
@@ -0,0 +1,2 @@
+config PCI
+    bool
diff --git a/hw/pcmcia/Kconfig b/hw/pcmcia/Kconfig
new file mode 100644
index 0000000000..41f2df9136
--- /dev/null
+++ b/hw/pcmcia/Kconfig
@@ -0,0 +1,2 @@
+config PCMCIA
+    bool
diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig
new file mode 100644
index 0000000000..c48bf4e8d0
--- /dev/null
+++ b/hw/scsi/Kconfig
@@ -0,0 +1,29 @@
+config SCSI
+    bool
+
+config LSI_SCSI_PCI
+    bool
+
+config MPTSAS_SCSI_PCI
+    bool
+
+config MEGASAS_SCSI_PCI
+    bool
+
+config VMW_PVSCSI_SCSI_PCI
+    bool
+
+config ESP
+    bool
+
+config ESP_PCI
+    bool
+
+config PSERIES
+    bool
+
+config VIRTIO_SCSI
+    bool
+
+config VHOST_USER_SCSI
+    bool
diff --git a/hw/sd/Kconfig b/hw/sd/Kconfig
new file mode 100644
index 0000000000..4f43bbb352
--- /dev/null
+++ b/hw/sd/Kconfig
@@ -0,0 +1,11 @@
+config PL181
+    bool
+
+config SSI_SD
+    bool
+
+config SD
+    bool
+
+config SDHCI
+    bool
diff --git a/hw/smbios/Kconfig b/hw/smbios/Kconfig
new file mode 100644
index 0000000000..553adf4bfc
--- /dev/null
+++ b/hw/smbios/Kconfig
@@ -0,0 +1,2 @@
+config SMBIOS
+    bool
diff --git a/hw/ssi/Kconfig b/hw/ssi/Kconfig
new file mode 100644
index 0000000000..5a03110a8d
--- /dev/null
+++ b/hw/ssi/Kconfig
@@ -0,0 +1,14 @@
+config PL022
+    bool
+
+config SSI
+    bool
+
+config XILINX_SPI
+    bool
+
+config XILINX_SPIPS
+    bool
+
+config STM32F2XX_SPI
+    bool
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
new file mode 100644
index 0000000000..7dbc1211ab
--- /dev/null
+++ b/hw/timer/Kconfig
@@ -0,0 +1,53 @@
+config ARM_TIMER
+    bool
+
+config ARM_MPTIMER
+    bool
+
+config A9_GTIMER
+    bool
+
+config DS1338
+    bool
+
+config HPET
+    bool
+
+config I8254
+    bool
+
+config M41T80
+    bool
+
+config M48T59
+    bool
+
+config PL031
+    bool
+
+config TWL92230
+    bool
+
+config XLNX_ZYNQMP
+    bool
+
+config ALTERA_TIMER
+    bool
+
+config MC146818RTC
+    bool
+
+config ALLWINNER_A10_PIT
+    bool
+
+config STM32F2XX_TIMER
+    bool
+
+config SUN4V_RTC
+    bool
+
+config CMSDK_APB_TIMER
+    bool
+
+config CMSDK_APB_DUALTIMER
+    bool
diff --git a/hw/tpm/Kconfig b/hw/tpm/Kconfig
new file mode 100644
index 0000000000..2eee8eb865
--- /dev/null
+++ b/hw/tpm/Kconfig
@@ -0,0 +1,14 @@
+config TPM
+    bool
+
+config TPM_TIS
+    bool
+
+config TPM_CRB
+    bool
+
+config TPM_PASSTHROUGH
+    bool
+
+config TPM_EMULATOR
+    bool
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
new file mode 100644
index 0000000000..cbf5c5d761
--- /dev/null
+++ b/hw/usb/Kconfig
@@ -0,0 +1,53 @@
+config USB
+    bool
+
+config USB_UHCI
+    bool
+
+config USB_OHCI
+    bool
+
+config USB_EHCI
+    bool
+
+config USB_EHCI_SYSBUS
+    bool
+
+config USB_XHCI
+    bool
+
+config USB_XHCI_NEC
+    bool
+
+config USB_MUSB
+    bool
+
+config TUSB6010
+    bool
+
+config USB_TABLET_WACOM
+    bool
+
+config USB_STORAGE_BOT
+    bool
+
+config USB_STORAGE_UAS
+    bool
+
+config USB_AUDIO
+    bool
+
+config USB_SERIAL
+    bool
+
+config USB_NETWORK
+    bool
+
+config USB_BLUETOOTH
+    bool
+
+config USB_SMARTCARD
+    bool
+
+config USB_STORAGE_MTP
+    bool
diff --git a/hw/vfio/Kconfig b/hw/vfio/Kconfig
new file mode 100644
index 0000000000..3cb7b25fe6
--- /dev/null
+++ b/hw/vfio/Kconfig
@@ -0,0 +1,11 @@
+config VFIO_CCW
+    bool
+
+config VFIO_XGMAC
+    bool
+
+config VFIO_AMD_XGBE
+    bool
+
+config VFIO_AP
+    bool
diff --git a/hw/virtio/Kconfig b/hw/virtio/Kconfig
new file mode 100644
index 0000000000..ebf18124fb
--- /dev/null
+++ b/hw/virtio/Kconfig
@@ -0,0 +1,17 @@
+config VIRTIO
+    bool
+
+config VIRTIO_RNG
+    bool
+
+config VIRTIO_PCI
+    bool
+
+config VIRTIO_MMIO
+    bool
+
+config VIRTIO_BALLOON
+    bool
+
+config VIRTIO_CRYPTO
+    bool
diff --git a/hw/watchdog/Kconfig b/hw/watchdog/Kconfig
new file mode 100644
index 0000000000..cd0244f4e1
--- /dev/null
+++ b/hw/watchdog/Kconfig
@@ -0,0 +1,11 @@
+config CMSDK_APB_WATCHDOG
+    bool
+
+config WDT_IB6300ESB
+    bool
+
+config WDT_IB700
+    bool
+
+config WDT_DIAG288
+    bool
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 08/25] build: switch to Kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (6 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 07/25] kconfig: introduce kconfig files Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 09/25] ide: express dependencies with Kconfig Yang Zhong
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

The make_device_config.sh script is replaced by minikconf, which
is modified to support the same command line as its predecessor.

The roots of the parsing are default-configs/*.mak, Kconfig.host and
hw/Kconfig.  One difference with make_device_config.sh is that all symbols
have to be defined in a Kconfig file, including those coming from the
configure script.  This is the reason for the Kconfig.host file introduced
in the previous patch. Whenever a file in default-configs/*.mak used
$(...) to refer to a config-host.mak symbol, this is replaced by a
Kconfig dependency.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 Kconfig.host                     |  3 ++-
 Makefile                         | 14 +++++++++++--
 Makefile.target                  |  7 ++++++-
 default-configs/i386-softmmu.mak |  3 ---
 hw/display/Kconfig               |  2 ++
 hw/i386/Kconfig                  |  6 ++++++
 hw/intc/Kconfig                  |  8 ++++++++
 hw/misc/Kconfig                  |  2 ++
 hw/tpm/Kconfig                   |  1 +
 rules.mak                        |  2 +-
 scripts/make_device_config.sh    | 30 ---------------------------
 scripts/minikconf.py             | 35 +++++++++++++++++++++++++++++---
 12 files changed, 72 insertions(+), 41 deletions(-)
 delete mode 100644 scripts/make_device_config.sh

diff --git a/Kconfig.host b/Kconfig.host
index 2136a4c3ec..d7f503d0ca 100644
--- a/Kconfig.host
+++ b/Kconfig.host
@@ -1,5 +1,6 @@
 # These are "proxy" symbols used to pass config-host.mak values
-# down to Kconfig.
+# down to Kconfig.  See also MINIKCONF_ARGS in the Makefile:
+# these two need to be kept in sync.
 
 config KVM
     bool
diff --git a/Makefile b/Makefile
index f2947186a4..ccf3e3f5b3 100644
--- a/Makefile
+++ b/Makefile
@@ -382,9 +382,19 @@ endif
 
 -include $(SUBDIR_DEVICES_MAK_DEP)
 
-%/config-devices.mak: default-configs/%.mak $(SRC_PATH)/scripts/make_device_config.sh
+# This has to be kept in sync with Kconfig.host.
+MINIKCONF_ARGS = \
+    CONFIG_KVM=$(CONFIG_KVM) \
+    CONFIG_SPICE=$(CONFIG_SPICE) \
+    CONFIG_TPM=$(CONFIG_TPM) \
+    CONFIG_XEN=$(CONFIG_XEN) \
+    CONFIG_OPENGL=$(CONFIG_OPENGL)
+
+MINIKCONF = $(SHELL) $(SRC_PATH)/scripts/minikconf.sh
+
+%/config-devices.mak: default-configs/%-softmmu.mak Kconfig.host hw/Kconfig
 	$(call quiet-command, \
-            $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > $@.tmp,"GEN","$@.tmp")
+            $(MINIKCONF) $@ $*-config-devices.mak.d $^ $(MINIKCONF_ARGS) > $@.tmp, "  GEN   $@.tmp")
 	$(call quiet-command, if test -f $@; then \
 	  if cmp -s $@.old $@; then \
 	    mv $@.tmp $@; \
diff --git a/Makefile.target b/Makefile.target
index 4d56298bbf..8c879b6088 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -4,9 +4,12 @@ BUILD_DIR?=$(CURDIR)/..
 
 include ../config-host.mak
 include config-target.mak
-include config-devices.mak
 include $(SRC_PATH)/rules.mak
 
+ifdef CONFIG_SOFTMMU
+include config-devices.mak
+endif
+
 $(call set-vpath, $(SRC_PATH):$(BUILD_DIR))
 ifdef CONFIG_LINUX
 QEMU_CFLAGS += -I../linux-headers
@@ -190,7 +193,9 @@ all-obj-$(CONFIG_USER_ONLY) += $(crypto-aes-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y)
 
+ifdef CONFIG_SOFTMMU
 $(QEMU_PROG_BUILD): config-devices.mak
+endif
 
 COMMON_LDADDS = ../libqemuutil.a
 
diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 65ef98be18..560250c998 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -4,7 +4,6 @@ include pci.mak
 include sound.mak
 include usb.mak
 include hyperv.mak
-CONFIG_QXL=$(CONFIG_SPICE)
 CONFIG_VGA_ISA=y
 CONFIG_VGA_CIRRUS=y
 CONFIG_VMWARE_VGA=y
@@ -37,8 +36,6 @@ CONFIG_HPET=y
 CONFIG_APPLESMC=y
 CONFIG_I8259=y
 CONFIG_PFLASH_CFI01=y
-CONFIG_TPM_TIS=$(CONFIG_TPM)
-CONFIG_TPM_CRB=$(CONFIG_TPM)
 CONFIG_MC146818RTC=y
 CONFIG_PCI_PIIX=y
 CONFIG_WDT_IB700=y
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index d5c022c886..132aeffdbe 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -51,6 +51,7 @@ config FRAMEBUFFER
 
 config MILKYMIST_TMU2
     bool
+    depends on OPENGL
 
 config SM501
     bool
@@ -66,6 +67,7 @@ config VGA
 
 config QXL
     bool
+    depends on SPICE
 
 config VIRTIO_GPU
     bool
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index 2dbe2b5d3e..427bda3717 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -3,12 +3,18 @@ config KVM
 
 config I440FX
     bool
+    select QXL if SPICE
+    select TPM_TIS if TPM
+    select XEN_I386 if XEN
 
 config ISAPC
     bool
 
 config Q35
     bool
+    select QXL if SPICE
+    select TPM_TIS if TPM
+    select XEN_I386 if XEN
 
 config VTD
     bool
diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig
index 69adbd135f..226ef3ae2e 100644
--- a/hw/intc/Kconfig
+++ b/hw/intc/Kconfig
@@ -21,9 +21,13 @@ config APIC
 
 config ARM_GIC_KVM
     bool
+    default y
+    depends on ARM_GIC && KVM
 
 config OPENPIC_KVM
     bool
+    default y
+    depends on OPENPIC && KVM
 
 config XICS
     bool
@@ -33,6 +37,8 @@ config XICS_SPAPR
 
 config XICS_KVM
     bool
+    default y
+    depends on XICS && KVM
 
 config ALLWINNER_A10_PIC
     bool
@@ -42,6 +48,8 @@ config S390_FLIC
 
 config S390_FLIC_KVM
     bool
+    default y
+    depends on S390_FLIC && KVM
 
 config OMPIC
     bool
diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig
index c006b046d4..cc8dbed24e 100644
--- a/hw/misc/Kconfig
+++ b/hw/misc/Kconfig
@@ -48,6 +48,8 @@ config MACIO
 
 config IVSHMEM_DEVICE
     bool
+    default y
+    depends on PCI
 
 config ECCMEMCTL
     bool
diff --git a/hw/tpm/Kconfig b/hw/tpm/Kconfig
index 2eee8eb865..da4bb5b6c7 100644
--- a/hw/tpm/Kconfig
+++ b/hw/tpm/Kconfig
@@ -3,6 +3,7 @@ config TPM
 
 config TPM_TIS
     bool
+    depends on TPM
 
 config TPM_CRB
     bool
diff --git a/rules.mak b/rules.mak
index bbb2667928..2d4559a6ce 100644
--- a/rules.mak
+++ b/rules.mak
@@ -142,7 +142,7 @@ cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \
 cc-c-option = $(if $(shell $(CC) $1 $2 -c -o /dev/null -xc /dev/null \
                 >/dev/null 2>&1 && echo OK), $2, $3)
 
-VPATH_SUFFIXES = %.c %.h %.S %.cc %.cpp %.m %.mak %.texi %.sh %.rc
+VPATH_SUFFIXES = %.c %.h %.S %.cc %.cpp %.m %.mak %.texi %.sh %.rc Kconfig%
 set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1)))
 
 # install-prog list, dir
diff --git a/scripts/make_device_config.sh b/scripts/make_device_config.sh
deleted file mode 100644
index 354af317b3..0000000000
--- a/scripts/make_device_config.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#! /bin/sh
-# Writes a target device config file to stdout, from a default and from
-# include directives therein.  Also emits Makefile dependencies.
-#
-# Usage: make_device_config.sh SRC DEPFILE-NAME DEPFILE-TARGET > DEST
-
-src=$1
-dep=$2
-target=$3
-src_dir=$(dirname $src)
-all_includes=
-
-process_includes () {
-  cat $1 | grep '^include' | \
-  while read include file ; do
-    all_includes="$all_includes $src_dir/$file"
-    process_includes $src_dir/$file
-  done
-}
-
-f=$src
-while [ -n "$f" ] ; do
-  f=$(cat $f | tr -d '\r' | awk '/^include / {printf "'$src_dir'/%s ", $2}')
-  [ $? = 0 ] || exit 1
-  all_includes="$all_includes $f"
-done
-process_includes $src
-
-cat $src $all_includes | grep -v '^include'
-echo "$target: $all_includes" > $dep
diff --git a/scripts/minikconf.py b/scripts/minikconf.py
index 1697dd653f..a03e5ec55e 100644
--- a/scripts/minikconf.py
+++ b/scripts/minikconf.py
@@ -12,6 +12,7 @@
 
 import os
 import sys
+import re
 
 __all__ = [ 'KconfigParserError', 'KconfigData', 'KconfigParser' ]
 
@@ -331,6 +332,12 @@ class KconfigParser:
         self.get_token()
         self.parse_config()
 
+    def do_assignment(self, var, val):
+        if not var.startswith("CONFIG_"):
+            raise Error('assigned variable should start with CONFIG_')
+        var = self.data.do_var(var[7:])
+        self.data.do_assignment(var, val)
+
     # file management -----
 
     def error_path(self):
@@ -619,6 +626,28 @@ class KconfigParser:
         return None
 
 if __name__ == '__main__':
-    fname = len(sys.argv) > 1 and sys.argv[1] or 'Kconfig.test'
-    data = KconfigParser.parse(open(fname, 'r'))
-    print data.compute_config()
+    argv = sys.argv
+    if len(argv) == 1:
+        print >>sys.stderr, "%s: at least one argument is required" % argv[0]
+        os.exit(1)
+
+    data = KconfigData()
+    parser = KconfigParser(data)
+    for arg in argv[3:]:
+        m = re.match(r'^(CONFIG_[A-Z0-9_]+)=([yn]?)$', arg)
+        if m is not None:
+            name, value = m.groups()
+            parser.do_assignment(name, value == 'y')
+        else:
+            fp = open(arg, 'r')
+            parser.parse_file(fp)
+            fp.close()
+
+    config = data.compute_config()
+    for key in sorted(config.keys()):
+        print 'CONFIG_%s=%s'% (key, (config[key] and 'y' or 'n'))
+
+    deps = open(argv[2], 'w')
+    for fname in data.previously_included:
+        print >>deps, '%s: %s' % (argv[1], fname)
+    deps.close()
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 09/25] ide: express dependencies with Kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (7 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 08/25] build: switch to Kconfig Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-03 15:47   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 10/25] build: convert pci.mak to Kconfig Yang Zhong
                   ` (16 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 default-configs/pci.mak |  3 ---
 hw/ide/Kconfig          | 11 +++++++++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/default-configs/pci.mak b/default-configs/pci.mak
index 171bdf48bc..c1b64922b9 100644
--- a/default-configs/pci.mak
+++ b/default-configs/pci.mak
@@ -23,9 +23,6 @@ CONFIG_MPTSAS_SCSI_PCI=y
 CONFIG_RTL8139_PCI=y
 CONFIG_E1000_PCI=y
 CONFIG_E1000E_PCI=y
-CONFIG_IDE_CORE=y
-CONFIG_IDE_QDEV=y
-CONFIG_IDE_PCI=y
 CONFIG_AHCI=y
 CONFIG_ESP=y
 CONFIG_ESP_PCI=y
diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig
index 5ec449525f..091f3a81c9 100644
--- a/hw/ide/Kconfig
+++ b/hw/ide/Kconfig
@@ -3,33 +3,44 @@ config IDE_CORE
 
 config IDE_QDEV
     bool
+    select IDE_CORE
 
 config IDE_PCI
     bool
+    select IDE_CORE
 
 config IDE_ISA
     bool
+    select IDE_QDEV
 
 config IDE_PIIX
     bool
+    select IDE_QDEV
 
 config IDE_CMD646
     bool
+    select IDE_QDEV
 
 config IDE_MACIO
     bool
+    select IDE_QDEV
 
 config IDE_MMIO
     bool
+    select IDE_QDEV
 
 config IDE_VIA
     bool
+    select IDE_QDEV
 
 config MICRODRIVE
     bool
+    select IDE_QDEV
 
 config AHCI
     bool
+    select IDE_QDEV
 
 config IDE_SII3112
     bool
+    select IDE_QDEV
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 10/25] build: convert pci.mak to Kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (8 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 09/25] ide: express dependencies with Kconfig Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-03 16:06   ` Thomas Huth
  2019-01-04 13:48   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 11/25] build: convert sound.mak " Yang Zhong
                   ` (15 subsequent siblings)
  25 siblings, 2 replies; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

Instead of including the same list of devices for each target,
set CONFIG_PCI to true, and make the devices default to present
whenever PCI is available.

Done mostly with the following script:

  while read i; do
     i=${i%=y}; i=${i#CONFIG_}
     sed -i -e'/^config '$i'$/!b' -en \
            -e'a\' -e'    default y\' -e'    depends on PCI' \
          `grep -lw $i hw/*/Kconfig`
  done < default-configs/pci.mak

followed by replacing a few "depends on" clauses with "select"
whenever the symbol is not really related to PCI.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 default-configs/i386-softmmu.mak |  2 +-
 default-configs/pci.mak          | 47 --------------------------------
 hw/audio/Kconfig                 |  6 ++++
 hw/block/Kconfig                 |  2 ++
 hw/char/Kconfig                  |  2 ++
 hw/display/Kconfig               | 12 +++++++-
 hw/ide/Kconfig                   |  6 ++++
 hw/ipack/Kconfig                 |  2 ++
 hw/misc/Kconfig                  |  4 +++
 hw/net/Kconfig                   | 19 +++++++++++++
 hw/scsi/Kconfig                  | 11 ++++++++
 hw/sd/Kconfig                    |  3 ++
 hw/usb/Kconfig                   | 10 +++++++
 hw/virtio/Kconfig                |  3 ++
 hw/watchdog/Kconfig              |  2 ++
 15 files changed, 82 insertions(+), 49 deletions(-)
 delete mode 100644 default-configs/pci.mak

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 560250c998..61f19e5231 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -1,6 +1,6 @@
 # Default configuration for i386-softmmu
 
-include pci.mak
+CONFIG_PCI=y
 include sound.mak
 include usb.mak
 include hyperv.mak
diff --git a/default-configs/pci.mak b/default-configs/pci.mak
deleted file mode 100644
index c1b64922b9..0000000000
--- a/default-configs/pci.mak
+++ /dev/null
@@ -1,47 +0,0 @@
-CONFIG_PCI=y
-# For now, CONFIG_IDE_CORE requires ISA, so we enable it here
-CONFIG_ISA_BUS=y
-CONFIG_VIRTIO_PCI=y
-include virtio.mak
-CONFIG_USB_UHCI=y
-CONFIG_USB_OHCI=y
-CONFIG_USB_EHCI=y
-CONFIG_USB_XHCI=y
-CONFIG_USB_XHCI_NEC=y
-CONFIG_NE2000_PCI=y
-CONFIG_EEPRO100_PCI=y
-CONFIG_PCNET_PCI=y
-CONFIG_PCNET_COMMON=y
-CONFIG_AC97=y
-CONFIG_HDA=y
-CONFIG_ES1370=y
-CONFIG_SCSI=y
-CONFIG_LSI_SCSI_PCI=y
-CONFIG_VMW_PVSCSI_SCSI_PCI=y
-CONFIG_MEGASAS_SCSI_PCI=y
-CONFIG_MPTSAS_SCSI_PCI=y
-CONFIG_RTL8139_PCI=y
-CONFIG_E1000_PCI=y
-CONFIG_E1000E_PCI=y
-CONFIG_AHCI=y
-CONFIG_ESP=y
-CONFIG_ESP_PCI=y
-CONFIG_SERIAL=y
-CONFIG_SERIAL_ISA=y
-CONFIG_SERIAL_PCI=y
-CONFIG_CAN_BUS=y
-CONFIG_CAN_SJA1000=y
-CONFIG_CAN_PCI=y
-CONFIG_IPACK=y
-CONFIG_WDT_IB6300ESB=y
-CONFIG_PCI_TESTDEV=y
-CONFIG_NVME_PCI=y
-CONFIG_SD=y
-CONFIG_SDHCI=y
-CONFIG_EDU=y
-CONFIG_VGA=y
-CONFIG_VGA_PCI=y
-CONFIG_BOCHS_DISPLAY=y
-CONFIG_IVSHMEM_DEVICE=$(CONFIG_IVSHMEM)
-CONFIG_ROCKER=y
-CONFIG_EDID=y
diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig
index 207baee6e1..af34bbcf0c 100644
--- a/hw/audio/Kconfig
+++ b/hw/audio/Kconfig
@@ -3,9 +3,13 @@ config SB16
 
 config ES1370
     bool
+    default y
+    depends on PCI
 
 config AC97
     bool
+    default y
+    depends on PCI
 
 config ADLIB
     bool
@@ -18,6 +22,8 @@ config CS4231A
 
 config HDA
     bool
+    default y
+    depends on PCI
 
 config PCSPK
     bool
diff --git a/hw/block/Kconfig b/hw/block/Kconfig
index 9d418bce4d..3710434436 100644
--- a/hw/block/Kconfig
+++ b/hw/block/Kconfig
@@ -21,6 +21,8 @@ config ONENAND
 
 config NVME_PCI
     bool
+    default y
+    depends on PCI
 
 config VIRTIO_BLK
     bool
diff --git a/hw/char/Kconfig b/hw/char/Kconfig
index 26c13243cf..1ed6f0dbce 100644
--- a/hw/char/Kconfig
+++ b/hw/char/Kconfig
@@ -15,6 +15,8 @@ config SERIAL_ISA
 
 config SERIAL_PCI
     bool
+    default y
+    depends on PCI
 
 config VIRTIO_SERIAL
     bool
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index 132aeffdbe..5e73277cc2 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -30,6 +30,9 @@ config SSD0323
 
 config VGA_PCI
     bool
+    default y
+    depends on PCI
+    select VGA
 
 config VGA_ISA
     bool
@@ -39,9 +42,15 @@ config VGA_ISA_MM
 
 config VMWARE_VGA
     bool
+    default y
+    depends on PCI
+    select VGA
 
 config BOCHS_DISPLAY
     bool
+    default y
+    depends on PCI
+    select VGA
 
 config BLIZZARD
     bool
@@ -67,7 +76,8 @@ config VGA
 
 config QXL
     bool
-    depends on SPICE
+    depends on SPICE && PCI
+    select VGA
 
 config VIRTIO_GPU
     bool
diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig
index 091f3a81c9..0f25b27163 100644
--- a/hw/ide/Kconfig
+++ b/hw/ide/Kconfig
@@ -7,6 +7,7 @@ config IDE_QDEV
 
 config IDE_PCI
     bool
+    depends on PCI
     select IDE_CORE
 
 config IDE_ISA
@@ -15,10 +16,12 @@ config IDE_ISA
 
 config IDE_PIIX
     bool
+    depends on PCI
     select IDE_QDEV
 
 config IDE_CMD646
     bool
+    select IDE_PCI
     select IDE_QDEV
 
 config IDE_MACIO
@@ -31,6 +34,7 @@ config IDE_MMIO
 
 config IDE_VIA
     bool
+    select IDE_PCI
     select IDE_QDEV
 
 config MICRODRIVE
@@ -39,6 +43,8 @@ config MICRODRIVE
 
 config AHCI
     bool
+    default y
+    depends on PCI
     select IDE_QDEV
 
 config IDE_SII3112
diff --git a/hw/ipack/Kconfig b/hw/ipack/Kconfig
index 481e0d2e64..98bd21cf0f 100644
--- a/hw/ipack/Kconfig
+++ b/hw/ipack/Kconfig
@@ -1,2 +1,4 @@
 config IPACK
     bool
+    default y
+    depends on PCI
diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig
index cc8dbed24e..1ca4b2464e 100644
--- a/hw/misc/Kconfig
+++ b/hw/misc/Kconfig
@@ -21,9 +21,13 @@ config ISA_TESTDEV
 
 config PCI_TESTDEV
     bool
+    default y
+    depends on PCI
 
 config EDU
     bool
+    default y
+    depends on PCI
 
 config PCA9552
     bool
diff --git a/hw/net/Kconfig b/hw/net/Kconfig
index 6b2ec971b5..c87375ee52 100644
--- a/hw/net/Kconfig
+++ b/hw/net/Kconfig
@@ -3,27 +3,42 @@ config DP8393X
 
 config NE2000_PCI
     bool
+    default y
+    depends on PCI
 
 config EEPRO100_PCI
     bool
+    default y
+    depends on PCI
 
 config PCNET_PCI
     bool
+    default y
+    depends on PCI
+    select PCNET_COMMON
 
 config PCNET_COMMON
     bool
 
 config E1000_PCI
     bool
+    default y
+    depends on PCI
 
 config E1000E_PCI
     bool
+    default y
+    depends on PCI
 
 config RTL8139_PCI
     bool
+    default y
+    depends on PCI
 
 config VMXNET3_PCI
     bool
+    default y
+    depends on PCI
 
 config SMC91C111
     bool
@@ -81,12 +96,16 @@ config ETSEC
 
 config ROCKER
     bool
+    default y
+    depends on PCI
 
 config CAN_BUS
     bool
 
 config CAN_PCI
     bool
+    default y
+    depends on PCI
 
 config CAN_SJA1000
     bool
diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig
index c48bf4e8d0..6e7575397f 100644
--- a/hw/scsi/Kconfig
+++ b/hw/scsi/Kconfig
@@ -3,21 +3,32 @@ config SCSI
 
 config LSI_SCSI_PCI
     bool
+    default y
+    depends on PCI
 
 config MPTSAS_SCSI_PCI
     bool
+    default y
+    depends on PCI
 
 config MEGASAS_SCSI_PCI
     bool
+    default y
+    depends on PCI
 
 config VMW_PVSCSI_SCSI_PCI
     bool
+    default y
+    depends on PCI
 
 config ESP
     bool
 
 config ESP_PCI
     bool
+    default y
+    depends on PCI
+    select ESP
 
 config PSERIES
     bool
diff --git a/hw/sd/Kconfig b/hw/sd/Kconfig
index 4f43bbb352..90ac74950a 100644
--- a/hw/sd/Kconfig
+++ b/hw/sd/Kconfig
@@ -9,3 +9,6 @@ config SD
 
 config SDHCI
     bool
+    default y
+    depends on PCI
+    select SD
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index cbf5c5d761..f23c542d27 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -3,21 +3,31 @@ config USB
 
 config USB_UHCI
     bool
+    default y
+    depends on PCI
 
 config USB_OHCI
     bool
+    default y
+    depends on PCI
 
 config USB_EHCI
     bool
+    default y
+    depends on PCI
 
 config USB_EHCI_SYSBUS
     bool
 
 config USB_XHCI
     bool
+    default y
+    depends on PCI
 
 config USB_XHCI_NEC
     bool
+    default y
+    depends on PCI
 
 config USB_MUSB
     bool
diff --git a/hw/virtio/Kconfig b/hw/virtio/Kconfig
index ebf18124fb..aabd6d4d96 100644
--- a/hw/virtio/Kconfig
+++ b/hw/virtio/Kconfig
@@ -6,6 +6,9 @@ config VIRTIO_RNG
 
 config VIRTIO_PCI
     bool
+    default y
+    depends on PCI
+    select VIRTIO
 
 config VIRTIO_MMIO
     bool
diff --git a/hw/watchdog/Kconfig b/hw/watchdog/Kconfig
index cd0244f4e1..4e24bf8240 100644
--- a/hw/watchdog/Kconfig
+++ b/hw/watchdog/Kconfig
@@ -3,6 +3,8 @@ config CMSDK_APB_WATCHDOG
 
 config WDT_IB6300ESB
     bool
+    default y
+    depends on PCI
 
 config WDT_IB700
     bool
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 11/25] build: convert sound.mak to Kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (9 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 10/25] build: convert pci.mak to Kconfig Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 13:26   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 12/25] build: convert usb.mak " Yang Zhong
                   ` (14 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

There is really nothing special in these devices; they are just
ISA devices.  Instead of including them for each target,
set CONFIG_ISA to true, and make the devices default to present
whenever ISA is available.  More conversion of ISA devices will
follow.

Done with the following script:

  while read i; do
     i=${i%=y}; i=${i#CONFIG_}
     sed -i -e'/^config '$i'$/!b' -en \
            -e'a\' -e'    default y\' -e'    depends on ISA' \
          `grep -lw $i hw/*/Kconfig`
  done < default-configs/sound.mak

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 default-configs/i386-softmmu.mak | 2 +-
 default-configs/sound.mak        | 4 ----
 hw/audio/Kconfig                 | 8 ++++++++
 3 files changed, 9 insertions(+), 5 deletions(-)
 delete mode 100644 default-configs/sound.mak

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 61f19e5231..275e72f3c6 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -1,7 +1,7 @@
 # Default configuration for i386-softmmu
 
 CONFIG_PCI=y
-include sound.mak
+CONFIG_ISA=y
 include usb.mak
 include hyperv.mak
 CONFIG_VGA_ISA=y
diff --git a/default-configs/sound.mak b/default-configs/sound.mak
deleted file mode 100644
index 4f22c34b5d..0000000000
--- a/default-configs/sound.mak
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SB16=y
-CONFIG_ADLIB=y
-CONFIG_GUS=y
-CONFIG_CS4231A=y
diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig
index af34bbcf0c..bfb30276ec 100644
--- a/hw/audio/Kconfig
+++ b/hw/audio/Kconfig
@@ -1,5 +1,7 @@
 config SB16
     bool
+    default y
+    depends on ISA_BUS
 
 config ES1370
     bool
@@ -13,12 +15,18 @@ config AC97
 
 config ADLIB
     bool
+    default y
+    depends on ISA_BUS
 
 config GUS
     bool
+    default y
+    depends on ISA_BUS
 
 config CS4231A
     bool
+    default y
+    depends on ISA_BUS
 
 config HDA
     bool
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 12/25] build: convert usb.mak to Kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (10 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 11/25] build: convert sound.mak " Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 13:31   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig Yang Zhong
                   ` (13 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

Instead of including the same list of devices for each target,
let the host controllers select CONFIG_USB and make the devices
default to present whenever USB is available.

Done with the following script:
  while read i; do
     i=${i%=y}; i=${i#CONFIG_}
     sed -i -e'/^config '$i'$/!b' -en \
            -e'a\' -e'    default y\' -e'    depends on USB' \
          `grep -lw $i hw/*/Kconfig`
  done < default-configs/usb.mak

followed by adding "select USB" on the host controllers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 default-configs/i386-softmmu.mak |  1 -
 default-configs/usb.mak          | 11 -----------
 hw/usb/Kconfig                   | 26 ++++++++++++++++++++++++++
 3 files changed, 26 insertions(+), 12 deletions(-)
 delete mode 100644 default-configs/usb.mak

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 275e72f3c6..e152590d15 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -2,7 +2,6 @@
 
 CONFIG_PCI=y
 CONFIG_ISA=y
-include usb.mak
 include hyperv.mak
 CONFIG_VGA_ISA=y
 CONFIG_VGA_CIRRUS=y
diff --git a/default-configs/usb.mak b/default-configs/usb.mak
deleted file mode 100644
index e42cfeabbe..0000000000
--- a/default-configs/usb.mak
+++ /dev/null
@@ -1,11 +0,0 @@
-CONFIG_USB=y
-CONFIG_USB_TABLET_WACOM=y
-CONFIG_USB_STORAGE_BOT=y
-CONFIG_USB_STORAGE_UAS=y
-CONFIG_USB_STORAGE_MTP=y
-CONFIG_SCSI=y
-CONFIG_USB_SMARTCARD=y
-CONFIG_USB_AUDIO=y
-CONFIG_USB_SERIAL=y
-CONFIG_USB_NETWORK=y
-CONFIG_USB_BLUETOOTH=y
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index f23c542d27..0b8f41040e 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -5,59 +5,85 @@ config USB_UHCI
     bool
     default y
     depends on PCI
+    select USB
 
 config USB_OHCI
     bool
     default y
     depends on PCI
+    select USB
 
 config USB_EHCI
     bool
     default y
     depends on PCI
+    select USB
 
 config USB_EHCI_SYSBUS
     bool
+    select USB
 
 config USB_XHCI
     bool
     default y
     depends on PCI
+    select USB
 
 config USB_XHCI_NEC
     bool
     default y
     depends on PCI
+    select USB
 
 config USB_MUSB
     bool
+    select USB
 
 config TUSB6010
     bool
+    select USB_MUSB
 
 config USB_TABLET_WACOM
     bool
+    default y
+    depends on USB
 
 config USB_STORAGE_BOT
     bool
+    default y
+    depends on USB
 
 config USB_STORAGE_UAS
     bool
+    default y
+    depends on USB
 
 config USB_AUDIO
     bool
+    default y
+    depends on USB
 
 config USB_SERIAL
     bool
+    default y
+    depends on USB
 
 config USB_NETWORK
     bool
+    default y
+    depends on USB
 
 config USB_BLUETOOTH
     bool
+    default y
+    depends on USB
 
 config USB_SMARTCARD
     bool
+    default y
+    depends on USB
 
 config USB_STORAGE_MTP
     bool
+    default y
+    depends on USB
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (11 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 12/25] build: convert usb.mak " Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 13:38   ` Paolo Bonzini
  2019-01-04 13:39   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 14/25] bluetooth: " Yang Zhong
                   ` (12 subsequent siblings)
  25 siblings, 2 replies; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

This lets you disable SCSI altogether with "CONFIG_SCSI=n".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 hw/scsi/Kconfig       | 11 ++++++++++-
 hw/scsi/Makefile.objs |  2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig
index 6e7575397f..d669a4824e 100644
--- a/hw/scsi/Kconfig
+++ b/hw/scsi/Kconfig
@@ -5,24 +5,29 @@ config LSI_SCSI_PCI
     bool
     default y
     depends on PCI
+    select SCSI
 
 config MPTSAS_SCSI_PCI
     bool
     default y
     depends on PCI
+    select SCSI
 
 config MEGASAS_SCSI_PCI
     bool
     default y
     depends on PCI
+    select SCSI
 
 config VMW_PVSCSI_SCSI_PCI
     bool
     default y
     depends on PCI
+    select SCSI
 
 config ESP
     bool
+    select SCSI
 
 config ESP_PCI
     bool
@@ -30,11 +35,15 @@ config ESP_PCI
     depends on PCI
     select ESP
 
-config PSERIES
+config SPAPR_VSCSI
     bool
+    select SCSI
 
 config VIRTIO_SCSI
     bool
+    default y
+    depends on VIRTIO
+    select SCSI
 
 config VHOST_USER_SCSI
     bool
diff --git a/hw/scsi/Makefile.objs b/hw/scsi/Makefile.objs
index 45167baeaf..54b36ed8b1 100644
--- a/hw/scsi/Makefile.objs
+++ b/hw/scsi/Makefile.objs
@@ -6,7 +6,7 @@ common-obj-$(CONFIG_MEGASAS_SCSI_PCI) += megasas.o
 common-obj-$(CONFIG_VMW_PVSCSI_SCSI_PCI) += vmw_pvscsi.o
 common-obj-$(CONFIG_ESP) += esp.o
 common-obj-$(CONFIG_ESP_PCI) += esp-pci.o
-obj-$(CONFIG_PSERIES) += spapr_vscsi.o
+obj-$(CONFIG_SPAPR_VSCSI) += spapr_vscsi.o
 
 ifeq ($(CONFIG_VIRTIO_SCSI),y)
 obj-y += virtio-scsi.o virtio-scsi-dataplane.o
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 14/25] bluetooth: express dependencies with Kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (12 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 13:41   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 15/25] isa: express dependencies with kconfig Yang Zhong
                   ` (11 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 hw/Makefile.objs | 2 +-
 hw/usb/Kconfig   | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 39d882af6f..b95b0c74a1 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -3,7 +3,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += acpi/
 devices-dirs-$(CONFIG_SOFTMMU) += adc/
 devices-dirs-$(CONFIG_SOFTMMU) += audio/
 devices-dirs-$(CONFIG_SOFTMMU) += block/
-devices-dirs-$(CONFIG_SOFTMMU) += bt/
+devices-dirs-$(CONFIG_BLUETOOTH) += bt/
 devices-dirs-$(CONFIG_SOFTMMU) += char/
 devices-dirs-$(CONFIG_SOFTMMU) += cpu/
 devices-dirs-$(CONFIG_SOFTMMU) += display/
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index 0b8f41040e..7b7ccfc039 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -77,6 +77,7 @@ config USB_BLUETOOTH
     bool
     default y
     depends on USB
+    select BLUETOOTH
 
 config USB_SMARTCARD
     bool
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 15/25] isa: express dependencies with kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (13 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 14/25] bluetooth: " Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 13:55   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 16/25] i386: express dependencies with Kconfig Yang Zhong
                   ` (10 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 default-configs/i386-softmmu.mak | 10 ----------
 hw/audio/Kconfig                 |  2 ++
 hw/block/Kconfig                 |  2 ++
 hw/char/Kconfig                  |  5 +++++
 hw/display/Kconfig               |  6 ++++++
 hw/i386/Kconfig                  |  1 +
 hw/ide/Kconfig                   |  1 +
 hw/input/Kconfig                 |  2 ++
 hw/isa/Kconfig                   |  5 +++++
 hw/misc/Kconfig                  |  4 ++++
 hw/net/Kconfig                   |  3 +++
 hw/watchdog/Kconfig              |  2 ++
 12 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index e152590d15..d664329ac1 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -4,23 +4,15 @@ CONFIG_PCI=y
 CONFIG_ISA=y
 include hyperv.mak
 CONFIG_VGA_ISA=y
-CONFIG_VGA_CIRRUS=y
 CONFIG_VMWARE_VGA=y
 CONFIG_VMXNET3_PCI=y
 CONFIG_VIRTIO_VGA=y
-CONFIG_VMMOUSE=y
 CONFIG_IPMI=y
 CONFIG_IPMI_LOCAL=y
 CONFIG_IPMI_EXTERN=y
 CONFIG_ISA_IPMI_KCS=y
 CONFIG_ISA_IPMI_BT=y
-CONFIG_SERIAL=y
-CONFIG_SERIAL_ISA=y
-CONFIG_PARALLEL=y
 CONFIG_I8254=y
-CONFIG_PCSPK=y
-CONFIG_PCKBD=y
-CONFIG_FDC=y
 CONFIG_ACPI=y
 CONFIG_ACPI_X86=y
 CONFIG_ACPI_X86_ICH=y
@@ -30,14 +22,12 @@ CONFIG_APM=y
 CONFIG_I8257=y
 CONFIG_IDE_ISA=y
 CONFIG_IDE_PIIX=y
-CONFIG_NE2000_ISA=y
 CONFIG_HPET=y
 CONFIG_APPLESMC=y
 CONFIG_I8259=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_MC146818RTC=y
 CONFIG_PCI_PIIX=y
-CONFIG_WDT_IB700=y
 CONFIG_ISA_DEBUG=y
 CONFIG_ISA_TESTDEV=y
 CONFIG_VMPORT=y
diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig
index bfb30276ec..350f2d4359 100644
--- a/hw/audio/Kconfig
+++ b/hw/audio/Kconfig
@@ -35,6 +35,8 @@ config HDA
 
 config PCSPK
     bool
+    default y
+    depends on ISA_BUS
 
 config WM8750
     bool
diff --git a/hw/block/Kconfig b/hw/block/Kconfig
index 3710434436..83c2be5915 100644
--- a/hw/block/Kconfig
+++ b/hw/block/Kconfig
@@ -1,5 +1,7 @@
 config FDC
     bool
+    default y
+    depends on ISA_BUS
 
 config SSI_M25P80
     bool
diff --git a/hw/char/Kconfig b/hw/char/Kconfig
index 1ed6f0dbce..26765599a5 100644
--- a/hw/char/Kconfig
+++ b/hw/char/Kconfig
@@ -3,6 +3,8 @@ config ESCC
 
 config PARALLEL
     bool
+    default y
+    depends on ISA_BUS
 
 config PL011
     bool
@@ -12,6 +14,9 @@ config SERIAL
 
 config SERIAL_ISA
     bool
+    default y
+    depends on ISA_BUS
+    select SERIAL
 
 config SERIAL_PCI
     bool
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index 5e73277cc2..e0d7919a06 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -9,6 +9,9 @@ config ADS7846
 
 config VGA_CIRRUS
     bool
+    default y
+    depends on ISA_BUS && PCI
+    select VGA
 
 config G364FB
     bool
@@ -36,9 +39,12 @@ config VGA_PCI
 
 config VGA_ISA
     bool
+    depends on ISA_BUS
+    select VGA
 
 config VGA_ISA_MM
     bool
+    select VGA
 
 config VMWARE_VGA
     bool
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index 427bda3717..68a9064558 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -9,6 +9,7 @@ config I440FX
 
 config ISAPC
     bool
+    select ISA_BUS
 
 config Q35
     bool
diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig
index 0f25b27163..41d3057675 100644
--- a/hw/ide/Kconfig
+++ b/hw/ide/Kconfig
@@ -12,6 +12,7 @@ config IDE_PCI
 
 config IDE_ISA
     bool
+    depends on ISA_BUS
     select IDE_QDEV
 
 config IDE_PIIX
diff --git a/hw/input/Kconfig b/hw/input/Kconfig
index 91bae47498..01805ed17b 100644
--- a/hw/input/Kconfig
+++ b/hw/input/Kconfig
@@ -6,6 +6,8 @@ config LM832X
 
 config PCKBD
     bool
+    default y
+    depends on ISA_BUS
 
 config PL050
     bool
diff --git a/hw/isa/Kconfig b/hw/isa/Kconfig
index b59d074453..3f451ef006 100644
--- a/hw/isa/Kconfig
+++ b/hw/isa/Kconfig
@@ -9,15 +9,20 @@ config I82378
 
 config PC87312
     bool
+    select ISA_BUS
 
 config PIIX4
     bool
+    select ISA_BUS
 
 config VT82C686
     bool
+    select ISA_BUS
 
 config SMC37C669
     bool
 
 config LPC_ICH9
     bool
+    select ISA_BUS
+    select ACPI_X86_ICH
diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig
index 1ca4b2464e..e6df7480c6 100644
--- a/hw/misc/Kconfig
+++ b/hw/misc/Kconfig
@@ -1,5 +1,6 @@
 config APPLESMC
     bool
+    depends on ISA_BUS
 
 config MAX111X
     bool
@@ -12,9 +13,11 @@ config TMP421
 
 config ISA_DEBUG
     bool
+    depends on ISA_BUS
 
 config SGA
     bool
+    depends on ISA_BUS
 
 config ISA_TESTDEV
     bool
@@ -93,6 +96,7 @@ config IOTKIT_SYSINFO
 
 config PVPANIC
     bool
+    depends on ISA_BUS
 
 config AUX
     bool
diff --git a/hw/net/Kconfig b/hw/net/Kconfig
index c87375ee52..b7585cbe55 100644
--- a/hw/net/Kconfig
+++ b/hw/net/Kconfig
@@ -48,6 +48,9 @@ config LAN9118
 
 config NE2000_ISA
     bool
+    default y
+    depends on ISA_BUS
+    depends on PCI # for NE2000State
 
 config OPENCORES_ETH
     bool
diff --git a/hw/watchdog/Kconfig b/hw/watchdog/Kconfig
index 4e24bf8240..b5cd056b01 100644
--- a/hw/watchdog/Kconfig
+++ b/hw/watchdog/Kconfig
@@ -8,6 +8,8 @@ config WDT_IB6300ESB
 
 config WDT_IB700
     bool
+    default y
+    depends on ISA_BUS
 
 config WDT_DIAG288
     bool
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 16/25] i386: express dependencies with Kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (14 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 15/25] isa: express dependencies with kconfig Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 17/25] i2c: " Yang Zhong
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

This way, the default-configs file only need to specify the boards
and any optional devices.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 default-configs/i386-softmmu.mak | 32 +++++----------------
 hw/acpi/Kconfig                  |  3 ++
 hw/display/Kconfig               |  1 +
 hw/i2c/Makefile.objs             |  4 +--
 hw/i386/Kconfig                  | 48 ++++++++++++++++++++++++++++----
 hw/isa/Kconfig                   |  1 +
 hw/pci-host/Kconfig              |  7 +++++
 hw/tpm/Kconfig                   |  5 +++-
 8 files changed, 67 insertions(+), 34 deletions(-)

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index d664329ac1..d2e58edd17 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -1,10 +1,6 @@
 # Default configuration for i386-softmmu
 
-CONFIG_PCI=y
-CONFIG_ISA=y
 include hyperv.mak
-CONFIG_VGA_ISA=y
-CONFIG_VMWARE_VGA=y
 CONFIG_VMXNET3_PCI=y
 CONFIG_VIRTIO_VGA=y
 CONFIG_IPMI=y
@@ -12,39 +8,21 @@ CONFIG_IPMI_LOCAL=y
 CONFIG_IPMI_EXTERN=y
 CONFIG_ISA_IPMI_KCS=y
 CONFIG_ISA_IPMI_BT=y
-CONFIG_I8254=y
-CONFIG_ACPI=y
-CONFIG_ACPI_X86=y
-CONFIG_ACPI_X86_ICH=y
-CONFIG_ACPI_MEMORY_HOTPLUG=y
-CONFIG_ACPI_CPU_HOTPLUG=y
-CONFIG_APM=y
-CONFIG_I8257=y
-CONFIG_IDE_ISA=y
-CONFIG_IDE_PIIX=y
+
+# Optional devices:
+#
 CONFIG_HPET=y
 CONFIG_APPLESMC=y
-CONFIG_I8259=y
 CONFIG_PFLASH_CFI01=y
-CONFIG_MC146818RTC=y
-CONFIG_PCI_PIIX=y
-CONFIG_ISA_DEBUG=y
 CONFIG_ISA_TESTDEV=y
 CONFIG_VMPORT=y
 CONFIG_SGA=y
-CONFIG_LPC_ICH9=y
-CONFIG_PCI_Q35=y
-CONFIG_APIC=y
-CONFIG_IOAPIC=y
 CONFIG_PVPANIC=y
 CONFIG_MEM_DEVICE=y
 CONFIG_DIMM=y
 CONFIG_NVDIMM=y
 CONFIG_ACPI_NVDIMM=y
 CONFIG_PCIE_PORT=y
-CONFIG_XIO3130=y
-CONFIG_IOH3420=y
-CONFIG_I82801B11=y
 CONFIG_SMBIOS=y
 CONFIG_PXB=y
 CONFIG_ACPI_VMGENID=y
@@ -53,5 +31,9 @@ CONFIG_I2C=y
 CONFIG_SEV=$(CONFIG_KVM)
 CONFIG_VTD=y
 CONFIG_AMD_IOMMU=y
+
+# Boards:
+#
+CONFIG_ISAPC=y
 CONFIG_I440FX=y
 CONFIG_Q35=y
diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig
index 2f4871c10a..98bb3539e1 100644
--- a/hw/acpi/Kconfig
+++ b/hw/acpi/Kconfig
@@ -3,15 +3,18 @@ config ACPI
 
 config ACPI_X86
     bool
+    select ACPI
 
 config ACPI_X86_ICH
     bool
+    select ACPI_X86
 
 config ACPI_CPU_HOTPLUG
     bool
 
 config ACPI_MEMORY_HOTPLUG
     bool
+    select MEM_DEVICE
 
 config ACPI_NVDIMM
     bool
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index e0d7919a06..8ce968bfff 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -82,6 +82,7 @@ config VGA
 
 config QXL
     bool
+    default y if PC
     depends on SPICE && PCI
     select VGA
 
diff --git a/hw/i2c/Makefile.objs b/hw/i2c/Makefile.objs
index 37cacde978..48f7760379 100644
--- a/hw/i2c/Makefile.objs
+++ b/hw/i2c/Makefile.objs
@@ -1,8 +1,8 @@
 common-obj-$(CONFIG_I2C) += core.o smbus.o smbus_eeprom.o
 common-obj-$(CONFIG_DDC) += i2c-ddc.o
 common-obj-$(CONFIG_VERSATILE_I2C) += versatile_i2c.o
-common-obj-$(CONFIG_ACPI_X86) += smbus_ich9.o
-common-obj-$(CONFIG_APM) += pm_smbus.o
+common-obj-$(CONFIG_ACPI_X86_ICH) += smbus_ich9.o
+common-obj-$(CONFIG_ACPI_SMBUS) += pm_smbus.o
 common-obj-$(CONFIG_BITBANG_I2C) += bitbang_i2c.o
 common-obj-$(CONFIG_EXYNOS4) += exynos4210_i2c.o
 common-obj-$(CONFIG_IMX_I2C) += imx_i2c.o
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index 68a9064558..f53a788a95 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -1,21 +1,57 @@
 config KVM
     bool
 
-config I440FX
+config PC
     bool
-    select QXL if SPICE
+    select ISA_DEBUG
+    select I8259
+    select I8254
+    select PCSPK
+    select I82374
+    select I8257
+    select MC146818RTC
     select TPM_TIS if TPM
-    select XEN_I386 if XEN
+
+config PC_PCI
+    bool
+    select APIC
+    select IOAPIC
+    select APM
+    select PC
+
+config PC_ACPI
+    bool
+    select ACPI_X86
+    select ACPI_CPU_HOTPLUG
+    select ACPI_MEMORY_HOTPLUG
+    depends on ACPI_SMBUS
+
+config I440FX
+    bool
+    select PC_PCI
+    select PC_ACPI
+    select ACPI_SMBUS
+    select PCI_PIIX
+    select FDC
+    select IDE_PIIX
 
 config ISAPC
     bool
     select ISA_BUS
+    select PC
+    select IDE_ISA
+    select VGA_ISA
+    # FIXME: it is in the same file as i440fx, and does not compile
+    # if separated
+    depends on I440FX
 
 config Q35
     bool
-    select QXL if SPICE
-    select TPM_TIS if TPM
-    select XEN_I386 if XEN
+    select PC_PCI
+    select PC_ACPI
+    select PCI_Q35
+    select LPC_ICH9
+    select AHCI
 
 config VTD
     bool
diff --git a/hw/isa/Kconfig b/hw/isa/Kconfig
index 3f451ef006..bf72e4fef2 100644
--- a/hw/isa/Kconfig
+++ b/hw/isa/Kconfig
@@ -25,4 +25,5 @@ config SMC37C669
 config LPC_ICH9
     bool
     select ISA_BUS
+    select ACPI_SMBUS
     select ACPI_X86_ICH
diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig
index 359df1d239..9d57c6cac9 100644
--- a/hw/pci-host/Kconfig
+++ b/hw/pci-host/Kconfig
@@ -21,9 +21,16 @@ config PCI_SABRE
 
 config PCI_PIIX
     bool
+    select PAM
+    select PCI
 
 config PCI_Q35
     bool
+    select PAM
+    select PCI
+    select XIO3130
+    select IOH3420
+    select I82801B11
 
 config PCI_GENERIC
     bool
diff --git a/hw/tpm/Kconfig b/hw/tpm/Kconfig
index da4bb5b6c7..28acdb745e 100644
--- a/hw/tpm/Kconfig
+++ b/hw/tpm/Kconfig
@@ -3,10 +3,13 @@ config TPM
 
 config TPM_TIS
     bool
-    depends on TPM
+    default y
+    depends on TPM && PC
 
 config TPM_CRB
     bool
+    default y
+    depends on TPM && PC
 
 config TPM_PASSTHROUGH
     bool
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 17/25] i2c: express dependencies with Kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (15 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 16/25] i386: express dependencies with Kconfig Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 15:30   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 18/25] ptimer: " Yang Zhong
                   ` (8 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 hw/Makefile.objs     | 2 +-
 hw/audio/Kconfig     | 1 +
 hw/display/Kconfig   | 3 +++
 hw/gpio/Kconfig      | 1 +
 hw/i2c/Kconfig       | 6 ++++++
 hw/i2c/Makefile.objs | 3 ++-
 hw/i386/Kconfig      | 1 +
 hw/input/Kconfig     | 1 +
 hw/isa/Kconfig       | 1 +
 hw/misc/Kconfig      | 4 ++++
 hw/timer/Kconfig     | 3 +++
 11 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index b95b0c74a1..920086b182 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -10,7 +10,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += display/
 devices-dirs-$(CONFIG_SOFTMMU) += dma/
 devices-dirs-$(CONFIG_SOFTMMU) += gpio/
 devices-dirs-$(CONFIG_HYPERV) += hyperv/
-devices-dirs-$(CONFIG_SOFTMMU) += i2c/
+devices-dirs-$(CONFIG_I2C) += i2c/
 devices-dirs-$(CONFIG_SOFTMMU) += ide/
 devices-dirs-$(CONFIG_SOFTMMU) += input/
 devices-dirs-$(CONFIG_SOFTMMU) += intc/
diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig
index 350f2d4359..5cb7118e44 100644
--- a/hw/audio/Kconfig
+++ b/hw/audio/Kconfig
@@ -40,6 +40,7 @@ config PCSPK
 
 config WM8750
     bool
+    depends on I2C
 
 config PL041
     bool
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index 8ce968bfff..8ddce09ead 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -24,9 +24,11 @@ config PL110
 
 config SII9022
     bool
+    depends on I2C
 
 config SSD0303
     bool
+    depends on I2C
 
 config SSD0323
     bool
@@ -70,6 +72,7 @@ config MILKYMIST_TMU2
 
 config SM501
     bool
+    depends on I2C
 
 config TCX
     bool
diff --git a/hw/gpio/Kconfig b/hw/gpio/Kconfig
index d0a4abf93f..9227cb5598 100644
--- a/hw/gpio/Kconfig
+++ b/hw/gpio/Kconfig
@@ -1,5 +1,6 @@
 config MAX7310
     bool
+    depends on I2C
 
 config PL061
     bool
diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig
index d6d4402608..74c9328729 100644
--- a/hw/i2c/Kconfig
+++ b/hw/i2c/Kconfig
@@ -3,18 +3,24 @@ config I2C
 
 config SMBUS_EEPROM
     bool
+    depends on I2C
 
 config DDC
     bool
+    depends on I2C
 
 config VERSATILE_I2C
     bool
+    select I2C
 
 config ACPI_SMBUS
     bool
+    select I2C
 
 config BITBANG_I2C
     bool
+    select I2C
 
 config IMX_I2C
     bool
+    select I2C
diff --git a/hw/i2c/Makefile.objs b/hw/i2c/Makefile.objs
index 48f7760379..ff22aa6541 100644
--- a/hw/i2c/Makefile.objs
+++ b/hw/i2c/Makefile.objs
@@ -1,4 +1,5 @@
-common-obj-$(CONFIG_I2C) += core.o smbus.o smbus_eeprom.o
+common-obj-$(CONFIG_I2C) += core.o smbus.o
+common-obj-$(CONFIG_SMBUS_EEPROM) += smbus_eeprom.o
 common-obj-$(CONFIG_DDC) += i2c-ddc.o
 common-obj-$(CONFIG_VERSATILE_I2C) += versatile_i2c.o
 common-obj-$(CONFIG_ACPI_X86_ICH) += smbus_ich9.o
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index f53a788a95..695a67f88d 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -24,6 +24,7 @@ config PC_ACPI
     select ACPI_X86
     select ACPI_CPU_HOTPLUG
     select ACPI_MEMORY_HOTPLUG
+    select SMBUS_EEPROM
     depends on ACPI_SMBUS
 
 config I440FX
diff --git a/hw/input/Kconfig b/hw/input/Kconfig
index 01805ed17b..5d64e07fc6 100644
--- a/hw/input/Kconfig
+++ b/hw/input/Kconfig
@@ -3,6 +3,7 @@ config ADB
 
 config LM832X
     bool
+    depends on I2C
 
 config PCKBD
     bool
diff --git a/hw/isa/Kconfig b/hw/isa/Kconfig
index bf72e4fef2..82eaf183b1 100644
--- a/hw/isa/Kconfig
+++ b/hw/isa/Kconfig
@@ -18,6 +18,7 @@ config PIIX4
 config VT82C686
     bool
     select ISA_BUS
+    select ACPI_SMBUS
 
 config SMC37C669
     bool
diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig
index e6df7480c6..0a87b52ec7 100644
--- a/hw/misc/Kconfig
+++ b/hw/misc/Kconfig
@@ -7,9 +7,11 @@ config MAX111X
 
 config TMP105
     bool
+    depends on I2C
 
 config TMP421
     bool
+    depends on I2C
 
 config ISA_DEBUG
     bool
@@ -34,6 +36,7 @@ config EDU
 
 config PCA9552
     bool
+    depends on I2C
 
 config PL310
     bool
@@ -100,3 +103,4 @@ config PVPANIC
 
 config AUX
     bool
+    depends on I2C
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index 7dbc1211ab..e1a6e7469b 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -9,6 +9,7 @@ config A9_GTIMER
 
 config DS1338
     bool
+    depends on I2C
 
 config HPET
     bool
@@ -18,6 +19,7 @@ config I8254
 
 config M41T80
     bool
+    depends on I2C
 
 config M48T59
     bool
@@ -27,6 +29,7 @@ config PL031
 
 config TWL92230
     bool
+    depends on I2C
 
 config XLNX_ZYNQMP
     bool
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 18/25] ptimer: express dependencies with Kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (16 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 17/25] i2c: " Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 19/25] edid: express dependencies with kconfig Yang Zhong
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 hw/Kconfig       | 2 ++
 hw/net/Kconfig   | 2 ++
 hw/timer/Kconfig | 6 ++++++
 3 files changed, 10 insertions(+)

diff --git a/hw/Kconfig b/hw/Kconfig
index b27290d332..27ac668584 100644
--- a/hw/Kconfig
+++ b/hw/Kconfig
@@ -43,6 +43,8 @@ source i386/Kconfig
 # Symbols used by multiple targets
 config XILINX
     bool
+    select PTIMER # for hw/timer/xilinx_timer.c
 
 config XILINX_AXI
     bool
+    select PTIMER # for hw/dma/xilinx_axidma.c
diff --git a/hw/net/Kconfig b/hw/net/Kconfig
index b7585cbe55..b50a8a4368 100644
--- a/hw/net/Kconfig
+++ b/hw/net/Kconfig
@@ -45,6 +45,7 @@ config SMC91C111
 
 config LAN9118
     bool
+    select PTIMER
 
 config NE2000_ISA
     bool
@@ -96,6 +97,7 @@ config VIRTIO_NET
 
 config ETSEC
     bool
+    select PTIMER
 
 config ROCKER
     bool
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index e1a6e7469b..a021c742de 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -1,8 +1,10 @@
 config ARM_TIMER
     bool
+    select PTIMER
 
 config ARM_MPTIMER
     bool
+    select PTIMER
 
 config A9_GTIMER
     bool
@@ -36,12 +38,14 @@ config XLNX_ZYNQMP
 
 config ALTERA_TIMER
     bool
+    select PTIMER
 
 config MC146818RTC
     bool
 
 config ALLWINNER_A10_PIT
     bool
+    select PTIMER
 
 config STM32F2XX_TIMER
     bool
@@ -51,6 +55,8 @@ config SUN4V_RTC
 
 config CMSDK_APB_TIMER
     bool
+    select PTIMER
 
 config CMSDK_APB_DUALTIMER
     bool
+    select PTIMER
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 19/25] edid: express dependencies with kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (17 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 18/25] ptimer: " Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 15:35   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 20/25] hyperv: " Yang Zhong
                   ` (6 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 hw/display/Kconfig | 2 ++
 hw/i2c/Kconfig     | 1 +
 2 files changed, 3 insertions(+)

diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index 8ddce09ead..8b8f1027b1 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -38,6 +38,7 @@ config VGA_PCI
     default y
     depends on PCI
     select VGA
+    select EDID
 
 config VGA_ISA
     bool
@@ -59,6 +60,7 @@ config BOCHS_DISPLAY
     default y
     depends on PCI
     select VGA
+    select EDID
 
 config BLIZZARD
     bool
diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig
index 74c9328729..ef1caa6d89 100644
--- a/hw/i2c/Kconfig
+++ b/hw/i2c/Kconfig
@@ -8,6 +8,7 @@ config SMBUS_EEPROM
 config DDC
     bool
     depends on I2C
+    select EDID
 
 config VERSATILE_I2C
     bool
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 20/25] hyperv: express dependencies with kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (18 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 19/25] edid: express dependencies with kconfig Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 15:38   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 21/25] virtio: make virtio dependencies with Kconfig Yang Zhong
                   ` (5 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

remove default-configs/hyperv.mak and make dependencies
with Kconfig.

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 default-configs/hyperv.mak       | 2 --
 default-configs/i386-softmmu.mak | 1 -
 hw/hyperv/Kconfig                | 1 +
 hw/i386/Kconfig                  | 2 ++
 4 files changed, 3 insertions(+), 3 deletions(-)
 delete mode 100644 default-configs/hyperv.mak

diff --git a/default-configs/hyperv.mak b/default-configs/hyperv.mak
deleted file mode 100644
index 5d0d9fd830..0000000000
--- a/default-configs/hyperv.mak
+++ /dev/null
@@ -1,2 +0,0 @@
-CONFIG_HYPERV=$(CONFIG_KVM)
-CONFIG_HYPERV_TESTDEV=y
diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index d2e58edd17..eb2d22de3c 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -1,6 +1,5 @@
 # Default configuration for i386-softmmu
 
-include hyperv.mak
 CONFIG_VMXNET3_PCI=y
 CONFIG_VIRTIO_VGA=y
 CONFIG_IPMI=y
diff --git a/hw/hyperv/Kconfig b/hw/hyperv/Kconfig
index be724b7f8b..632c3a675b 100644
--- a/hw/hyperv/Kconfig
+++ b/hw/hyperv/Kconfig
@@ -1,5 +1,6 @@
 config HYPERV
     bool
+    depends on KVM
 
 config HYPERV_TESTDEV
     bool
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index 695a67f88d..af4b81bae1 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -11,6 +11,8 @@ config PC
     select I8257
     select MC146818RTC
     select TPM_TIS if TPM
+    select HYPERV
+    select HYPERV_TESTDEV
 
 config PC_PCI
     bool
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 21/25] virtio: make virtio dependencies with Kconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (19 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 20/25] hyperv: " Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 19:54   ` Thomas Huth
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 22/25] i386-softmmu.mak: remove all CONFIG_* except boards definitions Yang Zhong
                   ` (4 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 default-configs/i386-softmmu.mak |  1 -
 hw/9pfs/Kconfig                  |  2 ++
 hw/block/Kconfig                 |  2 ++
 hw/char/Kconfig                  |  2 ++
 hw/display/Kconfig               |  5 +++++
 hw/input/Kconfig                 |  2 ++
 hw/net/Kconfig                   |  2 ++
 hw/pci-host/Kconfig              |  2 ++
 hw/virtio/Kconfig                | 10 +++++++++-
 9 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index eb2d22de3c..d3488b5a6d 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -1,7 +1,6 @@
 # Default configuration for i386-softmmu
 
 CONFIG_VMXNET3_PCI=y
-CONFIG_VIRTIO_VGA=y
 CONFIG_IPMI=y
 CONFIG_IPMI_LOCAL=y
 CONFIG_IPMI_EXTERN=y
diff --git a/hw/9pfs/Kconfig b/hw/9pfs/Kconfig
index a4750999d9..d85869ca81 100644
--- a/hw/9pfs/Kconfig
+++ b/hw/9pfs/Kconfig
@@ -1,2 +1,4 @@
 config VIRTIO_9P
     bool
+    default y
+    depends on VIRTIO
diff --git a/hw/block/Kconfig b/hw/block/Kconfig
index 83c2be5915..771967ad9f 100644
--- a/hw/block/Kconfig
+++ b/hw/block/Kconfig
@@ -28,6 +28,8 @@ config NVME_PCI
 
 config VIRTIO_BLK
     bool
+    default y
+    depends on VIRTIO
 
 config VHOST_USER_BLK
     bool
diff --git a/hw/char/Kconfig b/hw/char/Kconfig
index 26765599a5..e2b56a178c 100644
--- a/hw/char/Kconfig
+++ b/hw/char/Kconfig
@@ -25,6 +25,8 @@ config SERIAL_PCI
 
 config VIRTIO_SERIAL
     bool
+    default y
+    depends on VIRTIO
 
 config STM32F2XX_USART
     bool
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index 8b8f1027b1..38629b8e1b 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -93,9 +93,14 @@ config QXL
 
 config VIRTIO_GPU
     bool
+    default y
+    depends on VIRTIO
 
 config VIRTIO_VGA
     bool
+    default y
+    depends on VIRTIO && PCI
+    select VGA
 
 config DPCD
     bool
diff --git a/hw/input/Kconfig b/hw/input/Kconfig
index 5d64e07fc6..7434a14cb0 100644
--- a/hw/input/Kconfig
+++ b/hw/input/Kconfig
@@ -21,6 +21,8 @@ config TSC2005
 
 config VIRTIO_INPUT
     bool
+    default y
+    depends on VIRTIO
 
 config TSC210X
     bool
diff --git a/hw/net/Kconfig b/hw/net/Kconfig
index b50a8a4368..8b65de1d7f 100644
--- a/hw/net/Kconfig
+++ b/hw/net/Kconfig
@@ -94,6 +94,8 @@ config XILINX_ETHLITE
 
 config VIRTIO_NET
    bool
+   default y
+   depends on VIRTIO
 
 config ETSEC
     bool
diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig
index 9d57c6cac9..d7af6aa441 100644
--- a/hw/pci-host/Kconfig
+++ b/hw/pci-host/Kconfig
@@ -23,6 +23,7 @@ config PCI_PIIX
     bool
     select PAM
     select PCI
+    select VIRTIO
 
 config PCI_Q35
     bool
@@ -31,6 +32,7 @@ config PCI_Q35
     select XIO3130
     select IOH3420
     select I82801B11
+    select VIRTIO
 
 config PCI_GENERIC
     bool
diff --git a/hw/virtio/Kconfig b/hw/virtio/Kconfig
index aabd6d4d96..9127daed5e 100644
--- a/hw/virtio/Kconfig
+++ b/hw/virtio/Kconfig
@@ -3,18 +3,26 @@ config VIRTIO
 
 config VIRTIO_RNG
     bool
+    default y
+    depends on VIRTIO
 
 config VIRTIO_PCI
     bool
     default y
     depends on PCI
-    select VIRTIO
+    depends on VIRTIO
 
 config VIRTIO_MMIO
     bool
+    default y
+    depends on VIRTIO
 
 config VIRTIO_BALLOON
     bool
+    default y
+    depends on VIRTIO
 
 config VIRTIO_CRYPTO
     bool
+    default y
+    depends on VIRTIO
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 22/25] i386-softmmu.mak: remove all CONFIG_* except boards definitions
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (20 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 21/25] virtio: make virtio dependencies with Kconfig Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 13:59   ` Paolo Bonzini
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 23/25] x86_64-softmmu.mak: remove i386-softmmu.mak include Yang Zhong
                   ` (3 subsequent siblings)
  25 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

%-softmmu.mak only keep boards definitions in Kconfig mode.

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 default-configs/i386-softmmu.mak | 30 ------------------------------
 hw/i386/Kconfig                  | 30 ++++++++++++++++++++++++++++++
 hw/ide/Kconfig                   |  2 +-
 hw/net/Kconfig                   |  2 ++
 4 files changed, 33 insertions(+), 31 deletions(-)

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index d3488b5a6d..7b083412af 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -1,35 +1,5 @@
 # Default configuration for i386-softmmu
 
-CONFIG_VMXNET3_PCI=y
-CONFIG_IPMI=y
-CONFIG_IPMI_LOCAL=y
-CONFIG_IPMI_EXTERN=y
-CONFIG_ISA_IPMI_KCS=y
-CONFIG_ISA_IPMI_BT=y
-
-# Optional devices:
-#
-CONFIG_HPET=y
-CONFIG_APPLESMC=y
-CONFIG_PFLASH_CFI01=y
-CONFIG_ISA_TESTDEV=y
-CONFIG_VMPORT=y
-CONFIG_SGA=y
-CONFIG_PVPANIC=y
-CONFIG_MEM_DEVICE=y
-CONFIG_DIMM=y
-CONFIG_NVDIMM=y
-CONFIG_ACPI_NVDIMM=y
-CONFIG_PCIE_PORT=y
-CONFIG_SMBIOS=y
-CONFIG_PXB=y
-CONFIG_ACPI_VMGENID=y
-CONFIG_FW_CFG_DMA=y
-CONFIG_I2C=y
-CONFIG_SEV=$(CONFIG_KVM)
-CONFIG_VTD=y
-CONFIG_AMD_IOMMU=y
-
 # Boards:
 #
 CONFIG_ISAPC=y
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index af4b81bae1..c00080ac76 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -1,6 +1,9 @@
 config KVM
     bool
 
+config SEV
+    bool
+
 config PC
     bool
     select ISA_DEBUG
@@ -13,6 +16,29 @@ config PC
     select TPM_TIS if TPM
     select HYPERV
     select HYPERV_TESTDEV
+    select DIMM
+    select AMD_IOMMU
+    select NVDIMM
+    select ACPI_NVDIMM
+    select ACPI_VMGENID
+    select SMBIOS
+    select IPMI
+    select IPMI_LOCAL
+    select IPMI_EXTERN
+    select ISA_IPMI_KCS
+    select ISA_IPMI_BT
+    select PFLASH_CFI01
+    select I2C
+    select PVPANIC
+    select PXB
+    select VMPORT
+    select VMMOUSE
+    select SEV if KVM
+    select HPET
+    select APPLESMC
+    select ISA_TESTDEV
+    select SGA
+    select FW_CFG_DMA
 
 config PC_PCI
     bool
@@ -37,6 +63,7 @@ config I440FX
     select PCI_PIIX
     select FDC
     select IDE_PIIX
+    select VTD
 
 config ISAPC
     bool
@@ -55,6 +82,8 @@ config Q35
     select PCI_Q35
     select LPC_ICH9
     select AHCI
+    select VTD
+    select PCIE_PORT
 
 config VTD
     bool
@@ -67,3 +96,4 @@ config VMPORT
 
 config VMMOUSE
     bool
+    depends on VMPORT
diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig
index 41d3057675..b9ba571c04 100644
--- a/hw/ide/Kconfig
+++ b/hw/ide/Kconfig
@@ -17,7 +17,7 @@ config IDE_ISA
 
 config IDE_PIIX
     bool
-    depends on PCI
+    select IDE_PCI
     select IDE_QDEV
 
 config IDE_CMD646
diff --git a/hw/net/Kconfig b/hw/net/Kconfig
index 8b65de1d7f..3be0571649 100644
--- a/hw/net/Kconfig
+++ b/hw/net/Kconfig
@@ -108,6 +108,7 @@ config ROCKER
 
 config CAN_BUS
     bool
+    default y
 
 config CAN_PCI
     bool
@@ -116,3 +117,4 @@ config CAN_PCI
 
 config CAN_SJA1000
     bool
+    default y
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 23/25] x86_64-softmmu.mak: remove i386-softmmu.mak include
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (21 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 22/25] i386-softmmu.mak: remove all CONFIG_* except boards definitions Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 19:58   ` Thomas Huth
  2019-01-05 15:32   ` Peter Maydell
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 24/25] minikconf: implement allyesconfig, allnoconfig, randconfig, defconfig Yang Zhong
                   ` (2 subsequent siblings)
  25 siblings, 2 replies; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

Only keep same boards definitions as i386-softmmu.mak in
x86_64-softmmu.mak.

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 default-configs/x86_64-softmmu.mak | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
index 64b2ee2960..0c69c2930c 100644
--- a/default-configs/x86_64-softmmu.mak
+++ b/default-configs/x86_64-softmmu.mak
@@ -1,3 +1,7 @@
 # Default configuration for x86_64-softmmu
 
-include i386-softmmu.mak
+# Boards:
+#
+CONFIG_ISAPC=y
+CONFIG_I440FX=y
+CONFIG_Q35=y
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 24/25] minikconf: implement allyesconfig, allnoconfig, randconfig, defconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (22 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 23/25] x86_64-softmmu.mak: remove i386-softmmu.mak include Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 25/25] Makefile: only support defconfig Yang Zhong
  2019-01-04 14:02 ` [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Paolo Bonzini
  25 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

From: Paolo Bonzini <pbonzini@redhat.com>

Apart from defconfig (which is a no-op), the others are implemented
implemented simply by ignoring the RHS of assignments and "default"
statements.  The RHS is replaced respectively by "true", "false" or
a random value.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile             |  5 +++++
 scripts/minikconf.py | 43 ++++++++++++++++++++++++++++++++++++-------
 2 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index ccf3e3f5b3..b8602b1007 100644
--- a/Makefile
+++ b/Makefile
@@ -392,6 +392,11 @@ MINIKCONF_ARGS = \
 
 MINIKCONF = $(SHELL) $(SRC_PATH)/scripts/minikconf.sh
 
+.PHONY: allyesconfig allnoconfig defconfig randconfig
+allyesconfig allnoconfig defconfig randconfig:
+	rm */config-devices.mak config-all-devices.mak
+	$(MAKE) MINIKCONF="$(MINIKCONF) --$<" config-all-devices.mak
+
 %/config-devices.mak: default-configs/%-softmmu.mak Kconfig.host hw/Kconfig
 	$(call quiet-command, \
             $(MINIKCONF) $@ $*-config-devices.mak.d $^ $(MINIKCONF_ARGS) > $@.tmp, "  GEN   $@.tmp")
diff --git a/scripts/minikconf.py b/scripts/minikconf.py
index a03e5ec55e..ef9c4cdce0 100644
--- a/scripts/minikconf.py
+++ b/scripts/minikconf.py
@@ -13,8 +13,10 @@
 import os
 import sys
 import re
+import random
 
-__all__ = [ 'KconfigParserError', 'KconfigData', 'KconfigParser' ]
+__all__ = [ 'KconfigParserError', 'KconfigData', 'KconfigParser',
+        'defconfig', 'allyesconfig', 'allnoconfig', 'randconfig' ]
 
 def debug_print(*args):
     #print ' '.join(str(x) for x in args)
@@ -30,6 +32,11 @@ def debug_print(*args):
 # just its name).
 # -------------------------------------------
 
+allyesconfig = lambda x: True
+allnoconfig = lambda x: False
+defconfig = lambda x: x
+randconfig = lambda x: random.randint(0, 1) == 1
+
 class KconfigData:
     class Expr:
         def __and__(self, rhs):
@@ -178,7 +185,8 @@ class KconfigData:
             if self.cond.evaluate():
                 self.dest.set_value(True)
 
-    def __init__(self):
+    def __init__(self, value_mangler=defconfig):
+        self.value_mangler = value_mangler
         self.previously_included = []
         self.incl_info = None
         self.defined_vars = set()
@@ -256,10 +264,12 @@ class KconfigData:
         return var_obj
 
     def do_assignment(self, var, val):
-        self.clauses.append(KconfigData.AssignmentClause(var, val))
+        f = self.value_mangler
+        self.clauses.append(KconfigData.AssignmentClause(var, f(val)))
 
     def do_default(self, var, val, cond=None):
-        self.clauses.append(KconfigData.DefaultClause(var, val, cond))
+        f = self.value_mangler
+        self.clauses.append(KconfigData.DefaultClause(var, f(val), cond))
 
     def do_depends_on(self, var, expr):
         self.clauses.append(KconfigData.DependsOnClause(var, expr))
@@ -309,9 +319,10 @@ class KconfigParserError(Exception):
         return "%s: %s" % (self.loc, self.msg)
 
 class KconfigParser:
+
     @classmethod
-    def parse(self, fp):
-        data = KconfigData()
+    def parse(self, fp, mode=None):
+        data = KconfigData(mode or KconfigParser.defconfig)
         parser = KconfigParser(data)
         parser.parse_file(fp)
         return data
@@ -627,11 +638,29 @@ class KconfigParser:
 
 if __name__ == '__main__':
     argv = sys.argv
+    mode = defconfig
+    if len(sys.argv) > 1:
+        if argv[1] == '--defconfig':
+            del argv[1]
+        elif argv[1] == '--randconfig':
+            mode = randconfig
+            del argv[1]
+        elif argv[1] == '--allyesconfig':
+            mode = allyesconfig
+            del argv[1]
+        elif argv[1] == '--allnoconfig':
+            mode = allnoconfig
+            del argv[1]
+
     if len(argv) == 1:
         print >>sys.stderr, "%s: at least one argument is required" % argv[0]
         os.exit(1)
 
-    data = KconfigData()
+    if argv[1].startswith('-'):
+        print >>sys.stderr, "%s: invalid option %s" % (argv[0], argv[1])
+        os.exit(1)
+
+    data = KconfigData(mode)
     parser = KconfigParser(data)
     for arg in argv[3:]:
         m = re.match(r'^(CONFIG_[A-Z0-9_]+)=([yn]?)$', arg)
-- 
2.17.1

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

* [Qemu-devel] [RFC PATCH 25/25] Makefile: only support defconfig
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (23 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 24/25] minikconf: implement allyesconfig, allnoconfig, randconfig, defconfig Yang Zhong
@ 2018-12-27  6:34 ` Yang Zhong
  2019-01-04 14:02 ` [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Paolo Bonzini
  25 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2018-12-27  6:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell, thuth, yang.zhong

add CONFIG_VHOST_USER and CONFIG_LINUX in Kconfig.host, the
current Makefile only support defconfig because of randconfig
does not work.

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 Kconfig.host     |  6 ++++++
 Makefile         | 16 ++++++++--------
 hw/block/Kconfig |  2 ++
 hw/scsi/Kconfig  |  2 ++
 hw/tpm/Kconfig   |  2 ++
 5 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/Kconfig.host b/Kconfig.host
index d7f503d0ca..3772627a3a 100644
--- a/Kconfig.host
+++ b/Kconfig.host
@@ -16,3 +16,9 @@ config TPM
 
 config XEN
     bool
+
+config VHOST_USER
+    bool
+
+config LINUX
+    bool
diff --git a/Makefile b/Makefile
index b8602b1007..8b3c9685a9 100644
--- a/Makefile
+++ b/Makefile
@@ -368,6 +368,9 @@ endif
 SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR)
 SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
 SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
+SUBDIR_TARGET_MAK=$(patsubst %, %/config-target.mak, $(TARGET_DIRS))
+
+-include $(SUBDIR_TARGET_MAK)
 
 ifeq ($(SUBDIR_DEVICES_MAK),)
 config-all-devices.mak:
@@ -388,16 +391,13 @@ MINIKCONF_ARGS = \
     CONFIG_SPICE=$(CONFIG_SPICE) \
     CONFIG_TPM=$(CONFIG_TPM) \
     CONFIG_XEN=$(CONFIG_XEN) \
-    CONFIG_OPENGL=$(CONFIG_OPENGL)
-
-MINIKCONF = $(SHELL) $(SRC_PATH)/scripts/minikconf.sh
+    CONFIG_OPENGL=$(CONFIG_OPENGL) \
+    CONFIG_VHOST_USER=$(CONFIG_VHOST_USER) \
+    CONFIG_LINUX=$(CONFIG_LINUX)
 
-.PHONY: allyesconfig allnoconfig defconfig randconfig
-allyesconfig allnoconfig defconfig randconfig:
-	rm */config-devices.mak config-all-devices.mak
-	$(MAKE) MINIKCONF="$(MINIKCONF) --$<" config-all-devices.mak
+MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py --defconfig
 
-%/config-devices.mak: default-configs/%-softmmu.mak Kconfig.host hw/Kconfig
+%/config-devices.mak: default-configs/%.mak Kconfig.host $(SRC_PATH)/hw/Kconfig
 	$(call quiet-command, \
             $(MINIKCONF) $@ $*-config-devices.mak.d $^ $(MINIKCONF_ARGS) > $@.tmp, "  GEN   $@.tmp")
 	$(call quiet-command, if test -f $@; then \
diff --git a/hw/block/Kconfig b/hw/block/Kconfig
index 771967ad9f..b2f1de9eca 100644
--- a/hw/block/Kconfig
+++ b/hw/block/Kconfig
@@ -33,3 +33,5 @@ config VIRTIO_BLK
 
 config VHOST_USER_BLK
     bool
+    default y
+    depends on VHOST_USER && LINUX
diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig
index d669a4824e..03a91229f7 100644
--- a/hw/scsi/Kconfig
+++ b/hw/scsi/Kconfig
@@ -47,3 +47,5 @@ config VIRTIO_SCSI
 
 config VHOST_USER_SCSI
     bool
+    default y
+    depends on VHOST_USER && LINUX
diff --git a/hw/tpm/Kconfig b/hw/tpm/Kconfig
index 28acdb745e..6d383b7209 100644
--- a/hw/tpm/Kconfig
+++ b/hw/tpm/Kconfig
@@ -13,6 +13,8 @@ config TPM_CRB
 
 config TPM_PASSTHROUGH
     bool
+    depends on TPM
 
 config TPM_EMULATOR
     bool
+    depends on TPM
-- 
2.17.1

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

* Re: [Qemu-devel] [RFC PATCH 01/25] build: actually use CONFIG_PAM
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 01/25] build: actually use CONFIG_PAM Yang Zhong
@ 2019-01-03 14:15   ` Thomas Huth
  2019-01-07 11:29     ` Yang Zhong
  0 siblings, 1 reply; 70+ messages in thread
From: Thomas Huth @ 2019-01-03 14:15 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel
  Cc: pbonzini, sameo, ehabkost, peter.maydell, Daniel P. Berrange

 Hi,

On 2018-12-27 07:33, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> Do not link it unconditionally into all binaries.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/pci-host/Makefile.objs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/pci-host/Makefile.objs b/hw/pci-host/Makefile.objs
> index 6d6597c065..9d7e7cd1b8 100644
> --- a/hw/pci-host/Makefile.objs
> +++ b/hw/pci-host/Makefile.objs
> @@ -1,4 +1,4 @@
> -common-obj-y += pam.o
> +common-obj-$(CONFIG_PAM) += pam.o

CONFIG_PAM has been removed in the default-configs with commit

  a3b6e2bb71e6495a44f24e2296ab4feb4b6d4818
   default-configs: remove CONFIG_PAM

... so if you want to use it now, you've got to revert that commit, too.

 Thomas

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

* Re: [Qemu-devel] [RFC PATCH 02/25] hw/i386/Makefile.objs: Build pc_piix* and pc_q35 boards
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 02/25] hw/i386/Makefile.objs: Build pc_piix* and pc_q35 boards Yang Zhong
@ 2019-01-03 14:30   ` Thomas Huth
  0 siblings, 0 replies; 70+ messages in thread
From: Thomas Huth @ 2019-01-03 14:30 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel
  Cc: pbonzini, sameo, ehabkost, peter.maydell, Ákos Kovács,
	Michael S. Tsirkin, Marcel Apfelbaum

On 2018-12-27 07:33, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> CONFIG_PIIX and CONFIG_Q35 created for the pc board object files. These
> are enabled automatically at default-configs/i386-softmmu.mak and
> default-configs/x86_64-softmmu.mak
> 
> Signed-off-by: Ákos Kovács <akoskovacs@gmx.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  default-configs/i386-softmmu.mak | 2 ++
>  hw/i386/Makefile.objs            | 4 +++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
> index 64c998c4c8..65ef98be18 100644
> --- a/default-configs/i386-softmmu.mak
> +++ b/default-configs/i386-softmmu.mak
> @@ -67,3 +67,5 @@ CONFIG_I2C=y
>  CONFIG_SEV=$(CONFIG_KVM)
>  CONFIG_VTD=y
>  CONFIG_AMD_IOMMU=y
> +CONFIG_I440FX=y
> +CONFIG_Q35=y
> diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
> index fa87a14152..3de7ca2bb9 100644
> --- a/hw/i386/Makefile.objs
> +++ b/hw/i386/Makefile.objs
> @@ -1,6 +1,8 @@
>  obj-$(CONFIG_KVM) += kvm/
>  obj-y += multiboot.o
> -obj-y += pc.o pc_piix.o pc_q35.o
> +obj-y += pc.o
> +obj-$(CONFIG_I440FX) += pc_piix.o
> +obj-$(CONFIG_Q35) += pc_q35.o
>  obj-y += pc_sysfw.o
>  obj-$(CONFIG_VTD) += x86-iommu.o intel_iommu.o
>  obj-$(CONFIG_AMD_IOMMU) += x86-iommu.o amd_iommu.o
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [RFC PATCH 06/25] hw/display: make edid configurable
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 06/25] hw/display: make edid configurable Yang Zhong
@ 2019-01-03 14:49   ` Thomas Huth
  0 siblings, 0 replies; 70+ messages in thread
From: Thomas Huth @ 2019-01-03 14:49 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel
  Cc: peter.maydell, sameo, pbonzini, ehabkost, Gerd Hoffmann

On 2018-12-27 07:34, Yang Zhong wrote:
> Use CONFIG_EDID to make edid-generate.c and edid-region.c
> configurable.
> 
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  default-configs/pci.mak  | 1 +
>  hw/display/Makefile.objs | 4 +---
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/default-configs/pci.mak b/default-configs/pci.mak
> index 6c7be12779..171bdf48bc 100644
> --- a/default-configs/pci.mak
> +++ b/default-configs/pci.mak
> @@ -47,3 +47,4 @@ CONFIG_VGA_PCI=y
>  CONFIG_BOCHS_DISPLAY=y
>  CONFIG_IVSHMEM_DEVICE=$(CONFIG_IVSHMEM)
>  CONFIG_ROCKER=y
> +CONFIG_EDID=y
> diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
> index 97acd5b6cb..a8e23c8501 100644
> --- a/hw/display/Makefile.objs
> +++ b/hw/display/Makefile.objs
> @@ -1,4 +1,4 @@
> -common-obj-y += edid-generate.o
> +common-obj-$(CONFIG_EDID) += edid-generate.o edid-region.o
>  
>  common-obj-$(CONFIG_FW_CFG_DMA) += ramfb.o
>  common-obj-$(CONFIG_FW_CFG_DMA) += ramfb-standalone.o
> @@ -15,12 +15,10 @@ common-obj-$(CONFIG_SSD0323) += ssd0323.o
>  common-obj-$(CONFIG_XEN) += xenfb.o
>  
>  common-obj-$(CONFIG_VGA_PCI) += vga-pci.o
> -common-obj-$(CONFIG_VGA_PCI) += edid-region.o
>  common-obj-$(CONFIG_VGA_ISA) += vga-isa.o
>  common-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
>  common-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
>  common-obj-$(CONFIG_BOCHS_DISPLAY) += bochs-display.o
> -common-obj-$(CONFIG_BOCHS_DISPLAY) += edid-region.o
>  
>  common-obj-$(CONFIG_BLIZZARD) += blizzard.o
>  common-obj-$(CONFIG_EXYNOS4) += exynos4210_fimd.o

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [RFC PATCH 07/25] kconfig: introduce kconfig files
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 07/25] kconfig: introduce kconfig files Yang Zhong
@ 2019-01-03 15:04   ` Thomas Huth
  0 siblings, 0 replies; 70+ messages in thread
From: Thomas Huth @ 2019-01-03 15:04 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> The Kconfig files were generated mostly with this script:
> 
>   for i in `grep -ho CONFIG_[A-Z0-9_]* default-configs/* | sort -u`; do
>     set fnord `git grep -lw $i -- 'hw/*/Makefile.objs' `
>     shift
>     if test $# = 1; then
>       cat >> $(dirname $1)/Kconfig << EOF
> config ${i#CONFIG_}
>     bool
> 
> EOF
>       git add $(dirname $1)/Kconfig
>     else
>       echo $i $*
>     fi
>   done
>   sed -i '$d' hw/*/Kconfig
>   for i in hw/*; do
>     if test -d $i && ! test -f $i/Kconfig; then
>       touch $i/Kconfig
>       git add $i/Kconfig
>     fi
>   done
> 
> Whenever a symbol is referenced from multiple subdirectories, the
> script prints the list of directories that reference the symbol.
> These symbols have to be added manually to the Kconfig files.
> 
> Kconfig.host and hw/Kconfig were created manually.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---

Looks sane to me at a first glance... FWIW:
Acked-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [RFC PATCH 09/25] ide: express dependencies with Kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 09/25] ide: express dependencies with Kconfig Yang Zhong
@ 2019-01-03 15:47   ` Thomas Huth
  2019-01-08  5:22     ` Yang Zhong
  0 siblings, 1 reply; 70+ messages in thread
From: Thomas Huth @ 2019-01-03 15:47 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: peter.maydell, sameo, pbonzini, ehabkost

On 2018-12-27 07:34, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
[...]
> diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig
> index 5ec449525f..091f3a81c9 100644
> --- a/hw/ide/Kconfig
> +++ b/hw/ide/Kconfig
> @@ -3,33 +3,44 @@ config IDE_CORE
>  
>  config IDE_QDEV
>      bool
> +    select IDE_CORE
>  
>  config IDE_PCI
>      bool
> +    select IDE_CORE
>  
>  config IDE_ISA
>      bool
> +    select IDE_QDEV
>  
>  config IDE_PIIX
>      bool
> +    select IDE_QDEV
>  
>  config IDE_CMD646
>      bool
> +    select IDE_QDEV

PIIX and CMD646 seem to be derived from TYPE_PCI_IDE, so shouldn't these
switches rather select IDE_PCI instead? (Or depend on IDE_PCI?)

>  config IDE_MACIO
>      bool
> +    select IDE_QDEV
>  
>  config IDE_MMIO
>      bool
> +    select IDE_QDEV
>  
>  config IDE_VIA
>      bool
> +    select IDE_QDEV

dito, VIA is a PCI device, too.

>  config MICRODRIVE
>      bool
> +    select IDE_QDEV
>  
>  config AHCI
>      bool
> +    select IDE_QDEV
>  
>  config IDE_SII3112
>      bool
> +    select IDE_QDEV
> 

dito, SII3112 is a PCI device.

 Thomas

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

* Re: [Qemu-devel] [RFC PATCH 10/25] build: convert pci.mak to Kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 10/25] build: convert pci.mak to Kconfig Yang Zhong
@ 2019-01-03 16:06   ` Thomas Huth
  2019-01-08  5:58     ` Yang Zhong
  2019-01-04 13:48   ` Thomas Huth
  1 sibling, 1 reply; 70+ messages in thread
From: Thomas Huth @ 2019-01-03 16:06 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> Instead of including the same list of devices for each target,
> set CONFIG_PCI to true, and make the devices default to present
> whenever PCI is available.
> 
> Done mostly with the following script:
> 
>   while read i; do
>      i=${i%=y}; i=${i#CONFIG_}
>      sed -i -e'/^config '$i'$/!b' -en \
>             -e'a\' -e'    default y\' -e'    depends on PCI' \
>           `grep -lw $i hw/*/Kconfig`
>   done < default-configs/pci.mak
> 
> followed by replacing a few "depends on" clauses with "select"
> whenever the symbol is not really related to PCI.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  default-configs/i386-softmmu.mak |  2 +-
>  default-configs/pci.mak          | 47 --------------------------------
>  hw/audio/Kconfig                 |  6 ++++
>  hw/block/Kconfig                 |  2 ++
>  hw/char/Kconfig                  |  2 ++
>  hw/display/Kconfig               | 12 +++++++-
>  hw/ide/Kconfig                   |  6 ++++
>  hw/ipack/Kconfig                 |  2 ++
>  hw/misc/Kconfig                  |  4 +++
>  hw/net/Kconfig                   | 19 +++++++++++++
>  hw/scsi/Kconfig                  | 11 ++++++++
>  hw/sd/Kconfig                    |  3 ++
>  hw/usb/Kconfig                   | 10 +++++++
>  hw/virtio/Kconfig                |  3 ++
>  hw/watchdog/Kconfig              |  2 ++
>  15 files changed, 82 insertions(+), 49 deletions(-)
>  delete mode 100644 default-configs/pci.mak
> 
> diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
> index 560250c998..61f19e5231 100644
> --- a/default-configs/i386-softmmu.mak
> +++ b/default-configs/i386-softmmu.mak
> @@ -1,6 +1,6 @@
>  # Default configuration for i386-softmmu
[...]
> diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig
> index 091f3a81c9..0f25b27163 100644
> --- a/hw/ide/Kconfig
> +++ b/hw/ide/Kconfig
> @@ -7,6 +7,7 @@ config IDE_QDEV
>  
>  config IDE_PCI
>      bool
> +    depends on PCI
>      select IDE_CORE
>  
>  config IDE_ISA
> @@ -15,10 +16,12 @@ config IDE_ISA
>  
>  config IDE_PIIX
>      bool
> +    depends on PCI
>      select IDE_QDEV
>  
>  config IDE_CMD646
>      bool
> +    select IDE_PCI
>      select IDE_QDEV

Why "select" here and not "depends on" like in the previous cases?

>  config IDE_MACIO
> @@ -31,6 +34,7 @@ config IDE_MMIO
>  
>  config IDE_VIA
>      bool
> +    select IDE_PCI
>      select IDE_QDEV

dito

>  config MICRODRIVE
> @@ -39,6 +43,8 @@ config MICRODRIVE
>  
>  config AHCI
>      bool
> +    default y
> +    depends on PCI
>      select IDE_QDEV
>  
>  config IDE_SII3112

I think the SII3112 needs a "depends on PCI", too?

> diff --git a/hw/net/Kconfig b/hw/net/Kconfig
> index 6b2ec971b5..c87375ee52 100644
> --- a/hw/net/Kconfig
> +++ b/hw/net/Kconfig
> @@ -3,27 +3,42 @@ config DP8393X
>  
>  config NE2000_PCI
>      bool
> +    default y
> +    depends on PCI
>  
>  config EEPRO100_PCI
>      bool
> +    default y
> +    depends on PCI
>  
>  config PCNET_PCI
>      bool
> +    default y
> +    depends on PCI
> +    select PCNET_COMMON
>  
>  config PCNET_COMMON
>      bool
>  
>  config E1000_PCI
>      bool
> +    default y
> +    depends on PCI
>  
>  config E1000E_PCI
>      bool
> +    default y
> +    depends on PCI
>  
>  config RTL8139_PCI
>      bool
> +    default y
> +    depends on PCI
>  
>  config VMXNET3_PCI
>      bool
> +    default y
> +    depends on PCI
>  
>  config SMC91C111
>      bool
> @@ -81,12 +96,16 @@ config ETSEC
>  
>  config ROCKER
>      bool
> +    default y
> +    depends on PCI
>  
>  config CAN_BUS
>      bool
>  
>  config CAN_PCI
>      bool
> +    default y
> +    depends on PCI

Do we need a "select CAN_BUS" here? (Well, maybe that's rather something
for a later patch instead...)

 Thomas

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

* Re: [Qemu-devel] [RFC PATCH 11/25] build: convert sound.mak to Kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 11/25] build: convert sound.mak " Yang Zhong
@ 2019-01-04 13:26   ` Thomas Huth
  0 siblings, 0 replies; 70+ messages in thread
From: Thomas Huth @ 2019-01-04 13:26 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> There is really nothing special in these devices; they are just
> ISA devices.  Instead of including them for each target,
> set CONFIG_ISA to true, and make the devices default to present
> whenever ISA is available.  More conversion of ISA devices will
> follow.
> 
> Done with the following script:
> 
>   while read i; do
>      i=${i%=y}; i=${i#CONFIG_}
>      sed -i -e'/^config '$i'$/!b' -en \
>             -e'a\' -e'    default y\' -e'    depends on ISA' \
>           `grep -lw $i hw/*/Kconfig`
>   done < default-configs/sound.mak
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  default-configs/i386-softmmu.mak | 2 +-
>  default-configs/sound.mak        | 4 ----
>  hw/audio/Kconfig                 | 8 ++++++++
>  3 files changed, 9 insertions(+), 5 deletions(-)
>  delete mode 100644 default-configs/sound.mak
> 
> diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
> index 61f19e5231..275e72f3c6 100644
> --- a/default-configs/i386-softmmu.mak
> +++ b/default-configs/i386-softmmu.mak
> @@ -1,7 +1,7 @@
>  # Default configuration for i386-softmmu
>  
>  CONFIG_PCI=y
> -include sound.mak
> +CONFIG_ISA=y
>  include usb.mak
>  include hyperv.mak
>  CONFIG_VGA_ISA=y
> diff --git a/default-configs/sound.mak b/default-configs/sound.mak
> deleted file mode 100644
> index 4f22c34b5d..0000000000
> --- a/default-configs/sound.mak
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -CONFIG_SB16=y
> -CONFIG_ADLIB=y
> -CONFIG_GUS=y
> -CONFIG_CS4231A=y
> diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig
> index af34bbcf0c..bfb30276ec 100644
> --- a/hw/audio/Kconfig
> +++ b/hw/audio/Kconfig
> @@ -1,5 +1,7 @@
>  config SB16
>      bool
> +    default y
> +    depends on ISA_BUS
>  
>  config ES1370
>      bool
> @@ -13,12 +15,18 @@ config AC97
>  
>  config ADLIB
>      bool
> +    default y
> +    depends on ISA_BUS
>  
>  config GUS
>      bool
> +    default y
> +    depends on ISA_BUS
>  
>  config CS4231A
>      bool
> +    default y
> +    depends on ISA_BUS
>  
>  config HDA
>      bool
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [RFC PATCH 12/25] build: convert usb.mak to Kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 12/25] build: convert usb.mak " Yang Zhong
@ 2019-01-04 13:31   ` Thomas Huth
  0 siblings, 0 replies; 70+ messages in thread
From: Thomas Huth @ 2019-01-04 13:31 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> Instead of including the same list of devices for each target,
> let the host controllers select CONFIG_USB and make the devices
> default to present whenever USB is available.
> 
> Done with the following script:
>   while read i; do
>      i=${i%=y}; i=${i#CONFIG_}
>      sed -i -e'/^config '$i'$/!b' -en \
>             -e'a\' -e'    default y\' -e'    depends on USB' \
>           `grep -lw $i hw/*/Kconfig`
>   done < default-configs/usb.mak
> 
> followed by adding "select USB" on the host controllers.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  default-configs/i386-softmmu.mak |  1 -
>  default-configs/usb.mak          | 11 -----------
>  hw/usb/Kconfig                   | 26 ++++++++++++++++++++++++++
>  3 files changed, 26 insertions(+), 12 deletions(-)
>  delete mode 100644 default-configs/usb.mak

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [RFC PATCH 03/25] minikconfig: add parser skeleton
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 03/25] minikconfig: add parser skeleton Yang Zhong
@ 2019-01-04 13:36   ` Paolo Bonzini
  0 siblings, 0 replies; 70+ messages in thread
From: Paolo Bonzini @ 2019-01-04 13:36 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: peter.maydell, thuth, sameo, ehabkost

On 27/12/18 07:33, Yang Zhong wrote:
> +
> +# -------------------------------------------
> +# KconfigParser implements a recursive descent parser for (simplified)
> +# Kconfig syntax.  The static parse() method returns a KconfigData
> +# object, from which it is possible to build a BDD and compute a

s/BDD/DAG/ (BDD-based configuration seemed nifty but didn't work).

Paolo

> +# configuration
> +# -------------------------------------------

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

* Re: [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig Yang Zhong
@ 2019-01-04 13:38   ` Paolo Bonzini
  2019-01-08  7:32     ` Yang Zhong
  2019-01-04 13:39   ` Thomas Huth
  1 sibling, 1 reply; 70+ messages in thread
From: Paolo Bonzini @ 2019-01-04 13:38 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: peter.maydell, thuth, sameo, ehabkost

On 27/12/18 07:34, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> This lets you disable SCSI altogether with "CONFIG_SCSI=n".

USB_STORAGE_BOT and USB_STORAGE_UAS must also select SCSI.

Paolo

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

* Re: [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig Yang Zhong
  2019-01-04 13:38   ` Paolo Bonzini
@ 2019-01-04 13:39   ` Thomas Huth
  2019-01-08  8:04     ` Yang Zhong
  1 sibling, 1 reply; 70+ messages in thread
From: Thomas Huth @ 2019-01-04 13:39 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> This lets you disable SCSI altogether with "CONFIG_SCSI=n".
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  hw/scsi/Kconfig       | 11 ++++++++++-
>  hw/scsi/Makefile.objs |  2 +-
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig
> index 6e7575397f..d669a4824e 100644
> --- a/hw/scsi/Kconfig
> +++ b/hw/scsi/Kconfig
> @@ -5,24 +5,29 @@ config LSI_SCSI_PCI
>      bool
>      default y
>      depends on PCI
> +    select SCSI
>  
>  config MPTSAS_SCSI_PCI
>      bool
>      default y
>      depends on PCI
> +    select SCSI
>  
>  config MEGASAS_SCSI_PCI
>      bool
>      default y
>      depends on PCI
> +    select SCSI
>  
>  config VMW_PVSCSI_SCSI_PCI
>      bool
>      default y
>      depends on PCI
> +    select SCSI
>  
>  config ESP
>      bool
> +    select SCSI
>  
>  config ESP_PCI
>      bool
> @@ -30,11 +35,15 @@ config ESP_PCI
>      depends on PCI
>      select ESP
>  
> -config PSERIES
> +config SPAPR_VSCSI
>      bool
> +    select SCSI

I think this should get "default y" and "depends on PSERIES" now.

 Thomas

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

* Re: [Qemu-devel] [RFC PATCH 14/25] bluetooth: express dependencies with Kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 14/25] bluetooth: " Yang Zhong
@ 2019-01-04 13:41   ` Thomas Huth
  0 siblings, 0 replies; 70+ messages in thread
From: Thomas Huth @ 2019-01-04 13:41 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  hw/Makefile.objs | 2 +-
>  hw/usb/Kconfig   | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/Makefile.objs b/hw/Makefile.objs
> index 39d882af6f..b95b0c74a1 100644
> --- a/hw/Makefile.objs
> +++ b/hw/Makefile.objs
> @@ -3,7 +3,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += acpi/
>  devices-dirs-$(CONFIG_SOFTMMU) += adc/
>  devices-dirs-$(CONFIG_SOFTMMU) += audio/
>  devices-dirs-$(CONFIG_SOFTMMU) += block/
> -devices-dirs-$(CONFIG_SOFTMMU) += bt/
> +devices-dirs-$(CONFIG_BLUETOOTH) += bt/
>  devices-dirs-$(CONFIG_SOFTMMU) += char/
>  devices-dirs-$(CONFIG_SOFTMMU) += cpu/
>  devices-dirs-$(CONFIG_SOFTMMU) += display/
> diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
> index 0b8f41040e..7b7ccfc039 100644
> --- a/hw/usb/Kconfig
> +++ b/hw/usb/Kconfig
> @@ -77,6 +77,7 @@ config USB_BLUETOOTH
>      bool
>      default y
>      depends on USB
> +    select BLUETOOTH
>  
>  config USB_SMARTCARD
>      bool
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [RFC PATCH 10/25] build: convert pci.mak to Kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 10/25] build: convert pci.mak to Kconfig Yang Zhong
  2019-01-03 16:06   ` Thomas Huth
@ 2019-01-04 13:48   ` Thomas Huth
  2019-01-08  7:20     ` Yang Zhong
  1 sibling, 1 reply; 70+ messages in thread
From: Thomas Huth @ 2019-01-04 13:48 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> Instead of including the same list of devices for each target,
> set CONFIG_PCI to true, and make the devices default to present
> whenever PCI is available.
> 
> Done mostly with the following script:
> 
>   while read i; do
>      i=${i%=y}; i=${i#CONFIG_}
>      sed -i -e'/^config '$i'$/!b' -en \
>             -e'a\' -e'    default y\' -e'    depends on PCI' \
>           `grep -lw $i hw/*/Kconfig`
>   done < default-configs/pci.mak
> 
> followed by replacing a few "depends on" clauses with "select"
> whenever the symbol is not really related to PCI.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  default-configs/i386-softmmu.mak |  2 +-
>  default-configs/pci.mak          | 47 --------------------------------
>  hw/audio/Kconfig                 |  6 ++++
>  hw/block/Kconfig                 |  2 ++
>  hw/char/Kconfig                  |  2 ++
>  hw/display/Kconfig               | 12 +++++++-
>  hw/ide/Kconfig                   |  6 ++++
>  hw/ipack/Kconfig                 |  2 ++
>  hw/misc/Kconfig                  |  4 +++
>  hw/net/Kconfig                   | 19 +++++++++++++
>  hw/scsi/Kconfig                  | 11 ++++++++
>  hw/sd/Kconfig                    |  3 ++
>  hw/usb/Kconfig                   | 10 +++++++
>  hw/virtio/Kconfig                |  3 ++
>  hw/watchdog/Kconfig              |  2 ++
>  15 files changed, 82 insertions(+), 49 deletions(-)
>  delete mode 100644 default-configs/pci.mak
[...]
> diff --git a/hw/char/Kconfig b/hw/char/Kconfig
> index 26c13243cf..1ed6f0dbce 100644
> --- a/hw/char/Kconfig
> +++ b/hw/char/Kconfig
> @@ -15,6 +15,8 @@ config SERIAL_ISA
>  
>  config SERIAL_PCI
>      bool
> +    default y
> +    depends on PCI

I think this likely needs a "select SERIAL", too? At least the
SERIAL_ISA switch gets a "select SERIAL" in patch 15/25, so it sounds
logical if the SERIAL_PCI would get this, too...

 Thomas

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

* Re: [Qemu-devel] [RFC PATCH 15/25] isa: express dependencies with kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 15/25] isa: express dependencies with kconfig Yang Zhong
@ 2019-01-04 13:55   ` Thomas Huth
  2019-01-08  9:08     ` Yang Zhong
  0 siblings, 1 reply; 70+ messages in thread
From: Thomas Huth @ 2019-01-04 13:55 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
[...]
> diff --git a/hw/display/Kconfig b/hw/display/Kconfig
> index 5e73277cc2..e0d7919a06 100644
> --- a/hw/display/Kconfig
> +++ b/hw/display/Kconfig
> @@ -9,6 +9,9 @@ config ADS7846
>  
>  config VGA_CIRRUS
>      bool
> +    default y
> +    depends on ISA_BUS && PCI
> +    select VGA

Please note that the cirrus-isa device has recently been split into a
separate file, see commit:

  ce3cf70edaaf1b8f9a566b36011350c642287879
  Move "isa-cirrus-vga" device into a separate file

I guess we need a dedicated VGA_CIRRUS_ISA switch for that file now?

> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
> index 427bda3717..68a9064558 100644
> --- a/hw/i386/Kconfig
> +++ b/hw/i386/Kconfig
> @@ -9,6 +9,7 @@ config I440FX
>  
>  config ISAPC
>      bool
> +    select ISA_BUS
>  
>  config Q35
>      bool

Can Q35 and I440FX work completely without ISA_BUS already, or should
they also select ISA_BUS here?

 Thomas

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

* Re: [Qemu-devel] [RFC PATCH 22/25] i386-softmmu.mak: remove all CONFIG_* except boards definitions
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 22/25] i386-softmmu.mak: remove all CONFIG_* except boards definitions Yang Zhong
@ 2019-01-04 13:59   ` Paolo Bonzini
  2019-01-08 10:53     ` Yang Zhong
  0 siblings, 1 reply; 70+ messages in thread
From: Paolo Bonzini @ 2019-01-04 13:59 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: peter.maydell, thuth, sameo, ehabkost

On 27/12/18 07:34, Yang Zhong wrote:
> %-softmmu.mak only keep boards definitions in Kconfig mode.
> 
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  default-configs/i386-softmmu.mak | 30 ------------------------------
>  hw/i386/Kconfig                  | 30 ++++++++++++++++++++++++++++++
>  hw/ide/Kconfig                   |  2 +-
>  hw/net/Kconfig                   |  2 ++
>  4 files changed, 33 insertions(+), 31 deletions(-)
> 
> diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
> index d3488b5a6d..7b083412af 100644
> --- a/default-configs/i386-softmmu.mak
> +++ b/default-configs/i386-softmmu.mak
> @@ -1,35 +1,5 @@
>  # Default configuration for i386-softmmu
>  
> -CONFIG_VMXNET3_PCI=y
> -CONFIG_IPMI=y
> -CONFIG_IPMI_LOCAL=y
> -CONFIG_IPMI_EXTERN=y
> -CONFIG_ISA_IPMI_KCS=y
> -CONFIG_ISA_IPMI_BT=y
> -
> -# Optional devices:
> -#
> -CONFIG_HPET=y
> -CONFIG_APPLESMC=y
> -CONFIG_PFLASH_CFI01=y
> -CONFIG_ISA_TESTDEV=y
> -CONFIG_VMPORT=y
> -CONFIG_SGA=y
> -CONFIG_PVPANIC=y
> -CONFIG_MEM_DEVICE=y
> -CONFIG_DIMM=y
> -CONFIG_NVDIMM=y
> -CONFIG_ACPI_NVDIMM=y
> -CONFIG_PCIE_PORT=y
> -CONFIG_SMBIOS=y
> -CONFIG_PXB=y
> -CONFIG_ACPI_VMGENID=y
> -CONFIG_FW_CFG_DMA=y
> -CONFIG_I2C=y
> -CONFIG_SEV=$(CONFIG_KVM)
> -CONFIG_VTD=y
> -CONFIG_AMD_IOMMU=y
> -
>  # Boards:
>  #
>  CONFIG_ISAPC=y
> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
> index af4b81bae1..c00080ac76 100644
> --- a/hw/i386/Kconfig
> +++ b/hw/i386/Kconfig
> @@ -1,6 +1,9 @@
>  config KVM
>      bool
>  
> +config SEV
> +    bool

The rest of this patch should not be needed:

>  config PC
>      bool
>      select ISA_DEBUG
> @@ -13,6 +16,29 @@ config PC
>      select TPM_TIS if TPM
>      select HYPERV
>      select HYPERV_TESTDEV
> +    select DIMM
> +    select AMD_IOMMU

This should be selected by Q35 only, in patch 16.

> +    select NVDIMM
> +    select ACPI_NVDIMM
> +    select ACPI_VMGENID

I think these should not be selected

> +    select SMBIOS

Please add this to patch 16 instead.

> +    select IPMI

This should be selected through ISA_IPMI_KCS and ISA_IPMI_BT.

> +    select IPMI_LOCAL
> +    select IPMI_EXTERN

These should be config symbols that depend on IPMI.

> +    select ISA_IPMI_KCS
> +    select ISA_IPMI_BT

These should be config symbols that depend on PC and select IPMI.  The
default should be y.

> +    select PFLASH_CFI01
> +    select I2C

This should be selected automatically via PC_ACPI and ACPI_SMBUS.  No
need to specify it here.

> +    select PVPANIC

This should be a config symbol that has "default y if PC".  No need to
specify it here.

> +    select PXB

This should be "default y if PC", again no need to specify it here.

> +    select VMPORT
> +    select VMMOUSE

These ones are good, but they should be in patch 16.

> +    select SEV if KVM

This one should be "default y if PC && KVM", and not selected here.

> +    select HPET
> +    select APPLESMC
> +    select ISA_TESTDEV
> +    select SGA

These four should be "default y if PC" and not selected here.

> +    select FW_CFG_DMA

And finally this one should be in patch 16.

>  config PC_PCI
>      bool
> @@ -37,6 +63,7 @@ config I440FX
>      select PCI_PIIX
>      select FDC
>      select IDE_PIIX
> +    select VTD

I440FX should not select VTD, like AMD_IOMMU.

>  
>  config ISAPC
>      bool
> @@ -55,6 +82,8 @@ config Q35
>      select PCI_Q35
>      select LPC_ICH9
>      select AHCI
> +    select VTD

This should be in patch 16.

> +    select PCIE_PORT

There should be a "config PCIE" in patch 10, and then

config PCIE_PORT
    depends on PCIE
    default y if PCIE

In patch 10, all of XIO3130, IOH3420 and PCIE_PORT should depend on
PCIE.  PCI_Q35, PCI_XILINX, PCI_GENERIC and PCI_DESIGNWARE should select
PCIE.

>  config VTD
>      bool
> @@ -67,3 +96,4 @@ config VMPORT
>  
>  config VMMOUSE
>      bool
> +    depends on VMPORT

This should be in patch 16.

> diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig
> index 41d3057675..b9ba571c04 100644
> --- a/hw/ide/Kconfig
> +++ b/hw/ide/Kconfig
> @@ -17,7 +17,7 @@ config IDE_ISA
>  
>  config IDE_PIIX
>      bool
> -    depends on PCI
> +    select IDE_PCI

This is correct, but move it to patch 10.

>      select IDE_QDEV
>  
>  config IDE_CMD646
> diff --git a/hw/net/Kconfig b/hw/net/Kconfig
> index 8b65de1d7f..3be0571649 100644
> --- a/hw/net/Kconfig
> +++ b/hw/net/Kconfig
> @@ -108,6 +108,7 @@ config ROCKER
>  
>  config CAN_BUS
>      bool
> +    default y

This should not be default y.

>  config CAN_PCI
>      bool
> @@ -116,3 +117,4 @@ config CAN_PCI
>  
>  config CAN_SJA1000
>      bool
> +    default y

This should select CAN_BUS and, after patch 10, depend on PCI.

Paolo

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

* Re: [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU
  2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
                   ` (24 preceding siblings ...)
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 25/25] Makefile: only support defconfig Yang Zhong
@ 2019-01-04 14:02 ` Paolo Bonzini
  25 siblings, 0 replies; 70+ messages in thread
From: Paolo Bonzini @ 2019-01-04 14:02 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: peter.maydell, thuth, sameo, ehabkost

On 27/12/18 07:33, Yang Zhong wrote:
> (*) defconfig
>     "randconfig" build has some issues, which are mostly related
>     with CONFIG* in Kconfig.host abd configure. In randconfig mode,
>     some CONFIG* has different setting value in config-host.mak and
>     %/config-device.mak, which make QEMU build failure.

I'll look into this once you fix the other issue from the review of this
RFC.  Thanks for updating the patches!

Paolo

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

* Re: [Qemu-devel] [RFC PATCH 04/25] minikconfig: add AST
  2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 04/25] minikconfig: add AST Yang Zhong
@ 2019-01-04 14:13   ` Paolo Bonzini
  2019-01-07 12:06     ` Yang Zhong
  0 siblings, 1 reply; 70+ messages in thread
From: Paolo Bonzini @ 2019-01-04 14:13 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: peter.maydell, thuth, sameo, ehabkost

On 27/12/18 07:33, Yang Zhong wrote:
> +        self.clauses.append(KconfigData.DependsOnClause(var, expr))
>  
>      def do_select(self, var, symbol, cond=None):
> -        pass
> +        cond = (cond & var) if not (cond is None) else var

A better way to write this in Python is

    cond = (cond & var) if cond is not None else var

(My Python has improved since 2015 :)).

Paolo

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

* Re: [Qemu-devel] [RFC PATCH 17/25] i2c: express dependencies with Kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 17/25] i2c: " Yang Zhong
@ 2019-01-04 15:30   ` Thomas Huth
  2019-01-08  9:15     ` Yang Zhong
  0 siblings, 1 reply; 70+ messages in thread
From: Thomas Huth @ 2019-01-04 15:30 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
[...]
> diff --git a/hw/display/Kconfig b/hw/display/Kconfig
> index 8ce968bfff..8ddce09ead 100644
> --- a/hw/display/Kconfig
> +++ b/hw/display/Kconfig
> @@ -24,9 +24,11 @@ config PL110
>  
>  config SII9022
>      bool
> +    depends on I2C
>  
>  config SSD0303
>      bool
> +    depends on I2C
>  
>  config SSD0323
>      bool
> @@ -70,6 +72,7 @@ config MILKYMIST_TMU2
>  
>  config SM501
>      bool
> +    depends on I2C
>  
>  config TCX
>      bool

I think XLNX_ZYNQMP_ARM likely needs "depends on I2C" nowadays, too ?

 Thomas

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

* Re: [Qemu-devel] [RFC PATCH 19/25] edid: express dependencies with kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 19/25] edid: express dependencies with kconfig Yang Zhong
@ 2019-01-04 15:35   ` Thomas Huth
  0 siblings, 0 replies; 70+ messages in thread
From: Thomas Huth @ 2019-01-04 15:35 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  hw/display/Kconfig | 2 ++
>  hw/i2c/Kconfig     | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/hw/display/Kconfig b/hw/display/Kconfig
> index 8ddce09ead..8b8f1027b1 100644
> --- a/hw/display/Kconfig
> +++ b/hw/display/Kconfig
> @@ -38,6 +38,7 @@ config VGA_PCI
>      default y
>      depends on PCI
>      select VGA
> +    select EDID
>  
>  config VGA_ISA
>      bool
> @@ -59,6 +60,7 @@ config BOCHS_DISPLAY
>      default y
>      depends on PCI
>      select VGA
> +    select EDID
>  
>  config BLIZZARD
>      bool
> diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig
> index 74c9328729..ef1caa6d89 100644
> --- a/hw/i2c/Kconfig
> +++ b/hw/i2c/Kconfig
> @@ -8,6 +8,7 @@ config SMBUS_EEPROM
>  config DDC
>      bool
>      depends on I2C
> +    select EDID
>  
>  config VERSATILE_I2C
>      bool
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [RFC PATCH 20/25] hyperv: express dependencies with kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 20/25] hyperv: " Yang Zhong
@ 2019-01-04 15:38   ` Thomas Huth
  2019-01-04 19:50     ` Paolo Bonzini
  2019-01-08 10:35     ` Yang Zhong
  0 siblings, 2 replies; 70+ messages in thread
From: Thomas Huth @ 2019-01-04 15:38 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> remove default-configs/hyperv.mak and make dependencies
> with Kconfig.
> 
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  default-configs/hyperv.mak       | 2 --
>  default-configs/i386-softmmu.mak | 1 -
>  hw/hyperv/Kconfig                | 1 +
>  hw/i386/Kconfig                  | 2 ++
>  4 files changed, 3 insertions(+), 3 deletions(-)
>  delete mode 100644 default-configs/hyperv.mak
> 
> diff --git a/default-configs/hyperv.mak b/default-configs/hyperv.mak
> deleted file mode 100644
> index 5d0d9fd830..0000000000
> --- a/default-configs/hyperv.mak
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -CONFIG_HYPERV=$(CONFIG_KVM)
> -CONFIG_HYPERV_TESTDEV=y
> diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
> index d2e58edd17..eb2d22de3c 100644
> --- a/default-configs/i386-softmmu.mak
> +++ b/default-configs/i386-softmmu.mak
> @@ -1,6 +1,5 @@
>  # Default configuration for i386-softmmu
>  
> -include hyperv.mak
>  CONFIG_VMXNET3_PCI=y
>  CONFIG_VIRTIO_VGA=y
>  CONFIG_IPMI=y
> diff --git a/hw/hyperv/Kconfig b/hw/hyperv/Kconfig
> index be724b7f8b..632c3a675b 100644
> --- a/hw/hyperv/Kconfig
> +++ b/hw/hyperv/Kconfig
> @@ -1,5 +1,6 @@
>  config HYPERV
>      bool
> +    depends on KVM
>  
>  config HYPERV_TESTDEV
>      bool

Should HYPERV_TESTDEV maybe get a "depends on HYPERV", too?

> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
> index 695a67f88d..af4b81bae1 100644
> --- a/hw/i386/Kconfig
> +++ b/hw/i386/Kconfig
> @@ -11,6 +11,8 @@ config PC
>      select I8257
>      select MC146818RTC
>      select TPM_TIS if TPM
> +    select HYPERV
> +    select HYPERV_TESTDEV
>  
>  config PC_PCI
>      bool
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [RFC PATCH 20/25] hyperv: express dependencies with kconfig
  2019-01-04 15:38   ` Thomas Huth
@ 2019-01-04 19:50     ` Paolo Bonzini
  2019-01-08 10:38       ` Yang Zhong
  2019-01-08 10:35     ` Yang Zhong
  1 sibling, 1 reply; 70+ messages in thread
From: Paolo Bonzini @ 2019-01-04 19:50 UTC (permalink / raw)
  To: Thomas Huth, Yang Zhong, qemu-devel; +Cc: peter.maydell, sameo, ehabkost

On 04/01/19 16:38, Thomas Huth wrote:
> On 2018-12-27 07:34, Yang Zhong wrote:
>> remove default-configs/hyperv.mak and make dependencies
>> with Kconfig.
>>
>> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
>> ---
>>  default-configs/hyperv.mak       | 2 --
>>  default-configs/i386-softmmu.mak | 1 -
>>  hw/hyperv/Kconfig                | 1 +
>>  hw/i386/Kconfig                  | 2 ++
>>  4 files changed, 3 insertions(+), 3 deletions(-)
>>  delete mode 100644 default-configs/hyperv.mak
>>
>> diff --git a/default-configs/hyperv.mak b/default-configs/hyperv.mak
>> deleted file mode 100644
>> index 5d0d9fd830..0000000000
>> --- a/default-configs/hyperv.mak
>> +++ /dev/null
>> @@ -1,2 +0,0 @@
>> -CONFIG_HYPERV=$(CONFIG_KVM)
>> -CONFIG_HYPERV_TESTDEV=y
>> diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
>> index d2e58edd17..eb2d22de3c 100644
>> --- a/default-configs/i386-softmmu.mak
>> +++ b/default-configs/i386-softmmu.mak
>> @@ -1,6 +1,5 @@
>>  # Default configuration for i386-softmmu
>>  
>> -include hyperv.mak
>>  CONFIG_VMXNET3_PCI=y
>>  CONFIG_VIRTIO_VGA=y
>>  CONFIG_IPMI=y
>> diff --git a/hw/hyperv/Kconfig b/hw/hyperv/Kconfig
>> index be724b7f8b..632c3a675b 100644
>> --- a/hw/hyperv/Kconfig
>> +++ b/hw/hyperv/Kconfig
>> @@ -1,5 +1,6 @@
>>  config HYPERV
>>      bool
>> +    depends on KVM
>>  
>>  config HYPERV_TESTDEV
>>      bool
> 
> Should HYPERV_TESTDEV maybe get a "depends on HYPERV", too?

Yes, and also a "default y if PC".  That makes the "select
HYPERV_TESTDEV" unnecessary below.

Paolo

>> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
>> index 695a67f88d..af4b81bae1 100644
>> --- a/hw/i386/Kconfig
>> +++ b/hw/i386/Kconfig
>> @@ -11,6 +11,8 @@ config PC
>>      select I8257
>>      select MC146818RTC
>>      select TPM_TIS if TPM
>> +    select HYPERV
>> +    select HYPERV_TESTDEV
>>  
>>  config PC_PCI
>>      bool
>>
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 

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

* Re: [Qemu-devel] [RFC PATCH 21/25] virtio: make virtio dependencies with Kconfig
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 21/25] virtio: make virtio dependencies with Kconfig Yang Zhong
@ 2019-01-04 19:54   ` Thomas Huth
  2019-01-08 10:45     ` Yang Zhong
  0 siblings, 1 reply; 70+ messages in thread
From: Thomas Huth @ 2019-01-04 19:54 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  default-configs/i386-softmmu.mak |  1 -
>  hw/9pfs/Kconfig                  |  2 ++
>  hw/block/Kconfig                 |  2 ++
>  hw/char/Kconfig                  |  2 ++
>  hw/display/Kconfig               |  5 +++++
>  hw/input/Kconfig                 |  2 ++
>  hw/net/Kconfig                   |  2 ++
>  hw/pci-host/Kconfig              |  2 ++
>  hw/virtio/Kconfig                | 10 +++++++++-
>  9 files changed, 26 insertions(+), 2 deletions(-)

Shouldn't this patch also get rid of default-configs/virtio.mak ?

[...]
> diff --git a/hw/virtio/Kconfig b/hw/virtio/Kconfig
> index aabd6d4d96..9127daed5e 100644
> --- a/hw/virtio/Kconfig
> +++ b/hw/virtio/Kconfig
> @@ -3,18 +3,26 @@ config VIRTIO
>  
>  config VIRTIO_RNG
>      bool
> +    default y
> +    depends on VIRTIO
>  
>  config VIRTIO_PCI
>      bool
>      default y
>      depends on PCI
> -    select VIRTIO
> +    depends on VIRTIO
>  
>  config VIRTIO_MMIO
>      bool
> +    default y
> +    depends on VIRTIO

I don't think we should enable VIRTIO_MMIO by default - it's only used
on arm and riscv, but not on x86 and the other architectures.

>  config VIRTIO_BALLOON
>      bool
> +    default y
> +    depends on VIRTIO
>  
>  config VIRTIO_CRYPTO
>      bool
> +    default y
> +    depends on VIRTIO
> 

 Thomas

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

* Re: [Qemu-devel] [RFC PATCH 23/25] x86_64-softmmu.mak: remove i386-softmmu.mak include
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 23/25] x86_64-softmmu.mak: remove i386-softmmu.mak include Yang Zhong
@ 2019-01-04 19:58   ` Thomas Huth
  2019-01-08 10:55     ` Yang Zhong
  2019-01-05 15:32   ` Peter Maydell
  1 sibling, 1 reply; 70+ messages in thread
From: Thomas Huth @ 2019-01-04 19:58 UTC (permalink / raw)
  To: Yang Zhong, qemu-devel; +Cc: pbonzini, sameo, ehabkost, peter.maydell

On 2018-12-27 07:34, Yang Zhong wrote:
> Only keep same boards definitions as i386-softmmu.mak in
> x86_64-softmmu.mak.
> 
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  default-configs/x86_64-softmmu.mak | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
> index 64b2ee2960..0c69c2930c 100644
> --- a/default-configs/x86_64-softmmu.mak
> +++ b/default-configs/x86_64-softmmu.mak
> @@ -1,3 +1,7 @@
>  # Default configuration for x86_64-softmmu
>  
> -include i386-softmmu.mak
> +# Boards:
> +#
> +CONFIG_ISAPC=y
> +CONFIG_I440FX=y
> +CONFIG_Q35=y

Not sure whether this patch is really necessary since the two configs
are currently really the same. Anyway, in case you want to keep the patch:

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [RFC PATCH 23/25] x86_64-softmmu.mak: remove i386-softmmu.mak include
  2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 23/25] x86_64-softmmu.mak: remove i386-softmmu.mak include Yang Zhong
  2019-01-04 19:58   ` Thomas Huth
@ 2019-01-05 15:32   ` Peter Maydell
  2019-01-08 10:58     ` Yang Zhong
  1 sibling, 1 reply; 70+ messages in thread
From: Peter Maydell @ 2019-01-05 15:32 UTC (permalink / raw)
  To: Yang Zhong
  Cc: QEMU Developers, Paolo Bonzini, Samuel Ortiz, Eduardo Habkost,
	Thomas Huth

On Thu, 27 Dec 2018 at 06:35, Yang Zhong <yang.zhong@intel.com> wrote:
>
> Only keep same boards definitions as i386-softmmu.mak in
> x86_64-softmmu.mak.
>
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  default-configs/x86_64-softmmu.mak | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
> index 64b2ee2960..0c69c2930c 100644
> --- a/default-configs/x86_64-softmmu.mak
> +++ b/default-configs/x86_64-softmmu.mak
> @@ -1,3 +1,7 @@
>  # Default configuration for x86_64-softmmu
>
> -include i386-softmmu.mak
> +# Boards:
> +#
> +CONFIG_ISAPC=y
> +CONFIG_I440FX=y
> +CONFIG_Q35=y

Could you explain the rationale for doing this? Now
any new i386 board has to be added in two places,
doesn't it?

thanks
-- PMM

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

* Re: [Qemu-devel] [RFC PATCH 01/25] build: actually use CONFIG_PAM
  2019-01-03 14:15   ` Thomas Huth
@ 2019-01-07 11:29     ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-07 11:29 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, pbonzini, sameo, ehabkost, peter.maydell,
	Daniel P. Berrange, yang.zhong

On Thu, Jan 03, 2019 at 03:15:44PM +0100, Thomas Huth wrote:
>  Hi,
> 
> On 2018-12-27 07:33, Yang Zhong wrote:
> > From: Paolo Bonzini <pbonzini@redhat.com>
> > 
> > Do not link it unconditionally into all binaries.
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> >  hw/pci-host/Makefile.objs | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/pci-host/Makefile.objs b/hw/pci-host/Makefile.objs
> > index 6d6597c065..9d7e7cd1b8 100644
> > --- a/hw/pci-host/Makefile.objs
> > +++ b/hw/pci-host/Makefile.objs
> > @@ -1,4 +1,4 @@
> > -common-obj-y += pam.o
> > +common-obj-$(CONFIG_PAM) += pam.o
> 
> CONFIG_PAM has been removed in the default-configs with commit
> 
>   a3b6e2bb71e6495a44f24e2296ab4feb4b6d4818
>    default-configs: remove CONFIG_PAM
> 
> ... so if you want to use it now, you've got to revert that commit, too.
> 
>  Thomas

   Thanks Thomas for your reminder!
   Since default-configs/x86_64-softmmu.mak has only include i386-softmmu.mak file now,
   It's is hard to directly revert this patch, i will merge CONFIG_PAM=y into i386-softmmu.mak
   with this patch. thanks!

   Regards,

   Yang

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

* Re: [Qemu-devel] [RFC PATCH 04/25] minikconfig: add AST
  2019-01-04 14:13   ` Paolo Bonzini
@ 2019-01-07 12:06     ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-07 12:06 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-devel, peter.maydell, thuth, sameo, ehabkost, yang.zhong

On Fri, Jan 04, 2019 at 03:13:03PM +0100, Paolo Bonzini wrote:
> On 27/12/18 07:33, Yang Zhong wrote:
> > +        self.clauses.append(KconfigData.DependsOnClause(var, expr))
> >  
> >      def do_select(self, var, symbol, cond=None):
> > -        pass
> > +        cond = (cond & var) if not (cond is None) else var
> 
> A better way to write this in Python is
> 
>     cond = (cond & var) if cond is not None else var
> 
> (My Python has improved since 2015 :)).
> 
> Paolo

  Hello Paolo,

  Thanks! i will change this in next version.

  Regards,

  Yang

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

* Re: [Qemu-devel] [RFC PATCH 09/25] ide: express dependencies with Kconfig
  2019-01-03 15:47   ` Thomas Huth
@ 2019-01-08  5:22     ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-08  5:22 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, peter.maydell, sameo, pbonzini, ehabkost, yang.zhong

On Thu, Jan 03, 2019 at 04:47:02PM +0100, Thomas Huth wrote:
> On 2018-12-27 07:34, Yang Zhong wrote:
> > From: Paolo Bonzini <pbonzini@redhat.com>
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> [...]
> > diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig
> > index 5ec449525f..091f3a81c9 100644
> > --- a/hw/ide/Kconfig
> > +++ b/hw/ide/Kconfig
> > @@ -3,33 +3,44 @@ config IDE_CORE
> >  
> >  config IDE_QDEV
> >      bool
> > +    select IDE_CORE
> >  
> >  config IDE_PCI
> >      bool
> > +    select IDE_CORE
> >  
> >  config IDE_ISA
> >      bool
> > +    select IDE_QDEV
> >  
> >  config IDE_PIIX
> >      bool
> > +    select IDE_QDEV
> >  
> >  config IDE_CMD646
> >      bool
> > +    select IDE_QDEV
> 
> PIIX and CMD646 seem to be derived from TYPE_PCI_IDE, so shouldn't these
> switches rather select IDE_PCI instead? (Or depend on IDE_PCI?)
> 
  Hello Thomas,

  Thanks, you are right. The CONFIG_IDE_PCI=y was removed in this patch,
  so the "select IDE_PCI" should be added here from next patch(convert 
  pci.mak to Kconfig patch). thanks!

  Regards,

  Yang  


> >  config IDE_MACIO
> >      bool
> > +    select IDE_QDEV
> >  
> >  config IDE_MMIO
> >      bool
> > +    select IDE_QDEV
> >  
> >  config IDE_VIA
> >      bool
> > +    select IDE_QDEV
> 
> dito, VIA is a PCI device, too.
> 
  Yes, you are right, i will change this like above. thanks!

  Regards,

  Yang

> >  config MICRODRIVE
> >      bool
> > +    select IDE_QDEV
> >  
> >  config AHCI
> >      bool
> > +    select IDE_QDEV
> >  
> >  config IDE_SII3112
> >      bool
> > +    select IDE_QDEV
> > 
> 
> dito, SII3112 is a PCI device.
> 
>  Thomas

  Yes, thanks for reminder!
  I will add "depends on PCI" in next patches(convert pci.mak to 
  Kconfig patch), thanks

  Regards,

  Yang

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

* Re: [Qemu-devel] [RFC PATCH 10/25] build: convert pci.mak to Kconfig
  2019-01-03 16:06   ` Thomas Huth
@ 2019-01-08  5:58     ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-08  5:58 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, peter.maydell, sameo, pbonzini, ehabkost, yang.zhong

On Thu, Jan 03, 2019 at 05:06:32PM +0100, Thomas Huth wrote:
> On 2018-12-27 07:34, Yang Zhong wrote:
> > From: Paolo Bonzini <pbonzini@redhat.com>
> > 
> > Instead of including the same list of devices for each target,
> > set CONFIG_PCI to true, and make the devices default to present
> > whenever PCI is available.
> > 
> > Done mostly with the following script:
> > 
> >   while read i; do
> >      i=${i%=y}; i=${i#CONFIG_}
> >      sed -i -e'/^config '$i'$/!b' -en \
> >             -e'a\' -e'    default y\' -e'    depends on PCI' \
> >           `grep -lw $i hw/*/Kconfig`
> >   done < default-configs/pci.mak
> > 
> > followed by replacing a few "depends on" clauses with "select"
> > whenever the symbol is not really related to PCI.
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> > ---
> >  default-configs/i386-softmmu.mak |  2 +-
> >  default-configs/pci.mak          | 47 --------------------------------
> >  hw/audio/Kconfig                 |  6 ++++
> >  hw/block/Kconfig                 |  2 ++
> >  hw/char/Kconfig                  |  2 ++
> >  hw/display/Kconfig               | 12 +++++++-
> >  hw/ide/Kconfig                   |  6 ++++
> >  hw/ipack/Kconfig                 |  2 ++
> >  hw/misc/Kconfig                  |  4 +++
> >  hw/net/Kconfig                   | 19 +++++++++++++
> >  hw/scsi/Kconfig                  | 11 ++++++++
> >  hw/sd/Kconfig                    |  3 ++
> >  hw/usb/Kconfig                   | 10 +++++++
> >  hw/virtio/Kconfig                |  3 ++
> >  hw/watchdog/Kconfig              |  2 ++
> >  15 files changed, 82 insertions(+), 49 deletions(-)
> >  delete mode 100644 default-configs/pci.mak
> > 
> > diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
> > index 560250c998..61f19e5231 100644
> > --- a/default-configs/i386-softmmu.mak
> > +++ b/default-configs/i386-softmmu.mak
> > @@ -1,6 +1,6 @@
> >  # Default configuration for i386-softmmu
> [...]
> > diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig
> > index 091f3a81c9..0f25b27163 100644
> > --- a/hw/ide/Kconfig
> > +++ b/hw/ide/Kconfig
> > @@ -7,6 +7,7 @@ config IDE_QDEV
> >  
> >  config IDE_PCI
> >      bool
> > +    depends on PCI
> >      select IDE_CORE
> >  
> >  config IDE_ISA
> > @@ -15,10 +16,12 @@ config IDE_ISA
> >  
> >  config IDE_PIIX
> >      bool
> > +    depends on PCI
> >      select IDE_QDEV
> >  
> >  config IDE_CMD646
> >      bool
> > +    select IDE_PCI
> >      select IDE_QDEV
> 
> Why "select" here and not "depends on" like in the previous cases?
> 
  Thomas, thanks for reviewing, i will remove "select IDE_PCI" to previous
  patch(ide patch), IDE_PIIX should also "select IDE_PCI" here, thanks!

  Regards,

  Yang
 
> >  config IDE_MACIO
> > @@ -31,6 +34,7 @@ config IDE_MMIO
> >  
> >  config IDE_VIA
> >      bool
> > +    select IDE_PCI
> >      select IDE_QDEV
> 
> dito
> 
  Yes, same as above, thanks for reminder!


> >  config MICRODRIVE
> > @@ -39,6 +43,8 @@ config MICRODRIVE
> >  
> >  config AHCI
> >      bool
> > +    default y
> > +    depends on PCI
> >      select IDE_QDEV
> >  
> >  config IDE_SII3112
> 
> I think the SII3112 needs a "depends on PCI", too?
> 
  Yes, i need add "depends on PCI" here, thanks!

  Regards,

  Yang

> > diff --git a/hw/net/Kconfig b/hw/net/Kconfig
> > index 6b2ec971b5..c87375ee52 100644
> > --- a/hw/net/Kconfig
> > +++ b/hw/net/Kconfig
> > @@ -3,27 +3,42 @@ config DP8393X
> >  
> >  config NE2000_PCI
> >      bool
> > +    default y
> > +    depends on PCI
> >  
> >  config EEPRO100_PCI
> >      bool
> > +    default y
> > +    depends on PCI
> >  
> >  config PCNET_PCI
> >      bool
> > +    default y
> > +    depends on PCI
> > +    select PCNET_COMMON
> >  
> >  config PCNET_COMMON
> >      bool
> >  
> >  config E1000_PCI
> >      bool
> > +    default y
> > +    depends on PCI
> >  
> >  config E1000E_PCI
> >      bool
> > +    default y
> > +    depends on PCI
> >  
> >  config RTL8139_PCI
> >      bool
> > +    default y
> > +    depends on PCI
> >  
> >  config VMXNET3_PCI
> >      bool
> > +    default y
> > +    depends on PCI
> >  
> >  config SMC91C111
> >      bool
> > @@ -81,12 +96,16 @@ config ETSEC
> >  
> >  config ROCKER
> >      bool
> > +    default y
> > +    depends on PCI
> >  
> >  config CAN_BUS
> >      bool
> >  
> >  config CAN_PCI
> >      bool
> > +    default y
> > +    depends on PCI
> 
> Do we need a "select CAN_BUS" here? (Well, maybe that's rather something
> for a later patch instead...)
> 
>  Thomas

  Hello Thomas,

  Yes, right. All those code are based on can bus, which are implemented 
  in net/can. CAN_PCI and CAN_SJA1000 will select CAN_BUS, thanks!

  Regards,

  Yang

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

* Re: [Qemu-devel] [RFC PATCH 10/25] build: convert pci.mak to Kconfig
  2019-01-04 13:48   ` Thomas Huth
@ 2019-01-08  7:20     ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-08  7:20 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, eter.maydell, sameo, pbonzini, ehabkost, yang.zhong

On Fri, Jan 04, 2019 at 02:48:03PM +0100, Thomas Huth wrote:
> On 2018-12-27 07:34, Yang Zhong wrote:
> > From: Paolo Bonzini <pbonzini@redhat.com>
> > 
> > Instead of including the same list of devices for each target,
> > set CONFIG_PCI to true, and make the devices default to present
> > whenever PCI is available.
> > 
> > Done mostly with the following script:
> > 
> >   while read i; do
> >      i=${i%=y}; i=${i#CONFIG_}
> >      sed -i -e'/^config '$i'$/!b' -en \
> >             -e'a\' -e'    default y\' -e'    depends on PCI' \
> >           `grep -lw $i hw/*/Kconfig`
> >   done < default-configs/pci.mak
> > 
> > followed by replacing a few "depends on" clauses with "select"
> > whenever the symbol is not really related to PCI.
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> > ---
> >  default-configs/i386-softmmu.mak |  2 +-
> >  default-configs/pci.mak          | 47 --------------------------------
> >  hw/audio/Kconfig                 |  6 ++++
> >  hw/block/Kconfig                 |  2 ++
> >  hw/char/Kconfig                  |  2 ++
> >  hw/display/Kconfig               | 12 +++++++-
> >  hw/ide/Kconfig                   |  6 ++++
> >  hw/ipack/Kconfig                 |  2 ++
> >  hw/misc/Kconfig                  |  4 +++
> >  hw/net/Kconfig                   | 19 +++++++++++++
> >  hw/scsi/Kconfig                  | 11 ++++++++
> >  hw/sd/Kconfig                    |  3 ++
> >  hw/usb/Kconfig                   | 10 +++++++
> >  hw/virtio/Kconfig                |  3 ++
> >  hw/watchdog/Kconfig              |  2 ++
> >  15 files changed, 82 insertions(+), 49 deletions(-)
> >  delete mode 100644 default-configs/pci.mak
> [...]
> > diff --git a/hw/char/Kconfig b/hw/char/Kconfig
> > index 26c13243cf..1ed6f0dbce 100644
> > --- a/hw/char/Kconfig
> > +++ b/hw/char/Kconfig
> > @@ -15,6 +15,8 @@ config SERIAL_ISA
> >  
> >  config SERIAL_PCI
> >      bool
> > +    default y
> > +    depends on PCI
> 
> I think this likely needs a "select SERIAL", too? At least the
> SERIAL_ISA switch gets a "select SERIAL" in patch 15/25, so it sounds
> logical if the SERIAL_PCI would get this, too...
> 
>  Thomas

  Thomas, thanks, i will add "select SERIAL" into 15/25 patch, thanks again!

  Regards,

  Yang

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

* Re: [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig
  2019-01-04 13:38   ` Paolo Bonzini
@ 2019-01-08  7:32     ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-08  7:32 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-devel, peter.maydell, sameo, ehabkost, Thomas Huth, yang.zhong

On Fri, Jan 04, 2019 at 02:38:23PM +0100, Paolo Bonzini wrote:
> On 27/12/18 07:34, Yang Zhong wrote:
> > From: Paolo Bonzini <pbonzini@redhat.com>
> > 
> > This lets you disable SCSI altogether with "CONFIG_SCSI=n".
> 
> USB_STORAGE_BOT and USB_STORAGE_UAS must also select SCSI.
> 
> Paolo

  Thanks for Paolo's reminder, i will add this.

  Regards,

  Yang 

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

* Re: [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig
  2019-01-04 13:39   ` Thomas Huth
@ 2019-01-08  8:04     ` Yang Zhong
  2019-01-08 11:42       ` Paolo Bonzini
  0 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2019-01-08  8:04 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, peter.maydell, sameo, pbonzini, ehabkost, yang.zhong

On Fri, Jan 04, 2019 at 02:39:50PM +0100, Thomas Huth wrote:
> On 2018-12-27 07:34, Yang Zhong wrote:
> > From: Paolo Bonzini <pbonzini@redhat.com>
> > 
> > This lets you disable SCSI altogether with "CONFIG_SCSI=n".
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> > ---
> >  hw/scsi/Kconfig       | 11 ++++++++++-
> >  hw/scsi/Makefile.objs |  2 +-
> >  2 files changed, 11 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig
> > index 6e7575397f..d669a4824e 100644
> > --- a/hw/scsi/Kconfig
> > +++ b/hw/scsi/Kconfig
> >  
> > -config PSERIES
> > +config SPAPR_VSCSI
> >      bool
> > +    select SCSI
> 
> I think this should get "default y" and "depends on PSERIES" now.
> 
>  Thomas

   Hello Thomas,

   I greped CONFIG_PSERIES from current Kconfig repo and got below list
  ./hw/net/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_llan.o
  ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr.o spapr_caps.o spapr_vio.o spapr_events.o
  ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_hcall.o spapr_iommu.o spapr_rtas.o
  ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_pci.o spapr_rtc.o spapr_drc.o
  ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_cpu_core.o spapr_ovec.o spapr_irq.o
  ./hw/ppc/Makefile.objs:ifeq ($(CONFIG_PCI)$(CONFIG_PSERIES)$(CONFIG_LINUX), yyy)
  ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_rtas_ddw.o
  ./hw/char/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_vty.o
  ./hw/nvram/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_nvram.o
  ./default-configs/ppc64-softmmu.mak:CONFIG_PSERIES=y
  ./default-configs/ppc64-softmmu.mak:CONFIG_XICS=$(CONFIG_PSERIES)
  ./default-configs/ppc64-softmmu.mak:CONFIG_XICS_SPAPR=$(CONFIG_PSERIES)
  ./default-configs/ppc64-softmmu.mak:CONFIG_XICS_KVM=$(call land,$(CONFIG_PSERIES),$(CONFIG_KVM))

  Since this time is only for x86 and i did not add Kconfig file in hw/ppc/, i did not add 
  this dependency too in here. 
  
  In previous plan, i will add "config PSERRIES" in hw/ppc/Kconfig file for PowerPC pSeries
  and will add dependency in that time, thanks.

  Regards,

  Yang

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

* Re: [Qemu-devel] [RFC PATCH 15/25] isa: express dependencies with kconfig
  2019-01-04 13:55   ` Thomas Huth
@ 2019-01-08  9:08     ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-08  9:08 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, peter.maydell, sameo, pbonzini, ehabkost, yang.zhong

On Fri, Jan 04, 2019 at 02:55:20PM +0100, Thomas Huth wrote:
> On 2018-12-27 07:34, Yang Zhong wrote:
> > From: Paolo Bonzini <pbonzini@redhat.com>
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> > ---
> [...]
> > diff --git a/hw/display/Kconfig b/hw/display/Kconfig
> > index 5e73277cc2..e0d7919a06 100644
> > --- a/hw/display/Kconfig
> > +++ b/hw/display/Kconfig
> > @@ -9,6 +9,9 @@ config ADS7846
> >  
> >  config VGA_CIRRUS
> >      bool
> > +    default y
> > +    depends on ISA_BUS && PCI
> > +    select VGA
> 
> Please note that the cirrus-isa device has recently been split into a
> separate file, see commit:
> 
>   ce3cf70edaaf1b8f9a566b36011350c642287879
>   Move "isa-cirrus-vga" device into a separate file
> 
> I guess we need a dedicated VGA_CIRRUS_ISA switch for that file now?
> 
  Thanks for Thomas's reminder, you are right.

  The cirrus_vga_isa.c depend on "config VGA_CIRRUS" and "config VGA_ISA"
  common-obj-$(call land,$(CONFIG_VGA_CIRRUS),$(CONFIG_VGA_ISA))+=cirrus_vga_isa.o

  Those have been defined in this hw/display/Kconfig:

  config VGA_CIRRUS
    bool
    default y
    depends on ISA_BUS && PCI
    select VGA

  config VGA_ISA
    bool
    depends on ISA_BUS
    select VGA

  Since isa has been splited out from cirrus_vga.c file 
  common-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o

  The new "config VGA_CIRRUS" will remove ISA_BUS, like below:
   config VGA_CIRRUS
    bool
    default y
    depends on PCI
    select VGA

   Regards,

   Yang

> > diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
> > index 427bda3717..68a9064558 100644
> > --- a/hw/i386/Kconfig
> > +++ b/hw/i386/Kconfig
> > @@ -9,6 +9,7 @@ config I440FX
> >  
> >  config ISAPC
> >      bool
> > +    select ISA_BUS
> >  
> >  config Q35
> >      bool
> 
> Can Q35 and I440FX work completely without ISA_BUS already, or should
> they also select ISA_BUS here?
>
>  Thomas

  Thanks for comments, and "select ISA_BUS" for i440fx and Q35 are defined
  in hw/isa/Kconfig file of this patch.

   config PIIX4
     bool
+    select ISA_BUS

   config LPC_ICH9
     bool
+    select ISA_BUS
+    select ACPI_X86_ICH

    Regards,

    Yang

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

* Re: [Qemu-devel] [RFC PATCH 17/25] i2c: express dependencies with Kconfig
  2019-01-04 15:30   ` Thomas Huth
@ 2019-01-08  9:15     ` Yang Zhong
  2019-01-08 11:46       ` Paolo Bonzini
  0 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2019-01-08  9:15 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, peter.maydell, sameo, pbonzini, ehabkost, yang.zhong

On Fri, Jan 04, 2019 at 04:30:01PM +0100, Thomas Huth wrote:
> On 2018-12-27 07:34, Yang Zhong wrote:
> > From: Paolo Bonzini <pbonzini@redhat.com>
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> > ---
> [...]
> > diff --git a/hw/display/Kconfig b/hw/display/Kconfig
> > index 8ce968bfff..8ddce09ead 100644
> > --- a/hw/display/Kconfig
> > +++ b/hw/display/Kconfig
> > @@ -24,9 +24,11 @@ config PL110
> >  
> >  config SII9022
> >      bool
> > +    depends on I2C
> >  
> >  config SSD0303
> >      bool
> > +    depends on I2C
> >  
> >  config SSD0323
> >      bool
> > @@ -70,6 +72,7 @@ config MILKYMIST_TMU2
> >  
> >  config SM501
> >      bool
> > +    depends on I2C
> >  
> >  config TCX
> >      bool
> 
> I think XLNX_ZYNQMP_ARM likely needs "depends on I2C" nowadays, too ?
> 
>  Thomas

  Thomas, thanks for comments!
  Since this is pure ARM's config, we will move this "config XLNX_ZYNQMP_ARM" into ./hw/arm/Kconfig.
  otehr platforms will be in next steps. thanks! 

  ./hw/arm/Makefile.objs:obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx-zynqmp.o xlnx-zcu102.o
  ./hw/display/Makefile.objs:obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o
  ./hw/dma/Makefile.objs:obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dpdma.o
  ./hw/dma/Makefile.objs:common-obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx-zdma.o
  ./default-configs/aarch64-softmmu.mak:CONFIG_XLNX_ZYNQMP_ARM=y

  Regards,

  Yang

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

* Re: [Qemu-devel] [RFC PATCH 20/25] hyperv: express dependencies with kconfig
  2019-01-04 15:38   ` Thomas Huth
  2019-01-04 19:50     ` Paolo Bonzini
@ 2019-01-08 10:35     ` Yang Zhong
  1 sibling, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-08 10:35 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, peter.maydell, sameo, pbonzini, ehabkost, yang.zhong

On Fri, Jan 04, 2019 at 04:38:34PM +0100, Thomas Huth wrote:
> On 2018-12-27 07:34, Yang Zhong wrote:
> > remove default-configs/hyperv.mak and make dependencies
> > with Kconfig.
> > 
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> > ---
> >  default-configs/hyperv.mak       | 2 --
> >  default-configs/i386-softmmu.mak | 1 -
> >  hw/hyperv/Kconfig                | 1 +
> >  hw/i386/Kconfig                  | 2 ++
> >  4 files changed, 3 insertions(+), 3 deletions(-)
> >  delete mode 100644 default-configs/hyperv.mak
> >
  [...] 
> > diff --git a/hw/hyperv/Kconfig b/hw/hyperv/Kconfig
> > index be724b7f8b..632c3a675b 100644
> > --- a/hw/hyperv/Kconfig
> > +++ b/hw/hyperv/Kconfig
> > @@ -1,5 +1,6 @@
> >  config HYPERV
> >      bool
> > +    depends on KVM
> >  
> >  config HYPERV_TESTDEV
> >      bool
> 
> Should HYPERV_TESTDEV maybe get a "depends on HYPERV", too?
> 
  Thomas, thanks, i will change it.  
  
  Regards,

  Yang 
 
> > diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
> > index 695a67f88d..af4b81bae1 100644
> > --- a/hw/i386/Kconfig
> > +++ b/hw/i386/Kconfig
> > @@ -11,6 +11,8 @@ config PC
> >      select I8257
> >      select MC146818RTC
> >      select TPM_TIS if TPM
> > +    select HYPERV
> > +    select HYPERV_TESTDEV
> >  
> >  config PC_PCI
> >      bool
> > 
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [RFC PATCH 20/25] hyperv: express dependencies with kconfig
  2019-01-04 19:50     ` Paolo Bonzini
@ 2019-01-08 10:38       ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-08 10:38 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-devel, Thomas Huth, peter.maydell, sameo, ehabkost, yang.zhong

On Fri, Jan 04, 2019 at 08:50:23PM +0100, Paolo Bonzini wrote:
> On 04/01/19 16:38, Thomas Huth wrote:
> > On 2018-12-27 07:34, Yang Zhong wrote:
> >> remove default-configs/hyperv.mak and make dependencies
> >> with Kconfig.
> >>
> >> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> >> ---
> >>  default-configs/hyperv.mak       | 2 --
> >>  default-configs/i386-softmmu.mak | 1 -
> >>  hw/hyperv/Kconfig                | 1 +
> >>  hw/i386/Kconfig                  | 2 ++
> >>  4 files changed, 3 insertions(+), 3 deletions(-)
> >>  delete mode 100644 default-configs/hyperv.mak
> >>
> >> diff --git a/default-configs/hyperv.mak b/default-configs/hyperv.mak
> >> deleted file mode 100644
> >> index 5d0d9fd830..0000000000
> >> --- a/default-configs/hyperv.mak
> >> +++ /dev/null
> >> @@ -1,2 +0,0 @@
> >> -CONFIG_HYPERV=$(CONFIG_KVM)
> >> -CONFIG_HYPERV_TESTDEV=y
> >> diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
> >> index d2e58edd17..eb2d22de3c 100644
> >> --- a/default-configs/i386-softmmu.mak
> >> +++ b/default-configs/i386-softmmu.mak
> >> @@ -1,6 +1,5 @@
> >>  # Default configuration for i386-softmmu
> >>  
> >> -include hyperv.mak
> >>  CONFIG_VMXNET3_PCI=y
> >>  CONFIG_VIRTIO_VGA=y
> >>  CONFIG_IPMI=y
> >> diff --git a/hw/hyperv/Kconfig b/hw/hyperv/Kconfig
> >> index be724b7f8b..632c3a675b 100644
> >> --- a/hw/hyperv/Kconfig
> >> +++ b/hw/hyperv/Kconfig
> >> @@ -1,5 +1,6 @@
> >>  config HYPERV
> >>      bool
> >> +    depends on KVM
> >>  
> >>  config HYPERV_TESTDEV
> >>      bool
> > 
> > Should HYPERV_TESTDEV maybe get a "depends on HYPERV", too?
> 
> Yes, and also a "default y if PC".  That makes the "select
> HYPERV_TESTDEV" unnecessary below.
> 
> Paolo

  Thanks Paolo, i will also add this.

  Regards,

  Yang
> 
> >> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
> >> index 695a67f88d..af4b81bae1 100644
> >> --- a/hw/i386/Kconfig
> >> +++ b/hw/i386/Kconfig
> >> @@ -11,6 +11,8 @@ config PC
> >>      select I8257
> >>      select MC146818RTC
> >>      select TPM_TIS if TPM
> >> +    select HYPERV
> >> +    select HYPERV_TESTDEV
> >>  
> >>  config PC_PCI
> >>      bool
> >>
> > 
> > Reviewed-by: Thomas Huth <thuth@redhat.com>
> > 

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

* Re: [Qemu-devel] [RFC PATCH 21/25] virtio: make virtio dependencies with Kconfig
  2019-01-04 19:54   ` Thomas Huth
@ 2019-01-08 10:45     ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-08 10:45 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, peter.maydell, sameo, pbonzini, ehabkost, yang.zhong

On Fri, Jan 04, 2019 at 08:54:54PM +0100, Thomas Huth wrote:
> On 2018-12-27 07:34, Yang Zhong wrote:
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> > ---
> >  default-configs/i386-softmmu.mak |  1 -
> >  hw/9pfs/Kconfig                  |  2 ++
> >  hw/block/Kconfig                 |  2 ++
> >  hw/char/Kconfig                  |  2 ++
> >  hw/display/Kconfig               |  5 +++++
> >  hw/input/Kconfig                 |  2 ++
> >  hw/net/Kconfig                   |  2 ++
> >  hw/pci-host/Kconfig              |  2 ++
> >  hw/virtio/Kconfig                | 10 +++++++++-
> >  9 files changed, 26 insertions(+), 2 deletions(-)
> 
> Shouldn't this patch also get rid of default-configs/virtio.mak ?
> 
  Thanks for reminder, i omitted this file and should remove it. thanks!

  Regards,

  Yang

> [...]
> > diff --git a/hw/virtio/Kconfig b/hw/virtio/Kconfig
> > index aabd6d4d96..9127daed5e 100644
> > --- a/hw/virtio/Kconfig
> > +++ b/hw/virtio/Kconfig
> > @@ -3,18 +3,26 @@ config VIRTIO
> >  
> >  config VIRTIO_RNG
> >      bool
> > +    default y
> > +    depends on VIRTIO
> >  
> >  config VIRTIO_PCI
> >      bool
> >      default y
> >      depends on PCI
> > -    select VIRTIO
> > +    depends on VIRTIO
> >  
> >  config VIRTIO_MMIO
> >      bool
> > +    default y
> > +    depends on VIRTIO
> 
> I don't think we should enable VIRTIO_MMIO by default - it's only used
> on arm and riscv, but not on x86 and the other architectures.
>
  Yes, the VIRTIO_MMIO is only used in arm and risc arch, i will change
  this. thanks for Thomas's comments

  Regards,

  Yang
 
> >  config VIRTIO_BALLOON
> >      bool
> > +    default y
> > +    depends on VIRTIO
> >  
> >  config VIRTIO_CRYPTO
> >      bool
> > +    default y
> > +    depends on VIRTIO
> > 
> 
>  Thomas

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

* Re: [Qemu-devel] [RFC PATCH 22/25] i386-softmmu.mak: remove all CONFIG_* except boards definitions
  2019-01-04 13:59   ` Paolo Bonzini
@ 2019-01-08 10:53     ` Yang Zhong
  2019-01-08 11:48       ` Paolo Bonzini
  0 siblings, 1 reply; 70+ messages in thread
From: Yang Zhong @ 2019-01-08 10:53 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-devel, Thomas Huth, peter.maydell, sameo, ehabkost, yang.zhong

Hello Paolo,

Thanks for detailed comments, i will change this one by one.
The previous plan put all "selects" into hw/i386/Kconfig file, which
can easily config board if we want to optimize i440fx or q35 platform.

The new solution will spread "selects" into detailed hw/*/Kconfig file.

Regards,

Yang

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

* Re: [Qemu-devel] [RFC PATCH 23/25] x86_64-softmmu.mak: remove i386-softmmu.mak include
  2019-01-04 19:58   ` Thomas Huth
@ 2019-01-08 10:55     ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-08 10:55 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, peter.maydell, sameo, pbonzini, ehabkost, yang.zhong

On Fri, Jan 04, 2019 at 08:58:09PM +0100, Thomas Huth wrote:
> On 2018-12-27 07:34, Yang Zhong wrote:
> > Only keep same boards definitions as i386-softmmu.mak in
> > x86_64-softmmu.mak.
> > 
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> > ---
> >  default-configs/x86_64-softmmu.mak | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
> > index 64b2ee2960..0c69c2930c 100644
> > --- a/default-configs/x86_64-softmmu.mak
> > +++ b/default-configs/x86_64-softmmu.mak
> > @@ -1,3 +1,7 @@
> >  # Default configuration for x86_64-softmmu
> >  
> > -include i386-softmmu.mak
> > +# Boards:
> > +#
> > +CONFIG_ISAPC=y
> > +CONFIG_I440FX=y
> > +CONFIG_Q35=y
> 
> Not sure whether this patch is really necessary since the two configs
> are currently really the same. Anyway, in case you want to keep the patch:
> 
  Thanks for comments, yes, it seems this patch is not useful, i will remove
  this patch in next version.

  Regards,

  Yang 

> Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [RFC PATCH 23/25] x86_64-softmmu.mak: remove i386-softmmu.mak include
  2019-01-05 15:32   ` Peter Maydell
@ 2019-01-08 10:58     ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-08 10:58 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-devel, sameo, pbonzini, ehabkost, Thomas Huth, yang.zhong

On Sat, Jan 05, 2019 at 03:32:13PM +0000, Peter Maydell wrote:
> On Thu, 27 Dec 2018 at 06:35, Yang Zhong <yang.zhong@intel.com> wrote:
> >
> > Only keep same boards definitions as i386-softmmu.mak in
> > x86_64-softmmu.mak.
> >
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> > ---
> >  default-configs/x86_64-softmmu.mak | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
> > index 64b2ee2960..0c69c2930c 100644
> > --- a/default-configs/x86_64-softmmu.mak
> > +++ b/default-configs/x86_64-softmmu.mak
> > @@ -1,3 +1,7 @@
> >  # Default configuration for x86_64-softmmu
> >
> > -include i386-softmmu.mak
> > +# Boards:
> > +#
> > +CONFIG_ISAPC=y
> > +CONFIG_I440FX=y
> > +CONFIG_Q35=y
> 
> Could you explain the rationale for doing this? Now
> any new i386 board has to be added in two places,
> doesn't it?
> 
> thanks
> -- PMM

  Thanks Peter, you are right, i will remove this patch
  in next version, thanks!

  Regards,

  Yang

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

* Re: [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig
  2019-01-08  8:04     ` Yang Zhong
@ 2019-01-08 11:42       ` Paolo Bonzini
  2019-01-11  3:08         ` Yang Zhong
  0 siblings, 1 reply; 70+ messages in thread
From: Paolo Bonzini @ 2019-01-08 11:42 UTC (permalink / raw)
  To: Yang Zhong, Thomas Huth; +Cc: qemu-devel, peter.maydell, sameo, ehabkost

On 08/01/19 09:04, Yang Zhong wrote:
> On Fri, Jan 04, 2019 at 02:39:50PM +0100, Thomas Huth wrote:
>> On 2018-12-27 07:34, Yang Zhong wrote:
>>> From: Paolo Bonzini <pbonzini@redhat.com>
>>>
>>> This lets you disable SCSI altogether with "CONFIG_SCSI=n".
>>>
>>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>>> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
>>> ---
>>>  hw/scsi/Kconfig       | 11 ++++++++++-
>>>  hw/scsi/Makefile.objs |  2 +-
>>>  2 files changed, 11 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig
>>> index 6e7575397f..d669a4824e 100644
>>> --- a/hw/scsi/Kconfig
>>> +++ b/hw/scsi/Kconfig
>>>  
>>> -config PSERIES
>>> +config SPAPR_VSCSI
>>>      bool
>>> +    select SCSI
>>
>> I think this should get "default y" and "depends on PSERIES" now.
>>
>>  Thomas
> 
>    Hello Thomas,
> 
>    I greped CONFIG_PSERIES from current Kconfig repo and got below list
>   ./hw/net/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_llan.o
>   ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr.o spapr_caps.o spapr_vio.o spapr_events.o
>   ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_hcall.o spapr_iommu.o spapr_rtas.o
>   ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_pci.o spapr_rtc.o spapr_drc.o
>   ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_cpu_core.o spapr_ovec.o spapr_irq.o
>   ./hw/ppc/Makefile.objs:ifeq ($(CONFIG_PCI)$(CONFIG_PSERIES)$(CONFIG_LINUX), yyy)
>   ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_rtas_ddw.o
>   ./hw/char/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_vty.o
>   ./hw/nvram/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_nvram.o
>   ./default-configs/ppc64-softmmu.mak:CONFIG_PSERIES=y
>   ./default-configs/ppc64-softmmu.mak:CONFIG_XICS=$(CONFIG_PSERIES)
>   ./default-configs/ppc64-softmmu.mak:CONFIG_XICS_SPAPR=$(CONFIG_PSERIES)
>   ./default-configs/ppc64-softmmu.mak:CONFIG_XICS_KVM=$(call land,$(CONFIG_PSERIES),$(CONFIG_KVM))
> 
>   Since this time is only for x86 and i did not add Kconfig file in hw/ppc/, i did not add 
>   this dependency too in here. 
>   
>   In previous plan, i will add "config PSERRIES" in hw/ppc/Kconfig file for PowerPC pSeries
>   and will add dependency in that time, thanks.

You could skip the conversion to Kconfig of default-configs/, but
already add all "source hw/ARCH/Kconfig" statements to hw/Kconfig and
all "select" statements for buses.  Then, all machine types for example
could start removing CONFIG_SCSI=y and CONFIG_PCI=y, even if you do not
have the machines converted.

Paolo

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

* Re: [Qemu-devel] [RFC PATCH 17/25] i2c: express dependencies with Kconfig
  2019-01-08  9:15     ` Yang Zhong
@ 2019-01-08 11:46       ` Paolo Bonzini
  0 siblings, 0 replies; 70+ messages in thread
From: Paolo Bonzini @ 2019-01-08 11:46 UTC (permalink / raw)
  To: Yang Zhong, Thomas Huth; +Cc: qemu-devel, peter.maydell, sameo, ehabkost

On 08/01/19 10:15, Yang Zhong wrote:
>>  config SM501
>>      bool
>> +    depends on I2C
>>  
>>  config TCX
>>      bool
> I think XLNX_ZYNQMP_ARM likely needs "depends on I2C" nowadays, too ?

CONFIG_DDC should depend on I2C, while CONFIG_AUX should select I2C.

In a second phase, XLNX_ZYNQMP will select DDC.

Paolo

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

* Re: [Qemu-devel] [RFC PATCH 22/25] i386-softmmu.mak: remove all CONFIG_* except boards definitions
  2019-01-08 10:53     ` Yang Zhong
@ 2019-01-08 11:48       ` Paolo Bonzini
  2019-01-11  2:22         ` Yang Zhong
  0 siblings, 1 reply; 70+ messages in thread
From: Paolo Bonzini @ 2019-01-08 11:48 UTC (permalink / raw)
  To: Yang Zhong; +Cc: qemu-devel, Thomas Huth, peter.maydell, sameo, ehabkost

On 08/01/19 11:53, Yang Zhong wrote:
> Thanks for detailed comments, i will change this one by one.
> The previous plan put all "selects" into hw/i386/Kconfig file, which
> can easily config board if we want to optimize i440fx or q35 platform.

The selects are for mandatory devices, so if you remove them the machine
will not start.

If you want to reduce the platform by omitting non-mandatory devices,
you can use default-configs, because non-mandatory devices will be
"default y" (or "default y if PC/PCI/SCSI/I2C"/whatever).

Paolo

> The new solution will spread "selects" into detailed hw/*/Kconfig file.

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

* Re: [Qemu-devel] [RFC PATCH 22/25] i386-softmmu.mak: remove all CONFIG_* except boards definitions
  2019-01-08 11:48       ` Paolo Bonzini
@ 2019-01-11  2:22         ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-11  2:22 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-devel, Thomas Huth, peter.maydell, sameo, ehabkost, yang.zhong

On Tue, Jan 08, 2019 at 12:48:47PM +0100, Paolo Bonzini wrote:
> On 08/01/19 11:53, Yang Zhong wrote:
> > Thanks for detailed comments, i will change this one by one.
> > The previous plan put all "selects" into hw/i386/Kconfig file, which
> > can easily config board if we want to optimize i440fx or q35 platform.
> 
> The selects are for mandatory devices, so if you remove them the machine
> will not start.
> 
> If you want to reduce the platform by omitting non-mandatory devices,
> you can use default-configs, because non-mandatory devices will be
> "default y" (or "default y if PC/PCI/SCSI/I2C"/whatever).
> 
> Paolo
> 
  Thanks Paolo, it's clear now! Yang.

> > The new solution will spread "selects" into detailed hw/*/Kconfig file.

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

* Re: [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig
  2019-01-08 11:42       ` Paolo Bonzini
@ 2019-01-11  3:08         ` Yang Zhong
  0 siblings, 0 replies; 70+ messages in thread
From: Yang Zhong @ 2019-01-11  3:08 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-devel, Thomas Huth, peter.maydell, sameo, ehabkost, yang.zhong

On Tue, Jan 08, 2019 at 12:42:06PM +0100, Paolo Bonzini wrote:
> On 08/01/19 09:04, Yang Zhong wrote:
> > On Fri, Jan 04, 2019 at 02:39:50PM +0100, Thomas Huth wrote:
> >> On 2018-12-27 07:34, Yang Zhong wrote:
> >>> From: Paolo Bonzini <pbonzini@redhat.com>
> >>>
> >>> This lets you disable SCSI altogether with "CONFIG_SCSI=n".
> >>>
> >>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> >>> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> >>> ---
> >>>  hw/scsi/Kconfig       | 11 ++++++++++-
> >>>  hw/scsi/Makefile.objs |  2 +-
> >>>  2 files changed, 11 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig
> >>> index 6e7575397f..d669a4824e 100644
> >>> --- a/hw/scsi/Kconfig
> >>> +++ b/hw/scsi/Kconfig
> >>>  
> >>> -config PSERIES
> >>> +config SPAPR_VSCSI
> >>>      bool
> >>> +    select SCSI
> >>
> >> I think this should get "default y" and "depends on PSERIES" now.
> >>
> >>  Thomas
> > 
> >    Hello Thomas,
> > 
> >    I greped CONFIG_PSERIES from current Kconfig repo and got below list
> >   ./hw/net/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_llan.o
> >   ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr.o spapr_caps.o spapr_vio.o spapr_events.o
> >   ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_hcall.o spapr_iommu.o spapr_rtas.o
> >   ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_pci.o spapr_rtc.o spapr_drc.o
> >   ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_cpu_core.o spapr_ovec.o spapr_irq.o
> >   ./hw/ppc/Makefile.objs:ifeq ($(CONFIG_PCI)$(CONFIG_PSERIES)$(CONFIG_LINUX), yyy)
> >   ./hw/ppc/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_rtas_ddw.o
> >   ./hw/char/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_vty.o
> >   ./hw/nvram/Makefile.objs:obj-$(CONFIG_PSERIES) += spapr_nvram.o
> >   ./default-configs/ppc64-softmmu.mak:CONFIG_PSERIES=y
> >   ./default-configs/ppc64-softmmu.mak:CONFIG_XICS=$(CONFIG_PSERIES)
> >   ./default-configs/ppc64-softmmu.mak:CONFIG_XICS_SPAPR=$(CONFIG_PSERIES)
> >   ./default-configs/ppc64-softmmu.mak:CONFIG_XICS_KVM=$(call land,$(CONFIG_PSERIES),$(CONFIG_KVM))
> > 
> >   Since this time is only for x86 and i did not add Kconfig file in hw/ppc/, i did not add 
> >   this dependency too in here. 
> >   
> >   In previous plan, i will add "config PSERRIES" in hw/ppc/Kconfig file for PowerPC pSeries
> >   and will add dependency in that time, thanks.
> 
> You could skip the conversion to Kconfig of default-configs/, but
> already add all "source hw/ARCH/Kconfig" statements to hw/Kconfig and
> all "select" statements for buses.  Then, all machine types for example
> could start removing CONFIG_SCSI=y and CONFIG_PCI=y, even if you do not
> have the machines converted.
> 
  Hello Paolo,

  Okay, i will add extra patches for other machines and only keep ARCHs 
  dependency for default-configs/*-softmmu.mak in next stage.

  The new patches will include: 
   1) hw/ARCH/Makefile configurable
   2) Add Kconfig into hw/ARCH/
   3) convert bus, like pci, usb in other ARCHs

  Regards,

  Yang

> Paolo

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

end of thread, other threads:[~2019-01-11  3:12 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-27  6:33 [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Yang Zhong
2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 01/25] build: actually use CONFIG_PAM Yang Zhong
2019-01-03 14:15   ` Thomas Huth
2019-01-07 11:29     ` Yang Zhong
2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 02/25] hw/i386/Makefile.objs: Build pc_piix* and pc_q35 boards Yang Zhong
2019-01-03 14:30   ` Thomas Huth
2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 03/25] minikconfig: add parser skeleton Yang Zhong
2019-01-04 13:36   ` Paolo Bonzini
2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 04/25] minikconfig: add AST Yang Zhong
2019-01-04 14:13   ` Paolo Bonzini
2019-01-07 12:06     ` Yang Zhong
2018-12-27  6:33 ` [Qemu-devel] [RFC PATCH 05/25] minikconfig: add semantic analysis Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 06/25] hw/display: make edid configurable Yang Zhong
2019-01-03 14:49   ` Thomas Huth
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 07/25] kconfig: introduce kconfig files Yang Zhong
2019-01-03 15:04   ` Thomas Huth
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 08/25] build: switch to Kconfig Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 09/25] ide: express dependencies with Kconfig Yang Zhong
2019-01-03 15:47   ` Thomas Huth
2019-01-08  5:22     ` Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 10/25] build: convert pci.mak to Kconfig Yang Zhong
2019-01-03 16:06   ` Thomas Huth
2019-01-08  5:58     ` Yang Zhong
2019-01-04 13:48   ` Thomas Huth
2019-01-08  7:20     ` Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 11/25] build: convert sound.mak " Yang Zhong
2019-01-04 13:26   ` Thomas Huth
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 12/25] build: convert usb.mak " Yang Zhong
2019-01-04 13:31   ` Thomas Huth
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 13/25] scsi: express dependencies with Kconfig Yang Zhong
2019-01-04 13:38   ` Paolo Bonzini
2019-01-08  7:32     ` Yang Zhong
2019-01-04 13:39   ` Thomas Huth
2019-01-08  8:04     ` Yang Zhong
2019-01-08 11:42       ` Paolo Bonzini
2019-01-11  3:08         ` Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 14/25] bluetooth: " Yang Zhong
2019-01-04 13:41   ` Thomas Huth
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 15/25] isa: express dependencies with kconfig Yang Zhong
2019-01-04 13:55   ` Thomas Huth
2019-01-08  9:08     ` Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 16/25] i386: express dependencies with Kconfig Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 17/25] i2c: " Yang Zhong
2019-01-04 15:30   ` Thomas Huth
2019-01-08  9:15     ` Yang Zhong
2019-01-08 11:46       ` Paolo Bonzini
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 18/25] ptimer: " Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 19/25] edid: express dependencies with kconfig Yang Zhong
2019-01-04 15:35   ` Thomas Huth
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 20/25] hyperv: " Yang Zhong
2019-01-04 15:38   ` Thomas Huth
2019-01-04 19:50     ` Paolo Bonzini
2019-01-08 10:38       ` Yang Zhong
2019-01-08 10:35     ` Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 21/25] virtio: make virtio dependencies with Kconfig Yang Zhong
2019-01-04 19:54   ` Thomas Huth
2019-01-08 10:45     ` Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 22/25] i386-softmmu.mak: remove all CONFIG_* except boards definitions Yang Zhong
2019-01-04 13:59   ` Paolo Bonzini
2019-01-08 10:53     ` Yang Zhong
2019-01-08 11:48       ` Paolo Bonzini
2019-01-11  2:22         ` Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 23/25] x86_64-softmmu.mak: remove i386-softmmu.mak include Yang Zhong
2019-01-04 19:58   ` Thomas Huth
2019-01-08 10:55     ` Yang Zhong
2019-01-05 15:32   ` Peter Maydell
2019-01-08 10:58     ` Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 24/25] minikconf: implement allyesconfig, allnoconfig, randconfig, defconfig Yang Zhong
2018-12-27  6:34 ` [Qemu-devel] [RFC PATCH 25/25] Makefile: only support defconfig Yang Zhong
2019-01-04 14:02 ` [Qemu-devel] [RFC PATCH 00/25] Support Kconfig in QEMU Paolo Bonzini

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.