Merge remote-tracking branch 'remotes/ehabkost/tags/x86-and-machine-pull-request' into staging

x86 and machine queue, 2017-10-09

Includes x86, QOM, CPU, and option/config parsing patches.

Highlights:
* Deprecation of -nodefconfig option;
* MachineClass::valid_cpu_types field.

# gpg: Signature made Tue 10 Oct 2017 03:31:33 BST
# gpg:                using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-and-machine-pull-request:
  x86: Correct translation of some rdgsbase and wrgsbase encodings
  vl: exit if maxcpus is negative
  qom: update doc comment for type_register[_static]()
  config: qemu_config_parse() return number of config groups
  qemu-options: Deprecate -nodefconfig
  vl: Eliminate defconfig variable
  machine: Add a valid_cpu_types property
  qom/cpu: move cpu_model null check to cpu_class_by_name()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell
2017-10-10 13:25:46 +01:00
24 changed files with 65 additions and 90 deletions
-1
View File
@@ -244,7 +244,6 @@ static int read_config(BDRVBlkdebugState *s, const char *filename,
ret = qemu_config_parse(f, config_groups, filename);
if (ret < 0) {
error_setg(errp, "Could not parse blkdebug config file");
ret = -EINVAL;
goto fail;
}
}
+32
View File
@@ -758,6 +758,38 @@ void machine_run_board_init(MachineState *machine)
if (nb_numa_nodes) {
machine_numa_finish_init(machine);
}
/* If the machine supports the valid_cpu_types check and the user
* specified a CPU with -cpu check here that the user CPU is supported.
*/
if (machine_class->valid_cpu_types && machine->cpu_type) {
ObjectClass *class = object_class_by_name(machine->cpu_type);
int i;
for (i = 0; machine_class->valid_cpu_types[i]; i++) {
if (object_class_dynamic_cast(class,
machine_class->valid_cpu_types[i])) {
/* The user specificed CPU is in the valid field, we are
* good to go.
*/
break;
}
}
if (!machine_class->valid_cpu_types[i]) {
/* The user specified CPU is not valid */
error_report("Invalid CPU type: %s", machine->cpu_type);
error_printf("The valid types are: %s",
machine_class->valid_cpu_types[0]);
for (i = 1; machine_class->valid_cpu_types[i]; i++) {
error_printf(", %s", machine_class->valid_cpu_types[i]);
}
error_printf("\n");
exit(1);
}
}
machine_class->init(machine);
}
+1
View File
@@ -191,6 +191,7 @@ struct MachineClass {
bool has_hotpluggable_cpus;
bool ignore_memory_transaction_failures;
int numa_mem_align_shift;
const char **valid_cpu_types;
void (*numa_auto_assign_ram)(MachineClass *mc, NodeInfo *nodes,
int nb_nodes, ram_addr_t size);
+2 -2
View File
@@ -773,7 +773,7 @@ const char *object_get_typename(const Object *obj);
* @info and all of the strings it points to should exist for the life time
* that the type is registered.
*
* Returns: 0 on failure, the new #Type on success.
* Returns: the new #Type.
*/
Type type_register_static(const TypeInfo *info);
@@ -784,7 +784,7 @@ Type type_register_static(const TypeInfo *info);
* Unlike type_register_static(), this call does not require @info or its
* string members to continue to exist after the call returns.
*
* Returns: 0 on failure, the new #Type on success.
* Returns: the new #Type.
*/
Type type_register(const TypeInfo *info);
+1 -1
View File
@@ -113,7 +113,7 @@ extern int win2k_install_hack;
extern int alt_grab;
extern int ctrl_grab;
extern int smp_cpus;
extern int max_cpus;
extern unsigned int max_cpus;
extern int cursor_hide;
extern int graphic_rotate;
extern int no_quit;
+4
View File
@@ -2496,6 +2496,10 @@ would automatically enable USB support on the machine type.
If using the new syntax, USB support must be explicitly
enabled via the ``-machine usb=on'' argument.
@subsection -nodefconfig (since 2.11.0)
The ``-nodefconfig`` argument is a synonym for ``-no-user-config``.
@section qemu-img command line arguments
@subsection convert -s (since 2.0.0)
+4 -13
View File
@@ -4067,26 +4067,17 @@ Write device configuration to @var{file}. The @var{file} can be either filename
command line and device configuration into file or dash @code{-}) character to print the
output to stdout. This can be later used as input file for @code{-readconfig} option.
ETEXI
DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig,
"-nodefconfig\n"
" do not load default config files at startup\n",
QEMU_ARCH_ALL)
STEXI
@item -nodefconfig
@findex -nodefconfig
Normally QEMU loads configuration files from @var{sysconfdir} and @var{datadir} at startup.
The @code{-nodefconfig} option will prevent QEMU from loading any of those config files.
ETEXI
HXCOMM Deprecated, same as -no-user-config
DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, "", QEMU_ARCH_ALL)
DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
"-no-user-config\n"
" do not load user-provided config files at startup\n",
" do not load default user-provided config files at startup\n",
QEMU_ARCH_ALL)
STEXI
@item -no-user-config
@findex -no-user-config
The @code{-no-user-config} option makes QEMU not load any of the user-provided
config files on @var{sysconfdir}, but won't make it skip the QEMU-provided config
files from @var{datadir}.
config files on @var{sysconfdir}.
ETEXI
DEF("trace", HAS_ARG, QEMU_OPTION_trace,
"-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
+6 -1
View File
@@ -316,7 +316,12 @@ static bool cpu_common_has_work(CPUState *cs)
ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model)
{
CPUClass *cc = CPU_CLASS(object_class_by_name(typename));
CPUClass *cc;
if (!cpu_model) {
return NULL;
}
cc = CPU_CLASS(object_class_by_name(typename));
return cc->class_by_name(cpu_model);
}
+1 -5
View File
@@ -127,14 +127,10 @@ static const AlphaCPUAlias alpha_cpu_aliases[] = {
static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model)
{
ObjectClass *oc = NULL;
ObjectClass *oc;
char *typename;
int i;
if (cpu_model == NULL) {
return NULL;
}
oc = object_class_by_name(cpu_model);
if (oc != NULL && object_class_dynamic_cast(oc, TYPE_ALPHA_CPU) != NULL &&
!object_class_is_abstract(oc)) {
-4
View File
@@ -939,10 +939,6 @@ static ObjectClass *arm_cpu_class_by_name(const char *cpu_model)
char *typename;
char **cpuname;
if (!cpu_model) {
return NULL;
}
cpuname = g_strsplit(cpu_model, ",", 1);
typename = g_strdup_printf(ARM_CPU_TYPE_NAME("%s"), cpuname[0]);
oc = object_class_by_name(typename);
-4
View File
@@ -69,10 +69,6 @@ static ObjectClass *cris_cpu_class_by_name(const char *cpu_model)
ObjectClass *oc;
char *typename;
if (cpu_model == NULL) {
return NULL;
}
#if defined(CONFIG_USER_ONLY)
if (strcasecmp(cpu_model, "any") == 0) {
return object_class_by_name("crisv32-" TYPE_CRIS_CPU);
+2 -2
View File
@@ -8155,9 +8155,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
break;
case 0xc0 ... 0xc7: /* rdfsbase (f3 0f ae /0) */
case 0xc8 ... 0xc8: /* rdgsbase (f3 0f ae /1) */
case 0xc8 ... 0xcf: /* rdgsbase (f3 0f ae /1) */
case 0xd0 ... 0xd7: /* wrfsbase (f3 0f ae /2) */
case 0xd8 ... 0xd8: /* wrgsbase (f3 0f ae /3) */
case 0xd8 ... 0xdf: /* wrgsbase (f3 0f ae /3) */
if (CODE64(s)
&& (prefixes & PREFIX_REPZ)
&& !(prefixes & PREFIX_LOCK)
-4
View File
@@ -246,10 +246,6 @@ static ObjectClass *lm32_cpu_class_by_name(const char *cpu_model)
ObjectClass *oc;
char *typename;
if (cpu_model == NULL) {
return NULL;
}
typename = g_strdup_printf("%s-" TYPE_LM32_CPU, cpu_model);
oc = object_class_by_name(typename);
g_free(typename);
-4
View File
@@ -87,10 +87,6 @@ static ObjectClass *m68k_cpu_class_by_name(const char *cpu_model)
ObjectClass *oc;
char *typename;
if (cpu_model == NULL) {
return NULL;
}
typename = g_strdup_printf("%s-" TYPE_M68K_CPU, cpu_model);
oc = object_class_by_name(typename);
g_free(typename);
-4
View File
@@ -166,10 +166,6 @@ static ObjectClass *mips_cpu_class_by_name(const char *cpu_model)
ObjectClass *oc;
char *typename;
if (cpu_model == NULL) {
return NULL;
}
typename = mips_cpu_type_name(cpu_model);
oc = object_class_by_name(typename);
g_free(typename);
+1 -7
View File
@@ -89,13 +89,7 @@ static void moxie_cpu_initfn(Object *obj)
static ObjectClass *moxie_cpu_class_by_name(const char *cpu_model)
{
ObjectClass *oc;
if (cpu_model == NULL) {
return NULL;
}
oc = object_class_by_name(cpu_model);
ObjectClass *oc = object_class_by_name(cpu_model);
if (oc != NULL && (!object_class_dynamic_cast(oc, TYPE_MOXIE_CPU) ||
object_class_is_abstract(oc))) {
return NULL;
-4
View File
@@ -108,10 +108,6 @@ static ObjectClass *openrisc_cpu_class_by_name(const char *cpu_model)
ObjectClass *oc;
char *typename;
if (cpu_model == NULL) {
return NULL;
}
typename = g_strdup_printf("%s-" TYPE_OPENRISC_CPU, cpu_model);
oc = object_class_by_name(typename);
g_free(typename);
-3
View File
@@ -133,9 +133,6 @@ static ObjectClass *superh_cpu_class_by_name(const char *cpu_model)
ObjectClass *oc;
GSList *list, *item;
if (cpu_model == NULL) {
return NULL;
}
if (strcasecmp(cpu_model, "any") == 0) {
return object_class_by_name(TYPE_SH7750R_CPU);
}
-4
View File
@@ -730,10 +730,6 @@ static ObjectClass *sparc_cpu_class_by_name(const char *cpu_model)
ObjectClass *oc;
char *typename;
if (cpu_model == NULL) {
return NULL;
}
typename = sparc_cpu_type_name(cpu_model);
oc = object_class_by_name(typename);
g_free(typename);
-4
View File
@@ -120,10 +120,6 @@ static ObjectClass *tricore_cpu_class_by_name(const char *cpu_model)
ObjectClass *oc;
char *typename;
if (!cpu_model) {
return NULL;
}
typename = g_strdup_printf("%s-" TYPE_TRICORE_CPU, cpu_model);
oc = object_class_by_name(typename);
g_free(typename);

Some files were not shown because too many files have changed in this diff Show More