From patchwork Fri Mar 13 18:36:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11437609 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7825F1667 for ; Fri, 13 Mar 2020 18:47:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 500F3206E7 for ; Fri, 13 Mar 2020 18:47:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="N3NLwkeL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 500F3206E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpLZ-00033c-G6 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 13 Mar 2020 14:47:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54801) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpC0-0001Bh-Mr for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:37:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCpBz-0004lh-7x for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:37:56 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:43755 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCpBz-0004kP-3j for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:37:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584124674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g6kDoneuZrMhDVCRmujvDk3IfPp3E6PHImkHQw061IY=; b=N3NLwkeLsHolGeQ7T3a6eo35xVaOMqEnSRhIHXXBtV7e0grtkpd6taBiMaL9q6/81M1R3r aTgI4fUeevRetrPB4sVpYEZvQ7JOlrHIm+ALrrW1HCplM90uWRKGl/dpUiTjnvI8HjogJU EuZnqVAYipAROp6hfggn2TKXLQJEWGA= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-348-yTl5njkEMzGBHglAT7wzNg-1; Fri, 13 Mar 2020 14:37:53 -0400 X-MC-Unique: yTl5njkEMzGBHglAT7wzNg-1 Received: by mail-wm1-f71.google.com with SMTP id a11so1368629wmm.9 for ; Fri, 13 Mar 2020 11:37:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iYsZ3FxrwnOLNhhBs5OQJLjNJeFk+YWQzk3XZ1uOqWs=; b=oH3qmI00m3mN3CK6VxRWDBhf2WdcAyIw+zMpP1pcPDDZJ52ybRb1cQJqcVz/SvalCB mWn+FR4dJLC6Ghfzeg39h+GbcNDQSgFf7xY9sbROuiMw0bveUnRd53cbr4weQMHit6o7 +miNvgaDWUD7SA5BHVYi2ob4cotb/sOPmyDwYv5q3RXtrONWf3gQNxN/HtI0gjtdgiPa ShHNUrVd8KpdLeKEg9+qI+kchBUOid03Q/7jESDXzdFbUjVAYLl6YSMIc0spmtPIJJON mdpXQzdDAn4hsV45JDSLD5EqumKFNCNpPeGYalgbNUTciHMsceNPfAx9XXgyJ7KdUU+3 X8QA== X-Gm-Message-State: ANhLgQ2GMGCsZZTwJpPr0mYRYjFGqw1jFLi4gNIejhegUcXMIjYAdcXE uMYqa+TmUxnnc76GDDb1XTaCUIy5h8h0atQ5V1KqFGpzrH3YC7S+gVf1cytsjbP23JdXNYB5sg0 hhWGwllzHR2YEj1w= X-Received: by 2002:a5d:574e:: with SMTP id q14mr18374374wrw.330.1584124671736; Fri, 13 Mar 2020 11:37:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuzB9FhPCxZc8c+0Bt5wwNy9uUOC87j76T5iMKQTrkMJKvPhtuZkOqXgFb/ot1hwBoMX14+LQ== X-Received: by 2002:a5d:574e:: with SMTP id q14mr18374340wrw.330.1584124671486; Fri, 13 Mar 2020 11:37:51 -0700 (PDT) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id g129sm19273217wmg.12.2020.03.13.11.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 11:37:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 11/14] target: Restrict write_elfXX_note() handlers to system-mode Date: Fri, 13 Mar 2020 19:36:49 +0100 Message-Id: <20200313183652.10258-12-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313183652.10258-1-philmd@redhat.com> References: <20200313183652.10258-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-riscv@nongnu.org, Eduardo Habkost , Sagar Karandikar , David Hildenbrand , Bastian Koppelmann , Cornelia Huck , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Alistair Francis , David Gibson , =?utf-8?q?Alex_Benn=C3=A9e?= , Palmer Dabbelt , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu.h | 10 +++++----- target/i386/cpu.h | 18 +++++++++--------- target/ppc/cpu.h | 2 -- target/s390x/internal.h | 3 ++- target/ppc/translate_init.inc.c | 2 -- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 4ffd991b6f..8a22212521 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -958,6 +958,11 @@ void arm_cpu_post_init(Object *obj); uint64_t arm_cpu_mp_affinity(int idx, uint8_t clustersz); #ifndef CONFIG_USER_ONLY +int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, + int cpuid, void *opaque); +int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, + int cpuid, void *opaque); + extern const VMStateDescription vmstate_arm_cpu; #endif @@ -982,11 +987,6 @@ int arm_gen_dynamic_xml(CPUState *cpu); */ const char *arm_gdb_get_dynamic_xml(CPUState *cpu, const char *xmlname); -int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque); -int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque); - #ifdef TARGET_AARCH64 int aarch64_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg); int aarch64_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 576f309bbf..f25fe5fc7c 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1738,6 +1738,15 @@ struct X86CPU { #ifndef CONFIG_USER_ONLY +int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu, + int cpuid, void *opaque); +int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu, + int cpuid, void *opaque); +int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cpu, + void *opaque); +int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu, + void *opaque); + extern VMStateDescription vmstate_x86_cpu; #endif @@ -1749,15 +1758,6 @@ void x86_cpu_do_interrupt(CPUState *cpu); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request); -int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu, - int cpuid, void *opaque); -int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu, - int cpuid, void *opaque); -int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cpu, - void *opaque); -int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu, - void *opaque); - void x86_cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list, Error **errp); diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index b283042515..b9fb76d0b3 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1225,12 +1225,10 @@ int ppc_cpu_gdb_write_register_apple(CPUState *cpu, uint8_t *buf, int reg); #ifndef CONFIG_USER_ONLY void ppc_gdb_gen_spr_xml(PowerPCCPU *cpu); const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name); -#endif int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, void *opaque); int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, void *opaque); -#ifndef CONFIG_USER_ONLY void ppc_cpu_do_system_reset(CPUState *cs); extern const VMStateDescription vmstate_ppc_cpu; #endif diff --git a/target/s390x/internal.h b/target/s390x/internal.h index d37816104d..dcbd8d2065 100644 --- a/target/s390x/internal.h +++ b/target/s390x/internal.h @@ -226,9 +226,10 @@ static inline hwaddr decode_basedisp_s(CPUS390XState *env, uint32_t ipb, #define decode_basedisp_rs decode_basedisp_s /* arch_dump.c */ +#if !defined(CONFIG_USER_ONLY) int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, void *opaque); - +#endif /* cc_helper.c */ const char *cc_name(enum cc_op cc_op); diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index 53995f62ea..768ec18a28 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -10902,8 +10902,6 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = ppc_cpu_get_phys_page_debug; cc->vmsd = &vmstate_ppc_cpu; -#endif -#if defined(CONFIG_SOFTMMU) cc->write_elf64_note = ppc64_cpu_write_elf64_note; cc->write_elf32_note = ppc32_cpu_write_elf32_note; #endif